HISTORYTYPE > HISTORYDETAILTYPE 변경
로그 유저 아닐시 시스템으로 남기게 변경 히스토리 남기는 방식 추가 적용 HistoryRequest 생성 히스토리 API 작업 히스토리 mongodb 조회
This commit is contained in:
@@ -8,7 +8,6 @@ import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.caliverse.admin.domain.entity.FriendRequest;
|
||||
import com.caliverse.admin.domain.entity.HISTORYTYPE;
|
||||
import com.caliverse.admin.domain.entity.SEARCHTYPE;
|
||||
import com.caliverse.admin.domain.request.MailRequest;
|
||||
import com.caliverse.admin.dynamodb.domain.atrrib.AccountBaseAttrib;
|
||||
@@ -18,17 +17,14 @@ import com.caliverse.admin.dynamodb.domain.atrrib.MoneyAttrib;
|
||||
import com.caliverse.admin.dynamodb.domain.doc.MailDoc;
|
||||
import com.caliverse.admin.dynamodb.dto.PageResult;
|
||||
import com.caliverse.admin.dynamodb.service.DynamodbItemService;
|
||||
import com.caliverse.admin.dynamodb.service.DynamodbMailService;
|
||||
import com.caliverse.admin.dynamodb.service.DynamodbService;
|
||||
import com.caliverse.admin.dynamodb.service.DynamodbUserService;
|
||||
import com.caliverse.admin.global.common.utils.DynamodbUtil;
|
||||
import com.caliverse.admin.redis.service.RedisUserInfoService;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.json.JSONObject;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.caliverse.admin.domain.datacomponent.MetaDataHandler;
|
||||
@@ -55,6 +51,7 @@ public class UsersService {
|
||||
private final RedisUserInfoService redisUserInfoService;
|
||||
private final DynamodbUserService dynamodbUserService;
|
||||
private final DynamodbItemService dynamodbItemService;
|
||||
private final DynamodbMailService dynamodbMailService;
|
||||
|
||||
@Autowired
|
||||
private MetaDataHandler metaDataHandler;
|
||||
@@ -154,6 +151,7 @@ public class UsersService {
|
||||
.build();
|
||||
}
|
||||
|
||||
//유저 기본 정보
|
||||
public UsersResponse getBasicInfo(String guid){
|
||||
|
||||
String account_id = dynamodbUserService.getGuidByAccountId(guid);
|
||||
@@ -200,6 +198,7 @@ public class UsersService {
|
||||
|
||||
}
|
||||
|
||||
//아바타 정보
|
||||
public UsersResponse getAvatarInfo(String guid){
|
||||
|
||||
//avatarInfo
|
||||
@@ -217,10 +216,8 @@ public class UsersService {
|
||||
|
||||
}
|
||||
|
||||
//의상 정보
|
||||
public UsersResponse getClothInfo(String guid){
|
||||
|
||||
//clothInfo
|
||||
// Map<String, Object> charInfo = dynamoDBService.getClothInfo(guid);
|
||||
Map<String, Object> charInfo = dynamoDBService.getCloth(guid);
|
||||
|
||||
return UsersResponse.builder()
|
||||
@@ -235,10 +232,8 @@ public class UsersService {
|
||||
|
||||
}
|
||||
|
||||
//도구 정보
|
||||
public UsersResponse getToolSlotInfo(String guid){
|
||||
|
||||
// toolslotInfo
|
||||
// List<UsersResponse.SlotInfo> toolSlot = dynamoDBService.getToolSlot(guid);
|
||||
Map<String, Object> toolSlot = dynamoDBService.getTools(guid);
|
||||
|
||||
return UsersResponse.builder()
|
||||
@@ -252,33 +247,9 @@ public class UsersService {
|
||||
.build();
|
||||
|
||||
}
|
||||
public UsersResponse getInventoryInfo(String guid){
|
||||
|
||||
// List<List<UsersResponse.Inventory>> inventoryList = new ArrayList<>();
|
||||
// List<List<String>> item = dynamoDBService.getInvenItems(guid);
|
||||
// if(item != null){
|
||||
// for (List<String> list : item){
|
||||
// List<UsersResponse.Inventory> innerList = new ArrayList<>();
|
||||
// for (String key : list){
|
||||
// Map<String, Object> resItem = dynamoDBService.getItemTable(key);
|
||||
//
|
||||
// //객체를 생성하고 값을 설정
|
||||
// UsersResponse.Inventory inventory = new UsersResponse.Inventory();
|
||||
//
|
||||
// Object itemId = resItem.get("ItemId");
|
||||
// String itemIdString = CommonUtils.objectToString(itemId);
|
||||
// Integer itemIdInteger = CommonUtils.objectToInteger(itemId);
|
||||
//
|
||||
//
|
||||
// inventory.setCount(Integer.valueOf(CommonUtils.objectToString(resItem.get("Count"))));
|
||||
// inventory.setItemId(itemIdString);
|
||||
// inventory.setItemName(metaDataHandler.getMetaItemData(itemIdInteger).getName());
|
||||
// innerList.add(inventory);
|
||||
// }
|
||||
// inventoryList.add(innerList);
|
||||
// }
|
||||
// }
|
||||
// UsersResponse.InventoryInfo inventoryInfo = dynamoDBService.getInvenItems(guid);
|
||||
//인벤토리 정보
|
||||
public UsersResponse getInventoryInfo(String guid){
|
||||
UsersResponse.InventoryInfo inventoryInfo = dynamodbItemService.getInvenItems(guid);
|
||||
logger.info("getInventoryInfo Inventory Items: {}", inventoryInfo);
|
||||
|
||||
@@ -294,6 +265,7 @@ public class UsersService {
|
||||
|
||||
}
|
||||
|
||||
//인벤토리 아이템 삭제
|
||||
public UsersResponse deleteInventoryItem(Map<String, String> requestParams){
|
||||
String guid = requestParams.get("guid");
|
||||
String item_guid = requestParams.get("item_guid");
|
||||
@@ -302,12 +274,6 @@ public class UsersService {
|
||||
|
||||
userGameSessionService.kickUserSession(guid, "Item delete");
|
||||
if(update_cnt >= current_cnt){
|
||||
// String attrib = dynamoDBService.deleteItem(guid, item_guid);
|
||||
// if(!attrib.isEmpty()){
|
||||
// JSONObject jsonObject = new JSONObject();
|
||||
// jsonObject.put("data",attrib);
|
||||
// historyService.setLog(HISTORYTYPE.INVENTORY_ITEM_DELETE, jsonObject);
|
||||
// }
|
||||
dynamodbItemService.deleteItem(guid, item_guid);
|
||||
return UsersResponse.builder()
|
||||
.status(CommonCode.SUCCESS.getHttpStatus())
|
||||
@@ -319,10 +285,6 @@ public class UsersService {
|
||||
}else{
|
||||
int cnt = current_cnt - update_cnt;
|
||||
dynamodbItemService.updateItemStack(guid, item_guid, cnt);
|
||||
// JSONObject json = dynamoDBService.updateItem(guid, item_guid, cnt);
|
||||
// if(!json.isEmpty()){
|
||||
// historyService.setLog(HISTORYTYPE.INVENTORY_ITEM_UPDATE, json);
|
||||
// }
|
||||
return UsersResponse.builder()
|
||||
.status(CommonCode.SUCCESS.getHttpStatus())
|
||||
.result(CommonCode.SUCCESS.getResult())
|
||||
@@ -333,18 +295,17 @@ public class UsersService {
|
||||
}
|
||||
}
|
||||
|
||||
//우편 정보
|
||||
public UsersResponse getMail(UsersRequest usersRequest){
|
||||
// List<UsersResponse.Mail> mailList = dynamoDBService.getMail(guid, type);
|
||||
PageResult<MailDoc> mailPageResult = dynamodbService.getMail(usersRequest.getMailType(), usersRequest.getGuid(), "", usersRequest.getPageKey());
|
||||
PageResult<MailDoc> mailPageResult = dynamodbMailService.getMail(usersRequest.getMailType(), usersRequest.getGuid(), "", usersRequest.getPageKey());
|
||||
List<UsersResponse.Mail> mailList = new ArrayList<>();
|
||||
|
||||
mailPageResult.getItems().forEach(doc -> {
|
||||
try {
|
||||
// MailAttrib attrib = objectMapper.readValue(doc.getAttribValue(), MailAttrib.class);
|
||||
MailAttrib attrib = doc.getAttribValue();
|
||||
List<UsersResponse.MailItem> itemList = new ArrayList<>();
|
||||
if(attrib == null){
|
||||
MailJsonAttrib mailJsonAttrib = dynamodbService.getMailJsonAttrib(doc.getPK(),doc.getSK());
|
||||
MailJsonAttrib mailJsonAttrib = dynamodbMailService.getMailJsonAttrib(doc.getPK(),doc.getSK());
|
||||
mailJsonAttrib.getItemList().forEach(item -> {
|
||||
UsersResponse.MailItem mailItem = new UsersResponse.MailItem();
|
||||
mailItem.setItemId(CommonUtils.objectToString(item.getItemId()));
|
||||
@@ -416,18 +377,14 @@ public class UsersService {
|
||||
|
||||
}
|
||||
|
||||
//우편 삭제
|
||||
public UsersResponse deleteMail(Map<String, String> requestParams){
|
||||
String guid = requestParams.get("guid");
|
||||
String mail_guid = requestParams.get("mail_guid");
|
||||
String type = requestParams.get("type");
|
||||
|
||||
userGameSessionService.kickUserSession(guid, "delete mail");
|
||||
String attrib = dynamoDBService.deleteMail(type, guid, mail_guid);
|
||||
if(!attrib.isEmpty()){
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("data",attrib);
|
||||
historyService.setLog(HISTORYTYPE.USER_MAIL_DELETE, jsonObject);
|
||||
}
|
||||
dynamodbMailService.deleteMail(type, guid, mail_guid);
|
||||
|
||||
return UsersResponse.builder()
|
||||
.status(CommonCode.SUCCESS.getHttpStatus())
|
||||
@@ -438,13 +395,12 @@ public class UsersService {
|
||||
.build();
|
||||
}
|
||||
|
||||
//우편 아이템 삭제
|
||||
public UsersResponse deleteMailItem(MailRequest.DeleteMailItem deleteMailItem){
|
||||
userGameSessionService.kickUserSession(deleteMailItem.getGuid(), "delete mail item");
|
||||
JSONObject json = dynamoDBService.updateMailItem(deleteMailItem.getType(), deleteMailItem.getGuid(),
|
||||
dynamodbMailService.deleteMailItem(deleteMailItem.getType(), deleteMailItem.getGuid(),
|
||||
deleteMailItem.getMailGuid(), deleteMailItem.getItemId(), deleteMailItem.getParrentCount(), deleteMailItem.getCount());
|
||||
if(!json.isEmpty()){
|
||||
historyService.setLog(HISTORYTYPE.MAIL_ITEM_UPDATE, json);
|
||||
}
|
||||
|
||||
return UsersResponse.builder()
|
||||
.status(CommonCode.SUCCESS.getHttpStatus())
|
||||
.result(CommonCode.SUCCESS.getResult())
|
||||
@@ -454,6 +410,7 @@ public class UsersService {
|
||||
.build();
|
||||
}
|
||||
|
||||
//마이홈 정보
|
||||
public UsersResponse getMyhome(String guid){
|
||||
|
||||
UsersResponse.Myhome myhome = dynamoDBService.getMyhome(guid);
|
||||
@@ -470,6 +427,7 @@ public class UsersService {
|
||||
|
||||
}
|
||||
|
||||
//친구 목록
|
||||
public UsersResponse getFriendList(String guid){
|
||||
|
||||
List<UsersResponse.Friend> friendList = dynamoDBService.getFriendList(guid);
|
||||
@@ -518,6 +476,7 @@ public class UsersService {
|
||||
.build();
|
||||
}
|
||||
|
||||
//타투 정보
|
||||
public UsersResponse getTattoo(String guid){
|
||||
List<UsersResponse.Tattoo> resTatto = dynamoDBService.getTattoo(guid);
|
||||
|
||||
@@ -533,29 +492,8 @@ public class UsersService {
|
||||
|
||||
}
|
||||
|
||||
//퀘스트 정보
|
||||
public UsersResponse getQuest(String guid){
|
||||
// UsersResponse.Quest quest = new UsersResponse.Quest();
|
||||
//
|
||||
// List<UsersResponse.Quest> questListQuest = new ArrayList<>();
|
||||
//
|
||||
// Map<String, List<Map<String, Object>>> resMap= dynamoDBService.getQuest(guid);
|
||||
//
|
||||
// //List<Map<String, Object>> endList = resMap.get("EndList");
|
||||
// List<Map<String, Object>> questList = resMap.get("QuestList");
|
||||
//
|
||||
// int index = 1;
|
||||
// if(questList != null){
|
||||
// for (Map<String,Object> val : questList){
|
||||
// if(val != null){
|
||||
// quest = new UsersResponse.Quest();
|
||||
// quest.setQuestId(Integer.valueOf(CommonUtils.objectToString(val.get("QuestId"))));
|
||||
// quest.setStatus(CommonUtils.objectToString(val.get("IsComplete")));
|
||||
// quest.setRowNum((long)index);
|
||||
// questListQuest.add(quest);
|
||||
// index++;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
List<UsersResponse.QuestInfo> questList = dynamoDBService.getQuest(guid);
|
||||
|
||||
@@ -570,20 +508,5 @@ public class UsersService {
|
||||
.build();
|
||||
|
||||
}
|
||||
/*public UsersResponse getClaim(String guid){
|
||||
|
||||
List<UsersResponse.Guid> tattoo = dynamoDBService.getTattoo(guid);
|
||||
|
||||
return UsersResponse.builder()
|
||||
.resultData(
|
||||
UsersResponse.ResultData.builder()
|
||||
.tattooList(tattoo)
|
||||
.build()
|
||||
)
|
||||
.status(CommonCode.SUCCESS.getHttpStatus())
|
||||
.result(CommonCode.SUCCESS.getResult())
|
||||
.build();
|
||||
|
||||
}*/
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user