Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@ jobs:
ACTIVEMQ_PASSWORD: ${{ secrets.ACTIVEMQ_PASSWORD }}
ACTIVEMQ_PORT: ${{ secrets.ACTIVEMQ_PORT }}
JUDGE0_URL: ${{ secrets.JUDGE0_URL }}
ELASTICSEARCH_ADDRESS: ${{ secrets.ELASTICSEARCH_ADDRESS }}
ELASTICSEARCH_USERNAME: ${{ secrets.ELASTICSEARCH_USERNAME }}
ELASTICSEARCH_PASSWORD: ${{ secrets.ELASTICSEARCH_PASSWORD }}
ELASTICSEARCH_PORT: ${{ secrets.ELASTICSEARCH_PORT }}
OPEN_API_URL: ${{ secrets.OPEN_API_URL }}
OPEN_API_KEY: ${{ secrets.OPEN_API_KEY }}
CLIENT_ID: ${{ secrets.CLIENT_ID }}
Expand Down
4 changes: 0 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,6 @@ dependencies {
implementation 'org.springframework.boot:spring-boot-starter-actuator'
runtimeOnly 'io.micrometer:micrometer-registry-prometheus'

// elasticsearch + elasticsearch 쿼리빌더 dsl
implementation 'org.springframework.boot:spring-boot-starter-data-elasticsearch'
implementation 'co.elastic.clients:elasticsearch-java:8.18.2'

// activemq
implementation 'org.apache.activemq:activemq-broker:6.1.6'

Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ my.ezcode.codetest
| **🖥️ 언어** | Java 17 |
| **🔧 백엔드** | Spring Boot, Spring Data JPA, QueryDSL |
| **🔐 보안** | Spring Security, JWT |
| **💾 데이터베이스** | MySQL, Redis, MongoDB, Elastic search |
| **💾 데이터베이스** | MySQL, Redis, MongoDB |
| **📨 메시지 큐** | ActiveMQ, Redis Stream |
| **🧠 개발 도구 (IDE)** | IntelliJ IDEA |
| **🌐 외부 API** | Gmail SMTP, OpenAI, Judge0 |
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;

import org.ezcode.codetest.application.problem.dto.request.CategoryCreateRequest;
Expand All @@ -26,7 +27,6 @@
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
Expand Down Expand Up @@ -70,9 +70,16 @@ public void createProblem(ProblemCreateRequest requestDto, MultipartFile image,

}

// 검색 키워드 자동 완성
@Transactional(readOnly = true)
public Set<String> getSearchKeywordSuggestions(String keyword) {

return problemDomainService.getSearchKeywordSuggestions(keyword);
}

// 문제 전체 조회
@Transactional(readOnly = true)
public Page<ProblemResponse> getProblemsList(Pageable pageable, ProblemSearchCondition searchCondition) {
public Page<ProblemResponse> getProblemWithCondition(Pageable pageable, ProblemSearchCondition searchCondition) {

Page<Problem> problemPage = problemDomainService.getProblemBySearchCondition(pageable, searchCondition);
List<Problem> problems = problemPage.getContent();
Expand Down
15 changes: 15 additions & 0 deletions src/main/java/org/ezcode/codetest/common/config/WebConfig.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package org.ezcode.codetest.common.config;

import org.ezcode.codetest.presentation.problemmanagement.problem.StringToDifficultyConverter;
import org.springframework.context.annotation.Configuration;
import org.springframework.format.FormatterRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class WebConfig implements WebMvcConfigurer {

@Override
public void addFormatters(FormatterRegistry registry) {
registry.addConverter(new StringToDifficultyConverter());
}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,28 @@
package org.ezcode.codetest.domain.problem.model;

import org.ezcode.codetest.domain.problem.model.enums.Difficulty;

public record ProblemSearchCondition(
String category,

String difficulty
String categoryCode,

Difficulty difficulty,

String keyword

) {

public ProblemSearchCondition {

categoryCode = cleanString(categoryCode);
keyword = cleanString(keyword);
}

private static String cleanString(String input) {

if (input == null || input.isBlank()) {
return null;
}
return input.trim();
}
}
Loading