mirror of
https://gitee.com/durcframework/SOP.git
synced 2025-08-11 21:57:56 +08:00
优化ApiArgumentResolver
This commit is contained in:
@@ -29,10 +29,10 @@ public class AlipayController {
|
||||
return story;
|
||||
}
|
||||
|
||||
@ApiOperation(value="获取故事信息", notes = "说明接口的详细信息,介绍,用途,注意事项等。")
|
||||
@ApiOperation(value = "获取故事信息", notes = "说明接口的详细信息,介绍,用途,注意事项等。")
|
||||
@ApiMapping(value = "alipay.story.find")
|
||||
// 参数必须封装在类中
|
||||
public StoryVO getStory2(StoryParam story /* 业务参数必须放在第一位对应biz_content */, HttpServletRequest request) {
|
||||
public StoryVO getStory2(StoryParam story, HttpServletRequest request) {
|
||||
StoryVO storyVO = new StoryVO();
|
||||
storyVO.id = 1L;
|
||||
storyVO.name = "白雪公主";
|
||||
|
@@ -14,7 +14,7 @@ import javax.servlet.http.HttpServletRequest;
|
||||
public class JSR303DemoController {
|
||||
|
||||
@ApiMapping(value = "goods.add")
|
||||
public Object addGoods(GoodsParam param/* 业务参数必须放在第一位对应biz_content */, HttpServletRequest request) {
|
||||
public Object addGoods(GoodsParam param, HttpServletRequest request) {
|
||||
System.out.println(request.getParameter("method"));
|
||||
return param;
|
||||
}
|
||||
|
@@ -3,14 +3,14 @@ package com.gitee.sop.storyweb.controller.param;
|
||||
import lombok.Data;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
@Data
|
||||
public class GoodsParam {
|
||||
// @NotEmpty(message = "商品名称不能为空")
|
||||
@NotBlank(message = "商品名称不能为空")
|
||||
private String goods_name;
|
||||
|
||||
@NotEmpty(message = "{goods.remark.notNull}")
|
||||
@NotBlank(message = "{goods.remark.notNull}")
|
||||
private String goods_remark;
|
||||
|
||||
// 传参的格式:{xxx}=value1,value2...
|
||||
|
Reference in New Issue
Block a user