-
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.
Browse files
Browse the repository at this point in the history
[REFACTOR] ERD/Architecture 리팩토링
- Loading branch information
Showing
334 changed files
with
3,941 additions
and
8,297 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
2 changes: 1 addition & 1 deletion
2
...e/server/common/config/SwaggerConfig.java → ...ptie/server/api/config/SwaggerConfig.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
66 changes: 66 additions & 0 deletions
66
src/main/java/com/soptie/server/api/controller/AuthApi.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,66 @@ | ||
package com.soptie.server.api.controller; | ||
|
||
import java.security.Principal; | ||
|
||
import org.springframework.http.HttpStatus; | ||
import org.springframework.web.bind.annotation.DeleteMapping; | ||
import org.springframework.web.bind.annotation.PostMapping; | ||
import org.springframework.web.bind.annotation.RequestBody; | ||
import org.springframework.web.bind.annotation.RequestHeader; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.ResponseStatus; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
import com.soptie.server.api.controller.docs.AuthApiDocs; | ||
import com.soptie.server.api.controller.dto.request.auth.SignInRequest; | ||
import com.soptie.server.api.controller.dto.response.SuccessResponse; | ||
import com.soptie.server.api.controller.dto.response.auth.SignInResponse; | ||
import com.soptie.server.api.controller.dto.response.auth.TokenGetResponse; | ||
import com.soptie.server.api.controller.generic.SuccessMessage; | ||
import com.soptie.server.domain.auth.AuthService; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
import lombok.val; | ||
|
||
@RestController | ||
@RequiredArgsConstructor | ||
@RequestMapping("/api/v1/auth") | ||
public class AuthApi implements AuthApiDocs { | ||
|
||
private final AuthService authService; | ||
|
||
@ResponseStatus(HttpStatus.OK) | ||
@PostMapping | ||
public SuccessResponse<SignInResponse> signIn( | ||
@RequestHeader("Authorization") String socialAccessToken, | ||
@RequestBody SignInRequest request | ||
) { | ||
val response = authService.signIn(socialAccessToken, request); | ||
return SuccessResponse.success(SuccessMessage.SUCCESS_SIGN_IN.getMessage(), response); | ||
} | ||
|
||
@ResponseStatus(HttpStatus.OK) | ||
@PostMapping("/token") | ||
public SuccessResponse<TokenGetResponse> reissueToken( | ||
@RequestHeader("Authorization") String refreshToken | ||
) { | ||
val response = authService.reissueToken(refreshToken); | ||
return SuccessResponse.success(SuccessMessage.SUCCESS_RECREATE_TOKEN.getMessage(), response); | ||
} | ||
|
||
@ResponseStatus(HttpStatus.OK) | ||
@PostMapping("/logout") | ||
public SuccessResponse<?> signOut(Principal principal) { | ||
val memberId = Long.parseLong(principal.getName()); | ||
authService.signOut(memberId); | ||
return SuccessResponse.success(SuccessMessage.SUCCESS_SIGN_OUT.getMessage()); | ||
} | ||
|
||
@ResponseStatus(HttpStatus.OK) | ||
@DeleteMapping | ||
public SuccessResponse<?> withdrawal(Principal principal) { | ||
val memberId = Long.parseLong(principal.getName()); | ||
authService.withdraw(memberId); | ||
return SuccessResponse.success(SuccessMessage.SUCCESS_WITHDRAWAL.getMessage()); | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
src/main/java/com/soptie/server/api/controller/ChallengeApi.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,37 @@ | ||
package com.soptie.server.api.controller; | ||
|
||
import java.security.Principal; | ||
|
||
import org.springframework.http.HttpStatus; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RequestParam; | ||
import org.springframework.web.bind.annotation.ResponseStatus; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
import com.soptie.server.api.controller.docs.ChallengeApiDocs; | ||
import com.soptie.server.api.controller.dto.response.SuccessResponse; | ||
import com.soptie.server.api.controller.dto.response.challenge.GetChallengesByMemberResponse; | ||
import com.soptie.server.api.controller.generic.SuccessMessage; | ||
import com.soptie.server.domain.challenge.ChallengeService; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
import lombok.val; | ||
|
||
@RestController | ||
@RequiredArgsConstructor | ||
@RequestMapping("/api/v2/routines/challenge") | ||
public class ChallengeApi implements ChallengeApiDocs { | ||
private final ChallengeService challengeService; | ||
|
||
@ResponseStatus(HttpStatus.OK) | ||
@GetMapping | ||
public SuccessResponse<GetChallengesByMemberResponse> getChallengesByTheme( | ||
Principal principal, | ||
@RequestParam long themeId | ||
) { | ||
val memberId = Long.parseLong(principal.getName()); | ||
val response = challengeService.getChallengesByTheme(memberId, themeId); | ||
return SuccessResponse.success(SuccessMessage.GET_CHALLENGE.getMessage(), response); | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
src/main/java/com/soptie/server/api/controller/MakerApi.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,32 @@ | ||
package com.soptie.server.api.controller; | ||
|
||
import org.springframework.http.HttpStatus; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.ResponseStatus; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
import com.soptie.server.api.controller.docs.MakerApiDocs; | ||
import com.soptie.server.api.controller.dto.response.SuccessResponse; | ||
import com.soptie.server.api.controller.dto.response.maker.GetMakerListResponse; | ||
import com.soptie.server.api.controller.generic.SuccessMessage; | ||
import com.soptie.server.domain.maker.MakerService; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
import lombok.val; | ||
|
||
@RestController | ||
@RequiredArgsConstructor | ||
@RequestMapping("/api/v2/makers") | ||
public class MakerApi implements MakerApiDocs { | ||
|
||
private final MakerService makerService; | ||
|
||
@Override | ||
@GetMapping | ||
@ResponseStatus(HttpStatus.OK) | ||
public SuccessResponse<GetMakerListResponse> acquireAll() { | ||
val response = makerService.acquireAll(); | ||
return SuccessResponse.success(SuccessMessage.SUCCESS_GET_MAKER_THEME.getMessage(), response); | ||
} | ||
} |
63 changes: 63 additions & 0 deletions
63
src/main/java/com/soptie/server/api/controller/MemberApi.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,63 @@ | ||
package com.soptie.server.api.controller; | ||
|
||
import java.security.Principal; | ||
|
||
import org.springframework.http.HttpStatus; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.PatchMapping; | ||
import org.springframework.web.bind.annotation.PathVariable; | ||
import org.springframework.web.bind.annotation.PostMapping; | ||
import org.springframework.web.bind.annotation.RequestBody; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.ResponseStatus; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
import com.soptie.server.api.controller.docs.MemberApiDocs; | ||
import com.soptie.server.api.controller.dto.request.member.CreateProfileRequest; | ||
import com.soptie.server.api.controller.dto.response.SuccessResponse; | ||
import com.soptie.server.api.controller.dto.response.member.GetHomeInfoResponse; | ||
import com.soptie.server.api.controller.dto.response.member.GiveMemberCottonResponse; | ||
import com.soptie.server.api.controller.generic.SuccessMessage; | ||
import com.soptie.server.domain.member.CottonType; | ||
import com.soptie.server.domain.member.MemberService; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
import lombok.val; | ||
|
||
@RestController | ||
@RequiredArgsConstructor | ||
@RequestMapping("/api/v1/members") | ||
public class MemberApi implements MemberApiDocs { | ||
|
||
private final MemberService memberService; | ||
|
||
@ResponseStatus(HttpStatus.CREATED) | ||
@PostMapping | ||
public SuccessResponse<?> createMemberProfile( | ||
Principal principal, | ||
@RequestBody CreateProfileRequest request | ||
) { | ||
val memberId = Long.parseLong(principal.getName()); | ||
memberService.createMemberProfile(memberId, request); | ||
return SuccessResponse.success(SuccessMessage.CREATE_MEMBER_PROFILE.getMessage()); | ||
} | ||
|
||
@ResponseStatus(HttpStatus.OK) | ||
@PatchMapping("/cotton/{cottonType}") | ||
public SuccessResponse<GiveMemberCottonResponse> giveCotton( | ||
Principal principal, | ||
@PathVariable CottonType cottonType | ||
) { | ||
val memberId = Long.parseLong(principal.getName()); | ||
val response = memberService.giveCotton(memberId, cottonType); | ||
return SuccessResponse.success(SuccessMessage.GIVE_COTTON.getMessage(), response); | ||
} | ||
|
||
@ResponseStatus(HttpStatus.OK) | ||
@GetMapping | ||
public SuccessResponse<GetHomeInfoResponse> getMemberHomeInfo(Principal principal) { | ||
val memberId = Long.parseLong(principal.getName()); | ||
val response = memberService.getMemberHomeInfo(memberId); | ||
return SuccessResponse.success(SuccessMessage.GET_MEMBER_HOME.getMessage(), response); | ||
} | ||
} |
57 changes: 57 additions & 0 deletions
57
src/main/java/com/soptie/server/api/controller/MemberMissionApi.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,57 @@ | ||
package com.soptie.server.api.controller; | ||
|
||
import java.security.Principal; | ||
|
||
import org.springframework.http.HttpStatus; | ||
import org.springframework.web.bind.annotation.DeleteMapping; | ||
import org.springframework.web.bind.annotation.PatchMapping; | ||
import org.springframework.web.bind.annotation.PathVariable; | ||
import org.springframework.web.bind.annotation.PostMapping; | ||
import org.springframework.web.bind.annotation.RequestBody; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.ResponseStatus; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
import com.soptie.server.api.controller.docs.MemberMissionApiDocs; | ||
import com.soptie.server.api.controller.dto.request.membermission.CreateMemberMissionRequest; | ||
import com.soptie.server.api.controller.dto.response.SuccessResponse; | ||
import com.soptie.server.api.controller.dto.response.membermission.CreateMemberMissionResponse; | ||
import com.soptie.server.api.controller.generic.SuccessMessage; | ||
import com.soptie.server.domain.membermission.MemberMissionService; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
import lombok.val; | ||
|
||
@RestController | ||
@RequiredArgsConstructor | ||
@RequestMapping("/api/v1/routines/happiness/member") | ||
public class MemberMissionApi implements MemberMissionApiDocs { | ||
private final MemberMissionService memberMissionService; | ||
|
||
@ResponseStatus(HttpStatus.CREATED) | ||
@PostMapping | ||
public SuccessResponse<CreateMemberMissionResponse> createMemberMission( | ||
Principal principal, | ||
@RequestBody CreateMemberMissionRequest request | ||
) { | ||
val memberId = Long.parseLong(principal.getName()); | ||
val response = memberMissionService.createMemberMission(memberId, request); | ||
return SuccessResponse.success(SuccessMessage.CREATE_ROUTINE.getMessage(), response); | ||
} | ||
|
||
@ResponseStatus(HttpStatus.OK) | ||
@DeleteMapping("/routine/{routineId}") | ||
public SuccessResponse<?> deleteMemberMission(Principal principal, @PathVariable long routineId) { | ||
val memberId = Long.parseLong(principal.getName()); | ||
memberMissionService.deleteMemberMission(memberId, routineId); | ||
return SuccessResponse.success(SuccessMessage.DELETE_ROUTINE.getMessage()); | ||
} | ||
|
||
@ResponseStatus(HttpStatus.OK) | ||
@PatchMapping("/routine/{routineId}") | ||
public SuccessResponse<?> achieveMemberMission(Principal principal, @PathVariable long routineId) { | ||
val memberId = Long.parseLong(principal.getName()); | ||
memberMissionService.achieveMemberMission(memberId, routineId); | ||
return SuccessResponse.success(SuccessMessage.ACHIEVE_ROUTINE.getMessage()); | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
src/main/java/com/soptie/server/api/controller/MemberMissionApiV2.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,32 @@ | ||
package com.soptie.server.api.controller; | ||
|
||
import java.security.Principal; | ||
|
||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
import com.soptie.server.api.controller.docs.MemberMissionApiV2Docs; | ||
import com.soptie.server.api.controller.dto.response.SuccessResponse; | ||
import com.soptie.server.api.controller.generic.SuccessMessage; | ||
import com.soptie.server.domain.membermission.MemberMissionService; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
import lombok.val; | ||
|
||
@RestController | ||
@RequiredArgsConstructor | ||
@RequestMapping("/api/v2/routines/challenge/member") | ||
public class MemberMissionApiV2 implements MemberMissionApiV2Docs { | ||
private final MemberMissionService memberMissionService; | ||
|
||
@GetMapping | ||
public ResponseEntity<?> getMemberMission(Principal principal) { | ||
val memberId = Long.parseLong(principal.getName()); | ||
return memberMissionService.getMemberMission(memberId) | ||
.map(response -> | ||
ResponseEntity.ok(SuccessResponse.success(SuccessMessage.GET_ROUTINE.getMessage(), response))) | ||
.orElseGet(() -> ResponseEntity.noContent().build()); | ||
} | ||
} |
51 changes: 51 additions & 0 deletions
51
src/main/java/com/soptie/server/api/controller/MemberRoutineApi.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,51 @@ | ||
package com.soptie.server.api.controller; | ||
|
||
import java.security.Principal; | ||
import java.util.List; | ||
|
||
import org.springframework.http.HttpStatus; | ||
import org.springframework.web.bind.annotation.DeleteMapping; | ||
import org.springframework.web.bind.annotation.PatchMapping; | ||
import org.springframework.web.bind.annotation.PathVariable; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RequestParam; | ||
import org.springframework.web.bind.annotation.ResponseStatus; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
import com.soptie.server.api.controller.docs.MemberRoutineApiDocs; | ||
import com.soptie.server.api.controller.dto.response.SuccessResponse; | ||
import com.soptie.server.api.controller.dto.response.memberroutine.AchieveMemberRoutineResponse; | ||
import com.soptie.server.api.controller.generic.SuccessMessage; | ||
import com.soptie.server.domain.memberroutine.MemberRoutineService; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
import lombok.val; | ||
|
||
@RestController | ||
@RequiredArgsConstructor | ||
@RequestMapping("/api/v1/routines/daily/member") | ||
public class MemberRoutineApi implements MemberRoutineApiDocs { | ||
private final MemberRoutineService memberRoutineService; | ||
|
||
@ResponseStatus(HttpStatus.OK) | ||
@DeleteMapping | ||
public SuccessResponse<?> deleteMemberRoutines( | ||
Principal principal, | ||
@RequestParam List<Long> routines | ||
) { | ||
val memberId = Long.parseLong(principal.getName()); | ||
memberRoutineService.deleteMemberRoutines(memberId, routines); | ||
return SuccessResponse.success(SuccessMessage.DELETE_ROUTINE.getMessage()); | ||
} | ||
|
||
@ResponseStatus(HttpStatus.OK) | ||
@PatchMapping("/routine/{routineId}") | ||
public SuccessResponse<AchieveMemberRoutineResponse> achieveMemberRoutine( | ||
Principal principal, | ||
@PathVariable long routineId | ||
) { | ||
val memberId = Long.parseLong(principal.getName()); | ||
val response = memberRoutineService.achieveMemberRoutine(memberId, routineId); | ||
return SuccessResponse.success(SuccessMessage.ACHIEVE_ROUTINE.getMessage(), response); | ||
} | ||
} |
Oops, something went wrong.