Browse Source

修改查询销售信息接口为GET请求

Long 2 months ago
parent
commit
c9e800c274

+ 1 - 1
fs-company-app/src/main/java/com/fs/app/controller/CompanyUserController.java

@@ -105,7 +105,7 @@ public class CompanyUserController extends AppBaseController {
 
     @Login
     @ApiOperation("获取销售信息")
-    @PostMapping("/getCompanyUserInfo")
+    @GetMapping("/getCompanyUserInfo")
     public R getCompanyUserInfo(@ApiParam(name = "companyUserId", value = "销售用户ID", required = true)
                                 @RequestParam Long companyUserId) {
         return R.ok().put("data", companyUserService.selectCompanyUserById(companyUserId));

+ 6 - 0
fs-company-app/src/main/java/com/fs/app/exception/FSExceptionHandler.java

@@ -12,6 +12,7 @@ import org.springframework.validation.BindException;
 import org.springframework.validation.FieldError;
 import org.springframework.validation.ObjectError;
 import org.springframework.web.bind.MethodArgumentNotValidException;
+import org.springframework.web.bind.MissingServletRequestParameterException;
 import org.springframework.web.bind.annotation.ExceptionHandler;
 import org.springframework.web.bind.annotation.RestControllerAdvice;
 import org.springframework.web.servlet.NoHandlerFoundException;
@@ -50,6 +51,11 @@ public class FSExceptionHandler {
 		return R.error("数据库中已存在该记录");
 	}
 
+	@ExceptionHandler(MissingServletRequestParameterException.class)
+	public R handleMissingServletRequestParameterException(MissingServletRequestParameterException e) {
+		logger.error(e.getMessage(), e);
+		return R.error("缺少必要的参数");
+	}
 
 	@ExceptionHandler(Exception.class)
 	public R handleException(Exception e){