-
Notifications
You must be signed in to change notification settings - Fork 13
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
[feature/#204] [동아리 소개] API 구현
- Loading branch information
Showing
50 changed files
with
1,286 additions
and
181 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,36 @@ | ||
name: Gradle Build | ||
|
||
on: | ||
pull_request: | ||
branches: [dev, master, feature/*, refactor/* ] | ||
pull_request_target: | ||
types: [ opened, reopened, synchronize ] | ||
|
||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
environment: build_gradle | ||
|
||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up JDK 11 | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: '11' | ||
|
||
- name: Grant execute permission for gradlew | ||
run: chmod +x gradlew | ||
- name: Build with Gradle | ||
uses: gradle/gradle-build-action@4137be6a8bf7d7133955359dbd952c0ca73b1021 | ||
with: | ||
arguments: build | ||
env: | ||
IBAS_DEV_JWT_SECRET_KEY: ${{ secrets.IBAS_DEV_JWT_SECRET_KEY }} | ||
IBAS_DEV_KAKAO_CLIENT_ID: ${{ secrets.IBAS_DEV_KAKAO_CLIENT_ID }} | ||
IBAS_DEV_KAKAO_CLIENT_SECRET: ${{ secrets.IBAS_DEV_KAKAO_CLIENT_SECRET }} | ||
IBAS_DEV_NAVER_CLIENT_ID: ${{ secrets.IBAS_DEV_NAVER_CLIENT_ID }} | ||
IBAS_DEV_NAVER_CLIENT_SECRET: ${{ secrets.IBAS_DEV_NAVER_CLIENT_SECRET }} | ||
IBAS_DEV_GOOGLE_CLIENT_ID: ${{ secrets.IBAS_DEV_GOOGLE_CLIENT_ID }} | ||
IBAS_DEV_GOOGLE_CLIENT_SECRET: ${{ secrets.IBAS_DEV_GOOGLE_CLIENT_SECRET }} | ||
- uses: actions/checkout@v2 | ||
- name: Set up JDK 11 | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: '11' | ||
|
||
- name: Grant execute permission for gradlew | ||
run: chmod +x gradlew | ||
|
||
- name: Build with Gradle | ||
run: ./gradlew clean build | ||
env: | ||
IBAS_DEV_JWT_SECRET_KEY: ${{ secrets.IBAS_DEV_JWT_SECRET_KEY }} | ||
IBAS_DEV_KAKAO_CLIENT_ID: ${{ secrets.IBAS_DEV_KAKAO_CLIENT_ID }} | ||
IBAS_DEV_KAKAO_CLIENT_SECRET: ${{ secrets.IBAS_DEV_KAKAO_CLIENT_SECRET }} | ||
IBAS_DEV_NAVER_CLIENT_ID: ${{ secrets.IBAS_DEV_NAVER_CLIENT_ID }} | ||
IBAS_DEV_NAVER_CLIENT_SECRET: ${{ secrets.IBAS_DEV_NAVER_CLIENT_SECRET }} | ||
IBAS_DEV_GOOGLE_CLIENT_ID: ${{ secrets.IBAS_DEV_GOOGLE_CLIENT_ID }} | ||
IBAS_DEV_GOOGLE_CLIENT_SECRET: ${{ secrets.IBAS_DEV_GOOGLE_CLIENT_SECRET }} |
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
12 changes: 7 additions & 5 deletions
12
...in/board/domain/valueObject/Contents.java → ...ain/board/domain/valueObject/Content.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
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
60 changes: 60 additions & 0 deletions
60
resource-server/src/main/java/com/inhabas/api/domain/club/domain/entity/ClubHistory.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,60 @@ | ||
package com.inhabas.api.domain.club.domain.entity; | ||
|
||
import com.inhabas.api.auth.domain.oauth2.member.domain.entity.Member; | ||
import com.inhabas.api.domain.board.domain.valueObject.Content; | ||
import com.inhabas.api.domain.board.domain.valueObject.Title; | ||
import com.inhabas.api.domain.club.dto.SaveClubHistoryDto; | ||
import lombok.AccessLevel; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import org.springframework.data.annotation.CreatedDate; | ||
import org.springframework.data.jpa.domain.support.AuditingEntityListener; | ||
|
||
import javax.persistence.*; | ||
import java.time.LocalDateTime; | ||
|
||
@Entity | ||
@Table(name = "CLUB_HISTORY") | ||
@Getter | ||
@NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
@EntityListeners(AuditingEntityListener.class) | ||
public class ClubHistory { | ||
|
||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private Long id; | ||
|
||
@ManyToOne(fetch = FetchType.LAZY, optional = false) | ||
@JoinColumn(name = "USER_ID", foreignKey = @ForeignKey(name = "FK_MEMBER_OF_CLUB_HISTORY")) | ||
private Member member; | ||
|
||
@Embedded | ||
private Title title; | ||
|
||
@Embedded | ||
private Content content; | ||
|
||
@Column(name = "DATE_HISTORY", nullable = false, columnDefinition = "DATETIME(0)") | ||
private LocalDateTime dateHistory; | ||
|
||
@CreatedDate | ||
@Column(name = "DATE_CREATED", nullable = false, updatable = false, insertable = false, columnDefinition = "DATETIME(0) DEFAULT CURRENT_TIMESTAMP") | ||
private LocalDateTime dateCreated; | ||
|
||
@Builder | ||
public ClubHistory(Member member, Title title, Content content, LocalDateTime dateHistory) { | ||
this.member = member; | ||
this.title = title; | ||
this.content = content; | ||
this.dateHistory = dateHistory; | ||
} | ||
|
||
public void updateClubHistory(Member member, SaveClubHistoryDto saveClubHistoryDto) { | ||
this.member = member; | ||
this.title = new Title(saveClubHistoryDto.getTitle()); | ||
this.content = new Content(saveClubHistoryDto.getContent()); | ||
this.dateHistory = saveClubHistoryDto.getDateHistory(); | ||
} | ||
|
||
} |
53 changes: 53 additions & 0 deletions
53
resource-server/src/main/java/com/inhabas/api/domain/club/dto/ClubHistoryDto.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,53 @@ | ||
package com.inhabas.api.domain.club.dto; | ||
|
||
import com.fasterxml.jackson.annotation.JsonFormat; | ||
import com.inhabas.api.domain.club.domain.entity.ClubHistory; | ||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
import javax.validation.constraints.NotNull; | ||
import javax.validation.constraints.Positive; | ||
import java.time.LocalDateTime; | ||
|
||
@Getter | ||
@NoArgsConstructor | ||
public class ClubHistoryDto { | ||
|
||
@NotNull | ||
@Positive | ||
private Long id; | ||
|
||
@NotNull | ||
private String title; | ||
|
||
@NotNull | ||
private String content; | ||
|
||
@NotNull | ||
@Positive | ||
private Long writerId; | ||
|
||
@NotNull | ||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss") | ||
@Schema(type = "string", example = "2023-11-01T00:00:00") | ||
private LocalDateTime dateHistory; | ||
|
||
@Builder | ||
public ClubHistoryDto(Long id, String title, String content, Long writerId, LocalDateTime dateHistory) { | ||
this.id = id; | ||
this.title = title; | ||
this.content = content; | ||
this.writerId = writerId; | ||
this.dateHistory = dateHistory; | ||
} | ||
|
||
public ClubHistoryDto(ClubHistory clubHistory) { | ||
this.id = clubHistory.getId(); | ||
this.title = clubHistory.getTitle().getValue(); | ||
this.content = clubHistory.getContent().getValue(); | ||
this.writerId = clubHistory.getMember().getId(); | ||
this.dateHistory = clubHistory.getDateHistory(); | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
resource-server/src/main/java/com/inhabas/api/domain/club/dto/SaveClubHistoryDto.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.inhabas.api.domain.club.dto; | ||
|
||
import com.fasterxml.jackson.annotation.JsonFormat; | ||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
import javax.validation.constraints.NotNull; | ||
import java.time.LocalDateTime; | ||
|
||
@Getter | ||
@NoArgsConstructor | ||
public class SaveClubHistoryDto { | ||
|
||
private String title; | ||
|
||
private String content; | ||
|
||
@NotNull | ||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss") | ||
@Schema(type = "string", example = "2023-11-01T00:00:00") | ||
private LocalDateTime dateHistory; | ||
|
||
@Builder | ||
public SaveClubHistoryDto(String title, String content, LocalDateTime dateHistory) { | ||
this.title = title; | ||
this.content = content; | ||
this.dateHistory = dateHistory; | ||
} | ||
|
||
} |
7 changes: 7 additions & 0 deletions
7
...ce-server/src/main/java/com/inhabas/api/domain/club/repository/ClubHistoryRepository.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,7 @@ | ||
package com.inhabas.api.domain.club.repository; | ||
|
||
import com.inhabas.api.domain.club.domain.entity.ClubHistory; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
public interface ClubHistoryRepository extends JpaRepository<ClubHistory, Long> { | ||
} |
Oops, something went wrong.