-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from lsn5963/feat/init_settings
[FEAT] 기초세팅
- Loading branch information
Showing
27 changed files
with
541 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
HELP.md | ||
.gradle | ||
build/ | ||
!gradle/wrapper/gradle-wrapper.jar | ||
!**/src/main/**/build/ | ||
!**/src/test/**/build/ | ||
|
||
### STS ### | ||
.apt_generated | ||
.classpath | ||
.factorypath | ||
.project | ||
.settings | ||
.springBeans | ||
.sts4-cache | ||
bin/ | ||
!**/src/main/**/bin/ | ||
!**/src/test/**/bin/ | ||
|
||
### IntelliJ IDEA ### | ||
.idea | ||
*.iws | ||
*.iml | ||
*.ipr | ||
out/ | ||
!**/src/main/**/out/ | ||
!**/src/test/**/out/ | ||
|
||
### NetBeans ### | ||
/nbproject/private/ | ||
/nbbuild/ | ||
/dist/ | ||
/nbdist/ | ||
/.nb-gradle/ | ||
|
||
### VS Code ### | ||
.vscode/ | ||
|
||
/src/main/resources/auth/ | ||
/src/main/resources/database/ | ||
### MAC ### | ||
.DS_Store | ||
|
||
### ELSE ### | ||
application.yml |
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
11 changes: 11 additions & 0 deletions
11
src/main/java/com/noplanb/domain/character/application/CharacterService.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,11 @@ | ||
package com.noplanb.domain.character.application; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.stereotype.Service; | ||
import org.springframework.transaction.annotation.Transactional; | ||
|
||
@Service | ||
@RequiredArgsConstructor | ||
@Transactional(readOnly = true) | ||
public class CharacterService { | ||
} |
13 changes: 13 additions & 0 deletions
13
src/main/java/com/noplanb/domain/character/controller/CharacterController.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.noplanb.domain.character.controller; | ||
|
||
import io.swagger.v3.oas.annotations.tags.Tag; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.stereotype.Controller; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
|
||
@Controller | ||
@RequiredArgsConstructor | ||
@RequestMapping("/api/v1") | ||
@Tag(name = "CharacterController", description = "CharacterController입니다.") | ||
public class CharacterController { | ||
} |
44 changes: 44 additions & 0 deletions
44
src/main/java/com/noplanb/domain/character/domain/Character.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.noplanb.domain.character.domain; | ||
|
||
import com.noplanb.domain.common.BaseEntity; | ||
import com.noplanb.domain.item.domain.Item; | ||
import com.noplanb.domain.quest.domain.Quest; | ||
import jakarta.persistence.*; | ||
import lombok.AccessLevel; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
import static jakarta.persistence.GenerationType.IDENTITY; | ||
|
||
@Entity | ||
@Getter | ||
@NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
@Table(name = "character_entity") | ||
public class Character extends BaseEntity { | ||
@Id | ||
@GeneratedValue(strategy = IDENTITY) | ||
private Long id; | ||
private String characterName; | ||
private Long totalExp; | ||
private Long totalQuest; | ||
private Long todayExp; | ||
private Long level; | ||
@OneToMany(mappedBy = "character") | ||
private List<Quest> quests = new ArrayList<>(); | ||
@OneToMany(mappedBy = "character") | ||
private List<Item> items = new ArrayList<>(); | ||
|
||
public void addQuest(Quest quest){ | ||
this.quests.add(quest); | ||
quest.updateCharacter(this); | ||
|
||
} | ||
public void addItem(Item item){ | ||
this.items.add(item); | ||
item.updateCharacter(this); | ||
|
||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
src/main/java/com/noplanb/domain/character/repository/CharacterRepository.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,9 @@ | ||
package com.noplanb.domain.character.repository; | ||
|
||
import com.noplanb.domain.character.domain.Character; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.stereotype.Repository; | ||
|
||
@Repository | ||
public interface CharacterRepository extends JpaRepository<Character,Long> { | ||
} |
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,32 @@ | ||
package com.noplanb.domain.common; | ||
|
||
import jakarta.persistence.*; | ||
import lombok.Getter; | ||
import org.springframework.data.annotation.CreatedDate; | ||
import org.springframework.data.annotation.LastModifiedDate; | ||
import org.springframework.data.jpa.domain.support.AuditingEntityListener; | ||
|
||
import java.time.LocalDateTime; | ||
|
||
@Getter | ||
@MappedSuperclass | ||
@EntityListeners(AuditingEntityListener.class) | ||
public abstract class BaseEntity { | ||
|
||
@CreatedDate | ||
@Column(updatable=false) | ||
private LocalDateTime createdAt; | ||
|
||
@LastModifiedDate | ||
private LocalDateTime modifiedAt; | ||
|
||
@Enumerated(value = EnumType.STRING) | ||
private Status status = Status.ACTIVE; | ||
|
||
public void updateStatus(Status status){ | ||
this.status = status; | ||
} | ||
|
||
|
||
|
||
} |
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,6 @@ | ||
package com.noplanb.domain.common; | ||
|
||
public enum Status { | ||
ACTIVE, | ||
DELETED | ||
} |
11 changes: 11 additions & 0 deletions
11
src/main/java/com/noplanb/domain/item/application/ItemService.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,11 @@ | ||
package com.noplanb.domain.item.application; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.stereotype.Service; | ||
import org.springframework.transaction.annotation.Transactional; | ||
|
||
@Service | ||
@RequiredArgsConstructor | ||
@Transactional(readOnly = true) | ||
public class ItemService { | ||
} |
13 changes: 13 additions & 0 deletions
13
src/main/java/com/noplanb/domain/item/controller/ItemController.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.noplanb.domain.item.controller; | ||
|
||
import io.swagger.v3.oas.annotations.tags.Tag; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.stereotype.Controller; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
|
||
@Controller | ||
@RequiredArgsConstructor | ||
@RequestMapping("/api/v1") | ||
@Tag(name = "ItemController", description = "ItemControllerController입니다.") | ||
public class ItemController { | ||
} |
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,32 @@ | ||
package com.noplanb.domain.item.domain; | ||
|
||
import com.noplanb.domain.character.domain.Character; | ||
import com.noplanb.domain.common.BaseEntity; | ||
import jakarta.persistence.*; | ||
import lombok.AccessLevel; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
import static jakarta.persistence.GenerationType.IDENTITY; | ||
|
||
@Entity | ||
@Getter | ||
@NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
public class Item extends BaseEntity { | ||
@Id | ||
@GeneratedValue(strategy = IDENTITY) | ||
private Long id; | ||
private String item_name; | ||
@Enumerated(EnumType.STRING) | ||
private ItemType itemType; | ||
@Enumerated(EnumType.STRING) | ||
private ItemStatus itemStatus; | ||
private Long requiredLevel; | ||
@ManyToOne(fetch = FetchType.LAZY) | ||
@JoinColumn(name = "character_id") | ||
private Character character; | ||
|
||
public void updateCharacter(Character character) { | ||
this.character = character; | ||
} | ||
} |
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,6 @@ | ||
package com.noplanb.domain.item.domain; | ||
|
||
public enum ItemStatus { | ||
EQUIP, | ||
UNEQUIP | ||
} |
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,8 @@ | ||
package com.noplanb.domain.item.domain; | ||
|
||
public enum ItemType { | ||
HEAD, | ||
FACE, | ||
CLOTHES, | ||
BACKGROUND | ||
} |
9 changes: 9 additions & 0 deletions
9
src/main/java/com/noplanb/domain/item/repository/ItemRepository.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,9 @@ | ||
package com.noplanb.domain.item.repository; | ||
|
||
import com.noplanb.domain.item.domain.Item; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.stereotype.Repository; | ||
|
||
@Repository | ||
public interface ItemRepository extends JpaRepository<Item,Long> { | ||
} |
11 changes: 11 additions & 0 deletions
11
src/main/java/com/noplanb/domain/quest/application/QuestService.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,11 @@ | ||
package com.noplanb.domain.quest.application; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.stereotype.Service; | ||
import org.springframework.transaction.annotation.Transactional; | ||
|
||
@Service | ||
@RequiredArgsConstructor | ||
@Transactional(readOnly = true) | ||
public class QuestService { | ||
} |
13 changes: 13 additions & 0 deletions
13
src/main/java/com/noplanb/domain/quest/controller/QuestController.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.noplanb.domain.quest.controller; | ||
|
||
import io.swagger.v3.oas.annotations.tags.Tag; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.stereotype.Controller; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
|
||
@Controller | ||
@RequiredArgsConstructor | ||
@RequestMapping("/api/v1") | ||
@Tag(name = "QuestController", description = "QuestControllerController입니다.") | ||
public class QuestController { | ||
} |
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,29 @@ | ||
package com.noplanb.domain.quest.domain; | ||
|
||
import com.noplanb.domain.character.domain.Character; | ||
import com.noplanb.domain.common.BaseEntity; | ||
import jakarta.persistence.*; | ||
import lombok.AccessLevel; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
import static jakarta.persistence.GenerationType.IDENTITY; | ||
|
||
@Entity | ||
@Getter | ||
@NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
public class Quest extends BaseEntity { | ||
@Id | ||
@GeneratedValue(strategy = IDENTITY) | ||
private Long id; | ||
private String contents; | ||
private Long exp; | ||
private Boolean isComplete; | ||
@ManyToOne(fetch = FetchType.LAZY) | ||
@JoinColumn(name = "character_id") | ||
private Character character; | ||
|
||
public void updateCharacter(Character character) { | ||
this.character = character; | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
src/main/java/com/noplanb/domain/quest/repository/QuestRepository.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,9 @@ | ||
package com.noplanb.domain.quest.repository; | ||
|
||
import com.noplanb.domain.quest.domain.Quest; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.stereotype.Repository; | ||
|
||
@Repository | ||
public interface QuestRepository extends JpaRepository<Quest,Long> { | ||
} |
11 changes: 11 additions & 0 deletions
11
src/main/java/com/noplanb/domain/user/application/UserService.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,11 @@ | ||
package com.noplanb.domain.user.application; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.stereotype.Service; | ||
import org.springframework.transaction.annotation.Transactional; | ||
|
||
@Service | ||
@RequiredArgsConstructor | ||
@Transactional(readOnly = true) | ||
public class UserService { | ||
} |
13 changes: 13 additions & 0 deletions
13
src/main/java/com/noplanb/domain/user/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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package com.noplanb.domain.user.controller; | ||
|
||
import io.swagger.v3.oas.annotations.tags.Tag; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.stereotype.Controller; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
|
||
@Controller | ||
@RequiredArgsConstructor | ||
@RequestMapping("/api/v1") | ||
@Tag(name = "UserController", description = "UserControllerController입니다.") | ||
public class UserController { | ||
} |
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.noplanb.domain.user.domain; | ||
|
||
import com.noplanb.domain.character.domain.Character; | ||
import com.noplanb.domain.common.BaseEntity; | ||
import jakarta.persistence.*; | ||
import lombok.AccessLevel; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
import static jakarta.persistence.GenerationType.IDENTITY; | ||
|
||
@Entity | ||
@Getter | ||
@NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
public class User extends BaseEntity { | ||
@Id | ||
@GeneratedValue(strategy = IDENTITY) | ||
private Long id; | ||
private String name; | ||
private String email; | ||
private String password; | ||
@OneToOne(fetch = FetchType.LAZY) | ||
@JoinColumn(name = "character_id", unique = true) | ||
private Character character; | ||
|
||
} |
9 changes: 9 additions & 0 deletions
9
src/main/java/com/noplanb/domain/user/repository/UserRepository.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,9 @@ | ||
package com.noplanb.domain.user.repository; | ||
|
||
import com.noplanb.domain.user.domain.User; | ||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.stereotype.Repository; | ||
|
||
@Repository | ||
public interface UserRepository extends JpaRepository<User,Long> { | ||
} |
Oops, something went wrong.