| | |
| | | package com.tcm.training.admin.auth.controller; |
| | | |
| | | import com.tcm.training.admin.auth.dto.ChangePasswordRequest; |
| | | import com.tcm.training.admin.auth.dto.LoginRequest; |
| | | import com.tcm.training.admin.auth.dto.ProfileUpdateRequest; |
| | | import com.tcm.training.admin.auth.service.AuthService; |
| | | import com.tcm.training.admin.auth.service.CaptchaService; |
| | | import com.tcm.training.admin.auth.vo.CaptchaResponse; |
| | |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | |
| | | public ApiResponse<UserVO> me() { |
| | | return ApiResponse.ok(authService.me()); |
| | | } |
| | | |
| | | @PutMapping("/profile") |
| | | public ApiResponse<UserVO> updateProfile(@Valid @RequestBody ProfileUpdateRequest req) { |
| | | return ApiResponse.ok(authService.updateProfile(req)); |
| | | } |
| | | |
| | | @PostMapping("/change-password") |
| | | public ApiResponse<Void> changePassword(@Valid @RequestBody ChangePasswordRequest req) { |
| | | authService.changePassword(req); |
| | | return ApiResponse.ok(null); |
| | | } |
| | | } |