diff --git a/sop-common/sop-service-common/src/test/java/com/gitee/sop/servercommon/ValidatorTest.java b/sop-common/sop-service-common/src/test/java/com/gitee/sop/servercommon/ValidatorTest.java index 5e4a395f..4df31b66 100644 --- a/sop-common/sop-service-common/src/test/java/com/gitee/sop/servercommon/ValidatorTest.java +++ b/sop-common/sop-service-common/src/test/java/com/gitee/sop/servercommon/ValidatorTest.java @@ -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 } diff --git a/sop-example/sop-story/sop-story-web/src/main/java/com/gitee/sop/storyweb/controller/AlipayController.java b/sop-example/sop-story/sop-story-web/src/main/java/com/gitee/sop/storyweb/controller/AlipayController.java index 7cfe7817..c207bf52 100644 --- a/sop-example/sop-story/sop-story-web/src/main/java/com/gitee/sop/storyweb/controller/AlipayController.java +++ b/sop-example/sop-story/sop-story-web/src/main/java/com/gitee/sop/storyweb/controller/AlipayController.java @@ -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")