diff --git a/src/main/java/io/company/localhost/controller/api/RegisterController.java b/src/main/java/io/company/localhost/controller/api/RegisterController.java deleted file mode 100644 index 7afcc98..0000000 --- a/src/main/java/io/company/localhost/controller/api/RegisterController.java +++ /dev/null @@ -1,97 +0,0 @@ -/************************************************************ - * - * @packageName : io.company.localhost.controller.api - * @fileName : RegisterController.java - * @author : 박지윤 - * @date : 25.01.17 - * @description : 등록신청 - * - * =========================================================== - * DATE AUTHOR NOTE - * ----------------------------------------------------------- - * 24.01.17 박지윤 최초 생성 - * - *************************************************************/ - -package io.company.localhost.controller.api; - -import java.util.List; - -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; -import org.springframework.web.multipart.MultipartFile; - -import io.company.localhost.common.annotation.ParameterCheck; -import io.company.localhost.common.annotation.ReqMap; -import io.company.localhost.common.dto.ApiResponse; -import io.company.localhost.common.dto.MapDto; -import io.company.localhost.service.RegisterService; -import io.company.localhost.service.commoncodService; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; - -@Slf4j -@RequestMapping("/api/register") -@RestController -@RequiredArgsConstructor -public class RegisterController { - - private final commoncodService commoncodservice; - private final RegisterService registerService; - - /** - * 사용 가능 색상 조회 - * - * @return ApiResponse> - * - */ - @ParameterCheck - @GetMapping("/color") - public ApiResponse> getColorList() { - List ColorList = commoncodservice.getColorList(); - return ApiResponse.ok(ColorList); - } - - /** - * MBTI 목록 조회 - * - * @return ApiResponse> - * - */ - @ParameterCheck - @GetMapping("/mbti") - public ApiResponse> getMbtiList() { - List MbtiList = commoncodservice.getMbtiList(); - return ApiResponse.ok(MbtiList); - } - - /** - * 회원가입 - * - * @param profile - * @param map - * @return ApiResponse - * @throws RuntimeException 파일 업로드 실패 시 - */ - @PostMapping("/join") - public ApiResponse register(@RequestParam("profile") MultipartFile profile, @ReqMap MapDto map) { - int member = registerService.register(profile, map); - return ApiResponse.ok(member); - } - - /** - * 아이디 중복 체크 - * - * @param memberIds - * @return ApiResponse - * @throws IllegalArgumentException - */ - @GetMapping("/checkId") - public ApiResponse selectCheckId(@RequestParam String memberIds) { - boolean isDuplicate = registerService.selectCheckId(memberIds); - return ApiResponse.ok(!isDuplicate); - } -} diff --git a/src/main/java/io/company/localhost/controller/common/UserController.java b/src/main/java/io/company/localhost/controller/common/UserController.java index 9c526dd..7926f89 100644 --- a/src/main/java/io/company/localhost/controller/common/UserController.java +++ b/src/main/java/io/company/localhost/controller/common/UserController.java @@ -10,6 +10,7 @@ * DATE AUTHOR NOTE * ----------------------------------------------------------- * 24.12.06 조인제 최초 생성 + * 24.01.17 박지윤 Register 합침 * *************************************************************/ package io.company.localhost.controller.common; @@ -17,7 +18,12 @@ package io.company.localhost.controller.common; import io.company.localhost.common.annotation.Admin; import io.company.localhost.common.annotation.Guest; import io.company.localhost.common.annotation.Member; +import io.company.localhost.common.annotation.ParameterCheck; +import io.company.localhost.common.annotation.ReqMap; import io.company.localhost.common.dto.ApiResponse; +import io.company.localhost.common.dto.MapDto; +import io.company.localhost.service.RegisterService; +import io.company.localhost.service.commoncodService; import io.company.localhost.utils.AuthUtil; import io.company.localhost.utils.SessionListener; import io.company.localhost.vo.MemberVo; @@ -35,10 +41,14 @@ import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.security.core.context.SecurityContextHolderStrategy; import org.springframework.security.web.authentication.logout.SecurityContextLogoutHandler; import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.multipart.MultipartFile; import java.util.HashMap; +import java.util.List; import java.util.Map; import static org.springframework.security.web.authentication.rememberme.AbstractRememberMeServices.SPRING_SECURITY_REMEMBER_ME_COOKIE_KEY; @@ -48,7 +58,63 @@ import static org.springframework.security.web.authentication.rememberme.Abstrac @RequestMapping("/api/user") @RequiredArgsConstructor public class UserController { - + + private final commoncodService commoncodservice; + private final RegisterService registerService; + + /** + * 사용 가능 색상 조회 + * + * @return ApiResponse> + * + */ + @ParameterCheck + @GetMapping("/color") + public ApiResponse> getColorList() { + List ColorList = commoncodservice.getColorList(); + return ApiResponse.ok(ColorList); + } + + /** + * MBTI 목록 조회 + * + * @return ApiResponse> + * + */ + @ParameterCheck + @GetMapping("/mbti") + public ApiResponse> getMbtiList() { + List MbtiList = commoncodservice.getMbtiList(); + return ApiResponse.ok(MbtiList); + } + + /** + * 회원가입 + * + * @param profile + * @param map + * @return ApiResponse + * @throws RuntimeException 파일 업로드 실패 시 + */ + @PostMapping("/join") + public ApiResponse register(@RequestParam("profile") MultipartFile profile, @ReqMap MapDto map) { + int member = registerService.register(profile, map); + return ApiResponse.ok(member); + } + + /** + * 아이디 중복 체크 + * + * @param memberIds + * @return ApiResponse + * @throws IllegalArgumentException + */ + @GetMapping("/checkId") + public ApiResponse selectCheckId(@RequestParam String memberIds) { + boolean isDuplicate = registerService.selectCheckId(memberIds); + return ApiResponse.ok(!isDuplicate); + } + //security 인증 체크 @GetMapping("userInfo") @@ -132,7 +198,7 @@ public class UserController { return ApiResponse.ok(returnMessage); } - + @Guest @GetMapping("get1")