-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #175 from CEOS-Developers/dev
[fix] 서류 결과 확인 response 생성 로직 수정
- Loading branch information
Showing
36 changed files
with
860 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,3 +42,6 @@ out/ | |
|
||
### application ### | ||
application-secret.yml | ||
|
||
### | ||
.env** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 0 additions & 9 deletions
9
src/main/java/ceos/backend/domain/application/enums/SortPartType.java
This file was deleted.
Oops, something went wrong.
7 changes: 0 additions & 7 deletions
7
src/main/java/ceos/backend/domain/application/enums/SortPassType.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
76 changes: 76 additions & 0 deletions
76
src/main/java/ceos/backend/domain/retrospect/RetrospectController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
package ceos.backend.domain.retrospect; | ||
|
||
|
||
import ceos.backend.domain.retrospect.dto.request.CreateRetrospectRequest; | ||
import ceos.backend.domain.retrospect.dto.response.GetRetrospectResponse; | ||
import ceos.backend.domain.retrospect.dto.response.GetRetrospectsResponse; | ||
import ceos.backend.domain.retrospect.service.RetrospectService; | ||
import io.swagger.v3.oas.annotations.Operation; | ||
import io.swagger.v3.oas.annotations.tags.Tag; | ||
import jakarta.validation.Valid; | ||
import lombok.RequiredArgsConstructor; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.validation.annotation.Validated; | ||
import org.springframework.web.bind.annotation.DeleteMapping; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.PathVariable; | ||
import org.springframework.web.bind.annotation.PostMapping; | ||
import org.springframework.web.bind.annotation.PutMapping; | ||
import org.springframework.web.bind.annotation.RequestBody; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RequestParam; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
@Slf4j | ||
@RestController | ||
@RequiredArgsConstructor | ||
@Validated | ||
@RequestMapping(value = "/retrospect") | ||
@Tag(name = "Retrospect") | ||
public class RetrospectController { | ||
private final RetrospectService retrospectService; | ||
|
||
@Operation(summary = "회고록 목록 보기") | ||
@GetMapping | ||
public GetRetrospectsResponse getRetrospects( | ||
@RequestParam("pageNum") int pageNum, @RequestParam("limit") int limit) { | ||
log.info("회고록 목록 보기"); | ||
|
||
return retrospectService.getRetrospects(pageNum, limit); | ||
} | ||
|
||
@Operation(summary = "회고록 상세 보기") | ||
@GetMapping("/{id}") | ||
public GetRetrospectResponse getRetrospect(@PathVariable("id") Long id) { | ||
log.info("회고록 상세 보기"); | ||
|
||
return retrospectService.getRetrospect(id); | ||
} | ||
|
||
@Operation(summary = "회고록 작성") | ||
@PostMapping | ||
public void createRetrospect( | ||
@RequestBody @Valid CreateRetrospectRequest createRetrospectRequest) { | ||
log.info("회고록 작성"); | ||
|
||
retrospectService.createRetrospect(createRetrospectRequest); | ||
} | ||
|
||
@Operation(summary = "회고록 수정") | ||
@PutMapping("/{id}") | ||
public GetRetrospectResponse updateRetrospect( | ||
@PathVariable("id") Long id, | ||
@RequestBody @Valid CreateRetrospectRequest createRetrospectRequest) { | ||
log.info("회고록 수정"); | ||
|
||
return retrospectService.updateRetrospect(id, createRetrospectRequest); | ||
} | ||
|
||
@Operation(summary = "회고록 삭제") | ||
@DeleteMapping("/{id}") | ||
public void deleteRetrospect(@PathVariable("id") Long id) { | ||
log.info("회고록 삭제"); | ||
|
||
retrospectService.deleteRetrospect(id); | ||
} | ||
} |
59 changes: 59 additions & 0 deletions
59
src/main/java/ceos/backend/domain/retrospect/domain/Retrospect.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
package ceos.backend.domain.retrospect.domain; | ||
|
||
|
||
import ceos.backend.domain.retrospect.dto.request.CreateRetrospectRequest; | ||
import ceos.backend.global.common.entity.BaseEntity; | ||
import ceos.backend.global.common.entity.Part; | ||
import jakarta.persistence.Column; | ||
import jakarta.persistence.Entity; | ||
import jakarta.persistence.EnumType; | ||
import jakarta.persistence.Enumerated; | ||
import jakarta.persistence.GeneratedValue; | ||
import jakarta.persistence.GenerationType; | ||
import jakarta.persistence.Id; | ||
import jakarta.validation.constraints.NotBlank; | ||
import jakarta.validation.constraints.NotNull; | ||
import jakarta.validation.constraints.Positive; | ||
import lombok.AccessLevel; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Getter | ||
@NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
@Entity | ||
public class Retrospect extends BaseEntity { | ||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
@Column(name = "retrospect_id") | ||
private Long id; | ||
|
||
@NotBlank private String title; | ||
|
||
@NotBlank private String url; | ||
|
||
@NotBlank private String writer; | ||
|
||
@NotNull @Positive private Integer generation; | ||
|
||
@NotNull | ||
@Enumerated(EnumType.STRING) | ||
private Part part; | ||
|
||
@Builder | ||
public Retrospect(String title, String url, String writer, Integer generation, Part part) { | ||
this.title = title; | ||
this.url = url; | ||
this.writer = writer; | ||
this.generation = generation; | ||
this.part = part; | ||
} | ||
|
||
public void update(CreateRetrospectRequest createRetrospectRequest) { | ||
title = createRetrospectRequest.getTitle(); | ||
url = createRetrospectRequest.getUrl(); | ||
writer = createRetrospectRequest.getWriter(); | ||
generation = createRetrospectRequest.getGeneration(); | ||
part = createRetrospectRequest.getPart(); | ||
} | ||
} |
Oops, something went wrong.