Skip to content

Commit

Permalink
Merge pull request #213 from inha-iesw/develop
Browse files Browse the repository at this point in the history
Version 1.0.8 Release
  • Loading branch information
Gyuhyeok99 authored Dec 19, 2024
2 parents 7e92c33 + 39731dc commit 28f4882
Show file tree
Hide file tree
Showing 16 changed files with 138 additions and 25 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Deploy Documentation

on:
pull_request:
branches:
- develop
types: [closed]

jobs:
deploy-docs:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 0

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

- name: Grant execute permission for gradlew
run: chmod +x gradlew

- name: Generate Documentation
run: |
./gradlew clean javadoc
- name: Deploy to Docs Repo
uses: peaceiris/actions-gh-pages@v3
with:
personal_token: ${{ secrets.DOCS_DEPLOY_TOKEN }}
external_repository: inha-iesw/inhagit-server-docs
publish_branch: main
publish_dir: ./build/docs/javadoc
commit_message: |
docs: update documentation from PR #${{ github.event.pull_request.number }}
PR Title: ${{ github.event.pull_request.title }}
Merged by: ${{ github.event.pull_request.merged_by.login }}
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'
9 changes: 8 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,11 @@ src/main/java/inha/git/InitData.java
logs
logback-spring.xml

src/main/java/inha/git/common/config/SwaggerConfig.java
src/main/java/inha/git/common/config/SwaggerConfig.java


docs/**

.gitmodules

inhagit-server-secret/**
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "inhagit-server-secret"]
path = inhagit-server-secret
url = https://github.com/inha-iesw/inhagit-server-secret.git
23 changes: 22 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {
}

group = 'inha'
version = '1.0.7'
version = '1.0.8'

java {
toolchain {
Expand Down Expand Up @@ -107,4 +107,25 @@ tasks.named('test') {

jar {
enabled = false
}

javadoc {
options {
encoding = 'UTF-8'
charSet = 'UTF-8'
author = true
version = true
links = ['https://docs.oracle.com/en/java/javase/17/docs/api/']
title = "I-OSS Server API Documentation"
addStringOption('Xdoclint:none', '-quiet')
addBooleanOption('html5', true)
}
// 소스 파일 인코딩 설정
options.encoding = 'UTF-8'
}

tasks.register('copyDoc', Copy) {
dependsOn 'javadoc'
from "$buildDir/docs/javadoc"
into "$projectDir/docs"
}
Original file line number Diff line number Diff line change
Expand Up @@ -129,17 +129,22 @@ public BaseResponse<ProblemResponse> deleteProblem(@AuthenticationPrincipal User
* 문제 신청 목록 조회 API
*
* @param page 페이지
* @param size 사이즈
* @return 문제 신청 목록
*/
@GetMapping("/requests")
@Operation(summary = "문제 신청 목록 조회 API", description = "문제 신청 목록을 조회합니다.")
public BaseResponse<Page<SearchRequestProblemResponse>> getRequestProblems(
@RequestParam("problemIdx") Integer problemIdx,
@RequestParam("page") Integer page) {
@RequestParam("page") Integer page,
@RequestParam("size") Integer size) {
if (page < 1) {
throw new BaseException(INVALID_PAGE);
}
return BaseResponse.of(PROBLEM_REQUEST_SEARCH_OK, problemService.getRequestProblems(problemIdx, page - 1));
if (size < 1) {
throw new BaseException(INVALID_PAGE);
}
return BaseResponse.of(PROBLEM_REQUEST_SEARCH_OK, problemService.getRequestProblems(problemIdx, page - 1, size - 1));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public interface ProblemService {
ProblemResponse createProblem(User user, CreateProblemRequest createProblemRequest, MultipartFile file);
ProblemResponse updateProblem(User user, Integer problemIdx, UpdateProblemRequest updateProblemRequest, MultipartFile file);
ProblemResponse deleteProblem(User user, Integer problemIdx);
Page<SearchRequestProblemResponse> getRequestProblems(Integer problemIdx, Integer page);
Page<SearchRequestProblemResponse> getRequestProblems(Integer problemIdx, Integer page, Integer size);
RequestProblemResponse requestUser(User user, CreateRequestProblemRequest createRequestProblemRequest);
RequestProblemResponse requestTeam(User user, CreateTeamRequestProblemRequest createTeamRequestProblemRequest);
RequestProblemResponse approveRequest(User user, CreateProblemApproveRequest createProblemApproveRequest);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,11 +156,12 @@ public ProblemResponse deleteProblem(User user, Integer problemIdx) {
*
* @param problemIdx 문제 인덱스
* @param page 페이지
* @param size 사이즈
* @return 문제 신청 목록
*/
@Override
public Page<SearchRequestProblemResponse> getRequestProblems(Integer problemIdx, Integer page) {
Pageable pageable = PageRequest.of(page, 10, Sort.by(Sort.Direction.DESC, CREATE_AT));
public Page<SearchRequestProblemResponse> getRequestProblems(Integer problemIdx, Integer page, Integer size) {
Pageable pageable = PageRequest.of(page, size, Sort.by(Sort.Direction.DESC, CREATE_AT));
return problemQueryRepository.getRequestProblems(problemIdx, pageable);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,16 +75,20 @@ public BaseResponse<Page<SearchProjectsResponse>> getProjects(@RequestParam("pag
*
* @param searchProjectCond 프로젝트 검색 조건
* @param page 페이지 번호
* @param size size 페이지 사이즈
* @return 검색된 프로젝트 정보를 포함하는 BaseResponse<Page<SearchProjectsResponse>>
*/
@GetMapping("/cond")
@Operation(summary = "프로젝트 조건 조회 API", description = "프로젝트 조건에 맞게 조회합니다.")
public BaseResponse<Page<SearchProjectsResponse>> getCondProjects(@Validated @ModelAttribute SearchProjectCond searchProjectCond,
@RequestParam("page") Integer page) {
@RequestParam("page") Integer page, @RequestParam("size") Integer size) {
if (page < 1) {
throw new BaseException(INVALID_PAGE);
}
return BaseResponse.of(PROJECT_SEARCH_CONDITION_OK, projectSearchService.getCondProjects(searchProjectCond, page - 1));
if (size < 1) {
throw new BaseException(INVALID_PAGE);
}
return BaseResponse.of(PROJECT_SEARCH_CONDITION_OK, projectSearchService.getCondProjects(searchProjectCond, page - 1, size - 1));
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
public interface ProjectSearchService {

Page<SearchProjectsResponse> getProjects(Integer page, Integer size);
Page<SearchProjectsResponse> getCondProjects(SearchProjectCond searchProjectCond, Integer page);
Page<SearchProjectsResponse> getCondProjects(SearchProjectCond searchProjectCond, Integer page, Integer size);
SearchProjectResponse getProject(User user, Integer projectIdx);

List<SearchFileResponse> getProjectFileByIdx(User user, Integer projectIdx, String path);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,12 @@ public Page<SearchProjectsResponse> getProjects(Integer page, Integer size) {
*
* @param searchProjectCond 검색 조건
* @param page 페이지 번호
* @param size 페이지 사이즈
* @return 검색된 프로젝트 정보 페이지
*/
@Override
public Page<SearchProjectsResponse> getCondProjects(SearchProjectCond searchProjectCond, Integer page) {
Pageable pageable = PageRequest.of(page, 10, Sort.by(Sort.Direction.DESC, CREATE_AT));
public Page<SearchProjectsResponse> getCondProjects(SearchProjectCond searchProjectCond, Integer page, Integer size) {
Pageable pageable = PageRequest.of(page, size, Sort.by(Sort.Direction.DESC, CREATE_AT));
return projectQueryRepository.getCondProjects(searchProjectCond, pageable);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import static inha.git.common.code.status.ErrorStatus.COMPANY_CANNOT_CREATE_QUESTION;
import static inha.git.common.code.status.ErrorStatus.INVALID_PAGE;
import static inha.git.common.code.status.ErrorStatus.*;
import static inha.git.common.code.status.SuccessStatus.*;

/**
Expand All @@ -45,15 +44,19 @@ public class QuestionController {
* <p>질문 전체를 조회합니다.</p>
*
* @param page Integer
* @param size Integer
* @return 검색된 질문 정보를 포함하는 BaseResponse<Page<SearchQuestionsResponse>>
*/
@GetMapping
@Operation(summary = "질문 전체 조회 API", description = "질문 전체를 조회합니다.")
public BaseResponse<Page<SearchQuestionsResponse>> getQuestions(@RequestParam("page") Integer page) {
public BaseResponse<Page<SearchQuestionsResponse>> getQuestions(@RequestParam("page") Integer page, @RequestParam("size") Integer size) {
if (page < 1) {
throw new BaseException(INVALID_PAGE);
}
return BaseResponse.of(QUESTION_SEARCH_OK, questionService.getQuestions(page - 1));
if (size < 1) {
throw new BaseException(INVALID_SIZE);
}
return BaseResponse.of(QUESTION_SEARCH_OK, questionService.getQuestions(page - 1, size - 1));
}

/**
Expand All @@ -62,16 +65,20 @@ public BaseResponse<Page<SearchQuestionsResponse>> getQuestions(@RequestParam("p
* <p>질문 조건에 맞게 조회합니다.</p>
*
* @param page Integer
* @param size Integer
* @param searchQuestionCond SearchQuestionCond
* @return 검색된 질문 정보를 포함하는 BaseResponse<Page<SearchQuestionsResponse>>
*/
@GetMapping("/cond")
@Operation(summary = "질문 조건 조회 API", description = "질문 조건에 맞게 조회합니다.")
public BaseResponse<Page<SearchQuestionsResponse>> getCondQuestions(@RequestParam("page") Integer page, SearchQuestionCond searchQuestionCond) {
public BaseResponse<Page<SearchQuestionsResponse>> getCondQuestions(@RequestParam("page") Integer page, @RequestParam("size") Integer size , SearchQuestionCond searchQuestionCond) {
if (page < 1) {
throw new BaseException(INVALID_PAGE);
}
return BaseResponse.of(QUESTION_SEARCH_OK, questionService.getCondQuestions(searchQuestionCond, page - 1));
if (size < 1) {
throw new BaseException(INVALID_SIZE);
}
return BaseResponse.of(QUESTION_SEARCH_OK, questionService.getCondQuestions(searchQuestionCond, page - 1, size - 1));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
import org.springframework.data.domain.Page;

public interface QuestionService {
Page<SearchQuestionsResponse> getQuestions(Integer page);
Page<SearchQuestionsResponse> getCondQuestions(SearchQuestionCond searchQuestionCond, Integer page);
Page<SearchQuestionsResponse> getQuestions(Integer page, Integer size);
Page<SearchQuestionsResponse> getCondQuestions(SearchQuestionCond searchQuestionCond, Integer page, Integer size);
SearchQuestionResponse getQuestion(User user, Integer questionIdx);
QuestionResponse createQuestion(User user, CreateQuestionRequest createQuestionRequest);
QuestionResponse updateQuestion(User user, Integer questionIdx, UpdateQuestionRequest updateQuestionRequest);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,12 @@ public class QuestionServiceImpl implements QuestionService {
* 질문 전체 조회
*
* @param page Integer
* @param size Integer
* @return Page<SearchQuestionsResponse>
*/
@Override
public Page<SearchQuestionsResponse> getQuestions(Integer page) {
Pageable pageable = PageRequest.of(page, 10, Sort.by(Sort.Direction.DESC, CREATE_AT));
public Page<SearchQuestionsResponse> getQuestions(Integer page, Integer size) {
Pageable pageable = PageRequest.of(page, size, Sort.by(Sort.Direction.DESC, CREATE_AT));
return questionQueryRepository.getQuestions(pageable);
}

Expand All @@ -89,11 +90,12 @@ public Page<SearchQuestionsResponse> getQuestions(Integer page) {
*
* @param searchQuestionCond SearchQuestionCond
* @param page Integer
* @param size Integer
* @return Page<SearchQuestionsResponse>
*/
@Override
public Page<SearchQuestionsResponse> getCondQuestions(SearchQuestionCond searchQuestionCond, Integer page) {
Pageable pageable = PageRequest.of(page, 10, Sort.by(Sort.Direction.DESC, CREATE_AT));
public Page<SearchQuestionsResponse> getCondQuestions(SearchQuestionCond searchQuestionCond, Integer page, Integer size) {
Pageable pageable = PageRequest.of(page, size, Sort.by(Sort.Direction.DESC, CREATE_AT));
return questionQueryRepository.getCondQuestions(searchQuestionCond, pageable);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
public class ProfessorController {

private final ProfessorService professorService;

/**
* 교수 전용 학생 검색 API
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ public class StudentServiceImpl implements StudentService{
private final MailService mailService;
private final EmailDomainService emailDomainService;


/**
* 학생 회원가입
*
Expand Down
17 changes: 17 additions & 0 deletions src/main/resources/application.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
spring:
config:
activate:
on-profile: local
import: optional:file:${SPRING_CONFIG_LOCATION}application-local.yml
---
spring:
config:
activate:
on-profile: dev
import: optional:file:${SPRING_CONFIG_LOCATION}application-dev.yml
---
spring:
config:
activate:
on-profile: prod
import: optional:file:${SPRING_CONFIG_LOCATION}application-prod.yml

0 comments on commit 28f4882

Please sign in to comment.