|
|
|
@ -13,8 +13,8 @@ import com.anji.captcha.model.common.RepCodeEnum;
|
|
|
|
import com.anji.captcha.model.common.ResponseModel;
|
|
|
|
import com.anji.captcha.model.common.ResponseModel;
|
|
|
|
import com.anji.captcha.model.vo.CaptchaVO;
|
|
|
|
import com.anji.captcha.model.vo.CaptchaVO;
|
|
|
|
import com.anji.captcha.service.CaptchaService;
|
|
|
|
import com.anji.captcha.service.CaptchaService;
|
|
|
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
|
|
|
|
|
|
import com.yami.shop.common.response.ServerResponseEntity;
|
|
|
|
import com.yami.shop.common.response.ServerResponseEntity;
|
|
|
|
|
|
|
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
@ -35,17 +35,17 @@ public class CaptchaController {
|
|
|
|
this.captchaService = captchaService;
|
|
|
|
this.captchaService = captchaService;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@PostMapping({ "/get" })
|
|
|
|
@PostMapping({"/get"})
|
|
|
|
public ServerResponseEntity<ResponseModel> get(@RequestBody CaptchaVO captchaVO) {
|
|
|
|
public ServerResponseEntity<ResponseModel> get(@RequestBody CaptchaVO captchaVO) {
|
|
|
|
return ServerResponseEntity.success(captchaService.get(captchaVO));
|
|
|
|
return ServerResponseEntity.success(captchaService.get(captchaVO));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@PostMapping({ "/check" })
|
|
|
|
@PostMapping({"/check"})
|
|
|
|
public ServerResponseEntity<ResponseModel> check(@RequestBody CaptchaVO captchaVO) {
|
|
|
|
public ServerResponseEntity<ResponseModel> check(@RequestBody CaptchaVO captchaVO) {
|
|
|
|
ResponseModel responseModel;
|
|
|
|
ResponseModel responseModel;
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
responseModel = captchaService.check(captchaVO);
|
|
|
|
responseModel = captchaService.check(captchaVO);
|
|
|
|
}catch (Exception e) {
|
|
|
|
} catch (Exception e) {
|
|
|
|
return ServerResponseEntity.success(ResponseModel.errorMsg(RepCodeEnum.API_CAPTCHA_COORDINATE_ERROR));
|
|
|
|
return ServerResponseEntity.success(ResponseModel.errorMsg(RepCodeEnum.API_CAPTCHA_COORDINATE_ERROR));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return ServerResponseEntity.success(responseModel);
|
|
|
|
return ServerResponseEntity.success(responseModel);
|
|
|
|
|