에러 반환 타입변경
유저 정보 조회 수정
This commit is contained in:
@@ -2,6 +2,7 @@ package com.caliverse.admin.domain.response;
|
|||||||
|
|
||||||
import com.caliverse.admin.domain.entity.FriendRequest;
|
import com.caliverse.admin.domain.entity.FriendRequest;
|
||||||
import com.caliverse.admin.domain.entity.LANGUAGETYPE;
|
import com.caliverse.admin.domain.entity.LANGUAGETYPE;
|
||||||
|
import com.caliverse.admin.dynamodb.entity.ELanguageType;
|
||||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
@@ -74,7 +75,7 @@ public class UsersResponse {
|
|||||||
private String aid;
|
private String aid;
|
||||||
@JsonProperty("user_id")
|
@JsonProperty("user_id")
|
||||||
private String userId;
|
private String userId;
|
||||||
private LANGUAGETYPE nation;
|
private ELanguageType nation;
|
||||||
private String membership;
|
private String membership;
|
||||||
//친구 추천코드
|
//친구 추천코드
|
||||||
@JsonProperty("friend_code")
|
@JsonProperty("friend_code")
|
||||||
@@ -108,16 +109,16 @@ public class UsersResponse {
|
|||||||
private String level;
|
private String level;
|
||||||
//골드
|
//골드
|
||||||
@JsonProperty("gold_cali")
|
@JsonProperty("gold_cali")
|
||||||
private String goldCali;
|
private Double goldCali;
|
||||||
//사파이어
|
//사파이어
|
||||||
@JsonProperty("blue_cali")
|
@JsonProperty("blue_cali")
|
||||||
private String blueCali;
|
private Double blueCali;
|
||||||
//칼리움
|
//칼리움
|
||||||
@JsonProperty("red_cali")
|
@JsonProperty("red_cali")
|
||||||
private String redCali;
|
private Double redCali;
|
||||||
//루비
|
//루비
|
||||||
@JsonProperty("black_cali")
|
@JsonProperty("black_cali")
|
||||||
private String blackCali;
|
private Double blackCali;
|
||||||
|
|
||||||
}
|
}
|
||||||
@Data
|
@Data
|
||||||
|
|||||||
@@ -158,12 +158,12 @@ public class BlackListService {
|
|||||||
if(item.getGuid() != null){
|
if(item.getGuid() != null){
|
||||||
String guid = item.getGuid();
|
String guid = item.getGuid();
|
||||||
if(dynamoDBService.isGuidChecked(guid)){
|
if(dynamoDBService.isGuidChecked(guid)){
|
||||||
throw new RestApiException(CommonCode.ERROR.getHttpStatus(), ErrorCode.GUID_CHECK.getMessage());
|
throw new RestApiException(CommonCode.ERROR.getHttpStatus(), ErrorCode.WARNING_GUID_CHECK.toString());
|
||||||
}
|
}
|
||||||
// boolean isBlackUser = dynamoDBService.isWhiteOrBlackUser(guid);
|
// boolean isBlackUser = dynamoDBService.isWhiteOrBlackUser(guid);
|
||||||
boolean isBlackUser = dynamodbUserService.isBlockUser(guid);
|
boolean isBlackUser = dynamodbUserService.isBlockUser(guid);
|
||||||
if(isBlackUser){
|
if(isBlackUser){
|
||||||
throw new RestApiException(CommonCode.ERROR.getHttpStatus(), ErrorCode.DYNAMODB_EXIT_ERROR.getMessage());
|
throw new RestApiException(CommonCode.ERROR.getHttpStatus(), ErrorCode.USER_BLOCK_REGIST_DUPLE_WARNING.toString());
|
||||||
}
|
}
|
||||||
blackListRequest.setGuid(guid);
|
blackListRequest.setGuid(guid);
|
||||||
blackListRequest.setNickname(item.getNickname());
|
blackListRequest.setNickname(item.getNickname());
|
||||||
@@ -180,15 +180,15 @@ public class BlackListService {
|
|||||||
//adminDB 에 데이터 있는지 체크
|
//adminDB 에 데이터 있는지 체크
|
||||||
int cnt = blackListMapper.getCountByGuid(item.getGuid());
|
int cnt = blackListMapper.getCountByGuid(item.getGuid());
|
||||||
if(cnt > 0){
|
if(cnt > 0){
|
||||||
throw new RestApiException(CommonCode.ERROR.getHttpStatus(), ErrorCode.ADMINDB_EXIT_ERROR.getMessage());
|
throw new RestApiException(CommonCode.ERROR.getHttpStatus(), ErrorCode.USER_BLOCK_REGIST_DUPLE_WARNING.toString());
|
||||||
}
|
}
|
||||||
if(dynamoDBService.isGuidChecked(item.getGuid())){
|
if(dynamoDBService.isGuidChecked(item.getGuid())){
|
||||||
throw new RestApiException(CommonCode.ERROR.getHttpStatus(), ErrorCode.GUID_CHECK.getMessage());
|
throw new RestApiException(CommonCode.ERROR.getHttpStatus(), ErrorCode.WARNING_GUID_CHECK.toString());
|
||||||
}
|
}
|
||||||
// boolean isBlackUser = dynamoDBService.isWhiteOrBlackUser(item.getGuid());
|
// boolean isBlackUser = dynamoDBService.isWhiteOrBlackUser(item.getGuid());
|
||||||
boolean isBlackUser = dynamodbUserService.isBlockUser(item.getGuid());
|
boolean isBlackUser = dynamodbUserService.isBlockUser(item.getGuid());
|
||||||
if(isBlackUser){
|
if(isBlackUser){
|
||||||
throw new RestApiException(CommonCode.ERROR.getHttpStatus(), ErrorCode.DYNAMODB_EXIT_ERROR.getMessage());
|
throw new RestApiException(CommonCode.ERROR.getHttpStatus(), ErrorCode.USER_BLOCK_REGIST_DUPLE_WARNING.toString());
|
||||||
}
|
}
|
||||||
blackListRequest.setGuid(item.getGuid());
|
blackListRequest.setGuid(item.getGuid());
|
||||||
blackListRequest.setNickname(dynamodbUserService.getGuidByName(item.getGuid()));
|
blackListRequest.setNickname(dynamodbUserService.getGuidByName(item.getGuid()));
|
||||||
|
|||||||
@@ -325,92 +325,92 @@ public class DynamoDBService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public Map<String, Object> getAccountInfo(String guid){
|
// public Map<String, Object> getAccountInfo(String guid){
|
||||||
Map<String, Object> resMap = new HashMap<>();
|
// Map<String, Object> resMap = new HashMap<>();
|
||||||
|
//
|
||||||
String key = "PK = :pkValue AND SK = :skValue";
|
// String key = "PK = :pkValue AND SK = :skValue";
|
||||||
Map<String, AttributeValue> values = Map.of(":pkValue", AttributeValue.builder().s("account_base#"+guid).build()
|
// Map<String, AttributeValue> values = Map.of(":pkValue", AttributeValue.builder().s("account_base#"+guid).build()
|
||||||
,":skValue", AttributeValue.builder().s("empty").build());
|
// ,":skValue", AttributeValue.builder().s("empty").build());
|
||||||
|
//
|
||||||
try {
|
// try {
|
||||||
// 쿼리 실행
|
// // 쿼리 실행
|
||||||
QueryResponse response = executeQuery(key, values);
|
// QueryResponse response = executeQuery(key, values);
|
||||||
|
//
|
||||||
// 응답에서 원하는 속성을 가져옵니다.
|
// // 응답에서 원하는 속성을 가져옵니다.
|
||||||
for (Map<String, AttributeValue> item : response.items()) {
|
// for (Map<String, AttributeValue> item : response.items()) {
|
||||||
AttributeValue attrValue = item.get("AccountBaseAttrib");
|
// AttributeValue attrValue = item.get("AccountBaseAttrib");
|
||||||
if (attrValue != null) {
|
// if (attrValue != null) {
|
||||||
// "Attr" 속성의 값을 읽어옵니다.
|
// // "Attr" 속성의 값을 읽어옵니다.
|
||||||
String attrJson = attrValue.s();
|
// String attrJson = attrValue.s();
|
||||||
|
//
|
||||||
// JSON 문자열을 파싱하여 Map 또는 다른 객체로 변환합니다.
|
// // JSON 문자열을 파싱하여 Map 또는 다른 객체로 변환합니다.
|
||||||
ObjectMapper objectMapper = new ObjectMapper();
|
// ObjectMapper objectMapper = new ObjectMapper();
|
||||||
Map<String, Object> attrMap = objectMapper.readValue(attrJson, new TypeReference<Map<String, Object>>() {});
|
// Map<String, Object> attrMap = objectMapper.readValue(attrJson, new TypeReference<Map<String, Object>>() {});
|
||||||
|
//
|
||||||
resMap.put("userInfo", UsersResponse.UserInfo.builder()
|
// resMap.put("userInfo", UsersResponse.UserInfo.builder()
|
||||||
.aid(CommonUtils.objectToString(attrMap.get("user_guid")))
|
// .aid(CommonUtils.objectToString(attrMap.get("user_guid")))
|
||||||
.userId(CommonUtils.objectToString(attrMap.get("account_id")))
|
// .userId(CommonUtils.objectToString(attrMap.get("account_id")))
|
||||||
.nation(LANGUAGETYPE.values()[CommonUtils.objectToInteger(attrMap.get("language_type"))])
|
// .nation(LANGUAGETYPE.values()[CommonUtils.objectToInteger(attrMap.get("language_type"))])
|
||||||
//
|
// //
|
||||||
.membership(CommonUtils.objectToString(null))
|
// .membership(CommonUtils.objectToString(null))
|
||||||
//todo 친구 추천 코드 임시 null 값으로 셋팅 23.09.20
|
// //todo 친구 추천 코드 임시 null 값으로 셋팅 23.09.20
|
||||||
.friendCode(CommonUtils.objectToString(null))
|
// .friendCode(CommonUtils.objectToString(null))
|
||||||
.createDt(CommonUtils.objectToString(attrMap.get("created_datetime")))
|
// .createDt(CommonUtils.objectToString(attrMap.get("created_datetime")))
|
||||||
.accessDt(CommonUtils.objectToString(attrMap.get("login_datetime")))
|
// .accessDt(CommonUtils.objectToString(attrMap.get("login_datetime")))
|
||||||
.endDt(CommonUtils.objectToString(attrMap.get("logout_datetime")))
|
// .endDt(CommonUtils.objectToString(attrMap.get("logout_datetime")))
|
||||||
.walletUrl(CommonUtils.objectToString(attrMap.get("connect_facewallet")))
|
// .walletUrl(CommonUtils.objectToString(attrMap.get("connect_facewallet")))
|
||||||
.adminLevel(CommonUtils.objectToString(attrMap.get("auth_amdin_level_type")))
|
// .adminLevel(CommonUtils.objectToString(attrMap.get("auth_amdin_level_type")))
|
||||||
//todo 예비슬롯 임시 null 값으로 셋팅 23.09.20
|
// //todo 예비슬롯 임시 null 값으로 셋팅 23.09.20
|
||||||
.spareSlot(CommonUtils.objectToString(null))
|
// .spareSlot(CommonUtils.objectToString(null))
|
||||||
.build());
|
// .build());
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
log.info("getAccountInfo UserInfo: {}", resMap);
|
// log.info("getAccountInfo UserInfo: {}", resMap);
|
||||||
|
//
|
||||||
return resMap;
|
// return resMap;
|
||||||
} catch (Exception e) {
|
// } catch (Exception e) {
|
||||||
throw new RestApiException(CommonCode.ERROR.getHttpStatus(), ErrorCode.DYNAMODB_CONNECTION_ERROR.getMessage());
|
// throw new RestApiException(CommonCode.ERROR.getHttpStatus(), ErrorCode.DYNAMODB_CONNECTION_ERROR.getMessage());
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
// 유저조회 - 기본정보
|
// // 유저조회 - 기본정보
|
||||||
public Map<String, Object> getCharInfo(String guid){
|
// public Map<String, Object> getCharInfo(String guid){
|
||||||
Map<String, Object> resMap = new HashMap<>();
|
// Map<String, Object> resMap = new HashMap<>();
|
||||||
|
//
|
||||||
String key = "PK = :pkValue AND SK = :skValue";
|
// String key = "PK = :pkValue AND SK = :skValue";
|
||||||
Map<String, AttributeValue> values = Map.of(":pkValue", AttributeValue.builder().s("money#"+guid).build()
|
// Map<String, AttributeValue> values = Map.of(":pkValue", AttributeValue.builder().s("money#"+guid).build()
|
||||||
,":skValue", AttributeValue.builder().s("empty").build());
|
// ,":skValue", AttributeValue.builder().s("empty").build());
|
||||||
|
//
|
||||||
try {
|
// try {
|
||||||
// 쿼리 실행
|
// // 쿼리 실행
|
||||||
QueryResponse response = executeQuery(key, values);
|
// QueryResponse response = executeQuery(key, values);
|
||||||
|
//
|
||||||
// 응답에서 원하는 속성을 가져옵니다.
|
// // 응답에서 원하는 속성을 가져옵니다.
|
||||||
for (Map<String, AttributeValue> item : response.items()) {
|
// for (Map<String, AttributeValue> item : response.items()) {
|
||||||
|
//
|
||||||
//캐릭터 CharInfo 조회
|
// //캐릭터 CharInfo 조회
|
||||||
AttributeValue charValue = item.get("MoneyAttrib");
|
// AttributeValue charValue = item.get("MoneyAttrib");
|
||||||
if (charValue != null) {
|
// if (charValue != null) {
|
||||||
// "Attr" 속성의 값을 읽어옵니다.
|
// // "Attr" 속성의 값을 읽어옵니다.
|
||||||
Map<String, AttributeValue> attrMap = charValue.m();
|
// Map<String, AttributeValue> attrMap = charValue.m();
|
||||||
|
//
|
||||||
resMap.put("charInfo", UsersResponse.CharInfo.builder()
|
// resMap.put("charInfo", UsersResponse.CharInfo.builder()
|
||||||
.characterName(getGuidByName(guid))
|
// .characterName(getGuidByName(guid))
|
||||||
.level(CommonUtils.objectToString(null))
|
// .level(CommonUtils.objectToString(null))
|
||||||
.goldCali(CommonUtils.objectToString(attrMap.get("gold").n()))
|
// .goldCali(CommonUtils.objectToString(attrMap.get("gold").n()))
|
||||||
.redCali(CommonUtils.objectToString(attrMap.get("calium").n()))
|
// .redCali(CommonUtils.objectToString(attrMap.get("calium").n()))
|
||||||
.blackCali(CommonUtils.objectToString(attrMap.get("ruby").n()))
|
// .blackCali(CommonUtils.objectToString(attrMap.get("ruby").n()))
|
||||||
.blueCali(CommonUtils.objectToString(attrMap.get("sapphire").n()))
|
// .blueCali(CommonUtils.objectToString(attrMap.get("sapphire").n()))
|
||||||
.build());
|
// .build());
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
log.info("getCharInfo CharInfo: {}", resMap);
|
// log.info("getCharInfo CharInfo: {}", resMap);
|
||||||
|
//
|
||||||
return resMap;
|
// return resMap;
|
||||||
} catch (Exception e) {
|
// } catch (Exception e) {
|
||||||
throw new RestApiException(CommonCode.ERROR.getHttpStatus(), ErrorCode.DYNAMODB_CONNECTION_ERROR.getMessage());
|
// throw new RestApiException(CommonCode.ERROR.getHttpStatus(), ErrorCode.DYNAMODB_CONNECTION_ERROR.getMessage());
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
// 유저조회 - 아바타
|
// 유저조회 - 아바타
|
||||||
public Map<String, Object> getAvatarInfo(String guid){
|
public Map<String, Object> getAvatarInfo(String guid){
|
||||||
|
|||||||
@@ -38,7 +38,6 @@ import java.util.*;
|
|||||||
import java.util.concurrent.atomic.AtomicBoolean;
|
import java.util.concurrent.atomic.AtomicBoolean;
|
||||||
|
|
||||||
import static com.caliverse.admin.global.common.utils.CommonUtils.convertIsoByDatetime;
|
import static com.caliverse.admin.global.common.utils.CommonUtils.convertIsoByDatetime;
|
||||||
import static com.caliverse.admin.global.common.utils.DateUtils.stringToDateTime;
|
|
||||||
import static com.caliverse.admin.global.common.utils.DateUtils.stringISOToLocalDateTime;
|
import static com.caliverse.admin.global.common.utils.DateUtils.stringISOToLocalDateTime;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
@@ -445,7 +444,7 @@ public class LandService {
|
|||||||
if(nickname.isEmpty() || !nickname.equals(landRequest.getUserName())){
|
if(nickname.isEmpty() || !nickname.equals(landRequest.getUserName())){
|
||||||
return LandResponse.builder()
|
return LandResponse.builder()
|
||||||
.status(CommonCode.ERROR.getHttpStatus())
|
.status(CommonCode.ERROR.getHttpStatus())
|
||||||
.result(ErrorCode.GUID_CHECK.toString())
|
.result(ErrorCode.WARNING_GUID_CHECK.toString())
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -180,7 +180,7 @@ public class MailService {
|
|||||||
if(mailRequest.getGuid() != null){
|
if(mailRequest.getGuid() != null){
|
||||||
if(mailRequest.getUserType().equals(Mail.USERTYPE.GUID) && dynamoDBService.isGuidChecked(mailRequest.getGuid())){
|
if(mailRequest.getUserType().equals(Mail.USERTYPE.GUID) && dynamoDBService.isGuidChecked(mailRequest.getGuid())){
|
||||||
log.error("postMail RECEIVETYPE Single Guid Find Fail");
|
log.error("postMail RECEIVETYPE Single Guid Find Fail");
|
||||||
throw new RestApiException(CommonCode.ERROR.getHttpStatus(), ErrorCode.GUID_CHECK.getMessage());
|
throw new RestApiException(CommonCode.ERROR.getHttpStatus(), ErrorCode.WARNING_GUID_CHECK.getMessage());
|
||||||
}
|
}
|
||||||
String guid = mailRequest.getGuid();
|
String guid = mailRequest.getGuid();
|
||||||
// 닉네임이면 guid로 바꾼다
|
// 닉네임이면 guid로 바꾼다
|
||||||
@@ -213,7 +213,7 @@ public class MailService {
|
|||||||
case "GUID" -> {
|
case "GUID" -> {
|
||||||
if (dynamoDBService.isGuidChecked(excel.getUser())) {
|
if (dynamoDBService.isGuidChecked(excel.getUser())) {
|
||||||
log.error("postMail Multi Guid({}) Find Fail", excel.getUser());
|
log.error("postMail Multi Guid({}) Find Fail", excel.getUser());
|
||||||
throw new RestApiException(CommonCode.ERROR.getHttpStatus(), ErrorCode.GUID_CHECK.toString());
|
throw new RestApiException(CommonCode.ERROR.getHttpStatus(), ErrorCode.WARNING_GUID_CHECK.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
case "NICKNAME" -> {
|
case "NICKNAME" -> {
|
||||||
|
|||||||
@@ -9,11 +9,14 @@ import java.util.stream.Collectors;
|
|||||||
import com.caliverse.admin.domain.entity.FriendRequest;
|
import com.caliverse.admin.domain.entity.FriendRequest;
|
||||||
import com.caliverse.admin.domain.entity.HISTORYTYPE;
|
import com.caliverse.admin.domain.entity.HISTORYTYPE;
|
||||||
import com.caliverse.admin.domain.request.MailRequest;
|
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.MailAttrib;
|
||||||
import com.caliverse.admin.dynamodb.domain.atrrib.MailJsonAttrib;
|
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.domain.doc.MailDoc;
|
||||||
import com.caliverse.admin.dynamodb.dto.PageResult;
|
import com.caliverse.admin.dynamodb.dto.PageResult;
|
||||||
import com.caliverse.admin.dynamodb.service.DynamodbService;
|
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.global.common.utils.DynamodbUtil;
|
||||||
import com.caliverse.admin.redis.service.RedisUserInfoService;
|
import com.caliverse.admin.redis.service.RedisUserInfoService;
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
@@ -54,6 +57,8 @@ public class UsersService {
|
|||||||
@Qualifier("objectMapper")
|
@Qualifier("objectMapper")
|
||||||
@Autowired
|
@Autowired
|
||||||
private ObjectMapper objectMapper;
|
private ObjectMapper objectMapper;
|
||||||
|
@Autowired
|
||||||
|
private DynamodbUserService dynamodbUserService;
|
||||||
|
|
||||||
// 닉네임 변경
|
// 닉네임 변경
|
||||||
public UsersResponse changeNickname(UsersRequest usersRequest){
|
public UsersResponse changeNickname(UsersRequest usersRequest){
|
||||||
@@ -138,20 +143,41 @@ public class UsersService {
|
|||||||
|
|
||||||
public UsersResponse getBasicInfo(String guid){
|
public UsersResponse getBasicInfo(String guid){
|
||||||
|
|
||||||
String account_id = dynamoDBService.getGuidByAccountId(guid);
|
String account_id = dynamodbUserService.getGuidByAccountId(guid);
|
||||||
//userInfo
|
|
||||||
Map<String, Object> userInfo = dynamoDBService.getAccountInfo(account_id);
|
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
|
// 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);
|
boolean userSession = userGameSessionService.userSession(guid);
|
||||||
|
|
||||||
return UsersResponse.builder()
|
return UsersResponse.builder()
|
||||||
.resultData(
|
.resultData(
|
||||||
UsersResponse.ResultData.builder()
|
UsersResponse.ResultData.builder()
|
||||||
.charInfo((UsersResponse.CharInfo) charInfo.get("charInfo"))
|
.charInfo(charInfo)
|
||||||
.userInfo((UsersResponse.UserInfo) userInfo.get("userInfo"))
|
.userInfo(userInfo)
|
||||||
.userSession(userSession)
|
.userSession(userSession)
|
||||||
.build()
|
.build()
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ public class WhiteListService {
|
|||||||
Map<String, AttributeValue> whiteAttr = dynamoDBService.getItem("char#" + item, "char#" + item);
|
Map<String, AttributeValue> whiteAttr = dynamoDBService.getItem("char#" + item, "char#" + item);
|
||||||
//guid 검증
|
//guid 검증
|
||||||
if(whiteAttr.size() == 0){
|
if(whiteAttr.size() == 0){
|
||||||
throw new RestApiException(CommonCode.ERROR.getHttpStatus(), ErrorCode.GUID_CHECK.getMessage());
|
throw new RestApiException(CommonCode.ERROR.getHttpStatus(), ErrorCode.WARNING_GUID_CHECK.getMessage());
|
||||||
}
|
}
|
||||||
//화이트리스트 확정까지 보류
|
//화이트리스트 확정까지 보류
|
||||||
// boolean isWhiteUser = dynamoDBService.isWhiteOrBlackUser(whiteAttr.get("isWhiteUser"));
|
// boolean isWhiteUser = dynamoDBService.isWhiteOrBlackUser(whiteAttr.get("isWhiteUser"));
|
||||||
@@ -116,7 +116,7 @@ public class WhiteListService {
|
|||||||
|
|
||||||
//guid 검증
|
//guid 검증
|
||||||
if(whiteAttr.size() == 0){
|
if(whiteAttr.size() == 0){
|
||||||
throw new RestApiException(CommonCode.ERROR.getHttpStatus(), ErrorCode.GUID_CHECK.getMessage());
|
throw new RestApiException(CommonCode.ERROR.getHttpStatus(), ErrorCode.WARNING_GUID_CHECK.getMessage());
|
||||||
}
|
}
|
||||||
//화이트리스트 확정까지 보류
|
//화이트리스트 확정까지 보류
|
||||||
// boolean isWhiteUser = dynamoDBService.isWhiteOrBlackUser(whiteAttr.get("isWhiteUser"));
|
// boolean isWhiteUser = dynamoDBService.isWhiteOrBlackUser(whiteAttr.get("isWhiteUser"));
|
||||||
|
|||||||
@@ -10,5 +10,5 @@ public interface AccountBaseRepository extends DynamoDBRepository<AccountBaseDoc
|
|||||||
boolean isBlockUser(String account_id);
|
boolean isBlockUser(String account_id);
|
||||||
void updateBlockUserStart(String account_id, BlackList blackList);
|
void updateBlockUserStart(String account_id, BlackList blackList);
|
||||||
void updateBlockUserEnd(String account_id);
|
void updateBlockUserEnd(String account_id);
|
||||||
AccountBaseAttrib findUser(Long account_id);
|
AccountBaseAttrib findUser(String account_id);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -141,7 +141,7 @@ public class AccountBaseRepositoryImpl extends BaseDynamoDBRepository<AccountBas
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AccountBaseAttrib findUser(Long account_id) {
|
public AccountBaseAttrib findUser(String account_id) {
|
||||||
Key key = Key.builder()
|
Key key = Key.builder()
|
||||||
.partitionValue(DynamoDBConstants.PK_KEY_ACCOUNT_BASE + account_id)
|
.partitionValue(DynamoDBConstants.PK_KEY_ACCOUNT_BASE + account_id)
|
||||||
.sortValue(DynamoDBConstants.EMPTY)
|
.sortValue(DynamoDBConstants.EMPTY)
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
package com.caliverse.admin.dynamodb.service;
|
package com.caliverse.admin.dynamodb.service;
|
||||||
|
|
||||||
import com.caliverse.admin.domain.entity.BlackList;
|
import com.caliverse.admin.domain.entity.BlackList;
|
||||||
|
import com.caliverse.admin.dynamodb.domain.atrrib.AccountBaseAttrib;
|
||||||
|
import com.caliverse.admin.dynamodb.domain.atrrib.MoneyAttrib;
|
||||||
import com.caliverse.admin.dynamodb.domain.atrrib.NicknameAttrib;
|
import com.caliverse.admin.dynamodb.domain.atrrib.NicknameAttrib;
|
||||||
import com.caliverse.admin.dynamodb.domain.atrrib.UserBaseAttrib;
|
import com.caliverse.admin.dynamodb.domain.atrrib.UserBaseAttrib;
|
||||||
import com.caliverse.admin.dynamodb.repository.*;
|
import com.caliverse.admin.dynamodb.repository.*;
|
||||||
@@ -23,6 +25,7 @@ public class DynamodbUserService {
|
|||||||
private final UserBaseRepository userBaseRepository;
|
private final UserBaseRepository userBaseRepository;
|
||||||
private final UserNicknameRegistryRepository registryRepository;
|
private final UserNicknameRegistryRepository registryRepository;
|
||||||
private final NicknameRepository nicknameRepository;
|
private final NicknameRepository nicknameRepository;
|
||||||
|
private final MoneyRepository moneyRepository;
|
||||||
|
|
||||||
private final ObjectMapper mapper = new ObjectMapper();
|
private final ObjectMapper mapper = new ObjectMapper();
|
||||||
|
|
||||||
@@ -64,4 +67,12 @@ public class DynamodbUserService {
|
|||||||
return userBaseAttrib.getAccountId();
|
return userBaseAttrib.getAccountId();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public AccountBaseAttrib getAccountInfo(String accountId){
|
||||||
|
return accountBaseRepository.findUser(accountId);
|
||||||
|
}
|
||||||
|
|
||||||
|
public MoneyAttrib getMoneyInfo(String guid){
|
||||||
|
return moneyRepository.findAttrib(guid);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ public enum ErrorCode {
|
|||||||
//------------------------------------------------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------------------------------------------------
|
||||||
// DyanamoDB
|
// DyanamoDB
|
||||||
//------------------------------------------------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------------------------------------------------
|
||||||
GUID_CHECK("Guid를 확인해주세요."),
|
WARNING_GUID_CHECK("Guid를 확인해주세요."),
|
||||||
EMAIL_CHECK("Email을 확인해주세요"),
|
EMAIL_CHECK("Email을 확인해주세요"),
|
||||||
GUID_LENGTH_CHECK("guid(32자)를 확인해주세요."),
|
GUID_LENGTH_CHECK("guid(32자)를 확인해주세요."),
|
||||||
NICKNAME_CHECK("gameDB에 닉네임이 없습니다."),
|
NICKNAME_CHECK("gameDB에 닉네임이 없습니다."),
|
||||||
@@ -103,6 +103,7 @@ public enum ErrorCode {
|
|||||||
DYNAMODB_CONVERT_ERROR("형변환 도중 에러가 발생하였습니다."),
|
DYNAMODB_CONVERT_ERROR("형변환 도중 에러가 발생하였습니다."),
|
||||||
DYNAMODB_JSON_PARSE_ERROR("dynamoDB Json 변환 중 에러 발생"),
|
DYNAMODB_JSON_PARSE_ERROR("dynamoDB Json 변환 중 에러 발생"),
|
||||||
|
|
||||||
|
USER_BLOCK_REGIST_DUPLE_WARNING("이미 제재가 등록된 유저입니다."),
|
||||||
|
|
||||||
ADMINDB_EXIT_ERROR("admindb_exit_error"),
|
ADMINDB_EXIT_ERROR("admindb_exit_error"),
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user