Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions .github/workflows/application-CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: CI

on:
pull_request:
branches: [ "main" ]

jobs:
build:
runs-on: ubuntu-22.04

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

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

- name: create application.properties
run: |
## create application.properties
mkdir -p ./src/main/resources
cd ./src/main/resources

touch ./application.properties

echo "${{ secrets.APPLICATION }}" >> ./application.properties

cat ./application.properties
shell: bash

- name: build
working-directory: MathCaptain/weakness
run: |
chmod +x gradlew
./gradlew build -x test
shell: bash
17 changes: 16 additions & 1 deletion .github/workflows/docker-image-ec2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,24 @@ jobs:
- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: 'temurin' # OpenJDK 배포판
distribution: 'corretto'
java-version: '17' # Java 버전 (Spring Boot 3.x의 경우 Java 17 이상 필요)

- name: Create application.properties
run: |
# application.properties 파일 생성
mkdir -p ./src/main/resources
cd ./src/main/resources

# application.properties 파일 생성
touch ./application.properties

# GitHub-Actions 에서 설정한 값을 application.properties 파일에 쓰기
echo "${{ secrets.APPLICATION }}" >> ./application.properties

# application.properties 파일 확인
cat ./application.properties

# 3. Gradle 캐시 설정 (빌드 속도 향상)
- name: Cache Gradle packages
uses: actions/cache@v3
Expand Down
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,4 @@ MathCaptain/weakness.trace.db
*.trace.db

### Secret key ###
MathCaptain/weakness/src/main/resources/application.yml
MathCaptain/weakness/src/main/resources/application-jwt.yml
MathCaptain/weakness/src/main/resources/application.properties
12 changes: 12 additions & 0 deletions MathCaptain/weakness/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ plugins {
id 'io.spring.dependency-management' version '1.1.6'
}

ext {
springAiVersion = "1.0.0-M6"
}

group = 'MathCaptain'
version = '0.0.1-SNAPSHOT'

Expand Down Expand Up @@ -35,6 +39,8 @@ dependencies {
implementation 'nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect'
implementation 'io.jsonwebtoken:jjwt-api:0.12.3'
implementation 'commons-codec:commons-codec:1.5'
implementation 'org.springframework.ai:spring-ai-openai-spring-boot-starter'
implementation 'com.h2database:h2'
runtimeOnly 'mysql:mysql-connector-java:8.0.33'
implementation 'com.auth0:java-jwt:3.13.0'
runtimeOnly 'io.jsonwebtoken:jjwt-impl:0.12.3'
Expand All @@ -51,6 +57,12 @@ dependencies {
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.0'
}

dependencyManagement {
imports {
mavenBom "org.springframework.ai:spring-ai-bom:$springAiVersion"
}
}

tasks.named('test') {
useJUnitPlatform()
}
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
package MathCaptain.weakness;

import MathCaptain.weakness.Group.domain.Group;
import MathCaptain.weakness.Group.domain.RelationBetweenUserAndGroup;
import MathCaptain.weakness.Group.enums.CategoryStatus;
import MathCaptain.weakness.Group.enums.GroupRole;
import MathCaptain.weakness.Group.repository.GroupRepository;
import MathCaptain.weakness.Group.repository.RelationRepository;
import MathCaptain.weakness.Record.domain.ActivityRecord;
import MathCaptain.weakness.Record.repository.RecordRepository;
import MathCaptain.weakness.Recruitment.domain.Comment;
import MathCaptain.weakness.Recruitment.domain.Recruitment;
import MathCaptain.weakness.Recruitment.enums.RecruitmentStatus;
import MathCaptain.weakness.Recruitment.repository.CommentRepository;
import MathCaptain.weakness.Recruitment.repository.RecruitmentRepository;
import MathCaptain.weakness.User.domain.Users;
import MathCaptain.weakness.User.repository.UserRepository;
import MathCaptain.weakness.domain.Group.entity.Group;
import MathCaptain.weakness.domain.Group.entity.RelationBetweenUserAndGroup;
import MathCaptain.weakness.domain.Group.enums.CategoryStatus;
import MathCaptain.weakness.domain.Group.enums.GroupRole;
import MathCaptain.weakness.domain.Group.repository.GroupRepository;
import MathCaptain.weakness.domain.Group.repository.RelationRepository;
import MathCaptain.weakness.domain.Record.entity.ActivityRecord;
import MathCaptain.weakness.domain.Record.repository.RecordRepository;
import MathCaptain.weakness.domain.Recruitment.entity.Comment;
import MathCaptain.weakness.domain.Recruitment.entity.Recruitment;
import MathCaptain.weakness.domain.Recruitment.enums.RecruitmentStatus;
import MathCaptain.weakness.domain.Recruitment.repository.CommentRepository;
import MathCaptain.weakness.domain.Recruitment.repository.RecruitmentRepository;
import MathCaptain.weakness.domain.User.entity.Users;
import MathCaptain.weakness.domain.User.repository.UserRepository;
import jakarta.annotation.PostConstruct;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration;
import org.springframework.data.jpa.repository.config.EnableJpaAuditing;

@EnableJpaAuditing
@SpringBootApplication(exclude = SecurityAutoConfiguration.class)
public class WeaknessApplication {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package MathCaptain.weakness.Group.Login;
package MathCaptain.weakness.domain.Group.Login;

import jakarta.servlet.ServletException;
import jakarta.servlet.http.HttpServletRequest;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,26 +1,21 @@
package MathCaptain.weakness.Group.Login;

import MathCaptain.weakness.Group.dto.response.GroupResponseDto;
import MathCaptain.weakness.Group.repository.RelationRepository;
import MathCaptain.weakness.Group.service.GroupService;
import MathCaptain.weakness.global.Api.ApiResponse;
import MathCaptain.weakness.global.Security.jwt.JwtService;
import MathCaptain.weakness.User.repository.UserRepository;
package MathCaptain.weakness.domain.Group.Login;

import MathCaptain.weakness.domain.Group.repository.RelationRepository;
import MathCaptain.weakness.domain.Group.service.GroupService;
import MathCaptain.weakness.global.auth.jwt.JwtService;
import MathCaptain.weakness.domain.User.repository.UserRepository;
import com.fasterxml.jackson.databind.ObjectMapper;
import jakarta.servlet.ServletException;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.transaction.Transactional;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.ResponseEntity;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.web.authentication.SimpleUrlAuthenticationSuccessHandler;
import org.springframework.web.servlet.view.RedirectView;

import java.io.IOException;
import java.util.List;

@Slf4j
@RequiredArgsConstructor
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package MathCaptain.weakness.Group.Login;
package MathCaptain.weakness.domain.Group.Login;

import MathCaptain.weakness.User.domain.UserDetailsImpl;
import MathCaptain.weakness.User.domain.Users;
import MathCaptain.weakness.domain.User.entity.UserDetailsImpl;
import MathCaptain.weakness.domain.User.entity.Users;
import MathCaptain.weakness.global.annotation.LoginUser;
import org.springframework.core.MethodParameter;
import org.springframework.security.core.Authentication;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,16 @@
package MathCaptain.weakness.Group.controller;

import MathCaptain.weakness.Group.dto.request.GroupJoinRequestDto;
import MathCaptain.weakness.Group.dto.request.GroupSearchRequestDto;
import MathCaptain.weakness.Group.dto.request.GroupUpdateRequestDto;
import MathCaptain.weakness.Group.dto.response.GroupDetailResponseDto;
import MathCaptain.weakness.Group.dto.response.GroupMemberListResponseDto;
import MathCaptain.weakness.Group.dto.response.GroupResponseDto;
import MathCaptain.weakness.Group.dto.response.RelationResponseDto;
import MathCaptain.weakness.Group.enums.RequestStatus;
import MathCaptain.weakness.Group.service.GroupJoinService;
import MathCaptain.weakness.Notification.service.NotificationService;
import MathCaptain.weakness.User.domain.UserDetailsImpl;
import MathCaptain.weakness.User.domain.Users;
import MathCaptain.weakness.User.dto.response.UserResponseDto;
import MathCaptain.weakness.Group.service.GroupService;
import MathCaptain.weakness.Group.dto.request.GroupCreateRequestDto;
import MathCaptain.weakness.Group.service.RelationService;
package MathCaptain.weakness.domain.Group.controller;

import MathCaptain.weakness.domain.Group.dto.request.GroupSearchRequestDto;
import MathCaptain.weakness.domain.Group.dto.request.GroupUpdateRequestDto;
import MathCaptain.weakness.domain.Group.dto.response.GroupDetailResponseDto;
import MathCaptain.weakness.domain.Group.dto.response.GroupMemberListResponseDto;
import MathCaptain.weakness.domain.Group.dto.response.GroupResponseDto;
import MathCaptain.weakness.domain.Group.dto.response.RelationResponseDto;
import MathCaptain.weakness.domain.User.entity.Users;
import MathCaptain.weakness.domain.User.dto.response.UserResponseDto;
import MathCaptain.weakness.domain.Group.service.GroupService;
import MathCaptain.weakness.domain.Group.dto.request.GroupCreateRequestDto;
import MathCaptain.weakness.domain.Group.service.RelationService;
import MathCaptain.weakness.global.Api.ApiResponse;
import MathCaptain.weakness.global.annotation.LoginUser;
import jakarta.servlet.http.HttpServletResponse;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
package MathCaptain.weakness.Group.controller;
package MathCaptain.weakness.domain.Group.controller;

import MathCaptain.weakness.Group.dto.request.GroupJoinRequestDto;
import MathCaptain.weakness.Group.enums.RequestStatus;
import MathCaptain.weakness.Group.service.GroupJoinService;
import MathCaptain.weakness.Group.service.GroupService;
import MathCaptain.weakness.Group.service.RelationService;
import MathCaptain.weakness.Notification.service.NotificationService;
import MathCaptain.weakness.User.domain.Users;
import MathCaptain.weakness.domain.Group.dto.request.GroupJoinRequestDto;
import MathCaptain.weakness.domain.Group.enums.RequestStatus;
import MathCaptain.weakness.domain.Group.service.GroupJoinService;
import MathCaptain.weakness.domain.Group.service.RelationService;
import MathCaptain.weakness.domain.Notification.service.NotificationService;
import MathCaptain.weakness.domain.User.entity.Users;
import MathCaptain.weakness.global.Api.ApiResponse;
import MathCaptain.weakness.global.annotation.LoginUser;
import jakarta.validation.Valid;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package MathCaptain.weakness.Group.dto.request;
package MathCaptain.weakness.domain.Group.dto.request;

import MathCaptain.weakness.Group.enums.CategoryStatus;
import MathCaptain.weakness.domain.Group.enums.CategoryStatus;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import lombok.Builder;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package MathCaptain.weakness.Group.dto.request;
package MathCaptain.weakness.domain.Group.dto.request;

import jakarta.validation.constraints.NotNull;
import lombok.Builder;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package MathCaptain.weakness.Group.dto.request;
package MathCaptain.weakness.domain.Group.dto.request;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package MathCaptain.weakness.Group.dto.request;
package MathCaptain.weakness.domain.Group.dto.request;

import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package MathCaptain.weakness.Group.dto.response;
package MathCaptain.weakness.domain.Group.dto.response;

import MathCaptain.weakness.Group.enums.CategoryStatus;
import MathCaptain.weakness.domain.Group.enums.CategoryStatus;
import lombok.Builder;
import lombok.Data;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package MathCaptain.weakness.Group.dto.response;
package MathCaptain.weakness.domain.Group.dto.response;

import lombok.Builder;
import lombok.Data;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package MathCaptain.weakness.Group.dto.response;
package MathCaptain.weakness.domain.Group.dto.response;

import MathCaptain.weakness.Group.enums.GroupRole;
import MathCaptain.weakness.domain.Group.enums.GroupRole;
import jakarta.validation.constraints.NotNull;
import lombok.Builder;
import lombok.Data;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package MathCaptain.weakness.Group.dto.response;
package MathCaptain.weakness.domain.Group.dto.response;

import MathCaptain.weakness.Group.enums.CategoryStatus;
import MathCaptain.weakness.domain.Group.enums.CategoryStatus;
import lombok.Builder;
import lombok.Data;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package MathCaptain.weakness.Group.dto.response;
package MathCaptain.weakness.domain.Group.dto.response;

import MathCaptain.weakness.Group.enums.GroupRole;
import MathCaptain.weakness.User.dto.response.UserResponseDto;
import MathCaptain.weakness.domain.Group.enums.GroupRole;
import MathCaptain.weakness.domain.User.dto.response.UserResponseDto;
import lombok.Builder;
import lombok.Data;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package MathCaptain.weakness.Group.dto.response;
package MathCaptain.weakness.domain.Group.dto.response;

import MathCaptain.weakness.Group.enums.GroupRole;
import MathCaptain.weakness.domain.Group.enums.GroupRole;
import lombok.Builder;
import lombok.Data;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package MathCaptain.weakness.Group.domain;
package MathCaptain.weakness.domain.Group.entity;

import MathCaptain.weakness.Group.dto.request.GroupUpdateRequestDto;
import MathCaptain.weakness.Group.enums.CategoryStatus;
import MathCaptain.weakness.Recruitment.domain.Recruitment;
import MathCaptain.weakness.User.domain.Users;
import MathCaptain.weakness.domain.Group.dto.request.GroupUpdateRequestDto;
import MathCaptain.weakness.domain.Group.enums.CategoryStatus;
import MathCaptain.weakness.domain.Recruitment.entity.Recruitment;
import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.CreatedDate;

import java.time.DayOfWeek;
import java.time.LocalDate;
Expand Down Expand Up @@ -53,6 +53,7 @@ public class Group {
@Column(name = "hashtag")
private List<String> hashtags;

@CreatedDate
private LocalDate createDate;

private String groupImageUrl;
Expand All @@ -69,7 +70,6 @@ public class Group {

@PrePersist
protected void onCreate() {
this.createDate = LocalDate.now();

if (this.weeklyGoalAchieveMap == null) {
this.weeklyGoalAchieveMap = new EnumMap<>(DayOfWeek.class);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package MathCaptain.weakness.Group.domain;
package MathCaptain.weakness.domain.Group.entity;

import MathCaptain.weakness.Group.enums.GroupRole;
import MathCaptain.weakness.Group.enums.RequestStatus;
import MathCaptain.weakness.User.domain.Users;
import MathCaptain.weakness.domain.Group.enums.GroupRole;
import MathCaptain.weakness.domain.Group.enums.RequestStatus;
import MathCaptain.weakness.domain.User.entity.Users;
import jakarta.persistence.*;
import lombok.*;
import org.hibernate.validator.constraints.Range;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package MathCaptain.weakness.Group.enums;
package MathCaptain.weakness.domain.Group.enums;

public enum CategoryStatus {
FITNESS,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package MathCaptain.weakness.Group.enums;
package MathCaptain.weakness.domain.Group.enums;

public enum GroupRole {
LEADER,
Expand Down
Loading