pull/1/head
tanghc 5 years ago
parent 0bdac8506b
commit efe08c6389
  1. 20
      sop-common/sop-service-common/src/test/java/com/gitee/sop/servercommon/ValidatorTest.java
  2. 10
      sop-example/sop-story/sop-story-web/src/main/java/com/gitee/sop/storyweb/controller/AlipayController.java

@ -31,7 +31,8 @@ public class ValidatorTest extends TestCase {
public void testField() { 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); Store store = new Store("仓库A", manager, Type.ONE);
Goods goods = new Goods("Apple", new BigDecimal(50000), store); Goods goods = new Goods("Apple", new BigDecimal(50000), store);
serviceParamValidator.validateBizParam(goods); serviceParamValidator.validateBizParam(goods);
@ -93,12 +94,29 @@ public class ValidatorTest extends TestCase {
@NotNull(message = "Manager.status不能为空") @NotNull(message = "Manager.status不能为空")
private Status 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 { enum Type {
ONE,TWO ONE,TWO
} }
enum SubType {
OK,ERR
}
enum Status { enum Status {
OK, ERROR OK, ERROR
} }

@ -152,6 +152,16 @@ public class AlipayController {
return story; 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/ // http://localhost:2222/alipay.story.get/
@ApiOperation(value="获取故事信息2", notes = "获取故事信息2的详细信息") @ApiOperation(value="获取故事信息2", notes = "获取故事信息2的详细信息")
@ApiMapping(value = "alipay.story.get") @ApiMapping(value = "alipay.story.get")

Loading…
Cancel
Save