에러 반환 타입변경

유저 정보 조회 수정
This commit is contained in:
2025-04-25 15:46:29 +09:00
parent 031e97d305
commit d7c6ce3277
11 changed files with 149 additions and 111 deletions

View File

@@ -9,11 +9,14 @@ import java.util.stream.Collectors;
import com.caliverse.admin.domain.entity.FriendRequest;
import com.caliverse.admin.domain.entity.HISTORYTYPE;
import com.caliverse.admin.domain.request.MailRequest;
import com.caliverse.admin.dynamodb.domain.atrrib.AccountBaseAttrib;
import com.caliverse.admin.dynamodb.domain.atrrib.MailAttrib;
import com.caliverse.admin.dynamodb.domain.atrrib.MailJsonAttrib;
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.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;
@@ -54,6 +57,8 @@ public class UsersService {
@Qualifier("objectMapper")
@Autowired
private ObjectMapper objectMapper;
@Autowired
private DynamodbUserService dynamodbUserService;
// 닉네임 변경
public UsersResponse changeNickname(UsersRequest usersRequest){
@@ -138,20 +143,41 @@ public class UsersService {
public UsersResponse getBasicInfo(String guid){
String account_id = dynamoDBService.getGuidByAccountId(guid);
//userInfo
Map<String, Object> userInfo = dynamoDBService.getAccountInfo(account_id);
String account_id = dynamodbUserService.getGuidByAccountId(guid);
AccountBaseAttrib accountBaseAttrib = dynamodbUserService.getAccountInfo(account_id);
UsersResponse.UserInfo userInfo = UsersResponse.UserInfo.builder()
.aid(accountBaseAttrib.getUserGuid())
.userId(accountBaseAttrib.getAccountId())
.nation(accountBaseAttrib.getLanguageType())
.membership("")
.friendCode("")
.createDt(accountBaseAttrib.getCreatedDateTime())
.accessDt(accountBaseAttrib.getLoginDateTime())
.endDt(accountBaseAttrib.getLogoutDateTime())
.walletUrl("")
.adminLevel(accountBaseAttrib.getAuthAdminLevelType().name())
.spareSlot("")
.build();
// charInfo
Map<String, Object> charInfo = dynamoDBService.getCharInfo(guid);
MoneyAttrib moneyAttrib = dynamodbUserService.getMoneyInfo(guid);
UsersResponse.CharInfo charInfo = UsersResponse.CharInfo.builder()
.characterName(dynamodbUserService.getGuidByName(guid))
.level("")
.goldCali(moneyAttrib.getGold())
.redCali(moneyAttrib.getCalium())
.blackCali(moneyAttrib.getRuby())
.blueCali(moneyAttrib.getSapphire())
.build();
boolean userSession = userGameSessionService.userSession(guid);
return UsersResponse.builder()
.resultData(
UsersResponse.ResultData.builder()
.charInfo((UsersResponse.CharInfo) charInfo.get("charInfo"))
.userInfo((UsersResponse.UserInfo) userInfo.get("userInfo"))
.charInfo(charInfo)
.userInfo(userInfo)
.userSession(userSession)
.build()
)