Skip to content

Commit 58d8a20

Browse files
authored
feat : 스킬 리밸런싱, 뽑기 로직 성능 개선, 전투 승리 시 골드를 벌 수 있게끔 변경 (#84)
* feat : 스킬 구현체 추가, swagger 에 표시되게끔 설명 추가 * feat : 스킬 구현체 추가, swagger 에 표시되게끔 설명 추가 * feat : 스킬 리밸런싱, 뽑기 로직 성능 개선, 전투 승리 시 골드를 벌 수 있게끔 변경 * chore : 오타수정 * chore : 오타수정 * feat : 인카운터 수정
1 parent b72f9fd commit 58d8a20

File tree

108 files changed

+1853
-500
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

108 files changed

+1853
-500
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
package org.ezcode.codetest.application.chatting.dto.request;
22

33
import io.swagger.v3.oas.annotations.media.Schema;
4+
import jakarta.validation.constraints.Min;
45
import jakarta.validation.constraints.NotNull;
56

67
@Schema(description = "채팅방 삭제 요청")
78
public record ChatRoomDeleteRequest(
89

910
@Schema(description = "삭제할 채팅방 ID")
1011
@NotNull(message = "삭제하려는 방 ID를 반드시 입력해야합니다")
12+
@Min(value = 1, message = "ID 는 1 이상부터 입력가능합니다.")
1113
Long roomId
14+
1215
) {
1316

1417
}

src/main/java/org/ezcode/codetest/application/chatting/dto/request/ChatRoomSaveRequest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@ public record ChatRoomSaveRequest(
1212

1313
@Schema(description = "생성할 채팅방 제목")
1414
@NotBlank(message = "채팅방 제목은 비어있을 수 없습니다")
15-
@Size(message = "채팅방 이름 길이는 1~15자 사이로 작성해주세요", min = 1, max = 15)
15+
@Size(message = "채팅방 이름 길이는 25자 이내 작성해주세요", max = 25)
1616
String title
17+
1718
) {
1819

1920
public ChatRoom toEntity(User user) {

src/main/java/org/ezcode/codetest/application/chatting/dto/request/ChatSaveRequest.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,17 @@
55
import org.ezcode.codetest.domain.user.model.entity.User;
66

77
import io.swagger.v3.oas.annotations.media.Schema;
8+
import jakarta.validation.constraints.NotBlank;
9+
import jakarta.validation.constraints.Size;
810

911
@Schema(description = "채팅 메시지 생성 요청")
1012
public record ChatSaveRequest(
1113

1214
@Schema(description = "전송할 채팅 메시지")
15+
@NotBlank(message = "전송할 채팅 메시지는 공백일 수 없습니다.")
16+
@Size(message = "채팅방 메시지 길이는 100자 이내로 작성해주세요", max = 100)
1317
String message
18+
1419
) {
1520

1621
public Chat toEntity(User user, ChatRoom room) {

src/main/java/org/ezcode/codetest/application/chatting/dto/response/ChatResponse.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ public record ChatResponse(
2020

2121
@Schema(description = "채팅 메시지")
2222
String message
23+
2324
) {
2425
public static ChatResponse from(Chat chat) {
2526

src/main/java/org/ezcode/codetest/application/chatting/dto/response/RoomChangedResponse.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ public record RoomChangedResponse(
2121

2222
@Schema(description = "이벤트 타입(삭제, 변경, 생성)")
2323
String eventType
24-
) {
2524

25+
) {
2626
public static RoomChangedResponse from(ChatRoom room, String eventType, Long headCount) {
2727

2828
return RoomChangedResponse.builder()

src/main/java/org/ezcode/codetest/application/game/dto/mapper/GameMapper.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,16 @@
22

33
import java.util.List;
44

5+
import org.ezcode.codetest.application.game.dto.response.encounter.EncounterChoiceResponse;
6+
import org.ezcode.codetest.application.game.dto.response.encounter.EncounterResponse;
57
import org.ezcode.codetest.application.game.dto.response.item.AccessoryResponse;
68
import org.ezcode.codetest.application.game.dto.response.character.CharacterStatusResponse;
79
import org.ezcode.codetest.application.game.dto.response.item.DefenceResponse;
810
import org.ezcode.codetest.application.game.dto.response.item.ItemResponse;
911
import org.ezcode.codetest.application.game.dto.response.skill.SkillResponse;
1012
import org.ezcode.codetest.application.game.dto.response.item.WeaponResponse;
13+
import org.ezcode.codetest.domain.game.model.encounter.EncounterChoice;
14+
import org.ezcode.codetest.domain.game.model.encounter.RandomEncounter;
1115
import org.ezcode.codetest.domain.game.model.item.Accessory;
1216
import org.ezcode.codetest.domain.game.model.character.CharacterRealStat;
1317
import org.ezcode.codetest.domain.game.model.item.Defence;
@@ -37,6 +41,9 @@ public interface GameMapper {
3741
DefenceResponse toItemResponse(Defence defence);
3842
AccessoryResponse toItemResponse(Accessory accessory);
3943

44+
EncounterResponse toEncounterResponse(RandomEncounter encounter);
45+
EncounterChoiceResponse toEncounterChoiceResponse(EncounterChoice choice);
46+
4047
@Mapping(target = "realStat", ignore = true)
4148
@Mapping(target = "items", ignore = true)
4249
@Mapping(target = "skills", ignore = true)

src/main/java/org/ezcode/codetest/application/game/dto/request/character/CharacterSaveRequest.java

Lines changed: 0 additions & 11 deletions
This file was deleted.

src/main/java/org/ezcode/codetest/application/game/dto/request/encounter/EncounterChoiceDeleteRequest.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
package org.ezcode.codetest.application.game.dto.request.encounter;
22

3+
import io.swagger.v3.oas.annotations.media.Schema;
34
import jakarta.validation.constraints.NotBlank;
5+
import jakarta.validation.constraints.Size;
46

5-
public record
6-
EncounterChoiceDeleteRequest(
7+
@Schema(description = "인카운터 선택지 삭제 요청")
8+
public record EncounterChoiceDeleteRequest(
79

10+
@Schema(description = "삭제할 인카운터 선택지 이름")
811
@NotBlank(message = "삭제할 이름을 입력해주세요.")
12+
@Size(message = "이름 입력은 최대 30글자 이내로만 가능합니다.", max = 30)
913
String name
1014

1115
) {

src/main/java/org/ezcode/codetest/application/game/dto/request/encounter/EncounterChoiceRequest.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
package org.ezcode.codetest.application.game.dto.request.encounter;
22

3+
import io.swagger.v3.oas.annotations.media.Schema;
34
import jakarta.validation.constraints.NotNull;
45

6+
@Schema(description = "인카운터 선택지 결정 요청")
57
public record EncounterChoiceRequest(
68

79
@NotNull(message = "인카운터를 선택지를 선택해주세요.(true, false)")
10+
@Schema(description = "인카운터 선택지 결정(true:yes, false:no)")
811
Boolean playerDecision
912

1013
) {

src/main/java/org/ezcode/codetest/application/game/dto/request/encounter/EncounterChoiceSaveRequest.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,32 @@
55
import org.ezcode.codetest.domain.game.model.encounter.RandomEncounter;
66
import org.ezcode.codetest.domain.game.model.encounter.RandomEncounterEffect;
77

8+
import io.swagger.v3.oas.annotations.media.Schema;
89
import jakarta.validation.constraints.NotBlank;
910
import jakarta.validation.constraints.NotNull;
11+
import jakarta.validation.constraints.Size;
1012

13+
@Schema(description = "인카운터 선택지 저장 요청")
1114
public record EncounterChoiceSaveRequest(
1215

1316
@NotBlank(message = "인카운터 이름은 필수값입니다.")
17+
@Size(message = "인카운터 이름 입력은 최대 30글자 이내로만 가능합니다.", max = 30)
18+
@Schema(description = "인카운터 이름")
1419
String encounterName,
1520

1621
@NotBlank(message = "인카운터 선택 이름은 필수값입니다.")
22+
@Schema(description = "인카운터 선택지 이름")
23+
@Size(message = "선택지 이름 입력은 최대 30글자 이내로만 가능합니다.", max = 30)
1724
String choiceName,
1825

1926
@NotBlank(message = "인카운터 이펙트는 필수값입니다.")
27+
@Size(message = "효과 입력은 최대 30글자 이내로만 가능합니다.", max = 30)
2028
@EnumValidator(enumClass = RandomEncounterEffect.class)
29+
@Schema(description = "인카운터 선택지 효과")
2130
String randomEncounterEffect,
2231

2332
@NotNull(message = "플레이어의 인카운터 선택지를 골라주세요.(true,false)")
33+
@Schema(description = "인카운터 선택지 결정(true:yes, false:no)")
2434
Boolean playerDecision
2535

2636
) {

0 commit comments

Comments
 (0)