|
|
@@ -6,6 +6,8 @@ import com.huimv.employment.service.auth.dto.LoginResponse;
|
|
6
|
6
|
import com.huimv.employment.service.auth.dto.SmsLoginRequest;
|
|
7
|
7
|
import com.huimv.employment.service.auth.dto.SmsSendRequest;
|
|
8
|
8
|
import com.huimv.employment.service.auth.dto.SmsSendResponse;
|
|
|
9
|
+import io.swagger.v3.oas.annotations.Operation;
|
|
|
10
|
+import io.swagger.v3.oas.annotations.tags.Tag;
|
|
9
|
11
|
import org.springframework.validation.annotation.Validated;
|
|
10
|
12
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
11
|
13
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
@@ -21,6 +23,7 @@ import org.springframework.web.bind.annotation.RestController;
|
|
21
|
23
|
*/
|
|
22
|
24
|
@RestController
|
|
23
|
25
|
@RequestMapping("/api/v1/mp/auth")
|
|
|
26
|
+@Tag(name = "认证", description = "短信验证码登录,匿名访问")
|
|
24
|
27
|
public class AuthController {
|
|
25
|
28
|
|
|
26
|
29
|
private final AuthService authService;
|
|
|
@@ -42,6 +45,7 @@ public class AuthController {
|
|
42
|
45
|
* @return 是否 Mock 模式、验证码有效期(秒)
|
|
43
|
46
|
*/
|
|
44
|
47
|
@PostMapping("/sms/send")
|
|
|
48
|
+ @Operation(summary = "发送登录验证码")
|
|
45
|
49
|
public R<SmsSendResponse> sendSmsCode(@Validated @RequestBody SmsSendRequest request) {
|
|
46
|
50
|
return R.ok(authService.sendLoginCode(request));
|
|
47
|
51
|
}
|
|
|
@@ -57,6 +61,7 @@ public class AuthController {
|
|
57
|
61
|
* @return Token、用户 ID、脱敏手机号等
|
|
58
|
62
|
*/
|
|
59
|
63
|
@PostMapping("/sms/login")
|
|
|
64
|
+ @Operation(summary = "短信验证码登录")
|
|
60
|
65
|
public R<LoginResponse> loginBySms(@Validated @RequestBody SmsLoginRequest request) {
|
|
61
|
66
|
return R.ok(authService.loginBySms(request));
|
|
62
|
67
|
}
|