-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #93 from team9502/dev
feat: ์ฌ์ฉ์/๊ธฐ์ (ํ์) ๋น๋ฐ๋ฒํธ ์์ + ํฌ์ธํธ ์ด์ก ๋ด์ญ ์กฐํ์ ๋ค์ ํ์ด์ง ์ฌ๋ถ ์ถ๊ฐ + ๋ฆฌ๋ทฐ ์กฐํ์ ํ์ฌ ํ์ด์ง ๋ฒํธ์ ์ ์ฒด ํ์ด์ง ์ ์๋ต๊ฐ์ ํฌํจ + ๋ฆฌ๋ทฐ ์กฐํ์ ๊ณต๊ฐ๋ ๋ฆฌ๋ทฐ๊ฐ ์ต์๋จ์ผ๋ก ์ค๊ฒ ์์
- Loading branch information
Showing
19 changed files
with
297 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,14 +10,14 @@ | |
import org.springframework.http.ResponseEntity; | ||
import org.springframework.security.core.annotation.AuthenticationPrincipal; | ||
import org.springframework.web.bind.annotation.*; | ||
import team9502.sinchulgwinong.domain.companyUser.dto.request.CpUserPasswordUpdateRequestDTO; | ||
import team9502.sinchulgwinong.domain.companyUser.dto.request.CpUserProfileUpdateRequestDTO; | ||
import team9502.sinchulgwinong.domain.companyUser.dto.response.CpUserProfileResponseDTO; | ||
import team9502.sinchulgwinong.domain.companyUser.service.CpUserService; | ||
import team9502.sinchulgwinong.global.response.GlobalApiResponse; | ||
import team9502.sinchulgwinong.global.security.UserDetailsImpl; | ||
|
||
import static team9502.sinchulgwinong.global.response.SuccessCode.SUCCESS_CP_USER_PROFILE_READ; | ||
import static team9502.sinchulgwinong.global.response.SuccessCode.SUCCESS_CP_USER_PROFILE_UPDATED; | ||
import static team9502.sinchulgwinong.global.response.SuccessCode.*; | ||
|
||
@RestController | ||
@RequiredArgsConstructor | ||
|
@@ -32,7 +32,7 @@ public class CpUserController { | |
@ApiResponses({ | ||
@ApiResponse(responseCode = "200", description = "๊ธฐ์ (ํ์) ํ๋กํ ์กฐํ ์ฑ๊ณต", | ||
content = @Content(mediaType = "application/json", | ||
examples = @ExampleObject(value = "{ \"code\": \"200\", \"message\": \"ํ๋กํ ์กฐํ ์ฑ๊ณต\", \"data\": {\"cpUserId\": 1, \"cpName\": \"ํ9502\", \"cpEmail\": \"[email protected]\", \"cpPhoneNumber\": \"01012345678\", \"cpUsername\": \"๊น์์ฑ\", \"hiringStatus\": true, \"employeeCount\": 50, \"description\": \"๊ธฐ์ ์๊ฐ ์์์ ๋๋ค.\", \"cpNum\": \"1234567890\"} }"))), | ||
examples = @ExampleObject(value = "{ \"code\": \"200\", \"message\": \"ํ๋กํ ์กฐํ ์ฑ๊ณต\", \"data\": {\"cpUserId\": 1, \"cpName\": \"ํ9502\", \"cpEmail\": \"[email protected]\", \"cpPhoneNumber\": \"01012345678\", \"cpUsername\": \"๊น์์ฑ\", \"hiringStatus\": true, \"employeeCount\": 50, \"foundationDate\": \"2021-01-01\", \"description\": \"๊ธฐ์ ์๊ฐ ์์์ ๋๋ค.\", \"cpNum\": \"1234567890\", \"averageRating\": 4.5, \"reviewCount\": 20} }"))), | ||
@ApiResponse(responseCode = "400", description = "์๋ชป๋ ์ฌ์ฉ์ ์ ํ", | ||
content = @Content(mediaType = "application/json", | ||
examples = @ExampleObject(value = "{ \"code\": \"400\", \"message\": \"์๋ชป๋ ์ฌ์ฉ์ ์ ํ์ ๋๋ค.\", \"data\": null }"))), | ||
|
@@ -87,4 +87,39 @@ public ResponseEntity<GlobalApiResponse<CpUserProfileResponseDTO>> updateCompany | |
) | ||
); | ||
} | ||
|
||
@PatchMapping("/password") | ||
@Operation(summary = "๋น๋ฐ๋ฒํธ ๋ณ๊ฒฝ", description = "๋ก๊ทธ์ธํ ๊ธฐ์ (ํ์)์ ๋น๋ฐ๋ฒํธ๋ฅผ ์์ ํ๊ฒ ๋ณ๊ฒฝํฉ๋๋ค.") | ||
@ApiResponses({ | ||
@ApiResponse(responseCode = "200", description = "๋น๋ฐ๋ฒํธ ๋ณ๊ฒฝ ์ฑ๊ณต", | ||
content = @Content(mediaType = "application/json", | ||
examples = @ExampleObject(value = "{ \"code\": \"200\", \"message\": \"๋น๋ฐ๋ฒํธ ๋ณ๊ฒฝ ์ฑ๊ณต\" }"))), | ||
@ApiResponse(responseCode = "400", description = "๋น๋ฐ๋ฒํธ ๋ถ์ผ์น ๋๋ ์ ํจํ์ง ์์ ์์ฒญ", | ||
content = @Content(mediaType = "application/json", | ||
examples = { | ||
@ExampleObject(name = "๋น๋ฐ๋ฒํธ ๋ถ์ผ์น", value = "{ \"code\": \"400\", \"message\": \"์ ๋ ฅํ ๋น๋ฐ๋ฒํธ๊ฐ ๊ธฐ์กด ๋น๋ฐ๋ฒํธ์ ์ผ์นํ์ง ์์ต๋๋ค.\" }"), | ||
@ExampleObject(name = "๋น๋ฐ๋ฒํธ ํ์ธ ๋ถ์ผ์น", value = "{ \"code\": \"400\", \"message\": \"๋น๋ฐ๋ฒํธ์ ๋น๋ฐ๋ฒํธ ํ์ธ์ด ์ผ์นํ์ง ์์ต๋๋ค.\" }") | ||
})), | ||
@ApiResponse(responseCode = "400", description = "์๋ชป๋ ์ฌ์ฉ์ ์ ํ", | ||
content = @Content(mediaType = "application/json", | ||
examples = @ExampleObject(value = "{ \"code\": \"400\", \"message\": \"์๋ชป๋ ์ฌ์ฉ์ ์ ํ์ ๋๋ค.\", \"data\": null }"))), | ||
@ApiResponse(responseCode = "404", description = "์ฌ์ฉ์๋ฅผ ์ฐพ์ ์ ์์", | ||
content = @Content(mediaType = "application/json", | ||
examples = @ExampleObject(value = "{ \"code\": \"404\", \"message\": \"์ฌ์ฉ์๋ฅผ ์ฐพ์ ์ ์์ต๋๋ค.\" }"))), | ||
@ApiResponse(responseCode = "500", description = "์๋ฒ ๋ด๋ถ ์ค๋ฅ", | ||
content = @Content(mediaType = "application/json", | ||
examples = @ExampleObject(value = "{ \"code\": \"500\", \"message\": \"์๋ฒ ์ค๋ฅ๊ฐ ๋ฐ์ํ์ต๋๋ค.\" }"))) | ||
}) | ||
public ResponseEntity<GlobalApiResponse<Void>> updateUserProfile( | ||
@AuthenticationPrincipal UserDetailsImpl userDetails, | ||
@RequestBody CpUserPasswordUpdateRequestDTO requestDTO) { | ||
|
||
cpUserService.updateCpUserPassword(userDetails.getCpUserId(), requestDTO); | ||
|
||
return ResponseEntity.status(SUCCESS_USER_PASSWORD_UPDATED.getHttpStatus()) | ||
.body( | ||
GlobalApiResponse.of( | ||
SUCCESS_USER_PASSWORD_UPDATED.getMessage(), | ||
null)); | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
...eam9502/sinchulgwinong/domain/companyUser/dto/request/CpUserPasswordUpdateRequestDTO.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package team9502.sinchulgwinong.domain.companyUser.dto.request; | ||
|
||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Getter | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class CpUserPasswordUpdateRequestDTO { | ||
|
||
@Schema(description = "ํ์ฌ ๋น๋ฐ๋ฒํธ", example = "password") | ||
private String currentPassword; | ||
|
||
@Schema(description = "๋ณ๊ฒฝํ ๋น๋ฐ๋ฒํธ", example = "newPassword") | ||
private String newPassword; | ||
|
||
@Schema(description = "๋ณ๊ฒฝํ ๋น๋ฐ๋ฒํธ ํ์ธ", example = "newPassword") | ||
private String newPasswordConfirm; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
src/main/java/team9502/sinchulgwinong/domain/point/dto/response/PagedResponseDTO.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package team9502.sinchulgwinong.domain.point.dto.response; | ||
|
||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
import java.util.List; | ||
|
||
@Getter | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class PagedResponseDTO<T> { | ||
|
||
private List<T> data; | ||
|
||
@Schema(description = "๋ค์ ํ์ด์ง ์กด์ฌ ์ฌ๋ถ", example = "true") | ||
private boolean hasNextPage; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.