diff --git a/src/main/java/xyz/wbsite/dbtool/javafx/manger/callable/SpringBootCallable.java b/src/main/java/xyz/wbsite/dbtool/javafx/manger/callable/SpringBootCallable.java index baac62e6..a0dc33e5 100644 --- a/src/main/java/xyz/wbsite/dbtool/javafx/manger/callable/SpringBootCallable.java +++ b/src/main/java/xyz/wbsite/dbtool/javafx/manger/callable/SpringBootCallable.java @@ -478,7 +478,7 @@ public class SpringBootCallable implements Callable { if (name.endsWith(".java")) { freeMarkerManager.outputTemp(Tool.createFile(mpr.getAbsolutePath(), name), option + "/java/module/system/mpr/" + name, ctx); } else if (name.contains(dataBase.toString())) { - freeMarkerManager.outputTemp(Tool.createFile(mgr.getAbsolutePath(), name.replaceAll("_" + dataBase.toString(), "")), option + "/java/module/system/mpr/" + name, ctx); + freeMarkerManager.outputTemp(Tool.createFile(mpr.getAbsolutePath(), name.replaceAll("_" + dataBase.toString(), "")), option + "/java/module/system/mpr/" + name, ctx); } } diff --git a/src/main/resources/modules/SpringBoot/java/action/ajax/system/DeptAjax.java b/src/main/resources/modules/SpringBoot/java/action/ajax/system/DeptAjax.java index 92c03a62..11553b50 100644 --- a/src/main/resources/modules/SpringBoot/java/action/ajax/system/DeptAjax.java +++ b/src/main/resources/modules/SpringBoot/java/action/ajax/system/DeptAjax.java @@ -15,8 +15,16 @@ import ${basePackage}.frame.excel.exception.ReadErrorException; import ${basePackage}.frame.excel.exception.TemplateNotMatchException; import ${basePackage}.module.system.ent.Dept; import ${basePackage}.module.system.mgr.DeptManager; -import ${basePackage}.module.system.req.*; -import ${basePackage}.module.system.rsp.*; +import ${basePackage}.module.system.req.DeptCreateRequest; +import ${basePackage}.module.system.req.DeptDeleteRequest; +import ${basePackage}.module.system.req.DeptFindRequest; +import ${basePackage}.module.system.req.DeptGetRequest; +import ${basePackage}.module.system.req.DeptUpdateRequest; +import ${basePackage}.module.system.rsp.DeptCreateResponse; +import ${basePackage}.module.system.rsp.DeptDeleteResponse; +import ${basePackage}.module.system.rsp.DeptFindResponse; +import ${basePackage}.module.system.rsp.DeptGetResponse; +import ${basePackage}.module.system.rsp.DeptUpdateResponse; import java.io.IOException; import java.util.List; diff --git a/src/main/resources/modules/SpringBoot/java/action/ajax/system/DictAjax.java b/src/main/resources/modules/SpringBoot/java/action/ajax/system/DictAjax.java index c0a014a5..790a2156 100644 --- a/src/main/resources/modules/SpringBoot/java/action/ajax/system/DictAjax.java +++ b/src/main/resources/modules/SpringBoot/java/action/ajax/system/DictAjax.java @@ -15,8 +15,18 @@ import ${basePackage}.frame.excel.exception.ReadErrorException; import ${basePackage}.frame.excel.exception.TemplateNotMatchException; import ${basePackage}.module.system.ent.Dict; import ${basePackage}.module.system.mgr.DictManager; -import ${basePackage}.module.system.req.*; -import ${basePackage}.module.system.rsp.*; +import ${basePackage}.module.system.req.DictCreateRequest; +import ${basePackage}.module.system.req.DictDeleteRequest; +import ${basePackage}.module.system.req.DictFindRequest; +import ${basePackage}.module.system.req.DictGetRequest; +import ${basePackage}.module.system.req.DictLoadRequest; +import ${basePackage}.module.system.req.DictUpdateRequest; +import ${basePackage}.module.system.rsp.DictCreateResponse; +import ${basePackage}.module.system.rsp.DictDeleteResponse; +import ${basePackage}.module.system.rsp.DictFindResponse; +import ${basePackage}.module.system.rsp.DictGetResponse; +import ${basePackage}.module.system.rsp.DictLoadResponse; +import ${basePackage}.module.system.rsp.DictUpdateResponse; import java.io.IOException; import java.util.List; diff --git a/src/main/resources/modules/SpringBoot/java/action/ajax/system/DictItemAjax.java b/src/main/resources/modules/SpringBoot/java/action/ajax/system/DictItemAjax.java index 9b405ba8..94617369 100644 --- a/src/main/resources/modules/SpringBoot/java/action/ajax/system/DictItemAjax.java +++ b/src/main/resources/modules/SpringBoot/java/action/ajax/system/DictItemAjax.java @@ -15,8 +15,16 @@ import ${basePackage}.frame.excel.exception.ReadErrorException; import ${basePackage}.frame.excel.exception.TemplateNotMatchException; import ${basePackage}.module.system.ent.DictItem; import ${basePackage}.module.system.mgr.DictItemManager; -import ${basePackage}.module.system.req.*; -import ${basePackage}.module.system.rsp.*; +import ${basePackage}.module.system.req.DictItemCreateRequest; +import ${basePackage}.module.system.req.DictItemDeleteRequest; +import ${basePackage}.module.system.req.DictItemFindRequest; +import ${basePackage}.module.system.req.DictItemGetRequest; +import ${basePackage}.module.system.req.DictItemUpdateRequest; +import ${basePackage}.module.system.rsp.DictItemCreateResponse; +import ${basePackage}.module.system.rsp.DictItemDeleteResponse; +import ${basePackage}.module.system.rsp.DictItemFindResponse; +import ${basePackage}.module.system.rsp.DictItemGetResponse; +import ${basePackage}.module.system.rsp.DictItemUpdateResponse; import java.io.IOException; import java.util.List; diff --git a/src/main/resources/modules/SpringBoot/java/action/ajax/system/FileAjax.java b/src/main/resources/modules/SpringBoot/java/action/ajax/system/FileAjax.java index aae9f45a..58036961 100644 --- a/src/main/resources/modules/SpringBoot/java/action/ajax/system/FileAjax.java +++ b/src/main/resources/modules/SpringBoot/java/action/ajax/system/FileAjax.java @@ -12,8 +12,15 @@ import ${basePackage}.frame.utils.ResponseUtil; import ${basePackage}.frame.utils.ValidationUtil; import ${basePackage}.module.system.ent.File; import ${basePackage}.module.system.mgr.FileManager; -import ${basePackage}.module.system.req.*; -import ${basePackage}.module.system.rsp.*; +import ${basePackage}.module.system.req.FileCreateRequest; +import ${basePackage}.module.system.req.FileDeleteRequest; +import ${basePackage}.module.system.req.FileFindRequest; +import ${basePackage}.module.system.req.FileGetRequest; +import ${basePackage}.module.system.rsp.FileCreateResponse; +import ${basePackage}.module.system.rsp.FileDeleteResponse; +import ${basePackage}.module.system.rsp.FileFindResponse; +import ${basePackage}.module.system.rsp.FileGetResponse; +import ${basePackage}.module.system.rsp.FileUploadResponse; import com.fasterxml.jackson.core.TreeNode; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpHeaders; diff --git a/src/main/resources/modules/SpringBoot/java/action/ajax/system/ResourceAjax.java b/src/main/resources/modules/SpringBoot/java/action/ajax/system/ResourceAjax.java index e49e4aa0..ffb60d91 100644 --- a/src/main/resources/modules/SpringBoot/java/action/ajax/system/ResourceAjax.java +++ b/src/main/resources/modules/SpringBoot/java/action/ajax/system/ResourceAjax.java @@ -15,8 +15,16 @@ import ${basePackage}.frame.excel.exception.ReadErrorException; import ${basePackage}.frame.excel.exception.TemplateNotMatchException; import ${basePackage}.module.system.ent.Resource; import ${basePackage}.module.system.mgr.ResourceManager; -import ${basePackage}.module.system.req.*; -import ${basePackage}.module.system.rsp.*; +import ${basePackage}.module.system.req.ResourceCreateRequest; +import ${basePackage}.module.system.req.ResourceDeleteRequest; +import ${basePackage}.module.system.req.ResourceFindRequest; +import ${basePackage}.module.system.req.ResourceGetRequest; +import ${basePackage}.module.system.req.ResourceUpdateRequest; +import ${basePackage}.module.system.rsp.ResourceCreateResponse; +import ${basePackage}.module.system.rsp.ResourceDeleteResponse; +import ${basePackage}.module.system.rsp.ResourceFindResponse; +import ${basePackage}.module.system.rsp.ResourceGetResponse; +import ${basePackage}.module.system.rsp.ResourceUpdateResponse; import java.io.IOException; import java.util.List; diff --git a/src/main/resources/modules/SpringBoot/java/action/ajax/system/RoleAjax.java b/src/main/resources/modules/SpringBoot/java/action/ajax/system/RoleAjax.java index 24fbb677..25410a1e 100644 --- a/src/main/resources/modules/SpringBoot/java/action/ajax/system/RoleAjax.java +++ b/src/main/resources/modules/SpringBoot/java/action/ajax/system/RoleAjax.java @@ -15,8 +15,16 @@ import ${basePackage}.frame.excel.exception.ReadErrorException; import ${basePackage}.frame.excel.exception.TemplateNotMatchException; import ${basePackage}.module.system.ent.Role; import ${basePackage}.module.system.mgr.RoleManager; -import ${basePackage}.module.system.req.*; -import ${basePackage}.module.system.rsp.*; +import ${basePackage}.module.system.req.RoleCreateRequest; +import ${basePackage}.module.system.req.RoleDeleteRequest; +import ${basePackage}.module.system.req.RoleFindRequest; +import ${basePackage}.module.system.req.RoleGetRequest; +import ${basePackage}.module.system.req.RoleUpdateRequest; +import ${basePackage}.module.system.rsp.RoleCreateResponse; +import ${basePackage}.module.system.rsp.RoleDeleteResponse; +import ${basePackage}.module.system.rsp.RoleFindResponse; +import ${basePackage}.module.system.rsp.RoleGetResponse; +import ${basePackage}.module.system.rsp.RoleUpdateResponse; import java.io.IOException; import java.util.List; diff --git a/src/main/resources/modules/SpringBoot/java/action/ajax/system/RoleResourceAjax.java b/src/main/resources/modules/SpringBoot/java/action/ajax/system/RoleResourceAjax.java index 741049fa..fe8f3bc7 100644 --- a/src/main/resources/modules/SpringBoot/java/action/ajax/system/RoleResourceAjax.java +++ b/src/main/resources/modules/SpringBoot/java/action/ajax/system/RoleResourceAjax.java @@ -15,8 +15,16 @@ import ${basePackage}.frame.excel.exception.ReadErrorException; import ${basePackage}.frame.excel.exception.TemplateNotMatchException; import ${basePackage}.module.system.ent.RoleResource; import ${basePackage}.module.system.mgr.RoleResourceManager; -import ${basePackage}.module.system.req.*; -import ${basePackage}.module.system.rsp.*; +import ${basePackage}.module.system.req.RoleResourceCreateRequest; +import ${basePackage}.module.system.req.RoleResourceDeleteRequest; +import ${basePackage}.module.system.req.RoleResourceFindRequest; +import ${basePackage}.module.system.req.RoleResourceGetRequest; +import ${basePackage}.module.system.req.RoleResourceUpdateRequest; +import ${basePackage}.module.system.rsp.RoleResourceCreateResponse; +import ${basePackage}.module.system.rsp.RoleResourceDeleteResponse; +import ${basePackage}.module.system.rsp.RoleResourceFindResponse; +import ${basePackage}.module.system.rsp.RoleResourceGetResponse; +import ${basePackage}.module.system.rsp.RoleResourceUpdateResponse; import java.io.IOException; import java.util.List; diff --git a/src/main/resources/modules/SpringBoot/java/action/ajax/system/TokensAjax.java b/src/main/resources/modules/SpringBoot/java/action/ajax/system/TokensAjax.java index ee648deb..5c216860 100644 --- a/src/main/resources/modules/SpringBoot/java/action/ajax/system/TokensAjax.java +++ b/src/main/resources/modules/SpringBoot/java/action/ajax/system/TokensAjax.java @@ -15,8 +15,16 @@ import ${basePackage}.frame.excel.exception.ReadErrorException; import ${basePackage}.frame.excel.exception.TemplateNotMatchException; import ${basePackage}.module.system.ent.Tokens; import ${basePackage}.module.system.mgr.TokensManager; -import ${basePackage}.module.system.req.*; -import ${basePackage}.module.system.rsp.*; +import ${basePackage}.module.system.req.TokensCreateRequest; +import ${basePackage}.module.system.req.TokensDeleteRequest; +import ${basePackage}.module.system.req.TokensFindRequest; +import ${basePackage}.module.system.req.TokensGetRequest; +import ${basePackage}.module.system.req.TokensUpdateRequest; +import ${basePackage}.module.system.rsp.TokensCreateResponse; +import ${basePackage}.module.system.rsp.TokensDeleteResponse; +import ${basePackage}.module.system.rsp.TokensFindResponse; +import ${basePackage}.module.system.rsp.TokensGetResponse; +import ${basePackage}.module.system.rsp.TokensUpdateResponse; import java.io.IOException; import java.util.List; diff --git a/src/main/resources/modules/SpringBoot/java/action/ajax/system/UserAjax.java b/src/main/resources/modules/SpringBoot/java/action/ajax/system/UserAjax.java index 812b1b3e..62ee84ef 100644 --- a/src/main/resources/modules/SpringBoot/java/action/ajax/system/UserAjax.java +++ b/src/main/resources/modules/SpringBoot/java/action/ajax/system/UserAjax.java @@ -15,8 +15,16 @@ import ${basePackage}.frame.excel.exception.ReadErrorException; import ${basePackage}.frame.excel.exception.TemplateNotMatchException; import ${basePackage}.module.system.ent.User; import ${basePackage}.module.system.mgr.UserManager; -import ${basePackage}.module.system.req.*; -import ${basePackage}.module.system.rsp.*; +import ${basePackage}.module.system.req.UserCreateRequest; +import ${basePackage}.module.system.req.UserDeleteRequest; +import ${basePackage}.module.system.req.UserFindRequest; +import ${basePackage}.module.system.req.UserGetRequest; +import ${basePackage}.module.system.req.UserUpdateRequest; +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.UserUpdateResponse; import java.io.IOException; import java.util.List; diff --git a/src/main/resources/modules/SpringBoot/java/action/ajax/system/UserRoleAjax.java b/src/main/resources/modules/SpringBoot/java/action/ajax/system/UserRoleAjax.java index 632c4d29..24dec1d6 100644 --- a/src/main/resources/modules/SpringBoot/java/action/ajax/system/UserRoleAjax.java +++ b/src/main/resources/modules/SpringBoot/java/action/ajax/system/UserRoleAjax.java @@ -15,8 +15,16 @@ import ${basePackage}.frame.excel.exception.ReadErrorException; import ${basePackage}.frame.excel.exception.TemplateNotMatchException; import ${basePackage}.module.system.ent.UserRole; import ${basePackage}.module.system.mgr.UserRoleManager; -import ${basePackage}.module.system.req.*; -import ${basePackage}.module.system.rsp.*; +import ${basePackage}.module.system.req.UserRoleCreateRequest; +import ${basePackage}.module.system.req.UserRoleDeleteRequest; +import ${basePackage}.module.system.req.UserRoleFindRequest; +import ${basePackage}.module.system.req.UserRoleGetRequest; +import ${basePackage}.module.system.req.UserRoleUpdateRequest; +import ${basePackage}.module.system.rsp.UserRoleCreateResponse; +import ${basePackage}.module.system.rsp.UserRoleDeleteResponse; +import ${basePackage}.module.system.rsp.UserRoleFindResponse; +import ${basePackage}.module.system.rsp.UserRoleGetResponse; +import ${basePackage}.module.system.rsp.UserRoleUpdateResponse; import java.io.IOException; import java.util.List; diff --git a/src/main/resources/modules/SpringBoot/java/module/mgr/manager.ftl b/src/main/resources/modules/SpringBoot/java/module/mgr/manager.ftl index 47291f71..3f1514cd 100644 --- a/src/main/resources/modules/SpringBoot/java/module/mgr/manager.ftl +++ b/src/main/resources/modules/SpringBoot/java/module/mgr/manager.ftl @@ -1,7 +1,15 @@ package ${basePackage}.module.${moduleName}.mgr; -import ${basePackage}.module.${moduleName}.req.*; -import ${basePackage}.module.${moduleName}.rsp.*; +import ${basePackage}.module.${moduleName}.req.${table.getCName()}CreateRequest; +import ${basePackage}.module.${moduleName}.req.${table.getCName()}DeleteRequest; +import ${basePackage}.module.${moduleName}.req.${table.getCName()}FindRequest; +import ${basePackage}.module.${moduleName}.req.${table.getCName()}GetRequest; +import ${basePackage}.module.${moduleName}.req.${table.getCName()}UpdateRequest; +import ${basePackage}.module.${moduleName}.rsp.${table.getCName()}CreateResponse; +import ${basePackage}.module.${moduleName}.rsp.${table.getCName()}DeleteResponse; +import ${basePackage}.module.${moduleName}.rsp.${table.getCName()}FindResponse; +import ${basePackage}.module.${moduleName}.rsp.${table.getCName()}GetResponse; +import ${basePackage}.module.${moduleName}.rsp.${table.getCName()}UpdateResponse; import ${basePackage}.frame.base.Token; /** diff --git a/src/main/resources/modules/SpringBoot/java/module/mgr/managerImpl.ftl b/src/main/resources/modules/SpringBoot/java/module/mgr/managerImpl.ftl index 3896c5c1..43e72a5b 100644 --- a/src/main/resources/modules/SpringBoot/java/module/mgr/managerImpl.ftl +++ b/src/main/resources/modules/SpringBoot/java/module/mgr/managerImpl.ftl @@ -8,8 +8,16 @@ import ${basePackage}.frame.utils.MapperUtil; import ${basePackage}.frame.utils.ValidationUtil; import ${basePackage}.module.${moduleName}.ent.${table.getCName()}; import ${basePackage}.module.${moduleName}.mpr.${table.getCName()}Mapper; -import ${basePackage}.module.${moduleName}.req.*; -import ${basePackage}.module.${moduleName}.rsp.*; +import ${basePackage}.module.${moduleName}.req.${table.getCName()}CreateRequest; +import ${basePackage}.module.${moduleName}.req.${table.getCName()}DeleteRequest; +import ${basePackage}.module.${moduleName}.req.${table.getCName()}FindRequest; +import ${basePackage}.module.${moduleName}.req.${table.getCName()}GetRequest; +import ${basePackage}.module.${moduleName}.req.${table.getCName()}UpdateRequest; +import ${basePackage}.module.${moduleName}.rsp.${table.getCName()}CreateResponse; +import ${basePackage}.module.${moduleName}.rsp.${table.getCName()}DeleteResponse; +import ${basePackage}.module.${moduleName}.rsp.${table.getCName()}FindResponse; +import ${basePackage}.module.${moduleName}.rsp.${table.getCName()}GetResponse; +import ${basePackage}.module.${moduleName}.rsp.${table.getCName()}UpdateResponse; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import com.github.pagehelper.util.StringUtil; diff --git a/src/main/resources/modules/SpringBoot/java/module/mpr/mapperJava.ftl b/src/main/resources/modules/SpringBoot/java/module/mpr/mapperJava.ftl index 65d1d996..df1f1458 100644 --- a/src/main/resources/modules/SpringBoot/java/module/mpr/mapperJava.ftl +++ b/src/main/resources/modules/SpringBoot/java/module/mpr/mapperJava.ftl @@ -6,7 +6,11 @@ import org.apache.ibatis.annotations.Mapper; import java.util.List; import ${basePackage}.module.${moduleName}.ent.${table.getCName()}; -import ${basePackage}.module.${moduleName}.req.*; +import ${basePackage}.module.${moduleName}.req.${table.getCName()}CreateRequest; +import ${basePackage}.module.${moduleName}.req.${table.getCName()}DeleteRequest; +import ${basePackage}.module.${moduleName}.req.${table.getCName()}FindRequest; +import ${basePackage}.module.${moduleName}.req.${table.getCName()}GetRequest; +import ${basePackage}.module.${moduleName}.req.${table.getCName()}UpdateRequest; import ${basePackage}.frame.base.Token; /** diff --git a/src/main/resources/modules/SpringBoot/java/module/system/mgr/DictManagerImpl.java b/src/main/resources/modules/SpringBoot/java/module/system/mgr/DictManagerImpl.java index 16024c4e..3d41a254 100644 --- a/src/main/resources/modules/SpringBoot/java/module/system/mgr/DictManagerImpl.java +++ b/src/main/resources/modules/SpringBoot/java/module/system/mgr/DictManagerImpl.java @@ -184,7 +184,7 @@ public class DictManagerImpl implements DictManager { dictFindRequest.setValid(true); List dicts = dictMapper.find(dictFindRequest, token); if (dicts.size() == 0) { - response.addError(ErrorType.BUSINESS_ERROR, "字典不存在"); + response.addError(ErrorType.BUSINESS_ERROR, "[" + request.getDictName() + "]字典不存在"); return response; } else if (dicts.size() > 1) { response.addError(ErrorType.BUSINESS_ERROR, "字典重复异常,请联系管理员"); diff --git a/src/main/resources/modules/SpringBoot/java/module/system/mgr/TokensManager.java b/src/main/resources/modules/SpringBoot/java/module/system/mgr/TokensManager.java index 6d128b76..3f80f533 100644 --- a/src/main/resources/modules/SpringBoot/java/module/system/mgr/TokensManager.java +++ b/src/main/resources/modules/SpringBoot/java/module/system/mgr/TokensManager.java @@ -57,4 +57,13 @@ public interface TokensManager { * @return */ TokensGetResponse get(TokensGetRequest request, Token token); + + /** + * 构建Token + * + * @param request 请求对象 + * @param token 令牌 + * @return + */ + TokensBuildResponse build(TokensBuildRequest request, Token token); } diff --git a/src/main/resources/modules/SpringBoot/java/module/system/mgr/TokensManagerImpl.java b/src/main/resources/modules/SpringBoot/java/module/system/mgr/TokensManagerImpl.java index f9ec78a2..76e7c3bd 100644 --- a/src/main/resources/modules/SpringBoot/java/module/system/mgr/TokensManagerImpl.java +++ b/src/main/resources/modules/SpringBoot/java/module/system/mgr/TokensManagerImpl.java @@ -1,21 +1,32 @@ package ${basePackage}.module.system.mgr; -import ${basePackage}.frame.utils.IDgenerator; -import ${basePackage}.frame.utils.Message; -import ${basePackage}.frame.base.ErrorType; -import ${basePackage}.frame.base.Token; -import ${basePackage}.frame.utils.MapperUtil; -import ${basePackage}.frame.utils.ValidationUtil; -import ${basePackage}.module.system.ent.Tokens; -import ${basePackage}.module.system.mpr.TokensMapper; -import ${basePackage}.module.system.req.*; -import ${basePackage}.module.system.rsp.*; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import com.github.pagehelper.util.StringUtil; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import ${basePackage}.frame.base.ErrorType; +import ${basePackage}.frame.base.Token; +import ${basePackage}.frame.utils.IDgenerator; +import ${basePackage}.frame.utils.MapperUtil; +import ${basePackage}.frame.utils.Message; +import ${basePackage}.frame.utils.ValidationUtil; +import ${basePackage}.module.system.ent.Tokens; +import ${basePackage}.module.system.mpr.TokensMapper; +import ${basePackage}.module.system.req.TokensBuildRequest; +import ${basePackage}.module.system.req.TokensCreateRequest; +import ${basePackage}.module.system.req.TokensDeleteRequest; +import ${basePackage}.module.system.req.TokensFindRequest; +import ${basePackage}.module.system.req.TokensGetRequest; +import ${basePackage}.module.system.req.TokensUpdateRequest; +import ${basePackage}.module.system.rsp.TokensBuildResponse; +import ${basePackage}.module.system.rsp.TokensCreateResponse; +import ${basePackage}.module.system.rsp.TokensDeleteResponse; +import ${basePackage}.module.system.rsp.TokensFindResponse; +import ${basePackage}.module.system.rsp.TokensGetResponse; +import ${basePackage}.module.system.rsp.TokensUpdateResponse; /** * TOKENS - 通行证 @@ -164,4 +175,54 @@ public class TokensManagerImpl implements TokensManager { return response; } + + /** + * 构建Token + * + * @param request 请求对象 + * @param token 令牌 + * @return + */ + @Override + public TokensBuildResponse build(TokensBuildRequest request, Token token) { + TokensBuildResponse response = new TokensBuildResponse(); + + ValidationUtil.validate(request, response); + if (response.hasError()) { + return response; + } + + TokensFindRequest tokensFindRequest = MapperUtil.map(request, TokensFindRequest.class); + tokensFindRequest.setValid(true); + TokensFindResponse tokensFindResponse = this.find(tokensFindRequest, token); + if (tokensFindResponse.hasError()) { + response.addErrors(tokensFindResponse.getErrors()); + return response; + } + + if (tokensFindResponse.getResult().size() == 0) { + response.addError(ErrorType.BUSINESS_ERROR, "令牌无效或不存在"); + return response; + } else if (tokensFindResponse.getResult().size() > 1) { + response.addError(ErrorType.BUSINESS_ERROR, "令牌异常"); + return response; + } else { + Tokens tokens = tokensFindResponse.getResult().get(0); + Token newToken = new Token(); + if (tokens.getUserName().equals(admin)) { + newToken.setId(0); + newToken.setUserId(0); + newToken.setUserName(admin); + } else { + response.addError(ErrorType.BUSINESS_ERROR, "token"); + newToken.setId(tokens.getId()); + newToken.setUserId(tokens.getUserId()); + newToken.setUserName(tokens.getUserName()); + } + + response.setToken(newToken); + } + + return response; + } } diff --git a/src/main/resources/modules/SpringBoot/java/module/system/req/AuthLoginRequest.java b/src/main/resources/modules/SpringBoot/java/module/system/req/UserLoginRequest.java similarity index 93% rename from src/main/resources/modules/SpringBoot/java/module/system/req/AuthLoginRequest.java rename to src/main/resources/modules/SpringBoot/java/module/system/req/UserLoginRequest.java index a2c62e71..35e994b0 100644 --- a/src/main/resources/modules/SpringBoot/java/module/system/req/AuthLoginRequest.java +++ b/src/main/resources/modules/SpringBoot/java/module/system/req/UserLoginRequest.java @@ -11,7 +11,7 @@ import javax.validation.constraints.NotBlank; * @version 0.0.1 * @since 2019-07-20 */ -public class AuthLoginRequest extends BaseRequest { +public class UserLoginRequest extends BaseRequest { @NotBlank(message = "[username]用户名不能为空") private String username; diff --git a/src/main/resources/modules/SpringBoot/java/module/system/rsp/AuthLoginResponse.java b/src/main/resources/modules/SpringBoot/java/module/system/rsp/UserLoginResponse.java similarity index 78% rename from src/main/resources/modules/SpringBoot/java/module/system/rsp/AuthLoginResponse.java rename to src/main/resources/modules/SpringBoot/java/module/system/rsp/UserLoginResponse.java index abc6c34e..9c46708d 100644 --- a/src/main/resources/modules/SpringBoot/java/module/system/rsp/AuthLoginResponse.java +++ b/src/main/resources/modules/SpringBoot/java/module/system/rsp/UserLoginResponse.java @@ -3,13 +3,13 @@ package ${basePackage}.module.system.rsp; import ${basePackage}.frame.base.BaseResponse; /** - * AuthLoginResponse - 登录响应 + * UserLoginResponse - 登录响应 * * @author wangbing * @version 0.0.1 * @since 2019-07-20 */ -public class AuthLoginResponse extends BaseResponse { +public class UserLoginResponse extends BaseResponse { /** * ID diff --git a/src/main/resources/modules/SpringBoot/resources/static/css/base.css b/src/main/resources/modules/SpringBoot/resources/static/css/base.css index 8dddb6d4..5615e176 100644 --- a/src/main/resources/modules/SpringBoot/resources/static/css/base.css +++ b/src/main/resources/modules/SpringBoot/resources/static/css/base.css @@ -707,6 +707,16 @@ code { width: 220px; } +.box-card.data .el-table { + margin-top: 10px; + width: 100%; +} + +.box-card.data .el-table .cell { + max-height: 46px; + min-height: 23px; +} + .form .el-dialog { width: 700px; } diff --git a/src/main/resources/modules/SpringBoot/resources/templates/screen/module/mgr.ftl b/src/main/resources/modules/SpringBoot/resources/templates/screen/module/mgr.ftl index 61798f0a..7bd409f2 100644 --- a/src/main/resources/modules/SpringBoot/resources/templates/screen/module/mgr.ftl +++ b/src/main/resources/modules/SpringBoot/resources/templates/screen/module/mgr.ftl @@ -71,7 +71,7 @@ - + 新增 @@ -173,12 +173,10 @@ + size="mini"> - + 新增 @@ -89,12 +89,10 @@ + size="mini"> - + 新增 @@ -81,12 +81,10 @@ + size="small"> - + 新增 @@ -82,8 +82,7 @@ @selection-change="onSelectionChange" empty-text="无数据" :data="result" - size="small" - style="width: 100%"> + size="small"> - + 新增 @@ -80,12 +80,10 @@ + size="mini"> - + 新增 @@ -77,12 +77,10 @@ + size="mini"> - + 新增 @@ -65,12 +65,10 @@ + size="mini"> - + 导出 @@ -64,12 +64,10 @@ + size="mini"> - + 新增 @@ -92,12 +92,10 @@ + size="mini">