mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-12 21:02:08 +08:00
角色管理、板材管理接口入参检查完善
This commit is contained in:
+8
-2
@@ -1,13 +1,12 @@
|
||||
package com.cf.imes.module.manage.controller.admin.plate.vo.plate;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import lombok.*;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.cf.imes.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static com.cf.imes.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
@@ -19,15 +18,19 @@ import static com.cf.imes.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH
|
||||
public class PlatePageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "客户的商品编号", example = "1")
|
||||
@Size(max = 32, message = "商品编号长度不能超过32个字符")
|
||||
private String goodsId;
|
||||
|
||||
@Schema(description = "商品名称", example = "赵六")
|
||||
@Size(max = 64, message = "商品名称长度不能超过64个字符")
|
||||
private String goodsName;
|
||||
|
||||
@Schema(description = "材质:颗粒板、欧松板、多层板、生态板、禾香板、密度板、实木、铝蜂窝板、铝塑板")
|
||||
@Size(max = 64, message = "材质长度不能超过64个字符")
|
||||
private String material;
|
||||
|
||||
@Schema(description = "颜色")
|
||||
@Size(max = 32, message = "颜色长度不能超过32个字符")
|
||||
private String color;
|
||||
|
||||
@Schema(description = "纹理")
|
||||
@@ -46,12 +49,15 @@ public class PlatePageReqVO extends PageParam {
|
||||
// private Double price;
|
||||
|
||||
@Schema(description = "品牌")
|
||||
@Size(max = 64, message = "品牌长度不能超过64个字符")
|
||||
private String brand;
|
||||
|
||||
@Schema(description = "规格")
|
||||
@Size(max = 64, message = "规格长度不能超过64个字符")
|
||||
private String spec;
|
||||
|
||||
@Schema(description = "备注", example = "随便")
|
||||
@Size(max = 255, message = "备注长度不能超过255个字符")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
|
||||
+8
-1
@@ -1,10 +1,10 @@
|
||||
package com.cf.imes.module.manage.controller.admin.plate.vo.plate;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
@Schema(description = "管理后台 - 板材信息表 plate_{N}新增/修改 Request VO")
|
||||
@Data
|
||||
@@ -15,18 +15,22 @@ public class PlateSaveReqVO {
|
||||
|
||||
@Schema(description = "客户的商品编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotEmpty(message = "客户的商品编号不能为空")
|
||||
@Size(max = 32, message = "商品编号长度不能超过32个字符")
|
||||
private String goodsId;
|
||||
|
||||
@Schema(description = "商品名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六")
|
||||
@NotEmpty(message = "商品名称不能为空")
|
||||
@Size(max = 64, message = "商品名称长度不能超过64个字符")
|
||||
private String goodsName;
|
||||
|
||||
@Schema(description = "材质:颗粒板、欧松板、多层板、生态板、禾香板、密度板、实木、铝蜂窝板、铝塑板", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "材质:颗粒板、欧松板、多层板、生态板、禾香板、密度板、实木、铝蜂窝板、铝塑板不能为空")
|
||||
@Size(max = 64, message = "材质长度不能超过64个字符")
|
||||
private String material;
|
||||
|
||||
@Schema(description = "颜色", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "颜色不能为空")
|
||||
@Size(max = 32, message = "颜色长度不能超过32个字符")
|
||||
private String color;
|
||||
|
||||
@Schema(description = "纹理", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@@ -48,12 +52,15 @@ public class PlateSaveReqVO {
|
||||
// private Double price;
|
||||
|
||||
@Schema(description = "品牌")
|
||||
@Size(max = 64, message = "品牌长度不能超过64个字符")
|
||||
private String brand;
|
||||
|
||||
@Schema(description = "规格")
|
||||
@Size(max = 64, message = "规格长度不能超过64个字符")
|
||||
private String spec;
|
||||
|
||||
@Schema(description = "备注", example = "随便")
|
||||
@Size(max = 255, message = "备注长度不能超过255个字符")
|
||||
private String remark;
|
||||
|
||||
private Long organId;
|
||||
|
||||
+1
-1
@@ -39,7 +39,7 @@ public class OrganSaveReqVO {
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "绑定域名", example = "https://www.cf.com")
|
||||
@Size(max = 256, message = "绑定域名长度不能超过256个字符")
|
||||
@Size(max = 255, message = "绑定域名长度不能超过255个字符")
|
||||
private String website;
|
||||
|
||||
@Schema(description = "组织套餐编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@ public class TenantPackagePageReqVO extends PageParam {
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "备注", example = "好")
|
||||
@Size(max = 256, message = "备注长度不能超过256个字符")
|
||||
@Size(max = 255, message = "备注长度不能超过255个字符")
|
||||
private String remark;
|
||||
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@ public class TenantPackageSaveReqVO {
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "备注", example = "好")
|
||||
@Size(max = 256, message = "备注长度不能超过256个字符")
|
||||
@Size(max = 255, message = "备注长度不能超过255个字符")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "关联的菜单编号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
|
||||
+1
-1
@@ -47,7 +47,7 @@ public class PermissionController {
|
||||
@GetMapping("/list-role-menus")
|
||||
// @PreAuthorize("@ss.hasPermission('system:permission:assign-role-menu')")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('system:permission:assign-role-menu','base:permission:assign-role-menu')")
|
||||
public CommonResult<Set<Long>> getRoleMenuList(Long roleId) {
|
||||
public CommonResult<Set<Long>> getRoleMenuList(@RequestParam("roleId") Long roleId) {
|
||||
return success(permissionService.getRoleMenuListByRoleId(roleId));
|
||||
}
|
||||
|
||||
|
||||
+7
-1
@@ -1,5 +1,6 @@
|
||||
package com.cf.imes.module.system.controller.admin.permission;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.cf.imes.framework.common.enums.CommonStatusEnum;
|
||||
import com.cf.imes.framework.common.exception.ServiceException;
|
||||
import com.cf.imes.framework.common.pojo.CommonResult;
|
||||
@@ -33,8 +34,10 @@ import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import static com.cf.imes.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static com.cf.imes.framework.common.pojo.CommonResult.success;
|
||||
import static com.cf.imes.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
|
||||
import static com.cf.imes.module.system.enums.ErrorCodeConstants.ROLE_NOT_EXISTS;
|
||||
import static java.util.Collections.singleton;
|
||||
|
||||
@Tag(name = "管理后台 - 角色")
|
||||
@@ -99,6 +102,9 @@ public class RoleController {
|
||||
@PreAuthorize("@ss.hasAnyPermissions('system:role:query','base:role:query')")
|
||||
public CommonResult<RoleRespVO> getRole(@RequestParam("id") Long id) {
|
||||
RoleDO role = roleService.getRole(id);
|
||||
if (ObjectUtil.isNull(role)) {
|
||||
throw exception(ROLE_NOT_EXISTS);
|
||||
}
|
||||
return success(BeanUtils.toBean(role, RoleRespVO.class));
|
||||
}
|
||||
|
||||
@@ -106,7 +112,7 @@ public class RoleController {
|
||||
@Operation(summary = "获得角色分页")
|
||||
// @PreAuthorize("@ss.hasPermission('system:role:query')")
|
||||
@PreAuthorize("@ss.hasAnyPermissions('system:role:query','base:role:query')")
|
||||
public CommonResult<PageResult<RoleRespVO>> getRolePage(RolePageReqVO pageReqVO) {
|
||||
public CommonResult<PageResult<RoleRespVO>> getRolePage(@Valid RolePageReqVO pageReqVO) {
|
||||
PageResult<RoleDO> pageResult = roleService.getRolePage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, RoleRespVO.class));
|
||||
}
|
||||
|
||||
+3
@@ -4,6 +4,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.util.Collections;
|
||||
import java.util.Set;
|
||||
|
||||
@@ -16,6 +17,8 @@ public class PermissionAssignRoleMenuReqVO {
|
||||
private Long roleId;
|
||||
|
||||
@Schema(description = "菜单编号列表", example = "1,3,5")
|
||||
// todo 目前可用菜单数量大概在两百出头,暂时设置为300,后期扩展可以调整
|
||||
@Size(max = 300, message = "关联的菜单编号数量不能超过300")
|
||||
private Set<Long> menuIds = Collections.emptySet(); // 兜底
|
||||
|
||||
@Schema(description = "组织id")
|
||||
|
||||
+2
@@ -4,6 +4,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.util.Collections;
|
||||
import java.util.Set;
|
||||
|
||||
@@ -16,6 +17,7 @@ public class PermissionAssignRoleUserReqVO {
|
||||
private Long roleId;
|
||||
|
||||
@Schema(description = "用户编号列表", example = "1,3,5")
|
||||
@Size(max = 300, message = "关联的用户编号数量不能超过300")
|
||||
private Set<Long> userIds = Collections.emptySet();
|
||||
|
||||
@Schema(description = "组织id")
|
||||
|
||||
+5
@@ -1,11 +1,13 @@
|
||||
package com.cf.imes.module.system.controller.admin.permission.vo.role;
|
||||
|
||||
import com.cf.imes.framework.common.pojo.PageParam;
|
||||
import com.cf.imes.module.system.validation.system.common.CommonStatus;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import javax.validation.constraints.Size;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static com.cf.imes.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
@@ -16,12 +18,15 @@ import static com.cf.imes.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH
|
||||
public class RolePageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "角色名称,模糊匹配", example = "晨丰")
|
||||
@Size(max = 30, message = "角色名称长度不能超过30个字符")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "角色标识,模糊匹配", example = "chenfeng")
|
||||
@Size(max = 100, message = "角色标识长度不能超过100个字符")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "展示状态,参见 CommonStatusEnum 枚举类", example = "1")
|
||||
@CommonStatus
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "创建时间", example = "[2022-07-01 00:00:00,2022-07-01 23:59:59]")
|
||||
|
||||
+3
@@ -1,5 +1,6 @@
|
||||
package com.cf.imes.module.system.controller.admin.permission.vo.role;
|
||||
|
||||
import com.cf.imes.module.system.validation.system.common.CommonStatus;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@@ -29,9 +30,11 @@ public class RoleSaveReqVO {
|
||||
private Integer sort;
|
||||
|
||||
@Schema(description = "备注", example = "我是一个角色")
|
||||
@Size(max = 255, message = "备注长度不能超过255个字符")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "状态 0开启1关闭" )
|
||||
@CommonStatus
|
||||
private Integer status;
|
||||
|
||||
private Long organId;
|
||||
|
||||
+2
-3
@@ -1,7 +1,6 @@
|
||||
package com.cf.imes.module.system.controller.admin.permission.vo.role;
|
||||
|
||||
import com.cf.imes.framework.common.enums.CommonStatusEnum;
|
||||
import com.cf.imes.framework.common.validation.InEnum;
|
||||
import com.cf.imes.module.system.validation.system.common.CommonStatus;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@@ -17,7 +16,7 @@ public class RoleUpdateStatusReqVO {
|
||||
|
||||
@Schema(description = "状态,见 CommonStatusEnum 枚举", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotNull(message = "状态不能为空")
|
||||
@InEnum(value = CommonStatusEnum.class, message = "修改状态必须是 {value}")
|
||||
@CommonStatus
|
||||
private Integer status;
|
||||
|
||||
}
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ public class UserSaveReqVO {
|
||||
private String nickname;
|
||||
|
||||
@Schema(description = "备注", example = "我是一个用户")
|
||||
@Size(max = 256, message = "备注长度不能超过256个字符")
|
||||
@Size(max = 255, message = "备注长度不能超过255个字符")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "部门ID", example = "我是一个用户")
|
||||
|
||||
Reference in New Issue
Block a user