mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-12 21:02:08 +08:00
Merge branch 'main' of ssh://192.168.1.205:9922/cf_devdept2/cf_imes_server
This commit is contained in:
@@ -204,6 +204,10 @@
|
||||
<groupId>com.cf.imes</groupId>
|
||||
<artifactId>cf-module-infra-api</artifactId>
|
||||
</include>
|
||||
<include>
|
||||
<groupId>com.cf.imes</groupId>
|
||||
<artifactId>cf-module-prod-executor-api</artifactId>
|
||||
</include>
|
||||
<include>
|
||||
<groupId>com.cf.imes</groupId>
|
||||
<artifactId>cf-module-prod-manage-api</artifactId>
|
||||
|
||||
+5
@@ -1,10 +1,12 @@
|
||||
package com.cf.imes.module.system.controller.admin.logger.vo.operatelog;
|
||||
|
||||
import com.cf.imes.framework.common.pojo.PageParam;
|
||||
import com.cf.imes.module.system.validation.operatelog.OperateLogTypeValid;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
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;
|
||||
@@ -14,12 +16,15 @@ import static com.cf.imes.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH
|
||||
public class OperateLogPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "操作模块,模拟匹配", example = "订单")
|
||||
@Size(max = 50, message = "操作模块长度不能超过50个字符")
|
||||
private String module;
|
||||
|
||||
@Schema(description = "用户昵称,模拟匹配", example = "晨丰")
|
||||
@Size(max = 30, message = "用户昵称长度不能超过30个字符")
|
||||
private String userNickname;
|
||||
|
||||
@Schema(description = "操作分类,参见 OperateLogTypeEnum 枚举类", example = "1")
|
||||
@OperateLogTypeValid
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "操作状态", example = "true")
|
||||
|
||||
+4
@@ -1,12 +1,14 @@
|
||||
package com.cf.imes.module.system.controller.admin.notify.vo.message;
|
||||
|
||||
import com.cf.imes.framework.common.pojo.PageParam;
|
||||
import com.cf.imes.module.system.validation.notify.NotifyTemplateTypeValid;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
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;
|
||||
@@ -21,9 +23,11 @@ public class NotifyMessagePageReqVO extends PageParam {
|
||||
private Long userId;
|
||||
|
||||
@Schema(description = "模板编码", example = "test_01")
|
||||
@Size(max = 64, message = "模版编码长度不能超过64个字符")
|
||||
private String templateCode;
|
||||
|
||||
@Schema(description = "模版类型", example = "2")
|
||||
@NotifyTemplateTypeValid
|
||||
private Integer templateType;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
|
||||
+5
@@ -1,12 +1,14 @@
|
||||
package com.cf.imes.module.system.controller.admin.notify.vo.template;
|
||||
|
||||
import com.cf.imes.framework.common.pojo.PageParam;
|
||||
import com.cf.imes.module.system.validation.common.CommonStatus;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
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;
|
||||
@@ -18,12 +20,15 @@ import static com.cf.imes.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH
|
||||
public class NotifyTemplatePageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "模版编码", example = "test_01")
|
||||
@Size(max = 64, message = "模版编码长度不能超过64个字符")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "模版名称", example = "我是名称")
|
||||
@Size(max = 64, message = "模版名称长度不能超过64个字符")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "状态,参见 CommonStatusEnum 枚举类", example = "1")
|
||||
@CommonStatus
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
|
||||
+5
-3
@@ -1,7 +1,7 @@
|
||||
package com.cf.imes.module.system.controller.admin.notify.vo.template;
|
||||
|
||||
import com.cf.imes.framework.common.enums.CommonStatusEnum;
|
||||
import com.cf.imes.framework.common.validation.InEnum;
|
||||
import com.cf.imes.module.system.validation.common.CommonStatus;
|
||||
import com.cf.imes.module.system.validation.notify.NotifyTemplateTypeValid;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
@@ -28,6 +28,7 @@ public class NotifyTemplateSaveReqVO {
|
||||
|
||||
@Schema(description = "模版类型,对应 system_notify_template_type 字典", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotNull(message = "模版类型不能为空")
|
||||
@NotifyTemplateTypeValid
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "发送人名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "土豆")
|
||||
@@ -42,10 +43,11 @@ public class NotifyTemplateSaveReqVO {
|
||||
|
||||
@Schema(description = "状态,参见 CommonStatusEnum 枚举", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotNull(message = "状态不能为空")
|
||||
@InEnum(value = CommonStatusEnum.class, message = "状态必须是 {value}")
|
||||
@CommonStatus
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "备注", example = "我是备注")
|
||||
@Length(max = 255, message = "备注长度不能超过255个字符")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
|
||||
+3
@@ -4,6 +4,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.util.Map;
|
||||
|
||||
@Schema(description = "管理后台 - 站内信模板的发送 Request VO")
|
||||
@@ -16,9 +17,11 @@ public class NotifyTemplateSendReqVO {
|
||||
|
||||
@Schema(description = "模板编码", requiredMode = Schema.RequiredMode.REQUIRED, example = "01")
|
||||
@NotEmpty(message = "模板编码不能为空")
|
||||
@Size(max = 64, message = "模板编码长度不能超过64个字符")
|
||||
private String templateCode;
|
||||
|
||||
@Schema(description = "模板参数")
|
||||
@Size(max = 10, message = "模板参数数量不能超过10个")
|
||||
private Map<String, Object> templateParams;
|
||||
|
||||
}
|
||||
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
package com.cf.imes.module.system.validation.notify;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.cf.imes.module.system.enums.notify.NotifyTemplateTypeEnum;
|
||||
|
||||
import javax.validation.ConstraintValidator;
|
||||
import javax.validation.ConstraintValidatorContext;
|
||||
|
||||
/**
|
||||
* 通知模板类型校验器
|
||||
*
|
||||
* @author Gqr
|
||||
* @since 2024/10/15 13:47
|
||||
*/
|
||||
public class NofityTemplateTypeValidator implements ConstraintValidator<NotifyTemplateTypeValid, Integer> {
|
||||
@Override
|
||||
public boolean isValid(Integer value, ConstraintValidatorContext context) {
|
||||
if (ObjectUtil.isNull(value)) {
|
||||
return true;
|
||||
}
|
||||
for (NotifyTemplateTypeEnum typeEnum : NotifyTemplateTypeEnum.values()) {
|
||||
if (ObjectUtil.equal(typeEnum.getType(), value)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
package com.cf.imes.module.system.validation.notify;
|
||||
|
||||
import javax.validation.Constraint;
|
||||
import javax.validation.Payload;
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* 通知模板类型校验注解
|
||||
* @author Gqr
|
||||
* @since 2024/10/15 14:57
|
||||
*/
|
||||
@Target({
|
||||
ElementType.FIELD,
|
||||
})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
@Constraint(
|
||||
validatedBy = {NofityTemplateTypeValidator.class}
|
||||
)
|
||||
public @interface NotifyTemplateTypeValid {
|
||||
String message() default "通知模板类型不合法";
|
||||
|
||||
Class<?>[] groups() default {};
|
||||
|
||||
Class<? extends Payload>[] payload() default {};
|
||||
}
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
package com.cf.imes.module.system.validation.operatelog;
|
||||
|
||||
import javax.validation.Constraint;
|
||||
import javax.validation.Payload;
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* 操作日志类型校验注解
|
||||
*
|
||||
* @author Gqr
|
||||
* @since 2024/10/15 15:47
|
||||
*/
|
||||
@Target({
|
||||
ElementType.FIELD,
|
||||
})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
@Constraint(
|
||||
validatedBy = {OperateLogTypeValidator.class}
|
||||
)
|
||||
public @interface OperateLogTypeValid {
|
||||
String message() default "操作日志类型不合法";
|
||||
|
||||
Class<?>[] groups() default {};
|
||||
|
||||
Class<? extends Payload>[] payload() default {};
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
package com.cf.imes.module.system.validation.operatelog;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.cf.imes.framework.operatelog.core.enums.OperateTypeEnum;
|
||||
|
||||
import javax.validation.ConstraintValidator;
|
||||
import javax.validation.ConstraintValidatorContext;
|
||||
|
||||
/**
|
||||
* 操作日志类型校验器
|
||||
*
|
||||
* @author Gqr
|
||||
* @since 2024/10/15 15:49
|
||||
*/
|
||||
public class OperateLogTypeValidator implements ConstraintValidator<OperateLogTypeValid, Integer> {
|
||||
@Override
|
||||
public boolean isValid(Integer value, ConstraintValidatorContext context) {
|
||||
if (ObjectUtil.isNull(value)) {
|
||||
return true;
|
||||
}
|
||||
for (OperateTypeEnum typeEnum : OperateTypeEnum.values()) {
|
||||
if (ObjectUtil.equal(typeEnum.getType(), value)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user