Skip to content

Commit 464fc65

Browse files
wonjunYou5uhwannMinsuKim21
authored
[DEV-22] 이미지 요청 최대 파일 크기 10MB에서 20MB로 확장 (#69)
Co-authored-by: 5uhwann <[email protected]> Co-authored-by: MinsuKim <[email protected]> Co-authored-by: 5uhwann <[email protected]>
1 parent 84d7856 commit 464fc65

32 files changed

+899
-122
lines changed

.github/workflows/ddingdong-dev-deploy.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,7 @@ name: ddingdong-dev-depoly
33
on:
44
push:
55
branches:
6-
- develop # develop에 push될 때 실행
7-
8-
pull_request:
9-
branches:
10-
- develop
6+
- main
117

128
jobs:
139
build:
@@ -75,7 +71,8 @@ jobs:
7571
wait_for_environment_recovery: 180
7672

7773
- name: Test with Gradle
78-
run: ./gradlew test
74+
run: ./gradlew test --no-daemon
75+
7976

8077
- name: Upload coverage reports to Codecov
8178
uses: codecov/codecov-action@v3

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# 명지대학교 동아리 관리 시스템 - ddingdong
22

33
### URL
4-
https://ddingdong.club/
4+
DEFAULT : https://ddingdong.club/
5+
ADMIN : https://admin.ddingdong.club/
56

67
### 기술 스택
78

build.gradle

Lines changed: 46 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,75 @@
11
plugins {
2-
id 'java'
3-
id 'org.springframework.boot' version '2.7.12'
4-
id 'io.spring.dependency-management' version '1.0.15.RELEASE'
5-
id 'jacoco'
2+
id 'java'
3+
id 'org.springframework.boot' version '2.7.12'
4+
id 'io.spring.dependency-management' version '1.0.15.RELEASE'
5+
id 'jacoco'
66
}
77

88
group = 'ddingdong'
99
version = '0.0.1-SNAPSHOT'
1010

1111
java {
12-
sourceCompatibility = '17'
12+
sourceCompatibility = '17'
1313
}
1414

1515
jar {
16-
enabled = false
16+
enabled = false
1717
}
1818

1919
configurations {
20-
compileOnly {
21-
extendsFrom annotationProcessor
22-
}
20+
compileOnly {
21+
extendsFrom annotationProcessor
22+
}
2323
}
2424

2525
repositories {
26-
mavenCentral()
26+
mavenCentral()
2727
}
2828

2929
dependencies {
30-
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
31-
implementation 'org.springframework.boot:spring-boot-starter-web'
32-
implementation 'org.springframework.boot:spring-boot-starter-security'
30+
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
31+
implementation 'org.springframework.boot:spring-boot-starter-web'
32+
implementation 'org.springframework.boot:spring-boot-starter-security'
33+
implementation 'org.springframework.boot:spring-boot-starter-validation'
34+
35+
implementation 'io.hypersistence:hypersistence-utils-hibernate-55:3.7.2'
36+
37+
implementation 'com.auth0:java-jwt:4.2.1'
3338

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

36-
implementation 'io.awspring.cloud:spring-cloud-starter-aws:2.4.4'
37-
implementation 'com.mysql:mysql-connector-j'
42+
implementation 'org.apache.poi:poi:5.2.0'
43+
implementation 'org.apache.poi:poi-ooxml:5.2.0'
44+
implementation 'org.springframework.boot:spring-boot-configuration-processor'
3845

46+
implementation 'io.sentry:sentry-logback:7.6.0'
47+
implementation 'org.springdoc:springdoc-openapi-ui:1.6.11'
3948

40-
compileOnly 'org.projectlombok:lombok'
41-
runtimeOnly 'com.h2database:h2'
42-
annotationProcessor 'org.projectlombok:lombok'
43-
testImplementation 'org.springframework.boot:spring-boot-starter-test'
49+
compileOnly 'org.projectlombok:lombok'
50+
runtimeOnly 'com.h2database:h2'
51+
annotationProcessor 'org.projectlombok:lombok'
52+
testImplementation 'org.springframework.boot:spring-boot-starter-test'
4453
}
4554

4655
tasks.named('test') {
47-
useJUnitPlatform()
56+
useJUnitPlatform()
57+
}
58+
59+
jacoco {
60+
toolVersion = '0.8.10'
61+
}
62+
63+
test {
64+
finalizedBy jacocoTestReport
65+
}
66+
67+
jacocoTestReport {
68+
reports {
69+
html.enabled true
70+
xml.enabled true
71+
csv.enabled true
72+
}
4873
}
4974

5075
jacoco {
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
package ddingdong.ddingdongBE.common.config;
2+
3+
import io.swagger.v3.oas.models.Components;
4+
import io.swagger.v3.oas.models.OpenAPI;
5+
import io.swagger.v3.oas.models.security.SecurityScheme;
6+
import io.swagger.v3.oas.models.servers.Server;
7+
import java.util.List;
8+
import org.springframework.beans.factory.annotation.Value;
9+
import org.springframework.context.annotation.Bean;
10+
import org.springframework.context.annotation.Configuration;
11+
12+
@Configuration
13+
public class OpenApiConfig {
14+
15+
@Value("${swagger.server.url}")
16+
private String serverUrl;
17+
18+
@Bean
19+
public OpenAPI openApi() {
20+
return new OpenAPI()
21+
.components(securityComponents())
22+
.servers(List.of(new Server().url(serverUrl)));
23+
}
24+
25+
private Components securityComponents() {
26+
return new Components()
27+
.addSecuritySchemes(
28+
"AccessToken",
29+
new SecurityScheme()
30+
.type(SecurityScheme.Type.HTTP)
31+
.scheme("bearer")
32+
.bearerFormat("JWT")
33+
);
34+
}
35+
36+
}

src/main/java/ddingdong/ddingdongBE/common/config/SecurityConfig.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package ddingdong.ddingdongBE.common.config;
22

3-
import static org.springframework.http.HttpMethod.*;
3+
import static org.springframework.http.HttpMethod.GET;
44

55
import ddingdong.ddingdongBE.auth.service.JwtAuthService;
66
import ddingdong.ddingdongBE.common.filter.JwtAuthenticationFilter;
@@ -29,15 +29,17 @@ public SecurityFilterChain filterChain(HttpSecurity http, JwtAuthService authSer
2929
throws Exception {
3030
http
3131
.authorizeHttpRequests()
32-
.antMatchers(API_PREFIX + "/auth/**")
32+
.antMatchers(API_PREFIX + "/auth/**",
33+
API_PREFIX + "/events/**")
3334
.permitAll()
35+
.antMatchers(API_PREFIX + "/admin/**").hasRole("ADMIN")
36+
.antMatchers(API_PREFIX + "/club/**").hasRole("CLUB")
3437
.antMatchers(GET,
3538
API_PREFIX + "/clubs/**",
3639
API_PREFIX + "/notices/**",
3740
API_PREFIX + "/banners/**")
3841
.permitAll()
39-
.antMatchers(API_PREFIX + "/admin/**").hasRole("ADMIN")
40-
.antMatchers(API_PREFIX + "/club/**").hasRole("CLUB")
42+
.antMatchers("/v3/api-docs/**", "/swagger-ui/**", "/swagger-resources/**").permitAll()
4143
.anyRequest()
4244
.authenticated()
4345
.and()

src/main/java/ddingdong/ddingdongBE/common/exception/ErrorMessage.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,10 @@ public enum ErrorMessage {
1515
NO_SUCH_CLUB("해당 동아리가 존재하지 않습니다."),
1616
NO_SUCH_NOTICE("해당 공지사항이 존재하지 않습니다."),
1717
NO_SUCH_ACTIVITY_REPORT("해당 활동보고서가 존재하지 않습니다."),
18+
NO_SUCH_QR_STAMP_HISTORY("이벤트 참여 내역이 존재하지 않습니다."),
1819
INVALID_CLUB_SCORE_VALUE("동아리 점수는 0 ~ 999점 입니다."),
1920
INVALID_PASSWORD("잘못된 비밀번호입니다."),
21+
INVALID_STAMP_COUNT_FOR_APPLY("스탬프를 모두 모아야 이벤트에 참여할 수 있어요!"),
2022
ACCESS_DENIED("접근권한이 없습니다."),
2123
UNREGISTER_ID("등록되지 않은 ID입니다."),
2224
NO_SUCH_BANNER("해당 배너가 존재하지 않습니다."),

src/main/java/ddingdong/ddingdongBE/common/exception/ExceptionController.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import static ddingdong.ddingdongBE.common.exception.ErrorMessage.*;
44

55
import java.util.NoSuchElementException;
6+
import lombok.extern.slf4j.Slf4j;
67
import org.springframework.http.HttpStatus;
78
import org.springframework.http.ResponseEntity;
89
import org.springframework.web.bind.annotation.ExceptionHandler;
@@ -11,19 +12,20 @@
1112
import org.springframework.web.multipart.support.MissingServletRequestPartException;
1213

1314
@RestControllerAdvice
15+
@Slf4j
1416
public class ExceptionController {
1517

1618
@ExceptionHandler(RuntimeException.class)
1719
@ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
1820
public ExceptionResponse handleRuntimeException(RuntimeException e) {
19-
e.printStackTrace();
21+
log.info(e.getMessage());
2022
return ExceptionResponse.of(HttpStatus.INTERNAL_SERVER_ERROR, INTERNAL_SERVER_ERROR.getText());
2123
}
2224

2325
@ExceptionHandler(Exception.class)
2426
@ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
2527
public ExceptionResponse handleException(Exception e) {
26-
e.printStackTrace();
28+
log.info(e.getMessage());
2729
return ExceptionResponse.of(HttpStatus.INTERNAL_SERVER_ERROR, INTERNAL_SERVER_ERROR.getText());
2830
}
2931

@@ -34,9 +36,9 @@ public ExceptionResponse handleIllegalArgumentException(IllegalArgumentException
3436
}
3537

3638
@ExceptionHandler(NoSuchElementException.class)
37-
@ResponseStatus(HttpStatus.NOT_FOUND)
39+
@ResponseStatus(HttpStatus.BAD_REQUEST)
3840
public ExceptionResponse handleNoSuchElementException(NoSuchElementException e) {
39-
return ExceptionResponse.of(HttpStatus.NOT_FOUND, e.getMessage());
41+
return ExceptionResponse.of(HttpStatus.BAD_REQUEST, e.getMessage());
4042
}
4143

4244
@ExceptionHandler(AuthenticationException.class)
@@ -55,4 +57,4 @@ public ResponseEntity<ExceptionResponse> handleAuthenticationException(Authentic
5557
public ExceptionResponse handleMissingServletRequestPartException(MissingServletRequestPartException e) {
5658
return ExceptionResponse.of(HttpStatus.BAD_REQUEST, e.getMessage());
5759
}
58-
}
60+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package ddingdong.ddingdongBE.common.utils;
2+
3+
import ddingdong.ddingdongBE.domain.event.controller.dto.response.EventQrResponse;
4+
import org.springframework.stereotype.Component;
5+
6+
@Component
7+
public class EventQrGenerator {
8+
9+
public static final String URI_PREFIX = "https://chart.apis.google.com/chart?cht=qr&chs=250x250&chl=";
10+
11+
public EventQrResponse generateQrCodeUri(String studentName, String studentNumber) {
12+
String uri = URI_PREFIX + "https://ddingdong.club/event/code?studentName=" + studentName + "%26" + "studentNumber=" + studentNumber;
13+
14+
return EventQrResponse.of(uri);
15+
}
16+
}

0 commit comments

Comments
 (0)