@Test public void getEmailStatus() throws Exception { String email = UUID.randomUUID().toString().substring(0, 4) + "@celess.cn"; mockMvc.perform(get("/emailStatus/" + email)).andDo(result -> { String content = result.getResponse().getContentAsString(); assertEquals(SUCCESS.getCode(), JSONObject.fromObject(content).getInt(Code)); assertFalse(JSONObject.fromObject(content).getBoolean(Result)); }); email = "a@celess.cn"; mockMvc.perform(get("/emailStatus/" + email)).andDo(result -> { String content = result.getResponse().getContentAsString(); assertEquals(SUCCESS.getCode(), JSONObject.fromObject(content).getInt(Code)); assertTrue(JSONObject.fromObject(content).getBoolean(Result)); }); }
@GetMapping("/emailStatus/{email}") public Response getEmailStatus(@PathVariable("email") String email) { return ResponseUtil.success(userService.getStatusOfEmail(email)); }
UserController { @GetMapping("/emailStatus/{email}") public Response getEmailStatus(@PathVariable("email") String email) { return ResponseUtil.success(userService.getStatusOfEmail(email)); } }
UserController { @GetMapping("/emailStatus/{email}") public Response getEmailStatus(@PathVariable("email") String email) { return ResponseUtil.success(userService.getStatusOfEmail(email)); }  }
UserController { @GetMapping("/emailStatus/{email}") public Response getEmailStatus(@PathVariable("email") String email) { return ResponseUtil.success(userService.getStatusOfEmail(email)); }  @PostMapping("/login") Response login(@RequestBody LoginReq loginReq); @PostMapping("/registration") Response registration(@RequestParam("email") String email,
                                 @RequestParam("password") String password); @GetMapping("/logout") Response logout(); @PutMapping("/user/userInfo/update") Response updateInfo(String desc, String displayName); @GetMapping("/user/userInfo") Response getUserInfo(); @PostMapping("/user/imgUpload") @ResponseBody Response upload(@RequestParam("file") MultipartFile file); @PostMapping("/sendResetPwdEmail") Response sendResetPwdEmail(@RequestParam("email") String email); @PostMapping("/sendVerifyEmail") Response sendVerifyEmail(@RequestParam("email") String email); @PostMapping("/emailVerify") Response emailVerify(@RequestParam("verifyId") String verifyId,
                                @RequestParam("email") String mail); @PostMapping("/resetPwd") Response resetPwd(@RequestParam("verifyId") String verifyId,
                             @RequestParam("email") String email,
                             @RequestParam("pwd") String pwd); @DeleteMapping("/admin/user/delete") Response multipleDelete(@RequestBody Integer[] ids); @DeleteMapping("/admin/user/delete/{id}") Response delete(@PathVariable("id") Integer id); @PutMapping("/admin/user") Response updateInfoByAdmin(@RequestBody UserReq user); @GetMapping("/admin/users") Response getAllUser(@RequestParam("page") int pageNum, @RequestParam("count") int count); @GetMapping("/emailStatus/{email}") Response getEmailStatus(@PathVariable("email") String email); }
UserController { @GetMapping("/emailStatus/{email}") public Response getEmailStatus(@PathVariable("email") String email) { return ResponseUtil.success(userService.getStatusOfEmail(email)); }  @PostMapping("/login") Response login(@RequestBody LoginReq loginReq); @PostMapping("/registration") Response registration(@RequestParam("email") String email,
                                 @RequestParam("password") String password); @GetMapping("/logout") Response logout(); @PutMapping("/user/userInfo/update") Response updateInfo(String desc, String displayName); @GetMapping("/user/userInfo") Response getUserInfo(); @PostMapping("/user/imgUpload") @ResponseBody Response upload(@RequestParam("file") MultipartFile file); @PostMapping("/sendResetPwdEmail") Response sendResetPwdEmail(@RequestParam("email") String email); @PostMapping("/sendVerifyEmail") Response sendVerifyEmail(@RequestParam("email") String email); @PostMapping("/emailVerify") Response emailVerify(@RequestParam("verifyId") String verifyId,
                                @RequestParam("email") String mail); @PostMapping("/resetPwd") Response resetPwd(@RequestParam("verifyId") String verifyId,
                             @RequestParam("email") String email,
                             @RequestParam("pwd") String pwd); @DeleteMapping("/admin/user/delete") Response multipleDelete(@RequestBody Integer[] ids); @DeleteMapping("/admin/user/delete/{id}") Response delete(@PathVariable("id") Integer id); @PutMapping("/admin/user") Response updateInfoByAdmin(@RequestBody UserReq user); @GetMapping("/admin/users") Response getAllUser(@RequestParam("page") int pageNum, @RequestParam("count") int count); @GetMapping("/emailStatus/{email}") Response getEmailStatus(@PathVariable("email") String email);  }