-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* feat: Add ResponseDto * feat: Mission category GET api
- Loading branch information
Showing
5 changed files
with
102 additions
and
3 deletions.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
src/main/java/com/universe/uni/controller/MissionController.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,26 @@ | ||
package com.universe.uni.controller; | ||
|
||
import org.springframework.http.HttpStatus; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.PathVariable; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.ResponseStatus; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
import com.universe.uni.dto.response.MissionCategoryResponseDto; | ||
import com.universe.uni.service.MissionService; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
|
||
@RestController | ||
@RequiredArgsConstructor | ||
@RequestMapping("/api/mission") | ||
public class MissionController { | ||
private final MissionService missionService; | ||
|
||
@GetMapping("/{missionCategoryId}") | ||
@ResponseStatus(HttpStatus.OK) | ||
public MissionCategoryResponseDto getMissionCategory(@PathVariable Long missionCategoryId) { | ||
return missionService.getMissionCategory(missionCategoryId); | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
src/main/java/com/universe/uni/dto/response/MissionCategoryResponseDto.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,19 @@ | ||
package com.universe.uni.dto.response; | ||
|
||
import java.util.List; | ||
|
||
import com.fasterxml.jackson.annotation.JsonPropertyOrder; | ||
|
||
import lombok.Builder; | ||
|
||
@JsonPropertyOrder({"id", "title", "description", "tip", "image", "missionContentList"}) | ||
@Builder | ||
public record MissionCategoryResponseDto( | ||
Long id, | ||
String title, | ||
String description, | ||
String tip, | ||
String image, | ||
List<MissionContentResponseDto> missionContentList | ||
) { | ||
} |
13 changes: 13 additions & 0 deletions
13
src/main/java/com/universe/uni/dto/response/MissionContentResponseDto.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,13 @@ | ||
package com.universe.uni.dto.response; | ||
|
||
import com.fasterxml.jackson.annotation.JsonPropertyOrder; | ||
|
||
import lombok.Builder; | ||
|
||
@JsonPropertyOrder({"id", "content"}) | ||
@Builder | ||
public record MissionContentResponseDto( | ||
Long id, | ||
String content | ||
) { | ||
} |
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