forked from 9oorm-Oreum/9oorm-Oreum-backend
-
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.
- Loading branch information
1 parent
72ac8ea
commit d69ac35
Showing
8 changed files
with
107 additions
and
27 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
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
44 changes: 44 additions & 0 deletions
44
src/main/java/com/example/goorm/oreum/dto/OreumResponse.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,44 @@ | ||
package com.example.goorm.oreum.dto; | ||
|
||
import com.example.goorm.oreum.MyOreum; | ||
import com.example.goorm.oreum.Oreum; | ||
import com.example.goorm.oreum.OreumType; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.Setter; | ||
|
||
@Getter | ||
@Setter | ||
@Builder | ||
public class OreumResponse { | ||
private String nickname; | ||
private String name; | ||
private OreumType type; | ||
private double xPos; | ||
private double yPos; | ||
private double zPos; | ||
private Long myOreumId; | ||
|
||
public static OreumResponse of(Oreum oreum, MyOreum myOreum, BirthDayRequest request){ | ||
return OreumResponse.builder() | ||
.nickname(request.getNickname()) | ||
.name(oreum.getName()) | ||
.type(oreum.getType()) | ||
.xPos(oreum.getXPos()) | ||
.yPos(oreum.getYPos()) | ||
.zPos(oreum.getZPos()) | ||
.myOreumId(myOreum.getId()) | ||
.build(); | ||
} | ||
|
||
public static OreumResponse ofOthers(Oreum oreum, MyOreum myOreum){ | ||
return OreumResponse.builder() | ||
.nickname(myOreum.getNickname()) | ||
.name(oreum.getName()) | ||
.type(oreum.getType()) | ||
.xPos(oreum.getXPos()) | ||
.yPos(oreum.getYPos()) | ||
.zPos(oreum.getZPos()) | ||
.build(); | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
src/main/java/com/example/goorm/oreum/repository/MyOreumRepository.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,10 @@ | ||
package com.example.goorm.oreum.repository; | ||
|
||
import com.example.goorm.oreum.MyOreum; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
import java.util.Optional; | ||
|
||
public interface MyOreumRepository extends JpaRepository<MyOreum, Long> { | ||
Optional<MyOreum> findById(Long id); | ||
} |
3 changes: 2 additions & 1 deletion
3
.../example/goorm/oreum/OreumRepository.java → ...orm/oreum/repository/OreumRepository.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