-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #88 from JNU-econovation/be
[FEAT/BE] term 1 기능
- Loading branch information
Showing
43 changed files
with
496 additions
and
163 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 |
---|---|---|
@@ -0,0 +1,72 @@ | ||
# github repository actions 페이지에 나타날 이름 | ||
name: Backend CI | ||
|
||
# event trigger | ||
# main 브랜치에 push, PR이 되었을 때 workflow 실행 | ||
on: | ||
push: | ||
branches: [ "main","be" ] | ||
paths : 'BE/**' | ||
pull_request: | ||
branches: [ "main","be" ] | ||
paths : 'BE/**' | ||
|
||
defaults: | ||
run: | ||
working-directory: BE/eeos | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
# JDK setting : github actions에서 사용할 JDK 설정 | ||
- name: Set up JDK 17 | ||
- uses: actions/checkout@v3 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
|
||
# gradlew에 실행 권한을 부여합니다. | ||
- name: Grant execute permisson for gradlew | ||
run: chmod +x gradlew | ||
shell : bash | ||
|
||
# gradle caching - 빌드 시간 향상 | ||
- name: Gradle Caching | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.gradle/caches | ||
~/.gradle/wrapper | ||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | ||
restore-keys: | | ||
${{ runner.os }}-gradle- | ||
# gradle build | ||
- name: Build with Gradle | ||
working-directory : ./be/overflow | ||
run: ./gradlew build -x test | ||
|
||
- name: 테스트 결과를 PR에 코멘트로 등록합니다 | ||
uses: EnricoMi/publish-unit-test-result-action@v1 | ||
if: always() | ||
with: | ||
files: '**/build/test-results/test/TEST-*.xml' | ||
|
||
- name: 테스트 실패 시, 실패한 코드 라인에 Check 코멘트를 등록합니다 | ||
uses: mikepenz/action-junit-report@v3 | ||
if: always() | ||
with: | ||
report_paths: '**/build/test-results/test/TEST-*.xml' | ||
token: ${{ github.token }} | ||
|
||
- name: build 실패 시 Slack으로 알립니다 | ||
uses: 8398a7/action-slack@v3 | ||
with: | ||
status: ${{ job.status }} | ||
author_name: 백엔드 빌드 실패 알림 | ||
fields: repo, message, commit, author, action, eventName, ref, workflow, job, took | ||
env: | ||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | ||
if: failure() |
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,16 +1,14 @@ | ||
FROM openjdk:17-oracle | ||
COPY gradlew . | ||
COPY gradle gradle | ||
COPY build.gradle . | ||
COPY settings.gradle . | ||
COPY src src | ||
RUN chmod +x ./gradlew | ||
RUN ./gradlew build -x test | ||
# 프로젝트 소스 폴더 복사 | ||
COPY src src | ||
# gradlew 빌드 | ||
RUN ./gradlew bootjar | ||
ARG JAR_FILE=/build/libs/*.jar | ||
RUN mkdir -p /logs | ||
|
||
ENV PROFILE defaultgi | ||
ENV TZ=Asia/Seoul | ||
|
||
ARG JAVA_OPTS | ||
|
||
ARG RELEASE_VERSION | ||
ENV DD_VERSION=${RELEASE_VERSION} | ||
|
||
ARG JAR_FILE="./build/libs/*.jar" | ||
COPY ${JAR_FILE} app.jar | ||
EXPOSE 8080 | ||
ENTRYPOINT ["java", "-jar", "/*.jar"] | ||
ENTRYPOINT ["java", "-jar", "/app.jar"] |
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
9 changes: 9 additions & 0 deletions
9
BE/eeos/resources/local-develop-environment/mysql-conf.d/character.cnf
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,9 @@ | ||
[client] | ||
default-character-set = utf8mb4 | ||
|
||
[mysql] | ||
default-character-set = utf8mb4 | ||
|
||
[mysqld] | ||
character-set-client-handshake = FALSE | ||
character-set-server = utf8mb4 |
40 changes: 30 additions & 10 deletions
40
BE/eeos/resources/local-develop-environment/mysql-init.d/01_create_table.sql
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,24 +1,44 @@ | ||
use eeos; | ||
|
||
create table program | ||
( | ||
program_id bigint not null auto_increment, | ||
created_date datetime not null, | ||
is_deleted boolean not null, | ||
updated_date datetime not null, | ||
program_content varchar(255) not null, | ||
program_date timestamp not null, | ||
program_content TEXT not null, | ||
program_date TIMESTAMP not null, | ||
program_title varchar(255) not null, | ||
primary key (program_id) | ||
) engine = InnoDB; | ||
|
||
create table member | ||
( | ||
member_id bigint not null auto_increment, | ||
created_date datetime not null, | ||
is_deleted boolean not null, | ||
updated_date datetime not null, | ||
member_name varchar(255) not null, | ||
member_generation int not null, | ||
member_id bigint not null auto_increment, | ||
created_date datetime not null, | ||
is_deleted boolean not null, | ||
updated_date datetime not null, | ||
member_name varchar(255) not null, | ||
member_generation BIGINT not null, | ||
primary key (member_id) | ||
) engine = InnoDB; | ||
) engine = InnoDB; | ||
|
||
create table attend | ||
( | ||
attend_id bigint not null auto_increment, | ||
created_date datetime not null, | ||
is_deleted boolean not null, | ||
updated_date datetime not null, | ||
attend_program_id BIGINT not null, | ||
attend_member_id BIGINT not null, | ||
attend_status VARCHAR(40) not null, | ||
primary key (attend_id) | ||
) engine = InnoDB; | ||
|
||
ALTER TABLE member | ||
ADD INDEX idx_generation_name (member_generation, member_name); | ||
|
||
ALTER TABLE attend | ||
ADD INDEX idx_program (attend_program_id); | ||
|
||
ALTER TABLE program | ||
ADD INDEX idx_program_date (program_date); |
34 changes: 10 additions & 24 deletions
34
BE/eeos/resources/local-develop-environment/mysql-init.d/02_add.data.sql
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,28 +1,14 @@ | ||
use eeos; | ||
|
||
insert into program (created_date, is_deleted, updated_date, program_content, program_date , program_title) | ||
values | ||
('2023-10-16 16:30:00.000000', false, '2023-10-16 16:30:00.000000', '프로그램 내용 1', '2023-10-16 16:30:01.000000', '프로그램 제목 1'), | ||
('2023-10-16 16:31:00.000000', false, '2023-10-16 16:31:00.000000', '프로그램 내용 2', '2023-10-16 16:31:02.000000', '프로그램 제목 2'), | ||
('2023-10-16 16:32:00.000000', false, '2023-10-16 16:32:00.000000', '프로그램 내용 3', '2023-10-16 16:32:03.000000', '프로그램 제목 3'), | ||
('2023-10-16 16:33:00.000000', false, '2023-10-16 16:33:00.000000', '프로그램 내용 4', '2023-10-16 16:33:04.000000', '프로그램 제목 4'), | ||
('2023-10-16 16:34:00.000000', false, '2023-10-16 16:34:00.000000', '프로그램 내용 5', '2023-10-16 16:34:05.000000', '프로그램 제목 5'), | ||
('2023-10-16 16:35:00.000000', false, '2023-10-16 16:35:00.000000', '프로그램 내용 6', '2023-10-16 16:35:06.000000', '프로그램 제목 6'), | ||
('2023-10-16 16:36:00.000000', false, '2023-10-16 16:36:00.000000', '프로그램 내용 7', '2023-10-16 16:36:07.000000', '프로그램 제목 7'), | ||
('2023-10-16 16:37:00.000000', false, '2023-10-16 16:37:00.000000', '프로그램 내용 8', '2023-10-16 16:37:08.000000', '프로그램 제목 8'), | ||
('2023-10-16 16:38:00.000000', false, '2023-10-16 16:38:00.000000', '프로그램 내용 9', '2023-10-16 16:38:09.000000', '프로그램 제목 9'), | ||
('2023-10-16 16:39:00.000000', false, '2023-10-16 16:39:00.000000', '프로그램 내용 10', '2023-10-16 16:39:10.000000', '프로그램 제목 10'); | ||
|
||
|
||
insert into member (created_date, is_deleted, updated_date, member_name, member_generation) | ||
values | ||
('2023-10-16 16:40:00', false, '2023-10-16 16:40:00', '멤버 1', 20), | ||
('2023-10-16 16:41:00', false, '2023-10-16 16:41:00', '멤버 2', 21), | ||
('2023-10-16 16:42:00', false, '2023-10-16 16:42:00', '멤버 3', 23), | ||
('2023-10-16 16:43:00', false, '2023-10-16 16:43:00', '멤버 4', 29), | ||
('2023-10-16 16:44:00', false, '2023-10-16 16:44:00', '멤버 5', 19), | ||
('2023-10-16 16:45:00', false, '2023-10-16 16:45:00', '멤버 6', 12), | ||
('2023-10-16 16:46:00', false, '2023-10-16 16:46:00', '멤버 7', 13), | ||
('2023-10-16 16:47:00', false, '2023-10-16 16:47:00', '멤버 8', 19), | ||
('2023-10-16 16:48:00', false, '2023-10-16 16:48:00', '멤버 9', 19), | ||
('2023-10-16 16:49:00', false, '2023-10-16 16:49:00', '멤버 10', 20); | ||
('2023-10-16 16:40:00', false, '2023-10-16 16:40:00', '김수민', 20), | ||
('2023-10-16 16:41:00', false, '2023-10-16 16:41:00', '강바다', 21), | ||
('2023-10-16 16:42:00', false, '2023-10-16 16:42:00', '만두', 23), | ||
('2023-10-16 16:43:00', false, '2023-10-16 16:43:00', '바다', 29), | ||
('2023-10-16 16:44:00', false, '2023-10-16 16:44:00', '카리나', 19), | ||
('2023-10-16 16:45:00', false, '2023-10-16 16:45:00', '사장님', 12), | ||
('2023-10-16 16:46:00', false, '2023-10-16 16:46:00', '장현지', 13), | ||
('2023-10-16 16:47:00', false, '2023-10-16 16:47:00', '박준수', 19), | ||
('2023-10-16 16:48:00', false, '2023-10-16 16:48:00', '박지유', 19), | ||
('2023-10-16 16:49:00', false, '2023-10-16 16:49:00', '스티브', 20); |
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
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
3 changes: 2 additions & 1 deletion
3
BE/eeos/src/main/java/com/blackcompany/eeos/attend/persistence/AttendRepository.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 |
---|---|---|
@@ -1,11 +1,12 @@ | ||
package com.blackcompany.eeos.attend.persistence; | ||
|
||
import com.blackcompany.eeos.attend.application.model.AttendStatus; | ||
import java.util.List; | ||
import java.util.Optional; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
public interface AttendRepository extends JpaRepository<AttendEntity, Long> { | ||
List<AttendEntity> findAllByProgramId(Long programId); | ||
List<AttendEntity> findAllByProgramIdAndStatus(Long programId, AttendStatus status); | ||
|
||
Optional<AttendEntity> findByProgramIdAndMemberId(Long programId, Long memberId); | ||
} |
Oops, something went wrong.