Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEAT] 과제 제안 API 개발 & 이메일 API 개발 #68

Open
wants to merge 16 commits into
base: feat/46-proposal-api/base
Choose a base branch
from

Conversation

jcy0308
Copy link
Member

@jcy0308 jcy0308 commented Aug 16, 2024

작성자: @jcy0308

#46

체크 리스트

  • 적절한 제목으로 수정했나요?
  • 상단에 이슈 번호를 기입했나요?
  • Target Branch를 올바르게 설정했나요?
  • Reviewers/Assignees/Labels을 알맞게 설정했나요?

작업 내역

  • GetProposals
  • GetProposal
  • CreateProposal
  • UpdateProposal
  • DeleteProposal
  • GetProposalApply
  • CreateProposalApply
  • UpdateProposalApply
  • DeleteProposalApply

남은 구현

  • Proposal Entity에 fileUuid 추가
  • Email 템플릿 작성
  • 이메일을 보내야 하는 API 선정. 현재는 CreateProposal, CreateProposalApply만 적용
  • 컨트롤러 테스트 및 RestDocs 작성
  • integration test 작성

비고

  • 현재는 비동기 방식으로 email이 스프링에서 전송되도록 구현했습니다. 추후에 카프카로 교체될 가능성이 있어서 EmailService를 인터페이스 형식으로 구현했습니다. EmailService 구현체를 Kafka 프로듀서로 교체하면 됩니다.

2tle and others added 14 commits August 9, 2024 15:01
* feat: talk 및 jobInterview 레포지토리 추가

* feat: jobInterview DTO 추가

* feat: add create and get jobinterview api

* feat: add update and delete jobinterview api

* fix: change BaseVideoEntity access level

* refactor: add new line in JobInterview Category

* refactor: change dto name

* fix: change string check annotation to NotBlank

* refactor: change category enum class name

* feat: add enum validator

* refactor: apply dto format discussed in PR #12

* fix: apply static factory method

* chore: remove superbuilder annotation in BaseTimeEntity

* chore: transactional 어노테이션 클래스로 이동

* chore: 엔티티 객체 생성 스타일 변경

* fix: pathVariable 명시

* fix: cascade 옵션 변경

* chore: dirty checking 사용하는 방법으로 update 변경

* feat: change exception to custom BadRequestException

* chore: 접근제어자 제거

* feat: 잡페어 인터뷰 생성 테스트코드 작성

* feat: add JobInterview create Testcode

* fix: ExceptionCode 추가 및 변경사항 대응

* feat: 잡페어 인터뷰 컨트롤러 테스트

* feat: 잡페어 인터뷰 RestDocs

* feat: create QuizRepository

* feat: add Talk Request/Response DTO

* feat: implement talkservice and add exception code

* feat: implement talkController

* feat: implement TalkControllerTest

* feat: implement TalkControllerTest

* feat: 대담영상 api 문서 작성

* feat: 퀴즈 포함 대담 API 구현

* fix: 대담 연관관계 업데이트 버그 수정

* feat: add talker belonging and name field in jobinterview entity

* feat: update jobinterview testcode

* chore: remove status header

* feat: remove HasQuiz And Apply JsonUnwrapped Annotation

* refactor: remove Talks(List) Response DTO

* feat: update TalkController TestCode

* chore: update Talk API Docs

* refactor: 엔티티에서 DTO 사용 제거

* feat: @authuser 적용 및 testcode 수정

* chore: add token to request cookie and header

* fix: change local.yml

* refactor: change video package location

* refactor: test code 패키지 변경

* fix: change db url in local.yml
* feat: Add Notice,EventNotice entity Superbuilder, setter for update

* feat: Implement NoticeDto Inner Static class

* feat: Implement NoticeRepository

* feat: Implement NoticeService interface, NoticeServiceImpl

* feat: Implement NoticeController

* fix: @NoArgsConstructor(access = PROTECTED) for entities

* fix: change url, dto (request) field, add validation

* fix: remove service interface

* fix: change exception to bad request exception

* feat: implement getNoticeList api, minor renaming controller parameter

* fix: move @transactional annotation

* fix: remove @DaTa annotation

* refactor: refactor package structure

* fix: split response, request dto

* fix: Use static factory method instead of builder pattern

* feat: change put/post to return entity value, change update logic (use repository), fix minor naming

* feat: Implement increasing hitCount when getNotice

* fix: change protect constructor of BaseNoticeEntity to use annotation

* fix: Revise static factory method to use `from`

* [FEAT] Global Exception, Test, Restdocs 설정 (#17)

* feat: validator exception handler, BadrequestException 추가

* feat: controller test 설정 추가

* feat: index.adoc 추가

* feat: request field 템플릿 추가

* refactor: request field snippet 들여쓰기 수정

* feat: exception logger 추가

* feat: Implement RestDocs, base test code for NoticeController, change exception

- cherry-pick develop branch's 0f55de6 commit
- only for create notice
- revise to use custom BadRequestException

* fix: Add cascade option in Notice Entity

* fix: Revise parameter naming for pathvariable annotaion

* fix: Fix wrong service method description

* feat: change updateNotice, increaseHitCount to use entity method

* feat: Implement attached files handling, add NoticeListElementResponse

* refactor: rename DTOs

* fix: Revise Notice/EventNotice entity to not inherit BaseNoticeEntity

* minor renaming variables

* feat: Implement Test code/RestDocs for NoticeController

* cherry-pick: revised custom exception code #21

* feat: add custom exceptions for notice, notnull annotation for fileIds field

* refactor: rename NoticeResponse fileReponses field to files

* fix: revise NoticeService to work with request with no fileIds field

* fix: refine controllerTest code for restDocs

* fix: add pageable parameter in controllerTest

* refactor: remove unnecessary annotation

* feat: duplicate notice api for eventNotice api

* refactor: reformat (clean) code

* fix: change exception code number to prevent conflict

* feat: implement fixed notices prioritization

* refactor: change :path to {path} in adoc

* refactor: refactor adoc files

* refactor: remove debugging line for getNoticeList

* feat: new logic for updateNotice file handling (using Cascade=ALL)

* cherrypick: auth commit from develop branch

* refactor: move domain package location

* feat: duplicate eventNotice getList, update code from Notice

* refactor: remove unused import statement

* feat: auth user (admin) for create, update, delete

* feat: revise test code for auth user

* fix: Typo correction

* fix: add application-local.yml for CI

* chore: remove unnecessary comments

* refactor: move notice/eventNotice controller test package

---------

Co-authored-by: yesjuhee <[email protected]>
Co-authored-by: chanyeong <[email protected]>
* feat: EventPeriod  리포지터리 생성

* feat: devtools 패키지 추가

* feat: 엔티티에 SupeBuilder 추가

* feat: EventPeriodDto 작성

* feat:EventPeriodController 구현

* feat: EventPeriodService 구현

* refactor: 사용 안하는 import 삭제

* feat: test configurations

* feat: EvnetPeriodController 테스트 코드 작성

* feat: createEventPeriod 테스트코드, restdocs 코드 구현

* feat: GlobalExceptionHandler 추가, validation 실패시 응답바디 포멧 수정

* fix: builder 제거, DTO 분리

* feat: 정적 팩토리 메서드 사용하는 방식으로 createEventPeriod 메서드 수정

* feat: BadRequestExcption 추가

* fix: DTO 구조 변경에 맞춰 테스트 수정

* fix: Bad Request 테스트 수정, 해당 테스트 restdocs에서 제외시킴

* feat: 커스텀 에러 코드를 사용하는 방식으로 Exception Handler 수정

* fix: dto validation에 대한 응답도 ExceptionCode를 사용하도록 수정

* refactor: EventPeriodRequest -> CreateEventPeriodRequest 로 변경

* feat: getEvnetPeriods api 구현

* feat: getEventPeriods API 테스트, restdocs 구현

* fix: gitignore에 static/docs 추가

* feat: deleteEventPeriod controller 작성

* refactor: 컨트롤러 refactor

* feat: deleteEventPeriod service 구현

* feat: deleteEventPeriod test

* refactor: MockMvcRequestBuilders -> RestDocumentationRequestBuilders 로 변경

* feat: restdocs 추가

* refactor: merge conflict resolve 생략된거 해결

* refactor: index.adoc 머지 오류 수정

* fix: 도메인에서 DTO 사용 제외

* fix: createEventPeriod 요청 형식, 로직 수정

* fix: EventPeriod 조회 API 수정(리스트 조회 -> 단건 조회)

* feat: deleteEventPeriod API 삭제, updateEventPeriod API 추가

* feat: Auth 설정 추가

* refactor: event 도메인 폴더 위치 변경

* fix: test, restdocs 수정

* fix: TEST Auth 설정 추가

* fix: getEventPeriods API 복구

* fix: application-local.yml 복구

* chore: 주석 삭제

* chor: 누락된 adoc 파일 추가
@jcy0308 jcy0308 requested review from simta1 and shj1081 August 16, 2024 12:04
@jcy0308 jcy0308 self-assigned this Aug 16, 2024
@shj1081
Copy link
Contributor

shj1081 commented Aug 16, 2024

수고하셨습니다! 👍🏻👍🏻

메일 전송의 경우 application-email.yml 만들어서 테스트 해보려했는데, 저는 메일 발송이 잘 안되는 것 같아 yml 형식 질문드려도 될까요?

spring:
  mail:
    host: smtp.google.com
    port: 587
    username: {google id}
    password: {app password}
    properties:
      mail:
        smtp:
          auth: true
          debug: true
          timeout: 5000
          starttls:
            enable: true

이렇게 두고 테스트 하였었습니다 (gmail 에서 IMAP 설정은 해두었습니다)

@jcy0308
Copy link
Member Author

jcy0308 commented Aug 16, 2024

수고하셨습니다! 👍🏻👍🏻

메일 전송의 경우 application-email.yml 만들어서 테스트 해보려했는데, 저는 메일 발송이 잘 안되는 것 같아 yml 형식 질문드려도 될까요?

spring:
  mail:
    host: smtp.google.com
    port: 587
    username: {google id}
    password: {app password}
    properties:
      mail:
        smtp:
          auth: true
          debug: true
          timeout: 5000
          starttls:
            enable: true

이렇게 두고 테스트 하였었습니다 (gmail 에서 IMAP 설정은 해두었습니다)

앗 설정파일은 슬랙으로 공유드리겠습니다

@shj1081
Copy link
Contributor

shj1081 commented Aug 21, 2024

혹시 문의 관련 API 에서도 mail 발송을 위해 proposalEvent 를 MailEvent 로 바꾸어 global domain 으로 이동하여 사용하는 것이 가능할까요?

recipient, subject, body 의 형식이 동일하게 사용되는 것 같아 질문드립니다

@jcy0308
Copy link
Member Author

jcy0308 commented Aug 23, 2024

혹시 문의 관련 API 에서도 mail 발송을 위해 proposalEvent 를 MailEvent 로 바꾸어 global domain 으로 이동하여 사용하는 것이 가능할까요?

recipient, subject, body 의 형식이 동일하게 사용되는 것 같아 질문드립니다

EmailEvent로 통일하겠습니다

@shj1081
Copy link
Contributor

shj1081 commented Aug 23, 2024

수고하셨습니다ㅏㅏ 👍👍

  • proposal reply 와 proposal 이 one to one 관계이기에, controller 부분에서는 replyId 가 불필요해보이고, service 의 경우도 로직 수정이 필요한 것 같습니당 (하나의 제안에 하나의 답변? 일단 문의 사항의 경우도 동일하게 처리하였습니다)

  • getProposalReply api가 누락된 것 같습니당

shj1081 added a commit that referenced this pull request Aug 23, 2024
* 과제 제안 API PR의 mail 관련 설정 참고
Copy link
Contributor

@yesjuhee yesjuhee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

혹시 테스트 코드가 누락된 것 같은데 확인해주실 수 있나욥?!

@@ -2,6 +2,6 @@ spring:
profiles:
default: local
group:
local: common, oauth
local: common, oauth, email
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prod에도 email 추가해놓는게 좋을 것 같습니다

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants