Compare commits

...

23 Commits

Author SHA1 Message Date
caixiang
5d631e77c2 mark 2022-06-22 10:23:56 +08:00
caixiang
3b7b592a16 Merge branch 'master' of http://git.picaiba.com/why/ym
 Conflicts:
	ym-gateway/pom.xml
2022-06-22 09:14:41 +08:00
caixiang
342f843f2c mark 2022-06-22 09:14:03 +08:00
weihongyang
2bf099ee6d fix: 修改sercurity的UserDetailsService的实现类 2022-06-21 17:01:28 +08:00
weihongyang
62d1a761cc fix: 修改sercurity的config配置 2022-06-21 17:00:45 +08:00
weihongyang
7a4b82a94c fix: 修改全局异常捕获 2022-06-21 17:00:22 +08:00
weihongyang
3f8bb4f607 fix: 修改启动类 2022-06-21 17:00:02 +08:00
weihongyang
7b1365b5cd fix: 修改自动生成代码的存放路径 2022-06-21 15:52:06 +08:00
weihongyang
111473f057 fix: 修改swagger只在开发环境中启用,在生产幻境中关闭 2022-06-21 14:47:27 +08:00
weihongyang
0218a7548a fix: 修改扫码枪监听只在生产环境中启用 2022-06-21 14:46:50 +08:00
weihongyang
3b7e924478 feat: 增加生产yml文件 2022-06-21 14:46:03 +08:00
weihongyang
696e15f436 fix: 修改项目地址 2022-06-21 14:36:11 +08:00
weihongyang
a3802411d9 fix: 修改swagger依赖的bug 2022-06-21 14:35:50 +08:00
weihongyang
b98c015abc fix: 修改sercurity的放行策略 2022-06-21 14:34:34 +08:00
weihongyang
8e06463f12 fix: 修改VelocityTemplate的模板 2022-06-21 13:44:10 +08:00
weihongyang
8ae19c6c0b fix: 修改cors的config文件 2022-06-21 13:41:39 +08:00
weihongyang
22c90cf6bc feat: 新增swagger的config配置 2022-06-21 13:40:59 +08:00
weihongyang
891cc99c54 feat: 新增swagger的maven依赖 2022-06-21 13:40:35 +08:00
weihongyang
990cb5fd0c fix: 修改yml文件的redis 2022-06-21 13:39:44 +08:00
weihongyang
2902a959f3 fix: 修改请求接口的swagger注解 2022-06-21 13:39:20 +08:00
weihongyang
266ce0c6a7 fix: 修改扫码枪监听 2022-06-21 09:44:15 +08:00
weihongyang
37a7f6ae13 修改redis配置 2022-06-21 09:14:53 +08:00
weihongyang
9cdaf85171 修改redis配置 2022-06-21 09:11:59 +08:00
39 changed files with 742 additions and 114 deletions

View File

@ -13,7 +13,8 @@
<module>ym-generator</module>
<module>ym-gateway</module>
<module>ym-barcode</module>
<module>yum-basic</module>
<module>ym-baisc</module>
</modules>
<packaging>pom</packaging>

View File

@ -1,9 +1,25 @@
package com.cnbm.admin.config;
import com.cnbm.common.utils.DateUtils;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.module.SimpleModule;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.converter.ByteArrayHttpMessageConverter;
import org.springframework.http.converter.HttpMessageConverter;
import org.springframework.http.converter.ResourceHttpMessageConverter;
import org.springframework.http.converter.StringHttpMessageConverter;
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
import org.springframework.http.converter.support.AllEncompassingFormHttpMessageConverter;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import java.text.SimpleDateFormat;
import java.util.List;
import java.util.TimeZone;
/**
* @Author weihongyang
* @Date 2022/6/8 10:47 AM
@ -27,4 +43,35 @@ public class CorsConfig implements WebMvcConfigurer {
// 跨域允许时间
.maxAge(3600);
}
@Override
public void configureMessageConverters(List<HttpMessageConverter<?>> converters) {
converters.add(new ByteArrayHttpMessageConverter());
converters.add(new StringHttpMessageConverter());
converters.add(new ResourceHttpMessageConverter());
converters.add(new AllEncompassingFormHttpMessageConverter());
converters.add(new StringHttpMessageConverter());
converters.add(jackson2HttpMessageConverter());
}
@Bean
public MappingJackson2HttpMessageConverter jackson2HttpMessageConverter() {
MappingJackson2HttpMessageConverter converter = new MappingJackson2HttpMessageConverter();
ObjectMapper mapper = new ObjectMapper();
//日期格式转换
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
mapper.setDateFormat(new SimpleDateFormat(DateUtils.DATE_TIME_PATTERN));
mapper.setTimeZone(TimeZone.getTimeZone("GMT+8"));
//Long类型转String类型
SimpleModule simpleModule = new SimpleModule();
simpleModule.addSerializer(Long.class, ToStringSerializer.instance);
simpleModule.addSerializer(Long.TYPE, ToStringSerializer.instance);
mapper.registerModule(simpleModule);
converter.setObjectMapper(mapper);
return converter;
}
}

View File

@ -1,10 +1,14 @@
package com.cnbm.admin.config;
import com.cnbm.admin.filter.JwtAuthenticationTokenFilter;
import com.cnbm.admin.service.impl.UserDetailsServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.authentication.AuthenticationProvider;
import org.springframework.security.authentication.dao.DaoAuthenticationProvider;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
@ -38,6 +42,10 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
@Autowired
private AccessDeniedHandler accessDeniedHandler;
@Autowired
private UserDetailsServiceImpl userDetailsService;
@Override
protected void configure(HttpSecurity http) throws Exception {
http
@ -48,7 +56,11 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
.and()
.authorizeRequests()
// 对于登录接口 允许匿名访问
.antMatchers("/login").anonymous()
.antMatchers("/login","/swagger/**","/v2/**",
"/doc.html",
"/swagger-resources/**",
"/swagger-ui/**",
"/webjars/**").anonymous()
// .antMatchers("/testCors").hasAuthority("system:dept:list222")
// 除上面外的所有请求全部需要鉴权认证
.anyRequest().authenticated();
@ -71,4 +83,22 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
public AuthenticationManager authenticationManagerBean() throws Exception {
return super.authenticationManagerBean();
}
@Bean
public AuthenticationProvider daoAuthenticationProvider() {
DaoAuthenticationProvider daoAuthenticationProvider = new DaoAuthenticationProvider();
daoAuthenticationProvider.setUserDetailsService(userDetailsService);
daoAuthenticationProvider.setPasswordEncoder(passwordEncoder());
daoAuthenticationProvider.setHideUserNotFoundExceptions(false);
return daoAuthenticationProvider;
}
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
// 加入自定义认证, 无需配置userDetailsService否则会执行默认的provider
// auth.authenticationProvider(myAuthenticationProvider());
/* auth.userDetailsService(userService)
.passwordEncoder(passwordEncoder());*/
auth.authenticationProvider(daoAuthenticationProvider());
}
}

View File

@ -36,12 +36,12 @@ public class SysDictDataController {
@GetMapping("page")
@ApiOperation("字典数据")
@ApiImplicitParams({
@ApiImplicitParam(name = Constant.PAGE, value = "当前页码从1开始", paramType = "query", required = true, dataType="int") ,
@ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query",required = true, dataType="int") ,
@ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataType="String") ,
@ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataType="String") ,
@ApiImplicitParam(name = "dictLabel", value = "字典标签", paramType = "query", dataType="String"),
@ApiImplicitParam(name = "dictValue", value = "字典值", paramType = "query", dataType="String")
@ApiImplicitParam(name = Constant.PAGE, value = "当前页码从1开始", paramType = "query", required = true, dataTypeClass=Integer.class) ,
@ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query",required = true, dataTypeClass=Integer.class) ,
@ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataTypeClass=String.class) ,
@ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataTypeClass=String.class) ,
@ApiImplicitParam(name = "dictLabel", value = "字典标签", paramType = "query", dataTypeClass=String.class),
@ApiImplicitParam(name = "dictValue", value = "字典值", paramType = "query", dataTypeClass=String.class)
})
@PreAuthorize("@ex.hasAuthority('sys:dept:page')")
public Result<PageData<SysDictDataDTO>> page(@ApiIgnore @RequestParam Map<String, Object> params){

View File

@ -38,12 +38,12 @@ public class SysDictTypeController {
@GetMapping("page")
@ApiOperation("字典类型")
@ApiImplicitParams({
@ApiImplicitParam(name = Constant.PAGE, value = "当前页码从1开始", paramType = "query", required = true, dataType="int") ,
@ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query",required = true, dataType="int") ,
@ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataType="String") ,
@ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataType="String") ,
@ApiImplicitParam(name = "dictType", value = "字典类型", paramType = "query", dataType="String"),
@ApiImplicitParam(name = "dictName", value = "字典名称", paramType = "query", dataType="String")
@ApiImplicitParam(name = Constant.PAGE, value = "当前页码从1开始", paramType = "query", required = true, dataTypeClass=Integer.class) ,
@ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query",required = true, dataTypeClass=Integer.class) ,
@ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataTypeClass=String.class) ,
@ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataTypeClass=String.class) ,
@ApiImplicitParam(name = "dictType", value = "字典类型", paramType = "query", dataTypeClass=String.class),
@ApiImplicitParam(name = "dictName", value = "字典名称", paramType = "query", dataTypeClass=String.class)
})
@PreAuthorize("@ex.hasAuthority('sys:dict:page')")
public Result<PageData<SysDictTypeDTO>> page(@ApiIgnore @RequestParam Map<String, Object> params){

View File

@ -38,10 +38,10 @@ public class SysLogErrorController {
@GetMapping("page")
@ApiOperation("分页")
@ApiImplicitParams({
@ApiImplicitParam(name = Constant.PAGE, value = "当前页码从1开始", paramType = "query", required = true, dataType="int") ,
@ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query",required = true, dataType="int") ,
@ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataType="String") ,
@ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataType="String")
@ApiImplicitParam(name = Constant.PAGE, value = "当前页码从1开始", paramType = "query", required = true, dataTypeClass=Integer.class) ,
@ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query",required = true, dataTypeClass=Integer.class) ,
@ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataTypeClass=String.class) ,
@ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataTypeClass=String.class)
})
public Result<PageData<SysLogErrorDTO>> page(@ApiIgnore @RequestParam Map<String, Object> params){
PageData<SysLogErrorDTO> page = sysLogErrorService.page(params);

View File

@ -38,11 +38,11 @@ public class SysLogOperationController {
@GetMapping("page")
@ApiOperation("分页")
@ApiImplicitParams({
@ApiImplicitParam(name = Constant.PAGE, value = "当前页码从1开始", paramType = "query", required = true, dataType="int") ,
@ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query",required = true, dataType="int") ,
@ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataType="String") ,
@ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataType="String") ,
@ApiImplicitParam(name = "status", value = "状态 0失败 1成功", paramType = "query", dataType="int")
@ApiImplicitParam(name = Constant.PAGE, value = "当前页码从1开始", paramType = "query", required = true, dataTypeClass=Integer.class) ,
@ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query",required = true, dataTypeClass=Integer.class) ,
@ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataTypeClass=String.class) ,
@ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataTypeClass=String.class) ,
@ApiImplicitParam(name = "status", value = "状态 0失败 1成功", paramType = "query", dataTypeClass=String.class)
})
public Result<PageData<SysLogOperationDTO>> page(@ApiIgnore @RequestParam Map<String, Object> params){
PageData<SysLogOperationDTO> page = sysLogOperationService.page(params);

View File

@ -60,7 +60,7 @@ public class SysMenuController {
@GetMapping("list")
@ApiOperation("列表")
@ApiImplicitParam(name = "type", value = "菜单类型 0菜单 1按钮 null全部", paramType = "query", dataType="int")
@ApiImplicitParam(name = "type", value = "菜单类型 0菜单 1按钮 null全部", paramType = "query", dataTypeClass=Integer.class)
@PreAuthorize("@ex.hasAuthority('sys:menu:list')")
public Result<List<SysMenuDTO>> list(Integer type){
List<SysMenuDTO> list = sysMenuService.getAllMenuList(type);

View File

@ -41,11 +41,11 @@ public class SysParamsController {
@GetMapping("page")
@ApiOperation("分页")
@ApiImplicitParams({
@ApiImplicitParam(name = Constant.PAGE, value = "当前页码从1开始", paramType = "query", required = true, dataType="int") ,
@ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query",required = true, dataType="int") ,
@ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataType="String") ,
@ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataType="String") ,
@ApiImplicitParam(name = "paramCode", value = "参数编码", paramType = "query", dataType="String")
@ApiImplicitParam(name = Constant.PAGE, value = "当前页码从1开始", paramType = "query", required = true, dataTypeClass=Integer.class) ,
@ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query",required = true, dataTypeClass=Integer.class) ,
@ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataTypeClass=String.class) ,
@ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataTypeClass=String.class) ,
@ApiImplicitParam(name = "paramCode", value = "参数编码", paramType = "query", dataTypeClass=String.class)
})
@PreAuthorize("@ex.hasAuthority('sys:params:page')")
public Result<PageData<SysParamsDTO>> page(@ApiIgnore @RequestParam Map<String, Object> params){
@ -105,7 +105,7 @@ public class SysParamsController {
@GetMapping("export")
@ApiOperation("导出")
@LogOperation("导出")
@ApiImplicitParam(name = "paramCode", value = "参数编码", paramType = "query", dataType="String")
@ApiImplicitParam(name = "paramCode", value = "参数编码", paramType = "query", dataTypeClass=String.class)
@PreAuthorize("@ex.hasAuthority('sys:params:export')")
public void export(@ApiIgnore @RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
List<SysParamsDTO> list = sysParamsService.list(params);

View File

@ -45,11 +45,11 @@ public class SysRoleController {
@GetMapping("page")
@ApiOperation("分页")
@ApiImplicitParams({
@ApiImplicitParam(name = Constant.PAGE, value = "当前页码从1开始", paramType = "query", required = true, dataType="int") ,
@ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query",required = true, dataType="int") ,
@ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataType="String") ,
@ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataType="String") ,
@ApiImplicitParam(name = "name", value = "角色名", paramType = "query", dataType="String")
@ApiImplicitParam(name = Constant.PAGE, value = "当前页码从1开始", paramType = "query", required = true, dataTypeClass=Integer.class) ,
@ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query",required = true, dataTypeClass=Integer.class) ,
@ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataTypeClass=String.class) ,
@ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataTypeClass=String.class) ,
@ApiImplicitParam(name = "name", value = "角色名", paramType = "query", dataTypeClass=String.class)
})
@PreAuthorize("@ex.hasAuthority('sys:role:page')")
public Result<PageData<SysRoleDTO>> page(@ApiIgnore @RequestParam Map<String, Object> params){

View File

@ -53,13 +53,13 @@ public class SysUserController {
@GetMapping("page")
@ApiOperation("分页")
@ApiImplicitParams({
@ApiImplicitParam(name = Constant.PAGE, value = "当前页码从1开始", paramType = "query", required = true, dataType="int") ,
@ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query",required = true, dataType="int") ,
@ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataType="String") ,
@ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataType="String") ,
@ApiImplicitParam(name = "username", value = "用户名", paramType = "query", dataType="String"),
@ApiImplicitParam(name = "gender", value = "性别", paramType = "query", dataType="String"),
@ApiImplicitParam(name = "deptId", value = "部门ID", paramType = "query", dataType="String")
@ApiImplicitParam(name = Constant.PAGE, value = "当前页码从1开始", paramType = "query", required = true, dataTypeClass=Integer.class) ,
@ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query",required = true, dataTypeClass=Integer.class) ,
@ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataTypeClass=String.class) ,
@ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataTypeClass=String.class) ,
@ApiImplicitParam(name = "username", value = "用户名", paramType = "query", dataTypeClass=String.class),
@ApiImplicitParam(name = "gender", value = "性别", paramType = "query", dataTypeClass=String.class),
@ApiImplicitParam(name = "deptId", value = "部门ID", paramType = "query", dataTypeClass=String.class)
})
@PreAuthorize("@ex.hasAuthority('sys:user:page')")
public Result<PageData<SysUserDTO>> page(@ApiIgnore @RequestParam Map<String, Object> params){
@ -153,7 +153,7 @@ public class SysUserController {
@GetMapping("export")
@ApiOperation("导出")
@LogOperation("导出")
@ApiImplicitParam(name = "username", value = "用户名", paramType = "query", dataType="String")
@ApiImplicitParam(name = "username", value = "用户名", paramType = "query", dataTypeClass=String.class)
@PreAuthorize("@ex.hasAuthority('sys:user:export')")
public void export(@ApiIgnore @RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
List<SysUserDTO> list = sysUserService.list(params);

View File

@ -26,40 +26,40 @@ import java.util.Map;
* @Date 2022/6/10 2:05 PM
* @Version 1.0
*/
//@RestControllerAdvice
//public class RenExceptionHandler {
// private static final Logger logger = LoggerFactory.getLogger(RenExceptionHandler.class);
//
// @Autowired
// private SysLogErrorService sysLogErrorService;
//
// /**
// * 处理自定义异常
// */
// @ExceptionHandler(RenException.class)
// public Result handleRenException(RenException ex){
// Result result = new Result();
// result.error(ex.getCode(), ex.getMsg());
//
// return result;
// }
//
// @ExceptionHandler(DuplicateKeyException.class)
// public Result handleDuplicateKeyException(DuplicateKeyException ex){
// Result result = new Result();
// result.error(ErrorCode.DB_RECORD_EXISTS);
//
// return result;
// }
//
// @ExceptionHandler(Exception.class)
// public Result handleException(Exception ex){
// logger.error(ex.getMessage(), ex);
//
@RestControllerAdvice
public class RenExceptionHandler {
private static final Logger logger = LoggerFactory.getLogger(RenExceptionHandler.class);
@Autowired
private SysLogErrorService sysLogErrorService;
/**
* 处理自定义异常
*/
@ExceptionHandler(RenException.class)
public Result handleRenException(RenException ex){
Result result = new Result();
result.error(ex.getCode(), ex.getMsg());
return result;
}
@ExceptionHandler(DuplicateKeyException.class)
public Result handleDuplicateKeyException(DuplicateKeyException ex){
Result result = new Result();
result.error(ErrorCode.DB_RECORD_EXISTS);
return result;
}
@ExceptionHandler(Exception.class)
public Result handleException(Exception ex){
logger.error(ex.getMessage(), ex);
// saveLog(ex);
//
// return new Result().error();
// }
return new Result().error();
}
//
// /**
// * 保存异常日志
@ -84,4 +84,4 @@ import java.util.Map;
// //保存
// sysLogErrorService.save(log);
// }
//}
}

View File

@ -11,6 +11,7 @@ import com.cnbm.admin.service.SysMenuService;
import com.cnbm.common.utils.ConvertUtils;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.authentication.DisabledException;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
@ -46,6 +47,9 @@ public class UserDetailsServiceImpl implements UserDetailsService {
if (Objects.isNull(sysUserEntity)) {
throw new UsernameNotFoundException("用户名不存在");
}
if (sysUserEntity.getStatus() == 0) {
throw new DisabledException("该账户已被禁用,请联系管理员");
}
log.info("sysUserEntity的值是"+sysUserEntity.toString());
log.info("sysUserEntity.getSuperAdmin()=="+sysUserEntity.getSuperAdmin());
Set<String> userPermissions = sysMenuService.getUserPermissions(sysUserEntity);

View File

@ -9,7 +9,7 @@
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>yum-basic</artifactId>
<artifactId>ym-baisc</artifactId>
<properties>
<maven.compiler.source>8</maven.compiler.source>
@ -18,12 +18,17 @@
<dependencies>
<dependency>
<groupId>com.cnbm</groupId>
<artifactId>ym-common</artifactId>
<artifactId>ym-admin</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>com.cnbm</groupId>-->
<!-- <artifactId>ym-gateway</artifactId>-->
<!-- <version>1.0-SNAPSHOT</version>-->
<!-- </dependency>-->
<dependency>
<groupId>com.cnbm</groupId>
<artifactId>ym-admin</artifactId>
<artifactId>ym-common</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
</dependencies>

View File

@ -0,0 +1,116 @@
package com.cnbm.basic.controller;
import com.cnbm.admin.annotation.LogOperation;
import com.cnbm.common.constant.Constant;
import com.cnbm.common.page.PageData;
import com.cnbm.common.utils.ExcelUtils;
import com.cnbm.common.utils.Result;
import com.cnbm.common.validator.AssertUtils;
import com.cnbm.common.validator.ValidatorUtils;
import com.cnbm.common.validator.group.AddGroup;
import com.cnbm.common.validator.group.DefaultGroup;
import com.cnbm.common.validator.group.UpdateGroup;
import com.cnbm.basic.dto.ProductTypeDTO;
import com.cnbm.basic.excel.ProductTypeExcel;
import com.cnbm.basic.service.IProductTypeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
/**
* 产品类型 前端控制器
*
* @author why
* @since 2022-06-21
*/
@RestController
@RequestMapping("/basic/productType")
@Api(tags="产品类型 表")
public class ProductTypeController {
@Autowired
private IProductTypeService productTypeService;
@GetMapping("page")
@ApiOperation("分页")
@ApiImplicitParams({
@ApiImplicitParam(name = Constant.PAGE, value = "当前页码从1开始", paramType = "query", required = true, dataType="int") ,
@ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query",required = true, dataType="int") ,
@ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataType="String") ,
@ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataType="String")
})
// @PreAuthorize("@ex.hasAuthority('basic:productType:page')")
public Result<PageData<ProductTypeDTO>> page(@ApiIgnore @RequestParam Map<String, Object> params){
PageData<ProductTypeDTO> page = productTypeService.page(params);
return new Result<PageData<ProductTypeDTO>>().ok(page);
}
@GetMapping("{id}")
@ApiOperation("信息")
// @PreAuthorize("@ex.hasAuthority('basic:productType:info')")
public Result<ProductTypeDTO> get(@PathVariable("id") Long id){
ProductTypeDTO data = productTypeService.get(id);
return new Result<ProductTypeDTO>().ok(data);
}
@PostMapping
@ApiOperation("保存")
@LogOperation("保存")
// @PreAuthorize("@ex.hasAuthority('basic:productType:save')")
public Result save(@RequestBody ProductTypeDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
productTypeService.save(dto);
return new Result();
}
@PutMapping
@ApiOperation("修改")
@LogOperation("修改")
// @PreAuthorize("@ex.hasAuthority('basic:productType:update')")
public Result update(@RequestBody ProductTypeDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
productTypeService.update(dto);
return new Result();
}
@DeleteMapping
@ApiOperation("删除")
@LogOperation("删除")
// @PreAuthorize("@ex.hasAuthority('basic:productType:delete')")
public Result delete(@RequestBody Long[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
productTypeService.delete(ids);
return new Result();
}
@GetMapping("export")
@ApiOperation("导出")
@LogOperation("导出")
// @PreAuthorize("@ex.hasAuthority('basic:productType:export')")
public void export(@ApiIgnore @RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
List<ProductTypeDTO> list = productTypeService.list(params);
ExcelUtils.exportExcelToTarget(response, null, list, ProductTypeExcel.class);
}
}

View File

@ -1,8 +1,7 @@
package com.cnbm.basic.mapper;
import com.cnbm.basic.entity.ProductType;
import com.cnbm.common.dao.BaseDao;
import com.cnbm.basic.entity.ProductType;
import org.apache.ibatis.annotations.Mapper;
/**

View File

@ -1,9 +1,8 @@
package com.cnbm.basic.service;
import com.cnbm.common.service.CrudService;
import com.cnbm.basic.dto.ProductTypeDTO;
import com.cnbm.basic.entity.ProductType;
import com.cnbm.common.service.CrudService;
/**
* 产品类型

View File

@ -1,12 +1,11 @@
package com.cnbm.basic.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.cnbm.common.service.impl.CrudServiceImpl;
import com.cnbm.basic.dto.ProductTypeDTO;
import com.cnbm.basic.entity.ProductType;
import com.cnbm.basic.mapper.ProductTypeMapper;
import com.cnbm.basic.service.IProductTypeService;
import com.cnbm.common.service.impl.CrudServiceImpl;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

View File

@ -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.cnbm.basic.mapper.ProductTypeMapper">
</mapper>

View File

@ -5,6 +5,7 @@ import com.github.kwhat.jnativehook.NativeHookException;
import com.github.kwhat.jnativehook.keyboard.NativeKeyEvent;
import com.github.kwhat.jnativehook.keyboard.NativeKeyListener;
import lombok.extern.log4j.Log4j2;
import org.springframework.context.annotation.Profile;
import org.springframework.stereotype.Component;
import java.util.List;
@ -19,6 +20,7 @@ import java.util.stream.Collectors;
*/
@Log4j2
@Component
@Profile("prod")
public class GlobalKeyListenerExample implements NativeKeyListener {
static {
@ -48,14 +50,17 @@ public class GlobalKeyListenerExample implements NativeKeyListener {
return NativeKeyEvent.getKeyText(n);
}).collect(Collectors.toList());
for (String s : collect) {
result = result + s;
}
if (queue.size() == 5) {
log.info("符合标准的扫码是:"+ result.replace("Enter",""));
for (String s : collect) {
result = result + s;
}
}else {
log.info("符合标准的扫码是:"+ result.substring(1).replace("Enter",""));
for (int i = 1; i < collect.size(); i++) {
result = result + collect.get(i);
}
}
log.info("符合标准的扫码是:"+ result.replace("Enter",""));
queue.clear();
}
if (queue.size() == 6){

View File

@ -32,6 +32,27 @@
<artifactId>ym-barcode</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.cnbm</groupId>
<artifactId>ym-baisc</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-boot-starter</artifactId>
<version>3.0.0</version>
<exclusions>
<exclusion>
<groupId>io.swagger</groupId>
<artifactId>swagger-models</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-models</artifactId>
<version>1.5.21</version>
</dependency>
</dependencies>
</project>

View File

@ -2,6 +2,7 @@ package com.cnbm;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import springfox.documentation.oas.annotations.EnableOpenApi;
/**
* @Author weihongyang
@ -9,9 +10,9 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
* @Version 1.0
*/
@SpringBootApplication
public class AdminApplication {
@EnableOpenApi
public class YmApplication {
public static void main(String[] args) {
SpringApplication.run(AdminApplication.class,args);
SpringApplication.run(YmApplication.class,args);
}
}

View File

@ -0,0 +1,111 @@
package com.cnbm.config;
import com.cnbm.common.constant.Constant;
import com.google.common.collect.Lists;
import io.swagger.annotations.ApiOperation;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.oas.annotations.EnableOpenApi;
import springfox.documentation.service.*;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spi.service.contexts.SecurityContext;
import springfox.documentation.spring.web.plugins.Docket;
import java.util.Arrays;
import java.util.List;
import static com.google.common.collect.Lists.newArrayList;
/**
* @Author weihongyang
* @Date 2022/6/21 10:56 AM
* @Version 1.0
*/
@Configuration
@EnableOpenApi
@Profile("dev")
public class SwaggerConfig {
/**
* 创建API应用
* apiInfo() 增加API相关信息
* 通过select()函数返回一个ApiSelectorBuilder实例,用来控制哪些接口暴露给Swagger来展现
* 本例采用指定扫描的包路径来定义指定要建立API的目录
*
* @return
*/
@Bean
public Docket restApi() {
return new Docket(DocumentationType.SWAGGER_2)
.groupName("标准接口")
.apiInfo(apiInfo("Spring Boot中使用Swagger2构建RESTful APIs", "1.0"))
.useDefaultResponseMessages(true)
.forCodeGeneration(false)
.select()
.apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class))
.paths(PathSelectors.any())
.build()
.securityContexts(Arrays.asList(securityContext()))
// ApiKey的name需与SecurityReference的reference保持一致
.securitySchemes(Arrays.asList(new ApiKey("token", "token", "header")));
}
@Bean
public Docket basicApi() {
return new Docket(DocumentationType.SWAGGER_2)
.groupName("ym-basic")
.apiInfo(apiInfos("basic", "基础资料模块"))
.useDefaultResponseMessages(true)
.forCodeGeneration(false)
.select()
.apis(RequestHandlerSelectors.basePackage("com.cnbm.basic"))
.paths(PathSelectors.any())
.build()
.securityContexts(Arrays.asList(securityContext()))
// ApiKey的name需与SecurityReference的reference保持一致
.securitySchemes(Arrays.asList(new ApiKey("token", "token", "header")));
}
/**
* 创建该API的基本信息这些基本信息会展现在文档页面中
* 访问地址http://ip:port/swagger-ui.html
*
* @return
*/
private ApiInfo apiInfo(String title, String version) {
return new ApiInfoBuilder()
.title(title)
.description("ym-pass文档")
.termsOfServiceUrl("https://www.baidu.com/")
.version(version)
.build();
}
private ApiInfo apiInfos(String title, String desc) {
return new ApiInfoBuilder()
.title(title)
.description(desc)
.termsOfServiceUrl("https://www.baidu.com/")
.version("1.0")
.build();
}
private SecurityContext securityContext() {
return SecurityContext.builder()
.securityReferences(defaultAuth())
.build();
}
List<SecurityReference> defaultAuth() {
AuthorizationScope authorizationScope
= new AuthorizationScope("global", "accessEverything");
AuthorizationScope[] authorizationScopes = new AuthorizationScope[1];
authorizationScopes[0] = authorizationScope;
return Lists.newArrayList(
new SecurityReference(Constant.TOKEN_HEADER, authorizationScopes));
}
}

View File

@ -0,0 +1,40 @@
spring:
datasource:
#MySQL
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://mysql.picaiba.com:30307/ym_pass?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&nullCatalogMeansCurrent=true
username: root
password: 1qaz@WSX3edc$RFV
# #Oracle
# driver-class-name: oracle.jdbc.OracleDriver
# url: jdbc:oracle:thin:@192.168.10.10:1521:xe
# username: renren_security
# password: 123456
# #SQLServer
# driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
# url: jdbc:sqlserver://localhost:1433;DatabaseName=renren_security
# username: sa
# password: 123456
# #postgresql
# driver-class-name: org.postgresql.Driver
# url: jdbc:postgresql://192.168.10.10:5432/postgres
# username: postgres
# password: 123456
hikari:
pool-name: GrowUpHikariCP
minimum-idle: 1
maximum-pool-size: 10
##多数据源的配置需要引用renren-dynamic-datasource
#dynamic:
# datasource:
# slave1:
# driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
# url: jdbc:sqlserver://123456:1433;DatabaseName=renren_security
# username: sa
# password: 123456
# slave2:
# driver-class-name: org.postgresql.Driver
# url: jdbc:postgresql://123456:5432/renren_security
# username: postgres
# password: 123456

View File

@ -7,14 +7,14 @@ server:
min-spare: 30
port: 8080
servlet:
context-path: /ym-admin
context-path: /ym-spc
session:
cookie:
http-only: true
spring:
application:
name: ym-admin
name: ym-spc
# 环境 dev|test|prod
profiles:
active: dev
@ -31,9 +31,9 @@ spring:
enabled: true
redis:
database: 0
host: 124.221.241.144
port: 6379
password: why123456 # 密码(默认为空)
host: redis.picaiba.com
port: 6380
password: '@WSXcde3' # 密码(默认为空)
timeout: 6000ms # 连接超时时长(毫秒)
jedis:
pool:

View File

@ -48,8 +48,8 @@ public class CodeGenerator {
})
.packageConfig(builder -> {
//设置父包名
builder.parent("com.cnbm")
.moduleName("generator")
builder.parent("com.cnbm.generator")
.moduleName("code")
.service("service")
.serviceImpl("service.impl")
.entity("entity")

View File

@ -1,9 +1,6 @@
package com.cnbm.basic.controller;
package com.cnbm.generator.controller;
import com.cnbm.admin.annotation.LogOperation;
import com.cnbm.basic.dto.ProductTypeDTO;
import com.cnbm.basic.excel.ProductTypeExcel;
import com.cnbm.basic.service.IProductTypeService;
import com.cnbm.common.constant.Constant;
import com.cnbm.common.page.PageData;
import com.cnbm.common.utils.ExcelUtils;
@ -13,14 +10,15 @@ import com.cnbm.common.validator.ValidatorUtils;
import com.cnbm.common.validator.group.AddGroup;
import com.cnbm.common.validator.group.DefaultGroup;
import com.cnbm.common.validator.group.UpdateGroup;
import com.cnbm.generator.dto.ProductTypeDTO;
import com.cnbm.generator.excel.ProductTypeExcel;
import com.cnbm.generator.service.IProductTypeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;

View File

@ -0,0 +1,67 @@
package com.cnbm.generator.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.io.Serializable;
import java.time.LocalDateTime;
/**
* 产品类型
*
* @author why
* @since 2022-06-21
*/
@Data
@ApiModel(value = "产品类型 表DTO对象")
public class ProductTypeDTO implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "ID")
private BigDecimal id;
@ApiModelProperty(value = "产品类型 名")
private String name;
@ApiModelProperty(value = "产品类型 编码")
private String code;
@ApiModelProperty(value = "描述")
private String desc;
@ApiModelProperty(value = "1 可用0 不可用")
private BigDecimal status;
@ApiModelProperty(value = "备注")
private String remark;
@ApiModelProperty(value = "删除标志,是否有效:1 可用 0不可用")
private BigDecimal valid;
@ApiModelProperty(value = "创建人")
private BigDecimal creatorId;
@ApiModelProperty(value = "创建人姓名")
private String creatorName;
@ApiModelProperty(value = "创建时间")
private LocalDateTime createTime;
@ApiModelProperty(value = "更新人")
private BigDecimal updaterId;
@ApiModelProperty(value = "更新人姓名")
private String updaterName;
@ApiModelProperty(value = "更新时间")
private LocalDateTime updateTime;
@ApiModelProperty(value = "版本号")
private BigDecimal version;
}

View File

@ -24,10 +24,10 @@ public class EnhanceVelocityTemplateEngine extends VelocityTemplateEngine {
customFile.forEach((key, value) -> {
String fileName = "";
if ("DTO".equals(key)) {
fileName = String.format((path+ File.separator +"src/main/java/com/cnbm/generator"+ File.separator + "dto" + File.separator + entityName + "%s" + ".java"), key);
fileName = String.format((path+ File.separator +"src/main/java/com/cnbm/generator/code"+ File.separator + "dto" + File.separator + entityName + "%s" + ".java"), key);
}
if ("Excel".equals(key)) {
fileName = String.format((path+ File.separator +"src/main/java/com/cnbm/generator"+ File.separator + "excel" + File.separator + entityName + "%s" + ".java"), key);
fileName = String.format((path+ File.separator +"src/main/java/com/cnbm/generator/code"+ File.separator + "excel" + File.separator + entityName + "%s" + ".java"), key);
}
this.outputFile(new File(fileName), objectMap, value);
});

View File

@ -0,0 +1,69 @@
package com.cnbm.generator.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* <p>
* 产品类型
* </p>
*
* @author why
* @since 2022-06-21
*/
@Data
@TableName("product_type")
@ApiModel(value = "ProductType对象", description = "产品类型 表")
public class ProductType implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty("ID")
private BigDecimal id;
@ApiModelProperty("产品类型 名")
private String name;
@ApiModelProperty("产品类型 编码")
private String code;
@ApiModelProperty("描述")
private String desc;
@ApiModelProperty("1 可用0 不可用")
private BigDecimal status;
@ApiModelProperty("备注")
private String remark;
@ApiModelProperty("删除标志,是否有效:1 可用 0不可用")
private BigDecimal valid;
@ApiModelProperty("创建人")
private BigDecimal creatorId;
@ApiModelProperty("创建人姓名")
private String creatorName;
@ApiModelProperty("创建时间")
private LocalDateTime createTime;
@ApiModelProperty("更新人")
private BigDecimal updaterId;
@ApiModelProperty("更新人姓名")
private String updaterName;
@ApiModelProperty("更新时间")
private LocalDateTime updateTime;
@ApiModelProperty("版本号")
private BigDecimal version;
}

View File

@ -0,0 +1,46 @@
package com.cnbm.generator.excel;
import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.Data;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Date;
/**
* 产品类型
*
* @author why
* @since 2022-06-21
*/
@Data
public class ProductTypeExcel {
@Excel(name = "ID")
private BigDecimal id;
@Excel(name = "产品类型 名")
private String name;
@Excel(name = "产品类型 编码")
private String code;
@Excel(name = "描述")
private String desc;
@Excel(name = "1 可用0 不可用")
private BigDecimal status;
@Excel(name = "备注")
private String remark;
@Excel(name = "删除标志,是否有效:1 可用 0不可用")
private BigDecimal valid;
@Excel(name = "创建人")
private BigDecimal creatorId;
@Excel(name = "创建人姓名")
private String creatorName;
@Excel(name = "创建时间")
private LocalDateTime createTime;
@Excel(name = "更新人")
private BigDecimal updaterId;
@Excel(name = "更新人姓名")
private String updaterName;
@Excel(name = "更新时间")
private LocalDateTime updateTime;
@Excel(name = "版本号")
private BigDecimal version;
}

View File

@ -0,0 +1,16 @@
package com.cnbm.generator.mapper;
import com.cnbm.common.dao.BaseDao;
import com.cnbm.generator.entity.ProductType;
import org.apache.ibatis.annotations.Mapper;
/**
* 产品类型
*
* @author why
* @since 2022-06-21
*/
@Mapper
public interface ProductTypeMapper extends BaseDao<ProductType> {
}

View File

@ -0,0 +1,15 @@
package com.cnbm.generator.service;
import com.cnbm.common.service.CrudService;
import com.cnbm.generator.dto.ProductTypeDTO;
import com.cnbm.generator.entity.ProductType;
/**
* 产品类型
*
* @author why
* @since 2022-06-21
*/
public interface IProductTypeService extends CrudService<ProductType, ProductTypeDTO> {
}

View File

@ -0,0 +1,34 @@
package com.cnbm.generator.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.cnbm.common.service.impl.CrudServiceImpl;
import com.cnbm.generator.dto.ProductTypeDTO;
import com.cnbm.generator.mapper.ProductTypeMapper;
import com.cnbm.generator.entity.ProductType;
import com.cnbm.generator.service.IProductTypeService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import java.util.Map;
/**
* 产品类型
*
* @author why
* @since 2022-06-21
*/
@Service
public class ProductTypeServiceImpl extends CrudServiceImpl<ProductTypeMapper, ProductType, ProductTypeDTO> implements IProductTypeService {
@Override
public QueryWrapper<ProductType> getWrapper(Map<String, Object> params){
String id = (String)params.get("id");
QueryWrapper<ProductType> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), "id", id);
return wrapper;
}
}

View File

@ -43,10 +43,10 @@ public class ${table.controllerName} {
@GetMapping("page")
@ApiOperation("分页")
@ApiImplicitParams({
@ApiImplicitParam(name = Constant.PAGE, value = "当前页码从1开始", paramType = "query", required = true, dataType="int") ,
@ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query",required = true, dataType="int") ,
@ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataType="String") ,
@ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataType="String")
@ApiImplicitParam(name = Constant.PAGE, value = "当前页码从1开始", paramType = "query", required = true, dataTypeClass=Integer.class) ,
@ApiImplicitParam(name = Constant.LIMIT, value = "每页显示记录数", paramType = "query",required = true, dataTypeClass=Integer.class) ,
@ApiImplicitParam(name = Constant.ORDER_FIELD, value = "排序字段", paramType = "query", dataTypeClass=String.class) ,
@ApiImplicitParam(name = Constant.ORDER, value = "排序方式,可选值(asc、desc)", paramType = "query", dataTypeClass=String.class)
})
@PreAuthorize("@ex.hasAuthority('${package.ModuleName}:${table.entityPath}:page')")
public Result<PageData<${entity}DTO>> page(@ApiIgnore @RequestParam Map<String, Object> params){