feat(sys): 获取开通区管理,获取开通区域列表接口
This commit is contained in:
parent
735d060241
commit
8dd0cd6c5a
|
@ -55,5 +55,23 @@
|
|||
<artifactId>mybatis-plus-boot-starter</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-generator</artifactId>
|
||||
<version>3.4.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.velocity</groupId>
|
||||
<artifactId>velocity-engine-core</artifactId>
|
||||
<version>2.0</version>
|
||||
</dependency>
|
||||
|
||||
<!--mysql-->
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
|
|
@ -0,0 +1,60 @@
|
|||
package com.atguigu.ssyx;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.DbType;
|
||||
import com.baomidou.mybatisplus.generator.AutoGenerator;
|
||||
import com.baomidou.mybatisplus.generator.config.DataSourceConfig;
|
||||
import com.baomidou.mybatisplus.generator.config.GlobalConfig;
|
||||
import com.baomidou.mybatisplus.generator.config.PackageConfig;
|
||||
import com.baomidou.mybatisplus.generator.config.StrategyConfig;
|
||||
import com.baomidou.mybatisplus.generator.config.rules.NamingStrategy;
|
||||
|
||||
public class CodeGet {
|
||||
|
||||
public static void main(String[] args) {
|
||||
// 1、创建代码生成器
|
||||
AutoGenerator mpg = new AutoGenerator();
|
||||
|
||||
// 2、全局配置
|
||||
// 全局配置
|
||||
GlobalConfig gc = new GlobalConfig();
|
||||
gc.setOutputDir("F:\\File\\Java\\ssyx\\guigu-ssyx-parent\\service\\service-sys" + "/src/main/java\\com\\atguigu\\ssyx\\sys");
|
||||
|
||||
gc.setServiceName("%sService"); // 去掉Service接口的首字母I
|
||||
gc.setAuthor("atguigu");
|
||||
gc.setOpen(false);
|
||||
mpg.setGlobalConfig(gc);
|
||||
|
||||
// 3、数据源配置
|
||||
DataSourceConfig dsc = new DataSourceConfig();
|
||||
dsc.setUrl("jdbc:mysql://106.15.251.123:3305/shequ-sys?serverTimezone=GMT%2B8&useSSL=false&characterEncoding=utf-8&allowPublicKeyRetrieval=true");
|
||||
dsc.setDriverName("com.mysql.cj.jdbc.Driver");
|
||||
dsc.setUsername("root");
|
||||
dsc.setPassword("02120212");
|
||||
dsc.setDbType(DbType.MYSQL);
|
||||
mpg.setDataSource(dsc);
|
||||
|
||||
// 4、包配置
|
||||
PackageConfig pc = new PackageConfig();
|
||||
pc.setParent("com.atguigu");
|
||||
pc.setModuleName("system"); // 模块名
|
||||
pc.setController("controller");
|
||||
pc.setService("service");
|
||||
pc.setMapper("mapper");
|
||||
mpg.setPackageInfo(pc);
|
||||
|
||||
// 5、策略配置
|
||||
StrategyConfig strategy = new StrategyConfig();
|
||||
|
||||
strategy.setInclude("region", "region_ware", "ware");
|
||||
strategy.setNaming(NamingStrategy.underline_to_camel);// 数据库表映射到实体的命名策略
|
||||
strategy.setColumnNaming(NamingStrategy.underline_to_camel);// 数据库表字段映射到实体的命名策略
|
||||
strategy.setEntityLombokModel(true); // lombok 模型 @Accessors(chain = true) setter链式操作
|
||||
strategy.setRestControllerStyle(true); // restful api风格控制器
|
||||
strategy.setControllerMappingHyphenStyle(true); // url中驼峰转连字符
|
||||
|
||||
mpg.setStrategy(strategy);
|
||||
|
||||
// 6、执行
|
||||
mpg.execute();
|
||||
}
|
||||
}
|
|
@ -6,7 +6,7 @@ import org.springframework.context.annotation.ComponentScan;
|
|||
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
||||
|
||||
@SpringBootApplication
|
||||
@ComponentScan(basePackages = {"com.atguigu.ssyx", "com.atguigu.ssyx.acl"})
|
||||
@ComponentScan(basePackages = {"com.atguigu.ssyx"})
|
||||
@EnableTransactionManagement
|
||||
public class ServiceAclApplication {
|
||||
public static void main(String[] args) {
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
FROM openjdk:17
|
||||
MAINTAINER bunny
|
||||
|
||||
#系统编码
|
||||
ENV LANG=C.UTF-8 LC_ALL=C.UTF-8
|
||||
|
||||
# 设置时区,构建镜像时执行的命令
|
||||
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
|
||||
RUN echo "Asia/Shanghai" > /etc/timezone
|
||||
|
||||
# 设定工作目录
|
||||
WORKDIR /home/bunny
|
||||
|
||||
# 复制jar包
|
||||
COPY target/*.jar /home/bunny/app.jar
|
||||
|
||||
#启动容器时的进程
|
||||
ENTRYPOINT ["java","-jar","/home/bunny/app.jar"]
|
||||
|
||||
#暴露 8080 端口
|
||||
EXPOSE 8080
|
|
@ -18,6 +18,6 @@
|
|||
</properties>
|
||||
|
||||
<dependencies>
|
||||
|
||||
|
||||
</dependencies>
|
||||
</project>
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
package com.atguigu.ssyx.sys;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.transaction.annotation.EnableTransactionManagement;
|
||||
|
||||
@SpringBootApplication
|
||||
@EnableTransactionManagement
|
||||
@ComponentScan(basePackages = {"com.atguigu.ssyx"})
|
||||
public class ServiceSysApplication {
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(ServiceSysApplication.class, args);
|
||||
}
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package com.atguigu.ssyx.common.config;
|
||||
package com.atguigu.ssyx.sys.config;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
@ -19,7 +19,7 @@ import java.util.List;
|
|||
|
||||
@Configuration
|
||||
@EnableSwagger2WebMvc
|
||||
public class WebKnife4jConfig {
|
||||
public class Knife4jConfig {
|
||||
@Bean
|
||||
public Docket webApiConfig() {
|
||||
List<Parameter> pars = new ArrayList<>();
|
||||
|
@ -35,12 +35,12 @@ public class WebKnife4jConfig {
|
|||
pars.add(tokenPar.build());
|
||||
|
||||
return new Docket(DocumentationType.SWAGGER_2)
|
||||
.groupName("webApi")
|
||||
.groupName("区域查询API")
|
||||
.apiInfo(webApiInfo())
|
||||
.select()
|
||||
// 只显示api路径下的页面
|
||||
.apis(RequestHandlerSelectors.basePackage("com.atguigu.ssyx"))
|
||||
.paths(PathSelectors.regex("/api/.*"))
|
||||
.apis(RequestHandlerSelectors.basePackage("com.atguigu.ssyx.sys"))
|
||||
.paths(PathSelectors.regex("/admin/sys/regionWare/.*|/system/.*"))
|
||||
.build()
|
||||
.globalOperationParameters(pars);
|
||||
}
|
|
@ -0,0 +1,43 @@
|
|||
package com.atguigu.ssyx.sys.controller;
|
||||
|
||||
|
||||
import com.atguigu.ssyx.common.result.Result;
|
||||
import com.atguigu.ssyx.model.sys.RegionWare;
|
||||
import com.atguigu.ssyx.sys.service.RegionWareService;
|
||||
import com.atguigu.ssyx.vo.sys.RegionWareQueryVo;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
@Api(value = "获取开通区管理", tags = "获取开通区管理")
|
||||
@RestController
|
||||
@RequestMapping(value = "/admin/sys/regionWare")
|
||||
public class RegionController {
|
||||
@Resource
|
||||
private RegionWareService regionWareService;
|
||||
|
||||
@ApiOperation(value = "获取开通区域列表")
|
||||
@GetMapping("{page}/{limit}")
|
||||
public Result<IPage<RegionWare>> index(
|
||||
@ApiParam(name = "page", value = "当前页码", required = true)
|
||||
@PathVariable Long page,
|
||||
@ApiParam(name = "limit", value = "每页记录数", required = true)
|
||||
@PathVariable Long limit,
|
||||
@ApiParam(name = "regionWareVo", value = "查询对象", required = false)
|
||||
RegionWareQueryVo regionWareQueryVo) {
|
||||
|
||||
Page<RegionWare> pageParam = new Page<>(page, limit);
|
||||
IPage<RegionWare> pageModel = regionWareService.selectPage(pageParam, regionWareQueryVo);
|
||||
|
||||
return Result.success(pageModel);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
package com.atguigu.ssyx.sys.controller;
|
||||
|
||||
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/system/region-ware")
|
||||
public class RegionWareController {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
package com.atguigu.ssyx.sys.controller;
|
||||
|
||||
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 仓库表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author atguigu
|
||||
* @since 2024-04-02
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/ware")
|
||||
public class WareController {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
package com.atguigu.ssyx.sys.mapper;
|
||||
|
||||
import com.atguigu.ssyx.model.sys.Region;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 地区表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author atguigu
|
||||
* @since 2024-04-02
|
||||
*/
|
||||
public interface RegionMapper extends BaseMapper<Region> {
|
||||
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
package com.atguigu.ssyx.sys.mapper;
|
||||
|
||||
import com.atguigu.ssyx.model.sys.RegionWare;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 城市仓库关联表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author atguigu
|
||||
* @since 2024-04-02
|
||||
*/
|
||||
public interface RegionWareMapper extends BaseMapper<RegionWare> {
|
||||
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
package com.atguigu.ssyx.sys.mapper;
|
||||
|
||||
import com.atguigu.ssyx.model.sys.Ware;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 仓库表 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author atguigu
|
||||
* @since 2024-04-02
|
||||
*/
|
||||
public interface WareMapper extends BaseMapper<Ware> {
|
||||
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
package com.atguigu.ssyx.sys.service;
|
||||
|
||||
import com.atguigu.ssyx.model.sys.Region;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 地区表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author atguigu
|
||||
* @since 2024-04-02
|
||||
*/
|
||||
public interface RegionService extends IService<Region> {
|
||||
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
package com.atguigu.ssyx.sys.service;
|
||||
|
||||
import com.atguigu.ssyx.model.sys.RegionWare;
|
||||
import com.atguigu.ssyx.vo.sys.RegionWareQueryVo;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
public interface RegionWareService extends IService<RegionWare> {
|
||||
|
||||
/**
|
||||
* 开通区域列表
|
||||
*/
|
||||
IPage<RegionWare> selectPage(Page<RegionWare> pageParam, RegionWareQueryVo regionWareQueryVo);
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
package com.atguigu.ssyx.sys.service;
|
||||
|
||||
import com.atguigu.ssyx.model.sys.Ware;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 仓库表 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author atguigu
|
||||
* @since 2024-04-02
|
||||
*/
|
||||
public interface WareService extends IService<Ware> {
|
||||
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
package com.atguigu.ssyx.sys.service.impl;
|
||||
|
||||
import com.atguigu.ssyx.model.sys.Region;
|
||||
import com.atguigu.ssyx.sys.mapper.RegionMapper;
|
||||
import com.atguigu.ssyx.sys.service.RegionService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 地区表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author atguigu
|
||||
* @since 2024-04-02
|
||||
*/
|
||||
@Service
|
||||
public class RegionServiceImpl extends ServiceImpl<RegionMapper, Region> implements RegionService {
|
||||
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
package com.atguigu.ssyx.sys.service.impl;
|
||||
|
||||
import com.atguigu.ssyx.model.sys.RegionWare;
|
||||
import com.atguigu.ssyx.sys.mapper.RegionWareMapper;
|
||||
import com.atguigu.ssyx.sys.service.RegionWareService;
|
||||
import com.atguigu.ssyx.vo.sys.RegionWareQueryVo;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
@Service
|
||||
public class RegionWareServiceImpl extends ServiceImpl<RegionWareMapper, RegionWare> implements RegionWareService {
|
||||
|
||||
/**
|
||||
* 开通区域列表
|
||||
*/
|
||||
@Override
|
||||
public IPage<RegionWare> selectPage(Page<RegionWare> pageParam, RegionWareQueryVo regionWareQueryVo) {
|
||||
String keyword = regionWareQueryVo.getKeyword();
|
||||
LambdaQueryWrapper<RegionWare> wrapper = new LambdaQueryWrapper<>();
|
||||
|
||||
// 查询
|
||||
wrapper.like(!StringUtils.isEmpty(keyword), RegionWare::getRegionName, keyword).or().like(!StringUtils.isEmpty(keyword), RegionWare::getWareName, keyword);
|
||||
|
||||
return baseMapper.selectPage(pageParam, wrapper);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
package com.atguigu.ssyx.sys.service.impl;
|
||||
|
||||
import com.atguigu.ssyx.model.sys.Ware;
|
||||
import com.atguigu.ssyx.sys.mapper.WareMapper;
|
||||
import com.atguigu.ssyx.sys.service.WareService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 仓库表 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author atguigu
|
||||
* @since 2024-04-02
|
||||
*/
|
||||
@Service
|
||||
public class WareServiceImpl extends ServiceImpl<WareMapper, Ware> implements WareService {
|
||||
|
||||
}
|
|
@ -1,11 +1,11 @@
|
|||
server:
|
||||
port: 8200
|
||||
port: 8202
|
||||
|
||||
bunny:
|
||||
datasource:
|
||||
host: 106.15.251.123
|
||||
port: 3305
|
||||
sqlData: shequ-acl
|
||||
sqlData: shequ-sys
|
||||
username: root
|
||||
password: "02120212"
|
||||
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
-----------------▄██-█▄---------
|
||||
-----------------███▄██▄--------
|
||||
-----------------███████--------
|
||||
-----------------▀███████-------
|
||||
-------------------██████▄▄-----
|
||||
-------------------█████████▄---
|
||||
-------------------██████▄████--
|
||||
-------▄███████████████████████-
|
||||
-----▄███████████████████████▀--
|
||||
---▄██████████████████████------
|
||||
---███████████████████████------
|
||||
---███████████████████████------
|
||||
-▄▄██████████████████████▀------
|
||||
-█████████████████▀█████--------
|
||||
-▀██████████████▀▀-▀█████▄------
|
||||
-------▀▀▀▀▀▀▀▀▀------▀▀▀▀------
|
Binary file not shown.
After Width: | Height: | Size: 13 KiB |
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.atguigu.ssyx.sys.mapper.RegionMapper">
|
||||
|
||||
</mapper>
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.atguigu.ssyx.sys.mapper.RegionWareMapper">
|
||||
|
||||
</mapper>
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.atguigu.ssyx.sys.mapper.WareMapper">
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue