diff --git a/src/main/resources/modules/SpringBoot/java/frame/utils/IDgenerator.java b/src/main/resources/modules/SpringBoot/java/frame/utils/IDgenerator.java index c6c58f76..8806038f 100644 --- a/src/main/resources/modules/SpringBoot/java/frame/utils/IDgenerator.java +++ b/src/main/resources/modules/SpringBoot/java/frame/utils/IDgenerator.java @@ -1,8 +1,6 @@ package ${basePackage}.frame.utils; -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStreamReader; +import java.util.UUID; /** * IDgenerator - ID生成器 @@ -70,4 +68,8 @@ public class IDgenerator { protected static long timeGen() { return System.currentTimeMillis(); } + + public static String nextUUID() { + return UUID.randomUUID().toString(); + } } diff --git a/src/main/resources/modules/SpringBoot/java/module/system/ent/Dept.java b/src/main/resources/modules/SpringBoot/java/module/system/ent/Dept.java new file mode 100644 index 00000000..24ab046d --- /dev/null +++ b/src/main/resources/modules/SpringBoot/java/module/system/ent/Dept.java @@ -0,0 +1,102 @@ +package ${basePackage}.module.system.ent; + +import ${basePackage}.frame.excel.annotation.ColumnDescription; +import ${basePackage}.frame.excel.annotation.ColumnName; +import ${basePackage}.frame.excel.annotation.SheetName; +import ${basePackage}.frame.base.BaseEntity; + +/** + * DEPT - 部门 + * + * @author wangbing + * @version 0.0.1 + * @since 2019-12-24 + */ +@SheetName("部门") +public class Dept extends BaseEntity { + + /** + * DEPT_CODE - 部门代码 + */ + @ColumnName("部门代码") + @ColumnDescription("") + private String deptCode; + /** + * DEPT_NAME - 部门名称 + */ + @ColumnName("部门名称") + @ColumnDescription("") + private String deptName; + /** + * DEPT_ALIAS - 部门别名 + */ + @ColumnName("部门别名") + @ColumnDescription("") + private String deptAlias; + /** + * SUP_CODE - 父部门代码 + */ + @ColumnName("父部门代码") + @ColumnDescription("") + private String supCode; + /** + * SUP_NAME - 父部门名称 + */ + @ColumnName("父部门名称") + @ColumnDescription("") + private String supName; + /** + * VALID - 是否有效 + */ + @ColumnName("是否有效") + @ColumnDescription("") + 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; + } +} \ No newline at end of file diff --git a/src/main/resources/modules/SpringBoot/java/module/system/mgr/DeptManager.java b/src/main/resources/modules/SpringBoot/java/module/system/mgr/DeptManager.java new file mode 100644 index 00000000..c625cf54 --- /dev/null +++ b/src/main/resources/modules/SpringBoot/java/module/system/mgr/DeptManager.java @@ -0,0 +1,68 @@ +package ${basePackage}.module.system.mgr; + +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 ${basePackage}.frame.base.Token; + +/** + * 部门 + * + * @author wangbing + * @version 0.0.1 + * @since 2019-12-24 + */ +public interface DeptManager { + + /** + * 插入 + * + * @param request 请求对象 + * @param token 令牌 + * @return + */ + DeptCreateResponse create(DeptCreateRequest request, Token token); + + /** + * 逻辑删除 + * + * @param request 请求对象 + * @param token 令牌 + * @return + */ + DeptDeleteResponse delete(DeptDeleteRequest request, Token token); + + /** + * 更新 + * + * @param request 请求对象 + * @param token 令牌 + * @return + */ + DeptUpdateResponse update(DeptUpdateRequest request, Token token); + + /** + * 查询 + * + * @param request 请求对象 + * @param token 令牌 + * @return + */ + DeptFindResponse find(DeptFindRequest request, Token token); + + /** + * 获得对象 + * + * @param request 请求对象 + * @param token 令牌 + * @return + */ + DeptGetResponse get(DeptGetRequest request, Token token); +} diff --git a/src/main/resources/modules/SpringBoot/java/module/system/mgr/DeptManagerImpl.java b/src/main/resources/modules/SpringBoot/java/module/system/mgr/DeptManagerImpl.java new file mode 100644 index 00000000..1e909ba2 --- /dev/null +++ b/src/main/resources/modules/SpringBoot/java/module/system/mgr/DeptManagerImpl.java @@ -0,0 +1,175 @@ +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.Dept; +import ${basePackage}.module.system.mpr.DeptMapper; +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 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.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + * DEPT - 部门 + * + * @author wangbing + * @version 0.0.1 + * @since 2019-12-24 + */ +@Transactional +@Service +public class DeptManagerImpl implements DeptManager { + + @Autowired + private DeptMapper deptMapper; + + /** + * 插入 + * + * @param request 请求对象 + * @param token 令牌 + * @return 响应 + */ + public DeptCreateResponse create(DeptCreateRequest request, Token token) { + DeptCreateResponse response = new DeptCreateResponse(); + + ValidationUtil.validate(request, response); + if (response.hasError()) { + return response; + } + + long id = IDgenerator.nextId(); + Dept entity = MapperUtil.map(request, Dept.class); + entity.setId(id); + + long result = deptMapper.insert(entity, token); + if (1L != result) { + response.addError(ErrorType.BUSINESS_ERROR, Message.CREATE_FAILURE); + return response; + } + response.setId(id); + + return response; + } + + /** + * 逻辑删除 + * + * @param request 请求对象 + * @param token 令牌 + * @return 响应 + */ + public DeptDeleteResponse delete(DeptDeleteRequest request, Token token) { + DeptDeleteResponse response = new DeptDeleteResponse(); + + ValidationUtil.validate(request, response); + if (response.hasError()) { + return response; + } + + long result = deptMapper.delete(request, token); + if (1L != result) { + response.addError(ErrorType.BUSINESS_ERROR, Message.DELETE_FAILURE); + return response; + } + response.setResult(result); + + return response; + } + + /** + * 更新 + * + * @param request 请求对象 + * @param token 令牌 + * @return 响应 + */ + public DeptUpdateResponse update(DeptUpdateRequest request, Token token) { + DeptUpdateResponse response = new DeptUpdateResponse(); + + ValidationUtil.validate(request, response); + if (response.hasError()) { + return response; + } + + long result = deptMapper.update(request, token); + if (1L != result) { + response.addError(ErrorType.BUSINESS_ERROR, Message.UPDATE_FAILURE); + return response; + } + response.setResult(result); + + return response; + } + + /** + * 查询 + * + * @param request 请求对象 + * @param token 令牌 + * @return 响应 + */ + @Transactional(readOnly = true) + public DeptFindResponse find(DeptFindRequest request, Token token) { + DeptFindResponse response = new DeptFindResponse(); + + ValidationUtil.validate(request, response); + if (response.hasError()) { + return response; + } + + PageHelper.startPage(request.getPageNumber(), request.getPageSize()); + if (StringUtil.isNotEmpty(request.getSortKey())) { + PageHelper.orderBy(request.getSortKey() + " " + request.getSortType()); + } + PageInfo pageInfo = new PageInfo<>(deptMapper.find(request, token)); + + response.setResult(pageInfo.getList()); + response.setTotalCount(pageInfo.getTotal()); + + return response; + } + + /** + * 获得对象 + * + * @param request 请求对象 + * @param token 令牌 + * @return 响应 + */ + @Transactional(readOnly = true) + public DeptGetResponse get(DeptGetRequest request, Token token) { + DeptGetResponse response = new DeptGetResponse(); + + ValidationUtil.validate(request, response); + if (response.hasError()) { + return response; + } + + Dept po = deptMapper.get(request, token); + + if (po != null) { + response.setDept(po); + } else { + response.addError(ErrorType.BUSINESS_ERROR, Message.GET_FAILURE); + } + + return response; + } +} diff --git a/src/main/resources/modules/SpringBoot/java/module/system/mgr/DictItemManager.java b/src/main/resources/modules/SpringBoot/java/module/system/mgr/DictItemManager.java index e59d5112..2bd85c95 100644 --- a/src/main/resources/modules/SpringBoot/java/module/system/mgr/DictItemManager.java +++ b/src/main/resources/modules/SpringBoot/java/module/system/mgr/DictItemManager.java @@ -1,8 +1,16 @@ package ${basePackage}.module.system.mgr; import ${basePackage}.frame.base.Token; -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; /** * 字典项 diff --git a/src/main/resources/modules/SpringBoot/java/module/system/mgr/DictItemManagerImpl.java b/src/main/resources/modules/SpringBoot/java/module/system/mgr/DictItemManagerImpl.java index 2ae4678a..398b59db 100644 --- a/src/main/resources/modules/SpringBoot/java/module/system/mgr/DictItemManagerImpl.java +++ b/src/main/resources/modules/SpringBoot/java/module/system/mgr/DictItemManagerImpl.java @@ -14,8 +14,16 @@ import ${basePackage}.frame.utils.Message; import ${basePackage}.frame.utils.ValidationUtil; import ${basePackage}.module.system.ent.DictItem; import ${basePackage}.module.system.mpr.DictItemMapper; -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; /** * DICT_ITEM - 字典项 diff --git a/src/main/resources/modules/SpringBoot/java/module/system/mgr/DictManager.java b/src/main/resources/modules/SpringBoot/java/module/system/mgr/DictManager.java index 6f4dbd0a..9280a697 100644 --- a/src/main/resources/modules/SpringBoot/java/module/system/mgr/DictManager.java +++ b/src/main/resources/modules/SpringBoot/java/module/system/mgr/DictManager.java @@ -1,8 +1,18 @@ package ${basePackage}.module.system.mgr; import ${basePackage}.frame.base.Token; -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; /** * 字典 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 3d41a254..d7456589 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 @@ -14,8 +14,20 @@ import ${basePackage}.frame.utils.Message; import ${basePackage}.frame.utils.ValidationUtil; import ${basePackage}.module.system.ent.Dict; import ${basePackage}.module.system.mpr.DictMapper; -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.DictItemFindRequest; +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.DictItemFindResponse; +import ${basePackage}.module.system.rsp.DictLoadResponse; +import ${basePackage}.module.system.rsp.DictUpdateResponse; import java.util.List; diff --git a/src/main/resources/modules/SpringBoot/java/module/system/mgr/FileManager.java b/src/main/resources/modules/SpringBoot/java/module/system/mgr/FileManager.java index 77e06b00..784209b7 100644 --- a/src/main/resources/modules/SpringBoot/java/module/system/mgr/FileManager.java +++ b/src/main/resources/modules/SpringBoot/java/module/system/mgr/FileManager.java @@ -1,8 +1,14 @@ package ${basePackage}.module.system.mgr; -import ${basePackage}.module.system.req.*; -import ${basePackage}.module.system.rsp.*; import ${basePackage}.frame.base.Token; +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; /** * 文件 diff --git a/src/main/resources/modules/SpringBoot/java/module/system/mgr/FileManagerImpl.java b/src/main/resources/modules/SpringBoot/java/module/system/mgr/FileManagerImpl.java index 29dc01cf..3bc04ab9 100644 --- a/src/main/resources/modules/SpringBoot/java/module/system/mgr/FileManagerImpl.java +++ b/src/main/resources/modules/SpringBoot/java/module/system/mgr/FileManagerImpl.java @@ -1,21 +1,27 @@ 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.File; -import ${basePackage}.module.system.mpr.FileMapper; -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.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.File; +import ${basePackage}.module.system.mpr.FileMapper; +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; /** * FILE - 文件 diff --git a/src/main/resources/modules/SpringBoot/java/module/system/mgr/ResourceManager.java b/src/main/resources/modules/SpringBoot/java/module/system/mgr/ResourceManager.java index 9adf3712..de171307 100644 --- a/src/main/resources/modules/SpringBoot/java/module/system/mgr/ResourceManager.java +++ b/src/main/resources/modules/SpringBoot/java/module/system/mgr/ResourceManager.java @@ -1,8 +1,16 @@ package ${basePackage}.module.system.mgr; -import ${basePackage}.module.system.req.*; -import ${basePackage}.module.system.rsp.*; import ${basePackage}.frame.base.Token; +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; /** * 资源 diff --git a/src/main/resources/modules/SpringBoot/java/module/system/mgr/ResourceManagerImpl.java b/src/main/resources/modules/SpringBoot/java/module/system/mgr/ResourceManagerImpl.java index c0fe1ca3..33b8e818 100644 --- a/src/main/resources/modules/SpringBoot/java/module/system/mgr/ResourceManagerImpl.java +++ b/src/main/resources/modules/SpringBoot/java/module/system/mgr/ResourceManagerImpl.java @@ -1,21 +1,29 @@ 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.Resource; -import ${basePackage}.module.system.mpr.ResourceMapper; -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.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.Resource; +import ${basePackage}.module.system.mpr.ResourceMapper; +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; /** * RESOURCE - 资源 diff --git a/src/main/resources/modules/SpringBoot/java/module/system/mgr/RoleManager.java b/src/main/resources/modules/SpringBoot/java/module/system/mgr/RoleManager.java index 83c8ecfb..924c832d 100644 --- a/src/main/resources/modules/SpringBoot/java/module/system/mgr/RoleManager.java +++ b/src/main/resources/modules/SpringBoot/java/module/system/mgr/RoleManager.java @@ -1,8 +1,16 @@ package ${basePackage}.module.system.mgr; -import ${basePackage}.module.system.req.*; -import ${basePackage}.module.system.rsp.*; import ${basePackage}.frame.base.Token; +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; /** * 角色 diff --git a/src/main/resources/modules/SpringBoot/java/module/system/mgr/RoleManagerImpl.java b/src/main/resources/modules/SpringBoot/java/module/system/mgr/RoleManagerImpl.java index 415613e4..1f2c1aa1 100644 --- a/src/main/resources/modules/SpringBoot/java/module/system/mgr/RoleManagerImpl.java +++ b/src/main/resources/modules/SpringBoot/java/module/system/mgr/RoleManagerImpl.java @@ -1,21 +1,29 @@ 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.Role; -import ${basePackage}.module.system.mpr.RoleMapper; -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.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.Role; +import ${basePackage}.module.system.mpr.RoleMapper; +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; /** * ROLE - 角色 diff --git a/src/main/resources/modules/SpringBoot/java/module/system/mgr/RoleResourceManager.java b/src/main/resources/modules/SpringBoot/java/module/system/mgr/RoleResourceManager.java index d9389ff8..689b314a 100644 --- a/src/main/resources/modules/SpringBoot/java/module/system/mgr/RoleResourceManager.java +++ b/src/main/resources/modules/SpringBoot/java/module/system/mgr/RoleResourceManager.java @@ -1,8 +1,16 @@ package ${basePackage}.module.system.mgr; -import ${basePackage}.module.system.req.*; -import ${basePackage}.module.system.rsp.*; import ${basePackage}.frame.base.Token; +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; /** * 角色资源关系 diff --git a/src/main/resources/modules/SpringBoot/java/module/system/mgr/RoleResourceManagerImpl.java b/src/main/resources/modules/SpringBoot/java/module/system/mgr/RoleResourceManagerImpl.java index 7656bce2..30fd5c56 100644 --- a/src/main/resources/modules/SpringBoot/java/module/system/mgr/RoleResourceManagerImpl.java +++ b/src/main/resources/modules/SpringBoot/java/module/system/mgr/RoleResourceManagerImpl.java @@ -1,21 +1,29 @@ 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.RoleResource; -import ${basePackage}.module.system.mpr.RoleResourceMapper; -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.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.RoleResource; +import ${basePackage}.module.system.mpr.RoleResourceMapper; +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; /** * ROLE_RESOURCE - 角色资源关系 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 05cb109b..eebacd0e 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 @@ -1,8 +1,18 @@ package ${basePackage}.module.system.mgr; -import ${basePackage}.module.system.req.*; -import ${basePackage}.module.system.rsp.*; import ${basePackage}.frame.base.Token; +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; /** * 通行证 diff --git a/src/main/resources/modules/SpringBoot/java/module/system/mgr/UserManager.java b/src/main/resources/modules/SpringBoot/java/module/system/mgr/UserManager.java index e0b3d1e9..d53c3590 100644 --- a/src/main/resources/modules/SpringBoot/java/module/system/mgr/UserManager.java +++ b/src/main/resources/modules/SpringBoot/java/module/system/mgr/UserManager.java @@ -1,8 +1,16 @@ package ${basePackage}.module.system.mgr; -import ${basePackage}.module.system.req.*; -import ${basePackage}.module.system.rsp.*; import ${basePackage}.frame.base.Token; +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; /** * 用户 diff --git a/src/main/resources/modules/SpringBoot/java/module/system/mgr/UserManagerImpl.java b/src/main/resources/modules/SpringBoot/java/module/system/mgr/UserManagerImpl.java index 81bf35f4..a5885be7 100644 --- a/src/main/resources/modules/SpringBoot/java/module/system/mgr/UserManagerImpl.java +++ b/src/main/resources/modules/SpringBoot/java/module/system/mgr/UserManagerImpl.java @@ -1,21 +1,29 @@ 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.User; -import ${basePackage}.module.system.mpr.UserMapper; -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.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.User; +import ${basePackage}.module.system.mpr.UserMapper; +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; /** * USER - 用户 diff --git a/src/main/resources/modules/SpringBoot/java/module/system/mgr/UserRoleManager.java b/src/main/resources/modules/SpringBoot/java/module/system/mgr/UserRoleManager.java index 5751eb19..43168602 100644 --- a/src/main/resources/modules/SpringBoot/java/module/system/mgr/UserRoleManager.java +++ b/src/main/resources/modules/SpringBoot/java/module/system/mgr/UserRoleManager.java @@ -1,8 +1,16 @@ package ${basePackage}.module.system.mgr; -import ${basePackage}.module.system.req.*; -import ${basePackage}.module.system.rsp.*; import ${basePackage}.frame.base.Token; +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; /** * 用户角色授权 diff --git a/src/main/resources/modules/SpringBoot/java/module/system/mgr/UserRoleManagerImpl.java b/src/main/resources/modules/SpringBoot/java/module/system/mgr/UserRoleManagerImpl.java index 18b20b53..aaa92e0c 100644 --- a/src/main/resources/modules/SpringBoot/java/module/system/mgr/UserRoleManagerImpl.java +++ b/src/main/resources/modules/SpringBoot/java/module/system/mgr/UserRoleManagerImpl.java @@ -1,21 +1,29 @@ 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.UserRole; -import ${basePackage}.module.system.mpr.UserRoleMapper; -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.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.UserRole; +import ${basePackage}.module.system.mpr.UserRoleMapper; +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; /** * USER_ROLE - 用户角色授权 diff --git a/src/main/resources/modules/SpringBoot/java/module/system/mpr/DeptMapper.java b/src/main/resources/modules/SpringBoot/java/module/system/mpr/DeptMapper.java new file mode 100644 index 00000000..d43b9b9b --- /dev/null +++ b/src/main/resources/modules/SpringBoot/java/module/system/mpr/DeptMapper.java @@ -0,0 +1,78 @@ +package ${basePackage}.module.system.mpr; + +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +import ${basePackage}.module.system.ent.Dept; +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}.frame.base.Token; + +/** + * DEPT - 部门 + * + * @author wangbing + * @date 2019-12-24 + */ +@Mapper +public interface DeptMapper { + + /** + * 插入 + * + * @param request 请求对象 + * @param token 令牌 + * @return 返回数量 + */ + long insert(@Param("request") Dept request, @Param("token") Token token); + + /** + * 批量插入 + * + * @param request 请求对象 + * @param token 令牌 + * @return 返回数量 + */ + long insertBatch(@Param("list") List request, @Param("token") Token token); + + /** + * 逻辑删除 + * + * @param request 请求对象 + * @param token 令牌 + * @return 返回数量 + */ + long delete(@Param("request") DeptDeleteRequest request, @Param("token") Token token); + + /** + * 更新 + * + * @param request 请求对象 + * @param token 令牌 + * @return 返回数量 + */ + long update(@Param("request") DeptUpdateRequest request, @Param("token") Token token); + + /** + * 查询 + * + * @param request 请求对象 + * @param token 令牌 + * @return 返回对象 + */ + List find(@Param("request") DeptFindRequest request, @Param("token") Token token); + + /** + * 获得对象 + * + * @param request 请求对象 + * @param token 令牌 + * @return 返回对象 + */ + Dept get(@Param("request") DeptGetRequest request, @Param("token") Token token); +} diff --git a/src/main/resources/modules/SpringBoot/java/module/system/mpr/DictMapper.java b/src/main/resources/modules/SpringBoot/java/module/system/mpr/DictMapper.java index 97a230e3..45f8c052 100644 --- a/src/main/resources/modules/SpringBoot/java/module/system/mpr/DictMapper.java +++ b/src/main/resources/modules/SpringBoot/java/module/system/mpr/DictMapper.java @@ -4,7 +4,11 @@ import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import ${basePackage}.frame.base.Token; import ${basePackage}.module.system.ent.Dict; -import ${basePackage}.module.system.req.*; +import ${basePackage}.module.system.req.DictDeleteRequest; +import ${basePackage}.module.system.req.DictFindRequest; +import ${basePackage}.module.system.req.DictGetRequest; +import ${basePackage}.module.system.req.DictUpdateRequest; + import java.util.List; /** diff --git a/src/main/resources/modules/SpringBoot/java/module/system/mpr/FileMapper.java b/src/main/resources/modules/SpringBoot/java/module/system/mpr/FileMapper.java index b87da09e..b9cee915 100644 --- a/src/main/resources/modules/SpringBoot/java/module/system/mpr/FileMapper.java +++ b/src/main/resources/modules/SpringBoot/java/module/system/mpr/FileMapper.java @@ -1,14 +1,15 @@ package ${basePackage}.module.system.mpr; -import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import ${basePackage}.frame.base.Token; +import ${basePackage}.module.system.ent.File; +import ${basePackage}.module.system.req.FileDeleteRequest; +import ${basePackage}.module.system.req.FileFindRequest; +import ${basePackage}.module.system.req.FileGetRequest; import java.util.List; -import ${basePackage}.module.system.ent.File; -import ${basePackage}.module.system.req.*; -import ${basePackage}.frame.base.Token; - /** * FILE - 文件 * diff --git a/src/main/resources/modules/SpringBoot/java/module/system/mpr/MySQL_DeptMapper.xml b/src/main/resources/modules/SpringBoot/java/module/system/mpr/MySQL_DeptMapper.xml new file mode 100644 index 00000000..9a7bb46c --- /dev/null +++ b/src/main/resources/modules/SpringBoot/java/module/system/mpr/MySQL_DeptMapper.xml @@ -0,0 +1,154 @@ + + + + + `SYS_DEPT` + + + `ID`,`DEPT_CODE`,`DEPT_NAME`,`DEPT_ALIAS`,`SUP_CODE`,`SUP_NAME`,`VALID`,`ROW_VERSION`,`IS_DELETED`,`CREATE_BY`,`CREATE_TIME`,`LAST_UPDATE_BY`,`LAST_UPDATE_TIME` + + + + + + + + + + + + + + + + + + + + + + + + INSERT INTO + + ( + + ) + VALUES + ( + ${r"#"}{request.id}, + ${r"#"}{request.deptCode,jdbcType=VARCHAR}, + ${r"#"}{request.deptName,jdbcType=VARCHAR}, + ${r"#"}{request.deptAlias,jdbcType=VARCHAR}, + ${r"#"}{request.supCode,jdbcType=VARCHAR}, + ${r"#"}{request.supName,jdbcType=VARCHAR}, + ${r"#"}{request.valid,jdbcType=BIT}, + 0, + 0, + ${r"#"}{token.userId,jdbcType=NUMERIC}, + sysdate(), + NULL, + NULL + ) + + + + INSERT INTO + + ( + + ) + VALUES + + ( + ${r"#"}{item.id}, + ${r"#"}{item.deptCode,jdbcType=VARCHAR}, + ${r"#"}{item.deptName,jdbcType=VARCHAR}, + ${r"#"}{item.deptAlias,jdbcType=VARCHAR}, + ${r"#"}{item.supCode,jdbcType=VARCHAR}, + ${r"#"}{item.supName,jdbcType=VARCHAR}, + ${r"#"}{item.valid,jdbcType=BIT}, + 0, + 0, + ${r"#"}{token.userId,jdbcType=NUMERIC}, + sysdate(), + NULL, + NULL + ) + + + + + UPDATE + + SET `IS_DELETED` = 1 + WHERE `IS_DELETED` = 0 + AND `ID` = ${r"#"}{request.id} + + + + UPDATE + + SET + `DEPT_CODE` = ${r"#"}{request.deptCode,jdbcType=VARCHAR}, + `DEPT_NAME` = ${r"#"}{request.deptName,jdbcType=VARCHAR}, + `DEPT_ALIAS` = ${r"#"}{request.deptAlias,jdbcType=VARCHAR}, + `SUP_CODE` = ${r"#"}{request.supCode,jdbcType=VARCHAR}, + `SUP_NAME` = ${r"#"}{request.supName,jdbcType=VARCHAR}, + `VALID` = ${r"#"}{request.valid,jdbcType=BIT}, + `ROW_VERSION` = `ROW_VERSION` + 1, + `LAST_UPDATE_BY` = ${r"#"}{token.userId}, + `LAST_UPDATE_TIME` = sysdate() + WHERE + `IS_DELETED` = 0 + AND `ID` = ${r"#"}{request.id} + AND `ROW_VERSION` = ${r"#"}{request.rowVersion} + + + + \ No newline at end of file diff --git a/src/main/resources/modules/SpringBoot/java/module/system/mpr/ResourceMapper.java b/src/main/resources/modules/SpringBoot/java/module/system/mpr/ResourceMapper.java index 8d48cc0f..dc6a2e43 100644 --- a/src/main/resources/modules/SpringBoot/java/module/system/mpr/ResourceMapper.java +++ b/src/main/resources/modules/SpringBoot/java/module/system/mpr/ResourceMapper.java @@ -1,14 +1,16 @@ package ${basePackage}.module.system.mpr; -import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import ${basePackage}.frame.base.Token; +import ${basePackage}.module.system.ent.Resource; +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 java.util.List; -import ${basePackage}.module.system.ent.Resource; -import ${basePackage}.module.system.req.*; -import ${basePackage}.frame.base.Token; - /** * RESOURCE - 资源 * diff --git a/src/main/resources/modules/SpringBoot/java/module/system/mpr/RoleMapper.java b/src/main/resources/modules/SpringBoot/java/module/system/mpr/RoleMapper.java index fcfdf8e4..07af1226 100644 --- a/src/main/resources/modules/SpringBoot/java/module/system/mpr/RoleMapper.java +++ b/src/main/resources/modules/SpringBoot/java/module/system/mpr/RoleMapper.java @@ -1,14 +1,16 @@ package ${basePackage}.module.system.mpr; -import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import ${basePackage}.frame.base.Token; +import ${basePackage}.module.system.ent.Role; +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 java.util.List; -import ${basePackage}.module.system.ent.Role; -import ${basePackage}.module.system.req.*; -import ${basePackage}.frame.base.Token; - /** * ROLE - 角色 * diff --git a/src/main/resources/modules/SpringBoot/java/module/system/mpr/RoleResourceMapper.java b/src/main/resources/modules/SpringBoot/java/module/system/mpr/RoleResourceMapper.java index 2a81f08c..de70e493 100644 --- a/src/main/resources/modules/SpringBoot/java/module/system/mpr/RoleResourceMapper.java +++ b/src/main/resources/modules/SpringBoot/java/module/system/mpr/RoleResourceMapper.java @@ -1,14 +1,16 @@ package ${basePackage}.module.system.mpr; -import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import ${basePackage}.frame.base.Token; +import ${basePackage}.module.system.ent.RoleResource; +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 java.util.List; -import ${basePackage}.module.system.ent.RoleResource; -import ${basePackage}.module.system.req.*; -import ${basePackage}.frame.base.Token; - /** * ROLE_RESOURCE - 角色资源关系 * diff --git a/src/main/resources/modules/SpringBoot/java/module/system/mpr/TokensMapper.java b/src/main/resources/modules/SpringBoot/java/module/system/mpr/TokensMapper.java index 3d8f8cec..491bedb1 100644 --- a/src/main/resources/modules/SpringBoot/java/module/system/mpr/TokensMapper.java +++ b/src/main/resources/modules/SpringBoot/java/module/system/mpr/TokensMapper.java @@ -1,14 +1,16 @@ package ${basePackage}.module.system.mpr; -import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import ${basePackage}.frame.base.Token; +import ${basePackage}.module.system.ent.Tokens; +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 java.util.List; -import ${basePackage}.module.system.ent.Tokens; -import ${basePackage}.module.system.req.*; -import ${basePackage}.frame.base.Token; - /** * TOKENS - 通行证 * diff --git a/src/main/resources/modules/SpringBoot/java/module/system/mpr/UserMapper.java b/src/main/resources/modules/SpringBoot/java/module/system/mpr/UserMapper.java index 057435ee..d91da824 100644 --- a/src/main/resources/modules/SpringBoot/java/module/system/mpr/UserMapper.java +++ b/src/main/resources/modules/SpringBoot/java/module/system/mpr/UserMapper.java @@ -1,14 +1,16 @@ package ${basePackage}.module.system.mpr; -import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import ${basePackage}.frame.base.Token; +import ${basePackage}.module.system.ent.User; +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 java.util.List; -import ${basePackage}.module.system.ent.User; -import ${basePackage}.module.system.req.*; -import ${basePackage}.frame.base.Token; - /** * USER - 用户 * diff --git a/src/main/resources/modules/SpringBoot/java/module/system/mpr/UserRoleMapper.java b/src/main/resources/modules/SpringBoot/java/module/system/mpr/UserRoleMapper.java index 61646015..5b841b33 100644 --- a/src/main/resources/modules/SpringBoot/java/module/system/mpr/UserRoleMapper.java +++ b/src/main/resources/modules/SpringBoot/java/module/system/mpr/UserRoleMapper.java @@ -1,14 +1,16 @@ package ${basePackage}.module.system.mpr; -import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import ${basePackage}.frame.base.Token; +import ${basePackage}.module.system.ent.UserRole; +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 java.util.List; -import ${basePackage}.module.system.ent.UserRole; -import ${basePackage}.module.system.req.*; -import ${basePackage}.frame.base.Token; - /** * USER_ROLE - 用户角色授权 * diff --git a/src/main/resources/modules/SpringBoot/java/module/system/req/RoleCreateRequest.java b/src/main/resources/modules/SpringBoot/java/module/system/req/RoleCreateRequest.java new file mode 100644 index 00000000..fda7c227 --- /dev/null +++ b/src/main/resources/modules/SpringBoot/java/module/system/req/RoleCreateRequest.java @@ -0,0 +1,60 @@ +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; + +/** + * RoleCreateRequest - 角色新增 + * + * @author wangbing + * @version 0.0.1 + * @since 2019-12-24 + */ +public class RoleCreateRequest extends BaseRequest { + + /** + * 角色名称 + */ + @NotEmpty(message = "[roleName]角色名称不能为空") + @Length(min = 0, max = 50, message = "[roleName]角色名称长度不合法(0-50)") + private String roleName; + + /** + * 角色代码 + */ + @NotEmpty(message = "[roleCode]角色代码不能为空") + @Length(min = 0, max = 50, message = "[roleCode]角色代码长度不合法(0-50)") + private String roleCode; + + /** + * 角色描述 + */ + @Length(min = 0, max = 50, message = "[roleComment]角色描述长度不合法(0-50)") + private String roleComment; + + public String getRoleName() { + return this.roleName; + } + + public void setRoleName(String roleName) { + this.roleName = roleName; + } + + public String getRoleCode() { + return this.roleCode; + } + + public void setRoleCode(String roleCode) { + this.roleCode = roleCode; + } + + public String getRoleComment() { + return this.roleComment; + } + + public void setRoleComment(String roleComment) { + this.roleComment = roleComment; + } +} diff --git a/src/main/resources/modules/SpringBoot/java/module/system/req/RoleDeleteRequest.java b/src/main/resources/modules/SpringBoot/java/module/system/req/RoleDeleteRequest.java new file mode 100644 index 00000000..ee75ea7d --- /dev/null +++ b/src/main/resources/modules/SpringBoot/java/module/system/req/RoleDeleteRequest.java @@ -0,0 +1,28 @@ +package ${basePackage}.module.system.req; + +import ${basePackage}.frame.base.BaseUpdateRequest; +import javax.validation.constraints.NotNull; + +/** + * RoleDeleteRequest - 角色删除 + * + * @author wangbing + * @version 0.0.1 + * @since 2019-12-24 + */ +public class RoleDeleteRequest extends BaseUpdateRequest { + + /** + * 主键 + */ + @NotNull(message = "[id]主键不能为空") + private long id; + + public long getId() { + return this.id; + } + + public void setId(long id) { + this.id = id; + } +} diff --git a/src/main/resources/modules/SpringBoot/java/module/system/req/RoleFindRequest.java b/src/main/resources/modules/SpringBoot/java/module/system/req/RoleFindRequest.java new file mode 100644 index 00000000..06a1b78e --- /dev/null +++ b/src/main/resources/modules/SpringBoot/java/module/system/req/RoleFindRequest.java @@ -0,0 +1,52 @@ +package ${basePackage}.module.system.req; + +import ${basePackage}.frame.base.BaseFindRequest; + +/** + * RoleRequest - 角色查询 + * + * @author wangbing + * @version 0.0.1 + * @since 2019-12-24 + */ +public class RoleFindRequest extends BaseFindRequest { + + /** + * 角色名称 + */ + private String roleName; + + /** + * 角色代码 + */ + private String roleCode; + + /** + * 角色描述 + */ + private String roleComment; + + public String getRoleName() { + return this.roleName; + } + + public void setRoleName(String roleName) { + this.roleName = roleName; + } + + public String getRoleCode() { + return this.roleCode; + } + + public void setRoleCode(String roleCode) { + this.roleCode = roleCode; + } + + public String getRoleComment() { + return this.roleComment; + } + + public void setRoleComment(String roleComment) { + this.roleComment = roleComment; + } +} diff --git a/src/main/resources/modules/SpringBoot/java/module/system/req/RoleGetRequest.java b/src/main/resources/modules/SpringBoot/java/module/system/req/RoleGetRequest.java new file mode 100644 index 00000000..075c0254 --- /dev/null +++ b/src/main/resources/modules/SpringBoot/java/module/system/req/RoleGetRequest.java @@ -0,0 +1,28 @@ +package ${basePackage}.module.system.req; + +import ${basePackage}.frame.base.BaseRequest; +import javax.validation.constraints.NotNull; + +/** + * RoleGetRequest - 角色获取 + * + * @author wangbing + * @version 0.0.1 + * @since 2019-12-24 + */ +public class RoleGetRequest extends BaseRequest { + + /** + * 主键 + */ + @NotNull(message = "[id]主键不能为空") + private long id; + + public long getId() { + return this.id; + } + + public void setId(long id) { + this.id = id; + } +} diff --git a/src/main/resources/modules/SpringBoot/java/module/system/req/RoleUpdateRequest.java b/src/main/resources/modules/SpringBoot/java/module/system/req/RoleUpdateRequest.java new file mode 100644 index 00000000..34397dd9 --- /dev/null +++ b/src/main/resources/modules/SpringBoot/java/module/system/req/RoleUpdateRequest.java @@ -0,0 +1,74 @@ +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; + +/** + * RoleUpdateRequest - 角色更新 + * + * @author wangbing + * @version 0.0.1 + * @since 2019-12-24 + */ +public class RoleUpdateRequest extends BaseUpdateRequest { + + /** + * 主键 + */ + @NotNull(message = "[id]主键不能为NULL") + private Long id; + + /** + * 角色名称 + */ + @NotEmpty(message = "[roleName]角色名称不能为空") + @Length(min = 0, max = 50, message = "[roleName]角色名称长度不合法(0-50)") + private String roleName; + + /** + * 角色代码 + */ + @NotEmpty(message = "[roleCode]角色代码不能为空") + @Length(min = 0, max = 50, message = "[roleCode]角色代码长度不合法(0-50)") + private String roleCode; + + /** + * 角色描述 + */ + @Length(min = 0, max = 50, message = "[roleComment]角色描述长度不合法(0-50)") + private String roleComment; + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getRoleName() { + return this.roleName; + } + + public void setRoleName(String roleName) { + this.roleName = roleName; + } + + public String getRoleCode() { + return this.roleCode; + } + + public void setRoleCode(String roleCode) { + this.roleCode = roleCode; + } + + public String getRoleComment() { + return this.roleComment; + } + + public void setRoleComment(String roleComment) { + this.roleComment = roleComment; + } +} diff --git a/src/main/resources/modules/SpringBoot/java/module/system/rsp/RoleCreateResponse.java b/src/main/resources/modules/SpringBoot/java/module/system/rsp/RoleCreateResponse.java new file mode 100644 index 00000000..4948d075 --- /dev/null +++ b/src/main/resources/modules/SpringBoot/java/module/system/rsp/RoleCreateResponse.java @@ -0,0 +1,26 @@ +package ${basePackage}.module.system.rsp; + +import ${basePackage}.frame.base.BaseResponse; + +/** + * RoleCreateResponse - 角色 + * + * @author wangbing + * @version 0.0.1 + * @since 2019-12-24 + */ +public class RoleCreateResponse extends BaseResponse { + + /** + * 主键 + */ + private Long id; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } +} diff --git a/src/main/resources/modules/SpringBoot/java/module/system/rsp/RoleDeleteResponse.java b/src/main/resources/modules/SpringBoot/java/module/system/rsp/RoleDeleteResponse.java new file mode 100644 index 00000000..d6153070 --- /dev/null +++ b/src/main/resources/modules/SpringBoot/java/module/system/rsp/RoleDeleteResponse.java @@ -0,0 +1,26 @@ +package ${basePackage}.module.system.rsp; + +import ${basePackage}.frame.base.BaseResponse; + +/** + * RoleDeleteResponse - 角色 + * + * @author wangbing + * @version 0.0.1 + * @since 2019-12-24 + */ +public class RoleDeleteResponse extends BaseResponse { + + /** + * 删除数目 + */ + private Long result; + + public Long getResult() { + return this.result; + } + + public void setResult(Long result) { + this.result = result; + } +} diff --git a/src/main/resources/modules/SpringBoot/java/module/system/rsp/RoleFindResponse.java b/src/main/resources/modules/SpringBoot/java/module/system/rsp/RoleFindResponse.java new file mode 100644 index 00000000..7d4b9101 --- /dev/null +++ b/src/main/resources/modules/SpringBoot/java/module/system/rsp/RoleFindResponse.java @@ -0,0 +1,14 @@ +package ${basePackage}.module.system.rsp; + +import ${basePackage}.frame.base.BaseFindResponse; +import ${basePackage}.module.system.ent.Role; + +/** + * RoleFindResponse - 角色 + * + * @author wangbing + * @version 0.0.1 + * @since 2019-12-24 + */ +public class RoleFindResponse extends BaseFindResponse { +} \ No newline at end of file diff --git a/src/main/resources/modules/SpringBoot/java/module/system/rsp/RoleGetResponse.java b/src/main/resources/modules/SpringBoot/java/module/system/rsp/RoleGetResponse.java new file mode 100644 index 00000000..42513bc9 --- /dev/null +++ b/src/main/resources/modules/SpringBoot/java/module/system/rsp/RoleGetResponse.java @@ -0,0 +1,27 @@ +package ${basePackage}.module.system.rsp; + +import ${basePackage}.module.system.ent.Role; +import ${basePackage}.frame.base.BaseResponse; + +/** + * RoleGetResponse - 角色 + * + * @author wangbing + * @version 0.0.1 + * @since 2019-12-24 + */ +public class RoleGetResponse extends BaseResponse { + + /** + * 角色 + */ + private Role role; + + public Role getRole() { + return this.role; + } + + public void setRole(Role role) { + this.role = role; + } +} diff --git a/src/main/resources/modules/SpringBoot/java/module/system/rsp/RoleUpdateResponse.java b/src/main/resources/modules/SpringBoot/java/module/system/rsp/RoleUpdateResponse.java new file mode 100644 index 00000000..3d74d089 --- /dev/null +++ b/src/main/resources/modules/SpringBoot/java/module/system/rsp/RoleUpdateResponse.java @@ -0,0 +1,26 @@ +package ${basePackage}.module.system.rsp; + +import ${basePackage}.frame.base.BaseResponse; + +/** + * RoleUpdateResponse - 角色 + * + * @author wangbing + * @version 0.0.1 + * @since 2019-12-24 + */ +public class RoleUpdateResponse extends BaseResponse { + + /** + * 更新数目 + */ + private Long result; + + public Long getResult() { + return this.result; + } + + public void setResult(Long result) { + this.result = result; + } +}