This commit is contained in:
tanghc
2019-11-14 17:21:28 +08:00
parent 0bdac8506b
commit efe08c6389
2 changed files with 29 additions and 1 deletions

View File

@@ -31,7 +31,8 @@ public class ValidatorTest extends TestCase {
public void testField() {
Manager manager = new Manager("Jim", 22, Type.TWO, Status.OK);
Sub sub = new Sub("sub", Type.ONE);
Manager manager = new Manager("Jim", 22, Type.TWO, Status.OK, sub);
Store store = new Store("仓库A", manager, Type.ONE);
Goods goods = new Goods("Apple", new BigDecimal(50000), store);
serviceParamValidator.validateBizParam(goods);
@@ -93,12 +94,29 @@ public class ValidatorTest extends TestCase {
@NotNull(message = "Manager.status不能为空")
private Status status;
@NotNull(message = "sub不能为空")
private Sub sub;
}
@Data
@AllArgsConstructor
static class Sub {
@NotBlank(message = "管理员姓名不能为空")
private String name;
@NotNull(message = "Sub.type不能为空")
private Type type;
}
enum Type {
ONE,TWO
}
enum SubType {
OK,ERR
}
enum Status {
OK, ERROR
}

View File

@@ -152,6 +152,16 @@ public class AlipayController {
return story;
}
@ApiAbility(ignoreValidate = true)
@GetMapping("/empinfo/get")
@ApiOperation(value="遗留接口", notes = "遗留接口")
public StoryResult getEmpInfo() {
StoryResult story = new StoryResult();
story.setId(1L);
story.setName("遗留接口");
return story;
}
// http://localhost:2222/alipay.story.get/
@ApiOperation(value="获取故事信息2", notes = "获取故事信息2的详细信息")
@ApiMapping(value = "alipay.story.get")