Skip to content

Commit

Permalink
feat: csv dependency 추가 및 예외 메세지 이름 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
juno-junho committed May 17, 2024
1 parent 721b709 commit b38e868
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 24 deletions.
16 changes: 12 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -43,23 +43,31 @@ dependencies {
// concurrent-trees for trie
implementation 'com.googlecode.concurrent-trees:concurrent-trees:2.6.1'

// apache commons csv for csv generating csv file
implementation 'org.apache.commons:commons-csv:1.11.0'

// springboot
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-security'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-validation'

// mail
implementation 'org.springframework.boot:spring-boot-starter-mail'
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'

compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'

// database
runtimeOnly 'com.h2database:h2'
runtimeOnly 'com.mysql:mysql-connector-j'

// test
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.springframework.restdocs:spring-restdocs-mockmvc'
testImplementation 'org.springframework.security:spring-security-test'

// mail
implementation 'org.springframework.boot:spring-boot-starter-mail'
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'

// monitoring
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'io.micrometer:micrometer-registry-prometheus'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

import java.util.List;

import static com.spaceclub.global.annotation.profanity.BadWordExceptionMessage.BAD_WORD_DETECTED;
import static com.spaceclub.global.annotation.profanity.ProfanityExceptionMessage.BAD_WORD_DETECTED;
import static com.spaceclub.global.exception.GlobalExceptionCode.INVALID_REQUEST;
import static com.spaceclub.global.exception.GlobalExceptionCode.MAX_IMAGE_SIZE_EXCEEDED;
import static org.springframework.http.HttpStatus.BAD_REQUEST;
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package com.spaceclub.global.annotation.profanity;

import lombok.Getter;

@Getter
public enum ProfanityExceptionMessage {

FAIL_BAD_WORD_SETUP("비속어 목록 Trie 생성 실패"),
BAD_WORD_DETECTED("비속어가 발견 되었습니다"),
INVALID_EXTENSION("md,txt 파일만 업로드 가능합니다."),
FAILED_TO_SAVE("금칙어 저장에 실패하였습니다."),
BAD_WORD_ALREADY_EXISTS("이미 존재하는 금칙어입니다."),
FAILED_TO_CREATE_CSV("CSV 파일 생성에 실패하였습니다.")
;

private final String message;

ProfanityExceptionMessage(String message) {
this.message = message;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import java.util.Spliterator;
import java.util.stream.StreamSupport;

import static com.spaceclub.global.annotation.profanity.BadWordExceptionMessage.FAIL_BAD_WORD_SETUP;
import static com.spaceclub.global.annotation.profanity.ProfanityExceptionMessage.FAIL_BAD_WORD_SETUP;

@Slf4j
@Component
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@

import org.springframework.boot.context.properties.ConfigurationProperties;

import java.util.List;

@ConfigurationProperties(prefix = "profanity")
public record ProfanityConfig(
String filePath
String filePath,
List<String> validExtensions
) {

}

0 comments on commit b38e868

Please sign in to comment.