Former-commit-id: 5c0f8496476d380f2d34c07be191e37f66f9cfa4
master
wangbing 5 years ago
parent 94b7301fd4
commit 83f5b8dc44

@ -312,12 +312,13 @@ public class SpringBootCallable implements Callable {
for (Table table : md.getTables()) { for (Table table : md.getTables()) {
ctx.put("table", table); ctx.put("table", table);
freeMarkerManager.outputTemp(Tool.createFile(root.getAbsolutePath(), Tool.lineToClassName(table.getTableName()) + "Mapper" + ".java"), option + "/java/module/mpr/mapperJava.ftl", ctx); freeMarkerManager.outputTemp(Tool.createFile(root.getAbsolutePath(), Tool.lineToClassName(table.getTableName()) + "Mapper" + ".java"), option + "/java/module/mpr/mapper.java", ctx);
if (table.getSys()) { if (table.getSys()) {
freeMarkerManager.outputTemp(Tool.createFile(root.getAbsolutePath(), Tool.lineToClassName(table.getTableName()) + "Mapper" + ".xml"), option + "/java/module/mpr/mapper.ftl", ctx); // freeMarkerManager.outputTemp(Tool.createFile(root.getAbsolutePath(), dataBase.name() + "_" + Tool.lineToClassName(table.getTableName()) + "Mapper" + ".xml"), option + "/java/module/mpr/" + dataBase.name() + "_mapper.xml", ctx);
freeMarkerManager.outputTemp(Tool.createFile(root.getAbsolutePath(), Tool.lineToClassName(table.getTableName()) + "Mapper" + ".xml"), option + "/java/module/mpr/" + dataBase.name() + "_mapper.xml", ctx);
} else { } else {
freeMarkerManager.outputTemp(Tool.createFile(root.getAbsolutePath(), Tool.lineToClassName(table.getTableName()) + "Mapper" + ".xml"), option + "/java/module/mpr/mapper_nosys.ftl", ctx); freeMarkerManager.outputTemp(Tool.createFile(root.getAbsolutePath(), Tool.lineToClassName(table.getTableName()) + "Mapper" + ".xml"), option + "/java/module/mpr/Nosys_mapper.ftl", ctx);
} }
} }
} }
@ -477,8 +478,10 @@ public class SpringBootCallable implements Callable {
for (String name : ResourceUtil.getResourceFiles("/modules/SpringBoot/java/module/system/mpr/")) { for (String name : ResourceUtil.getResourceFiles("/modules/SpringBoot/java/module/system/mpr/")) {
if (name.endsWith(".java")) { if (name.endsWith(".java")) {
freeMarkerManager.outputTemp(Tool.createFile(mpr.getAbsolutePath(), name), option + "/java/module/system/mpr/" + name, ctx); freeMarkerManager.outputTemp(Tool.createFile(mpr.getAbsolutePath(), name), option + "/java/module/system/mpr/" + name, ctx);
} else if (name.contains(dataBase.toString())) { } else if (name.contains(dataBase.name())) {
freeMarkerManager.outputTemp(Tool.createFile(mpr.getAbsolutePath(), name.replaceAll("_" + dataBase.toString(), "")), option + "/java/module/system/mpr/" + name, ctx); //todo dateBase调试
// freeMarkerManager.outputTemp(Tool.createFile(mpr.getAbsolutePath(), name), option + "/java/module/system/mpr/" + name, ctx);
freeMarkerManager.outputTemp(Tool.createFile(mpr.getAbsolutePath(), name.replaceAll(dataBase.name() + "_", "")), option + "/java/module/system/mpr/" + name, ctx);
} }
} }
@ -610,16 +613,18 @@ public class SpringBootCallable implements Callable {
File tableDir = Tool.createPath(dbtool.getAbsolutePath(), module.getModuleName() + "_table"); File tableDir = Tool.createPath(dbtool.getAbsolutePath(), module.getModuleName() + "_table");
for (Table table : module.getTables()) { for (Table table : module.getTables()) {
ctx.put("table", table); ctx.put("table", table);
freeMarkerManager.outputTemp(Tool.createFile(tableDir.getAbsolutePath(), table.getTableName() + ".sql"), option + "/resources/dbtool/table.ftl", ctx); freeMarkerManager.outputTemp(Tool.createFile(tableDir.getAbsolutePath(), dataBase.name() + "_" + table.getTableName() + ".sql"), option + "/resources/dbtool/table.ftl", ctx);
} }
freeMarkerManager.outputTemp(Tool.createFile(tableDir.getAbsolutePath(), "ALL_TABLE.sql"), option + "/resources/dbtool/tableAll.ftl", ctx); freeMarkerManager.outputTemp(Tool.createFile(tableDir.getAbsolutePath(), dataBase.name() + "_ALL_TABLE" + ".sql"), option + "/resources/dbtool/tableAll.ftl", ctx);
} }
if (project.getSysMD()) {//生成系统模块 if (project.getSysMD()) {//生成系统模块
File system = Tool.createPath(dbtool.getAbsolutePath(), "system_table"); File system = Tool.createPath(dbtool.getAbsolutePath(), "system_table");
for (String name : ResourceUtil.getResourceFiles("/modules/SpringBoot/resources/dbtool/system/")) { for (String name : ResourceUtil.getResourceFiles("/modules/SpringBoot/resources/dbtool/system/")) {
freeMarkerManager.outputTemp(Tool.createFile(system.getAbsolutePath(), name), option + "/resources/dbtool/system/" + name, ctx); if (name.contains(dataBase.name())) {
freeMarkerManager.outputTemp(Tool.createFile(system.getAbsolutePath(), name), option + "/resources/dbtool/system/" + name, ctx);
}
} }
} }

@ -47,7 +47,7 @@ import java.util.regex.Pattern;
* *
* @author author * @author author
* @version 0.0.1 * @version 0.0.1
* @since 2019-06-16 * @since 2017-01-01
*/ */
@Controller @Controller
@ControllerAdvice @ControllerAdvice

@ -1,134 +0,0 @@
package ${basePackage}.action.ajax.system;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import ${basePackage}.frame.auth.LocalData;
import ${basePackage}.frame.base.ErrorType;
import ${basePackage}.frame.utils.CookieUtil;
import ${basePackage}.frame.utils.MD5Util;
import ${basePackage}.frame.utils.RequestUtil;
import ${basePackage}.frame.utils.ValidationUtil;
import ${basePackage}.module.system.ent.User;
import ${basePackage}.module.system.mgr.TokensManager;
import ${basePackage}.module.system.mgr.UserManager;
import ${basePackage}.module.system.req.AuthLoginRequest;
import ${basePackage}.module.system.req.TokensCreateRequest;
import ${basePackage}.module.system.req.UserFindRequest;
import ${basePackage}.module.system.rsp.AuthLoginResponse;
import ${basePackage}.module.system.rsp.TokensCreateResponse;
import ${basePackage}.module.system.rsp.UserFindResponse;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Calendar;
import java.util.Date;
import java.util.UUID;
public class AuthAjax {
@Value("${r'${web.url.auth.admin}'}")
private String admin;
@Value("${r'${web.url.auth.pwd}'}")
private String pwd;
@Autowired
private TokensManager tokensManager;
@Autowired
private UserManager userManager;
public AuthLoginResponse login(AuthLoginRequest request, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) {
AuthLoginResponse response = new AuthLoginResponse();
ValidationUtil.validate(request, response);
if (response.hasError()) {
return response;
}
if (request.getUsername().equals(admin)) {//超级管理员登录
String generatePwd = MD5Util.generatePwd(request.getPassword());
if (!generatePwd.equals(pwd)) {
response.addError(ErrorType.BUSINESS_ERROR, "登录密码错误");
} else {
Date current = new Date();
Calendar instance = Calendar.getInstance();
instance.setTime(current);
instance.add(Calendar.HOUR_OF_DAY, 1);//默认一个小时内有效
TokensCreateRequest tokensCreateRequest = new TokensCreateRequest();
tokensCreateRequest.setToken(UUID.randomUUID().toString());
tokensCreateRequest.setUserId(0L);
tokensCreateRequest.setUserName("超级管理员");
tokensCreateRequest.setLoginTime(current);
tokensCreateRequest.setValidTime(instance.getTime());
tokensCreateRequest.setValid(true);
tokensCreateRequest.setDeptId(null);
tokensCreateRequest.setDeptCode(null);
tokensCreateRequest.setDeptName(null);
tokensCreateRequest.setTerminalType("WEB");
tokensCreateRequest.setTerminalIp(RequestUtil.getIp(httpServletRequest));
tokensCreateRequest.setTerminalInfo(RequestUtil.getUserAgent(httpServletRequest));
TokensCreateResponse tokensCreateResponse = tokensManager.create(tokensCreateRequest, LocalData.getSysToken());
if (tokensCreateResponse.hasError()) {
response.addErrors(tokensCreateResponse.getErrors());
return response;
}
Cookie cookie = CookieUtil.newCookie("token", tokensCreateRequest.getToken());
cookie.setPath("/");
httpServletResponse.addCookie(cookie);
}
} else {//管理员登录
UserFindRequest userFindRequest = new UserFindRequest();
userFindRequest.setUserName(request.getUsername());
UserFindResponse userFindResponse = userManager.find(userFindRequest, LocalData.getSysToken());
if (userFindResponse.hasError()) {
response.addErrors(userFindResponse.getErrors());
return response;
} else if (userFindResponse.getResult().size() == 0) {
response.addError(ErrorType.BUSINESS_ERROR, "用户名或密码错误!");
return response;
} else if (userFindResponse.getResult().size() > 1) {
response.addError(ErrorType.BUSINESS_ERROR, "用户信息异常!");
return response;
}
User user = userFindResponse.getResult().get(0);
String generatePwd = MD5Util.generatePwd(request.getPassword());
if (!generatePwd.equals(user.getUserPwd())) {
response.addError(ErrorType.BUSINESS_ERROR, "用户名或密码错误!");
return response;
}
Date current = new Date();
Calendar instance = Calendar.getInstance();
instance.setTime(current);
instance.add(Calendar.HOUR_OF_DAY, 1);//默认一个小时内有效
TokensCreateRequest tokensCreateRequest = new TokensCreateRequest();
tokensCreateRequest.setToken(UUID.randomUUID().toString());
tokensCreateRequest.setUserId(user.getId());
tokensCreateRequest.setUserName(user.getUserName());
tokensCreateRequest.setLoginTime(current);
tokensCreateRequest.setValidTime(instance.getTime());
tokensCreateRequest.setValid(true);
tokensCreateRequest.setDeptId(user.getDeptId());
tokensCreateRequest.setDeptCode(user.getDeptCode());
tokensCreateRequest.setDeptName(user.getDeptName());
tokensCreateRequest.setTerminalType("WEB");
tokensCreateRequest.setTerminalIp(RequestUtil.getIp(httpServletRequest));
tokensCreateRequest.setTerminalInfo(RequestUtil.getUserAgent(httpServletRequest));
TokensCreateResponse tokensCreateResponse = tokensManager.create(tokensCreateRequest, LocalData.getSysToken());
if (tokensCreateResponse.hasError()) {
response.addErrors(tokensCreateResponse.getErrors());
return response;
}
Cookie cookie = CookieUtil.newCookie("token", tokensCreateRequest.getToken());
cookie.setPath("/");
httpServletResponse.addCookie(cookie);
}
return response;
}
}

@ -2,35 +2,56 @@ package ${basePackage}.action.ajax.system;
import com.fasterxml.jackson.core.TreeNode; import com.fasterxml.jackson.core.TreeNode;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import ${basePackage}.frame.excel.WSheet;
import ${basePackage}.frame.utils.LogUtil;
import ${basePackage}.frame.auth.LocalData; import ${basePackage}.frame.auth.LocalData;
import ${basePackage}.frame.base.BaseResponse;
import ${basePackage}.frame.base.ErrorType; import ${basePackage}.frame.base.ErrorType;
import ${basePackage}.frame.excel.WSheet;
import ${basePackage}.frame.excel.exception.ReadErrorException;
import ${basePackage}.frame.excel.exception.TemplateNotMatchException;
import ${basePackage}.frame.utils.CookieUtil;
import ${basePackage}.frame.utils.LogUtil;
import ${basePackage}.frame.utils.MD5Util;
import ${basePackage}.frame.utils.MapperUtil; import ${basePackage}.frame.utils.MapperUtil;
import ${basePackage}.frame.base.BaseResponse; import ${basePackage}.frame.utils.RequestUtil;
import ${basePackage}.frame.utils.ResponseUtil; import ${basePackage}.frame.utils.ResponseUtil;
import ${basePackage}.frame.utils.ValidationUtil; import ${basePackage}.frame.utils.ValidationUtil;
import ${basePackage}.frame.excel.exception.ReadErrorException;
import ${basePackage}.frame.excel.exception.TemplateNotMatchException;
import ${basePackage}.module.system.ent.User; import ${basePackage}.module.system.ent.User;
import ${basePackage}.module.system.mgr.TokensManager;
import ${basePackage}.module.system.mgr.UserManager; import ${basePackage}.module.system.mgr.UserManager;
import ${basePackage}.module.system.req.TokensCreateRequest;
import ${basePackage}.module.system.req.UserCreateRequest; import ${basePackage}.module.system.req.UserCreateRequest;
import ${basePackage}.module.system.req.UserDeleteRequest; import ${basePackage}.module.system.req.UserDeleteRequest;
import ${basePackage}.module.system.req.UserFindRequest; import ${basePackage}.module.system.req.UserFindRequest;
import ${basePackage}.module.system.req.UserGetRequest; import ${basePackage}.module.system.req.UserGetRequest;
import ${basePackage}.module.system.req.UserLoginRequest;
import ${basePackage}.module.system.req.UserUpdateRequest; import ${basePackage}.module.system.req.UserUpdateRequest;
import ${basePackage}.module.system.rsp.TokensCreateResponse;
import ${basePackage}.module.system.rsp.UserCreateResponse; import ${basePackage}.module.system.rsp.UserCreateResponse;
import ${basePackage}.module.system.rsp.UserDeleteResponse; import ${basePackage}.module.system.rsp.UserDeleteResponse;
import ${basePackage}.module.system.rsp.UserFindResponse; import ${basePackage}.module.system.rsp.UserFindResponse;
import ${basePackage}.module.system.rsp.UserGetResponse; import ${basePackage}.module.system.rsp.UserGetResponse;
import ${basePackage}.module.system.rsp.UserLoginResponse;
import ${basePackage}.module.system.rsp.UserUpdateResponse; import ${basePackage}.module.system.rsp.UserUpdateResponse;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException; import java.io.IOException;
import java.util.Calendar;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.UUID;
public class UserAjax{ public class UserAjax{
@Value("${r'${web.url.auth.admin}'}")
private String admin;
@Value("${r'${web.url.auth.pwd}'}")
private String pwd;
@Autowired
private TokensManager tokensManager;
@Autowired @Autowired
private UserManager userManager; private UserManager userManager;
@ -54,6 +75,103 @@ public class UserAjax{
return userManager.get(request, LocalData.getToken()); return userManager.get(request, LocalData.getToken());
} }
public UserLoginResponse login(UserLoginRequest request, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) {
UserLoginResponse response = new UserLoginResponse();
ValidationUtil.validate(request, response);
if (response.hasError()) {
return response;
}
if (request.getUsername().equals(admin)) {//超级管理员登录
String generatePwd = MD5Util.generatePwd(request.getPassword());
if (!generatePwd.equals(pwd)) {
response.addError(ErrorType.BUSINESS_ERROR, "登录密码错误");
} else {
Date current = new Date();
Calendar instance = Calendar.getInstance();
instance.setTime(current);
instance.add(Calendar.HOUR_OF_DAY, 1);//默认一个小时内有效
TokensCreateRequest tokensCreateRequest = new TokensCreateRequest();
tokensCreateRequest.setToken(UUID.randomUUID().toString());
tokensCreateRequest.setUserId(0L);
tokensCreateRequest.setUserName("超级管理员");
tokensCreateRequest.setLoginTime(current);
tokensCreateRequest.setValidTime(instance.getTime());
tokensCreateRequest.setValid(true);
tokensCreateRequest.setDeptId(null);
tokensCreateRequest.setDeptCode(null);
tokensCreateRequest.setDeptName(null);
tokensCreateRequest.setTerminalType("WEB");
tokensCreateRequest.setTerminalIp(RequestUtil.getIp(httpServletRequest));
tokensCreateRequest.setTerminalInfo(RequestUtil.getUserAgent(httpServletRequest));
TokensCreateResponse tokensCreateResponse = tokensManager.create(tokensCreateRequest, LocalData.getSysToken());
if (tokensCreateResponse.hasError()) {
response.addErrors(tokensCreateResponse.getErrors());
return response;
}
Cookie cookie = CookieUtil.newCookie("token", tokensCreateRequest.getToken());
cookie.setPath("/");
httpServletResponse.addCookie(cookie);
}
} else {//管理员登录
UserFindRequest userFindRequest = new UserFindRequest();
userFindRequest.setUserName(request.getUsername());
UserFindResponse userFindResponse = userManager.find(userFindRequest, LocalData.getSysToken());
if (userFindResponse.hasError()) {
response.addErrors(userFindResponse.getErrors());
return response;
} else if (userFindResponse.getResult().size() == 0) {
response.addError(ErrorType.BUSINESS_ERROR, "用户名或密码错误!");
return response;
} else if (userFindResponse.getResult().size() > 1) {
response.addError(ErrorType.BUSINESS_ERROR, "用户信息异常!");
return response;
}
User user = userFindResponse.getResult().get(0);
String generatePwd = MD5Util.generatePwd(request.getPassword());
if (!generatePwd.equals(user.getUserPwd())) {
response.addError(ErrorType.BUSINESS_ERROR, "用户名或密码错误!");
return response;
}
Date current = new Date();
Calendar instance = Calendar.getInstance();
instance.setTime(current);
instance.add(Calendar.HOUR_OF_DAY, 1);//默认一个小时内有效
TokensCreateRequest tokensCreateRequest = new TokensCreateRequest();
tokensCreateRequest.setToken(UUID.randomUUID().toString());
tokensCreateRequest.setUserId(user.getId());
tokensCreateRequest.setUserName(user.getUserName());
tokensCreateRequest.setLoginTime(current);
tokensCreateRequest.setValidTime(instance.getTime());
tokensCreateRequest.setValid(true);
tokensCreateRequest.setDeptId(user.getDeptId());
tokensCreateRequest.setDeptCode(user.getDeptCode());
tokensCreateRequest.setDeptName(user.getDeptName());
tokensCreateRequest.setTerminalType("WEB");
tokensCreateRequest.setTerminalIp(RequestUtil.getIp(httpServletRequest));
tokensCreateRequest.setTerminalInfo(RequestUtil.getUserAgent(httpServletRequest));
TokensCreateResponse tokensCreateResponse = tokensManager.create(tokensCreateRequest, LocalData.getSysToken());
if (tokensCreateResponse.hasError()) {
response.addErrors(tokensCreateResponse.getErrors());
return response;
}
Cookie cookie = CookieUtil.newCookie("token", tokensCreateRequest.getToken());
cookie.setPath("/");
httpServletResponse.addCookie(cookie);
}
return response;
}
public Object template(){ public Object template(){
return ResponseUtil.apply(new WSheet<>(User.class)); return ResponseUtil.apply(new WSheet<>(User.class));
} }

@ -1,23 +0,0 @@
package ${basePackage}.action.api.system;
import ${basePackage}.module.system.req.AuthLoginRequest;
import ${basePackage}.module.system.rsp.AuthLoginResponse;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class AuthApi {
public AuthLoginResponse login(AuthLoginRequest request, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) {
AuthLoginResponse response = new AuthLoginResponse();
// todo 设置cookie
Cookie token = new Cookie("token", "");
token.setDomain(httpServletRequest.getServerName());
token.setPath("/");
httpServletResponse.addCookie(token);
return response;
}
}

@ -1,13 +1,38 @@
package ${basePackage}.action.api.system; package ${basePackage}.action.api.system;
import org.springframework.beans.factory.annotation.Autowired;
import ${basePackage}.frame.auth.LocalData; import ${basePackage}.frame.auth.LocalData;
import ${basePackage}.frame.base.ErrorType;
import ${basePackage}.frame.utils.MD5Util;
import ${basePackage}.frame.utils.RequestUtil;
import ${basePackage}.frame.utils.ValidationUtil;
import ${basePackage}.module.system.ent.User;
import ${basePackage}.module.system.mgr.TokensManager;
import ${basePackage}.module.system.mgr.UserManager; import ${basePackage}.module.system.mgr.UserManager;
import ${basePackage}.module.system.req.*; import ${basePackage}.module.system.req.TokensCreateRequest;
import ${basePackage}.module.system.rsp.*; import ${basePackage}.module.system.req.UserCreateRequest;
import org.springframework.beans.factory.annotation.Autowired; import ${basePackage}.module.system.req.UserDeleteRequest;
import ${basePackage}.module.system.req.UserFindRequest;
import ${basePackage}.module.system.req.UserGetRequest;
import ${basePackage}.module.system.req.UserLoginRequest;
import ${basePackage}.module.system.req.UserUpdateRequest;
import ${basePackage}.module.system.rsp.TokensCreateResponse;
import ${basePackage}.module.system.rsp.UserCreateResponse;
import ${basePackage}.module.system.rsp.UserDeleteResponse;
import ${basePackage}.module.system.rsp.UserFindResponse;
import ${basePackage}.module.system.rsp.UserGetResponse;
import ${basePackage}.module.system.rsp.UserLoginResponse;
import ${basePackage}.module.system.rsp.UserUpdateResponse;
import javax.servlet.http.HttpServletRequest;
import java.util.Calendar;
import java.util.Date;
import java.util.UUID;
public class UserApi{ public class UserApi{
@Autowired
private TokensManager tokensManager;
@Autowired @Autowired
private UserManager userManager; private UserManager userManager;
@ -30,4 +55,63 @@ public class UserApi{
public UserGetResponse get(UserGetRequest request) { public UserGetResponse get(UserGetRequest request) {
return userManager.get(request, LocalData.getToken()); return userManager.get(request, LocalData.getToken());
} }
public UserLoginResponse login(UserLoginRequest request, HttpServletRequest httpServletRequest) {
UserLoginResponse response = new UserLoginResponse();
ValidationUtil.validate(request, response);
if (response.hasError()) {
return response;
}
UserFindRequest userFindRequest = new UserFindRequest();
userFindRequest.setUserName(request.getUsername());
UserFindResponse userFindResponse = userManager.find(userFindRequest, LocalData.getSysToken());
if (userFindResponse.hasError()) {
response.addErrors(userFindResponse.getErrors());
return response;
} else if (userFindResponse.getResult().size() == 0) {
response.addError(ErrorType.BUSINESS_ERROR, "用户名或密码错误!");
return response;
} else if (userFindResponse.getResult().size() > 1) {
response.addError(ErrorType.BUSINESS_ERROR, "用户信息异常!");
return response;
}
User user = userFindResponse.getResult().get(0);
String generatePwd = MD5Util.generatePwd(request.getPassword());
if (!generatePwd.equals(user.getUserPwd())) {
response.addError(ErrorType.BUSINESS_ERROR, "用户名或密码错误!");
return response;
}
Date current = new Date();
Calendar instance = Calendar.getInstance();
instance.setTime(current);
instance.add(Calendar.HOUR_OF_DAY, 1);//默认一个小时内有效
TokensCreateRequest tokensCreateRequest = new TokensCreateRequest();
tokensCreateRequest.setToken(UUID.randomUUID().toString());
tokensCreateRequest.setUserId(user.getId());
tokensCreateRequest.setUserName(user.getUserName());
tokensCreateRequest.setLoginTime(current);
tokensCreateRequest.setValidTime(instance.getTime());
tokensCreateRequest.setValid(true);
tokensCreateRequest.setDeptId(user.getDeptId());
tokensCreateRequest.setDeptCode(user.getDeptCode());
tokensCreateRequest.setDeptName(user.getDeptName());
tokensCreateRequest.setTerminalType("WEB");
tokensCreateRequest.setTerminalIp(RequestUtil.getIp(httpServletRequest));
tokensCreateRequest.setTerminalInfo(RequestUtil.getUserAgent(httpServletRequest));
TokensCreateResponse tokensCreateResponse = tokensManager.create(tokensCreateRequest, LocalData.getSysToken());
if (tokensCreateResponse.hasError()) {
response.addErrors(tokensCreateResponse.getErrors());
return response;
}
return response;
}
} }

@ -0,0 +1,364 @@
<?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="${basePackage}.module.${moduleName}.mpr.${table.getCName()}Mapper">
<#if dataBase == 'Oracle'>
<sql id="table">"${module.modulePrefix?default("")}${table.tableName}"</sql>
<#elseif dataBase='MySQL'>
<sql id="table">`${module.modulePrefix?default("")}${table.tableName}`</sql>
<#elseif dataBase='SQLite'>
<sql id="table">"${module.modulePrefix?default("")}${table.tableName}"</sql>
</#if>
<sql id="entityColumnList">
<#if dataBase == 'Oracle'>
<#list table.fields as f>"${f.fieldName}"<#if f_has_next>,</#if></#list>
<#elseif dataBase='MySQL'>
<#list table.fields as f>`${f.fieldName}`<#if f_has_next>,</#if></#list>
<#elseif dataBase='SQLite'>
<#list table.fields as f>"${f.fieldName}"<#if f_has_next>,</#if></#list>
</#if>
</sql>
<resultMap id="${table.getFName()}" type="${basePackage}.module.${moduleName}.ent.${table.getCName()}">
<#list table.fields as f>
<result column="${f.fieldName}" jdbcType="${f.fieldType.jdbcType()}" property="${f.getFName()}"/>
</#list>
</resultMap>
<select id="find" resultMap="${table.getFName()}">
SELECT
<include refid="entityColumnList"/>
FROM
<include refid="table"/>
WHERE
<#if dataBase == 'Oracle'>
"IS_DELETED" = 0
<#elseif dataBase='MySQL'>
`IS_DELETED` = 0
<#elseif dataBase='SQLite'>
"IS_DELETED" = 0
</#if>
<#list table.fields as f>
<#if f.isQuery>
<#if dataBase == 'Oracle'>
<#if f.fieldType.javaType() == "Boolean">
<if test="request.${f.getFName()} != null">
AND "${f.fieldName}" = ${r"#{"}request.${f.getFName()}}
</if>
</#if>
<#if f.fieldType.javaType() == "Byte">
<if test="request.${f.getFName()} != null and request.${f.getFName()} != 0">
AND "${f.fieldName}" = ${r"#{"}request.${f.getFName()}}
</if>
</#if>
<#if f.fieldType.javaType() == "Short">
<if test="request.${f.getFName()} != null and request.${f.getFName()} != 0">
AND "${f.fieldName}" = ${r"#{"}request.${f.getFName()}}
</if>
</#if>
<#if f.fieldType.javaType() == "Integer">
<if test="request.${f.getFName()} != null and request.${f.getFName()} != 0">
AND "${f.fieldName}" = ${r"#{"}request.${f.getFName()}}
</if>
</#if>
<#if f.fieldType.javaType() == "Long">
<if test="request.${f.getFName()} != null and request.${f.getFName()} != 0">
AND "${f.fieldName}" = ${r"#{"}request.${f.getFName()}}
</if>
</#if>
<#if f.fieldType.javaType() == "Float">
<if test="request.${f.getFName()} != null and request.${f.getFName()} != 0">
AND "${f.fieldName}" = ${r"#{"}request.${f.getFName()}}
</if>
</#if>
<#if f.fieldType.javaType() == "Double">
<if test="request.${f.getFName()} != null and request.${f.getFName()} != 0">
AND "${f.fieldName}" = ${r"#{"}request.${f.getFName()}}
</if>
</#if>
<#if f.fieldType.javaType() == "Character">
<if test="request.${f.getFName()} != null and request.${f.getFName()} != ''">
AND "${f.fieldName}" = ${r"#{"}request.${f.getFName()}}
</if>
</#if>
<#if f.fieldType.javaType() == "String">
<if test="request.${f.getFName()} != null and request.${f.getFName()} != ''">
AND "${f.fieldName}" = ${r"#{"}request.${f.getFName()}}
</if>
</#if>
<#if f.fieldType.javaType() == "Date">
<if test="request.${f.getFName()} != null and request.${f.getFName()} != ''">
AND to_char("${f.fieldName}",'yyyy-MM-dd HH24:mi:ss') = to_char(${r"#{"}request.${f.getFName()}},'yyyy-MM-dd HH24:mi:ss')
</if>
</#if>
<#elseif dataBase='MySQL'>
<#if f.fieldType.javaType() == "Boolean">
<if test="request.${f.getFName()} != null">
AND `${f.fieldName}` = ${r"#{"}request.${f.getFName()}}
</if>
</#if>
<#if f.fieldType.javaType() == "Byte">
<if test="request.${f.getFName()} != null and request.${f.getFName()} != 0">
AND `${f.fieldName}` = ${r"#{"}request.${f.getFName()}}
</if>
</#if>
<#if f.fieldType.javaType() == "Short">
<if test="request.${f.getFName()} != null and request.${f.getFName()} != 0">
AND `${f.fieldName}` = ${r"#{"}request.${f.getFName()}}
</if>
</#if>
<#if f.fieldType.javaType() == "Integer">
<if test="request.${f.getFName()} != null and request.${f.getFName()} != 0">
AND `${f.fieldName}` = ${r"#{"}request.${f.getFName()}}
</if>
</#if>
<#if f.fieldType.javaType() == "Long">
<if test="request.${f.getFName()} != null and request.${f.getFName()} != 0">
AND `${f.fieldName}` = ${r"#{"}request.${f.getFName()}}
</if>
</#if>
<#if f.fieldType.javaType() == "Float">
<if test="request.${f.getFName()} != null and request.${f.getFName()} != 0">
AND `${f.fieldName}` = ${r"#{"}request.${f.getFName()}}
</if>
</#if>
<#if f.fieldType.javaType() == "Double">
<if test="request.${f.getFName()} != null and request.${f.getFName()} != 0">
AND `${f.fieldName}` = ${r"#{"}request.${f.getFName()}}
</if>
</#if>
<#if f.fieldType.javaType() == "Character">
<if test="request.${f.getFName()} != null and request.${f.getFName()} != ''">
AND `${f.fieldName}` = ${r"#{"}request.${f.getFName()}}
</if>
</#if>
<#if f.fieldType.javaType() == "String">
<if test="request.${f.getFName()} != null and request.${f.getFName()} != ''">
AND `${f.fieldName}` = ${r"#{"}request.${f.getFName()}}
</if>
</#if>
<#if f.fieldType.javaType() == "Date">
<if test="request.${f.getFName()} != null">
AND DATE_FORMAT(`${f.fieldName}`,"%Y-%m-%d %T") = DATE_FORMAT(${r"#{"}request.${f.getFName()}},"%Y-%m-%d %T")
</if>
</#if>
<#elseif dataBase='SQLite'>
<#if f.fieldType.javaType() == "Boolean">
<if test="request.${f.getFName()} != null">
AND ${f.fieldName} = ${r"#{"}request.${f.getFName()}}
</if>
</#if>
<#if f.fieldType.javaType() == "Byte">
<if test="request.${f.getFName()} != null and request.${f.getFName()} != 0">
AND ${f.fieldName} = ${r"#{"}request.${f.getFName()}}
</if>
</#if>
<#if f.fieldType.javaType() == "Short">
<if test="request.${f.getFName()} != null and request.${f.getFName()} != 0">
AND ${f.fieldName} = ${r"#{"}request.${f.getFName()}}
</if>
</#if>
<#if f.fieldType.javaType() == "Integer">
<if test="request.${f.getFName()} != null and request.${f.getFName()} != 0">
AND ${f.fieldName} = ${r"#{"}request.${f.getFName()}}
</if>
</#if>
<#if f.fieldType.javaType() == "Long">
<if test="request.${f.getFName()} != null and request.${f.getFName()} != 0">
AND ${f.fieldName} = ${r"#{"}request.${f.getFName()}}
</if>
</#if>
<#if f.fieldType.javaType() == "Float">
<if test="request.${f.getFName()} != null and request.${f.getFName()} != 0">
AND ${f.fieldName} = ${r"#{"}request.${f.getFName()}}
</if>
</#if>
<#if f.fieldType.javaType() == "Double">
<if test="request.${f.getFName()} != null and request.${f.getFName()} != 0">
AND ${f.fieldName} = ${r"#{"}request.${f.getFName()}}
</if>
</#if>
<#if f.fieldType.javaType() == "Character">
<if test="request.${f.getFName()} != null and request.${f.getFName()} != ''">
AND ${f.fieldName} = ${r"#{"}request.${f.getFName()}}
</if>
</#if>
<#if f.fieldType.javaType() == "String">
<if test="request.${f.getFName()} != null and request.${f.getFName()} != ''">
AND ${f.fieldName} = ${r"#{"}request.${f.getFName()}}
</if>
</#if>
<#if f.fieldType.javaType() == "Date">
<if test="request.${f.getFName()} != null">
AND ${f.fieldName} = ${r"#{"}request.${f.getFName()}}
</if>
</#if>
</#if>
</#if>
</#list>
</select>
<select id="search" resultMap="${table.getFName()}">
SELECT
<include refid="entityColumnList"/>
FROM
<include refid="table"/>
WHERE
<#if dataBase == 'Oracle'>
"IS_DELETED" = 0
<#elseif dataBase='MySQL'>
`IS_DELETED` = 0
</#if>
<if test="request.keyword != null and request.keyword != ''">
1 = 2
<#list table.fields as f>
<#if f.isSearch>
<#if dataBase == 'Oracle'>
OR "${f.fieldName}" LIKE CONCAT(CONCAT('%',${r"#{"}request.keyword}),'%')
<#elseif dataBase='MySQL'>
OR `${f.fieldName}` LIKE CONCAT('%',${r"#{request.keyword}"},'%')
</#if>
<#elseif dataBase='SQLite'>
OR ${f.fieldName} LIKE CONCAT('%',${r"#{request.keyword}"},'%')
</#if>
</#list>
</if>
</select>
<insert id="insert">
INSERT INTO
<include refid="table"/>
(
<include refid="entityColumnList"/>
)
VALUES
(
${r"#{"}request.id},
<#list table.fields as f>
<#if !f.isSystem>
${r"#{"}request.${f.getFName()},jdbcType=${f.fieldType.jdbcType()}},
</#if>
</#list>
0,
0,
${r"#{"}token.userId,jdbcType=NUMERIC},
<#if dataBase == 'Oracle'>sysdate<#elseif dataBase == 'MySQL'>sysdate()<#elseif dataBase == 'SQLite'>datetime('now','localtime')</#if>,
NULL,
NULL
)
</insert>
<insert id="insertBatch">
INSERT INTO
<include refid="table"/>
(
<include refid="entityColumnList"/>
)
VALUES
<foreach collection="list" item= "item" index ="index" separator=",">
(
${r"#{"}item.id},
<#list table.fields as f>
<#if !f.isSystem>
${r"#{"}item.${f.getFName()},jdbcType=${f.fieldType.jdbcType()}},
</#if>
</#list>
0,
0,
${r"#{"}token.userId,jdbcType=NUMERIC},
<#if dataBase == 'Oracle'>sysdate<#elseif dataBase == 'MySQL'>sysdate()<#elseif dataBase == 'SQLite'>datetime('now','localtime')</#if>,
NULL,
NULL
)
</foreach >
</insert>
<update id="delete">
UPDATE
<include refid="table"/>
<#if dataBase == 'Oracle'>
SET "IS_DELETED" = 1
WHERE "IS_DELETED" = 0
AND "ID" = ${r"#{"}request.id}
<#elseif dataBase='MySQL'>
SET `IS_DELETED` = 1
WHERE `IS_DELETED` = 0
AND `ID` = ${r"#{"}request.id}
</#if>
</update>
<update id="update">
UPDATE
<include refid="table"/>
SET
<#if dataBase == 'Oracle'>
<#list table.fields as f>
<#if !f.isPrimaryKey>
<#if !f.isSystem || f.fieldName == 'ID'>
"${f.fieldName}" = ${r"#{"}request.${f.getFName()},jdbcType=${f.fieldType.jdbcType()}},
</#if>
</#if>
</#list>
"ROW_VERSION" = "ROW_VERSION" + 1,
"LAST_UPDATE_BY" = ${r"#{"}token.userId},
"LAST_UPDATE_TIME" = sysdate
<#elseif dataBase='MySQL'>
<#list table.fields as f>
<#if !f.isPrimaryKey>
<#if !f.isSystem || f.fieldName == 'ID'>
`${f.fieldName}` = ${r"#{"}request.${f.getFName()},jdbcType=${f.fieldType.jdbcType()}},
</#if>
</#if>
</#list>
`ROW_VERSION` = `ROW_VERSION` + 1,
`LAST_UPDATE_BY` = ${r"#{"}token.userId},
`LAST_UPDATE_TIME` = sysdate()
<#elseif dataBase='SQLite'>
<#list table.fields as f>
<#if !f.isPrimaryKey>
<#if !f.isSystem || f.fieldName == 'ID'>
${f.fieldName} = ${r"#{"}request.${f.getFName()},jdbcType=${f.fieldType.jdbcType()}},
</#if>
</#if>
</#list>
ROW_VERSION = ROW_VERSION + 1,
LAST_UPDATE_BY = ${r"#{"}token.userId},
LAST_UPDATE_TIME = datetime('now','localtime')
</#if>
WHERE
<#if dataBase == 'Oracle'>
"IS_DELETED" = 0
AND "ID" = ${r"#{"}request.id}
AND "ROW_VERSION" = ${r"#{"}request.rowVersion}
<#elseif dataBase='MySQL'>
`IS_DELETED` = 0
AND `ID` = ${r"#{"}request.id}
AND `ROW_VERSION` = ${r"#{"}request.rowVersion}
<#elseif dataBase='SQLite'>
IS_DELETED = 0
AND ID = ${r"#{"}request.id}
AND ROW_VERSION = ${r"#{"}request.rowVersion}
</#if>
</update>
<select id="get" resultMap="${table.getFName()}">
SELECT
<include refid="entityColumnList"/>
FROM
<include refid="table"/>
WHERE
<#if dataBase == 'Oracle'>
"IS_DELETED" = 0
AND "ID" = ${r"#{request.id}"}
<#elseif dataBase='MySQL'>
`IS_DELETED` = 0
AND `ID` = ${r"#{request.id}"}
<#elseif dataBase='SQLite'>
IS_DELETED = 0
AND ID = ${r"#{request.id}"}
</#if>
</select>
</mapper>

@ -0,0 +1,364 @@
<?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="${basePackage}.module.${moduleName}.mpr.${table.getCName()}Mapper">
<#if dataBase == 'Oracle'>
<sql id="table">"${module.modulePrefix?default("")}${table.tableName}"</sql>
<#elseif dataBase='MySQL'>
<sql id="table">`${module.modulePrefix?default("")}${table.tableName}`</sql>
<#elseif dataBase='SQLite'>
<sql id="table">"${module.modulePrefix?default("")}${table.tableName}"</sql>
</#if>
<sql id="entityColumnList">
<#if dataBase == 'Oracle'>
<#list table.fields as f>"${f.fieldName}"<#if f_has_next>,</#if></#list>
<#elseif dataBase='MySQL'>
<#list table.fields as f>`${f.fieldName}`<#if f_has_next>,</#if></#list>
<#elseif dataBase='SQLite'>
<#list table.fields as f>"${f.fieldName}"<#if f_has_next>,</#if></#list>
</#if>
</sql>
<resultMap id="${table.getFName()}" type="${basePackage}.module.${moduleName}.ent.${table.getCName()}">
<#list table.fields as f>
<result column="${f.fieldName}" jdbcType="${f.fieldType.jdbcType()}" property="${f.getFName()}"/>
</#list>
</resultMap>
<select id="find" resultMap="${table.getFName()}">
SELECT
<include refid="entityColumnList"/>
FROM
<include refid="table"/>
WHERE
<#if dataBase == 'Oracle'>
"IS_DELETED" = 0
<#elseif dataBase='MySQL'>
`IS_DELETED` = 0
<#elseif dataBase='SQLite'>
"IS_DELETED" = 0
</#if>
<#list table.fields as f>
<#if f.isQuery>
<#if dataBase == 'Oracle'>
<#if f.fieldType.javaType() == "Boolean">
<if test="request.${f.getFName()} != null">
AND "${f.fieldName}" = ${r"#{"}request.${f.getFName()}}
</if>
</#if>
<#if f.fieldType.javaType() == "Byte">
<if test="request.${f.getFName()} != null and request.${f.getFName()} != 0">
AND "${f.fieldName}" = ${r"#{"}request.${f.getFName()}}
</if>
</#if>
<#if f.fieldType.javaType() == "Short">
<if test="request.${f.getFName()} != null and request.${f.getFName()} != 0">
AND "${f.fieldName}" = ${r"#{"}request.${f.getFName()}}
</if>
</#if>
<#if f.fieldType.javaType() == "Integer">
<if test="request.${f.getFName()} != null and request.${f.getFName()} != 0">
AND "${f.fieldName}" = ${r"#{"}request.${f.getFName()}}
</if>
</#if>
<#if f.fieldType.javaType() == "Long">
<if test="request.${f.getFName()} != null and request.${f.getFName()} != 0">
AND "${f.fieldName}" = ${r"#{"}request.${f.getFName()}}
</if>
</#if>
<#if f.fieldType.javaType() == "Float">
<if test="request.${f.getFName()} != null and request.${f.getFName()} != 0">
AND "${f.fieldName}" = ${r"#{"}request.${f.getFName()}}
</if>
</#if>
<#if f.fieldType.javaType() == "Double">
<if test="request.${f.getFName()} != null and request.${f.getFName()} != 0">
AND "${f.fieldName}" = ${r"#{"}request.${f.getFName()}}
</if>
</#if>
<#if f.fieldType.javaType() == "Character">
<if test="request.${f.getFName()} != null and request.${f.getFName()} != ''">
AND "${f.fieldName}" = ${r"#{"}request.${f.getFName()}}
</if>
</#if>
<#if f.fieldType.javaType() == "String">
<if test="request.${f.getFName()} != null and request.${f.getFName()} != ''">
AND "${f.fieldName}" = ${r"#{"}request.${f.getFName()}}
</if>
</#if>
<#if f.fieldType.javaType() == "Date">
<if test="request.${f.getFName()} != null and request.${f.getFName()} != ''">
AND to_char("${f.fieldName}",'yyyy-MM-dd HH24:mi:ss') = to_char(${r"#{"}request.${f.getFName()}},'yyyy-MM-dd HH24:mi:ss')
</if>
</#if>
<#elseif dataBase='MySQL'>
<#if f.fieldType.javaType() == "Boolean">
<if test="request.${f.getFName()} != null">
AND `${f.fieldName}` = ${r"#{"}request.${f.getFName()}}
</if>
</#if>
<#if f.fieldType.javaType() == "Byte">
<if test="request.${f.getFName()} != null and request.${f.getFName()} != 0">
AND `${f.fieldName}` = ${r"#{"}request.${f.getFName()}}
</if>
</#if>
<#if f.fieldType.javaType() == "Short">
<if test="request.${f.getFName()} != null and request.${f.getFName()} != 0">
AND `${f.fieldName}` = ${r"#{"}request.${f.getFName()}}
</if>
</#if>
<#if f.fieldType.javaType() == "Integer">
<if test="request.${f.getFName()} != null and request.${f.getFName()} != 0">
AND `${f.fieldName}` = ${r"#{"}request.${f.getFName()}}
</if>
</#if>
<#if f.fieldType.javaType() == "Long">
<if test="request.${f.getFName()} != null and request.${f.getFName()} != 0">
AND `${f.fieldName}` = ${r"#{"}request.${f.getFName()}}
</if>
</#if>
<#if f.fieldType.javaType() == "Float">
<if test="request.${f.getFName()} != null and request.${f.getFName()} != 0">
AND `${f.fieldName}` = ${r"#{"}request.${f.getFName()}}
</if>
</#if>
<#if f.fieldType.javaType() == "Double">
<if test="request.${f.getFName()} != null and request.${f.getFName()} != 0">
AND `${f.fieldName}` = ${r"#{"}request.${f.getFName()}}
</if>
</#if>
<#if f.fieldType.javaType() == "Character">
<if test="request.${f.getFName()} != null and request.${f.getFName()} != ''">
AND `${f.fieldName}` = ${r"#{"}request.${f.getFName()}}
</if>
</#if>
<#if f.fieldType.javaType() == "String">
<if test="request.${f.getFName()} != null and request.${f.getFName()} != ''">
AND `${f.fieldName}` = ${r"#{"}request.${f.getFName()}}
</if>
</#if>
<#if f.fieldType.javaType() == "Date">
<if test="request.${f.getFName()} != null">
AND DATE_FORMAT(`${f.fieldName}`,"%Y-%m-%d %T") = DATE_FORMAT(${r"#{"}request.${f.getFName()}},"%Y-%m-%d %T")
</if>
</#if>
<#elseif dataBase='SQLite'>
<#if f.fieldType.javaType() == "Boolean">
<if test="request.${f.getFName()} != null">
AND ${f.fieldName} = ${r"#{"}request.${f.getFName()}}
</if>
</#if>
<#if f.fieldType.javaType() == "Byte">
<if test="request.${f.getFName()} != null and request.${f.getFName()} != 0">
AND ${f.fieldName} = ${r"#{"}request.${f.getFName()}}
</if>
</#if>
<#if f.fieldType.javaType() == "Short">
<if test="request.${f.getFName()} != null and request.${f.getFName()} != 0">
AND ${f.fieldName} = ${r"#{"}request.${f.getFName()}}
</if>
</#if>
<#if f.fieldType.javaType() == "Integer">
<if test="request.${f.getFName()} != null and request.${f.getFName()} != 0">
AND ${f.fieldName} = ${r"#{"}request.${f.getFName()}}
</if>
</#if>
<#if f.fieldType.javaType() == "Long">
<if test="request.${f.getFName()} != null and request.${f.getFName()} != 0">
AND ${f.fieldName} = ${r"#{"}request.${f.getFName()}}
</if>
</#if>
<#if f.fieldType.javaType() == "Float">
<if test="request.${f.getFName()} != null and request.${f.getFName()} != 0">
AND ${f.fieldName} = ${r"#{"}request.${f.getFName()}}
</if>
</#if>
<#if f.fieldType.javaType() == "Double">
<if test="request.${f.getFName()} != null and request.${f.getFName()} != 0">
AND ${f.fieldName} = ${r"#{"}request.${f.getFName()}}
</if>
</#if>
<#if f.fieldType.javaType() == "Character">
<if test="request.${f.getFName()} != null and request.${f.getFName()} != ''">
AND ${f.fieldName} = ${r"#{"}request.${f.getFName()}}
</if>
</#if>
<#if f.fieldType.javaType() == "String">
<if test="request.${f.getFName()} != null and request.${f.getFName()} != ''">
AND ${f.fieldName} = ${r"#{"}request.${f.getFName()}}
</if>
</#if>
<#if f.fieldType.javaType() == "Date">
<if test="request.${f.getFName()} != null">
AND ${f.fieldName} = ${r"#{"}request.${f.getFName()}}
</if>
</#if>
</#if>
</#if>
</#list>
</select>
<select id="search" resultMap="${table.getFName()}">
SELECT
<include refid="entityColumnList"/>
FROM
<include refid="table"/>
WHERE
<#if dataBase == 'Oracle'>
"IS_DELETED" = 0
<#elseif dataBase='MySQL'>
`IS_DELETED` = 0
</#if>
<if test="request.keyword != null and request.keyword != ''">
1 = 2
<#list table.fields as f>
<#if f.isSearch>
<#if dataBase == 'Oracle'>
OR "${f.fieldName}" LIKE CONCAT(CONCAT('%',${r"#{"}request.keyword}),'%')
<#elseif dataBase='MySQL'>
OR `${f.fieldName}` LIKE CONCAT('%',${r"#{request.keyword}"},'%')
</#if>
<#elseif dataBase='SQLite'>
OR ${f.fieldName} LIKE CONCAT('%',${r"#{request.keyword}"},'%')
</#if>
</#list>
</if>
</select>
<insert id="insert">
INSERT INTO
<include refid="table"/>
(
<include refid="entityColumnList"/>
)
VALUES
(
${r"#{"}request.id},
<#list table.fields as f>
<#if !f.isSystem>
${r"#{"}request.${f.getFName()},jdbcType=${f.fieldType.jdbcType()}},
</#if>
</#list>
0,
0,
${r"#{"}token.userId,jdbcType=NUMERIC},
<#if dataBase == 'Oracle'>sysdate<#elseif dataBase == 'MySQL'>sysdate()<#elseif dataBase == 'SQLite'>datetime('now','localtime')</#if>,
NULL,
NULL
)
</insert>
<insert id="insertBatch">
INSERT INTO
<include refid="table"/>
(
<include refid="entityColumnList"/>
)
VALUES
<foreach collection="list" item= "item" index ="index" separator=",">
(
${r"#{"}item.id},
<#list table.fields as f>
<#if !f.isSystem>
${r"#{"}item.${f.getFName()},jdbcType=${f.fieldType.jdbcType()}},
</#if>
</#list>
0,
0,
${r"#{"}token.userId,jdbcType=NUMERIC},
<#if dataBase == 'Oracle'>sysdate<#elseif dataBase == 'MySQL'>sysdate()<#elseif dataBase == 'SQLite'>datetime('now','localtime')</#if>,
NULL,
NULL
)
</foreach >
</insert>
<update id="delete">
UPDATE
<include refid="table"/>
<#if dataBase == 'Oracle'>
SET "IS_DELETED" = 1
WHERE "IS_DELETED" = 0
AND "ID" = ${r"#{"}request.id}
<#elseif dataBase='MySQL'>
SET `IS_DELETED` = 1
WHERE `IS_DELETED` = 0
AND `ID` = ${r"#{"}request.id}
</#if>
</update>
<update id="update">
UPDATE
<include refid="table"/>
SET
<#if dataBase == 'Oracle'>
<#list table.fields as f>
<#if !f.isPrimaryKey>
<#if !f.isSystem || f.fieldName == 'ID'>
"${f.fieldName}" = ${r"#{"}request.${f.getFName()},jdbcType=${f.fieldType.jdbcType()}},
</#if>
</#if>
</#list>
"ROW_VERSION" = "ROW_VERSION" + 1,
"LAST_UPDATE_BY" = ${r"#{"}token.userId},
"LAST_UPDATE_TIME" = sysdate
<#elseif dataBase='MySQL'>
<#list table.fields as f>
<#if !f.isPrimaryKey>
<#if !f.isSystem || f.fieldName == 'ID'>
`${f.fieldName}` = ${r"#{"}request.${f.getFName()},jdbcType=${f.fieldType.jdbcType()}},
</#if>
</#if>
</#list>
`ROW_VERSION` = `ROW_VERSION` + 1,
`LAST_UPDATE_BY` = ${r"#{"}token.userId},
`LAST_UPDATE_TIME` = sysdate()
<#elseif dataBase='SQLite'>
<#list table.fields as f>
<#if !f.isPrimaryKey>
<#if !f.isSystem || f.fieldName == 'ID'>
${f.fieldName} = ${r"#{"}request.${f.getFName()},jdbcType=${f.fieldType.jdbcType()}},
</#if>
</#if>
</#list>
ROW_VERSION = ROW_VERSION + 1,
LAST_UPDATE_BY = ${r"#{"}token.userId},
LAST_UPDATE_TIME = datetime('now','localtime')
</#if>
WHERE
<#if dataBase == 'Oracle'>
"IS_DELETED" = 0
AND "ID" = ${r"#{"}request.id}
AND "ROW_VERSION" = ${r"#{"}request.rowVersion}
<#elseif dataBase='MySQL'>
`IS_DELETED` = 0
AND `ID` = ${r"#{"}request.id}
AND `ROW_VERSION` = ${r"#{"}request.rowVersion}
<#elseif dataBase='SQLite'>
IS_DELETED = 0
AND ID = ${r"#{"}request.id}
AND ROW_VERSION = ${r"#{"}request.rowVersion}
</#if>
</update>
<select id="get" resultMap="${table.getFName()}">
SELECT
<include refid="entityColumnList"/>
FROM
<include refid="table"/>
WHERE
<#if dataBase == 'Oracle'>
"IS_DELETED" = 0
AND "ID" = ${r"#{request.id}"}
<#elseif dataBase='MySQL'>
`IS_DELETED` = 0
AND `ID` = ${r"#{request.id}"}
<#elseif dataBase='SQLite'>
IS_DELETED = 0
AND ID = ${r"#{request.id}"}
</#if>
</select>
</mapper>

@ -13,7 +13,7 @@ public class ${table.getCName()}CreateResponse extends BaseResponse {
<#if module.isHasSysFields()> <#if module.isHasSysFields()>
/** /**
* ID * 主键
*/ */
private Long id; private Long id;

@ -10,7 +10,7 @@ import ${basePackage}.frame.excel.annotation.SheetName;
* *
* @author wangbing * @author wangbing
* @version 0.0.1 * @version 0.0.1
* @since 2019-07-20 * @since 2017-01-01
*/ */
@SheetName("字典") @SheetName("字典")
public class Dict extends BaseEntity { public class Dict extends BaseEntity {

@ -10,7 +10,7 @@ import ${basePackage}.frame.excel.annotation.SheetName;
* *
* @author wangbing * @author wangbing
* @version 0.0.1 * @version 0.0.1
* @since 2019-07-20 * @since 2017-01-01
*/ */
@SheetName("字典项") @SheetName("字典项")
public class DictItem extends BaseEntity { public class DictItem extends BaseEntity {

@ -10,7 +10,7 @@ import ${basePackage}.frame.base.BaseEntity;
* *
* @author author * @author author
* @version 0.0.1 * @version 0.0.1
* @since 2019-11-29 * @since 2017-01-01
*/ */
@SheetName("文件") @SheetName("文件")
public class File extends BaseEntity { public class File extends BaseEntity {

@ -10,7 +10,7 @@ import ${basePackage}.frame.base.BaseEntity;
* *
* @author author * @author author
* @version 0.0.1 * @version 0.0.1
* @since 2019-12-19 * @since 2017-01-01
*/ */
@SheetName("资源") @SheetName("资源")
public class Resource extends BaseEntity { public class Resource extends BaseEntity {

@ -10,7 +10,7 @@ import ${basePackage}.frame.base.BaseEntity;
* *
* @author wangbing * @author wangbing
* @version 0.0.1 * @version 0.0.1
* @since 2019-12-20 * @since 2017-01-01
*/ */
@SheetName("角色") @SheetName("角色")
public class Role extends BaseEntity { public class Role extends BaseEntity {

@ -7,7 +7,7 @@ import ${basePackage}.frame.base.BaseEntity;
* *
* @author wangbing * @author wangbing
* @version 0.0.1 * @version 0.0.1
* @since 2019-12-20 * @since 2017-01-01
*/ */
public class RoleResource extends BaseEntity { public class RoleResource extends BaseEntity {

@ -11,7 +11,7 @@ import ${basePackage}.frame.base.BaseEntity;
* *
* @author wangbing * @author wangbing
* @version 0.0.1 * @version 0.0.1
* @since 2019-12-20 * @since 2017-01-01
*/ */
@SheetName("通行证") @SheetName("通行证")
public class Tokens extends BaseEntity { public class Tokens extends BaseEntity {

@ -10,7 +10,7 @@ import ${basePackage}.frame.base.BaseEntity;
* *
* @author wangbing * @author wangbing
* @version 0.0.1 * @version 0.0.1
* @since 2019-12-20 * @since 2017-01-01
*/ */
@SheetName("用户") @SheetName("用户")
public class User extends BaseEntity { public class User extends BaseEntity {

@ -7,7 +7,7 @@ import ${basePackage}.frame.base.BaseEntity;
* *
* @author wangbing * @author wangbing
* @version 0.0.1 * @version 0.0.1
* @since 2019-12-20 * @since 2017-01-01
*/ */
public class UserRole extends BaseEntity { public class UserRole extends BaseEntity {

@ -9,7 +9,7 @@ import ${basePackage}.frame.base.Token;
* *
* @author author * @author author
* @version 0.0.1 * @version 0.0.1
* @since 2019-12-19 * @since 2017-01-01
*/ */
public interface ResourceManager { public interface ResourceManager {

@ -22,7 +22,7 @@ import org.springframework.transaction.annotation.Transactional;
* *
* @author author * @author author
* @version 0.0.1 * @version 0.0.1
* @since 2019-12-19 * @since 2017-01-01
*/ */
@Transactional @Transactional
@Service @Service

@ -9,7 +9,7 @@ import ${basePackage}.frame.base.Token;
* *
* @author wangbing * @author wangbing
* @version 0.0.1 * @version 0.0.1
* @since 2019-12-20 * @since 2017-01-01
*/ */
public interface RoleManager { public interface RoleManager {

@ -22,7 +22,7 @@ import org.springframework.transaction.annotation.Transactional;
* *
* @author wangbing * @author wangbing
* @version 0.0.1 * @version 0.0.1
* @since 2019-12-20 * @since 2017-01-01
*/ */
@Transactional @Transactional
@Service @Service

@ -9,7 +9,7 @@ import ${basePackage}.frame.base.Token;
* *
* @author wangbing * @author wangbing
* @version 0.0.1 * @version 0.0.1
* @since 2019-12-20 * @since 2017-01-01
*/ */
public interface RoleResourceManager { public interface RoleResourceManager {

@ -22,7 +22,7 @@ import org.springframework.transaction.annotation.Transactional;
* *
* @author wangbing * @author wangbing
* @version 0.0.1 * @version 0.0.1
* @since 2019-12-20 * @since 2017-01-01
*/ */
@Transactional @Transactional
@Service @Service

@ -9,7 +9,7 @@ import ${basePackage}.frame.base.Token;
* *
* @author author * @author author
* @version 0.0.1 * @version 0.0.1
* @since 2019-12-19 * @since 2017-01-01
*/ */
public interface TokensManager { public interface TokensManager {

@ -33,12 +33,14 @@ import ${basePackage}.module.system.rsp.TokensUpdateResponse;
* *
* @author author * @author author
* @version 0.0.1 * @version 0.0.1
* @since 2019-12-19 * @since 2017-01-01
*/ */
@Transactional @Transactional
@Service @Service
public class TokensManagerImpl implements TokensManager { public class TokensManagerImpl implements TokensManager {
@Value("${r'${web.url.auth.admin}'}")
private String admin;
@Autowired @Autowired
private TokensMapper tokensMapper; private TokensMapper tokensMapper;

@ -9,7 +9,7 @@ import ${basePackage}.frame.base.Token;
* *
* @author wangbing * @author wangbing
* @version 0.0.1 * @version 0.0.1
* @since 2019-12-20 * @since 2017-01-01
*/ */
public interface UserManager { public interface UserManager {

@ -22,7 +22,7 @@ import org.springframework.transaction.annotation.Transactional;
* *
* @author wangbing * @author wangbing
* @version 0.0.1 * @version 0.0.1
* @since 2019-12-20 * @since 2017-01-01
*/ */
@Transactional @Transactional
@Service @Service

@ -9,7 +9,7 @@ import ${basePackage}.frame.base.Token;
* *
* @author wangbing * @author wangbing
* @version 0.0.1 * @version 0.0.1
* @since 2019-12-20 * @since 2017-01-01
*/ */
public interface UserRoleManager { public interface UserRoleManager {

@ -22,7 +22,7 @@ import org.springframework.transaction.annotation.Transactional;
* *
* @author wangbing * @author wangbing
* @version 0.0.1 * @version 0.0.1
* @since 2019-12-20 * @since 2017-01-01
*/ */
@Transactional @Transactional
@Service @Service

@ -15,7 +15,7 @@ import java.util.List;
* DICT_ITEM - * DICT_ITEM -
* *
* @author wangbing * @author wangbing
* @since 2019-07-20 * @since 2017-01-01
*/ */
@Mapper @Mapper
public interface DictItemMapper { public interface DictItemMapper {

@ -11,7 +11,7 @@ import java.util.List;
* DICT - * DICT -
* *
* @author wangbing * @author wangbing
* @since 2019-07-20 * @since 2017-01-01
*/ */
@Mapper @Mapper
public interface DictMapper { public interface DictMapper {

@ -7,7 +7,7 @@
<sql id="table">`SYS_RESOURCE`</sql> <sql id="table">`SYS_RESOURCE`</sql>
<sql id="entityColumnList"> <sql id="entityColumnList">
`ID`,`VALUE`,`COMMENT`,`RESOURCE_TYPE`,`VALID`,`ROW_VERSION`,`IS_DELETED`,`CREATE_BY`,`CREATE_TIME`,`LAST_UPDATE_BY`,`LAST_UPDATE_TIME` `ID`,`VALUE`,`COMMENT`,`RESOURCE_TYPE`,`NODE`,`SUP_ID`,`VALID`,`ROW_VERSION`,`IS_DELETED`,`CREATE_BY`,`CREATE_TIME`,`LAST_UPDATE_BY`,`LAST_UPDATE_TIME`
</sql> </sql>
<resultMap id="resource" type="${basePackage}.module.system.ent.Resource"> <resultMap id="resource" type="${basePackage}.module.system.ent.Resource">
@ -15,6 +15,8 @@
<result column="VALUE" jdbcType="VARCHAR" property="value"/> <result column="VALUE" jdbcType="VARCHAR" property="value"/>
<result column="COMMENT" jdbcType="VARCHAR" property="comment"/> <result column="COMMENT" jdbcType="VARCHAR" property="comment"/>
<result column="RESOURCE_TYPE" jdbcType="VARCHAR" property="resourceType"/> <result column="RESOURCE_TYPE" jdbcType="VARCHAR" property="resourceType"/>
<result column="NODE" jdbcType="BIT" property="node"/>
<result column="SUP_ID" jdbcType="BIGINT" property="supId"/>
<result column="VALID" jdbcType="BIT" property="valid"/> <result column="VALID" jdbcType="BIT" property="valid"/>
<result column="ROW_VERSION" jdbcType="BIGINT" property="rowVersion"/> <result column="ROW_VERSION" jdbcType="BIGINT" property="rowVersion"/>
<result column="IS_DELETED" jdbcType="BIT" property="isDeleted"/> <result column="IS_DELETED" jdbcType="BIT" property="isDeleted"/>
@ -40,6 +42,12 @@
<if test="request.resourceType != null and request.resourceType != ''"> <if test="request.resourceType != null and request.resourceType != ''">
AND `RESOURCE_TYPE` = ${r"#"}{request.resourceType} AND `RESOURCE_TYPE` = ${r"#"}{request.resourceType}
</if> </if>
<if test="request.node != null">
AND `NODE` = ${r"#"}{request.node}
</if>
<if test="request.supId != null and request.supId != 0">
AND `SUP_ID` = ${r"#"}{request.supId}
</if>
<if test="request.valid != null"> <if test="request.valid != null">
AND `VALID` = ${r"#"}{request.valid} AND `VALID` = ${r"#"}{request.valid}
</if> </if>
@ -69,6 +77,8 @@
${r"#"}{request.value,jdbcType=VARCHAR}, ${r"#"}{request.value,jdbcType=VARCHAR},
${r"#"}{request.comment,jdbcType=VARCHAR}, ${r"#"}{request.comment,jdbcType=VARCHAR},
${r"#"}{request.resourceType,jdbcType=VARCHAR}, ${r"#"}{request.resourceType,jdbcType=VARCHAR},
${r"#"}{request.node,jdbcType=BIT},
${r"#"}{request.supId,jdbcType=BIGINT},
${r"#"}{request.valid,jdbcType=BIT}, ${r"#"}{request.valid,jdbcType=BIT},
0, 0,
0, 0,
@ -92,6 +102,8 @@
${r"#"}{item.value,jdbcType=VARCHAR}, ${r"#"}{item.value,jdbcType=VARCHAR},
${r"#"}{item.comment,jdbcType=VARCHAR}, ${r"#"}{item.comment,jdbcType=VARCHAR},
${r"#"}{item.resourceType,jdbcType=VARCHAR}, ${r"#"}{item.resourceType,jdbcType=VARCHAR},
${r"#"}{item.node,jdbcType=BIT},
${r"#"}{item.supId,jdbcType=BIGINT},
${r"#"}{item.valid,jdbcType=BIT}, ${r"#"}{item.valid,jdbcType=BIT},
0, 0,
0, 0,
@ -118,6 +130,8 @@
`VALUE` = ${r"#"}{request.value,jdbcType=VARCHAR}, `VALUE` = ${r"#"}{request.value,jdbcType=VARCHAR},
`COMMENT` = ${r"#"}{request.comment,jdbcType=VARCHAR}, `COMMENT` = ${r"#"}{request.comment,jdbcType=VARCHAR},
`RESOURCE_TYPE` = ${r"#"}{request.resourceType,jdbcType=VARCHAR}, `RESOURCE_TYPE` = ${r"#"}{request.resourceType,jdbcType=VARCHAR},
`NODE` = ${r"#"}{request.node,jdbcType=BIT},
`SUP_ID` = ${r"#"}{request.supId,jdbcType=BIGINT},
`VALID` = ${r"#"}{request.valid,jdbcType=BIT}, `VALID` = ${r"#"}{request.valid,jdbcType=BIT},
`ROW_VERSION` = `ROW_VERSION` + 1, `ROW_VERSION` = `ROW_VERSION` + 1,
`LAST_UPDATE_BY` = ${r"#"}{token.userId}, `LAST_UPDATE_BY` = ${r"#"}{token.userId},

@ -0,0 +1,102 @@
package ${basePackage}.module.system.req;
import ${basePackage}.frame.base.BaseRequest;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.NotEmpty;
import org.hibernate.validator.constraints.Length;
/**
* DeptCreateRequest -
*
* @author wangbing
* @version 0.0.1
* @since 2017-01-01
*/
public class DeptCreateRequest extends BaseRequest {
/**
*
*/
@NotEmpty(message = "[deptCode]部门代码不能为空")
@Length(min = 0, max = 50, message = "[deptCode]部门代码长度不合法(0-50)")
private String deptCode;
/**
*
*/
@NotEmpty(message = "[deptName]部门名称不能为空")
@Length(min = 0, max = 100, message = "[deptName]部门名称长度不合法(0-100)")
private String deptName;
/**
*
*/
@Length(min = 0, max = 50, message = "[deptAlias]部门别名长度不合法(0-50)")
private String deptAlias;
/**
*
*/
@Length(min = 0, max = 50, message = "[supCode]父部门代码长度不合法(0-50)")
private String supCode;
/**
*
*/
@Length(min = 0, max = 100, message = "[supName]父部门名称长度不合法(0-100)")
private String supName;
/**
*
*/
@NotNull(message = "[valid]是否有效不能为NULL")
private Boolean valid;
public String getDeptCode() {
return this.deptCode;
}
public void setDeptCode(String deptCode) {
this.deptCode = deptCode;
}
public String getDeptName() {
return this.deptName;
}
public void setDeptName(String deptName) {
this.deptName = deptName;
}
public String getDeptAlias() {
return this.deptAlias;
}
public void setDeptAlias(String deptAlias) {
this.deptAlias = deptAlias;
}
public String getSupCode() {
return this.supCode;
}
public void setSupCode(String supCode) {
this.supCode = supCode;
}
public String getSupName() {
return this.supName;
}
public void setSupName(String supName) {
this.supName = supName;
}
public Boolean getValid() {
return this.valid;
}
public void setValid(Boolean valid) {
this.valid = valid;
}
}

@ -0,0 +1,28 @@
package ${basePackage}.module.system.req;
import ${basePackage}.frame.base.BaseUpdateRequest;
import javax.validation.constraints.NotNull;
/**
* DeptDeleteRequest -
*
* @author wangbing
* @version 0.0.1
* @since 2017-01-01
*/
public class DeptDeleteRequest extends BaseUpdateRequest {
/**
*
*/
@NotNull(message = "[id]主键不能为空")
private long id;
public long getId() {
return this.id;
}
public void setId(long id) {
this.id = id;
}
}

@ -0,0 +1,91 @@
package ${basePackage}.module.system.req;
import ${basePackage}.frame.base.BaseFindRequest;
/**
* DeptRequest -
*
* @author wangbing
* @version 0.0.1
* @since 2017-01-01
*/
public class DeptFindRequest extends BaseFindRequest {
/**
*
*/
private String deptCode;
/**
*
*/
private String deptName;
/**
*
*/
private String deptAlias;
/**
*
*/
private String supCode;
/**
*
*/
private String supName;
/**
*
*/
private Boolean valid;
public String getDeptCode() {
return this.deptCode;
}
public void setDeptCode(String deptCode) {
this.deptCode = deptCode;
}
public String getDeptName() {
return this.deptName;
}
public void setDeptName(String deptName) {
this.deptName = deptName;
}
public String getDeptAlias() {
return this.deptAlias;
}
public void setDeptAlias(String deptAlias) {
this.deptAlias = deptAlias;
}
public String getSupCode() {
return this.supCode;
}
public void setSupCode(String supCode) {
this.supCode = supCode;
}
public String getSupName() {
return this.supName;
}
public void setSupName(String supName) {
this.supName = supName;
}
public Boolean getValid() {
return this.valid;
}
public void setValid(Boolean valid) {
this.valid = valid;
}
}

@ -0,0 +1,28 @@
package ${basePackage}.module.system.req;
import ${basePackage}.frame.base.BaseRequest;
import javax.validation.constraints.NotNull;
/**
* DeptGetRequest -
*
* @author wangbing
* @version 0.0.1
* @since 2017-01-01
*/
public class DeptGetRequest extends BaseRequest {
/**
*
*/
@NotNull(message = "[id]主键不能为空")
private long id;
public long getId() {
return this.id;
}
public void setId(long id) {
this.id = id;
}
}

@ -0,0 +1,116 @@
package ${basePackage}.module.system.req;
import ${basePackage}.frame.base.BaseUpdateRequest;
import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotEmpty;
/**
* DeptUpdateRequest -
*
* @author wangbing
* @version 0.0.1
* @since 2017-01-01
*/
public class DeptUpdateRequest extends BaseUpdateRequest {
/**
*
*/
@NotNull(message = "[id]主键不能为NULL")
private Long id;
/**
*
*/
@NotEmpty(message = "[deptCode]部门代码不能为空")
@Length(min = 0, max = 50, message = "[deptCode]部门代码长度不合法(0-50)")
private String deptCode;
/**
*
*/
@NotEmpty(message = "[deptName]部门名称不能为空")
@Length(min = 0, max = 100, message = "[deptName]部门名称长度不合法(0-100)")
private String deptName;
/**
*
*/
@Length(min = 0, max = 50, message = "[deptAlias]部门别名长度不合法(0-50)")
private String deptAlias;
/**
*
*/
@Length(min = 0, max = 50, message = "[supCode]父部门代码长度不合法(0-50)")
private String supCode;
/**
*
*/
@Length(min = 0, max = 100, message = "[supName]父部门名称长度不合法(0-100)")
private String supName;
/**
*
*/
@NotNull(message = "[valid]是否有效不能为NULL")
private Boolean valid;
public Long getId() {
return this.id;
}
public void setId(Long id) {
this.id = id;
}
public String getDeptCode() {
return this.deptCode;
}
public void setDeptCode(String deptCode) {
this.deptCode = deptCode;
}
public String getDeptName() {
return this.deptName;
}
public void setDeptName(String deptName) {
this.deptName = deptName;
}
public String getDeptAlias() {
return this.deptAlias;
}
public void setDeptAlias(String deptAlias) {
this.deptAlias = deptAlias;
}
public String getSupCode() {
return this.supCode;
}
public void setSupCode(String supCode) {
this.supCode = supCode;
}
public String getSupName() {
return this.supName;
}
public void setSupName(String supName) {
this.supName = supName;
}
public Boolean getValid() {
return this.valid;
}
public void setValid(Boolean valid) {
this.valid = valid;
}
}

@ -10,7 +10,7 @@ import javax.validation.constraints.NotNull;
* *
* @author wangbing * @author wangbing
* @version 0.0.1 * @version 0.0.1
* @since 2019-07-20 * @since 2017-01-01
*/ */
public class DictCreateRequest extends BaseRequest { public class DictCreateRequest extends BaseRequest {

@ -9,7 +9,7 @@ import javax.validation.constraints.NotNull;
* *
* @author wangbing * @author wangbing
* @version 0.0.1 * @version 0.0.1
* @since 2019-07-20 * @since 2017-01-01
*/ */
public class DictDeleteRequest extends BaseUpdateRequest { public class DictDeleteRequest extends BaseUpdateRequest {

@ -7,7 +7,7 @@ import ${basePackage}.frame.base.BaseFindRequest;
* *
* @author wangbing * @author wangbing
* @version 0.0.1 * @version 0.0.1
* @since 2019-07-20 * @since 2017-01-01
*/ */
public class DictFindRequest extends BaseFindRequest { public class DictFindRequest extends BaseFindRequest {

@ -9,7 +9,7 @@ import javax.validation.constraints.NotNull;
* *
* @author wangbing * @author wangbing
* @version 0.0.1 * @version 0.0.1
* @since 2019-07-20 * @since 2017-01-01
*/ */
public class DictGetRequest extends BaseRequest { public class DictGetRequest extends BaseRequest {

@ -10,7 +10,7 @@ import javax.validation.constraints.NotNull;
* *
* @author wangbing * @author wangbing
* @version 0.0.1 * @version 0.0.1
* @since 2019-07-20 * @since 2017-01-01
*/ */
public class DictItemCreateRequest extends BaseRequest { public class DictItemCreateRequest extends BaseRequest {

@ -9,7 +9,7 @@ import javax.validation.constraints.NotNull;
* *
* @author wangbing * @author wangbing
* @version 0.0.1 * @version 0.0.1
* @since 2019-07-20 * @since 2017-01-01
*/ */
public class DictItemDeleteRequest extends BaseUpdateRequest { public class DictItemDeleteRequest extends BaseUpdateRequest {

@ -7,7 +7,7 @@ import ${basePackage}.frame.base.BaseFindRequest;
* *
* @author wangbing * @author wangbing
* @version 0.0.1 * @version 0.0.1
* @since 2019-07-20 * @since 2017-01-01
*/ */
public class DictItemFindRequest extends BaseFindRequest { public class DictItemFindRequest extends BaseFindRequest {

@ -9,7 +9,7 @@ import javax.validation.constraints.NotNull;
* *
* @author wangbing * @author wangbing
* @version 0.0.1 * @version 0.0.1
* @since 2019-07-20 * @since 2017-01-01
*/ */
public class DictItemGetRequest extends BaseRequest { public class DictItemGetRequest extends BaseRequest {

@ -10,7 +10,7 @@ import javax.validation.constraints.NotNull;
* *
* @author wangbing * @author wangbing
* @version 0.0.1 * @version 0.0.1
* @since 2019-07-20 * @since 2017-01-01
*/ */
public class DictItemUpdateRequest extends BaseUpdateRequest { public class DictItemUpdateRequest extends BaseUpdateRequest {

@ -10,7 +10,7 @@ import javax.validation.constraints.NotNull;
* *
* @author wangbing * @author wangbing
* @version 0.0.1 * @version 0.0.1
* @since 2019-07-20 * @since 2017-01-01
*/ */
public class DictLoadRequest extends BaseRequest { public class DictLoadRequest extends BaseRequest {

@ -11,7 +11,7 @@ import javax.validation.constraints.NotNull;
* *
* @author wangbing * @author wangbing
* @version 0.0.1 * @version 0.0.1
* @since 2019-07-20 * @since 2017-01-01
*/ */
public class DictUpdateRequest extends BaseUpdateRequest { public class DictUpdateRequest extends BaseUpdateRequest {

@ -2,23 +2,23 @@ package ${basePackage}.module.system.req;
import ${basePackage}.frame.base.BaseRequest; import ${basePackage}.frame.base.BaseRequest;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotEmpty;
import org.hibernate.validator.constraints.Length; import org.hibernate.validator.constraints.Length;
import ${basePackage}.frame.validation.Dict; import ${basePackage}.frame.validation.Dict;
/** /**
* ResourceCreateRequest - * ResourceCreateRequest -
* *
* @author author * @author wangbing
* @version 0.0.1 * @version 0.0.1
* @since 2019-12-19 * @since 2019-12-22
*/ */
public class ResourceCreateRequest extends BaseRequest { public class ResourceCreateRequest extends BaseRequest {
/** /**
* *
*/ */
@NotBlank(message = "[value]资源内容不能为空") @NotEmpty(message = "[value]资源内容不能为空")
@Length(min = 0, max = 100, message = "[value]资源内容长度不合法(0-100)") @Length(min = 0, max = 100, message = "[value]资源内容长度不合法(0-100)")
private String value; private String value;
@ -35,12 +35,6 @@ public class ResourceCreateRequest extends BaseRequest {
@Dict(name = "RESOURCE_TYPE") @Dict(name = "RESOURCE_TYPE")
private String resourceType; private String resourceType;
/**
*
*/
@NotNull(message = "[valid]是否有效不能为NULL")
private Boolean valid;
/** /**
* *
*/ */
@ -52,6 +46,12 @@ public class ResourceCreateRequest extends BaseRequest {
*/ */
private Long supId; private Long supId;
/**
*
*/
@NotNull(message = "[valid]是否有效不能为NULL")
private Boolean valid;
public String getValue() { public String getValue() {
return this.value; return this.value;
} }
@ -76,14 +76,6 @@ public class ResourceCreateRequest extends BaseRequest {
this.resourceType = resourceType; this.resourceType = resourceType;
} }
public Boolean getValid() {
return this.valid;
}
public void setValid(Boolean valid) {
this.valid = valid;
}
public Boolean getNode() { public Boolean getNode() {
return this.node; return this.node;
} }
@ -99,4 +91,12 @@ public class ResourceCreateRequest extends BaseRequest {
public void setSupId(Long supId) { public void setSupId(Long supId) {
this.supId = supId; this.supId = supId;
} }
public Boolean getValid() {
return this.valid;
}
public void setValid(Boolean valid) {
this.valid = valid;
}
} }

@ -8,7 +8,7 @@ import javax.validation.constraints.NotNull;
* *
* @author author * @author author
* @version 0.0.1 * @version 0.0.1
* @since 2019-12-19 * @since 2017-01-01
*/ */
public class ResourceDeleteRequest extends BaseUpdateRequest { public class ResourceDeleteRequest extends BaseUpdateRequest {

@ -8,7 +8,7 @@ import ${basePackage}.frame.validation.Dict;
* *
* @author author * @author author
* @version 0.0.1 * @version 0.0.1
* @since 2019-12-19 * @since 2017-01-01
*/ */
public class ResourceFindRequest extends BaseFindRequest { public class ResourceFindRequest extends BaseFindRequest {

@ -8,7 +8,7 @@ import javax.validation.constraints.NotNull;
* *
* @author author * @author author
* @version 0.0.1 * @version 0.0.1
* @since 2019-12-19 * @since 2017-01-01
*/ */
public class ResourceGetRequest extends BaseRequest { public class ResourceGetRequest extends BaseRequest {

@ -3,15 +3,15 @@ package ${basePackage}.module.system.req;
import ${basePackage}.frame.base.BaseUpdateRequest; import ${basePackage}.frame.base.BaseUpdateRequest;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.Length; import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotEmpty;
import ${basePackage}.frame.validation.Dict; import ${basePackage}.frame.validation.Dict;
/** /**
* ResourceUpdateRequest - * ResourceUpdateRequest -
* *
* @author author * @author wangbing
* @version 0.0.1 * @version 0.0.1
* @since 2019-12-19 * @since 2019-12-22
*/ */
public class ResourceUpdateRequest extends BaseUpdateRequest { public class ResourceUpdateRequest extends BaseUpdateRequest {
@ -24,7 +24,7 @@ public class ResourceUpdateRequest extends BaseUpdateRequest {
/** /**
* *
*/ */
@NotBlank(message = "[value]资源内容不能为空") @NotEmpty(message = "[value]资源内容不能为空")
@Length(min = 0, max = 100, message = "[value]资源内容长度不合法(0-100)") @Length(min = 0, max = 100, message = "[value]资源内容长度不合法(0-100)")
private String value; private String value;
@ -41,12 +41,6 @@ public class ResourceUpdateRequest extends BaseUpdateRequest {
@Dict(name = "RESOURCE_TYPE") @Dict(name = "RESOURCE_TYPE")
private String resourceType; private String resourceType;
/**
*
*/
@NotNull(message = "[valid]是否有效不能为NULL")
private Boolean valid;
/** /**
* *
*/ */
@ -58,6 +52,12 @@ public class ResourceUpdateRequest extends BaseUpdateRequest {
*/ */
private Long supId; private Long supId;
/**
*
*/
@NotNull(message = "[valid]是否有效不能为NULL")
private Boolean valid;
public Long getId() { public Long getId() {
return this.id; return this.id;
} }
@ -90,14 +90,6 @@ public class ResourceUpdateRequest extends BaseUpdateRequest {
this.resourceType = resourceType; this.resourceType = resourceType;
} }
public Boolean getValid() {
return this.valid;
}
public void setValid(Boolean valid) {
this.valid = valid;
}
public Boolean getNode() { public Boolean getNode() {
return this.node; return this.node;
} }
@ -113,4 +105,12 @@ public class ResourceUpdateRequest extends BaseUpdateRequest {
public void setSupId(Long supId) { public void setSupId(Long supId) {
this.supId = supId; this.supId = supId;
} }
public Boolean getValid() {
return this.valid;
}
public void setValid(Boolean valid) {
this.valid = valid;
}
} }

@ -0,0 +1,44 @@
package ${basePackage}.module.system.req;
import ${basePackage}.frame.base.BaseRequest;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.NotEmpty;
import org.hibernate.validator.constraints.Length;
/**
* RoleResourceCreateRequest -
*
* @author wangbing
* @version 0.0.1
* @since 2017-01-01
*/
public class RoleResourceCreateRequest extends BaseRequest {
/**
*
*/
@NotNull(message = "[roleId]角色主键不能为NULL")
private Long roleId;
/**
*
*/
@NotNull(message = "[resourceId]资源主键不能为NULL")
private Long resourceId;
public Long getRoleId() {
return this.roleId;
}
public void setRoleId(Long roleId) {
this.roleId = roleId;
}
public Long getResourceId() {
return this.resourceId;
}
public void setResourceId(Long resourceId) {
this.resourceId = resourceId;
}
}

@ -0,0 +1,28 @@
package ${basePackage}.module.system.req;
import ${basePackage}.frame.base.BaseUpdateRequest;
import javax.validation.constraints.NotNull;
/**
* RoleResourceDeleteRequest -
*
* @author wangbing
* @version 0.0.1
* @since 2017-01-01
*/
public class RoleResourceDeleteRequest extends BaseUpdateRequest {
/**
*
*/
@NotNull(message = "[id]主键不能为空")
private long id;
public long getId() {
return this.id;
}
public void setId(long id) {
this.id = id;
}
}

@ -0,0 +1,39 @@
package ${basePackage}.module.system.req;
import ${basePackage}.frame.base.BaseFindRequest;
/**
* RoleResourceRequest -
*
* @author wangbing
* @version 0.0.1
* @since 2017-01-01
*/
public class RoleResourceFindRequest extends BaseFindRequest {
/**
*
*/
private Long roleId;
/**
*
*/
private Long resourceId;
public Long getRoleId() {
return this.roleId;
}
public void setRoleId(Long roleId) {
this.roleId = roleId;
}
public Long getResourceId() {
return this.resourceId;
}
public void setResourceId(Long resourceId) {
this.resourceId = resourceId;
}
}

@ -0,0 +1,28 @@
package ${basePackage}.module.system.req;
import ${basePackage}.frame.base.BaseRequest;
import javax.validation.constraints.NotNull;
/**
* RoleResourceGetRequest -
*
* @author wangbing
* @version 0.0.1
* @since 2017-01-01
*/
public class RoleResourceGetRequest extends BaseRequest {
/**
*
*/
@NotNull(message = "[id]主键不能为空")
private long id;
public long getId() {
return this.id;
}
public void setId(long id) {
this.id = id;
}
}

@ -0,0 +1,58 @@
package ${basePackage}.module.system.req;
import ${basePackage}.frame.base.BaseUpdateRequest;
import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotEmpty;
/**
* RoleResourceUpdateRequest -
*
* @author wangbing
* @version 0.0.1
* @since 2017-01-01
*/
public class RoleResourceUpdateRequest extends BaseUpdateRequest {
/**
*
*/
@NotNull(message = "[id]主键不能为NULL")
private Long id;
/**
*
*/
@NotNull(message = "[roleId]角色主键不能为NULL")
private Long roleId;
/**
*
*/
@NotNull(message = "[resourceId]资源主键不能为NULL")
private Long resourceId;
public Long getId() {
return this.id;
}
public void setId(Long id) {
this.id = id;
}
public Long getRoleId() {
return this.roleId;
}
public void setRoleId(Long roleId) {
this.roleId = roleId;
}
public Long getResourceId() {
return this.resourceId;
}
public void setResourceId(Long resourceId) {
this.resourceId = resourceId;
}
}

@ -10,7 +10,7 @@ import java.util.Date;
* *
* @author wangbing * @author wangbing
* @version 0.0.1 * @version 0.0.1
* @since 2019-12-20 * @since 2017-01-01
*/ */
public class TokensBuildRequest extends BaseFindRequest { public class TokensBuildRequest extends BaseFindRequest {

@ -12,7 +12,7 @@ import ${basePackage}.frame.validation.Dict;
* *
* @author wangbing * @author wangbing
* @version 0.0.1 * @version 0.0.1
* @since 2019-12-20 * @since 2017-01-01
*/ */
public class TokensCreateRequest extends BaseRequest { public class TokensCreateRequest extends BaseRequest {

@ -8,7 +8,7 @@ import javax.validation.constraints.NotNull;
* *
* @author author * @author author
* @version 0.0.1 * @version 0.0.1
* @since 2019-12-19 * @since 2017-01-01
*/ */
public class TokensDeleteRequest extends BaseUpdateRequest { public class TokensDeleteRequest extends BaseUpdateRequest {

@ -9,7 +9,7 @@ import ${basePackage}.frame.validation.Dict;
* *
* @author wangbing * @author wangbing
* @version 0.0.1 * @version 0.0.1
* @since 2019-12-20 * @since 2017-01-01
*/ */
public class TokensFindRequest extends BaseFindRequest { public class TokensFindRequest extends BaseFindRequest {

@ -8,7 +8,7 @@ import javax.validation.constraints.NotNull;
* *
* @author author * @author author
* @version 0.0.1 * @version 0.0.1
* @since 2019-12-19 * @since 2017-01-01
*/ */
public class TokensGetRequest extends BaseRequest { public class TokensGetRequest extends BaseRequest {

@ -12,7 +12,7 @@ import ${basePackage}.frame.validation.Dict;
* *
* @author wangbing * @author wangbing
* @version 0.0.1 * @version 0.0.1
* @since 2019-12-20 * @since 2017-01-01
*/ */
public class TokensUpdateRequest extends BaseUpdateRequest { public class TokensUpdateRequest extends BaseUpdateRequest {

@ -0,0 +1,132 @@
package ${basePackage}.module.system.req;
import ${basePackage}.frame.base.BaseRequest;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.NotEmpty;
import org.hibernate.validator.constraints.Length;
import ${basePackage}.frame.validation.Dict;
/**
* UserCreateRequest -
*
* @author wangbing
* @version 0.0.1
* @since 2017-01-01
*/
public class UserCreateRequest extends BaseRequest {
/**
*
*/
@NotEmpty(message = "[userName]用户账户不能为空")
@Length(min = 0, max = 100, message = "[userName]用户账户长度不合法(0-100)")
private String userName;
/**
*
*/
@NotEmpty(message = "[userCode]用户代码不能为空")
@Length(min = 0, max = 50, message = "[userCode]用户代码长度不合法(0-50)")
private String userCode;
/**
*
*/
@Length(min = 0, max = 50, message = "[userAlias]用户别名长度不合法(0-50)")
private String userAlias;
/**
*
*/
@NotEmpty(message = "[userPwd]用户密码不能为空")
@Length(min = 0, max = 50, message = "[userPwd]用户密码长度不合法(0-50)")
private String userPwd;
/**
*
*/
@NotNull(message = "[userStatus]用户状态不能为NULL")
@Dict(name = "USER_STATUS")
private String userStatus;
/**
*
*/
private Long deptId;
/**
*
*/
@Length(min = 0, max = 50, message = "[deptCode]部门代码长度不合法(0-50)")
private String deptCode;
/**
*
*/
@Length(min = 0, max = 100, message = "[deptName]部门名称长度不合法(0-100)")
private String deptName;
public String getUserName() {
return this.userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getUserCode() {
return this.userCode;
}
public void setUserCode(String userCode) {
this.userCode = userCode;
}
public String getUserAlias() {
return this.userAlias;
}
public void setUserAlias(String userAlias) {
this.userAlias = userAlias;
}
public String getUserPwd() {
return this.userPwd;
}
public void setUserPwd(String userPwd) {
this.userPwd = userPwd;
}
public String getUserStatus() {
return this.userStatus;
}
public void setUserStatus(String userStatus) {
this.userStatus = userStatus;
}
public Long getDeptId() {
return this.deptId;
}
public void setDeptId(Long deptId) {
this.deptId = deptId;
}
public String getDeptCode() {
return this.deptCode;
}
public void setDeptCode(String deptCode) {
this.deptCode = deptCode;
}
public String getDeptName() {
return this.deptName;
}
public void setDeptName(String deptName) {
this.deptName = deptName;
}
}

@ -0,0 +1,28 @@
package ${basePackage}.module.system.req;
import ${basePackage}.frame.base.BaseUpdateRequest;
import javax.validation.constraints.NotNull;
/**
* UserDeleteRequest -
*
* @author wangbing
* @version 0.0.1
* @since 2017-01-01
*/
public class UserDeleteRequest extends BaseUpdateRequest {
/**
*
*/
@NotNull(message = "[id]主键不能为空")
private long id;
public long getId() {
return this.id;
}
public void setId(long id) {
this.id = id;
}
}

@ -0,0 +1,106 @@
package ${basePackage}.module.system.req;
import ${basePackage}.frame.base.BaseFindRequest;
import ${basePackage}.frame.validation.Dict;
/**
* UserRequest -
*
* @author wangbing
* @version 0.0.1
* @since 2017-01-01
*/
public class UserFindRequest extends BaseFindRequest {
/**
*
*/
private String userName;
/**
*
*/
private String userCode;
/**
*
*/
private String userAlias;
/**
*
*/
@Dict(name = "USER_STATUS")
private String userStatus;
/**
*
*/
private Long deptId;
/**
*
*/
private String deptCode;
/**
*
*/
private String deptName;
public String getUserName() {
return this.userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getUserCode() {
return this.userCode;
}
public void setUserCode(String userCode) {
this.userCode = userCode;
}
public String getUserAlias() {
return this.userAlias;
}
public void setUserAlias(String userAlias) {
this.userAlias = userAlias;
}
public String getUserStatus() {
return this.userStatus;
}
public void setUserStatus(String userStatus) {
this.userStatus = userStatus;
}
public Long getDeptId() {
return this.deptId;
}
public void setDeptId(Long deptId) {
this.deptId = deptId;
}
public String getDeptCode() {
return this.deptCode;
}
public void setDeptCode(String deptCode) {
this.deptCode = deptCode;
}
public String getDeptName() {
return this.deptName;
}
public void setDeptName(String deptName) {
this.deptName = deptName;
}
}

@ -0,0 +1,28 @@
package ${basePackage}.module.system.req;
import ${basePackage}.frame.base.BaseRequest;
import javax.validation.constraints.NotNull;
/**
* UserGetRequest -
*
* @author wangbing
* @version 0.0.1
* @since 2017-01-01
*/
public class UserGetRequest extends BaseRequest {
/**
*
*/
@NotNull(message = "[id]主键不能为空")
private long id;
public long getId() {
return this.id;
}
public void setId(long id) {
this.id = id;
}
}

@ -5,11 +5,11 @@ import ${basePackage}.frame.base.BaseRequest;
import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotBlank;
/** /**
* AuthLoginRequest - * UserLoginRequest -
* *
* @author wangbing * @author wangbing
* @version 0.0.1 * @version 0.0.1
* @since 2019-07-20 * @since 2017-01-01
*/ */
public class UserLoginRequest extends BaseRequest { public class UserLoginRequest extends BaseRequest {

@ -0,0 +1,44 @@
package ${basePackage}.module.system.req;
import ${basePackage}.frame.base.BaseRequest;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.NotEmpty;
import org.hibernate.validator.constraints.Length;
/**
* UserRoleCreateRequest -
*
* @author wangbing
* @version 0.0.1
* @since 2017-01-01
*/
public class UserRoleCreateRequest extends BaseRequest {
/**
*
*/
@NotNull(message = "[userId]用户主键不能为NULL")
private Long userId;
/**
*
*/
@NotNull(message = "[roleId]角色主键不能为NULL")
private Long roleId;
public Long getUserId() {
return this.userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public Long getRoleId() {
return this.roleId;
}
public void setRoleId(Long roleId) {
this.roleId = roleId;
}
}

@ -0,0 +1,28 @@
package ${basePackage}.module.system.req;
import ${basePackage}.frame.base.BaseUpdateRequest;
import javax.validation.constraints.NotNull;
/**
* UserRoleDeleteRequest -
*
* @author wangbing
* @version 0.0.1
* @since 2017-01-01
*/
public class UserRoleDeleteRequest extends BaseUpdateRequest {
/**
*
*/
@NotNull(message = "[id]主键不能为空")
private long id;
public long getId() {
return this.id;
}
public void setId(long id) {
this.id = id;
}
}

@ -0,0 +1,39 @@
package ${basePackage}.module.system.req;
import ${basePackage}.frame.base.BaseFindRequest;
/**
* UserRoleRequest -
*
* @author wangbing
* @version 0.0.1
* @since 2017-01-01
*/
public class UserRoleFindRequest extends BaseFindRequest {
/**
*
*/
private Long userId;
/**
*
*/
private Long roleId;
public Long getUserId() {
return this.userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public Long getRoleId() {
return this.roleId;
}
public void setRoleId(Long roleId) {
this.roleId = roleId;
}
}

@ -0,0 +1,28 @@
package ${basePackage}.module.system.req;
import ${basePackage}.frame.base.BaseRequest;
import javax.validation.constraints.NotNull;
/**
* UserRoleGetRequest -
*
* @author wangbing
* @version 0.0.1
* @since 2017-01-01
*/
public class UserRoleGetRequest extends BaseRequest {
/**
*
*/
@NotNull(message = "[id]主键不能为空")
private long id;
public long getId() {
return this.id;
}
public void setId(long id) {
this.id = id;
}
}

@ -0,0 +1,58 @@
package ${basePackage}.module.system.req;
import ${basePackage}.frame.base.BaseUpdateRequest;
import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotEmpty;
/**
* UserRoleUpdateRequest -
*
* @author wangbing
* @version 0.0.1
* @since 2017-01-01
*/
public class UserRoleUpdateRequest extends BaseUpdateRequest {
/**
*
*/
@NotNull(message = "[id]主键不能为NULL")
private Long id;
/**
*
*/
@NotNull(message = "[userId]用户主键不能为NULL")
private Long userId;
/**
*
*/
@NotNull(message = "[roleId]角色主键不能为NULL")
private Long roleId;
public Long getId() {
return this.id;
}
public void setId(Long id) {
this.id = id;
}
public Long getUserId() {
return this.userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public Long getRoleId() {
return this.roleId;
}
public void setRoleId(Long roleId) {
this.roleId = roleId;
}
}

@ -0,0 +1,146 @@
package ${basePackage}.module.system.req;
import ${basePackage}.frame.base.BaseUpdateRequest;
import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotEmpty;
import ${basePackage}.frame.validation.Dict;
/**
* UserUpdateRequest -
*
* @author wangbing
* @version 0.0.1
* @since 2017-01-01
*/
public class UserUpdateRequest extends BaseUpdateRequest {
/**
*
*/
@NotNull(message = "[id]主键不能为NULL")
private Long id;
/**
*
*/
@NotEmpty(message = "[userName]用户账户不能为空")
@Length(min = 0, max = 100, message = "[userName]用户账户长度不合法(0-100)")
private String userName;
/**
*
*/
@NotEmpty(message = "[userCode]用户代码不能为空")
@Length(min = 0, max = 50, message = "[userCode]用户代码长度不合法(0-50)")
private String userCode;
/**
*
*/
@Length(min = 0, max = 50, message = "[userAlias]用户别名长度不合法(0-50)")
private String userAlias;
/**
*
*/
@NotEmpty(message = "[userPwd]用户密码不能为空")
@Length(min = 0, max = 50, message = "[userPwd]用户密码长度不合法(0-50)")
private String userPwd;
/**
*
*/
@NotNull(message = "[userStatus]用户状态不能为NULL")
@Dict(name = "USER_STATUS")
private String userStatus;
/**
*
*/
private Long deptId;
/**
*
*/
@Length(min = 0, max = 50, message = "[deptCode]部门代码长度不合法(0-50)")
private String deptCode;
/**
*
*/
@Length(min = 0, max = 100, message = "[deptName]部门名称长度不合法(0-100)")
private String deptName;
public Long getId() {
return this.id;
}
public void setId(Long id) {
this.id = id;
}
public String getUserName() {
return this.userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getUserCode() {
return this.userCode;
}
public void setUserCode(String userCode) {
this.userCode = userCode;
}
public String getUserAlias() {
return this.userAlias;
}
public void setUserAlias(String userAlias) {
this.userAlias = userAlias;
}
public String getUserPwd() {
return this.userPwd;
}
public void setUserPwd(String userPwd) {
this.userPwd = userPwd;
}
public String getUserStatus() {
return this.userStatus;
}
public void setUserStatus(String userStatus) {
this.userStatus = userStatus;
}
public Long getDeptId() {
return this.deptId;
}
public void setDeptId(Long deptId) {
this.deptId = deptId;
}
public String getDeptCode() {
return this.deptCode;
}
public void setDeptCode(String deptCode) {
this.deptCode = deptCode;
}
public String getDeptName() {
return this.deptName;
}
public void setDeptName(String deptName) {
this.deptName = deptName;
}
}

@ -0,0 +1,26 @@
package ${basePackage}.module.system.rsp;
import ${basePackage}.frame.base.BaseResponse;
/**
* DeptCreateResponse -
*
* @author wangbing
* @version 0.0.1
* @since 2017-01-01
*/
public class DeptCreateResponse extends BaseResponse {
/**
* ID
*/
private Long id;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
}

@ -0,0 +1,26 @@
package ${basePackage}.module.system.rsp;
import ${basePackage}.frame.base.BaseResponse;
/**
* DeptDeleteResponse -
*
* @author wangbing
* @version 0.0.1
* @since 2017-01-01
*/
public class DeptDeleteResponse extends BaseResponse {
/**
*
*/
private Long result;
public Long getResult() {
return this.result;
}
public void setResult(Long result) {
this.result = result;
}
}

@ -0,0 +1,14 @@
package ${basePackage}.module.system.rsp;
import ${basePackage}.frame.base.BaseFindResponse;
import ${basePackage}.module.system.ent.Dept;
/**
* DeptFindResponse -
*
* @author wangbing
* @version 0.0.1
* @since 2017-01-01
*/
public class DeptFindResponse extends BaseFindResponse<Dept> {
}

@ -0,0 +1,27 @@
package ${basePackage}.module.system.rsp;
import ${basePackage}.module.system.ent.Dept;
import ${basePackage}.frame.base.BaseResponse;
/**
* DeptGetResponse -
*
* @author wangbing
* @version 0.0.1
* @since 2017-01-01
*/
public class DeptGetResponse extends BaseResponse {
/**
*
*/
private Dept dept;
public Dept getDept() {
return this.dept;
}
public void setDept(Dept dept) {
this.dept = dept;
}
}

@ -0,0 +1,26 @@
package ${basePackage}.module.system.rsp;
import ${basePackage}.frame.base.BaseResponse;
/**
* DeptUpdateResponse -
*
* @author wangbing
* @version 0.0.1
* @since 2017-01-01
*/
public class DeptUpdateResponse extends BaseResponse {
/**
*
*/
private Long result;
public Long getResult() {
return this.result;
}
public void setResult(Long result) {
this.result = result;
}
}

@ -7,7 +7,7 @@ import ${basePackage}.frame.base.BaseResponse;
* *
* @author wangbing * @author wangbing
* @version 0.0.1 * @version 0.0.1
* @since 2019-07-20 * @since 2017-01-01
*/ */
public class DictCreateResponse extends BaseResponse { public class DictCreateResponse extends BaseResponse {

@ -7,7 +7,7 @@ import ${basePackage}.frame.base.BaseResponse;
* *
* @author wangbing * @author wangbing
* @version 0.0.1 * @version 0.0.1
* @since 2019-07-20 * @since 2017-01-01
*/ */
public class DictDeleteResponse extends BaseResponse { public class DictDeleteResponse extends BaseResponse {

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save

Powered by TurnKey Linux.