Skip to content

Commit

Permalink
Null 295 api docs refactor and pagination (#28)
Browse files Browse the repository at this point in the history
* refactor: controller변경

* refactor: api doc 변경

* feat: dto 생성 및 수정

* chore: 디렉토리명 변경

* refactor: 서비스 코드 수정1

* chore: model 생성 및 수정

* chore: inner dto 수정

* refactor: 메모 추가, 태그 추가 리팩터링

* refactor: 단일/복수 메모 추가 및 리팩터링

* chore: tag추가 차단

* chore: AI 명칭 변경

* chore: 오류 수정

* refactor: 메모 검색, 업데이트 수정

* chore: 오류 해결

* chore: ai 서버 오류 해결

* refactor: ai 엔드포인트 변경 반영

* chore: 메모에 태그 추가 기능 삭제

* chore: 메모에 연결된 태그 찾는 메소드 추가

* chore: 줄넘김 제거

* chore: 폴더명 변경

* feat: 페이지네이션 구현

* fix: 루트 태그 api제거

* chore: 사용안하는 import문, class 삭제

* fix: ai api 수정

* chore: 임시 유저 아이디 추가

* feat: 회원가입시 루트태그 생성 기능 추가

* refactor: id를 UUID형식으로 변경

* refactor: builder형식 대신 생성자 사용

* chore: UUID 변경 전체 적용

* chore: ai code review 환경값 수정

* fix: 피드백 반영1

* fix: 메모 추가 오류 수정

* Origin/null 311 divide user db (#29)

* feat: 토큰에 유저id 추가

* feat: controller에 userId 매개변수 추가

* feat: user별로 데이터 접근 분리

* fix: ai코드리뷰 제한

* fix: ai 코드리뷰 수정

* fix: ai 코드리뷰 수정2

* fix: ai 코드리뷰 수정3

* fix: ai 코드리뷰 수정4

* fix: ai코드리뷰 reopen시에만 적용

* fix: 메모 추가 오류 수정

* refactor: api doc 수정

* chore: 클래스명 변경

* chore: user api 수정

* fix: 오류 해결
  • Loading branch information
BaeJinho4028 authored Sep 11, 2024
1 parent efebb4c commit ba5f8c7
Show file tree
Hide file tree
Showing 87 changed files with 1,536 additions and 1,174 deletions.
13 changes: 11 additions & 2 deletions .github/workflows/code_review_from_chatgpt.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
name: Code Review From ChatGPT

permissions:
contents: read
pull-requests: write

on:
pull_request:
types: [opened, synchronize]
types: [ reopened ]

jobs:
code-review:
runs-on: ubuntu-latest
Expand All @@ -14,4 +17,10 @@ jobs:
GITHUB_TOKEN: ${{ github.token }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
LANGUAGE: Korean
MODEL: gpt-4o
MODEL: gpt-4o-mini
top_p: 1
temperature: 1
PROMPT: |
Please focus only on critical errors and major issues in the code review. Provide a single, concise response that highlights the most significant problems. Avoid giving extensive feedback on minor or stylistic issues. Summarize your comments and prioritize the most impactful suggestions for improvement.
max_tokens: 5000
MAX_PATCH_LENGTH: 3000
1 change: 0 additions & 1 deletion src/main/java/com/example/oatnote/_config/MongoConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import org.springframework.data.mongodb.config.EnableMongoAuditing;

@Configuration
@EnableMongoAuditing
public class MongoConfig {

}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
import org.springframework.web.client.RestTemplate;

import com.example.oatnote.memo.service.client.exception.AiResponseErrorHandler;
import com.example.oatnote.memoTag.service.client.exception.AIResponseErrorHandler;
import com.fasterxml.jackson.databind.ObjectMapper;

import lombok.RequiredArgsConstructor;
Expand All @@ -20,7 +20,7 @@ public class RestTemplateConfig {
public RestTemplate restTemplate() {
RestTemplate restTemplate = new RestTemplate();
restTemplate.getMessageConverters().add(0, new MappingJackson2HttpMessageConverter(objectMapper));
restTemplate.setErrorHandler(new AiResponseErrorHandler());
restTemplate.setErrorHandler(new AIResponseErrorHandler());
return restTemplate;
}
}
4 changes: 2 additions & 2 deletions src/main/java/com/example/oatnote/_config/SecurityConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Excepti
http
.csrf(AbstractHttpConfigurer::disable)
.authorizeHttpRequests(authorize -> authorize
.requestMatchers("/memos/{memoId}/tags").authenticated() //TODO 경로 수정
.requestMatchers("/**").permitAll()
.requestMatchers("/user/login", "/user/register", "/user/refresh").permitAll()
.requestMatchers("/swagger-ui.html", "/swagger-ui/**", "/v3/api-docs/**").permitAll()
.anyRequest().authenticated()
)
.addFilterBefore(jwtAuthenticationFilter, UsernamePasswordAuthenticationFilter.class)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package com.example.oatnote.event.listener;

import java.util.ArrayList;

import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Component;

import com.example.oatnote.event.model.UserRegisteredEvent;
import com.example.oatnote.memoTag.service.tag.TagService;
import com.example.oatnote.memoTag.service.tag.model.Tag;

import lombok.RequiredArgsConstructor;

@Component
@RequiredArgsConstructor
public class CreateRootTagListener {

private final TagService tagService;

@EventListener
public void handleUserRegisteredEvent(UserRegisteredEvent event) {
createDummyTagsForNewUser(event.userId());
}

private void createDummyTagsForNewUser(String userId) {
Tag rootTag = new Tag(
userId,
"@",
userId,
new ArrayList<>()
);
tagService.saveTag(rootTag);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.example.oatnote.event.model;

public record UserRegisteredEvent(
String userId
) {

}
138 changes: 0 additions & 138 deletions src/main/java/com/example/oatnote/memo/MemoTagController.java

This file was deleted.

Loading

0 comments on commit ba5f8c7

Please sign in to comment.