去除lombok
parent
492721fe9b
commit
36c24376ef
4
pom.xml
4
pom.xml
|
|
@ -40,10 +40,10 @@
|
||||||
<artifactId>commons-lang3</artifactId>
|
<artifactId>commons-lang3</artifactId>
|
||||||
<version>3.5</version>
|
<version>3.5</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<!-- <dependency>
|
||||||
<groupId>org.projectlombok</groupId>
|
<groupId>org.projectlombok</groupId>
|
||||||
<artifactId>lombok</artifactId>
|
<artifactId>lombok</artifactId>
|
||||||
</dependency>
|
</dependency> -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.fasterxml.jackson.core</groupId>
|
<groupId>com.fasterxml.jackson.core</groupId>
|
||||||
<artifactId>jackson-databind</artifactId>
|
<artifactId>jackson-databind</artifactId>
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
package com.boot.security.server.advice;
|
package com.boot.security.server.advice;
|
||||||
|
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.http.converter.HttpMessageNotReadableException;
|
import org.springframework.http.converter.HttpMessageNotReadableException;
|
||||||
import org.springframework.security.access.AccessDeniedException;
|
import org.springframework.security.access.AccessDeniedException;
|
||||||
|
|
@ -12,43 +14,41 @@ import org.springframework.web.method.annotation.MethodArgumentTypeMismatchExcep
|
||||||
|
|
||||||
import com.boot.security.server.dto.ResponseInfo;
|
import com.boot.security.server.dto.ResponseInfo;
|
||||||
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* springmvc异常处理
|
* springmvc异常处理
|
||||||
*
|
*
|
||||||
* @author 小威老师
|
* @author 小威老师
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@Slf4j(topic = "adminLogger")
|
|
||||||
@RestControllerAdvice
|
@RestControllerAdvice
|
||||||
public class ExceptionHandlerAdvice {
|
public class ExceptionHandlerAdvice {
|
||||||
|
|
||||||
|
private static final Logger log = LoggerFactory.getLogger("adminLogger");
|
||||||
|
|
||||||
@ExceptionHandler({ IllegalArgumentException.class })
|
@ExceptionHandler({ IllegalArgumentException.class })
|
||||||
@ResponseStatus(HttpStatus.BAD_REQUEST)
|
@ResponseStatus(HttpStatus.BAD_REQUEST)
|
||||||
public ResponseInfo badRequestException(IllegalArgumentException exception) {
|
public ResponseInfo badRequestException(IllegalArgumentException exception) {
|
||||||
return ResponseInfo.builder().code(HttpStatus.BAD_REQUEST.value() + "").message(exception.getMessage()).build();
|
return new ResponseInfo(HttpStatus.BAD_REQUEST.value() + "", exception.getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ExceptionHandler({ AccessDeniedException.class })
|
@ExceptionHandler({ AccessDeniedException.class })
|
||||||
@ResponseStatus(HttpStatus.FORBIDDEN)
|
@ResponseStatus(HttpStatus.FORBIDDEN)
|
||||||
public ResponseInfo badRequestException(AccessDeniedException exception) {
|
public ResponseInfo badRequestException(AccessDeniedException exception) {
|
||||||
return ResponseInfo.builder().code(HttpStatus.FORBIDDEN.value() + "").message(exception.getMessage()).build();
|
return new ResponseInfo(HttpStatus.FORBIDDEN.value() + "", exception.getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ExceptionHandler({ MissingServletRequestParameterException.class, HttpMessageNotReadableException.class,
|
@ExceptionHandler({ MissingServletRequestParameterException.class, HttpMessageNotReadableException.class,
|
||||||
UnsatisfiedServletRequestParameterException.class, MethodArgumentTypeMismatchException.class })
|
UnsatisfiedServletRequestParameterException.class, MethodArgumentTypeMismatchException.class })
|
||||||
@ResponseStatus(HttpStatus.BAD_REQUEST)
|
@ResponseStatus(HttpStatus.BAD_REQUEST)
|
||||||
public ResponseInfo badRequestException(Exception exception) {
|
public ResponseInfo badRequestException(Exception exception) {
|
||||||
return ResponseInfo.builder().code(HttpStatus.BAD_REQUEST.value() + "").message(exception.getMessage()).build();
|
return new ResponseInfo(HttpStatus.BAD_REQUEST.value() + "", exception.getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ExceptionHandler(Throwable.class)
|
@ExceptionHandler(Throwable.class)
|
||||||
@ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
|
@ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
|
||||||
public ResponseInfo exception(Throwable throwable) {
|
public ResponseInfo exception(Throwable throwable) {
|
||||||
log.error("系统异常", throwable);
|
log.error("系统异常", throwable);
|
||||||
return ResponseInfo.builder().code(HttpStatus.INTERNAL_SERVER_ERROR.value() + "")
|
return new ResponseInfo(HttpStatus.INTERNAL_SERVER_ERROR.value() + "", throwable.getMessage());
|
||||||
.message(throwable.getMessage()).build();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,8 @@ import java.sql.SQLException;
|
||||||
|
|
||||||
import javax.sql.DataSource;
|
import javax.sql.DataSource;
|
||||||
|
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||||
import org.springframework.boot.web.servlet.FilterRegistrationBean;
|
import org.springframework.boot.web.servlet.FilterRegistrationBean;
|
||||||
import org.springframework.boot.web.servlet.ServletRegistrationBean;
|
import org.springframework.boot.web.servlet.ServletRegistrationBean;
|
||||||
|
|
@ -15,20 +17,17 @@ import com.alibaba.druid.pool.DruidDataSource;
|
||||||
import com.alibaba.druid.support.http.StatViewServlet;
|
import com.alibaba.druid.support.http.StatViewServlet;
|
||||||
import com.alibaba.druid.support.http.WebStatFilter;
|
import com.alibaba.druid.support.http.WebStatFilter;
|
||||||
|
|
||||||
import lombok.Getter;
|
|
||||||
import lombok.Setter;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Druid数据源配置
|
* Druid数据源配置
|
||||||
*
|
*
|
||||||
* @author 小威老师
|
* @author 小威老师
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@Slf4j(topic = "adminLogger")
|
|
||||||
@Configuration
|
@Configuration
|
||||||
public class DruidConfig {
|
public class DruidConfig {
|
||||||
|
|
||||||
|
private static final Logger log = LoggerFactory.getLogger("adminLogger");
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
public ServletRegistrationBean druidServlet() {
|
public ServletRegistrationBean druidServlet() {
|
||||||
log.info("init Druid Servlet Configuration ");
|
log.info("init Druid Servlet Configuration ");
|
||||||
|
|
@ -61,9 +60,7 @@ public class DruidConfig {
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@ConfigurationProperties(prefix = "spring.datasource")
|
@ConfigurationProperties(prefix = "spring.datasource")
|
||||||
@Getter
|
public class DataSourceProperties {
|
||||||
@Setter
|
|
||||||
class DataSourceProperties {
|
|
||||||
private String url;
|
private String url;
|
||||||
private String username;
|
private String username;
|
||||||
private String password;
|
private String password;
|
||||||
|
|
@ -83,6 +80,150 @@ public class DruidConfig {
|
||||||
private String filters;
|
private String filters;
|
||||||
private String connectionProperties;
|
private String connectionProperties;
|
||||||
|
|
||||||
|
public String getUrl() {
|
||||||
|
return url;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUrl(String url) {
|
||||||
|
this.url = url;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUsername() {
|
||||||
|
return username;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUsername(String username) {
|
||||||
|
this.username = username;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPassword() {
|
||||||
|
return password;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPassword(String password) {
|
||||||
|
this.password = password;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDriverClassName() {
|
||||||
|
return driverClassName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDriverClassName(String driverClassName) {
|
||||||
|
this.driverClassName = driverClassName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getInitialSize() {
|
||||||
|
return initialSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setInitialSize(int initialSize) {
|
||||||
|
this.initialSize = initialSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getMinIdle() {
|
||||||
|
return minIdle;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMinIdle(int minIdle) {
|
||||||
|
this.minIdle = minIdle;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getMaxActive() {
|
||||||
|
return maxActive;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMaxActive(int maxActive) {
|
||||||
|
this.maxActive = maxActive;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getMaxWait() {
|
||||||
|
return maxWait;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMaxWait(int maxWait) {
|
||||||
|
this.maxWait = maxWait;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getTimeBetweenEvictionRunsMillis() {
|
||||||
|
return timeBetweenEvictionRunsMillis;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTimeBetweenEvictionRunsMillis(int timeBetweenEvictionRunsMillis) {
|
||||||
|
this.timeBetweenEvictionRunsMillis = timeBetweenEvictionRunsMillis;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getMinEvictableIdleTimeMillis() {
|
||||||
|
return minEvictableIdleTimeMillis;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMinEvictableIdleTimeMillis(int minEvictableIdleTimeMillis) {
|
||||||
|
this.minEvictableIdleTimeMillis = minEvictableIdleTimeMillis;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getValidationQuery() {
|
||||||
|
return validationQuery;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setValidationQuery(String validationQuery) {
|
||||||
|
this.validationQuery = validationQuery;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isTestWhileIdle() {
|
||||||
|
return testWhileIdle;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTestWhileIdle(boolean testWhileIdle) {
|
||||||
|
this.testWhileIdle = testWhileIdle;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isTestOnBorrow() {
|
||||||
|
return testOnBorrow;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTestOnBorrow(boolean testOnBorrow) {
|
||||||
|
this.testOnBorrow = testOnBorrow;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isTestOnReturn() {
|
||||||
|
return testOnReturn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTestOnReturn(boolean testOnReturn) {
|
||||||
|
this.testOnReturn = testOnReturn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isPoolPreparedStatements() {
|
||||||
|
return poolPreparedStatements;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPoolPreparedStatements(boolean poolPreparedStatements) {
|
||||||
|
this.poolPreparedStatements = poolPreparedStatements;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getMaxPoolPreparedStatementPerConnectionSize() {
|
||||||
|
return maxPoolPreparedStatementPerConnectionSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMaxPoolPreparedStatementPerConnectionSize(int maxPoolPreparedStatementPerConnectionSize) {
|
||||||
|
this.maxPoolPreparedStatementPerConnectionSize = maxPoolPreparedStatementPerConnectionSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFilters() {
|
||||||
|
return filters;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFilters(String filters) {
|
||||||
|
this.filters = filters;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getConnectionProperties() {
|
||||||
|
return connectionProperties;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setConnectionProperties(String connectionProperties) {
|
||||||
|
this.connectionProperties = connectionProperties;
|
||||||
|
}
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
@Primary
|
@Primary
|
||||||
public DataSource dataSource() {
|
public DataSource dataSource() {
|
||||||
|
|
|
||||||
|
|
@ -76,8 +76,7 @@ public class SecurityHandlerConfig {
|
||||||
} else {
|
} else {
|
||||||
msg = exception.getMessage();
|
msg = exception.getMessage();
|
||||||
}
|
}
|
||||||
ResponseInfo info = ResponseInfo.builder().code(HttpStatus.UNAUTHORIZED.value() + "").message(msg)
|
ResponseInfo info = new ResponseInfo(HttpStatus.UNAUTHORIZED.value() + "", msg);
|
||||||
.build();
|
|
||||||
ResponseUtil.responseJson(response, HttpStatus.UNAUTHORIZED.value(), info);
|
ResponseUtil.responseJson(response, HttpStatus.UNAUTHORIZED.value(), info);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
@ -96,8 +95,7 @@ public class SecurityHandlerConfig {
|
||||||
@Override
|
@Override
|
||||||
public void commence(HttpServletRequest request, HttpServletResponse response,
|
public void commence(HttpServletRequest request, HttpServletResponse response,
|
||||||
AuthenticationException authException) throws IOException, ServletException {
|
AuthenticationException authException) throws IOException, ServletException {
|
||||||
ResponseInfo info = ResponseInfo.builder().code(HttpStatus.UNAUTHORIZED.value() + "").message("请先登录")
|
ResponseInfo info = new ResponseInfo(HttpStatus.UNAUTHORIZED.value() + "", "请先登录");
|
||||||
.build();
|
|
||||||
ResponseUtil.responseJson(response, HttpStatus.UNAUTHORIZED.value(), info);
|
ResponseUtil.responseJson(response, HttpStatus.UNAUTHORIZED.value(), info);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
@ -115,7 +113,7 @@ public class SecurityHandlerConfig {
|
||||||
@Override
|
@Override
|
||||||
public void onLogoutSuccess(HttpServletRequest request, HttpServletResponse response,
|
public void onLogoutSuccess(HttpServletRequest request, HttpServletResponse response,
|
||||||
Authentication authentication) throws IOException, ServletException {
|
Authentication authentication) throws IOException, ServletException {
|
||||||
ResponseInfo info = ResponseInfo.builder().code(HttpStatus.OK.value() + "").message("退出成功").build();
|
ResponseInfo info = new ResponseInfo(HttpStatus.OK.value() + "", "退出成功");
|
||||||
|
|
||||||
String token = TokenFilter.getToken(request);
|
String token = TokenFilter.getToken(request);
|
||||||
tokenService.deleteToken(token);
|
tokenService.deleteToken(token);
|
||||||
|
|
|
||||||
|
|
@ -72,21 +72,21 @@ public class FileController {
|
||||||
@GetMapping
|
@GetMapping
|
||||||
@ApiOperation(value = "文件查询")
|
@ApiOperation(value = "文件查询")
|
||||||
@PreAuthorize("hasAuthority('sys:file:query')")
|
@PreAuthorize("hasAuthority('sys:file:query')")
|
||||||
public PageTableResponse<FileInfo> listFiles(PageTableRequest request) {
|
public PageTableResponse listFiles(PageTableRequest request) {
|
||||||
return PageTableHandler.<FileInfo> builder().countHandler(new CountHandler() {
|
return new PageTableHandler(new CountHandler() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int count(PageTableRequest request) {
|
public int count(PageTableRequest request) {
|
||||||
return fileInfoDao.count(request.getParams());
|
return fileInfoDao.count(request.getParams());
|
||||||
}
|
}
|
||||||
}).listHandler(new ListHandler<FileInfo>() {
|
}, new ListHandler() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<FileInfo> list(PageTableRequest request) {
|
public List<FileInfo> list(PageTableRequest request) {
|
||||||
List<FileInfo> list = fileInfoDao.list(request.getParams(), request.getOffset(), request.getLimit());
|
List<FileInfo> list = fileInfoDao.list(request.getParams(), request.getOffset(), request.getLimit());
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
}).build().handle(request);
|
}).handle(request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@LogAnnotation
|
@LogAnnotation
|
||||||
|
|
|
||||||
|
|
@ -87,21 +87,21 @@ public class JobController {
|
||||||
@GetMapping
|
@GetMapping
|
||||||
@ApiOperation(value = "定时任务列表")
|
@ApiOperation(value = "定时任务列表")
|
||||||
@PreAuthorize("hasAuthority('job:query')")
|
@PreAuthorize("hasAuthority('job:query')")
|
||||||
public PageTableResponse<JobModel> list(PageTableRequest request) {
|
public PageTableResponse list(PageTableRequest request) {
|
||||||
return PageTableHandler.<JobModel> builder().countHandler(new CountHandler() {
|
return new PageTableHandler(new CountHandler() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int count(PageTableRequest request) {
|
public int count(PageTableRequest request) {
|
||||||
return jobDao.count(request.getParams());
|
return jobDao.count(request.getParams());
|
||||||
}
|
}
|
||||||
}).listHandler(new ListHandler<JobModel>() {
|
}, new ListHandler() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<JobModel> list(PageTableRequest request) {
|
public List<JobModel> list(PageTableRequest request) {
|
||||||
List<JobModel> list = jobDao.list(request.getParams(), request.getOffset(), request.getLimit());
|
List<JobModel> list = jobDao.list(request.getParams(), request.getOffset(), request.getLimit());
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
}).build().handle(request);
|
}).handle(request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "校验cron表达式")
|
@ApiOperation(value = "校验cron表达式")
|
||||||
|
|
|
||||||
|
|
@ -76,20 +76,20 @@ public class MailController {
|
||||||
@GetMapping
|
@GetMapping
|
||||||
@ApiOperation(value = "邮件列表")
|
@ApiOperation(value = "邮件列表")
|
||||||
@PreAuthorize("hasAuthority('mail:all:query')")
|
@PreAuthorize("hasAuthority('mail:all:query')")
|
||||||
public PageTableResponse<Mail> list(PageTableRequest request) {
|
public PageTableResponse list(PageTableRequest request) {
|
||||||
return PageTableHandler.<Mail> builder().countHandler(new CountHandler() {
|
return new PageTableHandler(new CountHandler() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int count(PageTableRequest request) {
|
public int count(PageTableRequest request) {
|
||||||
return mailDao.count(request.getParams());
|
return mailDao.count(request.getParams());
|
||||||
}
|
}
|
||||||
}).listHandler(new ListHandler<Mail>() {
|
}, new ListHandler() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<Mail> list(PageTableRequest request) {
|
public List<Mail> list(PageTableRequest request) {
|
||||||
return mailDao.list(request.getParams(), request.getOffset(), request.getLimit());
|
return mailDao.list(request.getParams(), request.getOffset(), request.getLimit());
|
||||||
}
|
}
|
||||||
}).build().handle(request);
|
}).handle(request);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -90,20 +90,20 @@ public class NoticeController {
|
||||||
@GetMapping
|
@GetMapping
|
||||||
@ApiOperation(value = "公告管理列表")
|
@ApiOperation(value = "公告管理列表")
|
||||||
@PreAuthorize("hasAuthority('notice:query')")
|
@PreAuthorize("hasAuthority('notice:query')")
|
||||||
public PageTableResponse<Notice> listNotice(PageTableRequest request) {
|
public PageTableResponse listNotice(PageTableRequest request) {
|
||||||
return PageTableHandler.<Notice> builder().countHandler(new CountHandler() {
|
return new PageTableHandler(new CountHandler() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int count(PageTableRequest request) {
|
public int count(PageTableRequest request) {
|
||||||
return noticeDao.count(request.getParams());
|
return noticeDao.count(request.getParams());
|
||||||
}
|
}
|
||||||
}).listHandler(new ListHandler<Notice>() {
|
}, new ListHandler() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<Notice> list(PageTableRequest request) {
|
public List<Notice> list(PageTableRequest request) {
|
||||||
return noticeDao.list(request.getParams(), request.getOffset(), request.getLimit());
|
return noticeDao.list(request.getParams(), request.getOffset(), request.getLimit());
|
||||||
}
|
}
|
||||||
}).build().handle(request);
|
}).handle(request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@LogAnnotation
|
@LogAnnotation
|
||||||
|
|
@ -123,21 +123,21 @@ public class NoticeController {
|
||||||
|
|
||||||
@GetMapping("/published")
|
@GetMapping("/published")
|
||||||
@ApiOperation(value = "公告列表")
|
@ApiOperation(value = "公告列表")
|
||||||
public PageTableResponse<NoticeReadVO> listNoticeReadVO(PageTableRequest request) {
|
public PageTableResponse listNoticeReadVO(PageTableRequest request) {
|
||||||
request.getParams().put("userId", UserUtil.getLoginUser().getId());
|
request.getParams().put("userId", UserUtil.getLoginUser().getId());
|
||||||
|
|
||||||
return PageTableHandler.<NoticeReadVO> builder().countHandler(new CountHandler() {
|
return new PageTableHandler(new CountHandler() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int count(PageTableRequest request) {
|
public int count(PageTableRequest request) {
|
||||||
return noticeDao.countNotice(request.getParams());
|
return noticeDao.countNotice(request.getParams());
|
||||||
}
|
}
|
||||||
}).listHandler(new ListHandler<NoticeReadVO>() {
|
}, new ListHandler() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<NoticeReadVO> list(PageTableRequest request) {
|
public List<NoticeReadVO> list(PageTableRequest request) {
|
||||||
return noticeDao.listNotice(request.getParams(), request.getOffset(), request.getLimit());
|
return noticeDao.listNotice(request.getParams(), request.getOffset(), request.getLimit());
|
||||||
}
|
}
|
||||||
}).build().handle(request);
|
}).handle(request);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -54,21 +54,21 @@ public class RoleController {
|
||||||
@GetMapping
|
@GetMapping
|
||||||
@ApiOperation(value = "角色列表")
|
@ApiOperation(value = "角色列表")
|
||||||
@PreAuthorize("hasAuthority('sys:role:query')")
|
@PreAuthorize("hasAuthority('sys:role:query')")
|
||||||
public PageTableResponse<Role> listRoles(PageTableRequest request) {
|
public PageTableResponse listRoles(PageTableRequest request) {
|
||||||
return PageTableHandler.<Role> builder().countHandler(new CountHandler() {
|
return new PageTableHandler(new CountHandler() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int count(PageTableRequest request) {
|
public int count(PageTableRequest request) {
|
||||||
return roleDao.count(request.getParams());
|
return roleDao.count(request.getParams());
|
||||||
}
|
}
|
||||||
}).listHandler(new ListHandler<Role>() {
|
}, new ListHandler() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<Role> list(PageTableRequest request) {
|
public List<Role> list(PageTableRequest request) {
|
||||||
List<Role> list = roleDao.list(request.getParams(), request.getOffset(), request.getLimit());
|
List<Role> list = roleDao.list(request.getParams(), request.getOffset(), request.getLimit());
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
}).build().handle(request);
|
}).handle(request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/{id}")
|
@GetMapping("/{id}")
|
||||||
|
|
|
||||||
|
|
@ -30,20 +30,20 @@ public class SysLogsController {
|
||||||
@GetMapping
|
@GetMapping
|
||||||
@PreAuthorize("hasAuthority('sys:log:query')")
|
@PreAuthorize("hasAuthority('sys:log:query')")
|
||||||
@ApiOperation(value = "日志列表")
|
@ApiOperation(value = "日志列表")
|
||||||
public PageTableResponse<SysLogs> list(PageTableRequest request) {
|
public PageTableResponse list(PageTableRequest request) {
|
||||||
return PageTableHandler.<SysLogs> builder().countHandler(new CountHandler() {
|
return new PageTableHandler(new CountHandler() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int count(PageTableRequest request) {
|
public int count(PageTableRequest request) {
|
||||||
return sysLogsDao.count(request.getParams());
|
return sysLogsDao.count(request.getParams());
|
||||||
}
|
}
|
||||||
}).listHandler(new ListHandler<SysLogs>() {
|
}, new ListHandler() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<SysLogs> list(PageTableRequest request) {
|
public List<SysLogs> list(PageTableRequest request) {
|
||||||
return sysLogsDao.list(request.getParams(), request.getOffset(), request.getLimit());
|
return sysLogsDao.list(request.getParams(), request.getOffset(), request.getLimit());
|
||||||
}
|
}
|
||||||
}).build().handle(request);
|
}).handle(request);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,8 @@ package com.boot.security.server.controller;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
|
@ -27,7 +29,6 @@ import com.boot.security.server.utils.UserUtil;
|
||||||
|
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户相关接口
|
* 用户相关接口
|
||||||
|
|
@ -36,11 +37,13 @@ import lombok.extern.slf4j.Slf4j;
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@Api(tags = "用户")
|
@Api(tags = "用户")
|
||||||
@Slf4j(topic = "adminLogger")
|
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/users")
|
@RequestMapping("/users")
|
||||||
public class UserController {
|
public class UserController {
|
||||||
|
|
||||||
|
private static final Logger log = LoggerFactory.getLogger("adminLogger");
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private UserService userService;
|
private UserService userService;
|
||||||
@Autowired
|
@Autowired
|
||||||
|
|
@ -91,21 +94,21 @@ public class UserController {
|
||||||
@GetMapping
|
@GetMapping
|
||||||
@ApiOperation(value = "用户列表")
|
@ApiOperation(value = "用户列表")
|
||||||
@PreAuthorize("hasAuthority('sys:user:query')")
|
@PreAuthorize("hasAuthority('sys:user:query')")
|
||||||
public PageTableResponse<SysUser> listUsers(PageTableRequest request) {
|
public PageTableResponse listUsers(PageTableRequest request) {
|
||||||
return PageTableHandler.<SysUser> builder().countHandler(new CountHandler() {
|
return new PageTableHandler(new CountHandler() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int count(PageTableRequest request) {
|
public int count(PageTableRequest request) {
|
||||||
return userDao.count(request.getParams());
|
return userDao.count(request.getParams());
|
||||||
}
|
}
|
||||||
}).listHandler(new ListHandler<SysUser>() {
|
}, new ListHandler() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<SysUser> list(PageTableRequest request) {
|
public List<SysUser> list(PageTableRequest request) {
|
||||||
List<SysUser> list = userDao.list(request.getParams(), request.getOffset(), request.getLimit());
|
List<SysUser> list = userDao.list(request.getParams(), request.getOffset(), request.getLimit());
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
}).build().handle(request);
|
}).handle(request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ApiOperation(value = "当前登录用户")
|
@ApiOperation(value = "当前登录用户")
|
||||||
|
|
|
||||||
|
|
@ -2,11 +2,6 @@ package com.boot.security.server.dto;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
import lombok.Getter;
|
|
||||||
import lombok.Setter;
|
|
||||||
|
|
||||||
@Getter
|
|
||||||
@Setter
|
|
||||||
public class BeanField implements Serializable {
|
public class BeanField implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 4279960350136806659L;
|
private static final long serialVersionUID = 4279960350136806659L;
|
||||||
|
|
@ -22,4 +17,53 @@ public class BeanField implements Serializable {
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
private String type;
|
private String type;
|
||||||
|
|
||||||
|
public String getColumnName() {
|
||||||
|
return columnName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setColumnName(String columnName) {
|
||||||
|
this.columnName = columnName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getColumnType() {
|
||||||
|
return columnType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setColumnType(String columnType) {
|
||||||
|
this.columnType = columnType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getColumnComment() {
|
||||||
|
return columnComment;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setColumnComment(String columnComment) {
|
||||||
|
this.columnComment = columnComment;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getColumnDefault() {
|
||||||
|
return columnDefault;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setColumnDefault(String columnDefault) {
|
||||||
|
this.columnDefault = columnDefault;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getType() {
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setType(String type) {
|
||||||
|
this.type = type;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,11 +3,6 @@ package com.boot.security.server.dto;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import lombok.Getter;
|
|
||||||
import lombok.Setter;
|
|
||||||
|
|
||||||
@Getter
|
|
||||||
@Setter
|
|
||||||
public class GenerateDetail implements Serializable {
|
public class GenerateDetail implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = -164567294469931676L;
|
private static final long serialVersionUID = -164567294469931676L;
|
||||||
|
|
@ -15,4 +10,20 @@ public class GenerateDetail implements Serializable {
|
||||||
private String beanName;
|
private String beanName;
|
||||||
|
|
||||||
private List<BeanField> fields;
|
private List<BeanField> fields;
|
||||||
|
|
||||||
|
public String getBeanName() {
|
||||||
|
return beanName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBeanName(String beanName) {
|
||||||
|
this.beanName = beanName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<BeanField> getFields() {
|
||||||
|
return fields;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFields(List<BeanField> fields) {
|
||||||
|
this.fields = fields;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,11 +3,6 @@ package com.boot.security.server.dto;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import lombok.Getter;
|
|
||||||
import lombok.Setter;
|
|
||||||
|
|
||||||
@Getter
|
|
||||||
@Setter
|
|
||||||
public class GenerateInput implements Serializable {
|
public class GenerateInput implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = -2870071259702969061L;
|
private static final long serialVersionUID = -2870071259702969061L;
|
||||||
|
|
@ -61,4 +56,100 @@ public class GenerateInput implements Serializable {
|
||||||
* 默认值
|
* 默认值
|
||||||
*/
|
*/
|
||||||
private List<String> beanFieldValue;
|
private List<String> beanFieldValue;
|
||||||
|
|
||||||
|
public String getPath() {
|
||||||
|
return path;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPath(String path) {
|
||||||
|
this.path = path;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTableName() {
|
||||||
|
return tableName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTableName(String tableName) {
|
||||||
|
this.tableName = tableName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBeanPackageName() {
|
||||||
|
return beanPackageName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBeanPackageName(String beanPackageName) {
|
||||||
|
this.beanPackageName = beanPackageName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBeanName() {
|
||||||
|
return beanName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBeanName(String beanName) {
|
||||||
|
this.beanName = beanName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDaoPackageName() {
|
||||||
|
return daoPackageName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDaoPackageName(String daoPackageName) {
|
||||||
|
this.daoPackageName = daoPackageName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDaoName() {
|
||||||
|
return daoName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDaoName(String daoName) {
|
||||||
|
this.daoName = daoName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getControllerPkgName() {
|
||||||
|
return controllerPkgName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setControllerPkgName(String controllerPkgName) {
|
||||||
|
this.controllerPkgName = controllerPkgName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getControllerName() {
|
||||||
|
return controllerName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setControllerName(String controllerName) {
|
||||||
|
this.controllerName = controllerName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getColumnNames() {
|
||||||
|
return columnNames;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setColumnNames(List<String> columnNames) {
|
||||||
|
this.columnNames = columnNames;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getBeanFieldName() {
|
||||||
|
return beanFieldName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBeanFieldName(List<String> beanFieldName) {
|
||||||
|
this.beanFieldName = beanFieldName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getBeanFieldType() {
|
||||||
|
return beanFieldType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBeanFieldType(List<String> beanFieldType) {
|
||||||
|
this.beanFieldType = beanFieldType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getBeanFieldValue() {
|
||||||
|
return beanFieldValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBeanFieldValue(List<String> beanFieldValue) {
|
||||||
|
this.beanFieldValue = beanFieldValue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,11 +2,6 @@ package com.boot.security.server.dto;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
import lombok.Getter;
|
|
||||||
import lombok.Setter;
|
|
||||||
|
|
||||||
@Getter
|
|
||||||
@Setter
|
|
||||||
public class LayuiFile implements Serializable {
|
public class LayuiFile implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 35435494737590569L;
|
private static final long serialVersionUID = 35435494737590569L;
|
||||||
|
|
@ -15,12 +10,50 @@ public class LayuiFile implements Serializable {
|
||||||
private String msg;
|
private String msg;
|
||||||
private LayuiFileData data;
|
private LayuiFileData data;
|
||||||
|
|
||||||
@Getter
|
public Integer getCode() {
|
||||||
@Setter
|
return code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCode(Integer code) {
|
||||||
|
this.code = code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMsg() {
|
||||||
|
return msg;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMsg(String msg) {
|
||||||
|
this.msg = msg;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LayuiFileData getData() {
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setData(LayuiFileData data) {
|
||||||
|
this.data = data;
|
||||||
|
}
|
||||||
|
|
||||||
public static class LayuiFileData implements Serializable {
|
public static class LayuiFileData implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 7907356434695924597L;
|
private static final long serialVersionUID = 7907356434695924597L;
|
||||||
private String src;
|
private String src;
|
||||||
private String title;
|
private String title;
|
||||||
|
|
||||||
|
public String getSrc() {
|
||||||
|
return src;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSrc(String src) {
|
||||||
|
this.src = src;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTitle() {
|
||||||
|
return title;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTitle(String title) {
|
||||||
|
this.title = title;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -13,11 +13,6 @@ import com.boot.security.server.model.Permission;
|
||||||
import com.boot.security.server.model.SysUser;
|
import com.boot.security.server.model.SysUser;
|
||||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
|
|
||||||
import lombok.Getter;
|
|
||||||
import lombok.Setter;
|
|
||||||
|
|
||||||
@Getter
|
|
||||||
@Setter
|
|
||||||
public class LoginUser extends SysUser implements UserDetails {
|
public class LoginUser extends SysUser implements UserDetails {
|
||||||
|
|
||||||
private static final long serialVersionUID = -1379274258881257107L;
|
private static final long serialVersionUID = -1379274258881257107L;
|
||||||
|
|
@ -25,6 +20,22 @@ public class LoginUser extends SysUser implements UserDetails {
|
||||||
private List<Permission> permissions;
|
private List<Permission> permissions;
|
||||||
private String token;
|
private String token;
|
||||||
|
|
||||||
|
public List<Permission> getPermissions() {
|
||||||
|
return permissions;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPermissions(List<Permission> permissions) {
|
||||||
|
this.permissions = permissions;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getToken() {
|
||||||
|
return token;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setToken(String token) {
|
||||||
|
this.token = token;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
public Collection<? extends GrantedAuthority> getAuthorities() {
|
public Collection<? extends GrantedAuthority> getAuthorities() {
|
||||||
|
|
|
||||||
|
|
@ -4,11 +4,6 @@ import java.util.Date;
|
||||||
|
|
||||||
import com.boot.security.server.model.Notice;
|
import com.boot.security.server.model.Notice;
|
||||||
|
|
||||||
import lombok.Getter;
|
|
||||||
import lombok.Setter;
|
|
||||||
|
|
||||||
@Setter
|
|
||||||
@Getter
|
|
||||||
public class NoticeReadVO extends Notice {
|
public class NoticeReadVO extends Notice {
|
||||||
|
|
||||||
private static final long serialVersionUID = -3842182350180882396L;
|
private static final long serialVersionUID = -3842182350180882396L;
|
||||||
|
|
@ -16,4 +11,28 @@ public class NoticeReadVO extends Notice {
|
||||||
private Long userId;
|
private Long userId;
|
||||||
private Date readTime;
|
private Date readTime;
|
||||||
private Boolean isRead;
|
private Boolean isRead;
|
||||||
|
|
||||||
|
public Long getUserId() {
|
||||||
|
return userId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUserId(Long userId) {
|
||||||
|
this.userId = userId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getReadTime() {
|
||||||
|
return readTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setReadTime(Date readTime) {
|
||||||
|
this.readTime = readTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean getIsRead() {
|
||||||
|
return isRead;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIsRead(Boolean isRead) {
|
||||||
|
this.isRead = isRead;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,11 +6,6 @@ import java.util.List;
|
||||||
import com.boot.security.server.model.Notice;
|
import com.boot.security.server.model.Notice;
|
||||||
import com.boot.security.server.model.SysUser;
|
import com.boot.security.server.model.SysUser;
|
||||||
|
|
||||||
import lombok.Getter;
|
|
||||||
import lombok.Setter;
|
|
||||||
|
|
||||||
@Getter
|
|
||||||
@Setter
|
|
||||||
public class NoticeVO implements Serializable {
|
public class NoticeVO implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 7363353918096951799L;
|
private static final long serialVersionUID = 7363353918096951799L;
|
||||||
|
|
@ -18,4 +13,21 @@ public class NoticeVO implements Serializable {
|
||||||
private Notice notice;
|
private Notice notice;
|
||||||
|
|
||||||
private List<SysUser> users;
|
private List<SysUser> users;
|
||||||
|
|
||||||
|
public Notice getNotice() {
|
||||||
|
return notice;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNotice(Notice notice) {
|
||||||
|
this.notice = notice;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<SysUser> getUsers() {
|
||||||
|
return users;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUsers(List<SysUser> users) {
|
||||||
|
this.users = users;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,17 +2,33 @@ package com.boot.security.server.dto;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Getter;
|
|
||||||
import lombok.Setter;
|
|
||||||
|
|
||||||
@Getter
|
|
||||||
@Setter
|
|
||||||
@Builder
|
|
||||||
public class ResponseInfo implements Serializable {
|
public class ResponseInfo implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = -4417715614021482064L;
|
private static final long serialVersionUID = -4417715614021482064L;
|
||||||
|
|
||||||
private String code;
|
private String code;
|
||||||
private String message;
|
private String message;
|
||||||
|
|
||||||
|
public ResponseInfo(String code, String message) {
|
||||||
|
super();
|
||||||
|
this.code = code;
|
||||||
|
this.message = message;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCode() {
|
||||||
|
return code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCode(String code) {
|
||||||
|
this.code = code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMessage() {
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMessage(String message) {
|
||||||
|
this.message = message;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,14 +4,17 @@ import java.util.List;
|
||||||
|
|
||||||
import com.boot.security.server.model.Role;
|
import com.boot.security.server.model.Role;
|
||||||
|
|
||||||
import lombok.Getter;
|
|
||||||
import lombok.Setter;
|
|
||||||
|
|
||||||
@Getter
|
|
||||||
@Setter
|
|
||||||
public class RoleDto extends Role {
|
public class RoleDto extends Role {
|
||||||
|
|
||||||
private static final long serialVersionUID = 4218495592167610193L;
|
private static final long serialVersionUID = 4218495592167610193L;
|
||||||
|
|
||||||
private List<Long> permissionIds;
|
private List<Long> permissionIds;
|
||||||
|
|
||||||
|
public List<Long> getPermissionIds() {
|
||||||
|
return permissionIds;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPermissionIds(List<Long> permissionIds) {
|
||||||
|
this.permissionIds = permissionIds;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,10 +2,6 @@ package com.boot.security.server.dto;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Getter;
|
|
||||||
import lombok.Setter;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Restful方式登陆token
|
* Restful方式登陆token
|
||||||
*
|
*
|
||||||
|
|
@ -13,13 +9,23 @@ import lombok.Setter;
|
||||||
*
|
*
|
||||||
* 2017年8月4日
|
* 2017年8月4日
|
||||||
*/
|
*/
|
||||||
@Getter
|
|
||||||
@Setter
|
|
||||||
@Builder
|
|
||||||
public class Token implements Serializable {
|
public class Token implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 6314027741784310221L;
|
private static final long serialVersionUID = 6314027741784310221L;
|
||||||
|
|
||||||
private String token;
|
private String token;
|
||||||
|
|
||||||
|
public Token(String token) {
|
||||||
|
super();
|
||||||
|
this.token = token;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getToken() {
|
||||||
|
return token;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setToken(String token) {
|
||||||
|
this.token = token;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,15 +4,18 @@ import java.util.List;
|
||||||
|
|
||||||
import com.boot.security.server.model.SysUser;
|
import com.boot.security.server.model.SysUser;
|
||||||
|
|
||||||
import lombok.Getter;
|
|
||||||
import lombok.Setter;
|
|
||||||
|
|
||||||
@Getter
|
|
||||||
@Setter
|
|
||||||
public class UserDto extends SysUser {
|
public class UserDto extends SysUser {
|
||||||
|
|
||||||
private static final long serialVersionUID = -184009306207076712L;
|
private static final long serialVersionUID = -184009306207076712L;
|
||||||
|
|
||||||
private List<Long> roleIds;
|
private List<Long> roleIds;
|
||||||
|
|
||||||
|
public List<Long> getRoleIds() {
|
||||||
|
return roleIds;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRoleIds(List<Long> roleIds) {
|
||||||
|
this.roleIds = roleIds;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,11 +3,6 @@ package com.boot.security.server.model;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
import lombok.Getter;
|
|
||||||
import lombok.Setter;
|
|
||||||
|
|
||||||
@Setter
|
|
||||||
@Getter
|
|
||||||
public abstract class BaseEntity<ID extends Serializable> implements Serializable {
|
public abstract class BaseEntity<ID extends Serializable> implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 2054813493011812469L;
|
private static final long serialVersionUID = 2054813493011812469L;
|
||||||
|
|
@ -15,4 +10,28 @@ public abstract class BaseEntity<ID extends Serializable> implements Serializabl
|
||||||
private ID id;
|
private ID id;
|
||||||
private Date createTime = new Date();
|
private Date createTime = new Date();
|
||||||
private Date updateTime = new Date();
|
private Date updateTime = new Date();
|
||||||
|
|
||||||
|
public ID getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(ID id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getCreateTime() {
|
||||||
|
return createTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCreateTime(Date createTime) {
|
||||||
|
this.createTime = createTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getUpdateTime() {
|
||||||
|
return updateTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUpdateTime(Date updateTime) {
|
||||||
|
this.updateTime = updateTime;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,5 @@
|
||||||
package com.boot.security.server.model;
|
package com.boot.security.server.model;
|
||||||
|
|
||||||
import lombok.Getter;
|
|
||||||
import lombok.Setter;
|
|
||||||
|
|
||||||
@Getter
|
|
||||||
@Setter
|
|
||||||
public class FileInfo extends BaseEntity<String> {
|
public class FileInfo extends BaseEntity<String> {
|
||||||
|
|
||||||
private static final long serialVersionUID = -5761547882766615438L;
|
private static final long serialVersionUID = -5761547882766615438L;
|
||||||
|
|
@ -14,4 +9,44 @@ public class FileInfo extends BaseEntity<String> {
|
||||||
private String path;
|
private String path;
|
||||||
private String url;
|
private String url;
|
||||||
private Integer type;
|
private Integer type;
|
||||||
|
|
||||||
|
public String getContentType() {
|
||||||
|
return contentType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setContentType(String contentType) {
|
||||||
|
this.contentType = contentType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getSize() {
|
||||||
|
return size;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSize(long size) {
|
||||||
|
this.size = size;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPath() {
|
||||||
|
return path;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPath(String path) {
|
||||||
|
this.path = path;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUrl() {
|
||||||
|
return url;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUrl(String url) {
|
||||||
|
this.url = url;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getType() {
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setType(Integer type) {
|
||||||
|
this.type = type;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,5 @@
|
||||||
package com.boot.security.server.model;
|
package com.boot.security.server.model;
|
||||||
|
|
||||||
import lombok.Getter;
|
|
||||||
import lombok.Setter;
|
|
||||||
|
|
||||||
@Getter
|
|
||||||
@Setter
|
|
||||||
public class JobModel extends BaseEntity<Long> {
|
public class JobModel extends BaseEntity<Long> {
|
||||||
|
|
||||||
private static final long serialVersionUID = -2458935535811207209L;
|
private static final long serialVersionUID = -2458935535811207209L;
|
||||||
|
|
@ -23,4 +18,60 @@ public class JobModel extends BaseEntity<Long> {
|
||||||
|
|
||||||
private int status;
|
private int status;
|
||||||
|
|
||||||
|
public String getJobName() {
|
||||||
|
return jobName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setJobName(String jobName) {
|
||||||
|
this.jobName = jobName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescription() {
|
||||||
|
return description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDescription(String description) {
|
||||||
|
this.description = description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCron() {
|
||||||
|
return cron;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCron(String cron) {
|
||||||
|
this.cron = cron;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSpringBeanName() {
|
||||||
|
return springBeanName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSpringBeanName(String springBeanName) {
|
||||||
|
this.springBeanName = springBeanName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMethodName() {
|
||||||
|
return methodName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMethodName(String methodName) {
|
||||||
|
this.methodName = methodName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean getIsSysJob() {
|
||||||
|
return isSysJob;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIsSysJob(Boolean isSysJob) {
|
||||||
|
this.isSysJob = isSysJob;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getStatus() {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStatus(int status) {
|
||||||
|
this.status = status;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,5 @@
|
||||||
package com.boot.security.server.model;
|
package com.boot.security.server.model;
|
||||||
|
|
||||||
import lombok.Getter;
|
|
||||||
import lombok.Setter;
|
|
||||||
|
|
||||||
@Getter
|
|
||||||
@Setter
|
|
||||||
public class Mail extends BaseEntity<Long> {
|
public class Mail extends BaseEntity<Long> {
|
||||||
|
|
||||||
private static final long serialVersionUID = 5613231124043303948L;
|
private static final long serialVersionUID = 5613231124043303948L;
|
||||||
|
|
@ -14,4 +9,36 @@ public class Mail extends BaseEntity<Long> {
|
||||||
private String subject;
|
private String subject;
|
||||||
private String content;
|
private String content;
|
||||||
|
|
||||||
|
public Long getUserId() {
|
||||||
|
return userId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUserId(Long userId) {
|
||||||
|
this.userId = userId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getToUsers() {
|
||||||
|
return toUsers;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setToUsers(String toUsers) {
|
||||||
|
this.toUsers = toUsers;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getSubject() {
|
||||||
|
return subject;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSubject(String subject) {
|
||||||
|
this.subject = subject;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getContent() {
|
||||||
|
return content;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setContent(String content) {
|
||||||
|
this.content = content;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,5 @@
|
||||||
package com.boot.security.server.model;
|
package com.boot.security.server.model;
|
||||||
|
|
||||||
import lombok.Getter;
|
|
||||||
import lombok.Setter;
|
|
||||||
|
|
||||||
@Getter
|
|
||||||
@Setter
|
|
||||||
public class MailTo extends BaseEntity<Long> {
|
public class MailTo extends BaseEntity<Long> {
|
||||||
|
|
||||||
private static final long serialVersionUID = -8238779033956731073L;
|
private static final long serialVersionUID = -8238779033956731073L;
|
||||||
|
|
@ -12,4 +7,28 @@ public class MailTo extends BaseEntity<Long> {
|
||||||
private Long mailId;
|
private Long mailId;
|
||||||
private String toUser;
|
private String toUser;
|
||||||
private Boolean status;
|
private Boolean status;
|
||||||
|
|
||||||
|
public Long getMailId() {
|
||||||
|
return mailId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMailId(Long mailId) {
|
||||||
|
this.mailId = mailId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getToUser() {
|
||||||
|
return toUser;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setToUser(String toUser) {
|
||||||
|
this.toUser = toUser;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean getStatus() {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStatus(Boolean status) {
|
||||||
|
this.status = status;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,5 @@
|
||||||
package com.boot.security.server.model;
|
package com.boot.security.server.model;
|
||||||
|
|
||||||
import lombok.Getter;
|
|
||||||
import lombok.Setter;
|
|
||||||
|
|
||||||
@Getter
|
|
||||||
@Setter
|
|
||||||
public class Notice extends BaseEntity<Long> {
|
public class Notice extends BaseEntity<Long> {
|
||||||
|
|
||||||
private static final long serialVersionUID = -4401913568806243090L;
|
private static final long serialVersionUID = -4401913568806243090L;
|
||||||
|
|
@ -13,6 +8,30 @@ public class Notice extends BaseEntity<Long> {
|
||||||
private String content;
|
private String content;
|
||||||
private Integer status;
|
private Integer status;
|
||||||
|
|
||||||
|
public String getTitle() {
|
||||||
|
return title;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTitle(String title) {
|
||||||
|
this.title = title;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getContent() {
|
||||||
|
return content;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setContent(String content) {
|
||||||
|
this.content = content;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getStatus() {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStatus(Integer status) {
|
||||||
|
this.status = status;
|
||||||
|
}
|
||||||
|
|
||||||
public interface Status {
|
public interface Status {
|
||||||
int DRAFT = 0;
|
int DRAFT = 0;
|
||||||
int PUBLISH = 1;
|
int PUBLISH = 1;
|
||||||
|
|
|
||||||
|
|
@ -2,11 +2,6 @@ package com.boot.security.server.model;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import lombok.Getter;
|
|
||||||
import lombok.Setter;
|
|
||||||
|
|
||||||
@Getter
|
|
||||||
@Setter
|
|
||||||
public class Permission extends BaseEntity<Long> {
|
public class Permission extends BaseEntity<Long> {
|
||||||
|
|
||||||
private static final long serialVersionUID = 6180869216498363919L;
|
private static final long serialVersionUID = 6180869216498363919L;
|
||||||
|
|
@ -20,4 +15,68 @@ public class Permission extends BaseEntity<Long> {
|
||||||
private Integer sort;
|
private Integer sort;
|
||||||
|
|
||||||
private List<Permission> child;
|
private List<Permission> child;
|
||||||
|
|
||||||
|
public Long getParentId() {
|
||||||
|
return parentId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setParentId(Long parentId) {
|
||||||
|
this.parentId = parentId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCss() {
|
||||||
|
return css;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCss(String css) {
|
||||||
|
this.css = css;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getHref() {
|
||||||
|
return href;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setHref(String href) {
|
||||||
|
this.href = href;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getType() {
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setType(Integer type) {
|
||||||
|
this.type = type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPermission() {
|
||||||
|
return permission;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPermission(String permission) {
|
||||||
|
this.permission = permission;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getSort() {
|
||||||
|
return sort;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSort(Integer sort) {
|
||||||
|
this.sort = sort;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Permission> getChild() {
|
||||||
|
return child;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setChild(List<Permission> child) {
|
||||||
|
this.child = child;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,5 @@
|
||||||
package com.boot.security.server.model;
|
package com.boot.security.server.model;
|
||||||
|
|
||||||
import lombok.Getter;
|
|
||||||
import lombok.Setter;
|
|
||||||
|
|
||||||
@Getter
|
|
||||||
@Setter
|
|
||||||
public class Role extends BaseEntity<Long> {
|
public class Role extends BaseEntity<Long> {
|
||||||
|
|
||||||
private static final long serialVersionUID = -3802292814767103648L;
|
private static final long serialVersionUID = -3802292814767103648L;
|
||||||
|
|
@ -12,4 +7,20 @@ public class Role extends BaseEntity<Long> {
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
private String description;
|
private String description;
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDescription() {
|
||||||
|
return description;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDescription(String description) {
|
||||||
|
this.description = description;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,5 @@
|
||||||
package com.boot.security.server.model;
|
package com.boot.security.server.model;
|
||||||
|
|
||||||
import lombok.Getter;
|
|
||||||
import lombok.Setter;
|
|
||||||
|
|
||||||
@Getter
|
|
||||||
@Setter
|
|
||||||
public class SysLogs extends BaseEntity<Long> {
|
public class SysLogs extends BaseEntity<Long> {
|
||||||
|
|
||||||
private static final long serialVersionUID = -7809315432127036583L;
|
private static final long serialVersionUID = -7809315432127036583L;
|
||||||
|
|
@ -13,4 +8,36 @@ public class SysLogs extends BaseEntity<Long> {
|
||||||
private Boolean flag;
|
private Boolean flag;
|
||||||
private String remark;
|
private String remark;
|
||||||
|
|
||||||
|
public SysUser getUser() {
|
||||||
|
return user;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUser(SysUser user) {
|
||||||
|
this.user = user;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getModule() {
|
||||||
|
return module;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setModule(String module) {
|
||||||
|
this.module = module;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean getFlag() {
|
||||||
|
return flag;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setFlag(Boolean flag) {
|
||||||
|
this.flag = flag;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRemark() {
|
||||||
|
return remark;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRemark(String remark) {
|
||||||
|
this.remark = remark;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,11 +4,6 @@ import java.util.Date;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
|
||||||
import lombok.Getter;
|
|
||||||
import lombok.Setter;
|
|
||||||
|
|
||||||
@Getter
|
|
||||||
@Setter
|
|
||||||
public class SysUser extends BaseEntity<Long> {
|
public class SysUser extends BaseEntity<Long> {
|
||||||
|
|
||||||
private static final long serialVersionUID = -6525908145032868837L;
|
private static final long serialVersionUID = -6525908145032868837L;
|
||||||
|
|
@ -26,6 +21,94 @@ public class SysUser extends BaseEntity<Long> {
|
||||||
private Integer status;
|
private Integer status;
|
||||||
private String intro;
|
private String intro;
|
||||||
|
|
||||||
|
public String getUsername() {
|
||||||
|
return username;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUsername(String username) {
|
||||||
|
this.username = username;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPassword() {
|
||||||
|
return password;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPassword(String password) {
|
||||||
|
this.password = password;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNickname() {
|
||||||
|
return nickname;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setNickname(String nickname) {
|
||||||
|
this.nickname = nickname;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getHeadImgUrl() {
|
||||||
|
return headImgUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setHeadImgUrl(String headImgUrl) {
|
||||||
|
this.headImgUrl = headImgUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPhone() {
|
||||||
|
return phone;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPhone(String phone) {
|
||||||
|
this.phone = phone;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTelephone() {
|
||||||
|
return telephone;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTelephone(String telephone) {
|
||||||
|
this.telephone = telephone;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEmail() {
|
||||||
|
return email;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEmail(String email) {
|
||||||
|
this.email = email;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getBirthday() {
|
||||||
|
return birthday;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBirthday(Date birthday) {
|
||||||
|
this.birthday = birthday;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getSex() {
|
||||||
|
return sex;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSex(Integer sex) {
|
||||||
|
this.sex = sex;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getStatus() {
|
||||||
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStatus(Integer status) {
|
||||||
|
this.status = status;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getIntro() {
|
||||||
|
return intro;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIntro(String intro) {
|
||||||
|
this.intro = intro;
|
||||||
|
}
|
||||||
|
|
||||||
public interface Status {
|
public interface Status {
|
||||||
int DISABLED = 0;
|
int DISABLED = 0;
|
||||||
int VALID = 1;
|
int VALID = 1;
|
||||||
|
|
|
||||||
|
|
@ -3,23 +3,27 @@ package com.boot.security.server.page.table;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import lombok.Builder;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页查询处理器
|
* 分页查询处理器
|
||||||
*
|
*
|
||||||
* @author 小威老师
|
* @author 小威老师
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@Builder
|
|
||||||
public class PageTableHandler<T> {
|
public class PageTableHandler {
|
||||||
|
|
||||||
private CountHandler countHandler;
|
private CountHandler countHandler;
|
||||||
private ListHandler<T> listHandler;
|
private ListHandler listHandler;
|
||||||
|
|
||||||
public PageTableResponse<T> handle(PageTableRequest dtRequest) {
|
public PageTableHandler(CountHandler countHandler, ListHandler listHandler) {
|
||||||
|
super();
|
||||||
|
this.countHandler = countHandler;
|
||||||
|
this.listHandler = listHandler;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PageTableResponse handle(PageTableRequest dtRequest) {
|
||||||
int count = 0;
|
int count = 0;
|
||||||
List<T> list = null;
|
List<?> list = null;
|
||||||
|
|
||||||
count = this.countHandler.count(dtRequest);
|
count = this.countHandler.count(dtRequest);
|
||||||
if (count > 0) {
|
if (count > 0) {
|
||||||
|
|
@ -27,14 +31,14 @@ public class PageTableHandler<T> {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (list == null) {
|
if (list == null) {
|
||||||
list = new ArrayList<T>();
|
list = new ArrayList<>();
|
||||||
}
|
}
|
||||||
|
|
||||||
return PageTableResponse.<T> builder().recordsTotal(count).recordsFiltered(count).data(list).build();
|
return new PageTableResponse(count, count, list);
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface ListHandler<T> {
|
public interface ListHandler {
|
||||||
List<T> list(PageTableRequest request);
|
List<?> list(PageTableRequest request);
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface CountHandler {
|
public interface CountHandler {
|
||||||
|
|
|
||||||
|
|
@ -3,17 +3,12 @@ package com.boot.security.server.page.table;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import lombok.Getter;
|
|
||||||
import lombok.Setter;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页查询参数
|
* 分页查询参数
|
||||||
*
|
*
|
||||||
* @author 小威老师
|
* @author 小威老师
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@Getter
|
|
||||||
@Setter
|
|
||||||
public class PageTableRequest implements Serializable {
|
public class PageTableRequest implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 7328071045193618467L;
|
private static final long serialVersionUID = 7328071045193618467L;
|
||||||
|
|
@ -21,4 +16,28 @@ public class PageTableRequest implements Serializable {
|
||||||
private Integer offset;
|
private Integer offset;
|
||||||
private Integer limit;
|
private Integer limit;
|
||||||
private Map<String, Object> params;
|
private Map<String, Object> params;
|
||||||
|
|
||||||
|
public Integer getOffset() {
|
||||||
|
return offset;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOffset(Integer offset) {
|
||||||
|
this.offset = offset;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getLimit() {
|
||||||
|
return limit;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLimit(Integer limit) {
|
||||||
|
this.limit = limit;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Map<String, Object> getParams() {
|
||||||
|
return params;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setParams(Map<String, Object> params) {
|
||||||
|
this.params = params;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,25 +3,49 @@ package com.boot.security.server.page.table;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Getter;
|
|
||||||
import lombok.Setter;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页查询返回
|
* 分页查询返回
|
||||||
*
|
*
|
||||||
* @author 小威老师
|
* @author 小威老师
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@Getter
|
public class PageTableResponse implements Serializable {
|
||||||
@Setter
|
|
||||||
@Builder
|
|
||||||
public class PageTableResponse<T> implements Serializable {
|
|
||||||
|
|
||||||
private static final long serialVersionUID = 620421858510718076L;
|
private static final long serialVersionUID = 620421858510718076L;
|
||||||
|
|
||||||
private Integer recordsTotal;
|
private Integer recordsTotal;
|
||||||
private Integer recordsFiltered;
|
private Integer recordsFiltered;
|
||||||
private List<T> data;
|
private List<?> data;
|
||||||
|
|
||||||
|
public PageTableResponse(Integer recordsTotal, Integer recordsFiltered, List<?> data) {
|
||||||
|
super();
|
||||||
|
this.recordsTotal = recordsTotal;
|
||||||
|
this.recordsFiltered = recordsFiltered;
|
||||||
|
this.data = data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getRecordsTotal() {
|
||||||
|
return recordsTotal;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRecordsTotal(Integer recordsTotal) {
|
||||||
|
this.recordsTotal = recordsTotal;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getRecordsFiltered() {
|
||||||
|
return recordsFiltered;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRecordsFiltered(Integer recordsFiltered) {
|
||||||
|
this.recordsFiltered = recordsFiltered;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<?> getData() {
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setData(List<?> data) {
|
||||||
|
this.data = data;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -2,6 +2,8 @@ package com.boot.security.server.service.impl;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
@ -12,12 +14,11 @@ import com.boot.security.server.model.FileInfo;
|
||||||
import com.boot.security.server.service.FileService;
|
import com.boot.security.server.service.FileService;
|
||||||
import com.boot.security.server.utils.FileUtil;
|
import com.boot.security.server.utils.FileUtil;
|
||||||
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
|
|
||||||
@Slf4j(topic = "adminLogger")
|
|
||||||
@Service
|
@Service
|
||||||
public class FileServiceImpl implements FileService {
|
public class FileServiceImpl implements FileService {
|
||||||
|
|
||||||
|
private static final Logger log = LoggerFactory.getLogger("adminLogger");
|
||||||
|
|
||||||
@Value("${files.path}")
|
@Value("${files.path}")
|
||||||
private String filesPath;
|
private String filesPath;
|
||||||
@Autowired
|
@Autowired
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,8 @@ import org.quartz.Scheduler;
|
||||||
import org.quartz.SchedulerException;
|
import org.quartz.SchedulerException;
|
||||||
import org.quartz.TriggerBuilder;
|
import org.quartz.TriggerBuilder;
|
||||||
import org.quartz.TriggerKey;
|
import org.quartz.TriggerKey;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.aop.support.AopUtils;
|
import org.springframework.aop.support.AopUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.context.ApplicationContext;
|
import org.springframework.context.ApplicationContext;
|
||||||
|
|
@ -25,12 +27,11 @@ import com.boot.security.server.job.SpringBeanJob;
|
||||||
import com.boot.security.server.model.JobModel;
|
import com.boot.security.server.model.JobModel;
|
||||||
import com.boot.security.server.service.JobService;
|
import com.boot.security.server.service.JobService;
|
||||||
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
|
|
||||||
@Slf4j(topic = "adminLogger")
|
|
||||||
@Service
|
@Service
|
||||||
public class JobServiceImpl implements JobService {
|
public class JobServiceImpl implements JobService {
|
||||||
|
|
||||||
|
private static final Logger log = LoggerFactory.getLogger("adminLogger");
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private Scheduler scheduler;
|
private Scheduler scheduler;
|
||||||
@Autowired
|
@Autowired
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,8 @@ package com.boot.security.server.service.impl;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
@ -12,12 +14,11 @@ import com.boot.security.server.service.MailService;
|
||||||
import com.boot.security.server.service.SendMailSevice;
|
import com.boot.security.server.service.SendMailSevice;
|
||||||
import com.boot.security.server.utils.UserUtil;
|
import com.boot.security.server.utils.UserUtil;
|
||||||
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
|
|
||||||
@Slf4j(topic = "adminLogger")
|
|
||||||
@Service
|
@Service
|
||||||
public class MailServiceImpl implements MailService {
|
public class MailServiceImpl implements MailService {
|
||||||
|
|
||||||
|
private static final Logger log = LoggerFactory.getLogger("adminLogger");
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private SendMailSevice sendMailSevice;
|
private SendMailSevice sendMailSevice;
|
||||||
@Autowired
|
@Autowired
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,8 @@ package com.boot.security.server.service.impl;
|
||||||
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
@ -11,12 +13,11 @@ import com.boot.security.server.model.Permission;
|
||||||
import com.boot.security.server.service.PermissionService;
|
import com.boot.security.server.service.PermissionService;
|
||||||
import com.boot.security.server.service.UserService;
|
import com.boot.security.server.service.UserService;
|
||||||
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
|
|
||||||
@Slf4j(topic = "adminLogger")
|
|
||||||
@Service
|
@Service
|
||||||
public class PermissionServiceImpl implements PermissionService {
|
public class PermissionServiceImpl implements PermissionService {
|
||||||
|
|
||||||
|
private static final Logger log = LoggerFactory.getLogger("adminLogger");
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private PermissionDao permissionDao;
|
private PermissionDao permissionDao;
|
||||||
@Autowired
|
@Autowired
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,8 @@ package com.boot.security.server.service.impl;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
@ -14,12 +16,11 @@ import com.boot.security.server.model.Role;
|
||||||
import com.boot.security.server.service.RoleService;
|
import com.boot.security.server.service.RoleService;
|
||||||
import com.boot.security.server.service.UserService;
|
import com.boot.security.server.service.UserService;
|
||||||
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
|
|
||||||
@Slf4j(topic = "adminLogger")
|
|
||||||
@Service
|
@Service
|
||||||
public class RoleServiceImpl implements RoleService {
|
public class RoleServiceImpl implements RoleService {
|
||||||
|
|
||||||
|
private static final Logger log = LoggerFactory.getLogger("adminLogger");
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private RoleDao roleDao;
|
private RoleDao roleDao;
|
||||||
@Autowired
|
@Autowired
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,8 @@ import java.util.Date;
|
||||||
|
|
||||||
import org.apache.commons.lang3.time.DateFormatUtils;
|
import org.apache.commons.lang3.time.DateFormatUtils;
|
||||||
import org.apache.commons.lang3.time.DateUtils;
|
import org.apache.commons.lang3.time.DateUtils;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.scheduling.annotation.Async;
|
import org.springframework.scheduling.annotation.Async;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
@ -14,12 +16,11 @@ import com.boot.security.server.model.SysUser;
|
||||||
import com.boot.security.server.service.SysLogService;
|
import com.boot.security.server.service.SysLogService;
|
||||||
import com.boot.security.server.utils.UserUtil;
|
import com.boot.security.server.utils.UserUtil;
|
||||||
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
|
|
||||||
@Slf4j(topic = "adminLogger")
|
|
||||||
@Service
|
@Service
|
||||||
public class SysLogServiceImpl implements SysLogService {
|
public class SysLogServiceImpl implements SysLogService {
|
||||||
|
|
||||||
|
private static final Logger log = LoggerFactory.getLogger("adminLogger");
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private SysLogsDao sysLogsDao;
|
private SysLogsDao sysLogsDao;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ public class TokenServiceImpl implements TokenService {
|
||||||
updateLoginUser(loginUser);
|
updateLoginUser(loginUser);
|
||||||
logService.save(loginUser.getId(), "登陆", true, null);
|
logService.save(loginUser.getId(), "登陆", true, null);
|
||||||
|
|
||||||
return Token.builder().token(token).build();
|
return new Token(token);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,8 @@ package com.boot.security.server.service.impl;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
||||||
|
|
@ -22,12 +24,11 @@ import com.boot.security.server.service.TokenService;
|
||||||
import com.boot.security.server.service.UserService;
|
import com.boot.security.server.service.UserService;
|
||||||
import com.google.common.collect.Sets;
|
import com.google.common.collect.Sets;
|
||||||
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
|
|
||||||
@Slf4j(topic = "adminLogger")
|
|
||||||
@Service
|
@Service
|
||||||
public class UserServiceImpl implements UserService {
|
public class UserServiceImpl implements UserService {
|
||||||
|
|
||||||
|
private static final Logger log = LoggerFactory.getLogger("adminLogger");
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private UserDao userDao;
|
private UserDao userDao;
|
||||||
@Autowired
|
@Autowired
|
||||||
|
|
|
||||||
|
|
@ -6,14 +6,15 @@ import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import com.boot.security.server.dto.GenerateInput;
|
import com.boot.security.server.dto.GenerateInput;
|
||||||
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
|
|
||||||
@Slf4j(topic = "adminLogger")
|
|
||||||
public class TemplateUtil {
|
public class TemplateUtil {
|
||||||
|
|
||||||
|
private static final Logger log = LoggerFactory.getLogger("adminLogger");
|
||||||
|
|
||||||
public static String getTemplete(String fileName) {
|
public static String getTemplete(String fileName) {
|
||||||
return FileUtil.getText(TemplateUtil.class.getClassLoader().getResourceAsStream("generate/" + fileName));
|
return FileUtil.getText(TemplateUtil.class.getClassLoader().getResourceAsStream("generate/" + fileName));
|
||||||
}
|
}
|
||||||
|
|
@ -40,6 +41,7 @@ public class TemplateUtil {
|
||||||
text = text.replace("{import}", imports);
|
text = text.replace("{import}", imports);
|
||||||
String filelds = getFields(beanFieldName, beanFieldType, beanFieldValue);
|
String filelds = getFields(beanFieldName, beanFieldType, beanFieldValue);
|
||||||
text = text.replace("{filelds}", filelds);
|
text = text.replace("{filelds}", filelds);
|
||||||
|
text = text.replace("{getset}", getset(beanFieldName, beanFieldType));
|
||||||
|
|
||||||
FileUtil.saveTextFile(text, path + File.separator + getPackagePath(beanPackageName) + beanName + ".java");
|
FileUtil.saveTextFile(text, path + File.separator + getPackagePath(beanPackageName) + beanName + ".java");
|
||||||
log.debug("生成java model:{}模板", beanName);
|
log.debug("生成java model:{}模板", beanName);
|
||||||
|
|
@ -78,6 +80,33 @@ public class TemplateUtil {
|
||||||
return buffer.toString();
|
return buffer.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static String getset(List<String> beanFieldName, List<String> beanFieldType) {
|
||||||
|
StringBuffer buffer = new StringBuffer();
|
||||||
|
int size = beanFieldName.size();
|
||||||
|
for (int i = 0; i < size; i++) {
|
||||||
|
String name = beanFieldName.get(i);
|
||||||
|
if ("id".equals(name) || "createTime".equals(name) || "updateTime".equals(name)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
String type = beanFieldType.get(i);
|
||||||
|
buffer.append("\tpublic ").append(type).append(" get")
|
||||||
|
.append(StringUtils.substring(name, 0, 1).toUpperCase() + name.substring(1, name.length()))
|
||||||
|
.append("() {\n");
|
||||||
|
buffer.append("\t\treturn ").append(name).append(";\n");
|
||||||
|
buffer.append("\t}\n");
|
||||||
|
buffer.append("\tpublic ").append(type).append(" set")
|
||||||
|
.append(StringUtils.substring(name, 0, 1).toUpperCase() + name.substring(1, name.length()))
|
||||||
|
.append("() {\n");
|
||||||
|
buffer.append("\t\treturn ").append(name).append(";\n");
|
||||||
|
buffer.append("\t}\n");
|
||||||
|
// 默认值
|
||||||
|
buffer.append(";\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
return buffer.toString();
|
||||||
|
}
|
||||||
|
|
||||||
public static void saveJavaDao(GenerateInput input) {
|
public static void saveJavaDao(GenerateInput input) {
|
||||||
String path = input.getPath();
|
String path = input.getPath();
|
||||||
String tableName = input.getTableName();
|
String tableName = input.getTableName();
|
||||||
|
|
|
||||||
|
|
@ -53,20 +53,20 @@ public class {controllerName} {
|
||||||
|
|
||||||
@GetMapping
|
@GetMapping
|
||||||
@ApiOperation(value = "列表")
|
@ApiOperation(value = "列表")
|
||||||
public PageTableResponse<{beanName}> list(PageTableRequest request) {
|
public PageTableResponse list(PageTableRequest request) {
|
||||||
return PageTableHandler.<{beanName}> builder().countHandler(new CountHandler() {
|
return new PageTableHandler(new CountHandler() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int count(PageTableRequest request) {
|
public int count(PageTableRequest request) {
|
||||||
return {daoParamName}.count(request.getParams());
|
return {daoParamName}.count(request.getParams());
|
||||||
}
|
}
|
||||||
}).listHandler(new ListHandler<{beanName}>() {
|
}, new ListHandler() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<{beanName}> list(PageTableRequest request) {
|
public List<{beanName}> list(PageTableRequest request) {
|
||||||
return {daoParamName}.list(request.getParams(), request.getOffset(), request.getLimit());
|
return {daoParamName}.list(request.getParams(), request.getOffset(), request.getLimit());
|
||||||
}
|
}
|
||||||
}).build().handle(request);
|
}).handle(request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@DeleteMapping("/{id}")
|
@DeleteMapping("/{id}")
|
||||||
|
|
|
||||||
|
|
@ -2,12 +2,8 @@ package {beanPackageName};
|
||||||
|
|
||||||
{import}
|
{import}
|
||||||
|
|
||||||
import lombok.Getter;
|
|
||||||
import lombok.Setter;
|
|
||||||
|
|
||||||
@Getter
|
|
||||||
@Setter
|
|
||||||
public class {beanName} extends BaseEntity<Long> {
|
public class {beanName} extends BaseEntity<Long> {
|
||||||
|
|
||||||
{filelds}
|
{filelds}
|
||||||
|
{getset}
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue