zoujiajian 2 ani în urmă
părinte
comite
21a7678c5c

+ 5 - 0
netflix-dao/src/main/java/com/cyksj/model/entity/CorpFollowActiveCode.java

@@ -7,6 +7,8 @@ import com.ejlchina.searcher.bean.DbIgnore;
 import lombok.Getter;
 import lombok.Setter;
 
+import javax.validation.constraints.NotEmpty;
+import javax.validation.constraints.NotNull;
 import java.util.List;
 
 /**
@@ -19,10 +21,12 @@ import java.util.List;
 @Setter
 public class CorpFollowActiveCode extends BaseEntity{
 
+	@NotEmpty(message = "活码名不为空")
 	private String name;
 
 	@TableField(exist = false)
 	@DbIgnore
+	@NotNull(message = "请选择对应客服")
 	private List<String> followIds;
 
 	/**
@@ -55,6 +59,7 @@ public class CorpFollowActiveCode extends BaseEntity{
 	/**
 	 * 客户标签
 	 */
+	@NotEmpty(message = "标签不为空")
 	private String markTag;
 
 	/**

+ 3 - 2
netflix-web/src/main/java/com/cyksj/web/controller/manage/corp/CmsCorpFollowActiveCodeController.java

@@ -27,6 +27,7 @@ import com.ejlchina.searcher.util.MapBuilder;
 import com.ejlchina.searcher.util.MapUtils;
 import lombok.RequiredArgsConstructor;
 import org.apache.commons.lang3.StringUtils;
+import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletRequest;
@@ -83,7 +84,7 @@ public class CmsCorpFollowActiveCodeController {
 	 * 创建活动活码
 	 */
 	@PostMapping("/post/active/code")
-	public Result<String> postActiveCode(@RequestBody CorpFollowActiveCode activeCode) throws Exception {
+	public Result<String> postActiveCode(@RequestBody @Validated CorpFollowActiveCode activeCode) throws Exception {
 		long adminId = StpUtil.getLoginIdAsLong();
 		corpFollowService.postActiveCode(adminId, activeCode);
 		return GatewayResponse.SUCCESS.newBuilder().toResult();
@@ -93,7 +94,7 @@ public class CmsCorpFollowActiveCodeController {
 	 * 编辑活动活码
 	 */
 	@PutMapping("/update/active/code")
-	public Result<String> upActiveCode(@RequestBody CorpFollowActiveCode activeCode) throws Exception {
+	public Result<String> upActiveCode(@RequestBody @Validated CorpFollowActiveCode activeCode) throws Exception {
 		corpFollowService.upActiveCode(activeCode);
 		return GatewayResponse.SUCCESS.newBuilder().toResult();
 	}