留言反馈增加条件限制

master
382696293@qq.com 2 years ago
parent 405a1fd347
commit 082ca6ff3a

@ -4,7 +4,9 @@ import com.flossom.common.core.annotation.Excel;
import com.flossom.common.core.web.domain.BaseEntity; import com.flossom.common.core.web.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle; import org.apache.commons.lang3.builder.ToStringStyle;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import java.util.Date; import java.util.Date;
/** /**
@ -45,6 +47,8 @@ public class CtLeaveMessage extends BaseEntity
/** 用户留言 */ /** 用户留言 */
@Excel(name = "用户留言") @Excel(name = "用户留言")
@NotBlank(message = "留言反馈不能为空")
@Length(min = 1, max = 100)
private String messageInfo; private String messageInfo;
/** 查询开始时间 */ /** 查询开始时间 */
private Date beginTime; private Date beginTime;

@ -8,6 +8,7 @@ import com.flossom.common.log.enums.BusinessType;
import com.flossom.common.security.annotation.RequiresPermissions; import com.flossom.common.security.annotation.RequiresPermissions;
import com.flossom.miniProgram.service.ICtleaveMeassageService; import com.flossom.miniProgram.service.ICtleaveMeassageService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
@ -26,7 +27,7 @@ public class CtleaveMessageApiController extends BaseController {
*/ */
@Log(title = "共创管理-留言管理", businessType = BusinessType.INSERT) @Log(title = "共创管理-留言管理", businessType = BusinessType.INSERT)
@PostMapping("/saveMessage") @PostMapping("/saveMessage")
public AjaxResult add(@RequestBody CtLeaveMessage ctLeaveMessage) public AjaxResult add(@RequestBody @Validated CtLeaveMessage ctLeaveMessage)
{ {
return toAjax(ctleaveMeassageService.saveCtleaveMeassage(ctLeaveMessage)); return toAjax(ctleaveMeassageService.saveCtleaveMeassage(ctLeaveMessage));
} }

Loading…
Cancel
Save