From 3be27d0648448c67eee9591bd70bd2968e3358ac Mon Sep 17 00:00:00 2001 From: YunaiV <> Date: Sun, 5 Jul 2020 22:22:45 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=E7=AE=A1=E7=90=86=E5=90=8E?= =?UTF-8?q?=E5=8F=B0=E7=9A=84=20admin=20=E7=9B=B8=E5=85=B3=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/framework/vo/PageParam.java | 3 +- .../controller/admin/AdminController.java | 40 +++++++---------- .../controller/admin/dto/AdminCreateDTO.java | 8 ++-- .../admin/dto/AdminUpdateInfoDTO.java | 8 ++-- ...PageResponse.java => AdminPageItemVO.java} | 25 ++--------- .../convert/admin/AdminConvert.java | 29 +++++++++++++ .../manager/admin/AdminManager.java | 43 +++++++++++++++++-- .../rpc/admin/dto/AdminCreateDTO.java | 11 +++-- .../rpc/admin/dto/AdminPageDTO.java | 15 ++++--- .../rpc/admin/dto/AdminUpdateDTO.java | 10 ++--- .../systemservice/rpc/admin/vo/AdminVO.java | 6 +++ .../dal/mysql/dataobject/admin/AdminDO.java | 8 ++-- .../service/admin/bo/AdminBO.java | 7 +++ .../service/admin/bo/AdminCreateBO.java | 11 +++-- .../service/admin/bo/AdminUpdateBO.java | 4 +- 15 files changed, 140 insertions(+), 88 deletions(-) rename management-web-app/src/main/java/cn/iocoder/mall/managementweb/controller/admin/vo/{AdminsAdminPageResponse.java => AdminPageItemVO.java} (75%) create mode 100644 management-web-app/src/main/java/cn/iocoder/mall/managementweb/convert/admin/AdminConvert.java diff --git a/common/common-framework/src/main/java/cn/iocoder/common/framework/vo/PageParam.java b/common/common-framework/src/main/java/cn/iocoder/common/framework/vo/PageParam.java index 5b4d4f6e8..8b81dbfb2 100644 --- a/common/common-framework/src/main/java/cn/iocoder/common/framework/vo/PageParam.java +++ b/common/common-framework/src/main/java/cn/iocoder/common/framework/vo/PageParam.java @@ -6,9 +6,10 @@ import org.hibernate.validator.constraints.Range; import javax.validation.constraints.Min; import javax.validation.constraints.NotNull; +import java.io.Serializable; @ApiModel("分页参数") -public class PageParam { +public class PageParam implements Serializable { @ApiModelProperty(value = "页码,从 1 开始", required = true,example = "1") @NotNull(message = "页码不能为空") diff --git a/management-web-app/src/main/java/cn/iocoder/mall/managementweb/controller/admin/AdminController.java b/management-web-app/src/main/java/cn/iocoder/mall/managementweb/controller/admin/AdminController.java index 721027661..5df1d158c 100644 --- a/management-web-app/src/main/java/cn/iocoder/mall/managementweb/controller/admin/AdminController.java +++ b/management-web-app/src/main/java/cn/iocoder/mall/managementweb/controller/admin/AdminController.java @@ -2,14 +2,19 @@ package cn.iocoder.mall.managementweb.controller.admin; import cn.iocoder.common.framework.util.HttpUtil; import cn.iocoder.common.framework.vo.CommonResult; +import cn.iocoder.common.framework.vo.PageResult; import cn.iocoder.mall.managementweb.controller.admin.dto.AdminCreateDTO; +import cn.iocoder.mall.managementweb.controller.admin.dto.AdminPageDTO; import cn.iocoder.mall.managementweb.controller.admin.dto.AdminUpdateInfoDTO; import cn.iocoder.mall.managementweb.controller.admin.dto.AdminUpdateStatusDTO; +import cn.iocoder.mall.managementweb.controller.admin.vo.AdminPageItemVO; import cn.iocoder.mall.managementweb.manager.admin.AdminManager; import cn.iocoder.mall.security.admin.core.context.AdminSecurityContextHolder; +import cn.iocoder.security.annotations.RequiresPermissions; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @@ -27,45 +32,32 @@ public class AdminController { private AdminManager adminManager; // =========== 管理员管理 API =========== -// @GetMapping("/page") -// @RequiresPermissions("system.admin.page") -// @ApiOperation(value = "管理员分页") -// public CommonResult> page(AdminPageDTO adminPageDTO) { -// PageResult page = adminService.getAdminPage(adminPageDTO); -// PageResult resultPage = AdminConvert.INSTANCE.convertAdminVOPage(page); -// // 拼接结果 -// if (!resultPage.getList().isEmpty()) { -// // 查询角色数组 -// Map> roleMap = adminService.getAdminRolesMap(CollectionUtil.convertList(resultPage.getList(), AdminBO::getId)); -// resultPage.getList().forEach(admin -> admin.setRoles(AdminConvert.INSTANCE.convertAdminVORoleList(roleMap.get(admin.getId())))); -// -// // 查询对应部门 -// List deptmentBOS = deptmentService.getAllDeptments(); -// Map deptNameMap = deptmentBOS.stream().collect(Collectors.toMap(d->d.getId(), d->d.getName())); -// //管理员所在部门被删后,变成未分配状态 -// deptNameMap.put(0, "未分配"); -// resultPage.getList().forEach(admin->{ -// admin.setDeptment(new AdminVO.Deptment(admin.getDeptmentId(), deptNameMap.get(admin.getDeptmentId()))); -// }); -// } -// return success(resultPage); -// } + + @ApiOperation(value = "管理员分页") + @GetMapping("/page") + @RequiresPermissions("system.admin.page") + public CommonResult> page(AdminPageDTO adminPageDTO) { + return success(adminManager.pageAdmin(adminPageDTO)); + } @ApiOperation(value = "创建管理员") @PostMapping("/create") + @RequiresPermissions("admin:create") public CommonResult createAdmin(AdminCreateDTO createDTO, HttpServletRequest request) { return success(adminManager.createAdmin(createDTO, AdminSecurityContextHolder.getAdminId(), HttpUtil.getIp(request))); } @PostMapping("/update") @ApiOperation(value = "更新管理员") + @RequiresPermissions("admin:update") public CommonResult updateAdmin(AdminUpdateInfoDTO updateInfoDTO) { adminManager.updateAdmin(updateInfoDTO); return success(true); } - @PostMapping("/update_status") + @PostMapping("/update-status") @ApiOperation(value = "更新管理员状态") + @RequiresPermissions("admin:update-status") public CommonResult updateUserStatus(AdminUpdateStatusDTO updateStatusDTO) { adminManager.updateAdminStatus(updateStatusDTO); return success(true); diff --git a/management-web-app/src/main/java/cn/iocoder/mall/managementweb/controller/admin/dto/AdminCreateDTO.java b/management-web-app/src/main/java/cn/iocoder/mall/managementweb/controller/admin/dto/AdminCreateDTO.java index 69aeb5be2..45c6a4f20 100644 --- a/management-web-app/src/main/java/cn/iocoder/mall/managementweb/controller/admin/dto/AdminCreateDTO.java +++ b/management-web-app/src/main/java/cn/iocoder/mall/managementweb/controller/admin/dto/AdminCreateDTO.java @@ -15,10 +15,10 @@ import javax.validation.constraints.Pattern; @Accessors(chain = true) public class AdminCreateDTO { - @ApiModelProperty(value = "昵称", required = true, example = "小王") - @NotEmpty(message = "昵称不能为空") - @Length(max = 10, message = "昵称长度最大为 10 位") - private String nickname; + @ApiModelProperty(value = "真实名字", required = true, example = "小王") + @NotEmpty(message = "真实名字不能为空") + @Length(max = 10, message = "真实名字长度最大为 10 位") + private String name; @ApiModelProperty(value = "部门编号", required = true, example = "1") @NotNull(message = "部门不能为空") diff --git a/management-web-app/src/main/java/cn/iocoder/mall/managementweb/controller/admin/dto/AdminUpdateInfoDTO.java b/management-web-app/src/main/java/cn/iocoder/mall/managementweb/controller/admin/dto/AdminUpdateInfoDTO.java index 287083838..929481244 100644 --- a/management-web-app/src/main/java/cn/iocoder/mall/managementweb/controller/admin/dto/AdminUpdateInfoDTO.java +++ b/management-web-app/src/main/java/cn/iocoder/mall/managementweb/controller/admin/dto/AdminUpdateInfoDTO.java @@ -30,10 +30,10 @@ public class AdminUpdateInfoDTO { @Length(min = 4, max = 16, message = "密码长度为 4-16 位") private String password; - @ApiModelProperty(value = "昵称", required = true, example = "小王") - @NotEmpty(message = "昵称不能为空") - @Length(max = 10, message = "昵称长度最大为 10 位") - private String nickname; + @ApiModelProperty(value = "真实名字", required = true, example = "小王") + @NotEmpty(message = "真实名字不能为空") + @Length(max = 10, message = "真实名字长度最大为 10 位") + private String name; @ApiModelProperty(value = "部门编号", required = true, example = "1") @NotNull(message = "部门不能为空") diff --git a/management-web-app/src/main/java/cn/iocoder/mall/managementweb/controller/admin/vo/AdminsAdminPageResponse.java b/management-web-app/src/main/java/cn/iocoder/mall/managementweb/controller/admin/vo/AdminPageItemVO.java similarity index 75% rename from management-web-app/src/main/java/cn/iocoder/mall/managementweb/controller/admin/vo/AdminsAdminPageResponse.java rename to management-web-app/src/main/java/cn/iocoder/mall/managementweb/controller/admin/vo/AdminPageItemVO.java index e5fbf5bca..d8de770b4 100644 --- a/management-web-app/src/main/java/cn/iocoder/mall/managementweb/controller/admin/vo/AdminsAdminPageResponse.java +++ b/management-web-app/src/main/java/cn/iocoder/mall/managementweb/controller/admin/vo/AdminPageItemVO.java @@ -8,10 +8,10 @@ import lombok.experimental.Accessors; import java.util.Date; import java.util.List; -@ApiModel("管理员 - 管理员模块 - 管理员分页信息 Response") +@ApiModel(value = "分页时,管理员的信息 VO") @Data @Accessors(chain = true) -public class AdminsAdminPageResponse { +public class AdminPageItemVO { @ApiModel("角色") @Data @@ -39,19 +39,6 @@ public class AdminsAdminPageResponse { } - @ApiModel("账号") - @Data - @Accessors(chain = true) - public static class Account { - - @ApiModelProperty(value = "账号编号", required = true, example = "1") - private Integer id; - - @ApiModelProperty(value = "登陆账号", required = true, example = "15601691300") - private String username; - - } - @ApiModelProperty(value = "管理员编号", required = true, example = "1") private Integer id; @ApiModelProperty(value = "真实名字", required = true, example = "小王") @@ -60,17 +47,13 @@ public class AdminsAdminPageResponse { private Date createTime; @ApiModelProperty(value = "在职状态", required = true, example = "1", notes = "见 AdminStatusEnum 枚举") private Integer status; - - /** - * 账号 - */ - private Account account; + @ApiModelProperty(value = "登陆账号", required = true, example = "15601691300") + private String username; /** * 角色列表 */ private List roles; - /** * 所在部门 */ diff --git a/management-web-app/src/main/java/cn/iocoder/mall/managementweb/convert/admin/AdminConvert.java b/management-web-app/src/main/java/cn/iocoder/mall/managementweb/convert/admin/AdminConvert.java new file mode 100644 index 000000000..daf5c6a5c --- /dev/null +++ b/management-web-app/src/main/java/cn/iocoder/mall/managementweb/convert/admin/AdminConvert.java @@ -0,0 +1,29 @@ +package cn.iocoder.mall.managementweb.convert.admin; + +import cn.iocoder.common.framework.vo.PageResult; +import cn.iocoder.mall.managementweb.controller.admin.dto.AdminUpdateInfoDTO; +import cn.iocoder.mall.managementweb.controller.admin.dto.AdminUpdateStatusDTO; +import cn.iocoder.mall.managementweb.controller.admin.vo.AdminPageItemVO; +import cn.iocoder.mall.systemservice.rpc.admin.dto.AdminCreateDTO; +import cn.iocoder.mall.systemservice.rpc.admin.dto.AdminPageDTO; +import cn.iocoder.mall.systemservice.rpc.admin.dto.AdminUpdateDTO; +import cn.iocoder.mall.systemservice.rpc.admin.vo.AdminVO; +import org.mapstruct.Mapper; +import org.mapstruct.factory.Mappers; + +@Mapper +public interface AdminConvert { + + AdminConvert INSTANCE = Mappers.getMapper(AdminConvert.class); + + AdminCreateDTO convert(cn.iocoder.mall.managementweb.controller.admin.dto.AdminCreateDTO bean); + + AdminUpdateDTO convert(AdminUpdateInfoDTO bean); + + AdminUpdateDTO convert(AdminUpdateStatusDTO bean); + + AdminPageDTO convert(cn.iocoder.mall.managementweb.controller.admin.dto.AdminPageDTO bean); + + PageResult convert(PageResult pageResultData); + +} diff --git a/management-web-app/src/main/java/cn/iocoder/mall/managementweb/manager/admin/AdminManager.java b/management-web-app/src/main/java/cn/iocoder/mall/managementweb/manager/admin/AdminManager.java index 29e11baa7..a599620ba 100644 --- a/management-web-app/src/main/java/cn/iocoder/mall/managementweb/manager/admin/AdminManager.java +++ b/management-web-app/src/main/java/cn/iocoder/mall/managementweb/manager/admin/AdminManager.java @@ -1,25 +1,62 @@ package cn.iocoder.mall.managementweb.manager.admin; +import cn.iocoder.common.framework.vo.CommonResult; +import cn.iocoder.common.framework.vo.PageResult; import cn.iocoder.mall.managementweb.controller.admin.dto.AdminCreateDTO; +import cn.iocoder.mall.managementweb.controller.admin.dto.AdminPageDTO; import cn.iocoder.mall.managementweb.controller.admin.dto.AdminUpdateInfoDTO; import cn.iocoder.mall.managementweb.controller.admin.dto.AdminUpdateStatusDTO; +import cn.iocoder.mall.managementweb.controller.admin.vo.AdminPageItemVO; +import cn.iocoder.mall.managementweb.convert.admin.AdminConvert; +import cn.iocoder.mall.systemservice.rpc.admin.AdminRpc; +import cn.iocoder.mall.systemservice.rpc.admin.vo.AdminVO; +import org.apache.dubbo.config.annotation.Reference; import org.springframework.stereotype.Service; @Service public class AdminManager { - //TODO 目前需要增加搜索所有子部门的用户 + @Reference(version = "${dubbo.consumer.AdminRpc.version}", validation = "false") + private AdminRpc adminRpc; + public PageResult pageAdmin(AdminPageDTO pageDTO) { + CommonResult> pageResult = adminRpc.pageAdmin(AdminConvert.INSTANCE.convert(pageDTO)); + pageResult.checkError(); + // 转换结果 + PageResult adminPageVO = AdminConvert.INSTANCE.convert(pageResult.getData()); + // 拼接结果 +// if (!resultPage.getList().isEmpty()) { +// // 查询角色数组 +// Map> roleMap = adminService.getAdminRolesMap(CollectionUtil.convertList(resultPage.getList(), AdminBO::getId)); +// resultPage.getList().forEach(admin -> admin.setRoles(AdminConvert.INSTANCE.convertAdminVORoleList(roleMap.get(admin.getId())))); +// +// // 查询对应部门 +// List deptmentBOS = deptmentService.getAllDeptments(); +// Map deptNameMap = deptmentBOS.stream().collect(Collectors.toMap(d->d.getId(), d->d.getName())); +// //管理员所在部门被删后,变成未分配状态 +// deptNameMap.put(0, "未分配"); +// resultPage.getList().forEach(admin->{ +// admin.setDeptment(new AdminVO.Deptment(admin.getDeptmentId(), deptNameMap.get(admin.getDeptmentId()))); +// }); +// } + return adminPageVO; + } public Integer createAdmin(AdminCreateDTO createDTO, Integer createAdminId, String createIp) { - return null; + CommonResult createAdminResult = adminRpc.createAdmin(AdminConvert.INSTANCE.convert(createDTO) + .setCreateAdminId(createAdminId).setCreateIp(createIp)); + createAdminResult.checkError(); + return createAdminResult.getData(); } public void updateAdmin(AdminUpdateInfoDTO updateInfoDTO) { + CommonResult updateAdminResult = adminRpc.updateAdmin(AdminConvert.INSTANCE.convert(updateInfoDTO)); + updateAdminResult.checkError(); } public void updateAdminStatus(AdminUpdateStatusDTO updateStatusDTO) { - + CommonResult updateAdminResult = adminRpc.updateAdmin(AdminConvert.INSTANCE.convert(updateStatusDTO)); + updateAdminResult.checkError(); } } diff --git a/system-service-project/system-service-api/src/main/java/cn/iocoder/mall/systemservice/rpc/admin/dto/AdminCreateDTO.java b/system-service-project/system-service-api/src/main/java/cn/iocoder/mall/systemservice/rpc/admin/dto/AdminCreateDTO.java index d934a47e1..989928eb2 100644 --- a/system-service-project/system-service-api/src/main/java/cn/iocoder/mall/systemservice/rpc/admin/dto/AdminCreateDTO.java +++ b/system-service-project/system-service-api/src/main/java/cn/iocoder/mall/systemservice/rpc/admin/dto/AdminCreateDTO.java @@ -8,7 +8,6 @@ import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotNull; import javax.validation.constraints.Pattern; import java.io.Serializable; -import java.util.Date; /** * 管理员添加 BO @@ -20,9 +19,9 @@ public class AdminCreateDTO implements Serializable { /** * 昵称 */ - @NotEmpty(message = "昵称不能为空") - @Length(max = 10, message = "昵称长度最大为 10 位") - private String nickname; + @NotEmpty(message = "真实名字不能为空") + @Length(max = 10, message = "真实名字长度最大为 10 位") + private String name; /** * 部门编号 */ @@ -47,11 +46,11 @@ public class AdminCreateDTO implements Serializable { * 创建管理员编号 */ @NotNull(message = "创建管理员编号不能为空") - private String createAdminId; + private Integer createAdminId; /** * 创建 IP */ @NotNull(message = "创建 IP 不能为空") - private Date createIp; + private String createIp; } diff --git a/system-service-project/system-service-api/src/main/java/cn/iocoder/mall/systemservice/rpc/admin/dto/AdminPageDTO.java b/system-service-project/system-service-api/src/main/java/cn/iocoder/mall/systemservice/rpc/admin/dto/AdminPageDTO.java index 9b636b203..17a10297a 100644 --- a/system-service-project/system-service-api/src/main/java/cn/iocoder/mall/systemservice/rpc/admin/dto/AdminPageDTO.java +++ b/system-service-project/system-service-api/src/main/java/cn/iocoder/mall/systemservice/rpc/admin/dto/AdminPageDTO.java @@ -1,22 +1,25 @@ package cn.iocoder.mall.systemservice.rpc.admin.dto; import cn.iocoder.common.framework.vo.PageParam; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; -@ApiModel("管理员分页查询 DTO") +/** + * 管理员分页查询 DTO + */ @Data @EqualsAndHashCode(callSuper = true) @Accessors(chain = true) public class AdminPageDTO extends PageParam { - @ApiModelProperty(value = "真实名字,模糊匹配", example = "小王") + /** + * 真实名字,模糊匹配 + */ private String name; - - @ApiModelProperty(value = "部门编号") + /** + * 部门编号 + */ private Integer departmentId; } diff --git a/system-service-project/system-service-api/src/main/java/cn/iocoder/mall/systemservice/rpc/admin/dto/AdminUpdateDTO.java b/system-service-project/system-service-api/src/main/java/cn/iocoder/mall/systemservice/rpc/admin/dto/AdminUpdateDTO.java index 3c7384627..dfe45cf15 100644 --- a/system-service-project/system-service-api/src/main/java/cn/iocoder/mall/systemservice/rpc/admin/dto/AdminUpdateDTO.java +++ b/system-service-project/system-service-api/src/main/java/cn/iocoder/mall/systemservice/rpc/admin/dto/AdminUpdateDTO.java @@ -2,7 +2,6 @@ package cn.iocoder.mall.systemservice.rpc.admin.dto; import cn.iocoder.common.framework.enums.CommonStatusEnum; import cn.iocoder.common.framework.validator.InEnum; -import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.experimental.Accessors; import org.hibernate.validator.constraints.Length; @@ -24,15 +23,13 @@ public class AdminUpdateDTO implements Serializable { @NotNull(message = "管理员编号不能为空") private Integer id; /** - * 昵称 + * 真实名字 */ - @ApiModelProperty(value = "昵称", required = true, example = "小王") - @Length(max = 10, message = "昵称长度最大为 10 位") - private String nickname; + @Length(max = 10, message = "真实名字长度最大为 10 位") + private String name; /** * 部门编号 */ - @ApiModelProperty(value = "部门编号", required = true, example = "1") private Integer departmentId; /** * 状态 @@ -48,7 +45,6 @@ public class AdminUpdateDTO implements Serializable { /** * 密码 */ - @ApiModelProperty(value = "密码", required = true, example = "buzhidao") @Length(min = 4, max = 16, message = "密码长度为 4-16 位") private String password; diff --git a/system-service-project/system-service-api/src/main/java/cn/iocoder/mall/systemservice/rpc/admin/vo/AdminVO.java b/system-service-project/system-service-api/src/main/java/cn/iocoder/mall/systemservice/rpc/admin/vo/AdminVO.java index c33f45ac2..177faef98 100644 --- a/system-service-project/system-service-api/src/main/java/cn/iocoder/mall/systemservice/rpc/admin/vo/AdminVO.java +++ b/system-service-project/system-service-api/src/main/java/cn/iocoder/mall/systemservice/rpc/admin/vo/AdminVO.java @@ -5,6 +5,7 @@ import lombok.Data; import lombok.experimental.Accessors; import java.io.Serializable; +import java.util.Date; /** * 管理员 DO @@ -37,4 +38,9 @@ public class AdminVO implements Serializable { */ private String username; + /** + * 创建时间 + */ + private Date createTime; + } diff --git a/system-service-project/system-service-app/src/main/java/cn/iocoder/mall/systemservice/dal/mysql/dataobject/admin/AdminDO.java b/system-service-project/system-service-app/src/main/java/cn/iocoder/mall/systemservice/dal/mysql/dataobject/admin/AdminDO.java index b56f31a9c..294988355 100644 --- a/system-service-project/system-service-app/src/main/java/cn/iocoder/mall/systemservice/dal/mysql/dataobject/admin/AdminDO.java +++ b/system-service-project/system-service-app/src/main/java/cn/iocoder/mall/systemservice/dal/mysql/dataobject/admin/AdminDO.java @@ -7,8 +7,6 @@ import lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; -import java.util.Date; - /** * 管理员实体 * @@ -56,11 +54,13 @@ public class AdminDO extends BaseDO { /** * 创建管理员编号 + * + * 外键 {@link AdminDO#id} */ - private String createAdminId; + private Integer createAdminId; /** * 创建 IP */ - private Date createIp; + private String createIp; } diff --git a/system-service-project/system-service-app/src/main/java/cn/iocoder/mall/systemservice/service/admin/bo/AdminBO.java b/system-service-project/system-service-app/src/main/java/cn/iocoder/mall/systemservice/service/admin/bo/AdminBO.java index 34e798b63..17493103d 100644 --- a/system-service-project/system-service-app/src/main/java/cn/iocoder/mall/systemservice/service/admin/bo/AdminBO.java +++ b/system-service-project/system-service-app/src/main/java/cn/iocoder/mall/systemservice/service/admin/bo/AdminBO.java @@ -5,6 +5,8 @@ import cn.iocoder.mall.systemservice.enums.admin.AdminStatusEnum; import lombok.Data; import lombok.experimental.Accessors; +import java.util.Date; + /** * 管理员信息 BO */ @@ -38,4 +40,9 @@ public class AdminBO { */ private String username; + /** + * 创建时间 + */ + private Date createTime; + } diff --git a/system-service-project/system-service-app/src/main/java/cn/iocoder/mall/systemservice/service/admin/bo/AdminCreateBO.java b/system-service-project/system-service-app/src/main/java/cn/iocoder/mall/systemservice/service/admin/bo/AdminCreateBO.java index 6bd7ffbb3..9a656ce96 100644 --- a/system-service-project/system-service-app/src/main/java/cn/iocoder/mall/systemservice/service/admin/bo/AdminCreateBO.java +++ b/system-service-project/system-service-app/src/main/java/cn/iocoder/mall/systemservice/service/admin/bo/AdminCreateBO.java @@ -7,7 +7,6 @@ import org.hibernate.validator.constraints.Length; import javax.validation.constraints.NotEmpty; import javax.validation.constraints.NotNull; import javax.validation.constraints.Pattern; -import java.util.Date; /** * 管理员添加 BO @@ -19,9 +18,9 @@ public class AdminCreateBO { /** * 昵称 */ - @NotEmpty(message = "昵称不能为空") - @Length(max = 10, message = "昵称长度最大为 10 位") - private String nickname; + @NotEmpty(message = "真实名字不能为空") + @Length(max = 10, message = "真实名字长度最大为 10 位") + private String name; /** * 部门编号 */ @@ -46,11 +45,11 @@ public class AdminCreateBO { * 创建管理员编号 */ @NotNull(message = "创建管理员编号不能为空") - private String createAdminId; + private Integer createAdminId; /** * 创建 IP */ @NotNull(message = "创建 IP 不能为空") - private Date createIp; + private String createIp; } diff --git a/system-service-project/system-service-app/src/main/java/cn/iocoder/mall/systemservice/service/admin/bo/AdminUpdateBO.java b/system-service-project/system-service-app/src/main/java/cn/iocoder/mall/systemservice/service/admin/bo/AdminUpdateBO.java index 73358a867..ff4c373e4 100644 --- a/system-service-project/system-service-app/src/main/java/cn/iocoder/mall/systemservice/service/admin/bo/AdminUpdateBO.java +++ b/system-service-project/system-service-app/src/main/java/cn/iocoder/mall/systemservice/service/admin/bo/AdminUpdateBO.java @@ -24,8 +24,8 @@ public class AdminUpdateBO { /** * 昵称 */ - @Length(max = 10, message = "昵称长度最大为 10 位") - private String nickname; + @Length(max = 10, message = "真实名字长度最大为 10 位") + private String name; /** * 部门编号 */