Skip to content

Commit

Permalink
fix: merge conflict 해결
Browse files Browse the repository at this point in the history
  • Loading branch information
Sion99 committed Nov 8, 2023
2 parents 08003d3 + 0313270 commit 82476be
Show file tree
Hide file tree
Showing 37 changed files with 1,116 additions and 267 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle
name: Build Test

on:
pull_request:
branches:
- main

permissions:
pull-requests: read

jobs:
build:

runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'

- name: Make gradlew executable
run: chmod +x gradlew

- name: Create application.yml
run: |
mkdir -p ./src/main/resources
cd ./src/main/resources
echo "${{ secrets.APPLICATION }}" base64 -d > application.yml
- name: Create service-account-file.json
run: |
mkdir -p ./src/main/resources/firebase
cd ./src/main/resources/firebase
echo "${{ secrets.SERVICE_ACCOUNT_FILE }}" base64 -d > service-account-file.json
- name: Build with Gradle
run: ./gradlew clean build
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package com.uspray.uspray.DTO.category;

import com.uspray.uspray.domain.Category;
import com.uspray.uspray.domain.Member;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import org.jetbrains.annotations.NotNull;

@Getter
@NoArgsConstructor
@AllArgsConstructor
@Builder
@Schema(description = "카테고리 DTO")
public class CategoryRequestDto {

@NotNull
@Schema(description = "카테고리 이름", example = "카테고리 이름")
private String name;

@NotNull
@Schema(description = "카테고리 색상", example = "#FFFFFF")
private String color;


public Category toEntity(Member member) {
return Category.builder()
.name(name)
.color(color)
.member(member)
.build();
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package com.uspray.uspray.DTO.category;

import com.uspray.uspray.domain.Category;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;

@Getter
@AllArgsConstructor
@Builder
@NoArgsConstructor
public class CategoryResponseDto {

@Schema(description = "카테고리 ID", example = "1")
private Long id;

@Schema(description = "카테고리 소유자 ID", example = "1")
private Long memberId;

@Schema(description = "카테고리 이름", example = "카테고리 이름")
private String name;

@Schema(description = "카테고리 색상", example = "#FFFFFF")
private String color;

@Schema(description = "카테고리 순서", example = "1")
private Integer order;

public static CategoryResponseDto of(Category category) {
return new CategoryResponseDto(category.getId(), category.getMember().getId(),
category.getName(), category.getColor(), category.getOrder());
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package com.uspray.uspray.DTO.grouppray;

import lombok.Data;

@Data
public class GroupPrayRequestDto {

private Long groupId;
private String content;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package com.uspray.uspray.DTO.grouppray;

import com.querydsl.core.annotations.QueryProjection;
import lombok.Data;

@Data
public class GroupPrayResponseDto {

private Long groupPrayId;
private String content;
private Boolean isOwner = false;
private Long authorId;
private Integer liked;

@QueryProjection
public GroupPrayResponseDto(Long groupPrayId, String content, Long authorId, Integer liked) {
this.groupPrayId = groupPrayId;
this.content = content;
this.authorId = authorId;
this.liked = liked;
}

public void changeOwner() {
this.isOwner = true;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package com.uspray.uspray.DTO.grouppray;

import lombok.Data;

@Data
public class GroupPrayUpdateDto {
private Long groupPrayId;
private String content;
}
20 changes: 20 additions & 0 deletions src/main/java/com/uspray/uspray/DTO/pray/PrayListResponseDto.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package com.uspray.uspray.DTO.pray;

import com.uspray.uspray.DTO.pray.request.PrayResponseDto;
import io.swagger.v3.oas.annotations.media.Schema;
import java.util.List;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;

@Getter
@AllArgsConstructor
@Builder
@NoArgsConstructor
public class PrayListResponseDto {

@Schema(description = "카테고리 ID", example = "1")
private Long categoryId;
private List<PrayResponseDto> prays;
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.uspray.uspray.DTO.pray.request;

import com.uspray.uspray.Enums.PrayType;
import com.uspray.uspray.domain.Category;
import com.uspray.uspray.domain.Member;
import com.uspray.uspray.domain.Pray;
import io.swagger.v3.oas.annotations.media.Schema;
Expand All @@ -25,11 +27,17 @@ public class PrayRequestDto {
@Schema(description = "기도제목 마감일", example = "2025-01-01")
private LocalDate deadline;

public Pray toEntity(Member member) {
@NotNull
@Schema(description = "기도제목 카테고리", example = "1")
private Long categoryId;

public Pray toEntity(Member member, Category category, PrayType prayType) {
return Pray.builder()
.content(content)
.deadline(deadline)
.member(member)
.category(category)
.prayType(prayType)
.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,12 @@ public class PrayResponseDto {
@Schema(description = "기도제목 생성일", example = "2021-01-01 00:00:00")
private LocalDateTime createdAt;

@Schema(description = "기도제목 카테고리", example = "1")
private Long categoryId;

public static PrayResponseDto of(Pray pray) {
return new PrayResponseDto(pray.getId(), pray.getContent(), pray.getDeadline(),
pray.getCount(), pray.getCreatedAt());
pray.getCount(), pray.getCreatedAt(), pray.getCategory().getId());
}

}
15 changes: 15 additions & 0 deletions src/main/java/com/uspray/uspray/Enums/PrayType.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.uspray.uspray.Enums;

import lombok.AccessLevel;
import lombok.Getter;
import lombok.RequiredArgsConstructor;

@Getter
@RequiredArgsConstructor(access = AccessLevel.PRIVATE)
public enum PrayType {
SHARED("공유 기도"),
PERSONAL("개인 기도"),
GROUP("그룹 기도"),
;
private final String title;
}
13 changes: 11 additions & 2 deletions src/main/java/com/uspray/uspray/InitDb.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package com.uspray.uspray;

import com.uspray.uspray.Enums.Authority;
import com.uspray.uspray.Enums.PrayType;
import com.uspray.uspray.domain.Category;
import com.uspray.uspray.domain.History;
import com.uspray.uspray.domain.Member;
import com.uspray.uspray.domain.Pray;
Expand Down Expand Up @@ -43,18 +45,25 @@ public void dbInit() {
.build();
em.persist(member);

Category category = Category.builder()
.name("기타 카테고리")
.color("#FFFFFF")
.member(member)
.build();
em.persist(category);

Pray pray = Pray.builder()
.content("테스트 기도")
.deadline(LocalDate.parse("2025-01-01"))
.member(member)
.category(category)
.prayType(PrayType.PERSONAL)
.build();

em.persist(pray);

History history = History.builder()
.pray(pray)
.build();

em.persist(history);
}

Expand Down
Loading

0 comments on commit 82476be

Please sign in to comment.