Commit ed8ddaa1 authored by zhangyi's avatar zhangyi

入参非空校验

parent a6eb5b4c
......@@ -7,6 +7,8 @@ import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
/**
* @ClassName EnterpriseController
......@@ -24,7 +26,7 @@ public class EnterpriseController {
private EnterpriseService enterpriseService;
@PostMapping("/infoHeader")
public R infoHeader(@RequestBody EnterpriseBody body) throws Exception
public R infoHeader(@RequestBody @Valid EnterpriseBody body) throws Exception
{
return enterpriseService.infoHeader(body);
}
......
......@@ -8,13 +8,13 @@ public class EnterpriseBody
* 企业id
*/
@NotNull(message = "企业id不能为空")
private String companyId;
private Integer companyId;
public String getCompanyId() {
public Integer getCompanyId() {
return companyId;
}
public void setCompanyId(String companyId) {
public void setCompanyId(Integer companyId) {
this.companyId = companyId;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment