Skip to content

Commit

Permalink
fix: current Type 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
DongGeon0908 committed Apr 6, 2024
1 parent 2c53248 commit af24054
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
6 changes: 5 additions & 1 deletion src/main/java/com/core/api/item/entity/Item.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ public class Item extends BaseEntity {
@Column(name = "type")
private ItemType type;

@Convert(converter = ItemTypeConverter.class)
@Column(name = "current_type")
private ItemType currentType;

public Item(Long uid, ItemSaveDto itemSaveDto, String address) {
this.uid = uid;
this.message = itemSaveDto.getMessage();
Expand All @@ -68,6 +72,6 @@ public Item(Long uid, ItemSaveDto itemSaveDto, String address) {
}

public void upgrade(ItemType type) {
this.type = type;
this.currentType = type;
}
}
7 changes: 5 additions & 2 deletions src/main/java/com/core/api/item/service/ItemService.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ public class ItemService {
private final ItemCommentLikeRepository itemCommentLikeRepository;
private final JPAQueryFactory jpaQueryFactory;

/** 해당 길이를 통해 위치 정보 범위 변경 */
/**
* 해당 길이를 통해 위치 정보 범위 변경
*/
public final static int ADDRESS_RANGE = 5000;

@Transactional
Expand All @@ -64,7 +66,8 @@ public ItemSaveResponseDto itemSave(AuthUser user, ItemSaveDto itemSaveDto) {
.message(itemSaveDto.getMessage())
.latitude(itemSaveDto.getLatitude())
.longitude(itemSaveDto.getLongitude())
.type(itemSaveDto.getType());
.type(itemSaveDto.getType())
.currentType(itemSaveDto.getType());

if (address.isPresent()) {
var add = address.get();
Expand Down

0 comments on commit af24054

Please sign in to comment.