package me.zhengjie.system.rest; import me.zhengjie.system.domain.VerificationCode; import me.zhengjie.system.service.VerificationCodeService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; /** * @author jie * @date 2018-12-26 */ @RestController @RequestMapping("api") public class VerificationCodeController { @Autowired private VerificationCodeService verificationCodeService; @PostMapping(value = "/code/sendEmail") public ResponseEntity sendEmail(@RequestBody VerificationCode code){ code.setType("email"); verificationCodeService.sendEmail(code); return new ResponseEntity(HttpStatus.OK); } @GetMapping(value = "/code/validated") public ResponseEntity validated(VerificationCode code){ verificationCodeService.validated(code); return new ResponseEntity(HttpStatus.OK); } }