-
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.
- Loading branch information
Showing
13 changed files
with
374 additions
and
215 deletions.
There are no files selected for viewing
23 changes: 14 additions & 9 deletions
23
src/main/java/com/endlesshorses/oot/custom/accessory/service/AccessoryService.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 |
---|---|---|
@@ -1,24 +1,29 @@ | ||
package com.endlesshorses.oot.custom.accessory.service; | ||
|
||
import com.endlesshorses.oot.custom.accessory.dto.AccessoryListResponseDto; | ||
import com.endlesshorses.oot.custom.accessory.enity.Accessory; | ||
import com.endlesshorses.oot.custom.accessory.repository.AccessoryRepository; | ||
import org.springframework.transaction.annotation.Transactional; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.stereotype.Service; | ||
import org.springframework.transaction.annotation.Transactional; | ||
|
||
import java.util.List; | ||
import java.util.stream.Collectors; | ||
|
||
@Service | ||
@RequiredArgsConstructor | ||
public class AccessoryService { | ||
private final AccessoryRepository accessoryRepository; | ||
private final AccessoryRepository accessoryRepository; | ||
|
||
// 액세서리 전체 목록 조회 | ||
@Transactional(readOnly = true) | ||
public List<AccessoryListResponseDto> list() { | ||
return accessoryRepository.findAll().stream() | ||
.map(AccessoryListResponseDto::new) | ||
.collect(Collectors.toList()); | ||
} | ||
|
||
// 액세서리 전체 목록 조회 | ||
@Transactional(readOnly = true) | ||
public List<AccessoryListResponseDto> list() { | ||
return accessoryRepository.findAll().stream() | ||
.map(AccessoryListResponseDto::new) | ||
.collect(Collectors.toList()); | ||
} | ||
public Accessory read(Long id) { | ||
return accessoryRepository.findById(id).orElseThrow(); | ||
} | ||
} |
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
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
43 changes: 43 additions & 0 deletions
43
src/main/java/com/endlesshorses/oot/custom/result/dto/ResultGetResponseDto.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,43 @@ | ||
package com.endlesshorses.oot.custom.result.dto; | ||
|
||
import com.endlesshorses.oot.custom.accessory.enity.Accessory; | ||
import com.endlesshorses.oot.custom.color.entity.Color; | ||
import com.endlesshorses.oot.custom.font.entity.Font; | ||
import com.endlesshorses.oot.custom.pattern.entity.Pattern; | ||
import com.endlesshorses.oot.custom.result.entity.Result; | ||
import com.endlesshorses.oot.custom.wheel.entity.Wheel; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
import java.time.LocalDateTime; | ||
|
||
@Getter | ||
@NoArgsConstructor | ||
public class ResultGetResponseDto { | ||
private String id; | ||
|
||
private Pattern pattern; | ||
|
||
private Wheel wheel; | ||
|
||
private Font font; | ||
|
||
private Color color; | ||
|
||
private Accessory accessory; | ||
|
||
private LocalDateTime createdAt; | ||
|
||
@Builder | ||
public ResultGetResponseDto(Result result) { | ||
this.id = result.getId(); | ||
this.pattern = result.getPattern(); | ||
this.wheel = result.getWheel(); | ||
this.font = result.getFont(); | ||
this.color = result.getColor(); | ||
this.accessory = result.getAccessory(); | ||
this.createdAt = result.getCreatedAt(); | ||
} | ||
|
||
} |
17 changes: 17 additions & 0 deletions
17
src/main/java/com/endlesshorses/oot/custom/result/dto/ResultPostResponseDto.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,17 @@ | ||
package com.endlesshorses.oot.custom.result.dto; | ||
|
||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.Setter; | ||
|
||
@Getter | ||
@Setter | ||
@NoArgsConstructor | ||
public class ResultPostResponseDto { //주는 DTO | ||
private String id; | ||
|
||
public ResultPostResponseDto(String id) { | ||
this.id = id; | ||
} | ||
|
||
} |
28 changes: 28 additions & 0 deletions
28
src/main/java/com/endlesshorses/oot/custom/result/dto/ResultRequestDto.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,28 @@ | ||
package com.endlesshorses.oot.custom.result.dto; | ||
|
||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.Setter; | ||
|
||
@Setter | ||
@Getter | ||
@NoArgsConstructor | ||
public | ||
class ResultRequestDto { //요청 DTO | ||
private Long patternId; | ||
private Long wheelId; | ||
private Long fontId; | ||
private Long colorId; | ||
private Long accessoryId; | ||
|
||
@Builder | ||
public ResultRequestDto(Long patternId, Long wheelId, Long fontId, Long colorId, Long accessoryId) { | ||
this.patternId = patternId; | ||
this.wheelId = wheelId; | ||
this.fontId = fontId; | ||
this.colorId = colorId; | ||
this.accessoryId = accessoryId; | ||
} | ||
|
||
} |
42 changes: 0 additions & 42 deletions
42
src/main/java/com/endlesshorses/oot/custom/result/dto/ResultResponseDTO.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
Oops, something went wrong.