Skip to content

Commit

Permalink
[merge] 운영 서버 배포 (#209)
Browse files Browse the repository at this point in the history
* [fix] #123 csv entity 필드 변경

* [fix] #123 csv domain 필드 변경

* [fix] #123 csv mapper 필드 변경

* [fix] #123 csvReader 필드 변경

* [fix] #123 csvWriter 필드 변경

* [fix] #123 controller part로 변경

* [fix] #123 AdminController consume설정

* [fix] #123 filepath 수정

* [hotfix]: 긴급 공지 상태 변경

* [chore] #127 actuator 의존성 추가

* [feat] #127 actuator 경로 White list 추가

* [hotfix] groupEntity와 memberEntity 간 조인 조건 명확히 하여 groupCode 관련 경로 표현식 오류 해결

* [fix] #123 getProgram으로 수정

* [fix] #123 JobScope추가

* [fix] #123 getMajor로 다시 수정ㅇ

* [hotfix]: 자료집 수정 api 추가

* [hotfix]: 자료집 수정 api 추가

* [hotfix]: 자료집 수정 url 수정

* [hotfix]: 자료집 수정 api 리팩토링

* [hotfix]: 자료집 수정 api 리팩토링

* [hotfix]: 자료집 수정 api 리팩토링

* [hotfix]: 자료집 수정 api 리팩토링

* [hotfix]: 자료집 수정 api 리팩토링

* [chore] #131 board 디비수정

* [hotfix]: 자료집 수정 카테고리

* [hotfix]: 자료집 수정 카테고리

* [hotfix]: 자료집 수정 카테고리

* [hotfix]: 자료집 categort 학부들 추가

* [feat] CORS 학교 도메인 연결!!!

* [refactor] 공지사항 게시물 정렬 시 1)긴급공지 2)NEW 3)일반 순으로 최종 재정렬되게 수정

* [refactor] 공지사항 게시물 정렬 시 1)긴급공지 2)NEW 3)일반 순으로 최종 재정렬되게 수정 - 검색도 적용

* [refactor] GroupCode에 CLUB_UNION(동아리연합회) 추가

- 동아리연합회는 멤버에 속하지만 동아리 연합회는 예외적으로 ACL적용을 해야하기 때문에 그룹코드에 추가해야함

- 그래서 동아리 연합회를 그룹코드에 추가하면 코드의 수정이 많지 않을 것이라고 예상(노션 업데이트)

* [refactor] ACL TargetGroup에 CLUB_UNION(동아리연합회) 추가

* [hotfix] 게시물 전체 조회 페이지네이션 오류 해결

distinct 추가해서 중복 객체 카운팅 해결

* [refactor] fetchCount -> fetchOne으로 수정

fetchCount는 최신 버전 deprecated

* [add] UserInfoResponse 추가(passu)

* [add] TokenRequest 추가(passu)

* [add] 토큰 유저 정보 조회 로직

* [add] 유저 찾기 로직

* [add] SecurityConfig 경로 추가

* [fix] record to class

* [hotfix] 페이징 중복 문제 해결, countDistinct

* [hotfix] 페이징 중복 문제 해결, countDistinct

* findAllByBoardIdAndGroupCodeAndMemberCode 메소드는 현재 프론트에서 쓰지 않는 메소드이기는 하지만, 함께 수정함(같은 로직이기 때문에)

* [refactor] 분실물 게시물 단건 조회 시 학생의 학번도 반환 추가

* [fix] @responsebody 삭제

* [fix] Header로 토큰 발급받는 것으로 수정

* [fix] required false설정

* [add] UserInfoResponse of 메소드 추가

* [fix] 우선 간편하게 하나만 찾아서 보내주는 것으로 수정

* [fix] studentId 출력 부분 수정

* [chore] #139 rename 및 타겟 브랜치 메인으로 변경

* [chore] #139 develop 브랜치 cicd

* [fix] #139 잘못 기입된 시크릿명 수정

* [refactor] : 게시물 생성 dto 공통 추상클래스로 만들기

* [refactor] #139 현재 브랜치 배포 대상 제외

* [refactor] : 팩토리로 게시판별 게시물 처리

* [feat]:인권신고게시판 추가 엔티티 생성

* [refactor]:배포 문제해결

* [feat]:#142 CustomReqeustBody, 게시물 delete 수정

* [fix]:#142 swagger 연결 서버 도메인 변경

* [fix]:#142 게시물 생성 description변경

* [feat] 건의게시판 답변대기 카테고리 추가

* [fix]: #142 전화번호 필드 추가

* [feat] 건의게시판 조회

* [feat] 건의게시판 단건조회

* [feat]: #142 인권신고게시판 조회 ACL 적용

* [feat]:#142 인권신고게시판 단건조회

* [feat]:#142 인권신고게시판 글쓰기 ACL추가

* Revert "[feat]:#142 인권신고게시판 단건조회"

This reverts commit 3d643bc.

* [fix]:#142 파일추가

* [feat]: 인권신고게시판 공식답변 처리

* [fix]: swagger description 수정

* Revert "Revert "[feat]:#142 인권신고게시판 단건조회""

This reverts commit 5218dd2.

* [fix] 예술창작학부에 속한 문예창작전공, 영화예술전공 예외처리 코드

* [fix] 예술창작학부에 속한 문예창작전공, 영화예술전공 예외처리 코드

* [feat] 건의게시판 자치기구 댓글 시 CommentType OFFICIAL로 내려가게 수정

* [feat]:#142 오피셜댓글-> 카테고리 상태변경

* [feat] : #142 에러수정

* [feat] #142 findSuggestionCommitteeMember 널처리

* [feat] #142 SuggestionPostDetailResponse 에 officialCommentList 추가

* [feat] #142 여백 제거

* [fix]:#142 personType 한글로 수정

* [fix]:#142 category, isAuthor, rightsDetailList 필드명 맞추기

* [fix]:#142 postFileList 필드명 변경

* [feat] #142 건의게시판 userId 추가

* [feat]:#142 건의대상 타입 필드 추가

* [feat] #142 suggestionTarget 널처리

* [feat] #142 suggestionTarget 널처리

* [feat] #142 건의게시판 조회

* [fix]:#142 단건조회 category 필드명 수정

* [fix] :#142 SuggestionTarget null 이슈 해결

* [fix] : #142 인권신고게시물생성 category 상수화

* Revert "[fix] : #142 인권신고게시물생성 category 상수화"

This reverts commit 995fdea.

* [feat] : #142 인권신고게시물 패치 API 생성

* [feat] : #142 인권게시판 일반로그인 유저 리스트조회 수정

* [feat] : #142 건의게시판 일반로그인 유저 리스트조회 수정

* [feat]:#142 페이지 정보처리

* [feat]:#142 페이지 정보처리2

* [fix]:#142 인권신고 게시판 일반 유저 ACL추가

* [fix]:#142 카테고리 상수화

* [feat]:#142 인권신고게시판 patch 수정

* [feat]:#142 board-8 patch시 에러처리

* [feat] 프론트 도메인 추가

* [fix]:비로그인 처리

* [fix]:category 필드 다중매핑

* [feat]:비로그인 목록조회 처리

* [refactor] : #142 목록조회 엔드포인트 변경 및 리팩토링

* [feat]:#142 rightsDetail patch 방식 수정

* [fix] : #142 swagger 스키마

* [refactor]: #152 개발 도메인 CORS 설정

* [infra] : #153 yml 수정 배포

* [fix]: #142 타 자치기구 목록조회 수정

* [feat] : #142 댓글 권한 추가

* [feat] : #142 관리자 권한추가

* [feat]: #142 공식댓글 수정 예외처리

* [feat] : #166 서비스 공지사항 board code 추가

* [feat] : #166 서비스 공지사항 리스트 조회

* [feat] : #166 서비스 공지사항 글쓰기 ACL

* [feat] : #166 서비스 공지사항 단건 게시물 ACL

* [feat] : #166 배치 처리에 서비스 공지사항 추가

* [feat] : #166 acl 리스트 중복 권한 제거

* [feat] : #169 내정보 불러오기(데이터 필드에 대한 기획 확인 필요)

* [feat] : #169 내정보 수정하기(union일 경우)

* [fix] : #169 내정보 수정하기(union일 경우)

* [fix] : #166 서비스 공지사항 단건조회 수정 및 리스트조회에  status추가

* [feat] 로깅 세팅 (#170)

* [chore] 로그 파일 ignore 처리

* [feat] 요청 로그 aop

* [feat] cicd 스크립트 수정
- logback.xml 설정 추가

* [feat] #169 마이페이지 -> 작성 글 보기 구현

* [feat] cicd 스크립트 수정

* [feat] #179 member 테이블 isVerfied 신입생을 위한 인증상태 추가 및 권한 수정

* [feat] #181 건의게시판 키워드 검색 API 수정(page, q없어도 리스트 내려가게)

* feat: 자료집게시판 상세조회 API 분리 구현

- Factory 패턴에서 분리하여 독립적인 API로 구현
- 게시글 번호를 통한 단건조회 기능 분리

* [feat] #185 질의응답게시판 구현

* [feat] #169 예외처리

* [feat] #187 질의응답게시판 검색 API qnaTarget 구분하게 수정

* [feat] #169 작성글조회 컨트롤러 수정

* [feat] : #169 내정보 불러오기(데이터 필드에 대한 기획 확인 필요)

* [feat] : #169 내정보 수정하기(union일 경우)

* [fix] : #169 내정보 수정하기(union일 경우)

* [feat] #169 merge develop

* [feat] #169 develop rebase

* [feat] #169 예외처리

* [feat] #169 작성글조회 컨트롤러 수정

* [feat] #169 내정보 조회, 내가 쓴 글 조회 API 수정

* [feat] #169 User에 nickname 추가

* [feat] #169 category 필드 응답에서 제외

* [feat] #169 예외처리

* [feat] #169 예외처리

* [feat] #191 질의응답게시판 댓글 수정

* [feat] #185 과/단과대, 총학생회로 조회할 수 있게 수정

* [feat] #185 질의응답게시판 오피셜 댓글 로직 수정

* [feat] #196 swagger cors

* cicd test

* cicd test

* cicd test

* cicd test

* cicd test

* cicd test

* cicd test

* cicd test

* cicd test

* cicd test

* cicd test

* cicd test

* cicd test

* cicd test

* [feat] LoggingAspect 수정

* Trigger deployment

* Trigger deployment

* Trigger deployment

* [fix] : #166 공지사항 단건조회 status추가

* Trigger deployment

* [feat] #204 단과대 학과 조회 api

* [feat] #204 단과대 학과 조회 api 수정

* [fix] : swagger 수정

* [chore] develop cicd yml 직접 생성 과정 삭제, 서버 실행 시 동적 생성

* [chore] main cicd yml 생성 방식 변경
- 환경변수로 전달하여 deploy.sh 실행 시 동적 생성

* [test] 개발 서버 cicd test

* [fix] 스크립트 문법 오류 수정

* [test] 운영 서버 cicd test

* [fix] 운영 서버 resources 디렉토리 생성 추가

* [chore] 시크릿명 오탈 기입 수정

* [chore] 시크릿명 오탈 기입 수정

* [refactor] test 브랜치 제거

---------

Co-authored-by: jeongu <[email protected]>
Co-authored-by: jeongu <[email protected]>
Co-authored-by: 배현서 <[email protected]>
Co-authored-by: chahyunsoo <[email protected]>
Co-authored-by: jinseok <[email protected]>
Co-authored-by: qogustj <[email protected]>
Co-authored-by: beakgugong <[email protected]>
Co-authored-by: JangInho <[email protected]>
Co-authored-by: Inho Jang <[email protected]>
  • Loading branch information
10 people authored Feb 14, 2025
1 parent c60cea5 commit e8ca131
Show file tree
Hide file tree
Showing 11 changed files with 118 additions and 27 deletions.
20 changes: 7 additions & 13 deletions .github/workflows/develop-cicd.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Java CI & CD with Gradle
name: DEVELOP CI & CD

on:
push:
Expand All @@ -21,16 +21,6 @@ jobs:
java-version: '17'
distribution: 'temurin'

- name: application.yml 설정
run: |
cd ./src/main
mkdir resources
cd ./resources
touch ./application.yml
echo "$APPLICATION_DEVELOP" > ./application.yml
env:
APPLICATION_DEVELOP: ${{ secrets.APPLICATION_DEVELOP }}

- name: Gradle Caching
uses: actions/cache@v3
with:
Expand Down Expand Up @@ -66,8 +56,12 @@ jobs:
script: |
sudo docker stop ussum-develop || true
sudo docker container prune -f
echo "${{ secrets.APPLICATION_DEVELOP }}" | sudo tee /home/ubuntu/application.yml > /dev/null
sudo docker pull ${{ secrets.DOCKER_REPO }}/ussum-develop:latest
sudo docker run -d --log-driver=syslog \
-e TZ=Asia/Seoul \
-p 8080:8080 --name ussum-develop \
${{ secrets.DOCKER_REPO }}/ussum-develop:latest
-e SPRING_CONFIG_LOCATION=file:/app/application.yml \
-p 8080:8080 \
--name ussum-develop \
-v /home/ubuntu/application.yml:/app/application.yml \
"${{ secrets.DOCKER_REPO }}/ussum-develop:latest"
14 changes: 3 additions & 11 deletions .github/workflows/main-cicd.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Java CI & CD with Gradle
name: MAIN CI & CD

on:
push:
Expand All @@ -22,19 +22,11 @@ jobs:
java-version: '17'
distribution: 'temurin'

- name: application.yml 설정
- name: logback.xml 설정
run: |
cd ./src/main
mkdir resources
cd ./resources
touch ./application.yml
echo "$APPLICATION_MAIN" > ./application.yml
env:
APPLICATION_MAIN: ${{ secrets.APPLICATION_MAIN }}

- name: logback.xml 설정
run: |
cd ./src/main/resources
touch ./logback.xml
echo "$LOGBACK" > ./logback.xml
env:
Expand Down Expand Up @@ -103,5 +95,5 @@ jobs:
sudo docker pull ${{ secrets.DOCKER_REPO }}/blue-green
chmod 777 ./scripts/deploy.sh
cp ./scripts/deploy.sh ./deploy.sh
./deploy.sh
APPLICATION_YML="${{ secrets.APPLICATION_MAIN }}" ./deploy.sh # 환경 변수로 전달
docker image prune -f
4 changes: 4 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ services:
- 8081:8080
environment:
- TZ=Asia/Seoul
- SPRING_CONFIG_LOCATION=file:/app/application.yml
volumes:
- /var/log/homepage:/var/log/homepage # /var/log/homepage
- /home/ubuntu/application.yml:/app/application.yml
green:
container_name: green
image: haul123/blue-green
Expand All @@ -20,5 +22,7 @@ services:
- 8082:8080
environment:
- TZ=Asia/Seoul
- SPRING_CONFIG_LOCATION=file:/app/application.yml
volumes:
- /var/log/homepage:/var/log/homepage # /var/log/homepage
- /home/ubuntu/application.yml:/app/application.yml
2 changes: 2 additions & 0 deletions scripts/deploy.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash

echo "${APPLICATION_YML}" | sudo tee /home/ubuntu/application.yml > /dev/null

IS_GREEN_EXIST=$(docker ps | grep green)
DEFAULT_CONF=" /etc/nginx/nginx.conf"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import ussum.homepage.application.post.service.dto.request.PostUpdateRequest;
import ussum.homepage.application.post.service.dto.request.RightsDetailRequest;
import ussum.homepage.application.post.service.dto.response.TopLikedPostListResponse;
import ussum.homepage.application.user.service.dto.response.CollegeAndDepartmentResponse;
import ussum.homepage.application.user.service.dto.response.MyPostsResponse;
import ussum.homepage.global.ApiResponse;
import ussum.homepage.global.config.auth.UserId;
Expand Down Expand Up @@ -275,4 +276,13 @@ public ResponseEntity<MyPostsResponse> getMyPostList(@Parameter(hidden = true) @
MyPostsResponse response = postManageService.getMyPostList(userId, page, take);
return ResponseEntity.ok(response);
}

@Operation(summary = "단과대 학과 조회 api", description = """
단과대 학과 리스트 조회하는 api입니다.
""")
@GetMapping("/colleges-departments")
public ApiResponse<CollegeAndDepartmentResponse> getCollegeAndDepartmentList(@Parameter(hidden = true) @UserId Long userId) {
CollegeAndDepartmentResponse response = postManageService.getCollegeAndDepartment(userId);
return ApiResponse.onSuccess(response);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

import ussum.homepage.application.post.service.dto.response.postSave.*;

import ussum.homepage.application.user.service.dto.response.CollegeAndDepartmentResponse;
import ussum.homepage.application.user.service.dto.response.MyPostsResponse;
import ussum.homepage.domain.comment.PostComment;
import ussum.homepage.domain.comment.service.PostCommentReader;
Expand Down Expand Up @@ -454,4 +455,69 @@ public MyPostsResponse getMyPostList(Long userId, int page, int take) {

return new MyPostsResponse(list, pageInfo);
}

public CollegeAndDepartmentResponse getCollegeAndDepartment(Long userId) {
List<String> colleges = List.of(
"경영대학",
"경제통상대학",
"공과대학",
"법과대학",
"사회과학대학",
"인문대학",
"자연과학대학",
"IT대학",
"융합특성화자유전공학부"
);

List<String> departments = List.of(
"경영학부",
"벤처중소기업학과",
"회계학과",
"금융학부",
"경제학과",
"글로벌통상학과",
"금융경제학과",
"국제무역학과",
"화학공학과",
"신소재공학과",
"전기공학부",
"기계공학부",
"산업정보시스템공학과",
"건축학부",
"법학과",
"국제법무학과",
"사회복지학부",
"행정학부",
"정치외교학과",
"정보사회학과",
"언론홍보학과",
"평생교육학과",
"기독교학과",
"국어국문학과",
"영어영문학과",
"독어독문학과",
"불어불문학과",
"중어중문학과",
"일어일문학과",
"철학과",
"사학과",
"문예창작전공",
"영화예술전공",
"스포츠학부",
"수학과",
"물리학과",
"화학과",
"정보통계보험수리학과",
"의생명시스템학부",
"컴퓨터학부",
"전자정보공학부",
"글로벌미디어학부",
"소프트웨어학부",
"AI융합학부",
"미디어경영학과",
"융합특성화자유전공학부"
);

return CollegeAndDepartmentResponse.of(colleges, departments);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@
@Getter
public class NoticePostDetailResponse extends PostDetailResDto {
private final List<FileResponse> fileResponseList;
private final String status;

@Builder
private NoticePostDetailResponse(Long postId, String categoryName, String authorName, String title, String content, String createdAt, String lastEditedAt, Boolean isAuthor,
List<FileResponse> fileResponseList, List<String> canAuthority) {
List<FileResponse> fileResponseList, List<String> canAuthority,String status) {
super(postId, categoryName, authorName, title, content, createdAt, lastEditedAt, isAuthor, canAuthority);
this.fileResponseList = fileResponseList;
this.status = status;
}

public static NoticePostDetailResponse of(Post post, Boolean isAuthor, User user, String categoryName, List<FileResponse> fileResponseList) {
Expand All @@ -30,6 +32,7 @@ public static NoticePostDetailResponse of(Post post, Boolean isAuthor, User user
.lastEditedAt(post.getLastEditedAt())
.isAuthor(isAuthor)
.fileResponseList(fileResponseList)
.status(post.getStatus())
.build();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@
@Getter
public class ServicePostDetailResponse extends PostDetailResDto{
private final List<FileResponse> fileResponseList;
private final String status;

@Builder
private ServicePostDetailResponse(Long postId, String categoryName, String authorName, String title, String content, String createdAt, String lastEditedAt, Boolean isAuthor,
List<FileResponse> fileResponseList, List<String> canAuthority) {
List<FileResponse> fileResponseList, List<String> canAuthority,String status) {
super(postId, categoryName, authorName, title, content, createdAt, lastEditedAt, isAuthor, canAuthority);
this.fileResponseList = fileResponseList;
this.status = status;
}

public static ServicePostDetailResponse of(Post post, Boolean isAuthor, User user, List<FileResponse> fileResponseList) {
Expand All @@ -28,6 +30,7 @@ public static ServicePostDetailResponse of(Post post, Boolean isAuthor, User use
.lastEditedAt(post.getLastEditedAt())
.isAuthor(isAuthor)
.fileResponseList(fileResponseList)
.status(post.getStatus())
.build();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package ussum.homepage.application.user.service.dto.response;

import lombok.Builder;

import java.util.List;

@Builder
public record CollegeAndDepartmentResponse(List<String> colleges, List<String> departments) {
public static CollegeAndDepartmentResponse of(List<String> colleges, List<String> departments) {
return CollegeAndDepartmentResponse.builder()
.colleges(colleges)
.departments(departments)
.build();
}

}
1 change: 1 addition & 0 deletions src/main/java/ussum/homepage/global/config/CorsConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public CorsFilter corsFilter() {
config.addAllowedOrigin("https://dev-homepage-frontend.vercel.app");
config.addAllowedOrigin("https://dev.sssupport.shop");
config.addAllowedOrigin("https://backend.sssupport.shop");
config.addAllowedOrigin("https://dev-backend.sssupport.shop");
config.addAllowedHeader("*");
config.setAllowedMethods(Arrays.asList("HEAD", "GET", "POST", "PUT", "DELETE", "PATCH", "OPTIONS"));
source.registerCorsConfiguration("/**",config);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public OpenAPI openAPI() {
.bearerFormat(JWT)
);
return new OpenAPI()
.addServersItem(new Server().url("https://dev.sssupport.shop"))
.addServersItem(new Server().url("https://dev-backend.sssupport.shop"))
.components(new Components())
.info(new Info())
.addSecurityItem(securityRequirement)
Expand Down

0 comments on commit e8ca131

Please sign in to comment.