@Test public void testCreateUser() { Map<String, String> map = new HashMap<>(); map.put("username", "qinyi"); HttpHeaders headers = new HttpHeaders(); headers.setContentType(MediaType.APPLICATION_JSON); HttpEntity<Map<String, String>> entity = new HttpEntity<>(map, headers); CommonResponse response = template.postForEntity("http: entity, CommonResponse.class).getBody(); log.debug(JSON.toJSONString(response)); }
@PostMapping("/create/user") public CreateUserResponse createUser(@RequestBody CreateUserRequest request) throws AdException { log.info("ad-sponsor: createUser -> {}", JSON.toJSONString(request)); return iUserService.createUser(request); }
UserController { @PostMapping("/create/user") public CreateUserResponse createUser(@RequestBody CreateUserRequest request) throws AdException { log.info("ad-sponsor: createUser -> {}", JSON.toJSONString(request)); return iUserService.createUser(request); } }
UserController { @PostMapping("/create/user") public CreateUserResponse createUser(@RequestBody CreateUserRequest request) throws AdException { log.info("ad-sponsor: createUser -> {}", JSON.toJSONString(request)); return iUserService.createUser(request); } @Autowired  UserController(IUserService iUserService); }
UserController { @PostMapping("/create/user") public CreateUserResponse createUser(@RequestBody CreateUserRequest request) throws AdException { log.info("ad-sponsor: createUser -> {}", JSON.toJSONString(request)); return iUserService.createUser(request); } @Autowired  UserController(IUserService iUserService); @PostMapping("/create/user") CreateUserResponse createUser(@RequestBody CreateUserRequest request); }
UserController { @PostMapping("/create/user") public CreateUserResponse createUser(@RequestBody CreateUserRequest request) throws AdException { log.info("ad-sponsor: createUser -> {}", JSON.toJSONString(request)); return iUserService.createUser(request); } @Autowired  UserController(IUserService iUserService); @PostMapping("/create/user") CreateUserResponse createUser(@RequestBody CreateUserRequest request);  }