消息服务,增加异常提示信息

This commit is contained in:
ajaxfan
2021-03-02 11:06:36 +08:00
parent 66cab26c33
commit b65f319aba
6 changed files with 38 additions and 23 deletions

View File

@ -1,6 +1,6 @@
package com.chinaunicom.mall.ebtp.extend.bizmessage.dto;
import org.springframework.lang.NonNull;
import javax.validation.constraints.NotEmpty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@ -11,10 +11,12 @@ import lombok.Data;
public class BizMessageCategoryAddDTO {
@ApiModelProperty(required = true, value = "类别编码")
private @NonNull String code;
@NotEmpty(message = "类别编码不能为空")
private String code;
@ApiModelProperty(required = true, value = "类别名称")
private @NonNull String name;
@NotEmpty(message = "类别名称不能为空")
private String name;
@ApiModelProperty("描述")
private String remark;

View File

@ -1,6 +1,6 @@
package com.chinaunicom.mall.ebtp.extend.bizmessage.dto;
import org.springframework.lang.NonNull;
import javax.validation.constraints.NotEmpty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@ -11,13 +11,16 @@ import lombok.Data;
public class BizMessageCategoryUpdateDTO {
@ApiModelProperty(required = true, value = "类别id")
private @NonNull String id;
@NotEmpty(message = "类别id不能为空")
private String id;
@ApiModelProperty(required = true, value = "类别编码")
private @NonNull String code;
@NotEmpty(message = "类别编码不能为空")
private String code;
@ApiModelProperty(required = true, value = "类别名称")
private @NonNull String name;
@NotEmpty(message = "类别名称不能为空")
private String name;
@ApiModelProperty("描述")
private String remark;

View File

@ -3,8 +3,8 @@ package com.chinaunicom.mall.ebtp.extend.bizmessage.dto;
import java.util.List;
import java.util.Map;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@ -20,21 +20,26 @@ import lombok.Data;
public class BizMessageRawDTO {
@ApiModelProperty(required = true, value = "消息标题")
private @Nonnull String title;
@NotEmpty(message = "消息标题不能为空")
private String title;
@ApiModelProperty(required = true, value = "消息类别")
private @Nonnull String category;
@NotEmpty(message = "消息类别不能为空")
private String category;
@ApiModelProperty(required = true, value = "消息模板编码")
private @Nonnull String templateCode;
@NotEmpty(message = "消息模板编码不能为空")
private String templateCode;
@ApiModelProperty(required = true, value = "消息内容对象")
private @Nonnull Map<String, Object> body;
@NotNull(message = "消息内容对象不能为空")
private Map<String, Object> body;
@ApiModelProperty(required = true, value = "消息附加参数")
private @Nonnull Map<String, Object> extra;
@NotNull(message = "消息附加参数不能为空")
private Map<String, Object> extra;
@ApiModelProperty(required = true, value = "授权用户列表")
private @Nullable List<String> users;
private List<String> users;
}

View File

@ -1,6 +1,6 @@
package com.chinaunicom.mall.ebtp.extend.bizmessage.dto;
import org.springframework.lang.NonNull;
import javax.validation.constraints.NotEmpty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@ -11,10 +11,12 @@ import lombok.Data;
public class BizMessageTemplateAddDTO {
@ApiModelProperty(required = true, value = "模板编码")
private @NonNull String code;
@NotEmpty(message = "模板编码不能为空")
private String code;
@ApiModelProperty(required = true, value = "模板内容")
private @NonNull String body;
@NotEmpty(message = "模板内容不能为空")
private String body;
@ApiModelProperty("路由")
private String router;

View File

@ -1,6 +1,6 @@
package com.chinaunicom.mall.ebtp.extend.bizmessage.dto;
import org.springframework.lang.NonNull;
import javax.validation.constraints.NotEmpty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@ -11,13 +11,16 @@ import lombok.Data;
public class BizMessageTemplateUpdateDTO {
@ApiModelProperty(required = true, value = "模板id")
private @NonNull String id;
@NotEmpty(message = "模板id不能为空")
private String id;
@ApiModelProperty(required = true, value = "模板编码")
private @NonNull String code;
@NotEmpty(message = "模板编码不能为空")
private String code;
@ApiModelProperty(required = true, value = "模板内容")
private @NonNull String body;
@NotEmpty(message = "模板内容不能为空")
private String body;
@ApiModelProperty("路由")
private String router;

View File

@ -33,7 +33,7 @@ public class BizMessageTemplateServiceImpl implements BizMessageTemplateService
@Override
public boolean update(BizMessageTemplate tempalte) {
return mapper.updateById(tempalte.setUpdatetime(new Timestamp(System.nanoTime()))) > 0;
return mapper.updateById(tempalte.setUpdatetime(new Timestamp(System.currentTimeMillis()))) > 0;
}
@Override