Skip to content

Commit

Permalink
[DEV-22] 이미지 요청 최대 파일 크기 10MB에서 20MB로 확장 (#69)
Browse files Browse the repository at this point in the history
Co-authored-by: 5uhwann <[email protected]>
Co-authored-by: MinsuKim <[email protected]>
Co-authored-by: 5uhwann <[email protected]>
  • Loading branch information
4 people authored Aug 5, 2024
1 parent 84d7856 commit 464fc65
Show file tree
Hide file tree
Showing 32 changed files with 899 additions and 122 deletions.
9 changes: 3 additions & 6 deletions .github/workflows/ddingdong-dev-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,7 @@ name: ddingdong-dev-depoly
on:
push:
branches:
- develop # develop에 push될 때 실행

pull_request:
branches:
- develop
- main

jobs:
build:
Expand Down Expand Up @@ -75,7 +71,8 @@ jobs:
wait_for_environment_recovery: 180

- name: Test with Gradle
run: ./gradlew test
run: ./gradlew test --no-daemon


- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# 명지대학교 동아리 관리 시스템 - ddingdong

### URL
https://ddingdong.club/
DEFAULT : https://ddingdong.club/
ADMIN : https://admin.ddingdong.club/

### 기술 스택

Expand Down
67 changes: 46 additions & 21 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,50 +1,75 @@
plugins {
id 'java'
id 'org.springframework.boot' version '2.7.12'
id 'io.spring.dependency-management' version '1.0.15.RELEASE'
id 'jacoco'
id 'java'
id 'org.springframework.boot' version '2.7.12'
id 'io.spring.dependency-management' version '1.0.15.RELEASE'
id 'jacoco'
}

group = 'ddingdong'
version = '0.0.1-SNAPSHOT'

java {
sourceCompatibility = '17'
sourceCompatibility = '17'
}

jar {
enabled = false
enabled = false
}

configurations {
compileOnly {
extendsFrom annotationProcessor
}
compileOnly {
extendsFrom annotationProcessor
}
}

repositories {
mavenCentral()
mavenCentral()
}

dependencies {
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-security'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-security'
implementation 'org.springframework.boot:spring-boot-starter-validation'

implementation 'io.hypersistence:hypersistence-utils-hibernate-55:3.7.2'

implementation 'com.auth0:java-jwt:4.2.1'

implementation 'com.auth0:java-jwt:4.2.1'
implementation 'io.awspring.cloud:spring-cloud-starter-aws:2.4.4'
implementation 'com.mysql:mysql-connector-j'

implementation 'io.awspring.cloud:spring-cloud-starter-aws:2.4.4'
implementation 'com.mysql:mysql-connector-j'
implementation 'org.apache.poi:poi:5.2.0'
implementation 'org.apache.poi:poi-ooxml:5.2.0'
implementation 'org.springframework.boot:spring-boot-configuration-processor'

implementation 'io.sentry:sentry-logback:7.6.0'
implementation 'org.springdoc:springdoc-openapi-ui:1.6.11'

compileOnly 'org.projectlombok:lombok'
runtimeOnly 'com.h2database:h2'
annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
compileOnly 'org.projectlombok:lombok'
runtimeOnly 'com.h2database:h2'
annotationProcessor 'org.projectlombok:lombok'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
}

tasks.named('test') {
useJUnitPlatform()
useJUnitPlatform()
}

jacoco {
toolVersion = '0.8.10'
}

test {
finalizedBy jacocoTestReport
}

jacocoTestReport {
reports {
html.enabled true
xml.enabled true
csv.enabled true
}
}

jacoco {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package ddingdong.ddingdongBE.common.config;

import io.swagger.v3.oas.models.Components;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.security.SecurityScheme;
import io.swagger.v3.oas.models.servers.Server;
import java.util.List;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class OpenApiConfig {

@Value("${swagger.server.url}")
private String serverUrl;

@Bean
public OpenAPI openApi() {
return new OpenAPI()
.components(securityComponents())
.servers(List.of(new Server().url(serverUrl)));
}

private Components securityComponents() {
return new Components()
.addSecuritySchemes(
"AccessToken",
new SecurityScheme()
.type(SecurityScheme.Type.HTTP)
.scheme("bearer")
.bearerFormat("JWT")
);
}

}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package ddingdong.ddingdongBE.common.config;

import static org.springframework.http.HttpMethod.*;
import static org.springframework.http.HttpMethod.GET;

import ddingdong.ddingdongBE.auth.service.JwtAuthService;
import ddingdong.ddingdongBE.common.filter.JwtAuthenticationFilter;
Expand Down Expand Up @@ -29,15 +29,17 @@ public SecurityFilterChain filterChain(HttpSecurity http, JwtAuthService authSer
throws Exception {
http
.authorizeHttpRequests()
.antMatchers(API_PREFIX + "/auth/**")
.antMatchers(API_PREFIX + "/auth/**",
API_PREFIX + "/events/**")
.permitAll()
.antMatchers(API_PREFIX + "/admin/**").hasRole("ADMIN")
.antMatchers(API_PREFIX + "/club/**").hasRole("CLUB")
.antMatchers(GET,
API_PREFIX + "/clubs/**",
API_PREFIX + "/notices/**",
API_PREFIX + "/banners/**")
.permitAll()
.antMatchers(API_PREFIX + "/admin/**").hasRole("ADMIN")
.antMatchers(API_PREFIX + "/club/**").hasRole("CLUB")
.antMatchers("/v3/api-docs/**", "/swagger-ui/**", "/swagger-resources/**").permitAll()
.anyRequest()
.authenticated()
.and()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ public enum ErrorMessage {
NO_SUCH_CLUB("해당 동아리가 존재하지 않습니다."),
NO_SUCH_NOTICE("해당 공지사항이 존재하지 않습니다."),
NO_SUCH_ACTIVITY_REPORT("해당 활동보고서가 존재하지 않습니다."),
NO_SUCH_QR_STAMP_HISTORY("이벤트 참여 내역이 존재하지 않습니다."),
INVALID_CLUB_SCORE_VALUE("동아리 점수는 0 ~ 999점 입니다."),
INVALID_PASSWORD("잘못된 비밀번호입니다."),
INVALID_STAMP_COUNT_FOR_APPLY("스탬프를 모두 모아야 이벤트에 참여할 수 있어요!"),
ACCESS_DENIED("접근권한이 없습니다."),
UNREGISTER_ID("등록되지 않은 ID입니다."),
NO_SUCH_BANNER("해당 배너가 존재하지 않습니다."),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import static ddingdong.ddingdongBE.common.exception.ErrorMessage.*;

import java.util.NoSuchElementException;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.ExceptionHandler;
Expand All @@ -11,19 +12,20 @@
import org.springframework.web.multipart.support.MissingServletRequestPartException;

@RestControllerAdvice
@Slf4j
public class ExceptionController {

@ExceptionHandler(RuntimeException.class)
@ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
public ExceptionResponse handleRuntimeException(RuntimeException e) {
e.printStackTrace();
log.info(e.getMessage());
return ExceptionResponse.of(HttpStatus.INTERNAL_SERVER_ERROR, INTERNAL_SERVER_ERROR.getText());
}

@ExceptionHandler(Exception.class)
@ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
public ExceptionResponse handleException(Exception e) {
e.printStackTrace();
log.info(e.getMessage());
return ExceptionResponse.of(HttpStatus.INTERNAL_SERVER_ERROR, INTERNAL_SERVER_ERROR.getText());
}

Expand All @@ -34,9 +36,9 @@ public ExceptionResponse handleIllegalArgumentException(IllegalArgumentException
}

@ExceptionHandler(NoSuchElementException.class)
@ResponseStatus(HttpStatus.NOT_FOUND)
@ResponseStatus(HttpStatus.BAD_REQUEST)
public ExceptionResponse handleNoSuchElementException(NoSuchElementException e) {
return ExceptionResponse.of(HttpStatus.NOT_FOUND, e.getMessage());
return ExceptionResponse.of(HttpStatus.BAD_REQUEST, e.getMessage());
}

@ExceptionHandler(AuthenticationException.class)
Expand All @@ -55,4 +57,4 @@ public ResponseEntity<ExceptionResponse> handleAuthenticationException(Authentic
public ExceptionResponse handleMissingServletRequestPartException(MissingServletRequestPartException e) {
return ExceptionResponse.of(HttpStatus.BAD_REQUEST, e.getMessage());
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package ddingdong.ddingdongBE.common.utils;

import ddingdong.ddingdongBE.domain.event.controller.dto.response.EventQrResponse;
import org.springframework.stereotype.Component;

@Component
public class EventQrGenerator {

public static final String URI_PREFIX = "https://chart.apis.google.com/chart?cht=qr&chs=250x250&chl=";

public EventQrResponse generateQrCodeUri(String studentName, String studentNumber) {
String uri = URI_PREFIX + "https://ddingdong.club/event/code?studentName=" + studentName + "%26" + "studentNumber=" + studentNumber;

return EventQrResponse.of(uri);
}
}
Loading

0 comments on commit 464fc65

Please sign in to comment.