forked from 9oormthon-univ/2024_DANPOONG_TEAM_5_BE
-
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.
feat: Team 도메인 수정 및 일급 컬렉션화 (9oormthon-univ#18)
* feat: 결제 기능 요구사항 반영 * feat: Team 도메인 수정 및 일급 컬렉션화 (#3)
- Loading branch information
1 parent
940fd85
commit 3fc8a96
Showing
6 changed files
with
108 additions
and
0 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
src/main/java/com/jangburich/domain/team/application/TeamService.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,13 @@ | ||
package com.jangburich.domain.team.application; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.stereotype.Service; | ||
import org.springframework.transaction.annotation.Transactional; | ||
|
||
@Service | ||
@Transactional(readOnly = true) | ||
@RequiredArgsConstructor | ||
public class TeamService { | ||
|
||
|
||
} |
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
23 changes: 23 additions & 0 deletions
23
src/main/java/com/jangburich/domain/team/domain/TeamLeader.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,23 @@ | ||
package com.jangburich.domain.team.domain; | ||
|
||
import jakarta.persistence.Embeddable; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.RequiredArgsConstructor; | ||
|
||
@Embeddable | ||
@Getter | ||
@NoArgsConstructor | ||
public class TeamLeader { | ||
private Long user_id; | ||
private String accountNumber; | ||
|
||
public TeamLeader(Long user_id, String accountNumber) { | ||
this.user_id = user_id; | ||
this.accountNumber = accountNumber; | ||
} | ||
|
||
public boolean isSameLeader(Long userId) { | ||
return this.user_id.equals(userId); | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
src/main/java/com/jangburich/domain/team/domain/TeamType.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.jangburich.domain.team.domain; | ||
|
||
public enum TeamType { | ||
INDIVIDUAL("개인"), | ||
GATHERING("모임"), | ||
FAMILY("가족"), | ||
COMPANY("회사"), | ||
CLUB("동아리"), | ||
ALUMNI("동호회"), | ||
STUDENT_ASSOCIATION("학생회"), | ||
OTHER("기타"); | ||
|
||
private final String description; | ||
|
||
TeamType(String description) { | ||
this.description = description; | ||
} | ||
|
||
public String getDescription() { | ||
return description; | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
src/main/java/com/jangburich/domain/team/dto/request/RegisterTeamRequest.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,4 @@ | ||
package com.jangburich.domain.team.dto.request; | ||
|
||
public record RegisterTeamRequest() { | ||
} |
30 changes: 30 additions & 0 deletions
30
src/main/java/com/jangburich/domain/team/presentation/TeamController.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.jangburich.domain.team.presentation; | ||
|
||
import com.jangburich.domain.team.application.TeamService; | ||
import com.jangburich.domain.team.dto.request.RegisterTeamRequest; | ||
import com.jangburich.global.payload.Message; | ||
import com.jangburich.global.payload.ResponseCustom; | ||
import io.swagger.v3.oas.annotations.tags.Tag; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.security.core.Authentication; | ||
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.RestController; | ||
|
||
@Tag(name = "Team", description = "Team API") | ||
@RestController | ||
@RequiredArgsConstructor | ||
@RequestMapping("/teams") | ||
public class TeamController { | ||
|
||
private final TeamService teamService; | ||
|
||
@PostMapping | ||
public ResponseCustom<Message> registerTeam( | ||
Authentication authentication, | ||
@RequestBody RegisterTeamRequest registerTeamRequest | ||
) { | ||
return ResponseCustom.OK(); | ||
} | ||
} |