Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import jakarta.persistence.*;
import lombok.*;
import org.farmsystem.homepage.domain.common.entity.BaseTimeEntity;
import org.farmsystem.homepage.domain.minigame.inventory.entity.Goods;
import org.farmsystem.homepage.domain.minigame.player.entity.Player;

Expand All @@ -10,7 +11,7 @@
@Getter
@NoArgsConstructor
@AllArgsConstructor
public class Dex {
public class Dex extends BaseTimeEntity {

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public DexResponseDTO addDex(Long userId, DexRequestDTO request) {

// ν•΄λ‹Ή 식물이 store에 μ‘΄μž¬ν•˜λŠ”μ§€ 확인
Goods goods = goodsRepository.findByGoodsNumber(request.ownedPlant())
.orElseThrow(() -> new BusinessException(ErrorCode.STORE_NOT_FOUND));
.orElseThrow(() -> new BusinessException(ErrorCode.GOODS_NOT_FOUND));
// 이미 λ“±λ‘λœ 식물인지 확인
if (dexRepository.existsByPlayerAndOwnedPlant(player, goods)) {
throw new BusinessException(ErrorCode.DEX_ALREADY_REGISTERED);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import jakarta.persistence.*;
import lombok.*;
import org.farmsystem.homepage.domain.common.entity.BaseTimeEntity;
import org.farmsystem.homepage.domain.minigame.player.entity.Player;

@Entity
Expand All @@ -10,7 +11,7 @@
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class FarmplotTile {
public class FarmplotTile extends BaseTimeEntity {

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import jakarta.persistence.*;
import lombok.*;
import org.farmsystem.homepage.domain.common.entity.BaseTimeEntity;
import org.farmsystem.homepage.domain.minigame.farm.dto.request.TileUpdateRequestDTO;
import org.farmsystem.homepage.domain.minigame.player.entity.Player;

Expand All @@ -12,7 +13,7 @@
@Getter
@NoArgsConstructor
@AllArgsConstructor
public class PlantedPlant {
public class PlantedPlant extends BaseTimeEntity {

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
@NoArgsConstructor
@AllArgsConstructor
@Builder
// TODO: public class Tile | @Table(name = "tile") 은 μ–΄λ•Œμš”

public class GardenTile extends BaseTimeEntity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@
@NoArgsConstructor
@AllArgsConstructor
@Builder
// TODO: μ§„μˆ˜) 이것도 이름 λ°”κΎΈκ³  싢은데 κ³ λ―Ό.. μ†Œμ€) κ·Έλƒ₯ μœ μ§€ν•˜κ³  placed_object_id μ•ˆλ˜λ‚˜? κΌ­ placedλ₯Ό λΆ™μ—¬μ•Ό ν•˜λŠ” μ΄μœ κ°€ μžˆλ‹€λ©΄ κ·Έλ ‡κ²Œ ν•˜λŠ” 게 λ§žλŠ” κ±° 같은데...
// ν•˜μ—° ) μƒκ΄€μ—†λŠ”λ° μ•„μ΄λ””λž‘ ν…Œμ΄λΈ” λͺ… ν†΅μΌλ§Œ ν•΄μ€¬μœΌλ©΄ μ’‹κ² λ‹€.
// μ†Œμ€ ) 인정.

public class PlacedObject extends BaseTimeEntity { //μΈλ²€ν† λ¦¬μ—μ„œ λ³΄μœ ν•œ 였브젝트 ν•˜λ‚˜λ₯Ό μ‚­μ œν•˜κ³  정원에 ν•˜λ‚˜λ₯Ό μΆ”κ°€ν•˜μ—¬ λ°°μΉ˜ν•¨.

@Id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ private boolean isDefaultGrass(Goods goods) {
//상점에 μ‘΄μž¬ν•˜λŠ” λ„˜λ²„μΈμ§€ 확인
private Goods findStoreOrThrow(Long goodsNumber) {
return goodsRepository.findByGoodsNumber(goodsNumber)
.orElseThrow(() -> new BusinessException(ErrorCode.STORE_NOT_FOUND));
.orElseThrow(() -> new BusinessException(ErrorCode.GOODS_NOT_FOUND));
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@
@NoArgsConstructor
@AllArgsConstructor
@Builder
// TODO: Goods λŒ€μ‹  Goods 같은 μ΄λ¦„μœΌλ‘œ λ°”κΎΈλŠ” 것을 μΆ”μ²œ
// 이유: GardenTileμ—μ„œ 'private Goods tileType;' 이 μžˆλŠ”λ°, μ΄ν•΄ν•˜κΈ° μ–΄λ ΅λ‹€.
// ν•„λ“œλͺ…μ—μ„œλ„ store λΉΌμ„œ ν•œκΊΌλ²ˆμ— μŠ‰μŠ‰ μ •λ¦¬ν•˜κ³ 

public class Goods { //enum λŒ€μ‹  였브젝트/식물 λ„˜λ²„μ™€ μ΄λ¦„μœΌλ‘œ μ‘΄μž¬ν•˜λŠ” 전체 였브젝트/식물 관리

@Id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
@Builder
public class Inventory extends BaseTimeEntity { //νšλ“ν•œ μ˜€λΈŒμ νŠΈλ“€μ„ κ΄€λ¦¬ν•˜λŠ” 인벀토리

// TODO: 각쒅 IDλŠ” μ—”ν‹°ν‹°λͺ…_id둜 μΌμΉ˜μ‹œμΌœμ£Όμ„Έμš”! ex. inventoryId (inventory_id)
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "inventory_id", nullable = false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public List<InventoryResponseDTO> updateInventoryObject(Long userId, InventoryUp
.orElseThrow(() -> new BusinessException(ErrorCode.PLAYER_NOT_FOUND));

Goods goods = goodsRepository.findByGoodsNumber(requestDTO.objectType())
.orElseThrow(() -> new BusinessException(ErrorCode.STORE_NOT_FOUND));
.orElseThrow(() -> new BusinessException(ErrorCode.GOODS_NOT_FOUND));

Long storeGoodsNumber = requestDTO.objectType();
int newCount = requestDTO.objectCount();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@

import jakarta.persistence.*;
import lombok.*;
import org.farmsystem.homepage.domain.common.entity.BaseTimeEntity;

@Entity
@Table(name = "badge")
@Getter
@NoArgsConstructor
@AllArgsConstructor
public class Badge { //칭호
public class Badge extends BaseTimeEntity { //칭호
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "badge_id", nullable = false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import jakarta.persistence.*;
import lombok.*;
import org.farmsystem.homepage.domain.common.entity.BaseTimeEntity;
import org.farmsystem.homepage.global.error.ErrorCode;
import org.farmsystem.homepage.global.error.exception.BusinessException;

Expand All @@ -13,7 +14,7 @@
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class DailyGame {
public class DailyGame extends BaseTimeEntity {

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class Player extends BaseTimeEntity {
@Column(nullable = false)
private int sunlight = 0;

@Column(nullable = false)
@Column(name = "seed_count", nullable = false)
private int seedCount = 0;

@Column(nullable = false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import jakarta.persistence.*;
import lombok.*;
import org.farmsystem.homepage.domain.common.entity.BaseTimeEntity;
import org.farmsystem.homepage.domain.minigame.player.entity.Player;

import java.time.LocalDateTime;
Expand All @@ -11,12 +12,12 @@
@Getter
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@AllArgsConstructor
// TODO: public class Solar | @Table(name = "solar") 은 μ–΄λ•Œμš”
public class Solar {

public class Solar extends BaseTimeEntity {

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
// TODO: 같은 λ§₯락으둜 solarId

@Column(name = "solar_id", nullable = false)
private Long solarId;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ public enum ErrorCode {
OBJECT_NOT_OWNED(HttpStatus.NOT_FOUND, "였브젝트 μˆ˜λŸ‰μ΄ λΆ€μ‘±ν•©λ‹ˆλ‹€."),
OBJECT_NOT_FOUND(HttpStatus.NOT_FOUND, "ν•΄λ‹Ή 타일 μœ„μΉ˜μ— μ˜€λΈŒμ νŠΈκ°€ μ—†μŠ΅λ‹ˆλ‹€."),
OBJECT_TYPE_MISMATCH(HttpStatus.BAD_REQUEST, "κΈ°μ‘΄ 타일 μ’Œν‘œ μœ„μ˜ μ˜€λΈŒμ νŠΈμ™€ λ‹€λ₯Έ μ˜€λΈŒμ νŠΈκ°€ μš”μ²­μœΌλ‘œ λ“€μ–΄μ™”μŠ΅λ‹ˆλ‹€."),
STORE_NOT_FOUND(HttpStatus.NOT_FOUND, "상점에 μ—†λŠ” μ˜€λΈŒμ νŠΈμž…λ‹ˆλ‹€."),
GOODS_NOT_FOUND(HttpStatus.NOT_FOUND, "상점에 μ—†λŠ” μ˜€λΈŒμ νŠΈμž…λ‹ˆλ‹€."),
PLAYER_NOT_FOUND(HttpStatus.NOT_FOUND, "ν”Œλ ˆμ΄μ–΄λ₯Ό 찾을 수 μ—†μŠ΅λ‹ˆλ‹€."),
FARMTILE_NOT_FOUND(HttpStatus.NOT_FOUND, "ν…ƒλ°­ 타일을 찾을 수 μ—†μŠ΅λ‹ˆλ‹€."),
BADGE_NOT_FOUND(HttpStatus.NOT_FOUND, "ν•΄λ‹Ή 칭호λ₯Ό 찾을 수 μ—†μŠ΅λ‹ˆλ‹€."),
Expand Down
Loading