-
Notifications
You must be signed in to change notification settings - Fork 0
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/user redis test #20
Merged
Merged
Changes from 5 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,6 @@ jobs: | |
permissions: | ||
write-all | ||
#contents: read | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up JDK 17 | ||
|
@@ -27,6 +26,14 @@ jobs: | |
java-version: '17' | ||
distribution: 'temurin' | ||
|
||
# Setup Redis | ||
- name: Setup Redis | ||
uses: shogo82148/[email protected] | ||
with: | ||
redis-version: 6.2.0 | ||
redis-port: 6379 | ||
auto-start: true | ||
|
||
# Configure Gradle for optimal use in GiHub Actions, including caching of downloaded dependencies. | ||
# See: https://github.com/gradle/actions/blob/main/setup-gradle/README.md | ||
- name: Grant execute permission for gradlew | ||
|
@@ -35,6 +42,20 @@ jobs: | |
- name: Setup Gradle | ||
uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5 # v3.1.0 | ||
|
||
# Wait for Redis to be ready | ||
- name: Wait for Redis to be ready | ||
run: | | ||
for i in `seq 1 15`; do | ||
if [ "$(redis-cli -h localhost ping)" = "PONG" ]; then | ||
echo "Redis is up and running" | ||
exit 0 | ||
fi | ||
echo "Waiting for Redis..." | ||
sleep 1 | ||
done | ||
echo "Redis did not start in time" | ||
exit 1 | ||
|
||
- name: Build with Gradle Wrapper | ||
run: ./gradlew build | ||
|
||
|
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: 6 additions & 3 deletions
9
src/main/java/kutaverse/game/map/controller/UserController.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
2 changes: 1 addition & 1 deletion
2
...utaverse/game/map/dto/MapRequestType.java → ...verse/game/map/domain/MapRequestType.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,4 +1,4 @@ | ||
package kutaverse.game.map.dto; | ||
package kutaverse.game.map.domain; | ||
|
||
public enum MapRequestType { | ||
SAVE,DELETE | ||
|
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
57 changes: 57 additions & 0 deletions
57
src/main/java/kutaverse/game/map/dto/request/PostMapUserRequest.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,57 @@ | ||
package kutaverse.game.map.dto.request; | ||
|
||
import kutaverse.game.map.domain.Status; | ||
import kutaverse.game.map.domain.User; | ||
import lombok.*; | ||
|
||
@NoArgsConstructor | ||
@Getter | ||
@Setter | ||
@AllArgsConstructor | ||
@Builder | ||
public class PostMapUserRequest { | ||
|
||
private String userId; | ||
private Double positionX; | ||
private Double positionY; | ||
private Double positionZ; | ||
private Double rotationPitch; | ||
private Double rotationYaw; | ||
private Double rotationRoll; | ||
private Status status; | ||
|
||
/** | ||
* service layer에서 엔티티 변환을 위해 필요합니다. | ||
* @return user | ||
*/ | ||
public User toEntity(){ | ||
return User.builder() | ||
.userId(userId) | ||
.positionX(positionX) | ||
.positionY(positionY) | ||
.positionZ(positionZ) | ||
.rotationPitch(rotationPitch) | ||
.rotationYaw(rotationYaw) | ||
.rotationRoll(rotationRoll) | ||
.status(status) | ||
.build(); | ||
} | ||
|
||
/** | ||
* 테스트에서 필요합니다. | ||
* @param user | ||
* @return PostMapUserRequest | ||
*/ | ||
public static PostMapUserRequest toEntity(User user){ | ||
return PostMapUserRequest.builder() | ||
.userId(user.getUserId()) | ||
.positionX(user.getPositionX()) | ||
.positionY(user.getPositionY()) | ||
.positionZ(user.getPositionZ()) | ||
.rotationPitch(user.getRotationPitch()) | ||
.rotationRoll(user.getRotationRoll()) | ||
.rotationYaw(user.getRotationYaw()) | ||
.status(user.getStatus()) | ||
.build(); | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
src/main/java/kutaverse/game/map/dto/response/GetMapUserResponse.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,37 @@ | ||
package kutaverse.game.map.dto.response; | ||
|
||
import kutaverse.game.map.domain.Status; | ||
import kutaverse.game.map.domain.User; | ||
import lombok.*; | ||
|
||
@Getter | ||
@Setter | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
@Builder | ||
@ToString | ||
@EqualsAndHashCode | ||
public class GetMapUserResponse { | ||
|
||
private String userId; | ||
private Double positionX; | ||
private Double positionY; | ||
private Double positionZ; | ||
private Double rotationPitch; | ||
private Double rotationYaw; | ||
private Double rotationRoll; | ||
private Status status; | ||
|
||
public static GetMapUserResponse toDto(User user){ | ||
return builder() | ||
.userId(user.getUserId()) | ||
.positionX(user.getPositionX()) | ||
.positionY(user.getPositionY()) | ||
.positionZ(user.getPositionZ()) | ||
.rotationPitch(user.getRotationPitch()) | ||
.rotationRoll(user.getRotationRoll()) | ||
.rotationYaw(user.getRotationYaw()) | ||
.status(user.getStatus()) | ||
.build(); | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
src/main/java/kutaverse/game/map/dto/response/PostMapUserResponse.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,37 @@ | ||
package kutaverse.game.map.dto.response; | ||
|
||
import kutaverse.game.map.domain.Status; | ||
import kutaverse.game.map.domain.User; | ||
import kutaverse.game.map.dto.request.PostMapUserRequest; | ||
import lombok.*; | ||
|
||
@Getter | ||
@Setter | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
@Builder | ||
@ToString | ||
public class PostMapUserResponse { | ||
|
||
private String userId; | ||
private Double positionX; | ||
private Double positionY; | ||
private Double positionZ; | ||
private Double rotationPitch; | ||
private Double rotationYaw; | ||
private Double rotationRoll; | ||
private Status status; | ||
|
||
public static PostMapUserResponse toDto(User user){ | ||
return builder() | ||
.userId(user.getUserId()) | ||
.positionX(user.getPositionX()) | ||
.positionY(user.getPositionY()) | ||
.positionZ(user.getPositionZ()) | ||
.rotationPitch(user.getRotationPitch()) | ||
.rotationRoll(user.getRotationRoll()) | ||
.rotationYaw(user.getRotationYaw()) | ||
.status(user.getStatus()) | ||
.build(); | ||
} | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이렇게 value 값을 지정하면 어떤 이점이 있나요? 저 형태가 아니면 예외를 발생시키나요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
불필요한 부분 같습니다 제거 했습니다.