Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[REFACTOR] ERD/Architecture 리팩토링 #324

Merged
merged 72 commits into from
Aug 23, 2024
Merged
Show file tree
Hide file tree
Changes from 57 commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
cfe0235
[REFACTOR] refactor project architecture
thguss Aug 19, 2024
20f0ca6
[REFACTOR] refactor project architecture
thguss Aug 19, 2024
52732d1
[REFACTOR] refactor entity
thguss Aug 19, 2024
cf4b43b
[ADD] added column
thguss Aug 19, 2024
67361cb
[DELETE] deleted themeV1
thguss Aug 19, 2024
c15d529
[DELETE] deleted themeV1
thguss Aug 19, 2024
8049fec
[DELETE] deleted themeV1
thguss Aug 19, 2024
ec0616b
[DELETE] deleted themeV1
thguss Aug 19, 2024
394e545
[REFACTOR] get basic themes api
thguss Aug 19, 2024
633af95
[DELETE] deleted by v1
thguss Aug 19, 2024
b087858
[DELETE] deleted by v1
thguss Aug 19, 2024
5ae8554
[REFACTOR] routine api
thguss Aug 19, 2024
62bb836
Merge pull request #325 from Team-Sopetit/refactor/#320-erd-architect…
thguss Aug 19, 2024
cf763c1
[REFACTOR] memberRoutine api
thguss Aug 20, 2024
bf0e3f8
[DELETE] deleted v1
thguss Aug 20, 2024
16010a0
[REFACTOR] refactor memberRoutine scheduler
thguss Aug 20, 2024
a070041
Merge pull request #326 from Team-Sopetit/refactor/#320-erd-architect…
thguss Aug 20, 2024
ca8d901
[DELETE] deleted v1
thguss Aug 20, 2024
676ff6f
[DELETE] deleted v1
thguss Aug 20, 2024
0c577e1
[DELETE] deleted v1 message
thguss Aug 20, 2024
49924b8
[REFACTOR] refactor challenge api
thguss Aug 20, 2024
1dd4813
Merge pull request #327 from Team-Sopetit/refactor/#320-erd-architect…
thguss Aug 20, 2024
8685b71
[REFACTOR] refactor conversation api
thguss Aug 20, 2024
7cea0fd
Merge pull request #328 from Team-Sopetit/refactor/#320-erd-architect…
thguss Aug 20, 2024
332d095
[DELETE] deleted v1
thguss Aug 20, 2024
3d75122
[DELETE] deleted v1
thguss Aug 20, 2024
ed5c50a
[REFACTOR] refactor member api
thguss Aug 20, 2024
23780aa
[REFACTOR] refactor member api
thguss Aug 20, 2024
679ecbf
Merge pull request #329 from Team-Sopetit/refactor/#320-erd-architect…
thguss Aug 20, 2024
6377aaa
[REFACTOR] refactor memberMission api
thguss Aug 21, 2024
b4bc7db
Merge pull request #330 from Team-Sopetit/refactor/#320-erd-architect…
thguss Aug 21, 2024
ed1c5b6
[DELETE] delete auth service dto
Chan531 Aug 21, 2024
da7be66
[REFACTOR] refactor auth api
Chan531 Aug 21, 2024
9e31e0c
[REFACTOR] refactor adapter
Chan531 Aug 21, 2024
ec0827d
[ADD] add auth successmessage
Chan531 Aug 21, 2024
b572577
[REFACTOR] refactor auth dto
Chan531 Aug 21, 2024
57b1320
[REFACTOR] refactor auth service
Chan531 Aug 21, 2024
1cacedb
[FIX] fix conflict
Chan531 Aug 21, 2024
d238f47
[ADD] add unauthorized exception
Chan531 Aug 21, 2024
0cfcdbd
[REFACTOR] refactor external api
Chan531 Aug 21, 2024
a7408ad
[REFACTOR] refactor auth service
Chan531 Aug 21, 2024
08200d3
[CHORE] apply convention
Chan531 Aug 21, 2024
e796212
[REFACTOR] apply dto convention
Chan531 Aug 21, 2024
dc94c22
[CHORE] delete unused method
Chan531 Aug 21, 2024
fa3c987
[REFACTOR] refactor auth method
Chan531 Aug 21, 2024
8145e8d
Merge pull request #331 from Team-Sopetit/refactor/#320-chan
Chan531 Aug 21, 2024
c150882
[DELETE] deleted unused class
thguss Aug 21, 2024
1fb8c5e
[ADD] add maker success message
Chan531 Aug 22, 2024
e226d30
[REFACTOR] refactor maker api & dto
Chan531 Aug 22, 2024
7bf087e
[CHORE] coding convention
Chan531 Aug 22, 2024
c56808b
[REFACTOR] add find theme & maker method
Chan531 Aug 22, 2024
b4c3173
[DELETE] delete unused method
Chan531 Aug 22, 2024
0d63ce5
[REFACTOR] refactor maker service
Chan531 Aug 22, 2024
aa75770
Merge pull request #332 from Team-Sopetit/refactor/#320-chan
thguss Aug 22, 2024
4aedda9
[CHORE] updated for ci success
thguss Aug 22, 2024
22dd9a8
[CHORE] update test
Chan531 Aug 22, 2024
72e96c4
[FIX] fix ci fail
Chan531 Aug 22, 2024
56e9c5f
[FIX] revoke to origin response dto
thguss Aug 22, 2024
6c2fb04
[CHORE] update dto data
Chan531 Aug 22, 2024
a236b9a
[FIX] fixed error
thguss Aug 22, 2024
8fcdb5a
[FIX] fixed invalid table name
thguss Aug 22, 2024
e8bcb9a
[FIX] register service bean
thguss Aug 22, 2024
2b56855
[DELETE] deleted comment
thguss Aug 22, 2024
ae926dd
[FIX] updated to native query
thguss Aug 22, 2024
259c9e4
[ADD] added flush
thguss Aug 22, 2024
d395a4c
[FIX] fixed counting achievementCount
thguss Aug 22, 2024
e4189fb
[FIX] fixed repository method
thguss Aug 22, 2024
da41261
[ADD] added giving rainbow cotton
thguss Aug 22, 2024
2bca551
[FIX] updated native query
thguss Aug 22, 2024
093c842
[FIX] updated native query
thguss Aug 22, 2024
866144b
[FIX] update querydsl
Chan531 Aug 23, 2024
9d2d530
[FIX] fix logout issue
Chan531 Aug 23, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.soptie.server.common.config;
package com.soptie.server.api.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
Expand All @@ -11,8 +11,8 @@
import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
import org.springframework.security.web.util.matcher.AntPathRequestMatcher;

import com.soptie.server.auth.jwt.CustomJwtAuthenticationEntryPoint;
import com.soptie.server.auth.jwt.JwtAuthenticationFilter;
import com.soptie.server.api.web.jwt.CustomJwtAuthenticationEntryPoint;
import com.soptie.server.api.web.jwt.JwtAuthenticationFilter;

import lombok.RequiredArgsConstructor;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.soptie.server.common.config;
package com.soptie.server.api.config;

import static io.swagger.v3.oas.models.security.SecurityScheme.Type.*;

Expand Down
66 changes: 66 additions & 0 deletions src/main/java/com/soptie/server/api/controller/AuthApi.java
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 src/main/java/com/soptie/server/api/controller/ChallengeApi.java
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 src/main/java/com/soptie/server/api/controller/MakerApi.java
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 src/main/java/com/soptie/server/api/controller/MemberApi.java
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);
}
}
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 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());
}
}
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());
}
}
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);
}
}
Loading
Loading