-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[feat]: 회원가입 로직 수정
- Loading branch information
Showing
13 changed files
with
173 additions
and
38 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
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
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
22 changes: 22 additions & 0 deletions
22
src/main/java/com/onnoff/onnoff/domain/user/controller/InquiryEnumController.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,22 @@ | ||
package com.onnoff.onnoff.domain.user.controller; | ||
|
||
import com.onnoff.onnoff.apiPayload.ApiResponse; | ||
import com.onnoff.onnoff.domain.user.dto.EnumInquiryResponseDTO; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
import java.util.List; | ||
|
||
@RestController | ||
@RequestMapping("/enums") | ||
public class InquiryEnumController { | ||
@GetMapping("/field-of-works") | ||
public ApiResponse<List<String>> getAllFieldValues(){ | ||
return ApiResponse.onSuccess(EnumInquiryResponseDTO.FieldOfWorkResponseDTO.getAllField()); | ||
} | ||
@GetMapping("/experience-years") | ||
public ApiResponse<List<String>> getAllExperienceValues(){ | ||
return ApiResponse.onSuccess(EnumInquiryResponseDTO.ExperienceYearResponseDTO.getAllExperience()); | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
src/main/java/com/onnoff/onnoff/domain/user/controller/UserController.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,15 @@ | ||
package com.onnoff.onnoff.domain.user.controller; | ||
|
||
|
||
import com.onnoff.onnoff.apiPayload.ApiResponse; | ||
import com.onnoff.onnoff.domain.user.dto.EnumInquiryResponseDTO; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
import java.util.List; | ||
|
||
@RestController | ||
public class UserController { | ||
|
||
} |
32 changes: 27 additions & 5 deletions
32
src/main/java/com/onnoff/onnoff/domain/user/converter/UserConverter.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
26 changes: 26 additions & 0 deletions
26
src/main/java/com/onnoff/onnoff/domain/user/dto/EnumInquiryResponseDTO.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,26 @@ | ||
package com.onnoff.onnoff.domain.user.dto; | ||
|
||
import com.onnoff.onnoff.domain.user.enums.ExperienceYear; | ||
import com.onnoff.onnoff.domain.user.enums.FieldOfWork; | ||
|
||
import java.util.Arrays; | ||
import java.util.List; | ||
import java.util.stream.Collectors; | ||
|
||
public class EnumInquiryResponseDTO { | ||
|
||
public static class FieldOfWorkResponseDTO{ | ||
public static List<String> getAllField() { | ||
return Arrays.stream(FieldOfWork.values()) | ||
.map(Enum::name) | ||
.collect(Collectors.toList()); | ||
} | ||
} | ||
public static class ExperienceYearResponseDTO{ | ||
public static List<String> getAllExperience() { | ||
return Arrays.stream(ExperienceYear.values()) | ||
.map(ExperienceYear::getValue) | ||
.collect(Collectors.toList()); | ||
} | ||
} | ||
} |
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
30 changes: 30 additions & 0 deletions
30
src/main/java/com/onnoff/onnoff/domain/user/enums/ExperienceYear.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,30 @@ | ||
package com.onnoff.onnoff.domain.user.enums; | ||
|
||
|
||
import com.onnoff.onnoff.apiPayload.code.status.ErrorStatus; | ||
import com.onnoff.onnoff.apiPayload.exception.GeneralException; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
|
||
@AllArgsConstructor | ||
@Getter | ||
public enum ExperienceYear { | ||
|
||
THE_NEW("신입"), | ||
THE_FIRST_YEAR("1년 이상 2년 미만"), | ||
THE_SECOND_YEAR("2년 이상 3년 미만"), | ||
THE_THIRD_YEAR("3년 이상 4년 미만"), | ||
THE_FOURTH_YEAR("4년 이상 5년 미만"), | ||
THE_FIFTH_YEAR_OR_MORE("5년 이상"), | ||
THE_SENIOR("시니어"); | ||
private final String value; | ||
|
||
public static ExperienceYear fromValue(String value) { | ||
for (ExperienceYear experienceYear : ExperienceYear.values()) { | ||
if (experienceYear.getValue().equals(value)) { | ||
return experienceYear; | ||
} | ||
} | ||
throw new GeneralException(ErrorStatus.INVALID_ENUM_VALUE); | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
src/main/java/com/onnoff/onnoff/domain/user/enums/FieldOfWork.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,15 @@ | ||
package com.onnoff.onnoff.domain.user.enums; | ||
|
||
|
||
import lombok.AllArgsConstructor; | ||
|
||
@AllArgsConstructor | ||
public enum FieldOfWork { | ||
|
||
서비스업, 의료_제약_복지, 제조_화학, | ||
판매_유통, IT_웹_통신, 건설업, | ||
교육업, 미디어_디자인, 은행_금융업, | ||
기관_협회, 비즈니스_투자, 물류_무역업, | ||
법률_법집행기관, 방송_광고_엔터테인먼트, 여행_숙박_음식점업, | ||
부동산_임대업 | ||
} |