Compare commits
49 Commits
01271cbf72
...
eed02de94e
| Author | SHA1 | Date | |
|---|---|---|---|
| eed02de94e | |||
| d5f28d9dba | |||
| 67d0b277de | |||
| 4e0304899c | |||
| 2c719227b4 | |||
| a50f703eb0 | |||
| a5122cfefc | |||
| 86d880e5c4 | |||
| 27320c44f8 | |||
| b22f0cdb50 | |||
| 4c00b074c4 | |||
| 160df69374 | |||
| 88c061fa65 | |||
| 4b61af8909 | |||
| c764dcbaf1 | |||
| 0973a36fc6 | |||
| 0fc081861b | |||
| 49dab65d25 | |||
| 0fbfdd906b | |||
| c5b0cd9b9d | |||
| e0b537bdb5 | |||
| 68c5f0a5ca | |||
| ebbba40054 | |||
| f6762671d9 | |||
| 927ef6c514 | |||
| 51100ecb31 | |||
| cb948c8a16 | |||
| 0c20a72173 | |||
| b6548a94a7 | |||
| 5b13f0c088 | |||
| a097fd7bb0 | |||
| 1e20e5ddf7 | |||
| 2cacd7a656 | |||
| 160377fe20 | |||
| e1cb55871b | |||
| 8b316bd5a3 | |||
| 2a94eb8f65 | |||
| f943a94f65 | |||
| ff7f8744e8 | |||
| 64c6791cc3 | |||
| 3acb92a579 | |||
| c5292fa20f | |||
| ed6e299814 | |||
| 8dcfc4ed13 | |||
| 4f1a26ca96 | |||
| 7c103cbba1 | |||
| 33691a48f4 | |||
| 2abd4b0067 | |||
| eac4fb8943 |
@@ -14,7 +14,9 @@ public enum StatisticsType {
|
||||
CAPACITY,
|
||||
UGQ_CREATE,
|
||||
SERVER_INFO,
|
||||
MONEY
|
||||
MONEY,
|
||||
USER_CREATE,
|
||||
USER_LOGIN
|
||||
;
|
||||
|
||||
public static StatisticsType getStatisticsType(String type) {
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.caliverse.admin.Indicators.entity;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.springframework.data.mongodb.core.mapping.Document;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Document(collection = "userCreate")
|
||||
public class UserCreateLogInfo extends LogInfoBase{
|
||||
private String logDay;
|
||||
private String accountId;
|
||||
private String userGuid;
|
||||
private String userNickname;
|
||||
private String createdTime;
|
||||
|
||||
public UserCreateLogInfo(String logDay, String accountId, String userGuid, String userNickname, String createdTime) {
|
||||
super(StatisticsType.USER_CREATE);
|
||||
|
||||
this.logDay = logDay;
|
||||
this.accountId = accountId;
|
||||
this.userGuid = userGuid;
|
||||
this.userNickname = userNickname;
|
||||
this.createdTime = createdTime;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.caliverse.admin.Indicators.entity;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import org.springframework.data.mongodb.core.mapping.Document;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Document(collection = "userLogin")
|
||||
public class UserLoginLogInfo extends LogInfoBase{
|
||||
private String logDay;
|
||||
private String accountId;
|
||||
private String userGuid;
|
||||
private String userNickname;
|
||||
private List<Map<String, Object>> sessions;
|
||||
private String firstLoginTime;
|
||||
private String lastLogoutTime;
|
||||
private Integer loginCount;
|
||||
private Double totalPlayTime;
|
||||
|
||||
public UserLoginLogInfo(String logDay,
|
||||
String accountId,
|
||||
String userGuid,
|
||||
String userNickname,
|
||||
List<Map<String, Object>> sessions,
|
||||
String firstLoginTime,
|
||||
String lastLogoutTime,
|
||||
Integer loginCount,
|
||||
Double totalPlayTime)
|
||||
{
|
||||
super(StatisticsType.USER_LOGIN);
|
||||
|
||||
this.logDay = logDay;
|
||||
this.accountId = accountId;
|
||||
this.userGuid = userGuid;
|
||||
this.userNickname = userNickname;
|
||||
this.sessions = sessions;
|
||||
this.firstLoginTime = firstLoginTime;
|
||||
this.lastLogoutTime = lastLogoutTime;
|
||||
this.loginCount = loginCount;
|
||||
this.totalPlayTime = totalPlayTime;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.caliverse.admin.Indicators.indicatorrepository;
|
||||
|
||||
import com.caliverse.admin.Indicators.entity.UserCreateLogInfo;
|
||||
import org.springframework.data.mongodb.repository.MongoRepository;
|
||||
|
||||
public interface IndicatorUserCreateRepository extends MongoRepository<UserCreateLogInfo, String> {
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package com.caliverse.admin.Indicators.indicatorrepository;
|
||||
|
||||
import com.caliverse.admin.Indicators.entity.UserLoginLogInfo;
|
||||
import org.springframework.data.mongodb.repository.MongoRepository;
|
||||
|
||||
public interface IndicatorUserLoginRepository extends MongoRepository<UserLoginLogInfo, String> {
|
||||
}
|
||||
@@ -19,10 +19,10 @@ public class MessageHandlerService {
|
||||
this.rabbitMqService = rabbitMqService;
|
||||
}
|
||||
|
||||
public void sendUserKickMessage(String userGuid, String serverName){
|
||||
public void sendUserKickMessage(String userGuid, String serverName, String reason){
|
||||
var user_kick_builder = ServerMessage.MOS2GS_NTF_USER_KICK.newBuilder();
|
||||
user_kick_builder.setUserGuid(userGuid);
|
||||
user_kick_builder.setKickReasonMsg("");
|
||||
user_kick_builder.setKickReasonMsg(String.format("backoffice %s", reason));
|
||||
user_kick_builder.setLogoutReasonType(LogoutReasonType.LogoutReasonType_None);
|
||||
|
||||
rabbitMqService.SendMessage(user_kick_builder.build(), serverName);
|
||||
|
||||
@@ -54,11 +54,15 @@ public class RabbitMqService {
|
||||
}
|
||||
catch (InvalidProtocolBufferException e) {
|
||||
log.error("InvalidProtocolBufferException message: {}, destServer: {}, e.Message : {}", message.toString(), destServer, e.getMessage());
|
||||
throw new RestApiException(CommonCode.ERROR.getHttpStatus(), ErrorCode.EXCEPTION_INVALID_PROTOCOL_BUFFER_EXCEPTION_ERROR.getMessage());
|
||||
throw new RuntimeException("InvalidProtocolBufferException message: " + message, e);
|
||||
}
|
||||
catch (IOException e) {
|
||||
log.error("IOException message: {}, destServer: {}, e.Message : {}", message.toString(), destServer, e.getMessage());
|
||||
throw new RestApiException(CommonCode.ERROR.getHttpStatus(), ErrorCode.EXCEPTION_IO_EXCEPTION_ERROR.getMessage());
|
||||
throw new RuntimeException("IOException message: " + message, e);
|
||||
}
|
||||
catch (Exception e) {
|
||||
log.error("Exception message: {}, destServer: {}, e.Message : {}", message.toString(), destServer, e.getMessage());
|
||||
throw new RuntimeException("Exception message: " + message, e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,731 @@
|
||||
// Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||
// source: Game_Define.proto
|
||||
|
||||
package com.caliverse.admin.domain.RabbitMq.message;
|
||||
|
||||
/**
|
||||
* Protobuf type {@code FloorProfitInfo}
|
||||
*/
|
||||
public final class FloorProfitInfo extends
|
||||
com.google.protobuf.GeneratedMessageV3 implements
|
||||
// @@protoc_insertion_point(message_implements:FloorProfitInfo)
|
||||
FloorProfitInfoOrBuilder {
|
||||
private static final long serialVersionUID = 0L;
|
||||
// Use FloorProfitInfo.newBuilder() to construct.
|
||||
private FloorProfitInfo(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
|
||||
super(builder);
|
||||
}
|
||||
private FloorProfitInfo() {
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
@SuppressWarnings({"unused"})
|
||||
protected java.lang.Object newInstance(
|
||||
UnusedPrivateParameter unused) {
|
||||
return new FloorProfitInfo();
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public final com.google.protobuf.UnknownFieldSet
|
||||
getUnknownFields() {
|
||||
return this.unknownFields;
|
||||
}
|
||||
public static final com.google.protobuf.Descriptors.Descriptor
|
||||
getDescriptor() {
|
||||
return com.caliverse.admin.domain.RabbitMq.message.GameDefine.internal_static_FloorProfitInfo_descriptor;
|
||||
}
|
||||
|
||||
@SuppressWarnings({"rawtypes"})
|
||||
@java.lang.Override
|
||||
protected com.google.protobuf.MapField internalGetMapField(
|
||||
int number) {
|
||||
switch (number) {
|
||||
case 1:
|
||||
return internalGetProfits();
|
||||
default:
|
||||
throw new RuntimeException(
|
||||
"Invalid map field number: " + number);
|
||||
}
|
||||
}
|
||||
@java.lang.Override
|
||||
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
|
||||
internalGetFieldAccessorTable() {
|
||||
return com.caliverse.admin.domain.RabbitMq.message.GameDefine.internal_static_FloorProfitInfo_fieldAccessorTable
|
||||
.ensureFieldAccessorsInitialized(
|
||||
com.caliverse.admin.domain.RabbitMq.message.FloorProfitInfo.class, com.caliverse.admin.domain.RabbitMq.message.FloorProfitInfo.Builder.class);
|
||||
}
|
||||
|
||||
public static final int PROFITS_FIELD_NUMBER = 1;
|
||||
private static final class ProfitsDefaultEntryHolder {
|
||||
static final com.google.protobuf.MapEntry<
|
||||
java.lang.Integer, com.caliverse.admin.domain.RabbitMq.message.Money> defaultEntry =
|
||||
com.google.protobuf.MapEntry
|
||||
.<java.lang.Integer, com.caliverse.admin.domain.RabbitMq.message.Money>newDefaultInstance(
|
||||
com.caliverse.admin.domain.RabbitMq.message.GameDefine.internal_static_FloorProfitInfo_ProfitsEntry_descriptor,
|
||||
com.google.protobuf.WireFormat.FieldType.INT32,
|
||||
0,
|
||||
com.google.protobuf.WireFormat.FieldType.MESSAGE,
|
||||
com.caliverse.admin.domain.RabbitMq.message.Money.getDefaultInstance());
|
||||
}
|
||||
@SuppressWarnings("serial")
|
||||
private com.google.protobuf.MapField<
|
||||
java.lang.Integer, com.caliverse.admin.domain.RabbitMq.message.Money> profits_;
|
||||
private com.google.protobuf.MapField<java.lang.Integer, com.caliverse.admin.domain.RabbitMq.message.Money>
|
||||
internalGetProfits() {
|
||||
if (profits_ == null) {
|
||||
return com.google.protobuf.MapField.emptyMapField(
|
||||
ProfitsDefaultEntryHolder.defaultEntry);
|
||||
}
|
||||
return profits_;
|
||||
}
|
||||
public int getProfitsCount() {
|
||||
return internalGetProfits().getMap().size();
|
||||
}
|
||||
/**
|
||||
* <pre>
|
||||
* <CurrencyType, Money>
|
||||
* </pre>
|
||||
*
|
||||
* <code>map<int32, .Money> profits = 1;</code>
|
||||
*/
|
||||
@java.lang.Override
|
||||
public boolean containsProfits(
|
||||
int key) {
|
||||
|
||||
return internalGetProfits().getMap().containsKey(key);
|
||||
}
|
||||
/**
|
||||
* Use {@link #getProfitsMap()} instead.
|
||||
*/
|
||||
@java.lang.Override
|
||||
@java.lang.Deprecated
|
||||
public java.util.Map<java.lang.Integer, com.caliverse.admin.domain.RabbitMq.message.Money> getProfits() {
|
||||
return getProfitsMap();
|
||||
}
|
||||
/**
|
||||
* <pre>
|
||||
* <CurrencyType, Money>
|
||||
* </pre>
|
||||
*
|
||||
* <code>map<int32, .Money> profits = 1;</code>
|
||||
*/
|
||||
@java.lang.Override
|
||||
public java.util.Map<java.lang.Integer, com.caliverse.admin.domain.RabbitMq.message.Money> getProfitsMap() {
|
||||
return internalGetProfits().getMap();
|
||||
}
|
||||
/**
|
||||
* <pre>
|
||||
* <CurrencyType, Money>
|
||||
* </pre>
|
||||
*
|
||||
* <code>map<int32, .Money> profits = 1;</code>
|
||||
*/
|
||||
@java.lang.Override
|
||||
public /* nullable */
|
||||
com.caliverse.admin.domain.RabbitMq.message.Money getProfitsOrDefault(
|
||||
int key,
|
||||
/* nullable */
|
||||
com.caliverse.admin.domain.RabbitMq.message.Money defaultValue) {
|
||||
|
||||
java.util.Map<java.lang.Integer, com.caliverse.admin.domain.RabbitMq.message.Money> map =
|
||||
internalGetProfits().getMap();
|
||||
return map.containsKey(key) ? map.get(key) : defaultValue;
|
||||
}
|
||||
/**
|
||||
* <pre>
|
||||
* <CurrencyType, Money>
|
||||
* </pre>
|
||||
*
|
||||
* <code>map<int32, .Money> profits = 1;</code>
|
||||
*/
|
||||
@java.lang.Override
|
||||
public com.caliverse.admin.domain.RabbitMq.message.Money getProfitsOrThrow(
|
||||
int key) {
|
||||
|
||||
java.util.Map<java.lang.Integer, com.caliverse.admin.domain.RabbitMq.message.Money> map =
|
||||
internalGetProfits().getMap();
|
||||
if (!map.containsKey(key)) {
|
||||
throw new java.lang.IllegalArgumentException();
|
||||
}
|
||||
return map.get(key);
|
||||
}
|
||||
|
||||
private byte memoizedIsInitialized = -1;
|
||||
@java.lang.Override
|
||||
public final boolean isInitialized() {
|
||||
byte isInitialized = memoizedIsInitialized;
|
||||
if (isInitialized == 1) return true;
|
||||
if (isInitialized == 0) return false;
|
||||
|
||||
memoizedIsInitialized = 1;
|
||||
return true;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public void writeTo(com.google.protobuf.CodedOutputStream output)
|
||||
throws java.io.IOException {
|
||||
com.google.protobuf.GeneratedMessageV3
|
||||
.serializeIntegerMapTo(
|
||||
output,
|
||||
internalGetProfits(),
|
||||
ProfitsDefaultEntryHolder.defaultEntry,
|
||||
1);
|
||||
getUnknownFields().writeTo(output);
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public int getSerializedSize() {
|
||||
int size = memoizedSize;
|
||||
if (size != -1) return size;
|
||||
|
||||
size = 0;
|
||||
for (java.util.Map.Entry<java.lang.Integer, com.caliverse.admin.domain.RabbitMq.message.Money> entry
|
||||
: internalGetProfits().getMap().entrySet()) {
|
||||
com.google.protobuf.MapEntry<java.lang.Integer, com.caliverse.admin.domain.RabbitMq.message.Money>
|
||||
profits__ = ProfitsDefaultEntryHolder.defaultEntry.newBuilderForType()
|
||||
.setKey(entry.getKey())
|
||||
.setValue(entry.getValue())
|
||||
.build();
|
||||
size += com.google.protobuf.CodedOutputStream
|
||||
.computeMessageSize(1, profits__);
|
||||
}
|
||||
size += getUnknownFields().getSerializedSize();
|
||||
memoizedSize = size;
|
||||
return size;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public boolean equals(final java.lang.Object obj) {
|
||||
if (obj == this) {
|
||||
return true;
|
||||
}
|
||||
if (!(obj instanceof com.caliverse.admin.domain.RabbitMq.message.FloorProfitInfo)) {
|
||||
return super.equals(obj);
|
||||
}
|
||||
com.caliverse.admin.domain.RabbitMq.message.FloorProfitInfo other = (com.caliverse.admin.domain.RabbitMq.message.FloorProfitInfo) obj;
|
||||
|
||||
if (!internalGetProfits().equals(
|
||||
other.internalGetProfits())) return false;
|
||||
if (!getUnknownFields().equals(other.getUnknownFields())) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public int hashCode() {
|
||||
if (memoizedHashCode != 0) {
|
||||
return memoizedHashCode;
|
||||
}
|
||||
int hash = 41;
|
||||
hash = (19 * hash) + getDescriptor().hashCode();
|
||||
if (!internalGetProfits().getMap().isEmpty()) {
|
||||
hash = (37 * hash) + PROFITS_FIELD_NUMBER;
|
||||
hash = (53 * hash) + internalGetProfits().hashCode();
|
||||
}
|
||||
hash = (29 * hash) + getUnknownFields().hashCode();
|
||||
memoizedHashCode = hash;
|
||||
return hash;
|
||||
}
|
||||
|
||||
public static com.caliverse.admin.domain.RabbitMq.message.FloorProfitInfo parseFrom(
|
||||
java.nio.ByteBuffer data)
|
||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||
return PARSER.parseFrom(data);
|
||||
}
|
||||
public static com.caliverse.admin.domain.RabbitMq.message.FloorProfitInfo parseFrom(
|
||||
java.nio.ByteBuffer data,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||
return PARSER.parseFrom(data, extensionRegistry);
|
||||
}
|
||||
public static com.caliverse.admin.domain.RabbitMq.message.FloorProfitInfo parseFrom(
|
||||
com.google.protobuf.ByteString data)
|
||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||
return PARSER.parseFrom(data);
|
||||
}
|
||||
public static com.caliverse.admin.domain.RabbitMq.message.FloorProfitInfo parseFrom(
|
||||
com.google.protobuf.ByteString data,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||
return PARSER.parseFrom(data, extensionRegistry);
|
||||
}
|
||||
public static com.caliverse.admin.domain.RabbitMq.message.FloorProfitInfo parseFrom(byte[] data)
|
||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||
return PARSER.parseFrom(data);
|
||||
}
|
||||
public static com.caliverse.admin.domain.RabbitMq.message.FloorProfitInfo parseFrom(
|
||||
byte[] data,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||
return PARSER.parseFrom(data, extensionRegistry);
|
||||
}
|
||||
public static com.caliverse.admin.domain.RabbitMq.message.FloorProfitInfo parseFrom(java.io.InputStream input)
|
||||
throws java.io.IOException {
|
||||
return com.google.protobuf.GeneratedMessageV3
|
||||
.parseWithIOException(PARSER, input);
|
||||
}
|
||||
public static com.caliverse.admin.domain.RabbitMq.message.FloorProfitInfo parseFrom(
|
||||
java.io.InputStream input,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws java.io.IOException {
|
||||
return com.google.protobuf.GeneratedMessageV3
|
||||
.parseWithIOException(PARSER, input, extensionRegistry);
|
||||
}
|
||||
public static com.caliverse.admin.domain.RabbitMq.message.FloorProfitInfo parseDelimitedFrom(java.io.InputStream input)
|
||||
throws java.io.IOException {
|
||||
return com.google.protobuf.GeneratedMessageV3
|
||||
.parseDelimitedWithIOException(PARSER, input);
|
||||
}
|
||||
public static com.caliverse.admin.domain.RabbitMq.message.FloorProfitInfo parseDelimitedFrom(
|
||||
java.io.InputStream input,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws java.io.IOException {
|
||||
return com.google.protobuf.GeneratedMessageV3
|
||||
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
|
||||
}
|
||||
public static com.caliverse.admin.domain.RabbitMq.message.FloorProfitInfo parseFrom(
|
||||
com.google.protobuf.CodedInputStream input)
|
||||
throws java.io.IOException {
|
||||
return com.google.protobuf.GeneratedMessageV3
|
||||
.parseWithIOException(PARSER, input);
|
||||
}
|
||||
public static com.caliverse.admin.domain.RabbitMq.message.FloorProfitInfo parseFrom(
|
||||
com.google.protobuf.CodedInputStream input,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws java.io.IOException {
|
||||
return com.google.protobuf.GeneratedMessageV3
|
||||
.parseWithIOException(PARSER, input, extensionRegistry);
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public Builder newBuilderForType() { return newBuilder(); }
|
||||
public static Builder newBuilder() {
|
||||
return DEFAULT_INSTANCE.toBuilder();
|
||||
}
|
||||
public static Builder newBuilder(com.caliverse.admin.domain.RabbitMq.message.FloorProfitInfo prototype) {
|
||||
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
|
||||
}
|
||||
@java.lang.Override
|
||||
public Builder toBuilder() {
|
||||
return this == DEFAULT_INSTANCE
|
||||
? new Builder() : new Builder().mergeFrom(this);
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
protected Builder newBuilderForType(
|
||||
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
|
||||
Builder builder = new Builder(parent);
|
||||
return builder;
|
||||
}
|
||||
/**
|
||||
* Protobuf type {@code FloorProfitInfo}
|
||||
*/
|
||||
public static final class Builder extends
|
||||
com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
|
||||
// @@protoc_insertion_point(builder_implements:FloorProfitInfo)
|
||||
com.caliverse.admin.domain.RabbitMq.message.FloorProfitInfoOrBuilder {
|
||||
public static final com.google.protobuf.Descriptors.Descriptor
|
||||
getDescriptor() {
|
||||
return com.caliverse.admin.domain.RabbitMq.message.GameDefine.internal_static_FloorProfitInfo_descriptor;
|
||||
}
|
||||
|
||||
@SuppressWarnings({"rawtypes"})
|
||||
protected com.google.protobuf.MapField internalGetMapField(
|
||||
int number) {
|
||||
switch (number) {
|
||||
case 1:
|
||||
return internalGetProfits();
|
||||
default:
|
||||
throw new RuntimeException(
|
||||
"Invalid map field number: " + number);
|
||||
}
|
||||
}
|
||||
@SuppressWarnings({"rawtypes"})
|
||||
protected com.google.protobuf.MapField internalGetMutableMapField(
|
||||
int number) {
|
||||
switch (number) {
|
||||
case 1:
|
||||
return internalGetMutableProfits();
|
||||
default:
|
||||
throw new RuntimeException(
|
||||
"Invalid map field number: " + number);
|
||||
}
|
||||
}
|
||||
@java.lang.Override
|
||||
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
|
||||
internalGetFieldAccessorTable() {
|
||||
return com.caliverse.admin.domain.RabbitMq.message.GameDefine.internal_static_FloorProfitInfo_fieldAccessorTable
|
||||
.ensureFieldAccessorsInitialized(
|
||||
com.caliverse.admin.domain.RabbitMq.message.FloorProfitInfo.class, com.caliverse.admin.domain.RabbitMq.message.FloorProfitInfo.Builder.class);
|
||||
}
|
||||
|
||||
// Construct using com.caliverse.admin.domain.RabbitMq.message.FloorProfitInfo.newBuilder()
|
||||
private Builder() {
|
||||
|
||||
}
|
||||
|
||||
private Builder(
|
||||
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
|
||||
super(parent);
|
||||
|
||||
}
|
||||
@java.lang.Override
|
||||
public Builder clear() {
|
||||
super.clear();
|
||||
bitField0_ = 0;
|
||||
internalGetMutableProfits().clear();
|
||||
return this;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public com.google.protobuf.Descriptors.Descriptor
|
||||
getDescriptorForType() {
|
||||
return com.caliverse.admin.domain.RabbitMq.message.GameDefine.internal_static_FloorProfitInfo_descriptor;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public com.caliverse.admin.domain.RabbitMq.message.FloorProfitInfo getDefaultInstanceForType() {
|
||||
return com.caliverse.admin.domain.RabbitMq.message.FloorProfitInfo.getDefaultInstance();
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public com.caliverse.admin.domain.RabbitMq.message.FloorProfitInfo build() {
|
||||
com.caliverse.admin.domain.RabbitMq.message.FloorProfitInfo result = buildPartial();
|
||||
if (!result.isInitialized()) {
|
||||
throw newUninitializedMessageException(result);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public com.caliverse.admin.domain.RabbitMq.message.FloorProfitInfo buildPartial() {
|
||||
com.caliverse.admin.domain.RabbitMq.message.FloorProfitInfo result = new com.caliverse.admin.domain.RabbitMq.message.FloorProfitInfo(this);
|
||||
if (bitField0_ != 0) { buildPartial0(result); }
|
||||
onBuilt();
|
||||
return result;
|
||||
}
|
||||
|
||||
private void buildPartial0(com.caliverse.admin.domain.RabbitMq.message.FloorProfitInfo result) {
|
||||
int from_bitField0_ = bitField0_;
|
||||
if (((from_bitField0_ & 0x00000001) != 0)) {
|
||||
result.profits_ = internalGetProfits();
|
||||
result.profits_.makeImmutable();
|
||||
}
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public Builder clone() {
|
||||
return super.clone();
|
||||
}
|
||||
@java.lang.Override
|
||||
public Builder setField(
|
||||
com.google.protobuf.Descriptors.FieldDescriptor field,
|
||||
java.lang.Object value) {
|
||||
return super.setField(field, value);
|
||||
}
|
||||
@java.lang.Override
|
||||
public Builder clearField(
|
||||
com.google.protobuf.Descriptors.FieldDescriptor field) {
|
||||
return super.clearField(field);
|
||||
}
|
||||
@java.lang.Override
|
||||
public Builder clearOneof(
|
||||
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
|
||||
return super.clearOneof(oneof);
|
||||
}
|
||||
@java.lang.Override
|
||||
public Builder setRepeatedField(
|
||||
com.google.protobuf.Descriptors.FieldDescriptor field,
|
||||
int index, java.lang.Object value) {
|
||||
return super.setRepeatedField(field, index, value);
|
||||
}
|
||||
@java.lang.Override
|
||||
public Builder addRepeatedField(
|
||||
com.google.protobuf.Descriptors.FieldDescriptor field,
|
||||
java.lang.Object value) {
|
||||
return super.addRepeatedField(field, value);
|
||||
}
|
||||
@java.lang.Override
|
||||
public Builder mergeFrom(com.google.protobuf.Message other) {
|
||||
if (other instanceof com.caliverse.admin.domain.RabbitMq.message.FloorProfitInfo) {
|
||||
return mergeFrom((com.caliverse.admin.domain.RabbitMq.message.FloorProfitInfo)other);
|
||||
} else {
|
||||
super.mergeFrom(other);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
public Builder mergeFrom(com.caliverse.admin.domain.RabbitMq.message.FloorProfitInfo other) {
|
||||
if (other == com.caliverse.admin.domain.RabbitMq.message.FloorProfitInfo.getDefaultInstance()) return this;
|
||||
internalGetMutableProfits().mergeFrom(
|
||||
other.internalGetProfits());
|
||||
bitField0_ |= 0x00000001;
|
||||
this.mergeUnknownFields(other.getUnknownFields());
|
||||
onChanged();
|
||||
return this;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public final boolean isInitialized() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public Builder mergeFrom(
|
||||
com.google.protobuf.CodedInputStream input,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws java.io.IOException {
|
||||
if (extensionRegistry == null) {
|
||||
throw new java.lang.NullPointerException();
|
||||
}
|
||||
try {
|
||||
boolean done = false;
|
||||
while (!done) {
|
||||
int tag = input.readTag();
|
||||
switch (tag) {
|
||||
case 0:
|
||||
done = true;
|
||||
break;
|
||||
case 10: {
|
||||
com.google.protobuf.MapEntry<java.lang.Integer, com.caliverse.admin.domain.RabbitMq.message.Money>
|
||||
profits__ = input.readMessage(
|
||||
ProfitsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry);
|
||||
internalGetMutableProfits().getMutableMap().put(
|
||||
profits__.getKey(), profits__.getValue());
|
||||
bitField0_ |= 0x00000001;
|
||||
break;
|
||||
} // case 10
|
||||
default: {
|
||||
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
|
||||
done = true; // was an endgroup tag
|
||||
}
|
||||
break;
|
||||
} // default:
|
||||
} // switch (tag)
|
||||
} // while (!done)
|
||||
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
|
||||
throw e.unwrapIOException();
|
||||
} finally {
|
||||
onChanged();
|
||||
} // finally
|
||||
return this;
|
||||
}
|
||||
private int bitField0_;
|
||||
|
||||
private com.google.protobuf.MapField<
|
||||
java.lang.Integer, com.caliverse.admin.domain.RabbitMq.message.Money> profits_;
|
||||
private com.google.protobuf.MapField<java.lang.Integer, com.caliverse.admin.domain.RabbitMq.message.Money>
|
||||
internalGetProfits() {
|
||||
if (profits_ == null) {
|
||||
return com.google.protobuf.MapField.emptyMapField(
|
||||
ProfitsDefaultEntryHolder.defaultEntry);
|
||||
}
|
||||
return profits_;
|
||||
}
|
||||
private com.google.protobuf.MapField<java.lang.Integer, com.caliverse.admin.domain.RabbitMq.message.Money>
|
||||
internalGetMutableProfits() {
|
||||
if (profits_ == null) {
|
||||
profits_ = com.google.protobuf.MapField.newMapField(
|
||||
ProfitsDefaultEntryHolder.defaultEntry);
|
||||
}
|
||||
if (!profits_.isMutable()) {
|
||||
profits_ = profits_.copy();
|
||||
}
|
||||
bitField0_ |= 0x00000001;
|
||||
onChanged();
|
||||
return profits_;
|
||||
}
|
||||
public int getProfitsCount() {
|
||||
return internalGetProfits().getMap().size();
|
||||
}
|
||||
/**
|
||||
* <pre>
|
||||
* <CurrencyType, Money>
|
||||
* </pre>
|
||||
*
|
||||
* <code>map<int32, .Money> profits = 1;</code>
|
||||
*/
|
||||
@java.lang.Override
|
||||
public boolean containsProfits(
|
||||
int key) {
|
||||
|
||||
return internalGetProfits().getMap().containsKey(key);
|
||||
}
|
||||
/**
|
||||
* Use {@link #getProfitsMap()} instead.
|
||||
*/
|
||||
@java.lang.Override
|
||||
@java.lang.Deprecated
|
||||
public java.util.Map<java.lang.Integer, com.caliverse.admin.domain.RabbitMq.message.Money> getProfits() {
|
||||
return getProfitsMap();
|
||||
}
|
||||
/**
|
||||
* <pre>
|
||||
* <CurrencyType, Money>
|
||||
* </pre>
|
||||
*
|
||||
* <code>map<int32, .Money> profits = 1;</code>
|
||||
*/
|
||||
@java.lang.Override
|
||||
public java.util.Map<java.lang.Integer, com.caliverse.admin.domain.RabbitMq.message.Money> getProfitsMap() {
|
||||
return internalGetProfits().getMap();
|
||||
}
|
||||
/**
|
||||
* <pre>
|
||||
* <CurrencyType, Money>
|
||||
* </pre>
|
||||
*
|
||||
* <code>map<int32, .Money> profits = 1;</code>
|
||||
*/
|
||||
@java.lang.Override
|
||||
public /* nullable */
|
||||
com.caliverse.admin.domain.RabbitMq.message.Money getProfitsOrDefault(
|
||||
int key,
|
||||
/* nullable */
|
||||
com.caliverse.admin.domain.RabbitMq.message.Money defaultValue) {
|
||||
|
||||
java.util.Map<java.lang.Integer, com.caliverse.admin.domain.RabbitMq.message.Money> map =
|
||||
internalGetProfits().getMap();
|
||||
return map.containsKey(key) ? map.get(key) : defaultValue;
|
||||
}
|
||||
/**
|
||||
* <pre>
|
||||
* <CurrencyType, Money>
|
||||
* </pre>
|
||||
*
|
||||
* <code>map<int32, .Money> profits = 1;</code>
|
||||
*/
|
||||
@java.lang.Override
|
||||
public com.caliverse.admin.domain.RabbitMq.message.Money getProfitsOrThrow(
|
||||
int key) {
|
||||
|
||||
java.util.Map<java.lang.Integer, com.caliverse.admin.domain.RabbitMq.message.Money> map =
|
||||
internalGetProfits().getMap();
|
||||
if (!map.containsKey(key)) {
|
||||
throw new java.lang.IllegalArgumentException();
|
||||
}
|
||||
return map.get(key);
|
||||
}
|
||||
public Builder clearProfits() {
|
||||
bitField0_ = (bitField0_ & ~0x00000001);
|
||||
internalGetMutableProfits().getMutableMap()
|
||||
.clear();
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <pre>
|
||||
* <CurrencyType, Money>
|
||||
* </pre>
|
||||
*
|
||||
* <code>map<int32, .Money> profits = 1;</code>
|
||||
*/
|
||||
public Builder removeProfits(
|
||||
int key) {
|
||||
|
||||
internalGetMutableProfits().getMutableMap()
|
||||
.remove(key);
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* Use alternate mutation accessors instead.
|
||||
*/
|
||||
@java.lang.Deprecated
|
||||
public java.util.Map<java.lang.Integer, com.caliverse.admin.domain.RabbitMq.message.Money>
|
||||
getMutableProfits() {
|
||||
bitField0_ |= 0x00000001;
|
||||
return internalGetMutableProfits().getMutableMap();
|
||||
}
|
||||
/**
|
||||
* <pre>
|
||||
* <CurrencyType, Money>
|
||||
* </pre>
|
||||
*
|
||||
* <code>map<int32, .Money> profits = 1;</code>
|
||||
*/
|
||||
public Builder putProfits(
|
||||
int key,
|
||||
com.caliverse.admin.domain.RabbitMq.message.Money value) {
|
||||
|
||||
if (value == null) { throw new NullPointerException("map value"); }
|
||||
internalGetMutableProfits().getMutableMap()
|
||||
.put(key, value);
|
||||
bitField0_ |= 0x00000001;
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
* <pre>
|
||||
* <CurrencyType, Money>
|
||||
* </pre>
|
||||
*
|
||||
* <code>map<int32, .Money> profits = 1;</code>
|
||||
*/
|
||||
public Builder putAllProfits(
|
||||
java.util.Map<java.lang.Integer, com.caliverse.admin.domain.RabbitMq.message.Money> values) {
|
||||
internalGetMutableProfits().getMutableMap()
|
||||
.putAll(values);
|
||||
bitField0_ |= 0x00000001;
|
||||
return this;
|
||||
}
|
||||
@java.lang.Override
|
||||
public final Builder setUnknownFields(
|
||||
final com.google.protobuf.UnknownFieldSet unknownFields) {
|
||||
return super.setUnknownFields(unknownFields);
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public final Builder mergeUnknownFields(
|
||||
final com.google.protobuf.UnknownFieldSet unknownFields) {
|
||||
return super.mergeUnknownFields(unknownFields);
|
||||
}
|
||||
|
||||
|
||||
// @@protoc_insertion_point(builder_scope:FloorProfitInfo)
|
||||
}
|
||||
|
||||
// @@protoc_insertion_point(class_scope:FloorProfitInfo)
|
||||
private static final com.caliverse.admin.domain.RabbitMq.message.FloorProfitInfo DEFAULT_INSTANCE;
|
||||
static {
|
||||
DEFAULT_INSTANCE = new com.caliverse.admin.domain.RabbitMq.message.FloorProfitInfo();
|
||||
}
|
||||
|
||||
public static com.caliverse.admin.domain.RabbitMq.message.FloorProfitInfo getDefaultInstance() {
|
||||
return DEFAULT_INSTANCE;
|
||||
}
|
||||
|
||||
private static final com.google.protobuf.Parser<FloorProfitInfo>
|
||||
PARSER = new com.google.protobuf.AbstractParser<FloorProfitInfo>() {
|
||||
@java.lang.Override
|
||||
public FloorProfitInfo parsePartialFrom(
|
||||
com.google.protobuf.CodedInputStream input,
|
||||
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
|
||||
throws com.google.protobuf.InvalidProtocolBufferException {
|
||||
Builder builder = newBuilder();
|
||||
try {
|
||||
builder.mergeFrom(input, extensionRegistry);
|
||||
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
|
||||
throw e.setUnfinishedMessage(builder.buildPartial());
|
||||
} catch (com.google.protobuf.UninitializedMessageException e) {
|
||||
throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
|
||||
} catch (java.io.IOException e) {
|
||||
throw new com.google.protobuf.InvalidProtocolBufferException(e)
|
||||
.setUnfinishedMessage(builder.buildPartial());
|
||||
}
|
||||
return builder.buildPartial();
|
||||
}
|
||||
};
|
||||
|
||||
public static com.google.protobuf.Parser<FloorProfitInfo> parser() {
|
||||
return PARSER;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public com.google.protobuf.Parser<FloorProfitInfo> getParserForType() {
|
||||
return PARSER;
|
||||
}
|
||||
|
||||
@java.lang.Override
|
||||
public com.caliverse.admin.domain.RabbitMq.message.FloorProfitInfo getDefaultInstanceForType() {
|
||||
return DEFAULT_INSTANCE;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
// Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||
// source: Game_Define.proto
|
||||
|
||||
package com.caliverse.admin.domain.RabbitMq.message;
|
||||
|
||||
public interface FloorProfitInfoOrBuilder extends
|
||||
// @@protoc_insertion_point(interface_extends:FloorProfitInfo)
|
||||
com.google.protobuf.MessageOrBuilder {
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* <CurrencyType, Money>
|
||||
* </pre>
|
||||
*
|
||||
* <code>map<int32, .Money> profits = 1;</code>
|
||||
*/
|
||||
int getProfitsCount();
|
||||
/**
|
||||
* <pre>
|
||||
* <CurrencyType, Money>
|
||||
* </pre>
|
||||
*
|
||||
* <code>map<int32, .Money> profits = 1;</code>
|
||||
*/
|
||||
boolean containsProfits(
|
||||
int key);
|
||||
/**
|
||||
* Use {@link #getProfitsMap()} instead.
|
||||
*/
|
||||
@java.lang.Deprecated
|
||||
java.util.Map<java.lang.Integer, com.caliverse.admin.domain.RabbitMq.message.Money>
|
||||
getProfits();
|
||||
/**
|
||||
* <pre>
|
||||
* <CurrencyType, Money>
|
||||
* </pre>
|
||||
*
|
||||
* <code>map<int32, .Money> profits = 1;</code>
|
||||
*/
|
||||
java.util.Map<java.lang.Integer, com.caliverse.admin.domain.RabbitMq.message.Money>
|
||||
getProfitsMap();
|
||||
/**
|
||||
* <pre>
|
||||
* <CurrencyType, Money>
|
||||
* </pre>
|
||||
*
|
||||
* <code>map<int32, .Money> profits = 1;</code>
|
||||
*/
|
||||
/* nullable */
|
||||
com.caliverse.admin.domain.RabbitMq.message.Money getProfitsOrDefault(
|
||||
int key,
|
||||
/* nullable */
|
||||
com.caliverse.admin.domain.RabbitMq.message.Money defaultValue);
|
||||
/**
|
||||
* <pre>
|
||||
* <CurrencyType, Money>
|
||||
* </pre>
|
||||
*
|
||||
* <code>map<int32, .Money> profits = 1;</code>
|
||||
*/
|
||||
com.caliverse.admin.domain.RabbitMq.message.Money getProfitsOrThrow(
|
||||
int key);
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1084,5 +1084,140 @@ public interface ServerMessageOrBuilder extends
|
||||
*/
|
||||
com.caliverse.admin.domain.RabbitMq.message.ServerMessage.GS2MQS_NTF_BEACON_COMPACT_SYNCOrBuilder getNtfBeaconCompactSyncOrBuilder();
|
||||
|
||||
/**
|
||||
* <code>.ServerMessage.OS2GS_REQ_CREATE_CALIUM_CONTENT_STORAGE reqCreateContentStorage = 78;</code>
|
||||
* @return Whether the reqCreateContentStorage field is set.
|
||||
*/
|
||||
boolean hasReqCreateContentStorage();
|
||||
/**
|
||||
* <code>.ServerMessage.OS2GS_REQ_CREATE_CALIUM_CONTENT_STORAGE reqCreateContentStorage = 78;</code>
|
||||
* @return The reqCreateContentStorage.
|
||||
*/
|
||||
com.caliverse.admin.domain.RabbitMq.message.ServerMessage.OS2GS_REQ_CREATE_CALIUM_CONTENT_STORAGE getReqCreateContentStorage();
|
||||
/**
|
||||
* <code>.ServerMessage.OS2GS_REQ_CREATE_CALIUM_CONTENT_STORAGE reqCreateContentStorage = 78;</code>
|
||||
*/
|
||||
com.caliverse.admin.domain.RabbitMq.message.ServerMessage.OS2GS_REQ_CREATE_CALIUM_CONTENT_STORAGEOrBuilder getReqCreateContentStorageOrBuilder();
|
||||
|
||||
/**
|
||||
* <code>.ServerMessage.OS2GS_ACK_CREATE_CALIUM_CONTENT_STORAGE ackCreateContentStorage = 79;</code>
|
||||
* @return Whether the ackCreateContentStorage field is set.
|
||||
*/
|
||||
boolean hasAckCreateContentStorage();
|
||||
/**
|
||||
* <code>.ServerMessage.OS2GS_ACK_CREATE_CALIUM_CONTENT_STORAGE ackCreateContentStorage = 79;</code>
|
||||
* @return The ackCreateContentStorage.
|
||||
*/
|
||||
com.caliverse.admin.domain.RabbitMq.message.ServerMessage.OS2GS_ACK_CREATE_CALIUM_CONTENT_STORAGE getAckCreateContentStorage();
|
||||
/**
|
||||
* <code>.ServerMessage.OS2GS_ACK_CREATE_CALIUM_CONTENT_STORAGE ackCreateContentStorage = 79;</code>
|
||||
*/
|
||||
com.caliverse.admin.domain.RabbitMq.message.ServerMessage.OS2GS_ACK_CREATE_CALIUM_CONTENT_STORAGEOrBuilder getAckCreateContentStorageOrBuilder();
|
||||
|
||||
/**
|
||||
* <code>.ServerMessage.GS2GS_NTF_CHANGE_CALIUM_STORAGE_INFO ntfChangeCaliumStorageInfo = 80;</code>
|
||||
* @return Whether the ntfChangeCaliumStorageInfo field is set.
|
||||
*/
|
||||
boolean hasNtfChangeCaliumStorageInfo();
|
||||
/**
|
||||
* <code>.ServerMessage.GS2GS_NTF_CHANGE_CALIUM_STORAGE_INFO ntfChangeCaliumStorageInfo = 80;</code>
|
||||
* @return The ntfChangeCaliumStorageInfo.
|
||||
*/
|
||||
com.caliverse.admin.domain.RabbitMq.message.ServerMessage.GS2GS_NTF_CHANGE_CALIUM_STORAGE_INFO getNtfChangeCaliumStorageInfo();
|
||||
/**
|
||||
* <code>.ServerMessage.GS2GS_NTF_CHANGE_CALIUM_STORAGE_INFO ntfChangeCaliumStorageInfo = 80;</code>
|
||||
*/
|
||||
com.caliverse.admin.domain.RabbitMq.message.ServerMessage.GS2GS_NTF_CHANGE_CALIUM_STORAGE_INFOOrBuilder getNtfChangeCaliumStorageInfoOrBuilder();
|
||||
|
||||
/**
|
||||
* <code>.ServerMessage.GS2GS_NTF_MODIFY_LAND_INFO ntfModifyLandInfo = 81;</code>
|
||||
* @return Whether the ntfModifyLandInfo field is set.
|
||||
*/
|
||||
boolean hasNtfModifyLandInfo();
|
||||
/**
|
||||
* <code>.ServerMessage.GS2GS_NTF_MODIFY_LAND_INFO ntfModifyLandInfo = 81;</code>
|
||||
* @return The ntfModifyLandInfo.
|
||||
*/
|
||||
com.caliverse.admin.domain.RabbitMq.message.ServerMessage.GS2GS_NTF_MODIFY_LAND_INFO getNtfModifyLandInfo();
|
||||
/**
|
||||
* <code>.ServerMessage.GS2GS_NTF_MODIFY_LAND_INFO ntfModifyLandInfo = 81;</code>
|
||||
*/
|
||||
com.caliverse.admin.domain.RabbitMq.message.ServerMessage.GS2GS_NTF_MODIFY_LAND_INFOOrBuilder getNtfModifyLandInfoOrBuilder();
|
||||
|
||||
/**
|
||||
* <code>.ServerMessage.GS2GS_NTF_MODIFY_BUILDING_INFO ntfModifyBuildingInfo = 82;</code>
|
||||
* @return Whether the ntfModifyBuildingInfo field is set.
|
||||
*/
|
||||
boolean hasNtfModifyBuildingInfo();
|
||||
/**
|
||||
* <code>.ServerMessage.GS2GS_NTF_MODIFY_BUILDING_INFO ntfModifyBuildingInfo = 82;</code>
|
||||
* @return The ntfModifyBuildingInfo.
|
||||
*/
|
||||
com.caliverse.admin.domain.RabbitMq.message.ServerMessage.GS2GS_NTF_MODIFY_BUILDING_INFO getNtfModifyBuildingInfo();
|
||||
/**
|
||||
* <code>.ServerMessage.GS2GS_NTF_MODIFY_BUILDING_INFO ntfModifyBuildingInfo = 82;</code>
|
||||
*/
|
||||
com.caliverse.admin.domain.RabbitMq.message.ServerMessage.GS2GS_NTF_MODIFY_BUILDING_INFOOrBuilder getNtfModifyBuildingInfoOrBuilder();
|
||||
|
||||
/**
|
||||
* <code>.ServerMessage.GS2GS_NTF_MODIFY_BUILDING_PROFIT ntfModifyBuildingProfit = 83;</code>
|
||||
* @return Whether the ntfModifyBuildingProfit field is set.
|
||||
*/
|
||||
boolean hasNtfModifyBuildingProfit();
|
||||
/**
|
||||
* <code>.ServerMessage.GS2GS_NTF_MODIFY_BUILDING_PROFIT ntfModifyBuildingProfit = 83;</code>
|
||||
* @return The ntfModifyBuildingProfit.
|
||||
*/
|
||||
com.caliverse.admin.domain.RabbitMq.message.ServerMessage.GS2GS_NTF_MODIFY_BUILDING_PROFIT getNtfModifyBuildingProfit();
|
||||
/**
|
||||
* <code>.ServerMessage.GS2GS_NTF_MODIFY_BUILDING_PROFIT ntfModifyBuildingProfit = 83;</code>
|
||||
*/
|
||||
com.caliverse.admin.domain.RabbitMq.message.ServerMessage.GS2GS_NTF_MODIFY_BUILDING_PROFITOrBuilder getNtfModifyBuildingProfitOrBuilder();
|
||||
|
||||
/**
|
||||
* <code>.ServerMessage.GS2GS_NTF_LAND_AUCTION_HIGHEST_BIDDER_CHANGE ntfLandAuctionHighestBidderChange = 84;</code>
|
||||
* @return Whether the ntfLandAuctionHighestBidderChange field is set.
|
||||
*/
|
||||
boolean hasNtfLandAuctionHighestBidderChange();
|
||||
/**
|
||||
* <code>.ServerMessage.GS2GS_NTF_LAND_AUCTION_HIGHEST_BIDDER_CHANGE ntfLandAuctionHighestBidderChange = 84;</code>
|
||||
* @return The ntfLandAuctionHighestBidderChange.
|
||||
*/
|
||||
com.caliverse.admin.domain.RabbitMq.message.ServerMessage.GS2GS_NTF_LAND_AUCTION_HIGHEST_BIDDER_CHANGE getNtfLandAuctionHighestBidderChange();
|
||||
/**
|
||||
* <code>.ServerMessage.GS2GS_NTF_LAND_AUCTION_HIGHEST_BIDDER_CHANGE ntfLandAuctionHighestBidderChange = 84;</code>
|
||||
*/
|
||||
com.caliverse.admin.domain.RabbitMq.message.ServerMessage.GS2GS_NTF_LAND_AUCTION_HIGHEST_BIDDER_CHANGEOrBuilder getNtfLandAuctionHighestBidderChangeOrBuilder();
|
||||
|
||||
/**
|
||||
* <code>.ServerMessage.GS2GS_NTF_LAND_AUCTION_WINNING_BID ntfLandAuctionWinningBid = 85;</code>
|
||||
* @return Whether the ntfLandAuctionWinningBid field is set.
|
||||
*/
|
||||
boolean hasNtfLandAuctionWinningBid();
|
||||
/**
|
||||
* <code>.ServerMessage.GS2GS_NTF_LAND_AUCTION_WINNING_BID ntfLandAuctionWinningBid = 85;</code>
|
||||
* @return The ntfLandAuctionWinningBid.
|
||||
*/
|
||||
com.caliverse.admin.domain.RabbitMq.message.ServerMessage.GS2GS_NTF_LAND_AUCTION_WINNING_BID getNtfLandAuctionWinningBid();
|
||||
/**
|
||||
* <code>.ServerMessage.GS2GS_NTF_LAND_AUCTION_WINNING_BID ntfLandAuctionWinningBid = 85;</code>
|
||||
*/
|
||||
com.caliverse.admin.domain.RabbitMq.message.ServerMessage.GS2GS_NTF_LAND_AUCTION_WINNING_BIDOrBuilder getNtfLandAuctionWinningBidOrBuilder();
|
||||
|
||||
/**
|
||||
* <code>.ServerMessage.GS2GS_NTF_LAND_AUCTION_RESERVATION ntfLandAuctionReservation = 86;</code>
|
||||
* @return Whether the ntfLandAuctionReservation field is set.
|
||||
*/
|
||||
boolean hasNtfLandAuctionReservation();
|
||||
/**
|
||||
* <code>.ServerMessage.GS2GS_NTF_LAND_AUCTION_RESERVATION ntfLandAuctionReservation = 86;</code>
|
||||
* @return The ntfLandAuctionReservation.
|
||||
*/
|
||||
com.caliverse.admin.domain.RabbitMq.message.ServerMessage.GS2GS_NTF_LAND_AUCTION_RESERVATION getNtfLandAuctionReservation();
|
||||
/**
|
||||
* <code>.ServerMessage.GS2GS_NTF_LAND_AUCTION_RESERVATION ntfLandAuctionReservation = 86;</code>
|
||||
*/
|
||||
com.caliverse.admin.domain.RabbitMq.message.ServerMessage.GS2GS_NTF_LAND_AUCTION_RESERVATIONOrBuilder getNtfLandAuctionReservationOrBuilder();
|
||||
|
||||
public com.caliverse.admin.domain.RabbitMq.message.ServerMessage.MsgCase getMsgCase();
|
||||
}
|
||||
|
||||
@@ -424,6 +424,56 @@ public final class ServerMessageOuterClass {
|
||||
static final
|
||||
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
|
||||
internal_static_ServerMessage_GS2GS_NTF_MODIFY_FLOOR_LINKED_INFOS_fieldAccessorTable;
|
||||
static final com.google.protobuf.Descriptors.Descriptor
|
||||
internal_static_ServerMessage_OS2GS_REQ_CREATE_CALIUM_CONTENT_STORAGE_descriptor;
|
||||
static final
|
||||
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
|
||||
internal_static_ServerMessage_OS2GS_REQ_CREATE_CALIUM_CONTENT_STORAGE_fieldAccessorTable;
|
||||
static final com.google.protobuf.Descriptors.Descriptor
|
||||
internal_static_ServerMessage_OS2GS_ACK_CREATE_CALIUM_CONTENT_STORAGE_descriptor;
|
||||
static final
|
||||
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
|
||||
internal_static_ServerMessage_OS2GS_ACK_CREATE_CALIUM_CONTENT_STORAGE_fieldAccessorTable;
|
||||
static final com.google.protobuf.Descriptors.Descriptor
|
||||
internal_static_ServerMessage_GS2GS_NTF_CHANGE_CALIUM_STORAGE_INFO_descriptor;
|
||||
static final
|
||||
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
|
||||
internal_static_ServerMessage_GS2GS_NTF_CHANGE_CALIUM_STORAGE_INFO_fieldAccessorTable;
|
||||
static final com.google.protobuf.Descriptors.Descriptor
|
||||
internal_static_ServerMessage_GS2GS_NTF_MODIFY_LAND_INFO_descriptor;
|
||||
static final
|
||||
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
|
||||
internal_static_ServerMessage_GS2GS_NTF_MODIFY_LAND_INFO_fieldAccessorTable;
|
||||
static final com.google.protobuf.Descriptors.Descriptor
|
||||
internal_static_ServerMessage_GS2GS_NTF_MODIFY_BUILDING_INFO_descriptor;
|
||||
static final
|
||||
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
|
||||
internal_static_ServerMessage_GS2GS_NTF_MODIFY_BUILDING_INFO_fieldAccessorTable;
|
||||
static final com.google.protobuf.Descriptors.Descriptor
|
||||
internal_static_ServerMessage_GS2GS_NTF_MODIFY_BUILDING_PROFIT_descriptor;
|
||||
static final
|
||||
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
|
||||
internal_static_ServerMessage_GS2GS_NTF_MODIFY_BUILDING_PROFIT_fieldAccessorTable;
|
||||
static final com.google.protobuf.Descriptors.Descriptor
|
||||
internal_static_ServerMessage_GS2GS_NTF_MODIFY_BUILDING_PROFIT_FloorProfitsEntry_descriptor;
|
||||
static final
|
||||
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
|
||||
internal_static_ServerMessage_GS2GS_NTF_MODIFY_BUILDING_PROFIT_FloorProfitsEntry_fieldAccessorTable;
|
||||
static final com.google.protobuf.Descriptors.Descriptor
|
||||
internal_static_ServerMessage_GS2GS_NTF_LAND_AUCTION_HIGHEST_BIDDER_CHANGE_descriptor;
|
||||
static final
|
||||
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
|
||||
internal_static_ServerMessage_GS2GS_NTF_LAND_AUCTION_HIGHEST_BIDDER_CHANGE_fieldAccessorTable;
|
||||
static final com.google.protobuf.Descriptors.Descriptor
|
||||
internal_static_ServerMessage_GS2GS_NTF_LAND_AUCTION_WINNING_BID_descriptor;
|
||||
static final
|
||||
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
|
||||
internal_static_ServerMessage_GS2GS_NTF_LAND_AUCTION_WINNING_BID_fieldAccessorTable;
|
||||
static final com.google.protobuf.Descriptors.Descriptor
|
||||
internal_static_ServerMessage_GS2GS_NTF_LAND_AUCTION_RESERVATION_descriptor;
|
||||
static final
|
||||
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
|
||||
internal_static_ServerMessage_GS2GS_NTF_LAND_AUCTION_RESERVATION_fieldAccessorTable;
|
||||
|
||||
public static com.google.protobuf.Descriptors.FileDescriptor
|
||||
getDescriptor() {
|
||||
@@ -436,7 +486,7 @@ public final class ServerMessageOuterClass {
|
||||
"\n\023ServerMessage.proto\032\037google/protobuf/t" +
|
||||
"imestamp.proto\032\023Define_Common.proto\032\023Def" +
|
||||
"ine_Result.proto\032\033Define_ProgramVersion." +
|
||||
"proto\032\021Game_Define.proto\"\316`\n\rServerMessa" +
|
||||
"proto\032\021Game_Define.proto\"\327o\n\rServerMessa" +
|
||||
"ge\022/\n\013messageTime\030\001 \001(\0132\032.google.protobu" +
|
||||
"f.Timestamp\022\025\n\rmessageSender\030\002 \001(\t\022#\n\004ch" +
|
||||
"at\030\003 \001(\0132\023.ServerMessage.ChatH\000\022)\n\007kickR" +
|
||||
@@ -562,192 +612,240 @@ public final class ServerMessageOuterClass {
|
||||
"essage.GS2GS_NTF_MODIFY_FLOOR_LINKED_INF" +
|
||||
"OSH\000\022M\n\024ntfBeaconCompactSync\030M \001(\0132-.Ser" +
|
||||
"verMessage.GS2MQS_NTF_BEACON_COMPACT_SYN" +
|
||||
"CH\000\032\207\001\n\004Chat\022\027\n\004type\030\001 \001(\0162\t.ChatType\022\026\n" +
|
||||
"\016senderNickName\030\002 \001(\t\022\024\n\014receiverGuid\030\003 " +
|
||||
"\001(\t\022\'\n\rreceiverstate\030\004 \001(\0162\020.PlayerState" +
|
||||
"Type\022\017\n\007message\030\005 \001(\t\032&\n\007KickReq\022\r\n\005reqI" +
|
||||
"d\030\001 \001(\005\022\014\n\004name\030\002 \001(\t\032I\n\007KickRes\022\r\n\005reqI" +
|
||||
"d\030\001 \001(\005\022!\n\007errCode\030\002 \001(\0162\020.ServerErrorCo" +
|
||||
"de\022\014\n\004name\030\003 \001(\t\032\024\n\022GetServerConfigReq\032I" +
|
||||
"\n\022GetServerConfigRes\022\022\n\nserverType\030\001 \001(\005" +
|
||||
"\022\017\n\007worldId\030\002 \001(\005\022\016\n\006region\030\003 \001(\005\032\025\n\023Whi" +
|
||||
"teListUpdateNoti\032\025\n\023BlackListUpdateNoti\032" +
|
||||
"%\n\rInspectionReq\022\024\n\014isInspection\030\001 \001(\005\032/" +
|
||||
"\n\022ReadyForDistroyReq\022\031\n\021isReadyForDistro" +
|
||||
"y\030\001 \001(\005\032*\n\026ManagerServerActiveReq\022\020\n\010isA" +
|
||||
"ctive\030\001 \001(\005\032*\n\026ManagerServerActiveRes\022\020\n" +
|
||||
"\010isActive\030\001 \001(\005\032(\n\025ChangeServerConfigReq" +
|
||||
"\022\017\n\007maxUser\030\001 \001(\005\032\027\n\025AllKickNormalUserNo" +
|
||||
"ti\032&\n\017ReceiveMailNoti\022\023\n\013accountGuid\030\001 \001" +
|
||||
"(\t\032\254\001\n\032AwsAutoScaleGroupOptionReq\022\034\n\024sca" +
|
||||
"leOutPlusConstant\030\001 \001(\005\022\030\n\020scaleInCondit" +
|
||||
"ion\030\002 \001(\005\022\031\n\021scaleOutCondition\030\003 \001(\005\022\022\n\n" +
|
||||
"serverName\030\004 \001(\t\022\020\n\010groupMin\030\005 \001(\005\022\025\n\rgr" +
|
||||
"oupCapacity\030\006 \001(\005\032\034\n\032AwsAutoScaleGroupOp" +
|
||||
"tionRes\032N\n ExchangeMannequinDisplayItemN" +
|
||||
"oti\022\022\n\nanchorGuid\030\001 \001(\t\022\026\n\016displayItemId" +
|
||||
"s\030\002 \003(\005\032G\n\tSacleInfo\022\027\n\017ServerGroupName\030" +
|
||||
"\001 \001(\t\022\017\n\007MinSize\030\002 \001(\005\022\020\n\010CapaCity\030\003 \001(\005" +
|
||||
"\032\032\n\030GetAwsAutoScaleOptionReq\032\263\001\n\030GetAwsA" +
|
||||
"utoScaleOptionRes\022\034\n\024scaleOutPlusConstan" +
|
||||
"t\030\001 \001(\005\022\030\n\020scaleInCondition\030\002 \001(\005\022\031\n\021sca" +
|
||||
"leOutCondition\030\003 \001(\005\0222\n\020instanceInfoList" +
|
||||
"\030\004 \003(\0132\030.ServerMessage.SacleInfo\022\020\n\010isAc" +
|
||||
"tive\030\005 \001(\005\032^\n\027InviteFriendToMyHomeReq\022\023\n" +
|
||||
"\013inviterGuid\030\001 \001(\t\022\027\n\017inviterNickName\030\002 " +
|
||||
"\001(\t\022\025\n\rinviterRoomId\030\003 \001(\t\032\275\001\n\017ToFiendNo" +
|
||||
"tiBase\022\020\n\010senderId\030\001 \001(\t\022\022\n\nsenderGuid\030\002" +
|
||||
" \001(\t\022\026\n\016senderNickName\030\003 \001(\t\022\023\n\013senderSt" +
|
||||
"ate\030\004 \001(\005\022\023\n\013senderMapId\030\005 \001(\005\022\022\n\nreceiv" +
|
||||
"erId\030\006 \001(\t\022\024\n\014receiverGuid\030\007 \001(\t\022\030\n\020rece" +
|
||||
"iverNickName\030\010 \001(\t\032\224\001\n\020InviteMyHomeBase\022" +
|
||||
"\020\n\010senderId\030\001 \001(\t\022\022\n\nsenderGuid\030\002 \001(\t\022\026\n" +
|
||||
"\016senderNickName\030\003 \001(\t\022\022\n\nreceiverId\030\004 \001(" +
|
||||
"\t\022\024\n\014receiverGuid\030\005 \001(\t\022\030\n\020receiverNickN" +
|
||||
"ame\030\006 \001(\t\032n\n\021LoginNotiToFriend\0220\n\010baseIn" +
|
||||
"fo\030\001 \001(\0132\036.ServerMessage.ToFiendNotiBase" +
|
||||
"\022\'\n\014locationInfo\030\002 \001(\0132\021.UserLocationInf" +
|
||||
"o\032F\n\022LogoutNotiToFriend\0220\n\010baseInfo\030\001 \001(" +
|
||||
"\0132\036.ServerMessage.ToFiendNotiBase\032n\n\021Sta" +
|
||||
"teNotiToFriend\0220\n\010baseInfo\030\001 \001(\0132\036.Serve" +
|
||||
"rMessage.ToFiendNotiBase\022\'\n\014locationInfo" +
|
||||
"\030\002 \001(\0132\021.UserLocationInfo\032\335\001\n\027ReceiveInv" +
|
||||
"iteMyHomeNoti\0221\n\010baseInfo\030\001 \001(\0132\037.Server" +
|
||||
"Message.InviteMyHomeBase\022\027\n\017inviterMyHom" +
|
||||
"eId\030\002 \001(\t\022.\n\nexpireTime\030\003 \001(\0132\032.google.p" +
|
||||
"rotobuf.Timestamp\0223\n\017replyExpireTime\030\004 \001" +
|
||||
"(\0132\032.google.protobuf.Timestamp\022\021\n\tunique" +
|
||||
"Key\030\005 \001(\t\032Z\n\025ReplyInviteMyhomeNoti\022\026\n\016ac" +
|
||||
"ceptOrRefuse\030\001 \001(\005\022\022\n\nreceiverId\030\002 \001(\t\022\025" +
|
||||
"\n\rreplyUserGuid\030\003 \001(\t\032?\n\027KickFromFriends" +
|
||||
"HomeNoti\022\022\n\nkickerGuid\030\001 \001(\t\022\020\n\010kickerId" +
|
||||
"\030\002 \001(\t\032s\n\021FriendRequestInfo\022\014\n\004guid\030\001 \001(" +
|
||||
"\t\022\020\n\010nickName\030\002 \001(\t\022\r\n\005isNew\030\003 \001(\005\022/\n\013re" +
|
||||
"questTime\030\004 \001(\0132\032.google.protobuf.Timest" +
|
||||
"amp\032^\n\021FriendRequestNoti\0225\n\013requestInfo\030" +
|
||||
"\001 \001(\0132 .ServerMessage.FriendRequestInfo\022" +
|
||||
"\022\n\nreceiverId\030\002 \001(\t\032\222\001\n\020FriendAcceptNoti" +
|
||||
"\022\020\n\010senderId\030\001 \001(\t\022\022\n\nsenderGuid\030\002 \001(\t\022\026" +
|
||||
"\n\016senderNickName\030\003 \001(\t\022\026\n\016acceptOrRefuse" +
|
||||
"\030\004 \001(\005\022\022\n\nreceiverId\030\005 \001(\t\022\024\n\014receiverGu" +
|
||||
"id\030\006 \001(\t\032z\n\020FriendDeleteNoti\022\020\n\010senderId" +
|
||||
"\030\001 \001(\t\022\022\n\nsenderGuid\030\002 \001(\t\022\026\n\016senderNick" +
|
||||
"Name\030\003 \001(\t\022\022\n\nreceiverId\030\004 \001(\t\022\024\n\014receiv" +
|
||||
"erGuid\030\005 \001(\t\032\201\001\n\027CancelFriendRequestNoti" +
|
||||
"\022\020\n\010senderId\030\001 \001(\t\022\022\n\nsenderGuid\030\002 \001(\t\022\026" +
|
||||
"\n\016senderNickName\030\003 \001(\t\022\022\n\nreceiverId\030\004 \001" +
|
||||
"(\t\022\024\n\014receiverGuid\030\005 \001(\t\032\035\n\033KickedFromFr" +
|
||||
"iendsMyHomeNoti\032\227\001\n%GS2GS_REQ_RESERVATIO" +
|
||||
"N_ENTER_TO_SERVER\022!\n\010moveType\030\001 \001(\0162\017.Se" +
|
||||
"rverMoveType\022\031\n\021requestServerName\030\002 \001(\t\022" +
|
||||
"\027\n\017requestUserGuid\030\003 \001(\t\022\027\n\017summonPartyG" +
|
||||
"uid\030\004 \001(\t\032|\n%GS2GS_ACK_RESERVATION_ENTER" +
|
||||
"_TO_SERVER\022\027\n\006result\030\001 \001(\0132\007.Result\022\033\n\023r" +
|
||||
"eservationUserGuid\030\002 \001(\t\022\035\n\025reservationS" +
|
||||
"erverName\030\003 \001(\t\032\\\n&GS2GS_REQ_RESERVATION" +
|
||||
"_CANCEL_TO_SERVER\022\031\n\021requestServerName\030\001" +
|
||||
" \001(\t\022\027\n\017requestUserGuid\030\002 \001(\t\032A\n&GS2GS_A" +
|
||||
"CK_RESERVATION_CANCEL_TO_SERVER\022\027\n\017reque" +
|
||||
"stUserGuid\030\001 \001(\t\0326\n\034GS2GS_NTF_RETURN_USE" +
|
||||
"R_LOGOUT\022\026\n\016returnUserGuid\030\001 \001(\t\032R\n\034GS2C" +
|
||||
"_NTF_FRIEND_LEAVING_HOME\022\014\n\004guid\030\001 \001(\t\022\020" +
|
||||
"\n\010nickName\030\002 \001(\t\022\022\n\nreceiverId\030\003 \001(\t\032B\n\023" +
|
||||
"GS2C_NTF_PARTY_INFO\022\021\n\tpartyGuid\030\001 \001(\t\022\030" +
|
||||
"\n\020partyMemberGuids\030\002 \003(\t\032x\n\023GS2C_NTF_PAR" +
|
||||
"TY_CHAT\022\021\n\tpartyGuid\030\001 \001(\t\022\027\n\017partySende" +
|
||||
"rGuid\030\002 \001(\t\022\033\n\023partySenderNickname\030\003 \001(\t" +
|
||||
"\022\030\n\020partySendMessage\030\004 \001(\t\032\214\001\n\034GS2C_NTF_" +
|
||||
"PARTY_INVITE_RESULT\022#\n\terrorCode\030\001 \001(\0162\020" +
|
||||
".ServerErrorCode\022\027\n\017invitePartyGuid\030\002 \001(" +
|
||||
"\t\022\026\n\016inviteHostGuid\030\003 \001(\t\022\026\n\016inviteUserG" +
|
||||
"uid\030\004 \001(\t\0322\n\026GS2C_NTF_DESTROY_PARTY\022\030\n\020d" +
|
||||
"estroyPartyGuid\030\001 \001(\t\032a\n\017InvitePartyNoti" +
|
||||
"\022\026\n\016inviteUserGuid\030\001 \001(\t\022\035\n\025invitePartyL" +
|
||||
"eaderGuid\030\002 \001(\t\022\027\n\017invitePartyGuid\030\003 \001(\t" +
|
||||
"\032~\n\024ReplyInvitePartyNoti\022\027\n\017invitePartyG" +
|
||||
"uid\030\001 \001(\t\022\026\n\016inviteUserGuid\030\002 \001(\t\022\032\n\022inv" +
|
||||
"iteUserNickname\030\003 \001(\t\022\031\n\006result\030\004 \001(\0162\t." +
|
||||
"BoolType\032L\n\017CreatePartyNoti\022 \n\030joinParty" +
|
||||
"MemberAccountId\030\001 \001(\t\022\027\n\017createPartyGuid" +
|
||||
"\030\002 \001(\t\032E\n\023JoinPartyMemberNoti\022\021\n\tpartyGu" +
|
||||
"id\030\001 \001(\t\022\033\n\023joinPartyMemberInfo\030\002 \001(\t\032_\n" +
|
||||
"\024LeavePartyMemberNoti\022\021\n\tpartyGuid\030\001 \001(\t" +
|
||||
"\022\032\n\022leavePartyUserGuid\030\002 \001(\t\022\030\n\005isBan\030\003 " +
|
||||
"\001(\0162\t.BoolType\032a\n\031ChangePartyServerNameN" +
|
||||
"oti\022\021\n\tpartyGuid\030\001 \001(\t\022\035\n\nisAddition\030\002 \001" +
|
||||
"(\0162\t.BoolType\022\022\n\nServerName\030\003 \001(\t\032H\n\031Rem" +
|
||||
"ovePartyServerNameNoti\022\021\n\tpartyGuid\030\001 \001(" +
|
||||
"\t\022\030\n\020removeServerName\030\002 \001(\t\032F\n\025ChangePar" +
|
||||
"tyLeaderNoti\022\021\n\tpartyGuid\030\001 \001(\t\022\032\n\022newPa" +
|
||||
"rtyLeaderGuid\030\002 \001(\t\032@\n\025ExchangePartyName" +
|
||||
"Noti\022\021\n\tpartyGuid\030\001 \001(\t\022\024\n\014newPartyName\030" +
|
||||
"\002 \001(\t\0324\n\031JoiningPartyFlagResetNoti\022\027\n\017ta" +
|
||||
"rgetAccountId\030\001 \001(\t\032X\n\033ExchangePartyMemb" +
|
||||
"erMarkNoti\022\021\n\tpartyGuid\030\001 \001(\t\022\026\n\016memberU" +
|
||||
"serGuid\030\002 \001(\t\022\016\n\006markId\030\003 \001(\005\0328\n\014BanPart" +
|
||||
"yNoti\022\021\n\tpartyGuid\030\001 \001(\t\022\025\n\rbanMemberGui" +
|
||||
"d\030\002 \001(\t\032{\n\025SummonPartyMemberNoti\022\027\n\017summ" +
|
||||
"CH\000\022Y\n\027reqCreateContentStorage\030N \001(\01326.S" +
|
||||
"erverMessage.OS2GS_REQ_CREATE_CALIUM_CON" +
|
||||
"TENT_STORAGEH\000\022Y\n\027ackCreateContentStorag" +
|
||||
"e\030O \001(\01326.ServerMessage.OS2GS_ACK_CREATE" +
|
||||
"_CALIUM_CONTENT_STORAGEH\000\022Y\n\032ntfChangeCa" +
|
||||
"liumStorageInfo\030P \001(\01323.ServerMessage.GS" +
|
||||
"2GS_NTF_CHANGE_CALIUM_STORAGE_INFOH\000\022F\n\021" +
|
||||
"ntfModifyLandInfo\030Q \001(\0132).ServerMessage." +
|
||||
"GS2GS_NTF_MODIFY_LAND_INFOH\000\022N\n\025ntfModif" +
|
||||
"yBuildingInfo\030R \001(\0132-.ServerMessage.GS2G" +
|
||||
"S_NTF_MODIFY_BUILDING_INFOH\000\022R\n\027ntfModif" +
|
||||
"yBuildingProfit\030S \001(\0132/.ServerMessage.GS" +
|
||||
"2GS_NTF_MODIFY_BUILDING_PROFITH\000\022h\n!ntfL" +
|
||||
"andAuctionHighestBidderChange\030T \001(\0132;.Se" +
|
||||
"rverMessage.GS2GS_NTF_LAND_AUCTION_HIGHE" +
|
||||
"ST_BIDDER_CHANGEH\000\022U\n\030ntfLandAuctionWinn" +
|
||||
"ingBid\030U \001(\01321.ServerMessage.GS2GS_NTF_L" +
|
||||
"AND_AUCTION_WINNING_BIDH\000\022V\n\031ntfLandAuct" +
|
||||
"ionReservation\030V \001(\01321.ServerMessage.GS2" +
|
||||
"GS_NTF_LAND_AUCTION_RESERVATIONH\000\032\207\001\n\004Ch" +
|
||||
"at\022\027\n\004type\030\001 \001(\0162\t.ChatType\022\026\n\016senderNic" +
|
||||
"kName\030\002 \001(\t\022\024\n\014receiverGuid\030\003 \001(\t\022\'\n\rrec" +
|
||||
"eiverstate\030\004 \001(\0162\020.PlayerStateType\022\017\n\007me" +
|
||||
"ssage\030\005 \001(\t\032&\n\007KickReq\022\r\n\005reqId\030\001 \001(\005\022\014\n" +
|
||||
"\004name\030\002 \001(\t\032I\n\007KickRes\022\r\n\005reqId\030\001 \001(\005\022!\n" +
|
||||
"\007errCode\030\002 \001(\0162\020.ServerErrorCode\022\014\n\004name" +
|
||||
"\030\003 \001(\t\032\024\n\022GetServerConfigReq\032I\n\022GetServe" +
|
||||
"rConfigRes\022\022\n\nserverType\030\001 \001(\005\022\017\n\007worldI" +
|
||||
"d\030\002 \001(\005\022\016\n\006region\030\003 \001(\005\032\025\n\023WhiteListUpda" +
|
||||
"teNoti\032\025\n\023BlackListUpdateNoti\032%\n\rInspect" +
|
||||
"ionReq\022\024\n\014isInspection\030\001 \001(\005\032/\n\022ReadyFor" +
|
||||
"DistroyReq\022\031\n\021isReadyForDistroy\030\001 \001(\005\032*\n" +
|
||||
"\026ManagerServerActiveReq\022\020\n\010isActive\030\001 \001(" +
|
||||
"\005\032*\n\026ManagerServerActiveRes\022\020\n\010isActive\030" +
|
||||
"\001 \001(\005\032(\n\025ChangeServerConfigReq\022\017\n\007maxUse" +
|
||||
"r\030\001 \001(\005\032\027\n\025AllKickNormalUserNoti\032&\n\017Rece" +
|
||||
"iveMailNoti\022\023\n\013accountGuid\030\001 \001(\t\032\254\001\n\032Aws" +
|
||||
"AutoScaleGroupOptionReq\022\034\n\024scaleOutPlusC" +
|
||||
"onstant\030\001 \001(\005\022\030\n\020scaleInCondition\030\002 \001(\005\022" +
|
||||
"\031\n\021scaleOutCondition\030\003 \001(\005\022\022\n\nserverName" +
|
||||
"\030\004 \001(\t\022\020\n\010groupMin\030\005 \001(\005\022\025\n\rgroupCapacit" +
|
||||
"y\030\006 \001(\005\032\034\n\032AwsAutoScaleGroupOptionRes\032N\n" +
|
||||
" ExchangeMannequinDisplayItemNoti\022\022\n\nanc" +
|
||||
"horGuid\030\001 \001(\t\022\026\n\016displayItemIds\030\002 \003(\005\032G\n" +
|
||||
"\tSacleInfo\022\027\n\017ServerGroupName\030\001 \001(\t\022\017\n\007M" +
|
||||
"inSize\030\002 \001(\005\022\020\n\010CapaCity\030\003 \001(\005\032\032\n\030GetAws" +
|
||||
"AutoScaleOptionReq\032\263\001\n\030GetAwsAutoScaleOp" +
|
||||
"tionRes\022\034\n\024scaleOutPlusConstant\030\001 \001(\005\022\030\n" +
|
||||
"\020scaleInCondition\030\002 \001(\005\022\031\n\021scaleOutCondi" +
|
||||
"tion\030\003 \001(\005\0222\n\020instanceInfoList\030\004 \003(\0132\030.S" +
|
||||
"erverMessage.SacleInfo\022\020\n\010isActive\030\005 \001(\005" +
|
||||
"\032^\n\027InviteFriendToMyHomeReq\022\023\n\013inviterGu" +
|
||||
"id\030\001 \001(\t\022\027\n\017inviterNickName\030\002 \001(\t\022\025\n\rinv" +
|
||||
"iterRoomId\030\003 \001(\t\032\275\001\n\017ToFiendNotiBase\022\020\n\010" +
|
||||
"senderId\030\001 \001(\t\022\022\n\nsenderGuid\030\002 \001(\t\022\026\n\016se" +
|
||||
"nderNickName\030\003 \001(\t\022\023\n\013senderState\030\004 \001(\005\022" +
|
||||
"\023\n\013senderMapId\030\005 \001(\005\022\022\n\nreceiverId\030\006 \001(\t" +
|
||||
"\022\024\n\014receiverGuid\030\007 \001(\t\022\030\n\020receiverNickNa" +
|
||||
"me\030\010 \001(\t\032\224\001\n\020InviteMyHomeBase\022\020\n\010senderI" +
|
||||
"d\030\001 \001(\t\022\022\n\nsenderGuid\030\002 \001(\t\022\026\n\016senderNic" +
|
||||
"kName\030\003 \001(\t\022\022\n\nreceiverId\030\004 \001(\t\022\024\n\014recei" +
|
||||
"verGuid\030\005 \001(\t\022\030\n\020receiverNickName\030\006 \001(\t\032" +
|
||||
"n\n\021LoginNotiToFriend\0220\n\010baseInfo\030\001 \001(\0132\036" +
|
||||
".ServerMessage.ToFiendNotiBase\022\'\n\014locati" +
|
||||
"onInfo\030\002 \001(\0132\021.UserLocationInfo\032F\n\022Logou" +
|
||||
"tNotiToFriend\0220\n\010baseInfo\030\001 \001(\0132\036.Server" +
|
||||
"Message.ToFiendNotiBase\032n\n\021StateNotiToFr" +
|
||||
"iend\0220\n\010baseInfo\030\001 \001(\0132\036.ServerMessage.T" +
|
||||
"oFiendNotiBase\022\'\n\014locationInfo\030\002 \001(\0132\021.U" +
|
||||
"serLocationInfo\032\335\001\n\027ReceiveInviteMyHomeN" +
|
||||
"oti\0221\n\010baseInfo\030\001 \001(\0132\037.ServerMessage.In" +
|
||||
"viteMyHomeBase\022\027\n\017inviterMyHomeId\030\002 \001(\t\022" +
|
||||
".\n\nexpireTime\030\003 \001(\0132\032.google.protobuf.Ti" +
|
||||
"mestamp\0223\n\017replyExpireTime\030\004 \001(\0132\032.googl" +
|
||||
"e.protobuf.Timestamp\022\021\n\tuniqueKey\030\005 \001(\t\032" +
|
||||
"Z\n\025ReplyInviteMyhomeNoti\022\026\n\016acceptOrRefu" +
|
||||
"se\030\001 \001(\005\022\022\n\nreceiverId\030\002 \001(\t\022\025\n\rreplyUse" +
|
||||
"rGuid\030\003 \001(\t\032?\n\027KickFromFriendsHomeNoti\022\022" +
|
||||
"\n\nkickerGuid\030\001 \001(\t\022\020\n\010kickerId\030\002 \001(\t\032s\n\021" +
|
||||
"FriendRequestInfo\022\014\n\004guid\030\001 \001(\t\022\020\n\010nickN" +
|
||||
"ame\030\002 \001(\t\022\r\n\005isNew\030\003 \001(\005\022/\n\013requestTime\030" +
|
||||
"\004 \001(\0132\032.google.protobuf.Timestamp\032^\n\021Fri" +
|
||||
"endRequestNoti\0225\n\013requestInfo\030\001 \001(\0132 .Se" +
|
||||
"rverMessage.FriendRequestInfo\022\022\n\nreceive" +
|
||||
"rId\030\002 \001(\t\032\222\001\n\020FriendAcceptNoti\022\020\n\010sender" +
|
||||
"Id\030\001 \001(\t\022\022\n\nsenderGuid\030\002 \001(\t\022\026\n\016senderNi" +
|
||||
"ckName\030\003 \001(\t\022\026\n\016acceptOrRefuse\030\004 \001(\005\022\022\n\n" +
|
||||
"receiverId\030\005 \001(\t\022\024\n\014receiverGuid\030\006 \001(\t\032z" +
|
||||
"\n\020FriendDeleteNoti\022\020\n\010senderId\030\001 \001(\t\022\022\n\n" +
|
||||
"senderGuid\030\002 \001(\t\022\026\n\016senderNickName\030\003 \001(\t" +
|
||||
"\022\022\n\nreceiverId\030\004 \001(\t\022\024\n\014receiverGuid\030\005 \001" +
|
||||
"(\t\032\201\001\n\027CancelFriendRequestNoti\022\020\n\010sender" +
|
||||
"Id\030\001 \001(\t\022\022\n\nsenderGuid\030\002 \001(\t\022\026\n\016senderNi" +
|
||||
"ckName\030\003 \001(\t\022\022\n\nreceiverId\030\004 \001(\t\022\024\n\014rece" +
|
||||
"iverGuid\030\005 \001(\t\032\035\n\033KickedFromFriendsMyHom" +
|
||||
"eNoti\032\227\001\n%GS2GS_REQ_RESERVATION_ENTER_TO" +
|
||||
"_SERVER\022!\n\010moveType\030\001 \001(\0162\017.ServerMoveTy" +
|
||||
"pe\022\031\n\021requestServerName\030\002 \001(\t\022\027\n\017request" +
|
||||
"UserGuid\030\003 \001(\t\022\027\n\017summonPartyGuid\030\004 \001(\t\032" +
|
||||
"|\n%GS2GS_ACK_RESERVATION_ENTER_TO_SERVER" +
|
||||
"\022\027\n\006result\030\001 \001(\0132\007.Result\022\033\n\023reservation" +
|
||||
"UserGuid\030\002 \001(\t\022\035\n\025reservationServerName\030" +
|
||||
"\003 \001(\t\032\\\n&GS2GS_REQ_RESERVATION_CANCEL_TO" +
|
||||
"_SERVER\022\031\n\021requestServerName\030\001 \001(\t\022\027\n\017re" +
|
||||
"questUserGuid\030\002 \001(\t\032A\n&GS2GS_ACK_RESERVA" +
|
||||
"TION_CANCEL_TO_SERVER\022\027\n\017requestUserGuid" +
|
||||
"\030\001 \001(\t\0326\n\034GS2GS_NTF_RETURN_USER_LOGOUT\022\026" +
|
||||
"\n\016returnUserGuid\030\001 \001(\t\032R\n\034GS2C_NTF_FRIEN" +
|
||||
"D_LEAVING_HOME\022\014\n\004guid\030\001 \001(\t\022\020\n\010nickName" +
|
||||
"\030\002 \001(\t\022\022\n\nreceiverId\030\003 \001(\t\032B\n\023GS2C_NTF_P" +
|
||||
"ARTY_INFO\022\021\n\tpartyGuid\030\001 \001(\t\022\030\n\020partyMem" +
|
||||
"berGuids\030\002 \003(\t\032x\n\023GS2C_NTF_PARTY_CHAT\022\021\n" +
|
||||
"\tpartyGuid\030\001 \001(\t\022\027\n\017partySenderGuid\030\002 \001(" +
|
||||
"\t\022\033\n\023partySenderNickname\030\003 \001(\t\022\030\n\020partyS" +
|
||||
"endMessage\030\004 \001(\t\032\214\001\n\034GS2C_NTF_PARTY_INVI" +
|
||||
"TE_RESULT\022#\n\terrorCode\030\001 \001(\0162\020.ServerErr" +
|
||||
"orCode\022\027\n\017invitePartyGuid\030\002 \001(\t\022\026\n\016invit" +
|
||||
"eHostGuid\030\003 \001(\t\022\026\n\016inviteUserGuid\030\004 \001(\t\032" +
|
||||
"2\n\026GS2C_NTF_DESTROY_PARTY\022\030\n\020destroyPart" +
|
||||
"yGuid\030\001 \001(\t\032a\n\017InvitePartyNoti\022\026\n\016invite" +
|
||||
"UserGuid\030\001 \001(\t\022\035\n\025invitePartyLeaderGuid\030" +
|
||||
"\002 \001(\t\022\027\n\017invitePartyGuid\030\003 \001(\t\032~\n\024ReplyI" +
|
||||
"nvitePartyNoti\022\027\n\017invitePartyGuid\030\001 \001(\t\022" +
|
||||
"\026\n\016inviteUserGuid\030\002 \001(\t\022\032\n\022inviteUserNic" +
|
||||
"kname\030\003 \001(\t\022\031\n\006result\030\004 \001(\0162\t.BoolType\032L" +
|
||||
"\n\017CreatePartyNoti\022 \n\030joinPartyMemberAcco" +
|
||||
"untId\030\001 \001(\t\022\027\n\017createPartyGuid\030\002 \001(\t\032E\n\023" +
|
||||
"JoinPartyMemberNoti\022\021\n\tpartyGuid\030\001 \001(\t\022\033" +
|
||||
"\n\023joinPartyMemberInfo\030\002 \001(\t\032_\n\024LeavePart" +
|
||||
"yMemberNoti\022\021\n\tpartyGuid\030\001 \001(\t\022\032\n\022leaveP" +
|
||||
"artyUserGuid\030\002 \001(\t\022\030\n\005isBan\030\003 \001(\0162\t.Bool" +
|
||||
"Type\032a\n\031ChangePartyServerNameNoti\022\021\n\tpar" +
|
||||
"tyGuid\030\001 \001(\t\022\035\n\nisAddition\030\002 \001(\0162\t.BoolT" +
|
||||
"ype\022\022\n\nServerName\030\003 \001(\t\032H\n\031RemovePartySe" +
|
||||
"rverNameNoti\022\021\n\tpartyGuid\030\001 \001(\t\022\030\n\020remov" +
|
||||
"eServerName\030\002 \001(\t\032F\n\025ChangePartyLeaderNo" +
|
||||
"ti\022\021\n\tpartyGuid\030\001 \001(\t\022\032\n\022newPartyLeaderG" +
|
||||
"uid\030\002 \001(\t\032@\n\025ExchangePartyNameNoti\022\021\n\tpa" +
|
||||
"rtyGuid\030\001 \001(\t\022\024\n\014newPartyName\030\002 \001(\t\0324\n\031J" +
|
||||
"oiningPartyFlagResetNoti\022\027\n\017targetAccoun" +
|
||||
"tId\030\001 \001(\t\032X\n\033ExchangePartyMemberMarkNoti" +
|
||||
"\022\021\n\tpartyGuid\030\001 \001(\t\022\026\n\016memberUserGuid\030\002 " +
|
||||
"\001(\t\022\016\n\006markId\030\003 \001(\005\0328\n\014BanPartyNoti\022\021\n\tp" +
|
||||
"artyGuid\030\001 \001(\t\022\025\n\rbanMemberGuid\030\002 \001(\t\032{\n" +
|
||||
"\025SummonPartyMemberNoti\022\027\n\017summonPartyGui" +
|
||||
"d\030\001 \001(\t\022\026\n\016summonUserGuid\030\002 \001(\t\022\030\n\020summo" +
|
||||
"nServerName\030\003 \001(\t\022\027\n\tsummonPos\030\004 \001(\0132\004.P" +
|
||||
"os\032{\n\032ReplySummonPartyMemberNoti\022\027\n\017summ" +
|
||||
"onPartyGuid\030\001 \001(\t\022\026\n\016summonUserGuid\030\002 \001(" +
|
||||
"\t\022\030\n\020summonServerName\030\003 \001(\t\022\027\n\tsummonPos" +
|
||||
"\030\004 \001(\0132\004.Pos\032{\n\032ReplySummonPartyMemberNo" +
|
||||
"ti\022\027\n\017summonPartyGuid\030\001 \001(\t\022\026\n\016summonUse" +
|
||||
"rGuid\030\002 \001(\t\022,\n\006result\030\003 \001(\0162\034.SummonPart" +
|
||||
"yMemberResultType\032\020\n\016NoticeChatNoti\032\020\n\016S" +
|
||||
"ystemMailNoti\032h\n\rPartyVoteNoti\022\021\n\tpartyG" +
|
||||
"uid\030\001 \001(\t\022\021\n\tvoteTitle\030\002 \001(\t\0221\n\rvoteStar" +
|
||||
"tTime\030\003 \001(\0132\032.google.protobuf.Timestamp\032" +
|
||||
"X\n\022ReplyPartyVoteNoti\022\021\n\tpartyGuid\030\001 \001(\t" +
|
||||
"\022\026\n\016partyVoterGuid\030\002 \001(\t\022\027\n\004vote\030\003 \001(\0162\t" +
|
||||
".VoteType\032u\n\023PartyVoteResultNoti\022\021\n\tpart" +
|
||||
"yGuid\030\001 \001(\t\022\021\n\tvoteTitle\030\002 \001(\t\022\022\n\nresult" +
|
||||
"True\030\003 \001(\005\022\023\n\013resultFalse\030\004 \001(\005\022\017\n\007absta" +
|
||||
"in\030\005 \001(\005\032*\n\025PartyInstanceInfoNoti\022\021\n\tpar" +
|
||||
"tyGuid\030\001 \001(\t\032`\n\017SessionInfoNoti\022\022\n\ninsta" +
|
||||
"nceId\030\001 \001(\t\022\024\n\014sessionCount\030\002 \001(\005\022\022\n\nser" +
|
||||
"verType\030\003 \001(\005\022\017\n\007worldId\030\004 \001(\005\032O\n\033Cancel" +
|
||||
"SummonPartyMemberNoti\022\021\n\tpartyGuid\030\001 \001(\t" +
|
||||
"\022\035\n\025cancelSummonUserGuids\030\002 \003(\t\032E\n\027Party" +
|
||||
"MemberLocationNoti\022\021\n\tpartyGuid\030\001 \001(\t\022\027\n" +
|
||||
"\017partyMemberGuid\030\002 \001(\t\032I\n\034GS2GS_NTF_CLEA" +
|
||||
"R_PARTY_SUMMON\022\021\n\tpartyGuid\030\001 \001(\t\022\026\n\016mem" +
|
||||
"berUserGuid\030\002 \001(\t\032O\n\"GS2GS_NTF_DELETE_PA" +
|
||||
"RTY_INVITE_SEND\022\021\n\tpartyGuid\030\001 \001(\t\022\026\n\016in" +
|
||||
"viteUserGuid\030\002 \001(\t\032\263\001\n\024GS2GS_NTF_CRAFT_H" +
|
||||
"ELP\022\016\n\006roomId\030\001 \001(\t\022\023\n\013anchor_guid\030\002 \001(\t" +
|
||||
"\0223\n\017craftFinishTime\030\003 \001(\0132\032.google.proto" +
|
||||
"buf.Timestamp\022\021\n\townerGuid\030\004 \001(\t\022\030\n\020owne" +
|
||||
"rHelpedCount\030\005 \001(\005\022\024\n\014helpUserName\030\006 \001(\t" +
|
||||
"\032`\n\031GS2GS_NTF_EXCHANGE_MYHOME\022\016\n\006roomId\030" +
|
||||
"\001 \001(\t\022\022\n\nmyhomeGuid\030\002 \001(\t\022\037\n\nmyhomeInfo\030" +
|
||||
"\003 \001(\0132\013.MyHomeInfo\032 \n\036GS2GS_NTF_UGC_NPC_" +
|
||||
"RANK_REFRESH\032O\n%GS2GS_NTF_MYHOME_HOST_EN" +
|
||||
"TER_EDIT_ROOM\022\016\n\006roomId\030\001 \001(\t\022\026\n\016exceptU" +
|
||||
"serGuid\030\002 \001(\t\032l\n\024MOS2GS_NTF_USER_KICK\022\020\n" +
|
||||
"\010userGuid\030\001 \001(\t\022+\n\020logoutReasonType\030\002 \001(" +
|
||||
"\0162\021.LogoutReasonType\022\025\n\rkickReasonMsg\030\003 " +
|
||||
"\001(\t\032\316\001\n\024MOS2GS_NTF_MAIL_SEND\022\020\n\010userGuid" +
|
||||
"\030\001 \001(\t\022\020\n\010mailType\030\002 \001(\t\022\033\n\010itemList\030\003 \003" +
|
||||
"(\0132\t.MailItem\022&\n\005title\030\004 \003(\0132\027.Operation" +
|
||||
"SystemMessage\022$\n\003msg\030\005 \003(\0132\027.OperationSy" +
|
||||
"stemMessage\022\'\n\006sender\030\006 \003(\0132\027.OperationS" +
|
||||
"ystemMessage\032\203\001\n\026MOS2GS_NTF_NOTICE_CHAT\022" +
|
||||
"\022\n\nnoticeType\030\001 \003(\t\022,\n\013chatMessage\030\002 \003(\013" +
|
||||
"2\027.OperationSystemMessage\022\'\n\006sender\030\003 \003(" +
|
||||
"\0132\027.OperationSystemMessage\032q\n\026GS2MQS_NTF" +
|
||||
"_FARMING_END\022\020\n\010userGuid\030\001 \001(\t\022\'\n\016farmin" +
|
||||
"gSummary\030\005 \001(\0132\017.FarmingSummary\022\034\n\tisApp" +
|
||||
"lyDb\030\006 \001(\0162\t.BoolType\032v\n\036GS2MQS_NTF_BEAC" +
|
||||
"ON_COMPACT_SYNC\022\020\n\010userGuid\030\001 \001(\t\022%\n\rugc" +
|
||||
"NpcCompact\030\005 \001(\0132\016.UgcNpcCompact\022\033\n\023loca" +
|
||||
"tedInstanceGuid\030\006 \001(\t\032z\n\024GS2GS_NTF_RENT_" +
|
||||
"FLOOR\022\030\n\020exceptServerName\030\001 \001(\t\0223\n\024rentF" +
|
||||
"loorRequestInfo\030\002 \001(\0132\025.RentFloorRequest" +
|
||||
"Info\022\023\n\013ugcNpcGuids\030\003 \003(\t\032w\n#GS2GS_NTF_M" +
|
||||
"ODIFY_FLOOR_LINKED_INFOS\022\030\n\020exceptServer" +
|
||||
"Name\030\001 \001(\t\0226\n\026modifyFloorLinkedInfos\030\002 \003" +
|
||||
"(\0132\026.ModifyFloorLinkedInfoB\005\n\003msgB/\n+com" +
|
||||
".caliverse.admin.domain.RabbitMq.message" +
|
||||
"P\001b\006proto3"
|
||||
"\t\022,\n\006result\030\003 \001(\0162\034.SummonPartyMemberRes" +
|
||||
"ultType\032\020\n\016NoticeChatNoti\032\020\n\016SystemMailN" +
|
||||
"oti\032h\n\rPartyVoteNoti\022\021\n\tpartyGuid\030\001 \001(\t\022" +
|
||||
"\021\n\tvoteTitle\030\002 \001(\t\0221\n\rvoteStartTime\030\003 \001(" +
|
||||
"\0132\032.google.protobuf.Timestamp\032X\n\022ReplyPa" +
|
||||
"rtyVoteNoti\022\021\n\tpartyGuid\030\001 \001(\t\022\026\n\016partyV" +
|
||||
"oterGuid\030\002 \001(\t\022\027\n\004vote\030\003 \001(\0162\t.VoteType\032" +
|
||||
"u\n\023PartyVoteResultNoti\022\021\n\tpartyGuid\030\001 \001(" +
|
||||
"\t\022\021\n\tvoteTitle\030\002 \001(\t\022\022\n\nresultTrue\030\003 \001(\005" +
|
||||
"\022\023\n\013resultFalse\030\004 \001(\005\022\017\n\007abstain\030\005 \001(\005\032*" +
|
||||
"\n\025PartyInstanceInfoNoti\022\021\n\tpartyGuid\030\001 \001" +
|
||||
"(\t\032`\n\017SessionInfoNoti\022\022\n\ninstanceId\030\001 \001(" +
|
||||
"\t\022\024\n\014sessionCount\030\002 \001(\005\022\022\n\nserverType\030\003 " +
|
||||
"\001(\005\022\017\n\007worldId\030\004 \001(\005\032O\n\033CancelSummonPart" +
|
||||
"yMemberNoti\022\021\n\tpartyGuid\030\001 \001(\t\022\035\n\025cancel" +
|
||||
"SummonUserGuids\030\002 \003(\t\032E\n\027PartyMemberLoca" +
|
||||
"tionNoti\022\021\n\tpartyGuid\030\001 \001(\t\022\027\n\017partyMemb" +
|
||||
"erGuid\030\002 \001(\t\032I\n\034GS2GS_NTF_CLEAR_PARTY_SU" +
|
||||
"MMON\022\021\n\tpartyGuid\030\001 \001(\t\022\026\n\016memberUserGui" +
|
||||
"d\030\002 \001(\t\032O\n\"GS2GS_NTF_DELETE_PARTY_INVITE" +
|
||||
"_SEND\022\021\n\tpartyGuid\030\001 \001(\t\022\026\n\016inviteUserGu" +
|
||||
"id\030\002 \001(\t\032\263\001\n\024GS2GS_NTF_CRAFT_HELP\022\016\n\006roo" +
|
||||
"mId\030\001 \001(\t\022\023\n\013anchor_guid\030\002 \001(\t\0223\n\017craftF" +
|
||||
"inishTime\030\003 \001(\0132\032.google.protobuf.Timest" +
|
||||
"amp\022\021\n\townerGuid\030\004 \001(\t\022\030\n\020ownerHelpedCou" +
|
||||
"nt\030\005 \001(\005\022\024\n\014helpUserName\030\006 \001(\t\032`\n\031GS2GS_" +
|
||||
"NTF_EXCHANGE_MYHOME\022\016\n\006roomId\030\001 \001(\t\022\022\n\nm" +
|
||||
"yhomeGuid\030\002 \001(\t\022\037\n\nmyhomeInfo\030\003 \001(\0132\013.My" +
|
||||
"HomeInfo\032 \n\036GS2GS_NTF_UGC_NPC_RANK_REFRE" +
|
||||
"SH\032O\n%GS2GS_NTF_MYHOME_HOST_ENTER_EDIT_R" +
|
||||
"OOM\022\016\n\006roomId\030\001 \001(\t\022\026\n\016exceptUserGuid\030\002 " +
|
||||
"\001(\t\032l\n\024MOS2GS_NTF_USER_KICK\022\020\n\010userGuid\030" +
|
||||
"\001 \001(\t\022+\n\020logoutReasonType\030\002 \001(\0162\021.Logout" +
|
||||
"ReasonType\022\025\n\rkickReasonMsg\030\003 \001(\t\032\316\001\n\024MO" +
|
||||
"S2GS_NTF_MAIL_SEND\022\020\n\010userGuid\030\001 \001(\t\022\020\n\010" +
|
||||
"mailType\030\002 \001(\t\022\033\n\010itemList\030\003 \003(\0132\t.MailI" +
|
||||
"tem\022&\n\005title\030\004 \003(\0132\027.OperationSystemMess" +
|
||||
"age\022$\n\003msg\030\005 \003(\0132\027.OperationSystemMessag" +
|
||||
"e\022\'\n\006sender\030\006 \003(\0132\027.OperationSystemMessa" +
|
||||
"ge\032\203\001\n\026MOS2GS_NTF_NOTICE_CHAT\022\022\n\nnoticeT" +
|
||||
"ype\030\001 \003(\t\022,\n\013chatMessage\030\002 \003(\0132\027.Operati" +
|
||||
"onSystemMessage\022\'\n\006sender\030\003 \003(\0132\027.Operat" +
|
||||
"ionSystemMessage\032q\n\026GS2MQS_NTF_FARMING_E" +
|
||||
"ND\022\020\n\010userGuid\030\001 \001(\t\022\'\n\016farmingSummary\030\005" +
|
||||
" \001(\0132\017.FarmingSummary\022\034\n\tisApplyDb\030\006 \001(\016" +
|
||||
"2\t.BoolType\032v\n\036GS2MQS_NTF_BEACON_COMPACT" +
|
||||
"_SYNC\022\020\n\010userGuid\030\001 \001(\t\022%\n\rugcNpcCompact" +
|
||||
"\030\005 \001(\0132\016.UgcNpcCompact\022\033\n\023locatedInstanc" +
|
||||
"eGuid\030\006 \001(\t\032z\n\024GS2GS_NTF_RENT_FLOOR\022\030\n\020e" +
|
||||
"xceptServerName\030\001 \001(\t\0223\n\024rentFloorReques" +
|
||||
"tInfo\030\002 \001(\0132\025.RentFloorRequestInfo\022\023\n\013ug" +
|
||||
"cNpcGuids\030\003 \003(\t\032w\n#GS2GS_NTF_MODIFY_FLOO" +
|
||||
"R_LINKED_INFOS\022\030\n\020exceptServerName\030\001 \001(\t" +
|
||||
"\0226\n\026modifyFloorLinkedInfos\030\002 \003(\0132\026.Modif" +
|
||||
"yFloorLinkedInfo\032g\n\'OS2GS_REQ_CREATE_CAL" +
|
||||
"IUM_CONTENT_STORAGE\022\031\n\021requestServerName" +
|
||||
"\030\001 \001(\t\022\021\n\tcontentId\030\002 \001(\t\022\016\n\006calium\030\003 \001(" +
|
||||
"\001\032B\n\'OS2GS_ACK_CREATE_CALIUM_CONTENT_STO" +
|
||||
"RAGE\022\027\n\006result\030\001 \001(\0132\007.Result\032&\n$GS2GS_N" +
|
||||
"TF_CHANGE_CALIUM_STORAGE_INFO\032T\n\032GS2GS_N" +
|
||||
"TF_MODIFY_LAND_INFO\022\030\n\020exceptServerName\030" +
|
||||
"\001 \001(\t\022\034\n\tlandInfos\030\002 \003(\0132\t.LandInfo\032`\n\036G" +
|
||||
"S2GS_NTF_MODIFY_BUILDING_INFO\022\030\n\020exceptS" +
|
||||
"erverName\030\001 \001(\t\022$\n\rbuildingInfos\030\002 \003(\0132\r" +
|
||||
".BuildingInfo\032\364\001\n GS2GS_NTF_MODIFY_BUILD" +
|
||||
"ING_PROFIT\022\030\n\020exceptServerName\030\001 \001(\t\022\026\n\016" +
|
||||
"buildingMetaId\030\002 \001(\005\022W\n\014floorProfits\030\003 \003" +
|
||||
"(\0132A.ServerMessage.GS2GS_NTF_MODIFY_BUIL" +
|
||||
"DING_PROFIT.FloorProfitsEntry\032E\n\021FloorPr" +
|
||||
"ofitsEntry\022\013\n\003key\030\001 \001(\005\022\037\n\005value\030\002 \001(\0132\020" +
|
||||
".FloorProfitInfo:\0028\001\032\200\002\n,GS2GS_NTF_LAND_" +
|
||||
"AUCTION_HIGHEST_BIDDER_CHANGE\022\030\n\020receive" +
|
||||
"rUserGuid\030\001 \001(\t\022(\n\025hasReceivedRefundMail" +
|
||||
"\030\002 \001(\0162\t.BoolType\022\022\n\nlandMetaId\030\003 \001(\005\022#\n" +
|
||||
"\014currencyType\030\005 \001(\0162\r.CurrencyType\022\027\n\017hi" +
|
||||
"ghestBidPrice\030\006 \001(\001\022\032\n\022highestBidUserGui" +
|
||||
"d\030\007 \001(\t\022\036\n\026highestBidUserNickname\030\010 \001(\t\032" +
|
||||
"\251\001\n\"GS2GS_NTF_LAND_AUCTION_WINNING_BID\022\027" +
|
||||
"\n\017winningUserGuid\030\001 \001(\t\022\033\n\023winningUserNi" +
|
||||
"ckname\030\002 \001(\t\022\022\n\nlandMetaId\030\005 \001(\005\022\027\n\017buil" +
|
||||
"dingMetaIds\030\006 \003(\005\022 \n\risNewRecvMail\030\007 \001(\016" +
|
||||
"2\t.BoolType\032>\n\"GS2GS_NTF_LAND_AUCTION_RE" +
|
||||
"SERVATION\022\030\n\020toAddActivitings\030\001 \003(\005B\005\n\003m" +
|
||||
"sgB/\n+com.caliverse.admin.domain.RabbitM" +
|
||||
"q.messageP\001b\006proto3"
|
||||
};
|
||||
descriptor = com.google.protobuf.Descriptors.FileDescriptor
|
||||
.internalBuildGeneratedFileFrom(descriptorData,
|
||||
@@ -763,7 +861,7 @@ public final class ServerMessageOuterClass {
|
||||
internal_static_ServerMessage_fieldAccessorTable = new
|
||||
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
|
||||
internal_static_ServerMessage_descriptor,
|
||||
new java.lang.String[] { "MessageTime", "MessageSender", "Chat", "KickReq", "KickRes", "WhiteListUpdateNoti", "BlackListUpdateNoti", "InspectionReq", "ChangeServerConfigReq", "AllKickNormalUserNoti", "AwsAutoScaleGroupOptionReq", "AwsAutoScaleGroupOptionRes", "ReceiveMailNoti", "ExchangeMannequinDisplayItemNoti", "GetAwsAutoScaleOptionReq", "GetAwsAutoScaleOptionRes", "ReadyForDistroyReq", "LoginNotiToFriend", "LogoutNotiToFriend", "ManagerServerActiveReq", "ManagerServerActiveRes", "ReceiveInviteMyHomeNoti", "ReplyInviteMyhomeNoti", "StateNotiToFriend", "FriendRequestNoti", "FriendAcceptNoti", "FriendDeleteNoti", "CancelFriendRequestNoti", "InvitePartyNoti", "ReplyInvitePartyNoti", "JoinPartyMemberNoti", "LeavePartyMemberNoti", "ChangePartyServerNameNoti", "ChangePartyLeaderNoti", "ExchangePartyNameNoti", "ExchangePartyMemberMarkNoti", "BanPartyNoti", "SummonPartyMemberNoti", "ReplySummonPartyMemberNoti", "NoticeChatNoti", "SystemMailNoti", "PartyVoteNoti", "ReplyPartyVoteNoti", "PartyVoteResultNoti", "PartyInstanceInfoNoti", "SessionInfoNoti", "KickedFromFriendsMyHomeNoti", "CancelSummonPartyMemberNoti", "PartyMemberLocationNoti", "NtfFriendLeavingHome", "NtfInvitePartyRecvResult", "NtfDestroyParty", "ReqReservationEnterToServer", "AckReservationEnterToServer", "NtfPartyChat", "NtfPartyInfo", "NtfReturnUserLogout", "NtfClearPartySummon", "NtfCraftHelp", "ReqReservationCancelToServer", "NtfExchangeMyhome", "NtfUgcNpcRankRefresh", "NtfDeletePartyInviteSend", "NtfMyhomeHostEnterEditRoom", "NtfUserKick", "NtfMailSend", "NtfOperationSystemNoticeChat", "AckReservationCancelToServer", "NtfFarmingEnd", "NtfRentFloor", "NtfModifyFloorLinkedInfos", "NtfBeaconCompactSync", "Msg", });
|
||||
new java.lang.String[] { "MessageTime", "MessageSender", "Chat", "KickReq", "KickRes", "WhiteListUpdateNoti", "BlackListUpdateNoti", "InspectionReq", "ChangeServerConfigReq", "AllKickNormalUserNoti", "AwsAutoScaleGroupOptionReq", "AwsAutoScaleGroupOptionRes", "ReceiveMailNoti", "ExchangeMannequinDisplayItemNoti", "GetAwsAutoScaleOptionReq", "GetAwsAutoScaleOptionRes", "ReadyForDistroyReq", "LoginNotiToFriend", "LogoutNotiToFriend", "ManagerServerActiveReq", "ManagerServerActiveRes", "ReceiveInviteMyHomeNoti", "ReplyInviteMyhomeNoti", "StateNotiToFriend", "FriendRequestNoti", "FriendAcceptNoti", "FriendDeleteNoti", "CancelFriendRequestNoti", "InvitePartyNoti", "ReplyInvitePartyNoti", "JoinPartyMemberNoti", "LeavePartyMemberNoti", "ChangePartyServerNameNoti", "ChangePartyLeaderNoti", "ExchangePartyNameNoti", "ExchangePartyMemberMarkNoti", "BanPartyNoti", "SummonPartyMemberNoti", "ReplySummonPartyMemberNoti", "NoticeChatNoti", "SystemMailNoti", "PartyVoteNoti", "ReplyPartyVoteNoti", "PartyVoteResultNoti", "PartyInstanceInfoNoti", "SessionInfoNoti", "KickedFromFriendsMyHomeNoti", "CancelSummonPartyMemberNoti", "PartyMemberLocationNoti", "NtfFriendLeavingHome", "NtfInvitePartyRecvResult", "NtfDestroyParty", "ReqReservationEnterToServer", "AckReservationEnterToServer", "NtfPartyChat", "NtfPartyInfo", "NtfReturnUserLogout", "NtfClearPartySummon", "NtfCraftHelp", "ReqReservationCancelToServer", "NtfExchangeMyhome", "NtfUgcNpcRankRefresh", "NtfDeletePartyInviteSend", "NtfMyhomeHostEnterEditRoom", "NtfUserKick", "NtfMailSend", "NtfOperationSystemNoticeChat", "AckReservationCancelToServer", "NtfFarmingEnd", "NtfRentFloor", "NtfModifyFloorLinkedInfos", "NtfBeaconCompactSync", "ReqCreateContentStorage", "AckCreateContentStorage", "NtfChangeCaliumStorageInfo", "NtfModifyLandInfo", "NtfModifyBuildingInfo", "NtfModifyBuildingProfit", "NtfLandAuctionHighestBidderChange", "NtfLandAuctionWinningBid", "NtfLandAuctionReservation", "Msg", });
|
||||
internal_static_ServerMessage_Chat_descriptor =
|
||||
internal_static_ServerMessage_descriptor.getNestedTypes().get(0);
|
||||
internal_static_ServerMessage_Chat_fieldAccessorTable = new
|
||||
@@ -1250,6 +1348,66 @@ public final class ServerMessageOuterClass {
|
||||
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
|
||||
internal_static_ServerMessage_GS2GS_NTF_MODIFY_FLOOR_LINKED_INFOS_descriptor,
|
||||
new java.lang.String[] { "ExceptServerName", "ModifyFloorLinkedInfos", });
|
||||
internal_static_ServerMessage_OS2GS_REQ_CREATE_CALIUM_CONTENT_STORAGE_descriptor =
|
||||
internal_static_ServerMessage_descriptor.getNestedTypes().get(81);
|
||||
internal_static_ServerMessage_OS2GS_REQ_CREATE_CALIUM_CONTENT_STORAGE_fieldAccessorTable = new
|
||||
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
|
||||
internal_static_ServerMessage_OS2GS_REQ_CREATE_CALIUM_CONTENT_STORAGE_descriptor,
|
||||
new java.lang.String[] { "RequestServerName", "ContentId", "Calium", });
|
||||
internal_static_ServerMessage_OS2GS_ACK_CREATE_CALIUM_CONTENT_STORAGE_descriptor =
|
||||
internal_static_ServerMessage_descriptor.getNestedTypes().get(82);
|
||||
internal_static_ServerMessage_OS2GS_ACK_CREATE_CALIUM_CONTENT_STORAGE_fieldAccessorTable = new
|
||||
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
|
||||
internal_static_ServerMessage_OS2GS_ACK_CREATE_CALIUM_CONTENT_STORAGE_descriptor,
|
||||
new java.lang.String[] { "Result", });
|
||||
internal_static_ServerMessage_GS2GS_NTF_CHANGE_CALIUM_STORAGE_INFO_descriptor =
|
||||
internal_static_ServerMessage_descriptor.getNestedTypes().get(83);
|
||||
internal_static_ServerMessage_GS2GS_NTF_CHANGE_CALIUM_STORAGE_INFO_fieldAccessorTable = new
|
||||
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
|
||||
internal_static_ServerMessage_GS2GS_NTF_CHANGE_CALIUM_STORAGE_INFO_descriptor,
|
||||
new java.lang.String[] { });
|
||||
internal_static_ServerMessage_GS2GS_NTF_MODIFY_LAND_INFO_descriptor =
|
||||
internal_static_ServerMessage_descriptor.getNestedTypes().get(84);
|
||||
internal_static_ServerMessage_GS2GS_NTF_MODIFY_LAND_INFO_fieldAccessorTable = new
|
||||
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
|
||||
internal_static_ServerMessage_GS2GS_NTF_MODIFY_LAND_INFO_descriptor,
|
||||
new java.lang.String[] { "ExceptServerName", "LandInfos", });
|
||||
internal_static_ServerMessage_GS2GS_NTF_MODIFY_BUILDING_INFO_descriptor =
|
||||
internal_static_ServerMessage_descriptor.getNestedTypes().get(85);
|
||||
internal_static_ServerMessage_GS2GS_NTF_MODIFY_BUILDING_INFO_fieldAccessorTable = new
|
||||
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
|
||||
internal_static_ServerMessage_GS2GS_NTF_MODIFY_BUILDING_INFO_descriptor,
|
||||
new java.lang.String[] { "ExceptServerName", "BuildingInfos", });
|
||||
internal_static_ServerMessage_GS2GS_NTF_MODIFY_BUILDING_PROFIT_descriptor =
|
||||
internal_static_ServerMessage_descriptor.getNestedTypes().get(86);
|
||||
internal_static_ServerMessage_GS2GS_NTF_MODIFY_BUILDING_PROFIT_fieldAccessorTable = new
|
||||
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
|
||||
internal_static_ServerMessage_GS2GS_NTF_MODIFY_BUILDING_PROFIT_descriptor,
|
||||
new java.lang.String[] { "ExceptServerName", "BuildingMetaId", "FloorProfits", });
|
||||
internal_static_ServerMessage_GS2GS_NTF_MODIFY_BUILDING_PROFIT_FloorProfitsEntry_descriptor =
|
||||
internal_static_ServerMessage_GS2GS_NTF_MODIFY_BUILDING_PROFIT_descriptor.getNestedTypes().get(0);
|
||||
internal_static_ServerMessage_GS2GS_NTF_MODIFY_BUILDING_PROFIT_FloorProfitsEntry_fieldAccessorTable = new
|
||||
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
|
||||
internal_static_ServerMessage_GS2GS_NTF_MODIFY_BUILDING_PROFIT_FloorProfitsEntry_descriptor,
|
||||
new java.lang.String[] { "Key", "Value", });
|
||||
internal_static_ServerMessage_GS2GS_NTF_LAND_AUCTION_HIGHEST_BIDDER_CHANGE_descriptor =
|
||||
internal_static_ServerMessage_descriptor.getNestedTypes().get(87);
|
||||
internal_static_ServerMessage_GS2GS_NTF_LAND_AUCTION_HIGHEST_BIDDER_CHANGE_fieldAccessorTable = new
|
||||
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
|
||||
internal_static_ServerMessage_GS2GS_NTF_LAND_AUCTION_HIGHEST_BIDDER_CHANGE_descriptor,
|
||||
new java.lang.String[] { "ReceiverUserGuid", "HasReceivedRefundMail", "LandMetaId", "CurrencyType", "HighestBidPrice", "HighestBidUserGuid", "HighestBidUserNickname", });
|
||||
internal_static_ServerMessage_GS2GS_NTF_LAND_AUCTION_WINNING_BID_descriptor =
|
||||
internal_static_ServerMessage_descriptor.getNestedTypes().get(88);
|
||||
internal_static_ServerMessage_GS2GS_NTF_LAND_AUCTION_WINNING_BID_fieldAccessorTable = new
|
||||
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
|
||||
internal_static_ServerMessage_GS2GS_NTF_LAND_AUCTION_WINNING_BID_descriptor,
|
||||
new java.lang.String[] { "WinningUserGuid", "WinningUserNickname", "LandMetaId", "BuildingMetaIds", "IsNewRecvMail", });
|
||||
internal_static_ServerMessage_GS2GS_NTF_LAND_AUCTION_RESERVATION_descriptor =
|
||||
internal_static_ServerMessage_descriptor.getNestedTypes().get(89);
|
||||
internal_static_ServerMessage_GS2GS_NTF_LAND_AUCTION_RESERVATION_fieldAccessorTable = new
|
||||
com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
|
||||
internal_static_ServerMessage_GS2GS_NTF_LAND_AUCTION_RESERVATION_descriptor,
|
||||
new java.lang.String[] { "ToAddActivitings", });
|
||||
com.google.protobuf.TimestampProto.getDescriptor();
|
||||
com.caliverse.admin.domain.RabbitMq.message.DefineCommon.getDescriptor();
|
||||
com.caliverse.admin.domain.RabbitMq.message.DefineResult.getDescriptor();
|
||||
|
||||
@@ -72,4 +72,9 @@ public class AdminController {
|
||||
return ResponseEntity.ok().body(adminService.deleteAdmin(adminRequest));
|
||||
}
|
||||
|
||||
//데이터 초기화
|
||||
@PostMapping("/init-data")
|
||||
public ResponseEntity<AdminResponse> initData(@RequestBody AuthenticateRequest authenticateRequest){
|
||||
return ResponseEntity.ok().body(adminService.initPassword(authenticateRequest));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
package com.caliverse.admin.domain.api;
|
||||
|
||||
import com.caliverse.admin.domain.request.AuthenticateRequest;
|
||||
import com.caliverse.admin.domain.request.LogGenericRequest;
|
||||
import com.caliverse.admin.domain.response.DataResponse;
|
||||
import com.caliverse.admin.domain.response.LogResponse;
|
||||
import com.caliverse.admin.domain.service.DataService;
|
||||
import com.caliverse.admin.global.common.code.CommonCode;
|
||||
import com.caliverse.admin.global.common.code.ErrorCode;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
@Tag(name = "데이터 관련", description = "데이터 관련 api 입니다.")
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/api/v1/data")
|
||||
|
||||
public class DataController {
|
||||
|
||||
private final DataService dataService;
|
||||
|
||||
@Value("${spring.profiles.active}")
|
||||
private String activeProfile;
|
||||
|
||||
@PostMapping("/init-list")
|
||||
public ResponseEntity<DataResponse> initHistoryList(
|
||||
@RequestBody LogGenericRequest logGenericRequest){
|
||||
if(activeProfile.equals("live")){
|
||||
return ResponseEntity.status(HttpStatus.NOT_FOUND).body(DataResponse.builder()
|
||||
.status(CommonCode.ERROR.getHttpStatus())
|
||||
.result(ErrorCode.NOT_FOUNT_API.toString())
|
||||
.build());
|
||||
}
|
||||
|
||||
return ResponseEntity.ok().body( dataService.initHistoryList(logGenericRequest));
|
||||
}
|
||||
|
||||
//데이터 초기화
|
||||
@PostMapping("/init-data")
|
||||
public ResponseEntity<DataResponse> initData(@RequestBody AuthenticateRequest authenticateRequest){
|
||||
if(activeProfile.equals("live")){
|
||||
return ResponseEntity.status(HttpStatus.NOT_FOUND).body(DataResponse.builder()
|
||||
.status(CommonCode.ERROR.getHttpStatus())
|
||||
.result(ErrorCode.NOT_FOUNT_API.toString())
|
||||
.build());
|
||||
}
|
||||
return ResponseEntity.ok().body(dataService.initData(authenticateRequest));
|
||||
}
|
||||
}
|
||||
@@ -20,6 +20,12 @@ import java.util.Map;
|
||||
@RequestMapping("/api/v1/land")
|
||||
public class LandController {
|
||||
private final LandService landService;
|
||||
|
||||
@GetMapping("/info")
|
||||
public ResponseEntity<LandResponse> getLandInfoList(
|
||||
@RequestParam Map<String, String> requestParam){
|
||||
return ResponseEntity.ok().body( landService.getLandInfo(requestParam));
|
||||
}
|
||||
@GetMapping("/auction/list")
|
||||
public ResponseEntity<LandResponse> getLandAuctionList(
|
||||
@RequestParam Map<String, String> requestParam){
|
||||
@@ -49,16 +55,34 @@ public class LandController {
|
||||
|
||||
return ResponseEntity.ok().body(landService.postLandAuction(landRequest));
|
||||
}
|
||||
@PostMapping("/change")
|
||||
public ResponseEntity<LandResponse> postLandOwnerChanges(
|
||||
@RequestBody LandRequest landRequest){
|
||||
|
||||
return ResponseEntity.ok().body(landService.postLandOwnerChanges(landRequest));
|
||||
}
|
||||
@PutMapping("/auction/{id}")
|
||||
public ResponseEntity<LandResponse> updateLandAuction(
|
||||
@PathVariable("id")Long id, @RequestBody LandRequest landRequest){
|
||||
|
||||
return ResponseEntity.ok().body(landService.updateLandAuction(id, landRequest));
|
||||
}
|
||||
@PutMapping("/change/{id}")
|
||||
public ResponseEntity<LandResponse> updateLandOwnerChanges(
|
||||
@PathVariable("id")Long id, @RequestBody LandRequest landRequest){
|
||||
|
||||
return ResponseEntity.ok().body(landService.updateLandOwnerChanges(id, landRequest));
|
||||
}
|
||||
@DeleteMapping("/auction/delete")
|
||||
public ResponseEntity<LandResponse> deleteLandAuction(
|
||||
@RequestBody LandRequest landRequest){
|
||||
|
||||
return ResponseEntity.ok().body(landService.deleteLandAuction(landRequest));
|
||||
}
|
||||
@DeleteMapping("/change/delete")
|
||||
public ResponseEntity<LandResponse> deleteLandOwnerChanges(
|
||||
@RequestBody LandRequest landRequest){
|
||||
|
||||
return ResponseEntity.ok().body(landService.deleteLandOwnerChanges(landRequest));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.caliverse.admin.domain.api;
|
||||
|
||||
import com.caliverse.admin.domain.request.LogGenericRequest;
|
||||
import com.caliverse.admin.domain.response.LogResponse;
|
||||
import com.caliverse.admin.domain.service.LogService;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@Tag(name = "로그", description = "로그 api")
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/api/v1/log")
|
||||
public class LogController {
|
||||
private final LogService logService;
|
||||
|
||||
@PostMapping("/generic/list")
|
||||
public ResponseEntity<LogResponse> genericlist(
|
||||
@RequestBody LogGenericRequest logGenericRequest){
|
||||
return ResponseEntity.ok().body( logService.genericLogList(logGenericRequest));
|
||||
}
|
||||
}
|
||||
@@ -30,6 +30,11 @@ public class UsersController {
|
||||
@RequestBody UsersRequest requestBody){
|
||||
return ResponseEntity.ok().body( usersService.changeAdminLevel(requestBody));
|
||||
}
|
||||
@PutMapping("/user-kick")
|
||||
public ResponseEntity<UsersResponse> userKick(
|
||||
@RequestBody UsersRequest requestBody){
|
||||
return ResponseEntity.ok().body( usersService.userKick(requestBody));
|
||||
}
|
||||
@GetMapping("/find-users")
|
||||
public ResponseEntity<UsersResponse> findUsers(
|
||||
@RequestParam Map<String, String> requestParams){
|
||||
@@ -66,11 +71,11 @@ public class UsersController {
|
||||
|
||||
return ResponseEntity.ok().body(usersService.deleteInventoryItem(requestParams));
|
||||
}
|
||||
//todo
|
||||
@GetMapping("/mail")
|
||||
|
||||
@PostMapping("/mail")
|
||||
public ResponseEntity<UsersResponse> getMail(
|
||||
@RequestParam("guid") String guid, @RequestParam("type") String type){
|
||||
return ResponseEntity.ok().body( usersService.getMail(guid,type));
|
||||
@RequestBody UsersRequest requestBody){
|
||||
return ResponseEntity.ok().body( usersService.getMail(requestBody));
|
||||
}
|
||||
@DeleteMapping("/mail/delete")
|
||||
public ResponseEntity<UsersResponse> deleteMail(
|
||||
@@ -89,25 +94,25 @@ public class UsersController {
|
||||
@RequestParam("guid") String guid){
|
||||
return ResponseEntity.ok().body( usersService.getMyhome(guid));
|
||||
}
|
||||
//todo
|
||||
|
||||
@GetMapping("/friendlist")
|
||||
public ResponseEntity<UsersResponse> getFriendList(
|
||||
@RequestParam("guid") String guid){
|
||||
return ResponseEntity.ok().body( usersService.getFriendList(guid));
|
||||
}
|
||||
//todo
|
||||
|
||||
@GetMapping("/tattoo")
|
||||
public ResponseEntity<UsersResponse> getTattoo(
|
||||
@RequestParam("guid") String guid){
|
||||
return ResponseEntity.ok().body( usersService.getTattoo(guid));
|
||||
}
|
||||
//todo
|
||||
|
||||
@GetMapping("/quest")
|
||||
public ResponseEntity<UsersResponse> getQuest(
|
||||
@RequestParam("guid") String guid){
|
||||
return ResponseEntity.ok().body( usersService.getQuest(guid));
|
||||
}
|
||||
//todo
|
||||
|
||||
/*@GetMapping("/claim")
|
||||
public ResponseEntity<UsersResponse> getClaim(
|
||||
@RequestParam("guid") String guid){
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.caliverse.admin.domain.dao.admin;
|
||||
|
||||
import com.caliverse.admin.domain.entity.*;
|
||||
import com.caliverse.admin.domain.request.LandRequest;
|
||||
import org.apache.ibatis.annotations.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
public interface DataMapper {
|
||||
@Select("SELECT * FROM data_initialize_schedule WHERE status = 'WAIT'")
|
||||
@Results({
|
||||
@Result(property = "id", column = "id"),
|
||||
@Result(property = "dataType", column = "data_type"),
|
||||
@Result(property = "status", column = "status"),
|
||||
@Result(property = "deleted", column = "deleted"),
|
||||
@Result(property = "createBy", column = "create_by"),
|
||||
@Result(property = "createDt", column = "create_dt"),
|
||||
})
|
||||
List<DataInit> getDataInit();
|
||||
|
||||
@Update("UPDATE data_initialize_schedule SET status = #{status} WHERE id = #{id}")
|
||||
int updateStatus(@Param("id") long id, @Param("status") String status);
|
||||
|
||||
@Insert("INSERT INTO data_initialize_schedule (data_type, create_by) VALUES (#{dataType}, #{createBy})")
|
||||
int postDataInit(@Param("dataType") EInitDataType dataType, @Param("createBy") long createBy);
|
||||
}
|
||||
@@ -2,8 +2,10 @@ package com.caliverse.admin.domain.dao.admin;
|
||||
|
||||
import com.caliverse.admin.domain.entity.Event;
|
||||
import com.caliverse.admin.domain.entity.LandAuction;
|
||||
import com.caliverse.admin.domain.entity.LandOwnerChange;
|
||||
import com.caliverse.admin.domain.entity.Message;
|
||||
import com.caliverse.admin.domain.request.LandRequest;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -11,26 +13,40 @@ import java.util.Map;
|
||||
|
||||
public interface LandMapper {
|
||||
|
||||
List<LandAuction> getAllLandAuction();
|
||||
List<LandOwnerChange> getAllLandOwnedChanges();
|
||||
|
||||
List<LandAuction> getLandAuctionList(Map map);
|
||||
|
||||
int getAllCnt(Map map);
|
||||
int getTotal();
|
||||
LandAuction getLandAuctionDetail(Long id);
|
||||
LandOwnerChange getLandOwnerChangeDetail(Long id);
|
||||
List<LandOwnerChange> getLandOwnerChangeInfo(int landId);
|
||||
|
||||
List<Message> getMessage(Long id);
|
||||
|
||||
int getMaxLandSeq(Integer landId);
|
||||
int getPossibleLand(Integer landId);
|
||||
int getPossibleLandOwnerChanges(Integer landId);
|
||||
|
||||
int postLandAuction(LandRequest landRequest);
|
||||
int postLandOwnerChange(LandRequest landRequest);
|
||||
|
||||
void insertMessage(Map map);
|
||||
int updateLandAuction(LandRequest landRequest);
|
||||
int updateLandOwnerChange(LandRequest landRequest);
|
||||
|
||||
int deleteMessage(Map map);
|
||||
int initLandAuction(Long id);
|
||||
int initLandOwnedChanges(Long id);
|
||||
|
||||
int deleteLandAuction(Map map);
|
||||
int deleteLandOwnerChanges(Map map);
|
||||
|
||||
int updateStatusLandAuction(Map map);
|
||||
int updateStatusLandOwnedChange(Map map);
|
||||
|
||||
List<LandAuction> getScheduleLandAuctionList();
|
||||
List<LandOwnerChange> getScheduleLandOwnedChangeList();
|
||||
}
|
||||
|
||||
@@ -29,6 +29,7 @@ public class MetaDataFileLoader {
|
||||
private final Map<Integer, MetaLandData> lands;
|
||||
private final Map<Integer, MetaBattleConfigData> battleConfigs;
|
||||
private final Map<Integer, MetaBattleRewardData> battleRewards;
|
||||
private final Map<String, MetaSystemMailData> systemMails;
|
||||
|
||||
public MetaDataFileLoader(JsonFileReader jsonFileReader) {
|
||||
this.jsonFileReader = jsonFileReader;
|
||||
@@ -42,6 +43,7 @@ public class MetaDataFileLoader {
|
||||
this.lands = new ConcurrentHashMap<>();
|
||||
this.battleConfigs = new ConcurrentHashMap<>();
|
||||
this.battleRewards = new ConcurrentHashMap<>();
|
||||
this.systemMails = new ConcurrentHashMap<>();
|
||||
}
|
||||
|
||||
@PostConstruct
|
||||
@@ -72,6 +74,7 @@ public class MetaDataFileLoader {
|
||||
loadClothType();
|
||||
loadBattleConfig();
|
||||
loadBattleReward();
|
||||
loadSystemMail();
|
||||
}catch(MetaDataException e){
|
||||
log.error("Failed to initialize metadata", e);
|
||||
throw e;
|
||||
@@ -152,6 +155,9 @@ public class MetaDataFileLoader {
|
||||
.sorted(Comparator.comparing(MetaBattleRewardData::getGroupID)) // groupId 기준으로 정렬
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
public List<MetaSystemMailData> getMetaSystemMail() {
|
||||
return new ArrayList<>(systemMails.values());
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -320,11 +326,18 @@ public class MetaDataFileLoader {
|
||||
item.setLandId((Integer)meta.get("LandId"));
|
||||
item.setOwner((String)meta.get("Owner"));
|
||||
item.setEditor((String)meta.get("Editor"));
|
||||
// item.setNonAuction((Boolean)meta.get("NonAuction"));
|
||||
Boolean nonAuction = (Boolean)meta.get("NonAuction");
|
||||
if(nonAuction != null)
|
||||
item.setNonAuction(nonAuction);
|
||||
item.setRentalStateSwitch((Boolean)meta.get("RentalStateSwitch"));
|
||||
item.setRentalAvailable((Boolean)meta.get("RentalAvailable"));
|
||||
item.setLandName(land_name);
|
||||
item.setLandDesc((String)meta.get("LandDesc"));
|
||||
item.setLandSize((String)meta.get("LandSize"));
|
||||
item.setLandType((String)meta.get("LandType"));
|
||||
item.setLinkedItem((Integer)meta.get("LinkedItem"));
|
||||
item.setCityType((String)meta.get("CityType"));
|
||||
item.setBuildingArea((String)meta.get("BuildingArea"));
|
||||
item.setBuildingId((Integer)meta.get("BuildingId"));
|
||||
item.setBuildingSocket((Integer)meta.get("BuildingSocket"));
|
||||
lands.put((Integer)meta.get("LandId"), item);
|
||||
@@ -379,4 +392,24 @@ public class MetaDataFileLoader {
|
||||
|
||||
log.info("loadBattleReward {} Load Complete", EMetaData.BATTLE_REWARD_DATA.getFileName());
|
||||
}
|
||||
|
||||
// 시스템메일 데이터 로드
|
||||
public void loadSystemMail(){
|
||||
List<Map<String, Object>> metaList = jsonFileReader.readJsonFile(EMetaData.SYSTEM_MAIL_DATA.getFileName(), MetadataConstants.JSON_LIST_SYSTEM_META);
|
||||
if(metaList == null || metaList.isEmpty()) {
|
||||
log.warn("System Mail data is empty or file not found: {}", EMetaData.SYSTEM_MAIL_DATA.getFileName());
|
||||
return;
|
||||
}
|
||||
|
||||
metaList.forEach(meta -> {
|
||||
MetaSystemMailData item = new MetaSystemMailData();
|
||||
item.setKey((String)meta.get("Key"));
|
||||
item.setMailTitle((String)meta.get("Mail_Title"));
|
||||
item.setMailDesc((String)meta.get("Mail_Desc"));
|
||||
item.setSender((String)meta.get("Sender"));
|
||||
systemMails.put((String)meta.get("Key"), item);
|
||||
});
|
||||
|
||||
log.info("loadSystemMail {} Load Complete", EMetaData.SYSTEM_MAIL_DATA.getFileName());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,5 +78,9 @@ public class MetaDataHandler {
|
||||
public List<MetaBattleRewardData> getMetaBattleRewardsListData() {
|
||||
return metadataFileLoader.getMetaBattleRewards();
|
||||
}
|
||||
|
||||
public List<MetaSystemMailData> getMetaSystemMailListData() {
|
||||
return metadataFileLoader.getMetaSystemMail();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
package com.caliverse.admin.domain.datacomponent;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@EqualsAndHashCode
|
||||
public class MetaQuestKey {
|
||||
private Integer qeustId;
|
||||
private Integer taskNum;
|
||||
}
|
||||
@@ -38,6 +38,9 @@ public class Admin implements UserDetails{
|
||||
@JsonProperty("expired_dt")
|
||||
private LocalDateTime expiredDt;
|
||||
|
||||
@JsonProperty("auth_level_type")
|
||||
private EAuthAdminLevelType authLevelType;
|
||||
|
||||
/* 만료일 만 가져올려면 */
|
||||
/*@Column(name = "expired_dt")
|
||||
@Temporal(TemporalType.DATE)
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.caliverse.admin.domain.entity;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
@Builder
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public class DataInit {
|
||||
private Long id;
|
||||
private EInitDataType dataType;
|
||||
private DATA_INIT_STATUS status;
|
||||
|
||||
private boolean deleted;
|
||||
|
||||
@JsonProperty("create_by")
|
||||
private String createBy;
|
||||
@JsonProperty("create_dt")
|
||||
private LocalDateTime createDt;
|
||||
|
||||
public enum DATA_INIT_STATUS {
|
||||
WAIT,
|
||||
RUNNING,
|
||||
FINISH,
|
||||
FAIL
|
||||
;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.caliverse.admin.domain.entity;
|
||||
|
||||
public enum EAuthAdminLevelType {
|
||||
None,
|
||||
Reader,
|
||||
Master,
|
||||
Developer
|
||||
;
|
||||
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
package com.caliverse.admin.domain.entity;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
public enum ECurrencyType {
|
||||
|
||||
NONE(0, "None"),
|
||||
GOLD(1, "Gold"),
|
||||
SAPPHIRE(2, "Sapphire"),
|
||||
CALIUM(3, "Calium"),
|
||||
BEAM(4, "Beam"),
|
||||
RUBY(5, "Ruby");
|
||||
|
||||
private final int value;
|
||||
private final String name;
|
||||
|
||||
ECurrencyType(int value, String name) {
|
||||
this.value = value;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public int getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public static int getValueByName(String name) {
|
||||
return Arrays.stream(values())
|
||||
.filter(type -> type.name.equalsIgnoreCase(name))
|
||||
.findFirst()
|
||||
.map(ECurrencyType::getValue)
|
||||
.orElse(NONE.value);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.caliverse.admin.domain.entity;
|
||||
|
||||
public enum EInitDataType {
|
||||
None,
|
||||
LandAuction,
|
||||
LandOwned,
|
||||
LandDesc
|
||||
;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.caliverse.admin.domain.entity;
|
||||
|
||||
public enum EInputType {
|
||||
None,
|
||||
String,
|
||||
Number,
|
||||
Boolean,
|
||||
Null
|
||||
;
|
||||
|
||||
}
|
||||
@@ -12,7 +12,8 @@ public enum EMetaData {
|
||||
LAND_DATA("LandData.json", true),
|
||||
BUILDING_DATA("BuildingData.json", true),
|
||||
BATTLE_CONFIG_DATA("BattleFFAConfigData.json", true),
|
||||
BATTLE_REWARD_DATA("BattleFFARewardData.json", true)
|
||||
BATTLE_REWARD_DATA("BattleFFARewardData.json", true),
|
||||
SYSTEM_MAIL_DATA("SystemMailData.json", true)
|
||||
|
||||
;
|
||||
|
||||
|
||||
@@ -44,7 +44,14 @@ public enum HISTORYTYPE {
|
||||
LAND_AUCTION_DELETE("랜드경매 삭제"),
|
||||
BATTLE_EVENT_ADD("전투시스템 이벤트 등록"),
|
||||
BATTLE_EVENT_UPDATE("전투시스템 이벤트 수정"),
|
||||
BATTLE_EVENT_DELETE("전투시스템 이벤트 삭제")
|
||||
BATTLE_EVENT_DELETE("전투시스템 이벤트 삭제"),
|
||||
LAND_OWNER_CHANGE_ADD("랜드 소유권 변경 등록"),
|
||||
LAND_OWNER_CHANGE_UPDATE("랜드 소유권 변경 수정"),
|
||||
LAND_OWNER_CHANGE_DELETE("랜드 소유권 변경 예약 취소"),
|
||||
LAND_OWNER_CHANGE_MAIL("랜드 소유권 변경 우편"),
|
||||
LAND_OWNED_INITIALIZE("랜드 소유권 정보 초기화"),
|
||||
LAND_DESC_INITIALIZE("랜드 정보 초기화"),
|
||||
LAND_AUCTION_INITIALIZE("랜드 경매 초기화"),
|
||||
;
|
||||
private String historyType;
|
||||
HISTORYTYPE(String type) {
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
package com.caliverse.admin.domain.entity;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
@Builder
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public class LandInfo {
|
||||
private Long id;
|
||||
@JsonProperty("row_num")
|
||||
private Integer rowNum;
|
||||
@JsonProperty("land_id")
|
||||
private Integer landId;
|
||||
@JsonProperty("land_name")
|
||||
private String landName;
|
||||
@JsonProperty("land_desc")
|
||||
private String landDesc;
|
||||
@JsonProperty("land_size")
|
||||
private String landSize;
|
||||
@JsonProperty("land_type")
|
||||
private String landType;
|
||||
private String category;
|
||||
@JsonProperty("building_id")
|
||||
private Integer buildingId;
|
||||
@JsonProperty("building_name")
|
||||
private String buildingName;
|
||||
@JsonProperty("owner_user_guid")
|
||||
private String ownerUserGuid;
|
||||
@JsonProperty("owner_user_nickname")
|
||||
private String ownerUserNickname;
|
||||
@JsonProperty("owner_user_create_date")
|
||||
// private LocalDateTime ownerUserCreateDate;
|
||||
private String ownerUserCreateDate;
|
||||
@JsonProperty("owner_price")
|
||||
private String ownerPrice;
|
||||
@JsonProperty("non_auction")
|
||||
private boolean nonAuction;
|
||||
private Integer socket;
|
||||
private String editor;
|
||||
private String status;
|
||||
private String isUpdate;
|
||||
private boolean isOwned;
|
||||
@JsonProperty("owner_changes")
|
||||
private List<LandOwnerChange> ownerChanges;
|
||||
|
||||
public enum LAND_STATUS {
|
||||
NONE,
|
||||
AUCTION_RUNNING,
|
||||
AUCTION_WAIT,
|
||||
AUCTION_END,
|
||||
OWNED,
|
||||
OWNED_WAIT
|
||||
;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package com.caliverse.admin.domain.entity;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
@Builder
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public class LandOwnerChange {
|
||||
private Long id;
|
||||
@JsonProperty("row_num")
|
||||
private Integer rowNum;
|
||||
@JsonProperty("land_id")
|
||||
private Integer landId;
|
||||
@JsonProperty("land_name")
|
||||
private String landName;
|
||||
@JsonProperty("building_id")
|
||||
private Integer buildingId;
|
||||
@JsonProperty("building_name")
|
||||
private String buildingName;
|
||||
@JsonProperty("user_guid")
|
||||
private String userGuid;
|
||||
@JsonProperty("user_name")
|
||||
private String userName;
|
||||
@JsonProperty("reservation_dt")
|
||||
private LocalDateTime reservationDt;
|
||||
@JsonProperty("is_reserve")
|
||||
private boolean isReserve;
|
||||
private CHANGE_STATUS status;
|
||||
|
||||
private boolean deleted;
|
||||
|
||||
@JsonProperty("create_by")
|
||||
private String createBy;
|
||||
@JsonProperty("create_dt")
|
||||
private LocalDateTime createDt;
|
||||
@JsonProperty("update_by")
|
||||
private String updateBy;
|
||||
@JsonProperty("update_dt")
|
||||
private LocalDateTime updateDt;
|
||||
|
||||
public enum CHANGE_STATUS {
|
||||
WAIT,
|
||||
FINISH,
|
||||
RUNNING,
|
||||
CANCEL,
|
||||
FAIL
|
||||
;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package com.caliverse.admin.domain.entity.common;
|
||||
|
||||
public enum SearchUserType {
|
||||
NONE,
|
||||
GUID,
|
||||
NICKNAME,
|
||||
ACCOUNT
|
||||
}
|
||||
@@ -8,11 +8,16 @@ public class MetaLandData {
|
||||
private Integer landId;
|
||||
private String owner;
|
||||
private String editor;
|
||||
private Integer linkedItem;
|
||||
private boolean nonAuction;
|
||||
private boolean rentalStateSwitch;
|
||||
private boolean rentalAvailable;
|
||||
private String landName;
|
||||
private String landDesc;
|
||||
private String landSize;
|
||||
private String landType;
|
||||
private Integer buildingId;
|
||||
private Integer buildingSocket;
|
||||
private String cityType;
|
||||
private String buildingArea;
|
||||
private Integer buildingId;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.caliverse.admin.domain.entity.metadata;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
|
||||
@Getter @Setter
|
||||
public class MetaSystemMailData {
|
||||
private String key;
|
||||
@JsonProperty("mail_title")
|
||||
private String mailTitle;
|
||||
@JsonProperty("mail_desc")
|
||||
private String mailDesc;
|
||||
private String sender;
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.caliverse.admin.domain.request;
|
||||
|
||||
import com.caliverse.admin.domain.entity.EInitDataType;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.*;
|
||||
|
||||
@@ -12,7 +13,8 @@ public class AuthenticateRequest {
|
||||
private String name;
|
||||
private String email;
|
||||
private String password;
|
||||
|
||||
@JsonProperty("new_password")
|
||||
private String newPassword;
|
||||
@JsonProperty("init_data_type")
|
||||
private EInitDataType initDataType;
|
||||
}
|
||||
|
||||
@@ -50,6 +50,21 @@ public class LandRequest {
|
||||
@JsonProperty("message_list")
|
||||
private List<Message> massageList;
|
||||
|
||||
//소유권 변경
|
||||
@JsonProperty("user_guid")
|
||||
private String userGuid;
|
||||
@JsonProperty("user_name")
|
||||
private String userName;
|
||||
@JsonProperty("is_reserve")
|
||||
private boolean isReserve;
|
||||
@JsonProperty("reservation_dt")
|
||||
private LocalDateTime reservationDt;
|
||||
|
||||
@JsonProperty("building_id")
|
||||
private Integer buildingId;
|
||||
@JsonProperty("building_name")
|
||||
private String buildingName;
|
||||
|
||||
@JsonProperty("create_by")
|
||||
private Long createBy;
|
||||
@JsonProperty("create_dt")
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
package com.caliverse.admin.domain.request;
|
||||
|
||||
import com.caliverse.admin.domain.entity.EInputType;
|
||||
import com.caliverse.admin.domain.entity.common.SearchUserType;
|
||||
import com.caliverse.admin.logs.entity.LogAction;
|
||||
import com.caliverse.admin.logs.entity.LogDomain;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class LogGenericRequest {
|
||||
@JsonProperty("search_type")
|
||||
private SearchUserType searchType;
|
||||
@JsonProperty("search_data")
|
||||
private String searchData;
|
||||
@JsonProperty("log_action")
|
||||
private LogAction logAction;
|
||||
@JsonProperty("log_domain")
|
||||
private LogDomain logDomain;
|
||||
private List<LogFilter> filters;
|
||||
@JsonProperty("tran_id")
|
||||
private String tranId;
|
||||
@JsonProperty("start_dt")
|
||||
private LocalDateTime startDt;
|
||||
@JsonProperty("end_dt")
|
||||
private LocalDateTime endDt;
|
||||
@JsonProperty("page_no")
|
||||
private Integer pageNo;
|
||||
@JsonProperty("page_size")
|
||||
private Integer pageSize;
|
||||
@JsonProperty("order_by")
|
||||
private String orderBy;
|
||||
|
||||
@Data
|
||||
public static class LogFilter{
|
||||
@JsonProperty("field_name")
|
||||
private String fieldName;
|
||||
@JsonProperty("field_type")
|
||||
private EInputType fieldType;
|
||||
private String value;
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,8 @@
|
||||
package com.caliverse.admin.domain.request;
|
||||
|
||||
import com.caliverse.admin.domain.entity.SEARCHTYPE;
|
||||
import com.caliverse.admin.domain.entity.WhiteList;
|
||||
import com.caliverse.admin.dynamodb.entity.KeyParam;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.*;
|
||||
|
||||
@@ -19,4 +21,9 @@ public class UsersRequest {
|
||||
private String newNickname;
|
||||
@JsonProperty("admin_level")
|
||||
private String adminLevel;
|
||||
|
||||
@JsonProperty("mail_type")
|
||||
private SEARCHTYPE mailType;
|
||||
@JsonProperty("page_key")
|
||||
private KeyParam pageKey;
|
||||
}
|
||||
|
||||
@@ -47,6 +47,9 @@ public class AdminResponse {
|
||||
|
||||
private Long groupId;
|
||||
|
||||
@JsonProperty("auth_level_type")
|
||||
private EAuthAdminLevelType authLevelType;
|
||||
|
||||
@JsonProperty("list")
|
||||
private List<Admin> adminList;
|
||||
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.caliverse.admin.domain.response;
|
||||
|
||||
import com.caliverse.admin.history.domain.DynamodbDataInitializeHistory;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class DataResponse {
|
||||
private int status;
|
||||
|
||||
private String result;
|
||||
|
||||
@JsonProperty("data")
|
||||
private ResultData resultData;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public static class ResultData {
|
||||
|
||||
@JsonProperty("init_list")
|
||||
List<DynamodbDataInitializeHistory> dataInitList;
|
||||
|
||||
private String message;
|
||||
|
||||
private int total;
|
||||
@JsonProperty("total_all")
|
||||
private int totalAll;
|
||||
@JsonProperty("page_no")
|
||||
private int pageNo;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.caliverse.admin.domain.response;
|
||||
|
||||
import com.caliverse.admin.domain.entity.LandAuction;
|
||||
import com.caliverse.admin.domain.entity.LandInfo;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
@@ -35,6 +36,9 @@ public class LandResponse {
|
||||
@JsonProperty("building_list")
|
||||
private List<Building> buildingList;
|
||||
|
||||
@JsonProperty("land_info_list")
|
||||
private List<LandInfo> landInfoList;
|
||||
|
||||
private String message;
|
||||
@JsonProperty("land_list")
|
||||
private List<Land> landList;
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.caliverse.admin.domain.response;
|
||||
|
||||
import com.caliverse.admin.logs.Indicatordomain.GenericMongoLog;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class LogResponse {
|
||||
private int status;
|
||||
|
||||
private String result;
|
||||
@JsonProperty("data")
|
||||
|
||||
private ResultData resultData;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
public static class ResultData {
|
||||
|
||||
private String message;
|
||||
|
||||
@JsonProperty("generic_list")
|
||||
// private List<Map<String, Object>> genericList;
|
||||
private List<GenericMongoLog> genericList;
|
||||
|
||||
private int total;
|
||||
@JsonProperty("total_all")
|
||||
private int totalAll;
|
||||
@JsonProperty("page_no")
|
||||
private int pageNo;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -31,6 +31,8 @@ public class UsersResponse {
|
||||
|
||||
private String message;
|
||||
|
||||
@JsonProperty("user_session")
|
||||
private boolean userSession;
|
||||
@JsonProperty("user_info")
|
||||
private UserInfo userInfo;
|
||||
@JsonProperty("char_info")
|
||||
@@ -62,6 +64,8 @@ public class UsersResponse {
|
||||
@JsonProperty("quest_detail")
|
||||
private List<Quest> questDetail;
|
||||
|
||||
private Map<String,String> pageKey;
|
||||
|
||||
private Map<String,String> result;
|
||||
}
|
||||
@Data
|
||||
|
||||
@@ -132,6 +132,7 @@ public class AdminService {
|
||||
.status(admin.get().getStatus())
|
||||
.authorityList(groupAuth)
|
||||
.expiredDt(admin.get().getPwUpdateDt().plus(passwordExpiration, ChronoUnit.DAYS))
|
||||
.authLevelType(admin.get().getAuthLevelType())
|
||||
.build();
|
||||
}
|
||||
return AdminResponse.builder()
|
||||
|
||||
@@ -23,6 +23,8 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.time.DayOfWeek;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalTime;
|
||||
import java.util.HashMap;
|
||||
@@ -116,6 +118,15 @@ public class BattleEventService {
|
||||
LocalDateTime start_dt = battleEventRequest.getEventStartDt();
|
||||
LocalDateTime end_dt = start_dt.plusHours(12);
|
||||
battleEventRequest.setEventEndDt(end_dt);
|
||||
}else{
|
||||
// 일자만 필요해서 UTC시간으로 변경되다보니 한국시간(+9)을 더해서 마지막시간으로 설정
|
||||
LocalDateTime end_dt_kst = battleEventRequest.getEventEndDt()
|
||||
.plusHours(9)
|
||||
.withHour(23)
|
||||
.withMinute(59)
|
||||
.withSecond(59)
|
||||
.withNano(0);
|
||||
battleEventRequest.setEventEndDt(end_dt_kst);
|
||||
}
|
||||
battleEventRequest.setInstanceId(CommonConstants.BATTLE_INSTANCE_ID); //고정값으로 넣고 추후 맵정보가 늘어나면 선택하는 걸로
|
||||
|
||||
@@ -126,21 +137,13 @@ public class BattleEventService {
|
||||
List<BattleEvent> existingList = battleMapper.getCheckBattleEventList(battleEventRequest);
|
||||
boolean isTime = isTimeOverlapping(existingList, battleEventRequest);
|
||||
if(isTime){
|
||||
log.warn("battle Schedule duplication start_dt: {}, end_dt: {}, operation_time: {}", battleEventRequest.getEventStartDt(), battleEventRequest.getEventEndDt(), operation_time);
|
||||
return BattleEventResponse.builder()
|
||||
.status(CommonCode.ERROR.getHttpStatus())
|
||||
.result(ErrorCode.ERROR_BATTLE_EVENT_TIME_OVER.toString())
|
||||
.build();
|
||||
}
|
||||
|
||||
// 일자만 필요해서 UTC시간으로 변경되다보니 한국시간(+9)을 더해서 마지막시간으로 설정
|
||||
LocalDateTime end_dt_kst = battleEventRequest.getEventEndDt()
|
||||
.plusHours(9)
|
||||
.withHour(23)
|
||||
.withMinute(59)
|
||||
.withSecond(59)
|
||||
.withNano(0);
|
||||
battleEventRequest.setEventEndDt(end_dt_kst);
|
||||
|
||||
int next_event_id = dynamodbBattleEventService.getEventId() + 1;
|
||||
battleEventRequest.setEventId(next_event_id);
|
||||
|
||||
@@ -363,14 +366,205 @@ public class BattleEventService {
|
||||
}
|
||||
|
||||
private boolean isTimeOverlapping(List<BattleEvent> existingList, BattleEventRequest battleEventRequest){
|
||||
LocalTime newStartTime = battleEventRequest.getEventStartDt().toLocalTime();
|
||||
LocalDateTime newStartDt = battleEventRequest.getEventStartDt();
|
||||
LocalDateTime newEndDt = battleEventRequest.getEventEndDt();
|
||||
LocalDate newStartDate = newStartDt.toLocalDate();
|
||||
LocalDate newEndDate = newEndDt.toLocalDate();
|
||||
LocalTime newStartTime = newStartDt.toLocalTime();
|
||||
LocalTime newEndTime = newStartTime.plusSeconds(battleEventRequest.getEventOperationTime());
|
||||
BattleEvent.BATTLE_REPEAT_TYPE newRepeatType = battleEventRequest.getRepeatType();
|
||||
|
||||
return existingList.stream().anyMatch(schedule -> {
|
||||
LocalTime existingStartTime = schedule.getEventStartDt().toLocalTime();
|
||||
LocalTime existingEndTime = existingStartTime.plusSeconds(schedule.getEventOperationTime());
|
||||
return existingList.stream().anyMatch(existingEvent -> {
|
||||
// 자기 자신은 제외 (수정 시)
|
||||
if (battleEventRequest.getId() != null && battleEventRequest.getId().equals(existingEvent.getId())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return !existingStartTime.isAfter(newEndTime) && !newStartTime.isAfter(existingEndTime);
|
||||
// 기존 이벤트 정보
|
||||
LocalDateTime existingStartDt = existingEvent.getEventStartDt();
|
||||
LocalDateTime existingEndDt = existingEvent.getEventEndDt();
|
||||
LocalDate existingStartDate = existingStartDt.toLocalDate();
|
||||
LocalDate existingEndDate = existingEndDt.toLocalDate();
|
||||
LocalTime existingStartTime = existingStartDt.toLocalTime();
|
||||
LocalTime existingEndTime = existingStartTime.plusSeconds(existingEvent.getEventOperationTime());
|
||||
BattleEvent.BATTLE_REPEAT_TYPE existingRepeatType = existingEvent.getRepeatType();
|
||||
|
||||
// 1. 두 이벤트가 모두 NONE 타입인 경우
|
||||
if (newRepeatType == BattleEvent.BATTLE_REPEAT_TYPE.NONE &&
|
||||
existingRepeatType == BattleEvent.BATTLE_REPEAT_TYPE.NONE) {
|
||||
// 같은 날짜인지 확인
|
||||
if (newStartDate.equals(existingStartDate)) {
|
||||
// 시간이 겹치는지 확인
|
||||
return !existingStartTime.isAfter(newEndTime) && !newStartTime.isAfter(existingEndTime);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// 2. NONE 타입과 DAY 타입 간의 중복 체크
|
||||
if (newRepeatType == BattleEvent.BATTLE_REPEAT_TYPE.NONE &&
|
||||
existingRepeatType == BattleEvent.BATTLE_REPEAT_TYPE.DAY) {
|
||||
// NONE 이벤트의 날짜가 DAY 이벤트의 기간 내에 있는지 확인
|
||||
if (isDateInRange(newStartDate, existingStartDate, existingEndDate)) {
|
||||
// 시간이 겹치는지 확인
|
||||
return !existingStartTime.isAfter(newEndTime) && !newStartTime.isAfter(existingEndTime);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// 3. DAY 타입과 NONE 타입 간의 중복 체크
|
||||
if (newRepeatType == BattleEvent.BATTLE_REPEAT_TYPE.DAY &&
|
||||
existingRepeatType == BattleEvent.BATTLE_REPEAT_TYPE.NONE) {
|
||||
// NONE 이벤트의 날짜가 DAY 이벤트의 기간 내에 있는지 확인
|
||||
if (isDateInRange(existingStartDate, newStartDate, newEndDate)) {
|
||||
// 시간이 겹치는지 확인
|
||||
return !existingStartTime.isAfter(newEndTime) && !newStartTime.isAfter(existingEndTime);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// 4. 두 이벤트가 모두 DAY 타입인 경우
|
||||
if (newRepeatType == BattleEvent.BATTLE_REPEAT_TYPE.DAY &&
|
||||
existingRepeatType == BattleEvent.BATTLE_REPEAT_TYPE.DAY) {
|
||||
// 날짜 범위가 겹치는지 확인
|
||||
if (datesOverlap(newStartDate, newEndDate, existingStartDate, existingEndDate)) {
|
||||
// 시간이 겹치는지 확인
|
||||
return !existingStartTime.isAfter(newEndTime) && !newStartTime.isAfter(existingEndTime);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// 5. NONE 타입과 요일 타입 간의 중복 체크
|
||||
if (newRepeatType == BattleEvent.BATTLE_REPEAT_TYPE.NONE &&
|
||||
isWeekdayType(existingRepeatType)) {
|
||||
// NONE 이벤트의 날짜가 요일 이벤트의 기간 내에 있는지 확인
|
||||
if (isDateInRange(newStartDate, existingStartDate, existingEndDate)) {
|
||||
// NONE 이벤트의 요일이 요일 이벤트의 요일과 일치하는지 확인
|
||||
DayOfWeek noneDayOfWeek = newStartDate.getDayOfWeek();
|
||||
DayOfWeek weekdayType = getDayOfWeekFromRepeatType(existingRepeatType);
|
||||
|
||||
if (noneDayOfWeek == weekdayType) {
|
||||
// 시간이 겹치는지 확인
|
||||
return !existingStartTime.isAfter(newEndTime) && !newStartTime.isAfter(existingEndTime);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// 6. 요일 타입과 NONE 타입 간의 중복 체크
|
||||
if (isWeekdayType(newRepeatType) &&
|
||||
existingRepeatType == BattleEvent.BATTLE_REPEAT_TYPE.NONE) {
|
||||
// NONE 이벤트의 날짜가 요일 이벤트의 기간 내에 있는지 확인
|
||||
if (isDateInRange(existingStartDate, newStartDate, newEndDate)) {
|
||||
// NONE 이벤트의 요일이 요일 이벤트의 요일과 일치하는지 확인
|
||||
DayOfWeek noneDayOfWeek = existingStartDate.getDayOfWeek();
|
||||
DayOfWeek weekdayType = getDayOfWeekFromRepeatType(newRepeatType);
|
||||
|
||||
if (noneDayOfWeek == weekdayType) {
|
||||
// 시간이 겹치는지 확인
|
||||
return !existingStartTime.isAfter(newEndTime) && !newStartTime.isAfter(existingEndTime);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// 7. DAY 타입과 요일 타입 간의 중복 체크
|
||||
if (newRepeatType == BattleEvent.BATTLE_REPEAT_TYPE.DAY &&
|
||||
isWeekdayType(existingRepeatType)) {
|
||||
// 날짜 범위가 겹치는지 확인
|
||||
if (datesOverlap(newStartDate, newEndDate, existingStartDate, existingEndDate)) {
|
||||
// 날짜 범위 내에 해당 요일이 적어도 하나 있는지 확인
|
||||
if (hasOverlappingWeekday(newStartDate, newEndDate, existingStartDate, existingEndDate, getDayOfWeekFromRepeatType(existingRepeatType))) {
|
||||
// 시간이 겹치는지 확인
|
||||
return !existingStartTime.isAfter(newEndTime) && !newStartTime.isAfter(existingEndTime);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// 8. 요일 타입과 DAY 타입 간의 중복 체크
|
||||
if (isWeekdayType(newRepeatType) &&
|
||||
existingRepeatType == BattleEvent.BATTLE_REPEAT_TYPE.DAY) {
|
||||
// 날짜 범위가 겹치는지 확인
|
||||
if (datesOverlap(newStartDate, newEndDate, existingStartDate, existingEndDate)) {
|
||||
// 날짜 범위 내에 해당 요일이 적어도 하나 있는지 확인
|
||||
if (hasOverlappingWeekday(newStartDate, newEndDate, existingStartDate, existingEndDate, getDayOfWeekFromRepeatType(newRepeatType))) {
|
||||
// 시간이 겹치는지 확인
|
||||
return !existingStartTime.isAfter(newEndTime) && !newStartTime.isAfter(existingEndTime);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// 9. 두 이벤트가 모두 요일 타입인 경우
|
||||
if (isWeekdayType(newRepeatType) && isWeekdayType(existingRepeatType)) {
|
||||
// 같은 요일인지 확인
|
||||
if (newRepeatType == existingRepeatType) {
|
||||
// 날짜 범위가 겹치는지 확인
|
||||
if (datesOverlap(newStartDate, newEndDate, existingStartDate, existingEndDate)) {
|
||||
// 시간이 겹치는지 확인
|
||||
return !existingStartTime.isAfter(newEndTime) && !newStartTime.isAfter(existingEndTime);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
private boolean isDateInRange(LocalDate date, LocalDate rangeStart, LocalDate rangeEnd) {
|
||||
return !date.isBefore(rangeStart) && !date.isAfter(rangeEnd);
|
||||
}
|
||||
|
||||
private boolean datesOverlap(LocalDate start1, LocalDate end1, LocalDate start2, LocalDate end2) {
|
||||
return !start1.isAfter(end2) && !start2.isAfter(end1);
|
||||
}
|
||||
|
||||
private boolean isWeekdayType(BattleEvent.BATTLE_REPEAT_TYPE repeatType) {
|
||||
return repeatType == BattleEvent.BATTLE_REPEAT_TYPE.SUNDAY ||
|
||||
repeatType == BattleEvent.BATTLE_REPEAT_TYPE.MONDAY ||
|
||||
repeatType == BattleEvent.BATTLE_REPEAT_TYPE.TUESDAY ||
|
||||
repeatType == BattleEvent.BATTLE_REPEAT_TYPE.WEDNESDAY ||
|
||||
repeatType == BattleEvent.BATTLE_REPEAT_TYPE.THURSDAY ||
|
||||
repeatType == BattleEvent.BATTLE_REPEAT_TYPE.FRIDAY ||
|
||||
repeatType == BattleEvent.BATTLE_REPEAT_TYPE.SATURDAY;
|
||||
}
|
||||
|
||||
private DayOfWeek getDayOfWeekFromRepeatType(BattleEvent.BATTLE_REPEAT_TYPE repeatType) {
|
||||
switch (repeatType) {
|
||||
case MONDAY: return DayOfWeek.MONDAY;
|
||||
case TUESDAY: return DayOfWeek.TUESDAY;
|
||||
case WEDNESDAY: return DayOfWeek.WEDNESDAY;
|
||||
case THURSDAY: return DayOfWeek.THURSDAY;
|
||||
case FRIDAY: return DayOfWeek.FRIDAY;
|
||||
case SATURDAY: return DayOfWeek.SATURDAY;
|
||||
case SUNDAY: return DayOfWeek.SUNDAY;
|
||||
default: throw new IllegalArgumentException("Invalid repeat type: " + repeatType);
|
||||
}
|
||||
}
|
||||
|
||||
private boolean hasOverlappingWeekday(
|
||||
LocalDate start1, LocalDate end1,
|
||||
LocalDate start2, LocalDate end2,
|
||||
DayOfWeek dayOfWeek) {
|
||||
|
||||
// 두 범위의 교집합 계산
|
||||
LocalDate overlapStart = start1.isAfter(start2) ? start1 : start2;
|
||||
LocalDate overlapEnd = end1.isBefore(end2) ? end1 : end2;
|
||||
|
||||
if (overlapStart.isAfter(overlapEnd)) {
|
||||
return false; // 겹치는 날짜 범위 없음
|
||||
}
|
||||
|
||||
// 겹치는 날짜 범위 내에 해당 요일이 있는지 확인
|
||||
LocalDate current = overlapStart;
|
||||
while (!current.isAfter(overlapEnd)) {
|
||||
if (current.getDayOfWeek() == dayOfWeek) {
|
||||
return true; // 해당 요일 발견
|
||||
}
|
||||
current = current.plusDays(1);
|
||||
}
|
||||
|
||||
return false; // 해당 요일 없음
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,215 @@
|
||||
package com.caliverse.admin.domain.service;
|
||||
|
||||
import com.caliverse.admin.domain.dao.admin.DataMapper;
|
||||
import com.caliverse.admin.domain.dao.admin.LandMapper;
|
||||
import com.caliverse.admin.domain.entity.*;
|
||||
import com.caliverse.admin.domain.request.AuthenticateRequest;
|
||||
import com.caliverse.admin.domain.request.LogGenericRequest;
|
||||
import com.caliverse.admin.domain.response.DataResponse;
|
||||
import com.caliverse.admin.dynamodb.service.DynamodbDataService;
|
||||
import com.caliverse.admin.global.common.code.CommonCode;
|
||||
import com.caliverse.admin.global.common.code.ErrorCode;
|
||||
import com.caliverse.admin.global.common.code.SuccessCode;
|
||||
import com.caliverse.admin.global.common.constants.MysqlConstants;
|
||||
import com.caliverse.admin.global.common.utils.CommonUtils;
|
||||
import com.caliverse.admin.global.component.transaction.TransactionIdManager;
|
||||
import com.caliverse.admin.history.domain.DynamodbDataInitializeHistory;
|
||||
import com.caliverse.admin.history.service.DataInitializeHistoryService;
|
||||
import com.caliverse.admin.history.service.MysqlHistoryLogService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.data.mongodb.UncategorizedMongoDbException;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Slf4j
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class DataService {
|
||||
|
||||
private final DynamodbDataService dynamodbDataService;
|
||||
private final MysqlHistoryLogService mysqlHistoryLogService;
|
||||
private final LandMapper landMapper;
|
||||
private final DataMapper dataMapper;
|
||||
private final DataInitializeHistoryService dataInitializeHistoryService;
|
||||
private final TransactionIdManager transactionIdManager;
|
||||
|
||||
public DataResponse initHistoryList(LogGenericRequest logGenericRequest){
|
||||
|
||||
LocalDateTime startDt = logGenericRequest.getStartDt().plusHours(9);
|
||||
LocalDateTime endDt = logGenericRequest.getEndDt().plusHours(9).plusDays(1);
|
||||
|
||||
logGenericRequest.setStartDt(startDt);
|
||||
logGenericRequest.setEndDt(endDt);
|
||||
|
||||
List<DynamodbDataInitializeHistory> logList = new ArrayList<>();
|
||||
try{
|
||||
logList = dataInitializeHistoryService.loadHistoryData(logGenericRequest, DynamodbDataInitializeHistory.class);
|
||||
}catch(UncategorizedMongoDbException e){
|
||||
if (e.getMessage().contains("Sort exceeded memory limit")) {
|
||||
log.error("MongoDB Query memory limit error: {}", e.getMessage());
|
||||
return DataResponse.builder()
|
||||
.status(CommonCode.ERROR.getHttpStatus())
|
||||
.result(ErrorCode.ERROR_LOG_MEMORY_LIMIT.toString())
|
||||
.build();
|
||||
} else {
|
||||
log.error("MongoDB Query error", e);
|
||||
return DataResponse.builder()
|
||||
.status(CommonCode.ERROR.getHttpStatus())
|
||||
.result(ErrorCode.ERROR_MONGODB_QUERY.toString())
|
||||
.build();
|
||||
}
|
||||
}catch (Exception e){
|
||||
log.error("dataInitialize error", e);
|
||||
}
|
||||
|
||||
return DataResponse.builder()
|
||||
.resultData(DataResponse.ResultData.builder()
|
||||
.dataInitList(logList)
|
||||
.build())
|
||||
.status(CommonCode.SUCCESS.getHttpStatus())
|
||||
.result(CommonCode.SUCCESS.getResult())
|
||||
.build();
|
||||
|
||||
}
|
||||
|
||||
@Transactional(transactionManager = "transactionManager")
|
||||
public DataResponse initData(AuthenticateRequest authenticateRequest){
|
||||
EInitDataType dataType = authenticateRequest.getInitDataType();
|
||||
log.info("initData email: {}, initDataType: {}", CommonUtils.getAdmin().getEmail(), dataType);
|
||||
|
||||
dataMapper.postDataInit(dataType, CommonUtils.getAdmin().getId());
|
||||
|
||||
// switch(dataType){
|
||||
// case LandAuction -> {
|
||||
// int result = initLandAuction();
|
||||
// if(result == 0){
|
||||
// return DataResponse.builder()
|
||||
// .status(CommonCode.ERROR.getHttpStatus())
|
||||
// .result(ErrorCode.ERROR_DATA_INIT.toString())
|
||||
// .build();
|
||||
// }
|
||||
// }
|
||||
// case LandOwned -> {
|
||||
// int result = initLandOwned();
|
||||
// if(result == 0){
|
||||
// return DataResponse.builder()
|
||||
// .status(CommonCode.ERROR.getHttpStatus())
|
||||
// .result(ErrorCode.ERROR_DATA_INIT.toString())
|
||||
// .build();
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// dynamodbDataService.InitDataLandOwned();
|
||||
|
||||
return DataResponse.builder()
|
||||
.status(CommonCode.SUCCESS.getHttpStatus())
|
||||
.result(CommonCode.SUCCESS.getResult())
|
||||
.resultData(DataResponse.ResultData.builder()
|
||||
.message(SuccessCode.SAVE.getMessage())
|
||||
.build())
|
||||
.build();
|
||||
}
|
||||
|
||||
@Transactional(transactionManager = "transactionManager")
|
||||
public void initLandAuction(LandAuction landAuction){
|
||||
try {
|
||||
long auctionId = landAuction.getId();
|
||||
int result = landMapper.initLandAuction(auctionId);
|
||||
|
||||
List<Message> message = landMapper.getMessage(auctionId);
|
||||
Map map = new HashMap();
|
||||
map.put("id", landAuction.getId());
|
||||
landMapper.deleteMessage(map);
|
||||
|
||||
mysqlHistoryLogService.deleteHistoryLog(
|
||||
HISTORYTYPE.LAND_AUCTION_INITIALIZE,
|
||||
MysqlConstants.TABLE_NAME_LAND_AUCTION,
|
||||
HISTORYTYPE.LAND_AUCTION_INITIALIZE.name(),
|
||||
landAuction,
|
||||
CommonUtils.getAdmin() == null ? "" : CommonUtils.getAdmin().getEmail(),
|
||||
CommonUtils.getClientIp() == null ? "" : CommonUtils.getClientIp()
|
||||
);
|
||||
if (!message.isEmpty()) {
|
||||
mysqlHistoryLogService.deleteHistoryLog(
|
||||
HISTORYTYPE.LAND_AUCTION_INITIALIZE,
|
||||
MysqlConstants.TABLE_NAME_MESSAGE,
|
||||
HISTORYTYPE.LAND_AUCTION_INITIALIZE.name(),
|
||||
message,
|
||||
CommonUtils.getAdmin() == null ? "" : CommonUtils.getAdmin().getEmail(),
|
||||
CommonUtils.getClientIp() == null ? "" : CommonUtils.getClientIp()
|
||||
);
|
||||
}
|
||||
|
||||
dataInitializeHistoryService.mysqlDataInitHistory(
|
||||
EInitDataType.LandAuction,
|
||||
MysqlConstants.TABLE_NAME_LAND_AUCTION,
|
||||
transactionIdManager.getCurrentTransactionId(),
|
||||
true,
|
||||
"",
|
||||
landAuction
|
||||
);
|
||||
|
||||
}catch(Exception e){
|
||||
log.error("InitLandAuction Delete Error: {}", e.getMessage());
|
||||
dataInitializeHistoryService.mysqlDataInitHistory(
|
||||
EInitDataType.LandAuction,
|
||||
MysqlConstants.TABLE_NAME_LAND_AUCTION,
|
||||
transactionIdManager.getCurrentTransactionId(),
|
||||
false,
|
||||
e.getMessage(),
|
||||
landAuction
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
public void initLandOwned(LandOwnerChange landOwnerChange){
|
||||
try {
|
||||
long id = landOwnerChange.getId();
|
||||
landMapper.initLandOwnedChanges(id);
|
||||
|
||||
mysqlHistoryLogService.deleteHistoryLog(
|
||||
HISTORYTYPE.LAND_OWNED_INITIALIZE,
|
||||
MysqlConstants.TABLE_NAME_LAND_OWNER_CHANGE,
|
||||
HISTORYTYPE.LAND_OWNED_INITIALIZE.name(),
|
||||
landOwnerChange,
|
||||
CommonUtils.getAdmin() == null ? "" : CommonUtils.getAdmin().getEmail(),
|
||||
CommonUtils.getClientIp() == null ? "" : CommonUtils.getClientIp()
|
||||
);
|
||||
|
||||
dataInitializeHistoryService.mysqlDataInitHistory(
|
||||
EInitDataType.LandOwned,
|
||||
MysqlConstants.TABLE_NAME_LAND_OWNER_CHANGE,
|
||||
transactionIdManager.getCurrentTransactionId(),
|
||||
true,
|
||||
"",
|
||||
landOwnerChange
|
||||
);
|
||||
}catch(Exception e){
|
||||
log.error("initLandOwned Delete Error: {}", e.getMessage());
|
||||
dataInitializeHistoryService.mysqlDataInitHistory(
|
||||
EInitDataType.LandOwned,
|
||||
MysqlConstants.TABLE_NAME_LAND_OWNER_CHANGE,
|
||||
transactionIdManager.getCurrentTransactionId(),
|
||||
false,
|
||||
e.getMessage(),
|
||||
landOwnerChange
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
public List<DataInit> getScheduleDataInitList(){
|
||||
return dataMapper.getDataInit();
|
||||
}
|
||||
|
||||
public void updateStatus(long id, DataInit.DATA_INIT_STATUS status){
|
||||
dataMapper.updateStatus(id, status.toString());
|
||||
}
|
||||
}
|
||||
@@ -96,7 +96,7 @@ public class DynamoDBService {
|
||||
Map<String, Object> resMap = new HashMap<>();
|
||||
Map<String, AttributeValue> key = new HashMap<>();
|
||||
key.put("PK", AttributeValue.builder().s("user_nickname_registry#global").build());
|
||||
key.put("SK", AttributeValue.builder().s(primaryKey).build());
|
||||
key.put("SK", AttributeValue.builder().s(primaryKey.toLowerCase(Locale.ENGLISH)).build());
|
||||
// GetItem 요청을 만듭니다.
|
||||
GetItemRequest getItemRequest = GetItemRequest.builder()
|
||||
.tableName(metaTable)
|
||||
@@ -1664,122 +1664,6 @@ public class DynamoDBService {
|
||||
return resTatto;
|
||||
}
|
||||
|
||||
public String insertSystemMail(int id, ArrayNode titleList, ArrayNode textList, ArrayNode senderList, LocalDateTime start_dt, LocalDateTime end_dt, ArrayNode itemList) {
|
||||
try {
|
||||
|
||||
// Attrib에 저장할 JSON 생성
|
||||
ObjectMapper objectMapper = new ObjectMapper();
|
||||
ObjectNode infoNode = objectMapper.createObjectNode();
|
||||
infoNode.put("attrib_type", DynamoDBConstants.ATTRIB_SYSTEMMAIL);
|
||||
infoNode.put("mail_id", id);
|
||||
infoNode.set("sender_nickname", senderList);
|
||||
infoNode.set("title", titleList);
|
||||
infoNode.set("text", textList);
|
||||
infoNode.put("start_time", CommonUtils.convertUTCDate(start_dt));
|
||||
infoNode.put("end_time", CommonUtils.convertUTCDate(end_dt));
|
||||
infoNode.set("item_list", itemList);
|
||||
|
||||
String infoJson = infoNode.toString();
|
||||
log.info("insertSystemMail SystemMetaMailAttrib: {}", infoJson);
|
||||
|
||||
// 추가 데이터
|
||||
Map<String, AttributeValue> itemValues = new HashMap<>();
|
||||
itemValues.put("PK", AttributeValue.builder().s(DynamoDBConstants.PK_KEY_SYSTEM_MAIL).build());
|
||||
itemValues.put("SK", AttributeValue.builder().s(String.valueOf(id)).build());
|
||||
itemValues.put("CreatedDateTime", AttributeValue.builder().s(CommonUtils.convertUTCDate(LocalDateTime.now())).build());
|
||||
itemValues.put("DeletedDateTime", AttributeValue.builder().s(DynamoDBConstants.MIN_DATE).build());
|
||||
itemValues.put("DocType", AttributeValue.builder().s(DynamoDBConstants.DOC_SYSTEMMAIL).build());
|
||||
itemValues.put("SystemMetaMailAttrib", AttributeValue.builder().s(infoJson).build());
|
||||
itemValues.put("RestoredDateTime", AttributeValue.builder().s(DynamoDBConstants.MIN_DATE).build());
|
||||
itemValues.put("UpdatedDateTime", AttributeValue.builder().s(CommonUtils.convertUTCDate(LocalDateTime.now())).build());
|
||||
|
||||
PutItemRequest putRequest = PutItemRequest.builder()
|
||||
.tableName(metaTable)
|
||||
.item(itemValues)
|
||||
.build();
|
||||
|
||||
dynamoDbClient.putItem(putRequest);
|
||||
|
||||
return itemValues.toString();
|
||||
} catch (Exception e) {
|
||||
log.error("insertSystemMail: {}", e.getMessage());
|
||||
throw new RestApiException(CommonCode.ERROR.getHttpStatus(), ErrorCode.DYNAMODB_CONNECTION_ERROR.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public String deleteSystemMail(String id) {
|
||||
Map<String, AttributeValue> itemAttributes = new HashMap<>();
|
||||
itemAttributes.put("PK", AttributeValue.builder().s(DynamoDBConstants.PK_KEY_SYSTEM_MAIL).build());
|
||||
itemAttributes.put("SK", AttributeValue.builder().s(id).build());
|
||||
try {
|
||||
Map<String, AttributeValue> item = getItem(DynamoDBConstants.PK_KEY_SYSTEM_MAIL, id);
|
||||
|
||||
DeleteItemRequest request = DeleteItemRequest.builder()
|
||||
.tableName(metaTable)
|
||||
.key(itemAttributes)
|
||||
.build();
|
||||
|
||||
DeleteItemResponse response = dynamoDbClient.deleteItem(request);
|
||||
|
||||
if(response.sdkHttpResponse().isSuccessful())
|
||||
return item.toString();
|
||||
|
||||
return "";
|
||||
}catch (ConditionalCheckFailedException e) {
|
||||
log.error("deleteSystemMail Conditional check failed: {}", e.getMessage());
|
||||
throw new RestApiException(CommonCode.ERROR.getHttpStatus(), ErrorCode.DYNAMODB_CONNECTION_ERROR.getMessage());
|
||||
}catch(Exception e){
|
||||
log.error("deleteSystemMail: {}", e.getMessage());
|
||||
throw new RestApiException(CommonCode.ERROR.getHttpStatus(), ErrorCode.DYNAMODB_CONNECTION_ERROR.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public String updateSystemMail(String id, ArrayNode titleList, ArrayNode textList, LocalDateTime start_dt, LocalDateTime end_dt, ArrayNode itemList) {
|
||||
try{
|
||||
|
||||
Map<String, AttributeValue> item = getItem(DynamoDBConstants.PK_KEY_SYSTEM_MAIL, id);
|
||||
|
||||
String InfoJson = item.get("SystemMetaMailAttrib").s();
|
||||
|
||||
ObjectMapper objectMapper = new ObjectMapper();
|
||||
JsonNode infoNode = objectMapper.readTree(InfoJson);
|
||||
|
||||
((ObjectNode) infoNode).set("title", titleList);
|
||||
((ObjectNode) infoNode).set("text", textList);
|
||||
((ObjectNode) infoNode).put("start_time", CommonUtils.convertUTCDate(start_dt));
|
||||
((ObjectNode) infoNode).put("end_time", CommonUtils.convertUTCDate(end_dt));
|
||||
((ObjectNode) infoNode).set("item_list", itemList);
|
||||
|
||||
String updatedInfoJson = infoNode.toString();
|
||||
|
||||
Map<String, AttributeValue> expressionAttributeValues = new HashMap<>();
|
||||
expressionAttributeValues.put(":newAttrib", AttributeValue.builder().s(updatedInfoJson).build());
|
||||
|
||||
String updateExpression = "SET SystemMetaMailAttrib = :newAttrib";
|
||||
|
||||
UpdateItemRequest updateRequest = UpdateItemRequest.builder()
|
||||
.tableName(metaTable)
|
||||
.key(Map.of(
|
||||
"PK", AttributeValue.builder().s(DynamoDBConstants.PK_KEY_SYSTEM_MAIL).build(),
|
||||
"SK", AttributeValue.builder().s(id).build()))
|
||||
.updateExpression(updateExpression)
|
||||
.expressionAttributeValues(expressionAttributeValues)
|
||||
.returnValues(ReturnValue.ALL_NEW) // 업데이트 후의 값을 반환하려면 지정
|
||||
.build();
|
||||
|
||||
|
||||
dynamoDbClient.updateItem(updateRequest);
|
||||
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("data(before)", InfoJson);
|
||||
jsonObject.put("data(after)", updatedInfoJson);
|
||||
return jsonObject.toString();
|
||||
}catch(Exception e){
|
||||
log.error("updateSystemMail: {}", e.getMessage());
|
||||
throw new RestApiException(CommonCode.ERROR.getHttpStatus(), ErrorCode.DYNAMODB_CONNECTION_ERROR.getMessage() );
|
||||
}
|
||||
}
|
||||
|
||||
// 친구 목록
|
||||
public List<UsersResponse.Friend> getFriendList(String guid){
|
||||
List<UsersResponse.Friend> resList = new ArrayList<>();
|
||||
@@ -1885,454 +1769,4 @@ public class DynamoDBService {
|
||||
}
|
||||
return myhome;
|
||||
}
|
||||
|
||||
// 칼리움 수량
|
||||
public float getCaliumTotal(){
|
||||
try {
|
||||
float total = 0;
|
||||
Map<String, AttributeValue> response = getItem(DynamoDBConstants.PK_KEY_CALIUM, "empty");
|
||||
|
||||
AttributeValue attributeValue = response.get(DynamoDBConstants.ATTRIB_CALIUM);
|
||||
|
||||
if (attributeValue != null) {
|
||||
Map<String, AttributeValue> attrib = attributeValue.m();
|
||||
Map<String, AttributeValue> storageMap = attrib.get("calium_operator_storage").m();
|
||||
|
||||
total = Float.parseFloat(storageMap.get("operator_total_calium").n());
|
||||
}
|
||||
log.info("getCaliumTotal calium total: {}", total);
|
||||
return total;
|
||||
}catch (Exception e){
|
||||
log.error("getCaliumTotal: {}", e.getMessage());
|
||||
throw new RestApiException(CommonCode.ERROR.getHttpStatus(), ErrorCode.DYNAMODB_CONNECTION_ERROR.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public String updateCaliumTotal(float caliumCnt) {
|
||||
try{
|
||||
Map<String, AttributeValue> item = getItem(DynamoDBConstants.PK_KEY_CALIUM, "empty");
|
||||
|
||||
String InfoJson = item.get(DynamoDBConstants.ATTRIB_CALIUM).m().toString();
|
||||
|
||||
float currentTotal = Float.parseFloat(item.get(DynamoDBConstants.ATTRIB_CALIUM).m().get("calium_operator_storage").m().get("operator_total_calium").n());
|
||||
float sumTotal = currentTotal + caliumCnt;
|
||||
log.info("updateCaliumTotal currentTotal: {}, newCaliumCnt: {}", currentTotal, caliumCnt);
|
||||
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSSSSSS");
|
||||
String nowDateTime = LocalDateTime.now().format(formatter);
|
||||
|
||||
try {
|
||||
String updateExpression = "SET " + DynamoDBConstants.ATTRIB_CALIUM + ".calium_operator_storage.operator_total_calium = :newCalium, "
|
||||
+ DynamoDBConstants.ATTRIB_CALIUM + ".calium_operator_storage.operator_calium_fill_up_date = :newDate, "
|
||||
+ "UpdatedDateTime = :newDate";
|
||||
log.info("updateCaliumTotal update Query: {}", updateExpression);
|
||||
|
||||
Map<String, AttributeValue> expressionAttributeValues = new HashMap<>();
|
||||
expressionAttributeValues.put(":newCalium",
|
||||
AttributeValue.builder().n(String.valueOf(sumTotal)).build());
|
||||
expressionAttributeValues.put(":newDate",
|
||||
AttributeValue.builder().s(nowDateTime).build());
|
||||
|
||||
UpdateItemRequest updateRequest = UpdateItemRequest.builder()
|
||||
.tableName(metaTable)
|
||||
.key(Map.of(
|
||||
"PK", AttributeValue.builder().s(DynamoDBConstants.PK_KEY_CALIUM).build(),
|
||||
"SK", AttributeValue.builder().s("empty").build()))
|
||||
.updateExpression(updateExpression)
|
||||
.expressionAttributeValues(expressionAttributeValues)
|
||||
.returnValues(ReturnValue.ALL_NEW) // 업데이트 후의 값을 반환하려면 지정
|
||||
.build();
|
||||
|
||||
UpdateItemResponse updateResponse = dynamoDbClient.updateItem(updateRequest);
|
||||
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("data(before)", InfoJson);
|
||||
jsonObject.put("data(after)", updateResponse.attributes().get(DynamoDBConstants.ATTRIB_CALIUM).m().toString());
|
||||
return jsonObject.toString();
|
||||
}catch(Exception e){
|
||||
log.error("updateCaliumTotal Error occurred during update. Rolling back to original value: {}", e.getMessage());
|
||||
|
||||
String updateExpression = "SET " + DynamoDBConstants.ATTRIB_CALIUM + ".calium_operator_storage.operator_total_calium = :oldAttrib";
|
||||
|
||||
Map<String, AttributeValue> expressionAttributeValues = new HashMap<>();
|
||||
expressionAttributeValues.put(":oldAttrib",
|
||||
AttributeValue.builder().n(String.valueOf(currentTotal)).build()); // 여기서 20은 새로운 값입니다
|
||||
|
||||
UpdateItemRequest updateRequest = UpdateItemRequest.builder()
|
||||
.tableName(metaTable)
|
||||
.key(Map.of(
|
||||
"PK", AttributeValue.builder().s(DynamoDBConstants.PK_KEY_CALIUM).build(),
|
||||
"SK", AttributeValue.builder().s("empty").build()))
|
||||
.updateExpression(updateExpression)
|
||||
.expressionAttributeValues(expressionAttributeValues)
|
||||
.returnValues(ReturnValue.ALL_NEW) // 업데이트 후의 값을 반환하려면 지정
|
||||
.build();
|
||||
|
||||
try{
|
||||
UpdateItemResponse updateResponse = dynamoDbClient.updateItem(updateRequest);
|
||||
}catch(Exception rollbackError){
|
||||
log.error("updateCaliumTotal Failed to rollback: {}", rollbackError.getMessage());
|
||||
throw rollbackError;
|
||||
}
|
||||
throw e;
|
||||
}
|
||||
}catch(Exception e){
|
||||
log.error("updateCaliumTotal: {}", e.getMessage());
|
||||
throw new RestApiException(CommonCode.ERROR.getHttpStatus(), ErrorCode.DYNAMODB_CONNECTION_ERROR.getMessage() );
|
||||
}
|
||||
}
|
||||
|
||||
// public String insertLandAuction(LandRequest landRequest) {
|
||||
// try {
|
||||
// LocalDateTime nowDate = LocalDateTime.now();
|
||||
//
|
||||
// // LandAuctionRegistryAttrib 객체 생성
|
||||
// LandAuctionRegistryAttrib attrib = new LandAuctionRegistryAttrib();
|
||||
// attrib.setLandMetaId(landRequest.getLandId());
|
||||
// attrib.setAuctionNumber(landRequest.getAuctionSeq());
|
||||
// attrib.setAuctionReservationNoticeStartTime(CommonUtils.convertUTCDate(landRequest.getResvStartDt()));
|
||||
// attrib.setBidCurrencyType(landRequest.getCurrencyType());
|
||||
// attrib.setAuctionStartTime(CommonUtils.convertUTCDate(landRequest.getAuctionStartDt()));
|
||||
// attrib.setAuctionEndTime(CommonUtils.convertUTCDate(landRequest.getAuctionEndDt()));
|
||||
// attrib.setBidStartPrice(landRequest.getStartPrice());
|
||||
// attrib.setIsCancelAuction(CommonConstants.FALSE);
|
||||
// attrib.setAuctionState(CommonConstants.NONE);
|
||||
// attrib.setAuctionResult(CommonConstants.NONE);
|
||||
// attrib.setRegisteredVersionTime(CommonUtils.convertUTCDate(nowDate));
|
||||
// attrib.setProcessVersionTime(DynamoDBConstants.MIN_DATE);
|
||||
//
|
||||
// // LandAuctionRegistry 객체 생성
|
||||
// LandAuctionRegistryDoc registry = new LandAuctionRegistryDoc();
|
||||
// registry.setPK(DynamoDBConstants.PK_KEY_LANDAUCTION);
|
||||
// registry.setSK(String.format("%s#%s", landRequest.getLandId(), landRequest.getAuctionSeq()));
|
||||
// registry.setDocType(DynamoDBConstants.DOC_LANDAUCTION);
|
||||
// registry.setAttribValue(attrib);
|
||||
// registry.setCreatedDateTime(CommonUtils.convertUTCDate(nowDate));
|
||||
// registry.setUpdatedDateTime(CommonUtils.convertUTCDate(nowDate));
|
||||
// registry.setDeletedDateTime(DynamoDBConstants.MIN_DATE);
|
||||
// registry.setRestoredDateTime(DynamoDBConstants.MIN_DATE);
|
||||
//
|
||||
// TableSchema<LandAuctionRegistryDoc> schema = TableSchema.fromBean(LandAuctionRegistryDoc.class);
|
||||
//
|
||||
// DynamoDbTable<LandAuctionRegistryDoc> table = enhancedClient.table(metaTable, schema);
|
||||
//
|
||||
// table.putItem(registry);
|
||||
//
|
||||
// return registry.toString();
|
||||
//
|
||||
// } catch (DynamoDbException e) {
|
||||
// log.error("insertLandAuction Failed to insert new item: {}", e.getMessage());
|
||||
// throw new RestApiException(CommonCode.ERROR.getHttpStatus(),
|
||||
// ErrorCode.DYNAMODB_INSERT_ERROR.getMessage());
|
||||
// } catch (Exception e) {
|
||||
// log.error("insertLandAuction Error: {}", e.getMessage());
|
||||
// throw new RestApiException(CommonCode.ERROR.getHttpStatus(),
|
||||
// ErrorCode.DYNAMODB_CONNECTION_ERROR.getMessage());
|
||||
// }
|
||||
// }
|
||||
|
||||
@DynamoDBTransaction
|
||||
public JSONObject insertLandAuctionRegistryWithActivity(LandRequest landRequest) {
|
||||
String registry_result = insertLandAuction(landRequest);
|
||||
String activity_result = upsertLandAuctionActive(landRequest);
|
||||
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("land_auction_registry_result", registry_result);
|
||||
jsonObject.put("land_auction_active_result", activity_result);
|
||||
return jsonObject;
|
||||
}
|
||||
|
||||
public String insertLandAuction(LandRequest landRequest) {
|
||||
LocalDateTime nowDate = LocalDateTime.now();
|
||||
|
||||
// LandAuctionRegistryAttrib 객체 생성
|
||||
LandAuctionRegistryAttrib attrib = new LandAuctionRegistryAttrib();
|
||||
attrib.setLandMetaId(landRequest.getLandId());
|
||||
attrib.setAuctionNumber(landRequest.getAuctionSeq());
|
||||
attrib.setAuctionReservationNoticeStartTime(CommonUtils.convertUTCDate(landRequest.getResvStartDt()));
|
||||
attrib.setBidCurrencyType(landRequest.getCurrencyType());
|
||||
attrib.setAuctionStartTime(CommonUtils.convertUTCDate(landRequest.getAuctionStartDt()));
|
||||
attrib.setAuctionEndTime(CommonUtils.convertUTCDate(landRequest.getAuctionEndDt()));
|
||||
attrib.setBidStartPrice(landRequest.getStartPrice());
|
||||
attrib.setIsCancelAuction(CommonConstants.FALSE);
|
||||
attrib.setAuctionState(CommonConstants.NONE);
|
||||
attrib.setAuctionResult(CommonConstants.NONE);
|
||||
attrib.setRegisteredVersionTime(CommonUtils.convertUTCDate(nowDate));
|
||||
attrib.setProcessVersionTime(DynamoDBConstants.MIN_DATE);
|
||||
|
||||
// LandAuctionRegistry 객체 생성
|
||||
LandAuctionRegistryDoc registry = new LandAuctionRegistryDoc();
|
||||
registry.setPK(DynamoDBConstants.PK_KEY_LAND_AUCTION);
|
||||
registry.setSK(String.format("%s#%s", landRequest.getLandId(), landRequest.getAuctionSeq()));
|
||||
registry.setDocType(DynamoDBConstants.DOC_LANDAUCTION);
|
||||
registry.setAttribValue(attrib);
|
||||
registry.setCreatedDateTime(CommonUtils.convertUTCDate(nowDate));
|
||||
registry.setUpdatedDateTime(CommonUtils.convertUTCDate(nowDate));
|
||||
registry.setDeletedDateTime(DynamoDBConstants.MIN_DATE);
|
||||
registry.setRestoredDateTime(DynamoDBConstants.MIN_DATE);
|
||||
|
||||
DynamoDBOperations.addPutItem(registry, LandAuctionRegistryDoc.class);
|
||||
|
||||
return registry.toString();
|
||||
}
|
||||
|
||||
public String updateLandAuction(LandRequest landRequest) {
|
||||
try {
|
||||
TableSchema<LandAuctionRegistryDoc> schema = TableSchema.fromBean(LandAuctionRegistryDoc.class);
|
||||
|
||||
DynamoDbTable<LandAuctionRegistryDoc> table = enhancedClient.table(metaTable, schema);
|
||||
|
||||
Key key = Key.builder()
|
||||
.partitionValue(DynamoDBConstants.PK_KEY_LAND_AUCTION)
|
||||
.sortValue(String.format("%s#%s", landRequest.getLandId(), landRequest.getAuctionSeq()))
|
||||
.build();
|
||||
|
||||
LandAuctionRegistryDoc existingRegistry = table.getItem(key);
|
||||
if (existingRegistry == null) {
|
||||
throw new RestApiException(CommonCode.ERROR.getHttpStatus(),
|
||||
ErrorCode.DYNAMODB_CONNECTION_ERROR.getMessage());
|
||||
}
|
||||
|
||||
LandAuctionRegistryAttrib before = existingRegistry.getAttribValue();
|
||||
|
||||
// JSON을 객체로 변환하여 업데이트
|
||||
LandAuctionRegistryAttrib attrib = before;
|
||||
attrib.setAuctionReservationNoticeStartTime(CommonUtils.convertUTCDate(landRequest.getResvStartDt()));
|
||||
attrib.setAuctionStartTime(CommonUtils.convertUTCDate(landRequest.getAuctionStartDt()));
|
||||
attrib.setAuctionEndTime(CommonUtils.convertUTCDate(landRequest.getAuctionEndDt()));
|
||||
attrib.setBidStartPrice(landRequest.getStartPrice());
|
||||
attrib.setRegisteredVersionTime(CommonUtils.convertUTCDate(LocalDateTime.now()));
|
||||
|
||||
// Registry 업데이트
|
||||
existingRegistry.setAttribValue(attrib);
|
||||
existingRegistry.setUpdatedDateTime(CommonUtils.convertUTCDate(LocalDateTime.now()));
|
||||
|
||||
table.updateItem(existingRegistry);
|
||||
|
||||
JSONObject response = new JSONObject();
|
||||
response.put("data(before)", mapper.writeValueAsString(before));
|
||||
response.put("data(after)", mapper.writeValueAsString(attrib));
|
||||
return response.toString();
|
||||
|
||||
} catch (DynamoDbException e) {
|
||||
log.error("updateLandAuction Failed to update existing item: {}", e.getMessage());
|
||||
throw new RestApiException(CommonCode.ERROR.getHttpStatus(),
|
||||
ErrorCode.DYNAMODB_UPDATE_ERROR.getMessage());
|
||||
} catch (Exception e) {
|
||||
log.error("updateLandAuction Error: {}", e.getMessage());
|
||||
throw new RestApiException(CommonCode.ERROR.getHttpStatus(),
|
||||
ErrorCode.DYNAMODB_CONNECTION_ERROR.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public String cancelLandAuction(LandAuction auctionInfo) {
|
||||
try {
|
||||
TableSchema<LandAuctionRegistryDoc> schema = TableSchema.fromBean(LandAuctionRegistryDoc.class);
|
||||
|
||||
DynamoDbTable<LandAuctionRegistryDoc> table = enhancedClient.table(metaTable, schema);
|
||||
|
||||
Key key = Key.builder()
|
||||
.partitionValue(DynamoDBConstants.PK_KEY_LAND_AUCTION)
|
||||
.sortValue(String.format("%s#%s", auctionInfo.getLandId(), auctionInfo.getAuctionSeq()))
|
||||
.build();
|
||||
|
||||
LandAuctionRegistryDoc existingRegistry = table.getItem(key);
|
||||
if (existingRegistry == null) {
|
||||
throw new RestApiException(CommonCode.ERROR.getHttpStatus(),
|
||||
ErrorCode.DYNAMODB_CONNECTION_ERROR.getMessage());
|
||||
}
|
||||
|
||||
LandAuctionRegistryAttrib before = existingRegistry.getAttribValue();
|
||||
|
||||
// JSON을 객체로 변환하여 업데이트
|
||||
LandAuctionRegistryAttrib attrib = before;
|
||||
attrib.setIsCancelAuction(CommonConstants.TRUE);
|
||||
attrib.setAuctionResult(ELandAuctionResult.CANCELED.getName());
|
||||
attrib.setRegisteredVersionTime(CommonUtils.convertUTCDate(LocalDateTime.now()));
|
||||
|
||||
// Registry 업데이트
|
||||
existingRegistry.setAttribValue(attrib);
|
||||
existingRegistry.setUpdatedDateTime(CommonUtils.convertUTCDate(LocalDateTime.now()));
|
||||
|
||||
table.updateItem(existingRegistry);
|
||||
|
||||
JSONObject response = new JSONObject();
|
||||
response.put("data(before)", mapper.writeValueAsString(before));
|
||||
response.put("data(after)", mapper.writeValueAsString(attrib));
|
||||
return response.toString();
|
||||
|
||||
} catch (DynamoDbException e) {
|
||||
log.error("cancelLandAuction Failed to update existing item: {}", e.getMessage());
|
||||
throw new RestApiException(CommonCode.ERROR.getHttpStatus(),
|
||||
ErrorCode.DYNAMODB_UPDATE_ERROR.getMessage());
|
||||
} catch (Exception e) {
|
||||
log.error("cancelLandAuction Error: {}", e.getMessage());
|
||||
throw new RestApiException(CommonCode.ERROR.getHttpStatus(),
|
||||
ErrorCode.DYNAMODB_CONNECTION_ERROR.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public String upsertLandAuctionActive(LandRequest landRequest){
|
||||
Key key = Key.builder()
|
||||
.partitionValue(DynamoDBConstants.PK_KEY_LAND_AUCTION_ACTIVE)
|
||||
.sortValue(landRequest.getLandId().toString())
|
||||
.build();
|
||||
|
||||
LandAuctionActivityDoc item = DynamoDBOperations.getItem(key, LandAuctionActivityDoc.class);
|
||||
|
||||
String resultJson;
|
||||
|
||||
if (item == null) {
|
||||
resultJson = insertLandAuctionActive(landRequest);
|
||||
}else{
|
||||
resultJson = updateLandAuctionActive(landRequest, item);
|
||||
}
|
||||
|
||||
return resultJson;
|
||||
}
|
||||
|
||||
public String insertLandAuctionActive(LandRequest landRequest){
|
||||
LocalDateTime nowDate = LocalDateTime.now();
|
||||
|
||||
LandAuctionActivityAttrib attrib = new LandAuctionActivityAttrib();
|
||||
attrib.setLandMetaId(landRequest.getLandId());
|
||||
attrib.setAuctionNumber(landRequest.getAuctionSeq());
|
||||
|
||||
LandAuctionActivityDoc activityDoc = new LandAuctionActivityDoc();
|
||||
activityDoc.setPK(DynamoDBConstants.PK_KEY_LAND_AUCTION_ACTIVE);
|
||||
activityDoc.setSK(landRequest.getLandId().toString());
|
||||
activityDoc.setDocType(DynamoDBConstants.DOC_LANDAUCTION_ACTIVE);
|
||||
activityDoc.setAttribValue(attrib);
|
||||
activityDoc.setCreatedDateTime(CommonUtils.convertUTCDate(nowDate));
|
||||
activityDoc.setUpdatedDateTime(CommonUtils.convertUTCDate(nowDate));
|
||||
|
||||
DynamoDBOperations.addPutItem(activityDoc, LandAuctionActivityDoc.class);
|
||||
|
||||
try {
|
||||
return mapper.writeValueAsString(activityDoc.getAttribValue());
|
||||
}catch(JsonProcessingException e){
|
||||
log.error("insertLandAuctionActive JsonProcessingException: {}", e.getMessage());
|
||||
throw new RestApiException(CommonCode.ERROR.getHttpStatus(), ErrorCode.DYNAMODB_JSON_PARSE_ERROR.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public String updateLandAuctionActive(LandRequest landRequest, LandAuctionActivityDoc existingDoc){
|
||||
LandAuctionActivityAttrib attrib = existingDoc.getAttribValue();
|
||||
attrib.setAuctionNumber(landRequest.getAuctionSeq());
|
||||
|
||||
existingDoc.setAttribValue(attrib);
|
||||
existingDoc.setUpdatedDateTime(CommonUtils.convertUTCDate(LocalDateTime.now()));
|
||||
|
||||
DynamoDBOperations.addUpdateItem(existingDoc, LandAuctionActivityDoc.class);
|
||||
|
||||
try {
|
||||
return mapper.writeValueAsString(existingDoc.getAttribValue());
|
||||
}catch(JsonProcessingException e){
|
||||
log.error("updateLandAuctionActive JsonProcessingException: {}", e.getMessage());
|
||||
throw new RestApiException(CommonCode.ERROR.getHttpStatus(), ErrorCode.DYNAMODB_JSON_PARSE_ERROR.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
// public String insertLandAuctionActive(LandRequest landRequest) {
|
||||
// try {
|
||||
// TableSchema<LandAuctionActivityDoc> schema = TableSchema.fromBean(LandAuctionActivityDoc.class);
|
||||
//
|
||||
// DynamoDbTable<LandAuctionActivityDoc> table = enhancedClient.table(metaTable, schema);
|
||||
// LocalDateTime nowDate = LocalDateTime.now();
|
||||
//
|
||||
// Key key = Key.builder()
|
||||
// .partitionValue(DynamoDBConstants.PK_KEY_LANDAUCTION_ACTIVE)
|
||||
// .sortValue(landRequest.getLandId().toString())
|
||||
// .build();
|
||||
//
|
||||
// LandAuctionActivityDoc activity = table.getItem(key);
|
||||
// String resultJson;
|
||||
//
|
||||
// if (activity == null) {
|
||||
// // 새로운 데이터 생성
|
||||
// LandAuctionActivityAttrib attrib = new LandAuctionActivityAttrib();
|
||||
// attrib.setLandMetaId(landRequest.getLandId());
|
||||
// attrib.setAuctionNumber(landRequest.getAuctionSeq());
|
||||
//
|
||||
// activity = new LandAuctionActivityDoc();
|
||||
// activity.setPK(DynamoDBConstants.PK_KEY_LANDAUCTION_ACTIVE);
|
||||
// activity.setSK(landRequest.getLandId().toString());
|
||||
// activity.setDocType(DynamoDBConstants.DOC_LANDAUCTION_ACTIVE);
|
||||
// activity.setAttribValue(attrib);
|
||||
// activity.setCreatedDateTime(CommonUtils.convertUTCDate(nowDate));
|
||||
// activity.setUpdatedDateTime(CommonUtils.convertUTCDate(nowDate));
|
||||
//// activity.setDeletedDateTime(DynamoDBConstants.MIN_DATE);
|
||||
//// activity.setRestoredDateTime(DynamoDBConstants.MIN_DATE);
|
||||
//
|
||||
// table.putItem(activity);
|
||||
// resultJson = mapper.writeValueAsString(attrib);
|
||||
//
|
||||
// } else {
|
||||
// // 기존 데이터 업데이트
|
||||
// LandAuctionActivityAttrib attrib = activity.getAttribValue();
|
||||
// attrib.setAuctionNumber(landRequest.getAuctionSeq());
|
||||
//
|
||||
// activity.setAttribValue(attrib);
|
||||
// activity.setUpdatedDateTime(CommonUtils.convertUTCDate(nowDate));
|
||||
//
|
||||
// table.updateItem(activity);
|
||||
// resultJson = mapper.writeValueAsString(attrib);
|
||||
// }
|
||||
//
|
||||
// return resultJson;
|
||||
//
|
||||
// } catch (DynamoDbException e) {
|
||||
// log.error("insertLandAuctionActive DB operation failed: {}", e.getMessage());
|
||||
// throw new RestApiException(CommonCode.ERROR.getHttpStatus(),
|
||||
// ErrorCode.DYNAMODB_INSERT_ERROR.getMessage());
|
||||
// } catch (Exception e) {
|
||||
// log.error("insertLandAuctionActive Fail: {}", e.getMessage());
|
||||
// throw new RestApiException(CommonCode.ERROR.getHttpStatus(),
|
||||
// ErrorCode.DYNAMODB_CONNECTION_ERROR.getMessage());
|
||||
// }
|
||||
// }
|
||||
|
||||
public LandAuctionRegistryAttrib getLandAuctionRegistry(Integer land_id, Integer auction_seq){
|
||||
try {
|
||||
DynamoDbTable<LandAuctionRegistryDoc> table = enhancedClient.table(metaTable,
|
||||
TableSchema.fromBean(LandAuctionRegistryDoc.class));
|
||||
|
||||
Key key = Key.builder()
|
||||
.partitionValue(DynamoDBConstants.PK_KEY_LAND_AUCTION)
|
||||
.sortValue(String.format("%s#%s", land_id, auction_seq))
|
||||
.build();
|
||||
|
||||
LandAuctionRegistryDoc registry = table.getItem(key);
|
||||
if (registry == null) {
|
||||
throw new RestApiException(CommonCode.ERROR.getHttpStatus(), ErrorCode.DYNAMODB_CONNECTION_ERROR.getMessage());
|
||||
}
|
||||
|
||||
return registry.getAttribValue();
|
||||
}catch (Exception e){
|
||||
log.error("getLandAuctionRegistry: {}", e.getMessage());
|
||||
throw new RestApiException(CommonCode.ERROR.getHttpStatus(), ErrorCode.DYNAMODB_CONNECTION_ERROR.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
public LandAuctionHighestBidUserAttrib getLandAuctionHighestUser(Integer land_id, Integer auction_seq){
|
||||
try {
|
||||
DynamoDbTable<LandAuctionHighestBidUserDoc> table = enhancedClient.table(metaTable,
|
||||
TableSchema.fromBean(LandAuctionHighestBidUserDoc.class));
|
||||
|
||||
Key key = Key.builder()
|
||||
.partitionValue(DynamoDBConstants.PK_KEY_LAND_AUCTION_HIGHEST_USER)
|
||||
.sortValue(String.format("%s#%s", land_id, auction_seq))
|
||||
.build();
|
||||
|
||||
LandAuctionHighestBidUserDoc highestBidUser = table.getItem(key);
|
||||
if (highestBidUser == null) {
|
||||
throw new RestApiException(CommonCode.ERROR.getHttpStatus(), ErrorCode.DYNAMODB_CONNECTION_ERROR.getMessage());
|
||||
}
|
||||
|
||||
return highestBidUser.getAttribValue();
|
||||
}catch (Exception e){
|
||||
log.error("getLandAuctionHighestUser: {}", e.getMessage());
|
||||
throw new RestApiException(CommonCode.ERROR.getHttpStatus(), ErrorCode.DYNAMODB_CONNECTION_ERROR.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -358,23 +358,6 @@ public class EventService {
|
||||
.build();
|
||||
}
|
||||
|
||||
public void insertSystemMail(Event event, ArrayNode mailTitleArray, ArrayNode mailTextArray, ArrayNode mailSenderArray, ArrayNode mailItemArray){
|
||||
String dynamoResult = dynamoDBService.insertSystemMail(
|
||||
event.getId().intValue(),
|
||||
mailTitleArray,
|
||||
mailTextArray,
|
||||
mailSenderArray,
|
||||
event.getStartDt(),
|
||||
event.getEndDt(),
|
||||
mailItemArray
|
||||
);
|
||||
|
||||
eventMapper.updateAddFlag(event.getId());
|
||||
|
||||
historyService.setScheduleLog(HISTORYTYPE.EVENT_ADD, dynamoResult);
|
||||
log.info("insertSystemMail Save Complete: {}", dynamoResult);
|
||||
}
|
||||
|
||||
@Transactional(transactionManager = "transactionManager")
|
||||
public void insertSystemMail(Event event){
|
||||
try {
|
||||
|
||||
@@ -62,7 +62,7 @@ public class ItemsService {
|
||||
var itemCount = itemDeleteRequest.getItemCount();
|
||||
|
||||
//UserKick
|
||||
userGameSessionService.kickUserSession(userGuid);
|
||||
userGameSessionService.kickUserSession(userGuid, "item delete");
|
||||
//ItemDelete
|
||||
dynamoDBQueryServiceBase.deleteUserItem(userGuid, itemGuid);
|
||||
|
||||
|
||||
@@ -3,20 +3,28 @@ package com.caliverse.admin.domain.service;
|
||||
import com.caliverse.admin.domain.dao.admin.LandMapper;
|
||||
import com.caliverse.admin.domain.datacomponent.MetaDataHandler;
|
||||
import com.caliverse.admin.domain.entity.*;
|
||||
import com.caliverse.admin.dynamodb.domain.atrrib.LandAttrib;
|
||||
import com.caliverse.admin.dynamodb.domain.atrrib.LandAuctionHighestBidUserAttrib;
|
||||
import com.caliverse.admin.dynamodb.domain.atrrib.LandAuctionRegistryAttrib;
|
||||
import com.caliverse.admin.domain.entity.metadata.MetaBuildingData;
|
||||
import com.caliverse.admin.domain.entity.metadata.MetaLandData;
|
||||
import com.caliverse.admin.domain.request.LandRequest;
|
||||
import com.caliverse.admin.domain.response.LandResponse;
|
||||
import com.caliverse.admin.dynamodb.entity.ELandAuctionResult;
|
||||
import com.caliverse.admin.dynamodb.entity.ELandAuctionState;
|
||||
import com.caliverse.admin.dynamodb.service.DynamodbLandAuctionService;
|
||||
import com.caliverse.admin.dynamodb.service.DynamodbLandService;
|
||||
import com.caliverse.admin.dynamodb.service.DynamodbService;
|
||||
import com.caliverse.admin.dynamodb.service.DynamodbUserService;
|
||||
import com.caliverse.admin.global.common.code.CommonCode;
|
||||
import com.caliverse.admin.global.common.code.ErrorCode;
|
||||
import com.caliverse.admin.global.common.code.SuccessCode;
|
||||
import com.caliverse.admin.global.common.constants.CommonConstants;
|
||||
import com.caliverse.admin.global.common.constants.MysqlConstants;
|
||||
import com.caliverse.admin.global.common.utils.CommonUtils;
|
||||
import com.caliverse.admin.global.common.utils.DateUtils;
|
||||
import com.caliverse.admin.history.service.MysqlHistoryLogService;
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
@@ -26,11 +34,13 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
|
||||
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;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
@@ -39,14 +49,216 @@ public class LandService {
|
||||
// private final DynamoDBService dynamoDBService;
|
||||
private final DynamodbLandAuctionService dynamodbLandAuctionService;
|
||||
private final DynamodbLandService dynamodbLandService;
|
||||
private final DynamodbUserService dynamodbUserService;
|
||||
|
||||
private final LandMapper landMapper;
|
||||
private final MetaDataHandler metaDataHandler;
|
||||
private final HistoryService historyService;
|
||||
private final ObjectMapper objectMapper;
|
||||
private final MysqlHistoryLogService mysqlHistoryLogService;
|
||||
private final DynamodbService dynamodbService;
|
||||
|
||||
// 랜드 정보 조회
|
||||
public LandResponse getLandInfo(@RequestParam Map<String, String> requestParam){
|
||||
String searchType = requestParam.getOrDefault("land_type", "ID");
|
||||
String searchData = requestParam.getOrDefault("land_data", "");
|
||||
String landSize = requestParam.getOrDefault("land_size", "ALL");
|
||||
String category = requestParam.getOrDefault("category", "ALL");
|
||||
String status = requestParam.getOrDefault("status", "ALL");
|
||||
String startDt = requestParam.getOrDefault("start_dt", "");
|
||||
String endDt = requestParam.getOrDefault("end_dt", "");
|
||||
int page = Integer.parseInt(requestParam.getOrDefault("page_no", "1"));
|
||||
int size = Integer.parseInt(requestParam.getOrDefault("page_size", "50"));
|
||||
String orderBy = requestParam.getOrDefault("orderby", "DESC");
|
||||
|
||||
List<MetaLandData> landData = metaDataHandler.getMetaLandListData();
|
||||
List<MetaBuildingData> buildingData = metaDataHandler.getMetaBuildingListData();
|
||||
List<LandAuction> auctions = landMapper.getLandAuctionList(new HashMap());
|
||||
|
||||
List<LandInfo> list = landData.stream()
|
||||
//필터 전처리(map 처리속도를 최대한 빠르게하기 위해서 먼저 필터 처리할수 있는건 한다)
|
||||
.filter(info -> {
|
||||
boolean result = true;
|
||||
|
||||
if (!searchData.isEmpty()) {
|
||||
if (searchType.equals("ID")) {
|
||||
String landIdStr = String.valueOf(info.getLandId());
|
||||
result = landIdStr.contains(searchData);
|
||||
} else if (searchType.equals("NAME")) {
|
||||
String landName = metaDataHandler.getTextStringData(info.getLandName());
|
||||
result = landName.contains(searchData);
|
||||
}
|
||||
}
|
||||
|
||||
if (!landSize.equals("ALL")) {
|
||||
result = info.getLandSize().contains(landSize);
|
||||
}
|
||||
|
||||
return result;
|
||||
})
|
||||
.map(data -> buildLandInfo(data, buildingData, auctions)).filter(Objects::nonNull)
|
||||
.filter(info -> {
|
||||
boolean result = true;
|
||||
|
||||
if (!status.equals("ALL")) {
|
||||
result = info.getStatus().contains(status);
|
||||
}
|
||||
|
||||
if (!category.equals("ALL")) {
|
||||
result = info.getCategory().contains(category);
|
||||
}
|
||||
|
||||
String createDate = info.getOwnerUserCreateDate();
|
||||
if (!startDt.isEmpty() && !endDt.isEmpty()) {
|
||||
if (createDate.isEmpty()) {
|
||||
result = false;
|
||||
} else {
|
||||
LocalDateTime start_dt = stringISOToLocalDateTime(startDt);
|
||||
LocalDateTime end_dt = stringISOToLocalDateTime(endDt);
|
||||
LocalDateTime date = DateUtils.stringToLocalDateTime(createDate);
|
||||
result = (date.isEqual(start_dt) || date.isAfter(start_dt)) &&
|
||||
(date.isEqual(end_dt) || date.isBefore(end_dt));
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
})
|
||||
.sorted(orderBy.equals("ASC") ?
|
||||
Comparator.comparing(LandInfo::getLandId).reversed() :
|
||||
Comparator.comparing(LandInfo::getLandId))
|
||||
.toList();
|
||||
|
||||
// 페이징 처리
|
||||
int totalItems = list.size();
|
||||
int totalPages = (int) Math.ceil((double) totalItems / size);
|
||||
page = (totalItems > 0 && page > totalPages) ? totalPages : page;
|
||||
|
||||
List<LandInfo> pagedList = (totalItems == 0) ?
|
||||
new ArrayList<>() :
|
||||
list.subList((page - 1) * size, Math.min((page - 1) * size + size, totalItems));
|
||||
|
||||
return LandResponse.builder()
|
||||
.resultData(LandResponse.ResultData.builder()
|
||||
.landInfoList(pagedList)
|
||||
.total(pagedList.size())
|
||||
.totalAll(totalItems)
|
||||
.pageNo(requestParam.get("page_no") != null ?
|
||||
Integer.parseInt(requestParam.get("page_no")) : 1)
|
||||
.build())
|
||||
.status(CommonCode.SUCCESS.getHttpStatus())
|
||||
.result(CommonCode.SUCCESS.getResult())
|
||||
.build();
|
||||
}
|
||||
|
||||
private LandInfo buildLandInfo(MetaLandData data, List<MetaBuildingData> buildingData, List<LandAuction> auctions){
|
||||
try {
|
||||
int landId = data.getLandId();
|
||||
String editor = data.getEditor();
|
||||
boolean nonAction = data.isNonAuction();
|
||||
|
||||
String ownerGuid = "";
|
||||
String ownerName = "";
|
||||
String ownerDate = "";
|
||||
double ownerPrice = 0;
|
||||
String category = "";
|
||||
String status = LandInfo.LAND_STATUS.NONE.toString();
|
||||
|
||||
List<LandOwnerChange> ownerChanges = new ArrayList<>();
|
||||
|
||||
if(editor.equals(CommonConstants.USER)){
|
||||
//경매 체크
|
||||
int auctionNumber = dynamodbLandAuctionService.getLandAuctionNumber(landId);
|
||||
if(auctionNumber > 0){
|
||||
LandAuctionRegistryAttrib auctionRegistry = dynamodbLandAuctionService.getLandAuctionRegistry(landId, auctionNumber);
|
||||
String auctionState = auctionRegistry.getAuctionState();
|
||||
if (auctionState.equals(ELandAuctionState.STARTED.getName())) {
|
||||
status = LandInfo.LAND_STATUS.AUCTION_RUNNING.toString();
|
||||
} else if (auctionState.equals(ELandAuctionState.ENDED.getName())) {
|
||||
String auctionResult = auctionRegistry.getAuctionResult();
|
||||
if (auctionResult.equals(ELandAuctionResult.SUCCESSED.getName())) {
|
||||
LandAuctionHighestBidUserAttrib bidUser = dynamodbLandAuctionService.getLandAuctionHighestUser(landId, auctionNumber);
|
||||
status = LandInfo.LAND_STATUS.AUCTION_END.toString();
|
||||
if (bidUser != null) {
|
||||
ownerPrice = bidUser.getHighestBidPrice();
|
||||
} else {
|
||||
log.warn("LandAuction land: {}, auction_number: {} Ended Result Success bidUser null", landId, auctionNumber);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
status = LandInfo.LAND_STATUS.AUCTION_WAIT.toString();
|
||||
}
|
||||
}
|
||||
|
||||
//랜드 존재
|
||||
LandAttrib land = dynamodbLandService.getLandInfo(landId);
|
||||
if(land != null){
|
||||
ownerGuid = land.getOwnerUserGuid();
|
||||
//소유 체크
|
||||
if(!ownerGuid.isEmpty()){
|
||||
String parsedDate = dynamodbLandService.getLandOwnerCreateDate(ownerGuid, landId);
|
||||
ownerDate = parsedDate.isEmpty() ? "" : convertIsoByDatetime(parsedDate);
|
||||
ownerName = dynamodbUserService.getGuidByName(ownerGuid);
|
||||
if(status.equals(LandInfo.LAND_STATUS.NONE.toString())){
|
||||
status = LandInfo.LAND_STATUS.OWNED.toString();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//변경 이력
|
||||
ownerChanges = landMapper.getLandOwnerChangeInfo(landId);
|
||||
if(!ownerChanges.isEmpty()){
|
||||
long changesCount = ownerChanges.stream().filter(changeData -> changeData.getStatus().equals(LandOwnerChange.CHANGE_STATUS.WAIT)).count();
|
||||
if(changesCount > 0){
|
||||
status = LandInfo.LAND_STATUS.OWNED_WAIT.toString();
|
||||
}
|
||||
}
|
||||
}else{
|
||||
ownerName = CommonConstants.CALIVERSE_NAME;
|
||||
}
|
||||
|
||||
if(editor.equals(CommonConstants.CALIVERSE_CODE)){
|
||||
category = CommonConstants.LAND_PUBLIC;
|
||||
}else{
|
||||
if(nonAction){
|
||||
category = CommonConstants.LAND_EVENT;
|
||||
}else{
|
||||
category = CommonConstants.LAND_AUCTION;
|
||||
}
|
||||
}
|
||||
|
||||
boolean isOwned = editor.equals(CommonConstants.USER) && nonAction && ownerGuid.isEmpty();
|
||||
|
||||
MetaBuildingData buildingInfo = buildingData.stream()
|
||||
.filter(building -> building.getBuildingId().equals(data.getBuildingId()))
|
||||
.findFirst().get();
|
||||
|
||||
return LandInfo.builder()
|
||||
.id((long) landId)
|
||||
.landId(landId)
|
||||
.landName(metaDataHandler.getTextStringData(data.getLandName()))
|
||||
.landDesc(metaDataHandler.getTextStringData(data.getLandDesc()))
|
||||
.buildingId(data.getBuildingId())
|
||||
.buildingName(metaDataHandler.getTextStringData(buildingInfo.getBuildingName()))
|
||||
.nonAuction(nonAction)
|
||||
.editor(editor)
|
||||
.status(status)
|
||||
.isOwned(isOwned)
|
||||
.category(category)
|
||||
.landSize(data.getLandSize())
|
||||
.landType(data.getLandType())
|
||||
.socket(buildingInfo.getInstanceSocket())
|
||||
.ownerUserGuid(ownerGuid)
|
||||
.ownerUserNickname(ownerName)
|
||||
.ownerUserCreateDate(ownerDate)
|
||||
.ownerPrice(String.valueOf(ownerPrice))
|
||||
.ownerChanges(ownerChanges)
|
||||
.build();
|
||||
}catch(Exception e){
|
||||
log.error("buildLandInfo", e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
// 랜드 메타데이터 정보 조회
|
||||
public LandResponse getLandList(){
|
||||
List<MetaLandData> landData = metaDataHandler.getMetaLandListData();
|
||||
List<LandResponse.Land> landList = landData.stream()
|
||||
@@ -62,7 +274,9 @@ public class LandService {
|
||||
.type(data.getLandType())
|
||||
.buildingId(data.getBuildingId())
|
||||
.build()
|
||||
).toList();
|
||||
)
|
||||
.sorted(Comparator.comparing(LandResponse.Land::getId))
|
||||
.toList();
|
||||
|
||||
return LandResponse.builder()
|
||||
.resultData(LandResponse.ResultData.builder()
|
||||
@@ -188,17 +402,17 @@ public class LandService {
|
||||
map.put("id",String.valueOf(auction_id));
|
||||
|
||||
//메시지 저장
|
||||
if(landRequest.getMassageList()!= null && !landRequest.getMassageList().isEmpty()){
|
||||
landRequest.getMassageList().forEach(
|
||||
item -> {
|
||||
map.put("title",item.getTitle());
|
||||
map.put("content",item.getContent());
|
||||
map.put("language",item.getLanguage());
|
||||
landMapper.insertMessage(map);
|
||||
}
|
||||
);
|
||||
}
|
||||
log.info("AdminToolDB Message Save Complete");
|
||||
// if(landRequest.getMassageList()!= null && !landRequest.getMassageList().isEmpty()){
|
||||
// landRequest.getMassageList().forEach(
|
||||
// item -> {
|
||||
// map.put("title",item.getTitle());
|
||||
// map.put("content",item.getContent());
|
||||
// map.put("language",item.getLanguage());
|
||||
// landMapper.insertMessage(map);
|
||||
// }
|
||||
// );
|
||||
// }
|
||||
// log.info("AdminToolDB Message Save Complete");
|
||||
|
||||
LandAuction auction_info = landMapper.getLandAuctionDetail(auction_id);
|
||||
auction_info.setMessageList(landMapper.getMessage(auction_id));
|
||||
@@ -214,22 +428,79 @@ public class LandService {
|
||||
|
||||
dynamodbLandAuctionService.insertLandAuctionRegistryWithActivity(landRequest);
|
||||
|
||||
//로그 기록
|
||||
try{
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("land_id", landRequest.getLandId());
|
||||
jsonObject.put("auction_seq", landRequest.getAuctionSeq());
|
||||
jsonObject.put("start_price", landRequest.getStartPrice());
|
||||
jsonObject.put("recv_start_dt", landRequest.getResvStartDt());
|
||||
jsonObject.put("recv_end_dt", landRequest.getResvEndDt());
|
||||
jsonObject.put("auction_start_dt", landRequest.getAuctionStartDt());
|
||||
jsonObject.put("auction_end_dt", landRequest.getAuctionEndDt());
|
||||
jsonObject.put("message_list", map);
|
||||
historyService.setLog(HISTORYTYPE.LAND_AUCTION_ADD, jsonObject);
|
||||
}catch(Exception e){
|
||||
log.error("history log Save Fail: {}", e.getMessage());
|
||||
return LandResponse.builder()
|
||||
.status(CommonCode.SUCCESS.getHttpStatus())
|
||||
.result(CommonCode.SUCCESS.getResult())
|
||||
.resultData(LandResponse.ResultData.builder()
|
||||
.message(SuccessCode.SAVE.getMessage())
|
||||
.build())
|
||||
.build();
|
||||
}
|
||||
|
||||
@Transactional(transactionManager = "transactionManager")
|
||||
public LandResponse postLandOwnerChanges(LandRequest landRequest){
|
||||
String guid = landRequest.getUserGuid();
|
||||
String nickname = dynamodbUserService.getGuidByName(guid);
|
||||
int landId = landRequest.getLandId();
|
||||
if(nickname.isEmpty() || !nickname.equals(landRequest.getUserName())){
|
||||
return LandResponse.builder()
|
||||
.status(CommonCode.ERROR.getHttpStatus())
|
||||
.result(ErrorCode.GUID_CHECK.toString())
|
||||
.build();
|
||||
}
|
||||
|
||||
int chk = landMapper.getPossibleLandOwnerChanges(landId);
|
||||
if(chk > 0){
|
||||
return LandResponse.builder()
|
||||
.status(CommonCode.ERROR.getHttpStatus())
|
||||
.result(ErrorCode.ERROR_LAND_OWNER_CHANGES_DUPLICATION.toString())
|
||||
.build();
|
||||
}
|
||||
|
||||
LandAttrib landInfo = dynamodbLandService.getLandInfo(landId);
|
||||
if(landInfo != null && !landInfo.getOwnerUserGuid().isEmpty()){
|
||||
return LandResponse.builder()
|
||||
.status(CommonCode.ERROR.getHttpStatus())
|
||||
.result(ErrorCode.ERROR_LAND_OWNER_DUPLICATION.toString())
|
||||
.build();
|
||||
}
|
||||
|
||||
landRequest.setCreateBy(CommonUtils.getAdmin().getId());
|
||||
boolean is_reserve = landRequest.isReserve();
|
||||
if(!is_reserve){
|
||||
landRequest.setReservationDt(LocalDateTime.now());
|
||||
}
|
||||
|
||||
int result = landMapper.postLandOwnerChange(landRequest);
|
||||
try {
|
||||
log.info("AdminToolDB LandOwnerChanges Save: {}", objectMapper.writeValueAsString(landRequest));
|
||||
} catch (JsonProcessingException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
long id = landRequest.getId();
|
||||
|
||||
HashMap<String,Object> map = new HashMap<>();
|
||||
map.put("id",String.valueOf(id));
|
||||
|
||||
LandOwnerChange info = landMapper.getLandOwnerChangeDetail(id);
|
||||
|
||||
mysqlHistoryLogService.insertHistoryLog(
|
||||
HISTORYTYPE.LAND_OWNER_CHANGE_ADD,
|
||||
MysqlConstants.TABLE_NAME_LAND_OWNER_CHANGE,
|
||||
HISTORYTYPE.LAND_OWNER_CHANGE_ADD.name(),
|
||||
info,
|
||||
CommonUtils.getAdmin().getEmail(),
|
||||
CommonUtils.getClientIp()
|
||||
);
|
||||
|
||||
// if(!is_reserve){
|
||||
// dynamodbLandService.ChangesLandOwner(landRequest);
|
||||
// map.put("status", LandOwnerChange.CHANGE_STATUS.FINISH);
|
||||
// updateLandOwnedChangeStatus(map);
|
||||
// dynamodbService.insertLandChangesMail(landRequest);
|
||||
// }
|
||||
|
||||
return LandResponse.builder()
|
||||
.status(CommonCode.SUCCESS.getHttpStatus())
|
||||
.result(CommonCode.SUCCESS.getResult())
|
||||
@@ -246,7 +517,7 @@ public class LandService {
|
||||
landRequest.setUpdateDt(LocalDateTime.now());
|
||||
|
||||
LandAuction before_info = landMapper.getLandAuctionDetail(id);
|
||||
before_info.setMessageList(landMapper.getMessage(id));
|
||||
// before_info.setMessageList(landMapper.getMessage(id));
|
||||
|
||||
if(!before_info.getStatus().equals(LandAuction.AUCTION_STATUS.WAIT) && !before_info.getStatus().equals(LandAuction.AUCTION_STATUS.RESV_START)){
|
||||
return LandResponse.builder()
|
||||
@@ -262,19 +533,19 @@ public class LandService {
|
||||
map.put("id", String.valueOf(id));
|
||||
|
||||
// message 테이블 데이터 삭제 처리 by mail_id
|
||||
landMapper.deleteMessage(map);
|
||||
|
||||
// 메시지 업데이트
|
||||
if (landRequest.getMassageList() != null && !landRequest.getMassageList().isEmpty()) {
|
||||
landRequest.getMassageList().forEach(item -> {
|
||||
map.put("title", item.getTitle());
|
||||
map.put("content", item.getContent());
|
||||
map.put("language", item.getLanguage());
|
||||
|
||||
landMapper.insertMessage(map);
|
||||
});
|
||||
}
|
||||
log.info("AdminToolDB Message Update Complete");
|
||||
// landMapper.deleteMessage(map);
|
||||
//
|
||||
// // 메시지 업데이트
|
||||
// if (landRequest.getMassageList() != null && !landRequest.getMassageList().isEmpty()) {
|
||||
// landRequest.getMassageList().forEach(item -> {
|
||||
// map.put("title", item.getTitle());
|
||||
// map.put("content", item.getContent());
|
||||
// map.put("language", item.getLanguage());
|
||||
//
|
||||
// landMapper.insertMessage(map);
|
||||
// });
|
||||
// }
|
||||
// log.info("AdminToolDB Message Update Complete");
|
||||
|
||||
LandAuction after_info = landMapper.getLandAuctionDetail(id);
|
||||
after_info.setMessageList(landMapper.getMessage(id));
|
||||
@@ -291,16 +562,42 @@ public class LandService {
|
||||
|
||||
dynamodbLandAuctionService.updateLandAuction(landRequest);
|
||||
|
||||
//로그 기록
|
||||
try{
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("before_info",before_info.toString());
|
||||
jsonObject.put("after_info",after_info.toString());
|
||||
// jsonObject.put("dynamoDB_result",land_auction_registry_result);
|
||||
historyService.setLog(HISTORYTYPE.LAND_AUCTION_UPDATE, jsonObject);
|
||||
}catch(Exception e){
|
||||
log.error("history log Save Fail: {}", e.getMessage());
|
||||
}
|
||||
|
||||
return LandResponse.builder()
|
||||
.resultData(LandResponse.ResultData.builder()
|
||||
.build())
|
||||
.status(CommonCode.SUCCESS.getHttpStatus())
|
||||
.result(CommonCode.SUCCESS.getResult())
|
||||
.build();
|
||||
}
|
||||
|
||||
@Transactional(transactionManager = "transactionManager")
|
||||
public LandResponse updateLandOwnerChanges(Long id, LandRequest landRequest) {
|
||||
landRequest.setId(id);
|
||||
landRequest.setUpdateBy(CommonUtils.getAdmin().getId());
|
||||
landRequest.setUpdateDt(LocalDateTime.now());
|
||||
|
||||
Map<String, String> map = new HashMap<>();
|
||||
map.put("id", String.valueOf(id));
|
||||
|
||||
LandOwnerChange before_info = landMapper.getLandOwnerChangeDetail(id);
|
||||
|
||||
int result = landMapper.updateLandOwnerChange(landRequest);
|
||||
log.info("AdminToolDB LandOwnerChanges Update Complete: {}", landRequest);
|
||||
|
||||
LandOwnerChange after_info = landMapper.getLandOwnerChangeDetail(id);
|
||||
|
||||
mysqlHistoryLogService.updateHistoryLog(
|
||||
HISTORYTYPE.LAND_OWNER_CHANGE_UPDATE,
|
||||
MysqlConstants.TABLE_NAME_LAND_OWNER_CHANGE,
|
||||
HISTORYTYPE.LAND_OWNER_CHANGE_UPDATE.name(),
|
||||
before_info,
|
||||
after_info,
|
||||
CommonUtils.getAdmin().getEmail(),
|
||||
CommonUtils.getClientIp()
|
||||
);
|
||||
|
||||
dynamodbLandService.ChangesLandOwner(landRequest);
|
||||
|
||||
return LandResponse.builder()
|
||||
.resultData(LandResponse.ResultData.builder()
|
||||
@@ -370,10 +667,58 @@ public class LandService {
|
||||
.build();
|
||||
}
|
||||
|
||||
@Transactional(transactionManager = "transactionManager")
|
||||
public LandResponse deleteLandOwnerChanges(LandRequest landRequest){
|
||||
Long id = landRequest.getId();
|
||||
LandOwnerChange info = landMapper.getLandOwnerChangeDetail(id);
|
||||
|
||||
//예약상태가 아니면 취소할 수 없다
|
||||
if(!info.getStatus().equals(LandOwnerChange.CHANGE_STATUS.WAIT)){
|
||||
return LandResponse.builder()
|
||||
.status(CommonCode.ERROR.getHttpStatus())
|
||||
.result(ErrorCode.ERROR_LAND_OWNER_CHANGES_RESERVATION.toString())
|
||||
.build();
|
||||
}
|
||||
|
||||
Map<String,Object> map = new HashMap<>();
|
||||
map.put("id", id);
|
||||
map.put("updateBy", CommonUtils.getAdmin().getId());
|
||||
int result = landMapper.deleteLandOwnerChanges(map);
|
||||
log.info("LandOwnerChanges Delete Complete: {}", landRequest);
|
||||
|
||||
mysqlHistoryLogService.deleteHistoryLog(
|
||||
HISTORYTYPE.LAND_OWNER_CHANGE_DELETE,
|
||||
MysqlConstants.TABLE_NAME_LAND_OWNER_CHANGE,
|
||||
HISTORYTYPE.LAND_OWNER_CHANGE_DELETE.name(),
|
||||
info,
|
||||
CommonUtils.getAdmin().getEmail(),
|
||||
CommonUtils.getClientIp()
|
||||
);
|
||||
|
||||
return LandResponse.builder()
|
||||
.resultData(LandResponse.ResultData.builder()
|
||||
.build())
|
||||
.status(CommonCode.SUCCESS.getHttpStatus())
|
||||
.result(CommonCode.SUCCESS.getResult())
|
||||
.build();
|
||||
}
|
||||
|
||||
public List<LandAuction> getScheduleLandAuctionList(){
|
||||
return landMapper.getScheduleLandAuctionList();
|
||||
}
|
||||
|
||||
public List<LandOwnerChange> getScheduleLandOwnerChangesList(){
|
||||
return landMapper.getScheduleLandOwnedChangeList();
|
||||
}
|
||||
|
||||
public List<LandAuction> getAllLandAuctionList(){
|
||||
return landMapper.getAllLandAuction();
|
||||
}
|
||||
|
||||
public List<LandOwnerChange> getAllLandOwnerChangesList(){
|
||||
return landMapper.getAllLandOwnedChanges();
|
||||
}
|
||||
|
||||
public LandAuctionRegistryAttrib getLandAuctionRegistryAttrib(Integer land_id, Integer auction_seq){
|
||||
return dynamodbLandAuctionService.getLandAuctionRegistry(land_id, auction_seq);
|
||||
}
|
||||
@@ -391,4 +736,14 @@ public class LandService {
|
||||
log.error("updateLandAuction LandAuction Update Fail map: {}", map);
|
||||
}
|
||||
}
|
||||
|
||||
@Transactional(transactionManager = "transactionManager")
|
||||
public void updateLandOwnedChangeStatus(Map<String,Object> map){
|
||||
try{
|
||||
landMapper.updateStatusLandOwnedChange(map);
|
||||
log.info("updateLandOwnedChangeStatus LandOwned status changed: {}", map.get("status"));
|
||||
}catch(Exception e){
|
||||
log.error("updateLandOwnedChangeStatus LandOwned Update Fail map: {}", map);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,91 @@
|
||||
package com.caliverse.admin.domain.service;
|
||||
|
||||
import com.caliverse.admin.Indicators.Indicatorsservice.aggregationservice.*;
|
||||
import com.caliverse.admin.Indicators.entity.*;
|
||||
import com.caliverse.admin.domain.entity.Currencys;
|
||||
import com.caliverse.admin.domain.entity.LandInfo;
|
||||
import com.caliverse.admin.domain.entity.ROUTE;
|
||||
import com.caliverse.admin.domain.request.LogGenericRequest;
|
||||
import com.caliverse.admin.domain.response.IndicatorsResponse;
|
||||
import com.caliverse.admin.domain.response.LandResponse;
|
||||
import com.caliverse.admin.domain.response.LogResponse;
|
||||
import com.caliverse.admin.global.common.code.CommonCode;
|
||||
import com.caliverse.admin.global.common.code.ErrorCode;
|
||||
import com.caliverse.admin.global.common.exception.RestApiException;
|
||||
import com.caliverse.admin.global.common.utils.CommonUtils;
|
||||
import com.caliverse.admin.global.common.utils.ExcelUtils;
|
||||
import com.caliverse.admin.logs.Indicatordomain.GenericMongoLog;
|
||||
import com.caliverse.admin.logs.logservice.businesslogservice.BusinessLogGenericService;
|
||||
import com.caliverse.admin.logs.logservice.indicators.IndicatorsDauService;
|
||||
import com.caliverse.admin.logs.logservice.indicators.IndicatorsMcuService;
|
||||
import com.caliverse.admin.logs.logservice.indicators.IndicatorsNruService;
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.mongodb.MongoCommandException;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.data.mongodb.UncategorizedMongoDbException;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
public class LogService {
|
||||
|
||||
private final BusinessLogGenericService businessLogGenericService;
|
||||
|
||||
public LogResponse genericLogList(LogGenericRequest logGenericRequest){
|
||||
int page = logGenericRequest.getPageNo();
|
||||
int size = logGenericRequest.getPageSize();
|
||||
|
||||
LocalDateTime startDt = logGenericRequest.getStartDt().plusHours(9);
|
||||
LocalDateTime endDt = logGenericRequest.getEndDt().plusHours(9).plusDays(1);
|
||||
|
||||
logGenericRequest.setStartDt(startDt);
|
||||
logGenericRequest.setEndDt(endDt);
|
||||
|
||||
// List<Map<String, Object>> logList = businessLogGenericService.loadBusinessLogData(logGenericRequest);
|
||||
List<GenericMongoLog> logList = new ArrayList<>();
|
||||
try{
|
||||
logList = businessLogGenericService.loadBusinessLogData(logGenericRequest, GenericMongoLog.class);
|
||||
}catch(UncategorizedMongoDbException e){
|
||||
if (e.getMessage().contains("Sort exceeded memory limit")) {
|
||||
log.error("MongoDB Query memory limit error: {}", e.getMessage());
|
||||
return LogResponse.builder()
|
||||
.status(CommonCode.ERROR.getHttpStatus())
|
||||
.result(ErrorCode.ERROR_LOG_MEMORY_LIMIT.toString())
|
||||
.build();
|
||||
} else {
|
||||
log.error("MongoDB Query error", e);
|
||||
return LogResponse.builder()
|
||||
.status(CommonCode.ERROR.getHttpStatus())
|
||||
.result(ErrorCode.ERROR_MONGODB_QUERY.toString())
|
||||
.build();
|
||||
}
|
||||
}catch (Exception e){
|
||||
log.error("businessLog error", e);
|
||||
}
|
||||
|
||||
int totalItems = logList.size();
|
||||
|
||||
return LogResponse.builder()
|
||||
.resultData(LogResponse.ResultData.builder()
|
||||
.genericList(logList)
|
||||
.total(totalItems)
|
||||
.totalAll(totalItems)
|
||||
.pageNo(logGenericRequest.getPageNo() != null ?
|
||||
page : 1)
|
||||
.build())
|
||||
.status(CommonCode.SUCCESS.getHttpStatus())
|
||||
.result(CommonCode.SUCCESS.getResult())
|
||||
.build();
|
||||
|
||||
}
|
||||
}
|
||||
@@ -30,10 +30,7 @@ import org.springframework.core.io.ResourceLoader;
|
||||
import java.net.MalformedURLException;
|
||||
import java.nio.file.Path;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
|
||||
@Slf4j
|
||||
@Service
|
||||
|
||||
@@ -26,15 +26,20 @@ public class UserGameSessionService {
|
||||
this.messageHandlerService = messageHandlerService;
|
||||
}
|
||||
|
||||
public boolean userSession(String userGuid){
|
||||
var loginSession = redisUserInfoService.getUserLoginSessionInfo(userGuid);
|
||||
|
||||
public void kickUserSession(String userGuid){
|
||||
return loginSession != null;
|
||||
}
|
||||
|
||||
public void kickUserSession(String userGuid, String reason){
|
||||
|
||||
var loginSession = redisUserInfoService.getUserLoginSessionInfo(userGuid);
|
||||
|
||||
//게임이 접속중 이면 kick 하고 2초 대기
|
||||
if(null != loginSession ){
|
||||
var serverName = loginSession.getCurrentServer();
|
||||
messageHandlerService.sendUserKickMessage(userGuid, serverName);
|
||||
messageHandlerService.sendUserKickMessage(userGuid, serverName, reason);
|
||||
|
||||
//여기서 2초 정도 대기(게임 메모리 정리를 위해)
|
||||
try{
|
||||
|
||||
@@ -4,16 +4,25 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
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.request.MailRequest;
|
||||
import com.caliverse.admin.dynamodb.domain.atrrib.MailAttrib;
|
||||
import com.caliverse.admin.dynamodb.domain.atrrib.MailJsonAttrib;
|
||||
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.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;
|
||||
@@ -34,6 +43,7 @@ public class UsersService {
|
||||
private static final Logger logger = LoggerFactory.getLogger(UsersService.class);
|
||||
|
||||
private final DynamoDBService dynamoDBService;
|
||||
private final DynamodbService dynamodbService;
|
||||
private final HistoryService historyService;
|
||||
private final UserGameSessionService userGameSessionService;
|
||||
private final RedisUserInfoService redisUserInfoService;
|
||||
@@ -41,6 +51,9 @@ public class UsersService {
|
||||
//metadataHandler 어떻게 가져와야 되는가
|
||||
@Autowired
|
||||
private MetaDataHandler metaDataHandler;
|
||||
@Qualifier("objectMapper")
|
||||
@Autowired
|
||||
private ObjectMapper objectMapper;
|
||||
|
||||
// 닉네임 변경
|
||||
public UsersResponse changeNickname(UsersRequest usersRequest){
|
||||
@@ -89,6 +102,23 @@ public class UsersService {
|
||||
|
||||
}
|
||||
|
||||
// 유저 킥
|
||||
public UsersResponse userKick(UsersRequest usersRequest){
|
||||
String guid = usersRequest.getGuid();
|
||||
String adminUser = CommonUtils.getAdmin().getEmail();
|
||||
|
||||
userGameSessionService.kickUserSession(guid, String.format("admin %s kick out", adminUser));
|
||||
|
||||
return UsersResponse.builder()
|
||||
.resultData(UsersResponse.ResultData.builder()
|
||||
.message(SuccessCode.SUCCESS.getMessage())
|
||||
.build())
|
||||
.status(CommonCode.SUCCESS.getHttpStatus())
|
||||
.result(CommonCode.SUCCESS.getResult())
|
||||
.build();
|
||||
|
||||
}
|
||||
|
||||
// 유정 정보 조회 닉네임,GUID,Account ID
|
||||
public UsersResponse findUsers(Map requestParam){
|
||||
|
||||
@@ -105,6 +135,7 @@ public class UsersService {
|
||||
.result(CommonCode.SUCCESS.getResult())
|
||||
.build();
|
||||
}
|
||||
|
||||
public UsersResponse getBasicInfo(String guid){
|
||||
|
||||
String account_id = dynamoDBService.getGuidByAccountId(guid);
|
||||
@@ -114,12 +145,14 @@ public class UsersService {
|
||||
// charInfo
|
||||
Map<String, Object> charInfo = dynamoDBService.getCharInfo(guid);
|
||||
|
||||
boolean userSession = userGameSessionService.userSession(guid);
|
||||
|
||||
return UsersResponse.builder()
|
||||
.resultData(
|
||||
UsersResponse.ResultData.builder()
|
||||
.charInfo((UsersResponse.CharInfo) charInfo.get("charInfo"))
|
||||
.userInfo((UsersResponse.UserInfo) userInfo.get("userInfo"))
|
||||
.userSession(userSession)
|
||||
.build()
|
||||
)
|
||||
.status(CommonCode.SUCCESS.getHttpStatus())
|
||||
@@ -227,7 +260,7 @@ public class UsersService {
|
||||
int current_cnt = Integer.parseInt(requestParams.get("current_cnt"));
|
||||
int update_cnt = Integer.parseInt(requestParams.get("cnt"));
|
||||
|
||||
userGameSessionService.kickUserSession(guid);
|
||||
userGameSessionService.kickUserSession(guid, "Item delete");
|
||||
if(update_cnt >= current_cnt){
|
||||
String attrib = dynamoDBService.deleteItem(guid, item_guid);
|
||||
if(!attrib.isEmpty()){
|
||||
@@ -258,13 +291,81 @@ public class UsersService {
|
||||
}
|
||||
}
|
||||
|
||||
public UsersResponse getMail(String guid, String type){
|
||||
public UsersResponse getMail(UsersRequest usersRequest){
|
||||
// List<UsersResponse.Mail> mailList = dynamoDBService.getMail(guid, type);
|
||||
PageResult<MailDoc> mailPageResult = dynamodbService.getMail(usersRequest.getMailType(), usersRequest.getGuid(), "", "", "", usersRequest.getPageKey(), false);
|
||||
List<UsersResponse.Mail> mailList = new ArrayList<>();
|
||||
|
||||
List<UsersResponse.Mail> mailList = dynamoDBService.getMail(guid, type);;
|
||||
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.getItemList().forEach(item -> {
|
||||
UsersResponse.MailItem mailItem = new UsersResponse.MailItem();
|
||||
mailItem.setItemId(CommonUtils.objectToString(item.getItemId()));
|
||||
mailItem.setCount(item.getCount());
|
||||
String item_nm = metaDataHandler.getMetaItemNameData(item.getItemId());
|
||||
mailItem.setItemName(metaDataHandler.getTextStringData(item_nm));
|
||||
itemList.add(mailItem);
|
||||
});
|
||||
|
||||
UsersResponse.Mail mail = UsersResponse.Mail.builder()
|
||||
.mailGuid(mailJsonAttrib.getMailGuid())
|
||||
.title(mailJsonAttrib.getTitle())
|
||||
.content(mailJsonAttrib.getText())
|
||||
.senderNickname(mailJsonAttrib.getSenderNickName())
|
||||
.receiveNickname(mailJsonAttrib.getReceiverNickName())
|
||||
.status(mailJsonAttrib.isRead())
|
||||
.isSystemMail(mailJsonAttrib.isSystemMail())
|
||||
.isGetItem(mailJsonAttrib.isGetItem())
|
||||
.createDt(mailJsonAttrib.getCreateTime())
|
||||
.mailItemList(itemList)
|
||||
.build();
|
||||
mailList.add(mail);
|
||||
}else{
|
||||
attrib.getItemList().forEach(item -> {
|
||||
UsersResponse.MailItem mailItem = new UsersResponse.MailItem();
|
||||
mailItem.setItemId(CommonUtils.objectToString(item.getItemId()));
|
||||
mailItem.setCount(item.getCount());
|
||||
String item_nm = metaDataHandler.getMetaItemNameData(item.getItemId());
|
||||
mailItem.setItemName(metaDataHandler.getTextStringData(item_nm));
|
||||
itemList.add(mailItem);
|
||||
});
|
||||
|
||||
UsersResponse.Mail mail = UsersResponse.Mail.builder()
|
||||
.mailGuid(attrib.getMailGuid())
|
||||
.title(attrib.getTitle())
|
||||
.content(attrib.getText())
|
||||
.senderNickname(attrib.getSenderNickName())
|
||||
.receiveNickname(attrib.getReceiverNickName())
|
||||
.status(Boolean.parseBoolean(attrib.getIsRead()))
|
||||
.isSystemMail(Boolean.parseBoolean(attrib.getIsSystemMail()))
|
||||
.isGetItem(Boolean.parseBoolean(attrib.getIsGetItem()))
|
||||
.createDt(attrib.getCreateTime())
|
||||
.mailItemList(itemList)
|
||||
.build();
|
||||
mailList.add(mail);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage());
|
||||
return;
|
||||
}
|
||||
});
|
||||
return UsersResponse.builder()
|
||||
.resultData(
|
||||
UsersResponse.ResultData.builder()
|
||||
.mailList(mailList)
|
||||
.pageKey(mailPageResult.getLastEvaluatedKey() == null ?
|
||||
null :
|
||||
mailPageResult.getLastEvaluatedKey().entrySet().stream()
|
||||
.collect(Collectors.toMap(
|
||||
Map.Entry::getKey,
|
||||
entry -> entry.getValue().s()
|
||||
))
|
||||
)
|
||||
.build()
|
||||
)
|
||||
.status(CommonCode.SUCCESS.getHttpStatus())
|
||||
@@ -278,7 +379,7 @@ public class UsersService {
|
||||
String mail_guid = requestParams.get("mail_guid");
|
||||
String type = requestParams.get("type");
|
||||
|
||||
userGameSessionService.kickUserSession(guid);
|
||||
userGameSessionService.kickUserSession(guid, "delete mail");
|
||||
String attrib = dynamoDBService.deleteMail(type, guid, mail_guid);
|
||||
if(!attrib.isEmpty()){
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
@@ -296,7 +397,7 @@ public class UsersService {
|
||||
}
|
||||
|
||||
public UsersResponse deleteMailItem(MailRequest.DeleteMailItem deleteMailItem){
|
||||
userGameSessionService.kickUserSession(deleteMailItem.getGuid());
|
||||
userGameSessionService.kickUserSession(deleteMailItem.getGuid(), "delete mail item");
|
||||
JSONObject json = dynamoDBService.updateMailItem(deleteMailItem.getType(), deleteMailItem.getGuid(),
|
||||
deleteMailItem.getMailGuid(), deleteMailItem.getItemId(), deleteMailItem.getParrentCount(), deleteMailItem.getCount());
|
||||
if(!json.isEmpty()){
|
||||
|
||||
@@ -28,9 +28,9 @@ public class BuildingAttrib extends DynamoDBAttribBase{
|
||||
@JsonProperty("owner_user_guid")
|
||||
private String ownerUserGuid;
|
||||
@JsonProperty("RentalCurrencyType")
|
||||
private String rentalCurrencyType;
|
||||
private Integer rentalCurrencyType;
|
||||
@JsonProperty("RentalCurrencyAmount")
|
||||
private Double rentalCurrencyAmount;
|
||||
@JsonProperty("IsRentalOpen")
|
||||
private String isRentalOpen;
|
||||
private boolean isRentalOpen;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.caliverse.admin.dynamodb.domain.atrrib;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.databind.PropertyNamingStrategies;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonNaming;
|
||||
@@ -11,8 +13,12 @@ import software.amazon.awssdk.enhanced.dynamodb.mapper.annotations.DynamoDbBean;
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class)
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public abstract class DynamoDBAttribBase {
|
||||
//객체일때는 사용안하고 Json으로 Attrib이 생성될때만 사용(상속 안받는걸로)
|
||||
@JsonProperty("attrib_type")
|
||||
private String attribType;
|
||||
|
||||
@JsonIgnore
|
||||
private transient boolean isSaveToJson = true;
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.caliverse.admin.dynamodb.domain.atrrib;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.databind.PropertyNamingStrategies;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonNaming;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
import software.amazon.awssdk.enhanced.dynamodb.mapper.annotations.DynamoDbAttribute;
|
||||
import software.amazon.awssdk.enhanced.dynamodb.mapper.annotations.DynamoDbBean;
|
||||
|
||||
@Setter
|
||||
@ToString(callSuper = true)
|
||||
@NoArgsConstructor
|
||||
@DynamoDbBean
|
||||
@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class)
|
||||
public class LandAuctionRecordAttrib {
|
||||
@JsonProperty("land_meta_id")
|
||||
private Integer landMetaId;
|
||||
|
||||
@JsonProperty("auction_number")
|
||||
private Integer auctionNumber;
|
||||
|
||||
@DynamoDbAttribute("land_meta_id")
|
||||
public Integer getLandMetaId() {
|
||||
return landMetaId;
|
||||
}
|
||||
|
||||
@DynamoDbAttribute("auction_number")
|
||||
public Integer getAuctionNumber() {
|
||||
return auctionNumber;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
package com.caliverse.admin.dynamodb.domain.atrrib;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.databind.PropertyNamingStrategies;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonNaming;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
import software.amazon.awssdk.enhanced.dynamodb.mapper.annotations.DynamoDbAttribute;
|
||||
import software.amazon.awssdk.enhanced.dynamodb.mapper.annotations.DynamoDbBean;
|
||||
|
||||
@Setter
|
||||
@ToString(callSuper = true)
|
||||
@NoArgsConstructor
|
||||
@DynamoDbBean
|
||||
@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class)
|
||||
public class LandAuctionRefundBidPriceAttrib {
|
||||
@JsonProperty("land_meta_id")
|
||||
private Integer landMetaId;
|
||||
@JsonProperty("auction_number")
|
||||
private Integer auctionNumber;
|
||||
@JsonProperty("bid_user_guid")
|
||||
private String bidUserGuid;
|
||||
@JsonProperty("last_bid_type")
|
||||
private String lastBidType;
|
||||
@JsonProperty("bid_currency_type")
|
||||
private String bidCurrencyType;
|
||||
@JsonProperty("bid_price")
|
||||
private Double bidPrice;
|
||||
@JsonProperty("refundable_normal_bid_price")
|
||||
private Double refundableNormalBidPrice;
|
||||
@JsonProperty("refundable_blind_bid_price")
|
||||
private Double refundableBlindBidPrice;
|
||||
|
||||
@DynamoDbAttribute("land_meta_id")
|
||||
public Integer getLandMetaId() {
|
||||
return landMetaId;
|
||||
}
|
||||
|
||||
@DynamoDbAttribute("auction_number")
|
||||
public Integer getAuctionNumber() {
|
||||
return auctionNumber;
|
||||
}
|
||||
|
||||
@DynamoDbAttribute("bid_user_guid")
|
||||
public String getBidUserGuid() {
|
||||
return bidUserGuid;
|
||||
}
|
||||
|
||||
@DynamoDbAttribute("last_bid_type")
|
||||
public String getLastBidType() { return lastBidType; }
|
||||
|
||||
@DynamoDbAttribute("bid_currency_type")
|
||||
public String getBidCurrencyType() { return bidCurrencyType; }
|
||||
|
||||
@DynamoDbAttribute("bid_price")
|
||||
public Double getBidPrice() {
|
||||
return bidPrice;
|
||||
}
|
||||
|
||||
@DynamoDbAttribute("refundable_normal_bid_price")
|
||||
public Double getRefundableNormalBidPrice() {
|
||||
return refundableNormalBidPrice;
|
||||
}
|
||||
|
||||
@DynamoDbAttribute("refundable_blind_bid_price")
|
||||
public Double getRefundableBlindBidPrice() {
|
||||
return refundableBlindBidPrice;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,122 @@
|
||||
package com.caliverse.admin.dynamodb.domain.atrrib;
|
||||
|
||||
import com.caliverse.admin.dynamodb.entity.MailItem;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.databind.PropertyNamingStrategies;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonNaming;
|
||||
import lombok.*;
|
||||
import software.amazon.awssdk.enhanced.dynamodb.mapper.annotations.DynamoDbAttribute;
|
||||
import software.amazon.awssdk.enhanced.dynamodb.mapper.annotations.DynamoDbBean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Setter
|
||||
@ToString(callSuper = true)
|
||||
@NoArgsConstructor
|
||||
@DynamoDbBean
|
||||
@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class)
|
||||
public class MailAttrib{
|
||||
@JsonProperty("mail_guid")
|
||||
private String mailGuid;
|
||||
|
||||
@JsonProperty("is_read")
|
||||
private String isRead;
|
||||
@JsonProperty("is_get_item")
|
||||
private String isGetItem;
|
||||
@JsonProperty("is_system_mail")
|
||||
private String isSystemMail;
|
||||
|
||||
@JsonProperty("sender_nickname")
|
||||
private String senderNickName;
|
||||
@JsonProperty("sender_guid")
|
||||
private String senderGuid;
|
||||
@JsonProperty("receiver_nickname")
|
||||
private String receiverNickName;
|
||||
@JsonProperty("receiver_guid")
|
||||
private String receiverGuid;
|
||||
|
||||
private String title;
|
||||
private String text;
|
||||
|
||||
@JsonProperty("create_time")
|
||||
private String createTime;
|
||||
@JsonProperty("expire_time")
|
||||
private String expireTime;
|
||||
@JsonProperty("is_text_by_meta_data")
|
||||
private String isTextByMetaData;
|
||||
@JsonProperty("item_list")
|
||||
private List<MailItemAttrib> itemList;
|
||||
@JsonProperty("package_order_id")
|
||||
private String packageOrderId;
|
||||
@JsonProperty("contents_arguments")
|
||||
private List<String> contentsArguments;
|
||||
|
||||
@DynamoDbAttribute("mail_guid")
|
||||
public String getMailGuid() {
|
||||
return mailGuid;
|
||||
}
|
||||
|
||||
@DynamoDbAttribute("is_read")
|
||||
public String getIsRead() {
|
||||
return isRead;
|
||||
}
|
||||
|
||||
@DynamoDbAttribute("is_get_item")
|
||||
public String getIsGetItem() {
|
||||
return isGetItem;
|
||||
}
|
||||
|
||||
@DynamoDbAttribute("is_system_mail")
|
||||
public String getIsSystemMail() {
|
||||
return isSystemMail;
|
||||
}
|
||||
|
||||
@DynamoDbAttribute("sender_nickname")
|
||||
public String getSenderNickName() {
|
||||
return senderNickName;
|
||||
}
|
||||
@DynamoDbAttribute("sender_guid")
|
||||
public String getSenderGuid() {
|
||||
return senderGuid;
|
||||
}
|
||||
@DynamoDbAttribute("receiver_nickname")
|
||||
public String getReceiverNickName() {
|
||||
return receiverNickName;
|
||||
}
|
||||
@DynamoDbAttribute("receiver_guid")
|
||||
public String getReceiverGuid() {
|
||||
return receiverGuid;
|
||||
}
|
||||
@DynamoDbAttribute("title")
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
@DynamoDbAttribute("text")
|
||||
public String getText() {
|
||||
return text;
|
||||
}
|
||||
@DynamoDbAttribute("create_time")
|
||||
public String getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
@DynamoDbAttribute("expire_time")
|
||||
public String getExpireTime() {
|
||||
return expireTime;
|
||||
}
|
||||
@DynamoDbAttribute("is_text_by_meta_data")
|
||||
public String getIsTextByMetaData() {
|
||||
return isTextByMetaData;
|
||||
}
|
||||
@DynamoDbAttribute("item_list")
|
||||
public List<MailItemAttrib> getItemList() {
|
||||
return itemList;
|
||||
}
|
||||
@DynamoDbAttribute("package_order_id")
|
||||
public String getPackageOrderId() {
|
||||
return packageOrderId;
|
||||
}
|
||||
@DynamoDbAttribute("contents_arguments")
|
||||
public List<String> getContentsArguments() {
|
||||
return contentsArguments;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.caliverse.admin.dynamodb.domain.atrrib;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import software.amazon.awssdk.enhanced.dynamodb.mapper.annotations.DynamoDbAttribute;
|
||||
import software.amazon.awssdk.enhanced.dynamodb.mapper.annotations.DynamoDbBean;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@DynamoDbBean
|
||||
public class MailItemAttrib {
|
||||
@JsonProperty("ItemId")
|
||||
private Integer itemId;
|
||||
@JsonProperty("Count")
|
||||
private Double count;
|
||||
@JsonProperty("ProductId")
|
||||
private Integer productId;
|
||||
@JsonProperty("isRepeatProduct")
|
||||
private String isRepeatProduct;
|
||||
|
||||
@DynamoDbAttribute("ItemId")
|
||||
public Integer getItemId() {
|
||||
return itemId;
|
||||
}
|
||||
@DynamoDbAttribute("Count")
|
||||
public Double getCount() {
|
||||
return count;
|
||||
}
|
||||
@DynamoDbAttribute("ProductId")
|
||||
public Integer getProductId() {
|
||||
return productId;
|
||||
}
|
||||
@DynamoDbAttribute("bid_start_price")
|
||||
public String getBidStartPrice() {
|
||||
return isRepeatProduct;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
package com.caliverse.admin.dynamodb.domain.atrrib;
|
||||
|
||||
import com.caliverse.admin.dynamodb.entity.MailItem;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.databind.PropertyNamingStrategies;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonNaming;
|
||||
import lombok.*;
|
||||
import software.amazon.awssdk.enhanced.dynamodb.mapper.annotations.DynamoDbBean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString(callSuper = true)
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@NoArgsConstructor
|
||||
@DynamoDbBean
|
||||
@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class)
|
||||
public class MailJsonAttrib extends DynamoDBAttribBase{
|
||||
@JsonProperty("mail_guid")
|
||||
private String mailGuid;
|
||||
|
||||
@JsonProperty("is_read")
|
||||
private boolean isRead;
|
||||
@JsonProperty("is_get_item")
|
||||
private boolean isGetItem;
|
||||
@JsonProperty("is_system_mail")
|
||||
private boolean isSystemMail;
|
||||
|
||||
@JsonProperty("sender_nickname")
|
||||
private String senderNickName;
|
||||
@JsonProperty("sender_guid")
|
||||
private String senderGuid;
|
||||
@JsonProperty("receiver_nickname")
|
||||
private String receiverNickName;
|
||||
@JsonProperty("receiver_guid")
|
||||
private String receiverGuid;
|
||||
|
||||
private String title;
|
||||
private String text;
|
||||
|
||||
@JsonProperty("create_time")
|
||||
private String createTime;
|
||||
@JsonProperty("expire_time")
|
||||
private String expireTime;
|
||||
@JsonProperty("is_text_by_meta_data")
|
||||
private boolean isTextByMetaData;
|
||||
@JsonProperty("item_list")
|
||||
private List<MailItem> itemList;
|
||||
@JsonProperty("package_order_id")
|
||||
private String packageOrderId;
|
||||
@JsonProperty("contents_arguments")
|
||||
private List<String> contentsArguments;
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.caliverse.admin.dynamodb.domain.doc;
|
||||
|
||||
import com.caliverse.admin.dynamodb.domain.atrrib.LandAuctionRecordAttrib;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import software.amazon.awssdk.enhanced.dynamodb.mapper.annotations.DynamoDbAttribute;
|
||||
import software.amazon.awssdk.enhanced.dynamodb.mapper.annotations.DynamoDbBean;
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@NoArgsConstructor
|
||||
@DynamoDbBean
|
||||
public class LandAuctionRecordDoc extends DynamoDBDocBase {
|
||||
private LandAuctionRecordAttrib landAuctionRecordAttrib;
|
||||
|
||||
public String getAttribFieldName() {
|
||||
return "LandAuctionActivityAttrib";
|
||||
}
|
||||
|
||||
@DynamoDbAttribute("LandAuctionRecordAttrib")
|
||||
public LandAuctionRecordAttrib getAttribValue() {
|
||||
return landAuctionRecordAttrib;
|
||||
}
|
||||
|
||||
public void setAttribValue(LandAuctionRecordAttrib value) {
|
||||
this.landAuctionRecordAttrib = value;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.caliverse.admin.dynamodb.domain.doc;
|
||||
|
||||
import com.caliverse.admin.dynamodb.domain.atrrib.LandAuctionRefundBidPriceAttrib;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import software.amazon.awssdk.enhanced.dynamodb.mapper.annotations.DynamoDbAttribute;
|
||||
import software.amazon.awssdk.enhanced.dynamodb.mapper.annotations.DynamoDbBean;
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@NoArgsConstructor
|
||||
@DynamoDbBean
|
||||
public class LandAuctionRefundBidPriceDoc extends DynamoDBDocBase {
|
||||
private LandAuctionRefundBidPriceAttrib landAuctionRefundBidPriceAttrib;
|
||||
|
||||
public String getAttribFieldName() {
|
||||
return "LandAuctionRefundBidPriceAttrib";
|
||||
}
|
||||
|
||||
@DynamoDbAttribute("LandAuctionRefundBidPriceAttrib")
|
||||
@JsonProperty("LandAuctionRefundBidPriceAttrib")
|
||||
public LandAuctionRefundBidPriceAttrib getAttribValue() {
|
||||
return landAuctionRefundBidPriceAttrib;
|
||||
}
|
||||
|
||||
public void setAttribValue(LandAuctionRefundBidPriceAttrib value) {
|
||||
this.landAuctionRefundBidPriceAttrib = value;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.caliverse.admin.dynamodb.domain.doc;
|
||||
|
||||
import com.caliverse.admin.dynamodb.domain.atrrib.LandAttrib;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.caliverse.admin.dynamodb.domain.doc;
|
||||
|
||||
import com.caliverse.admin.dynamodb.domain.atrrib.MailAttrib;
|
||||
import com.caliverse.admin.global.common.constants.DynamoDBConstants;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import software.amazon.awssdk.enhanced.dynamodb.mapper.annotations.DynamoDbAttribute;
|
||||
import software.amazon.awssdk.enhanced.dynamodb.mapper.annotations.DynamoDbBean;
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@NoArgsConstructor
|
||||
@DynamoDbBean
|
||||
public class MailDoc extends DynamoDBDocBase {
|
||||
private MailAttrib mailAttrib;
|
||||
@Setter
|
||||
private long ttl;
|
||||
|
||||
public String getAttribFieldName() {
|
||||
return DynamoDBConstants.ATTRIB_MAIL;
|
||||
}
|
||||
|
||||
@DynamoDbAttribute(DynamoDBConstants.ATTRIB_MAIL)
|
||||
@JsonProperty(DynamoDBConstants.ATTRIB_MAIL)
|
||||
public MailAttrib getAttribValue() {
|
||||
return mailAttrib;
|
||||
}
|
||||
|
||||
@DynamoDbAttribute("TTL")
|
||||
@JsonProperty("TTL")
|
||||
public long getTtl() {
|
||||
return ttl;
|
||||
}
|
||||
|
||||
public void setAttribValue(MailAttrib value) {
|
||||
this.mailAttrib = value;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.caliverse.admin.dynamodb.domain.doc;
|
||||
|
||||
import com.caliverse.admin.global.common.constants.DynamoDBConstants;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
import software.amazon.awssdk.enhanced.dynamodb.mapper.annotations.DynamoDbAttribute;
|
||||
import software.amazon.awssdk.enhanced.dynamodb.mapper.annotations.DynamoDbBean;
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@NoArgsConstructor
|
||||
@DynamoDbBean
|
||||
public class MailJsonDoc extends DynamoDBDocBase {
|
||||
private String mailAttrib;
|
||||
@Setter
|
||||
private long ttl;
|
||||
|
||||
public String getAttribFieldName() {
|
||||
return DynamoDBConstants.ATTRIB_MAIL;
|
||||
}
|
||||
|
||||
@DynamoDbAttribute(DynamoDBConstants.ATTRIB_MAIL)
|
||||
@JsonProperty(DynamoDBConstants.ATTRIB_MAIL)
|
||||
public String getAttribValue() {
|
||||
return mailAttrib;
|
||||
}
|
||||
|
||||
@DynamoDbAttribute("TTL")
|
||||
@JsonProperty("TTL")
|
||||
public long getTtl() {
|
||||
return ttl;
|
||||
}
|
||||
|
||||
public void setAttribValue(String value) {
|
||||
this.mailAttrib = value;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.caliverse.admin.dynamodb.dto;
|
||||
|
||||
import software.amazon.awssdk.services.dynamodb.model.AttributeValue;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class PageResult<T> {
|
||||
private final List<T> items;
|
||||
private final Map<String, AttributeValue> lastEvaluatedKey;
|
||||
|
||||
public PageResult(List<T> items, Map<String, AttributeValue> lastEvaluatedKey) {
|
||||
this.items = items;
|
||||
this.lastEvaluatedKey = lastEvaluatedKey;
|
||||
}
|
||||
|
||||
public List<T> getItems() {
|
||||
return items;
|
||||
}
|
||||
|
||||
public Map<String, AttributeValue> getLastEvaluatedKey() {
|
||||
return lastEvaluatedKey;
|
||||
}
|
||||
|
||||
public boolean hasMorePages() {
|
||||
return lastEvaluatedKey != null && !lastEvaluatedKey.isEmpty();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.caliverse.admin.dynamodb.entity;
|
||||
|
||||
import com.caliverse.admin.dynamodb.domain.doc.DynamoDBDocBase;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
public class DynamodbOperationResult {
|
||||
private boolean success;
|
||||
private String message;
|
||||
private DynamoDBDocBase data;
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.caliverse.admin.dynamodb.entity;
|
||||
|
||||
|
||||
import com.caliverse.admin.domain.entity.common.ValueEnum;
|
||||
|
||||
public enum ECurrencyType implements ValueEnum {
|
||||
None(0),
|
||||
Gold(1),
|
||||
Sapphire(2),
|
||||
Calium(3),
|
||||
Beam(4),
|
||||
Ruby(5),
|
||||
;
|
||||
|
||||
private final int value;
|
||||
|
||||
ECurrencyType(int value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getValue() {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.caliverse.admin.dynamodb.entity;
|
||||
|
||||
|
||||
import com.caliverse.admin.domain.entity.common.ValueEnum;
|
||||
|
||||
public enum EOwnedType implements ValueEnum {
|
||||
None(0),
|
||||
Own(1),
|
||||
Rent(2),
|
||||
;
|
||||
|
||||
private final int value;
|
||||
|
||||
EOwnedType(int value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getValue() {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.caliverse.admin.dynamodb.entity;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class KeyParam {
|
||||
@JsonProperty("PK")
|
||||
private String pk;
|
||||
@JsonProperty("SK")
|
||||
private String sk;
|
||||
}
|
||||
@@ -1,17 +1,23 @@
|
||||
package com.caliverse.admin.dynamodb.entity;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import software.amazon.awssdk.enhanced.dynamodb.mapper.annotations.DynamoDbBean;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@DynamoDbBean
|
||||
public class MailItem {
|
||||
@JsonProperty("itemId")
|
||||
@JsonProperty("ItemId")
|
||||
private Integer itemId;
|
||||
@JsonProperty("count")
|
||||
@JsonProperty("Count")
|
||||
private Double count;
|
||||
@JsonProperty("productId")
|
||||
@JsonProperty("ProductId")
|
||||
private Integer productId;
|
||||
@JsonProperty("isRepeatProduct")
|
||||
private boolean isRepeatProduct;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.caliverse.admin.dynamodb.repository;
|
||||
|
||||
import com.caliverse.admin.dynamodb.dto.PageResult;
|
||||
import com.caliverse.admin.dynamodb.service.DynamoDBOperations;
|
||||
import com.caliverse.admin.global.common.code.CommonCode;
|
||||
import com.caliverse.admin.global.common.code.ErrorCode;
|
||||
@@ -10,8 +11,10 @@ import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import software.amazon.awssdk.enhanced.dynamodb.Expression;
|
||||
import software.amazon.awssdk.enhanced.dynamodb.Key;
|
||||
import software.amazon.awssdk.services.dynamodb.model.AttributeValue;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@RequiredArgsConstructor
|
||||
public abstract class BaseDynamoDBRepository<T> implements DynamoDBRepository<T> {
|
||||
@@ -57,7 +60,17 @@ public abstract class BaseDynamoDBRepository<T> implements DynamoDBRepository<T>
|
||||
|
||||
@Override
|
||||
public List<T> findAll(Key key) {
|
||||
return operations.getItems(key, entityClass);
|
||||
return operations.getQueryItems(key, entityClass);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<T> findAllScan(String prefix) {
|
||||
return operations.getItemsScanBegins(prefix, entityClass);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<T> findAllScan(String prefix, String sortKey) {
|
||||
return operations.getItemsScanBegins(prefix, sortKey, entityClass);
|
||||
}
|
||||
|
||||
protected <T> T deepCopy(T source, Class<T> valueType) {
|
||||
@@ -77,4 +90,25 @@ public abstract class BaseDynamoDBRepository<T> implements DynamoDBRepository<T>
|
||||
return operations.getItemsByPrefix(partitionKey, sortKeyPrefix, entityClass);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<T> findByPaging(
|
||||
String partitionKey,
|
||||
String sortKeyPrefix,
|
||||
String filterAttributeName,
|
||||
String filterAttributeValue,
|
||||
Map<String, AttributeValue> exclusiveStartKey,
|
||||
boolean scanIndexForward
|
||||
) {
|
||||
|
||||
return operations.queryItemsPaging(
|
||||
partitionKey,
|
||||
sortKeyPrefix,
|
||||
filterAttributeName,
|
||||
filterAttributeValue,
|
||||
exclusiveStartKey,
|
||||
scanIndexForward,
|
||||
entityClass
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,9 +3,12 @@ package com.caliverse.admin.dynamodb.repository;
|
||||
import com.caliverse.admin.domain.request.LandRequest;
|
||||
import com.caliverse.admin.dynamodb.domain.atrrib.BuildingAttrib;
|
||||
import com.caliverse.admin.dynamodb.domain.doc.BuildingDoc;
|
||||
import com.caliverse.admin.dynamodb.entity.DynamodbOperationResult;
|
||||
|
||||
public interface BuildingRepository extends DynamoDBRepository<BuildingDoc> {
|
||||
BuildingAttrib findBuildingAttrib(Integer buildingId);
|
||||
void insertBuilding(LandRequest landRequest);
|
||||
void updateBuilding(LandRequest landRequest);
|
||||
DynamodbOperationResult initBuildingOwner(int buildingId);
|
||||
DynamodbOperationResult initBuildingDesc(int buildingId);
|
||||
}
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
package com.caliverse.admin.dynamodb.repository;
|
||||
|
||||
import com.caliverse.admin.dynamodb.dto.PageResult;
|
||||
import software.amazon.awssdk.enhanced.dynamodb.Expression;
|
||||
import software.amazon.awssdk.enhanced.dynamodb.Key;
|
||||
import software.amazon.awssdk.services.dynamodb.model.AttributeValue;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface DynamoDBRepository<T> {
|
||||
void save(T item);
|
||||
@@ -14,5 +17,16 @@ public interface DynamoDBRepository<T> {
|
||||
void deleteWithCondition(Key key, Expression condition);
|
||||
T findById(Key key);
|
||||
List<T> findAll(Key key);
|
||||
List<T> findAllScan(String prefix);
|
||||
List<T> findAllScan(String prefix, String sortKey);
|
||||
List<T> findByPrefix(String partitionKey, String sortKeyPrefix);
|
||||
|
||||
PageResult<T> findByPaging(
|
||||
String partitionKey,
|
||||
String sortKeyPrefix,
|
||||
String filterAttributeName,
|
||||
String filterAttributeValue,
|
||||
Map<String, AttributeValue> exclusiveStartKey,
|
||||
boolean scanIndexForward
|
||||
);
|
||||
}
|
||||
|
||||
@@ -92,9 +92,7 @@ public class AccountBaseRepositoryImpl extends BaseDynamoDBRepository<AccountBas
|
||||
HISTORYTYPE.BLACKLIST_UPDATE,
|
||||
HISTORYTYPE.BLACKLIST_UPDATE.name(),
|
||||
beforeDoc,
|
||||
afterDoc,
|
||||
CommonConstants.SCHEDULE,
|
||||
""
|
||||
afterDoc
|
||||
);
|
||||
}
|
||||
}catch (Exception e){
|
||||
@@ -134,9 +132,7 @@ public class AccountBaseRepositoryImpl extends BaseDynamoDBRepository<AccountBas
|
||||
HISTORYTYPE.BLACKLIST_UPDATE,
|
||||
HISTORYTYPE.BLACKLIST_UPDATE.name(),
|
||||
beforeDoc,
|
||||
afterDoc,
|
||||
CommonConstants.SCHEDULE,
|
||||
""
|
||||
afterDoc
|
||||
);
|
||||
}
|
||||
}catch (Exception e){
|
||||
|
||||
@@ -119,9 +119,7 @@ public class BattleEventRepositoryImpl extends BaseDynamoDBRepository<BattleEven
|
||||
dynamodbHistoryLogService.insertHistoryLog(
|
||||
HISTORYTYPE.BATTLE_EVENT_ADD,
|
||||
HISTORYTYPE.BATTLE_EVENT_ADD.name(),
|
||||
doc,
|
||||
CommonUtils.getAdmin().getEmail(),
|
||||
CommonUtils.getClientIp()
|
||||
doc
|
||||
);
|
||||
}catch (Exception e){
|
||||
log.error("insert Error: {}", e.getMessage());
|
||||
@@ -167,9 +165,7 @@ public class BattleEventRepositoryImpl extends BaseDynamoDBRepository<BattleEven
|
||||
HISTORYTYPE.BATTLE_EVENT_UPDATE,
|
||||
HISTORYTYPE.BATTLE_EVENT_UPDATE.name(),
|
||||
beforeDoc,
|
||||
afterDoc,
|
||||
CommonUtils.getAdmin().getEmail(),
|
||||
CommonUtils.getClientIp()
|
||||
afterDoc
|
||||
);
|
||||
}
|
||||
}catch (Exception e){
|
||||
@@ -209,9 +205,7 @@ public class BattleEventRepositoryImpl extends BaseDynamoDBRepository<BattleEven
|
||||
HISTORYTYPE.BATTLE_EVENT_UPDATE,
|
||||
HISTORYTYPE.BATTLE_EVENT_UPDATE.name(),
|
||||
beforeDoc,
|
||||
afterDoc,
|
||||
CommonUtils.getAdmin().getEmail(),
|
||||
CommonUtils.getClientIp()
|
||||
afterDoc
|
||||
);
|
||||
}
|
||||
}catch (Exception e){
|
||||
|
||||
@@ -0,0 +1,222 @@
|
||||
package com.caliverse.admin.dynamodb.repository.Impl;
|
||||
|
||||
import com.caliverse.admin.domain.entity.HISTORYTYPE;
|
||||
import com.caliverse.admin.domain.request.LandRequest;
|
||||
import com.caliverse.admin.dynamodb.domain.atrrib.BuildingAttrib;
|
||||
import com.caliverse.admin.dynamodb.domain.doc.BuildingDoc;
|
||||
import com.caliverse.admin.dynamodb.entity.ECurrencyType;
|
||||
import com.caliverse.admin.dynamodb.entity.DynamodbOperationResult;
|
||||
import com.caliverse.admin.dynamodb.repository.BaseDynamoDBRepository;
|
||||
import com.caliverse.admin.dynamodb.repository.BuildingRepository;
|
||||
import com.caliverse.admin.dynamodb.service.DynamoDBOperations;
|
||||
import com.caliverse.admin.global.common.code.CommonCode;
|
||||
import com.caliverse.admin.global.common.code.ErrorCode;
|
||||
import com.caliverse.admin.global.common.constants.DynamoDBConstants;
|
||||
import com.caliverse.admin.global.common.exception.RestApiException;
|
||||
import com.caliverse.admin.global.common.utils.CommonUtils;
|
||||
import com.caliverse.admin.history.service.DynamodbHistoryLogService;
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
import software.amazon.awssdk.enhanced.dynamodb.Key;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static com.caliverse.admin.global.common.utils.CommonUtils.convertUTCDate;
|
||||
|
||||
@Component
|
||||
@Slf4j
|
||||
public class BuildingRepositoryImpl extends BaseDynamoDBRepository<BuildingDoc> implements BuildingRepository {
|
||||
public BuildingRepositoryImpl(DynamoDBOperations operations, DynamodbHistoryLogService dynamodbHistoryLogService, ObjectMapper objectMapper) {
|
||||
super(operations, BuildingDoc.class, dynamodbHistoryLogService, objectMapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BuildingAttrib findBuildingAttrib(Integer buildingId) {
|
||||
Key key = Key.builder()
|
||||
.partitionValue(DynamoDBConstants.PK_KEY_BUILDING + buildingId)
|
||||
.sortValue(DynamoDBConstants.EMPTY)
|
||||
.build();
|
||||
|
||||
BuildingDoc doc = findById(key);
|
||||
if (doc == null) return null;
|
||||
String attribJson = doc.getAttribValue();
|
||||
try {
|
||||
return objectMapper.readValue(attribJson, BuildingAttrib.class);
|
||||
} catch (JsonProcessingException e) {
|
||||
throw new RestApiException(CommonCode.ERROR.getHttpStatus(),
|
||||
ErrorCode.DYNAMODB_JSON_PARSE_ERROR.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void insertBuilding(LandRequest landRequest) {
|
||||
try {
|
||||
LocalDateTime nowDate = LocalDateTime.now();
|
||||
|
||||
int building_id = landRequest.getBuildingId();
|
||||
String guid = landRequest.getUserGuid();
|
||||
|
||||
String pk = DynamoDBConstants.PK_KEY_BUILDING + building_id;
|
||||
|
||||
BuildingAttrib attrib = new BuildingAttrib();
|
||||
attrib.setAttribType(DynamoDBConstants.ATTRIB_BUILDING);
|
||||
attrib.setBuildingName("");
|
||||
attrib.setBuildingMetaId(building_id);
|
||||
attrib.setDescription("");
|
||||
attrib.setOwnerUserGuid(guid);
|
||||
attrib.setRentalCurrencyAmount(0.0);
|
||||
attrib.setRentalCurrencyType(ECurrencyType.Calium.getValue());
|
||||
attrib.setRentalOpen(false);
|
||||
attrib.setBuildingGuid("");
|
||||
|
||||
BuildingDoc doc = new BuildingDoc();
|
||||
doc.setPK(pk);
|
||||
doc.setSK(DynamoDBConstants.EMPTY);
|
||||
doc.setDocType(DynamoDBConstants.DOC_BUILDING);
|
||||
doc.setAttribValue(objectMapper.writeValueAsString(attrib));
|
||||
doc.setCreatedDateTime(convertUTCDate(nowDate));
|
||||
doc.setUpdatedDateTime(convertUTCDate(nowDate));
|
||||
doc.setDeletedDateTime(DynamoDBConstants.MIN_DATE);
|
||||
doc.setRestoredDateTime(DynamoDBConstants.MIN_DATE);
|
||||
|
||||
save(doc);
|
||||
|
||||
log.info("BuildingDoc Insert Success: {}", objectMapper.writeValueAsString(doc));
|
||||
|
||||
dynamodbHistoryLogService.insertHistoryLog(
|
||||
HISTORYTYPE.LAND_OWNER_CHANGE_ADD,
|
||||
HISTORYTYPE.LAND_OWNER_CHANGE_ADD.name(),
|
||||
doc
|
||||
);
|
||||
|
||||
}catch (Exception e){
|
||||
log.error("insert Error: {}", e.getMessage());
|
||||
throw new RestApiException(CommonCode.ERROR.getHttpStatus(), ErrorCode.DYNAMODB_CONNECTION_ERROR.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateBuilding(LandRequest landRequest) {
|
||||
LocalDateTime nowDate = LocalDateTime.now();
|
||||
|
||||
int buildingId_id = landRequest.getBuildingId();
|
||||
String guid = landRequest.getUserGuid();
|
||||
|
||||
try {
|
||||
Key key = Key.builder()
|
||||
.partitionValue(DynamoDBConstants.PK_KEY_BUILDING + buildingId_id)
|
||||
.sortValue(DynamoDBConstants.EMPTY)
|
||||
.build();
|
||||
|
||||
BuildingDoc beforeDoc = findById(key);
|
||||
|
||||
if (beforeDoc != null) {
|
||||
BuildingDoc afterDoc = deepCopy(beforeDoc, BuildingDoc.class);
|
||||
|
||||
BuildingAttrib attrib = objectMapper.readValue(afterDoc.getAttribValue(), BuildingAttrib.class);
|
||||
attrib.setDescription("");
|
||||
attrib.setOwnerUserGuid(guid);
|
||||
|
||||
afterDoc.setAttribValue(objectMapper.writeValueAsString(attrib));
|
||||
afterDoc.setUpdatedDateTime(CommonUtils.convertUTCDate(nowDate));
|
||||
|
||||
update(afterDoc);
|
||||
|
||||
log.info("BuildingDoc Update Success: {}", objectMapper.writeValueAsString(afterDoc));
|
||||
|
||||
dynamodbHistoryLogService.updateHistoryLog(
|
||||
HISTORYTYPE.LAND_OWNER_CHANGE_UPDATE,
|
||||
HISTORYTYPE.LAND_OWNER_CHANGE_UPDATE.name(),
|
||||
beforeDoc,
|
||||
afterDoc
|
||||
);
|
||||
}
|
||||
}catch (Exception e){
|
||||
throw new RestApiException(CommonCode.ERROR.getHttpStatus(), ErrorCode.DYNAMODB_CONNECTION_ERROR.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public DynamodbOperationResult initBuildingOwner(int buildingId) {
|
||||
|
||||
try {
|
||||
Key key = Key.builder()
|
||||
.partitionValue(DynamoDBConstants.PK_KEY_BUILDING + buildingId)
|
||||
.sortValue(DynamoDBConstants.EMPTY)
|
||||
.build();
|
||||
|
||||
BuildingDoc beforeDoc = findById(key);
|
||||
|
||||
if (beforeDoc != null) {
|
||||
BuildingDoc afterDoc = deepCopy(beforeDoc, BuildingDoc.class);
|
||||
|
||||
BuildingAttrib attrib = objectMapper.readValue(afterDoc.getAttribValue(), BuildingAttrib.class);
|
||||
attrib.setOwnerUserGuid("");
|
||||
|
||||
afterDoc.setAttribValue(objectMapper.writeValueAsString(attrib));
|
||||
afterDoc.setUpdatedDateTime(CommonUtils.convertUTCDate(LocalDateTime.now()));
|
||||
|
||||
update(afterDoc);
|
||||
|
||||
log.info("BuildingDoc Owned Init Update Success: {}", objectMapper.writeValueAsString(afterDoc));
|
||||
|
||||
dynamodbHistoryLogService.updateHistoryLog(
|
||||
HISTORYTYPE.LAND_OWNED_INITIALIZE,
|
||||
HISTORYTYPE.LAND_OWNED_INITIALIZE.name(),
|
||||
beforeDoc,
|
||||
afterDoc
|
||||
);
|
||||
return new DynamodbOperationResult(true, "", afterDoc);
|
||||
}
|
||||
return new DynamodbOperationResult(false, "null", null);
|
||||
}catch (Exception e){
|
||||
log.error("Init Building Owner Error: {}", e.getMessage());
|
||||
return new DynamodbOperationResult(false, e.getMessage(), null);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public DynamodbOperationResult initBuildingDesc(int buildingId) {
|
||||
|
||||
try {
|
||||
Key key = Key.builder()
|
||||
.partitionValue(DynamoDBConstants.PK_KEY_BUILDING + buildingId)
|
||||
.sortValue(DynamoDBConstants.EMPTY)
|
||||
.build();
|
||||
|
||||
BuildingDoc beforeDoc = findById(key);
|
||||
|
||||
if (beforeDoc != null) {
|
||||
BuildingDoc afterDoc = deepCopy(beforeDoc, BuildingDoc.class);
|
||||
|
||||
BuildingAttrib attrib = objectMapper.readValue(afterDoc.getAttribValue(), BuildingAttrib.class);
|
||||
attrib.setDescription("");
|
||||
attrib.setBuildingName("");
|
||||
attrib.setRentalCurrencyAmount(0.0);
|
||||
attrib.setRentalOpen(false);
|
||||
attrib.setRentalCurrencyType(ECurrencyType.Calium.getValue());
|
||||
|
||||
afterDoc.setAttribValue(objectMapper.writeValueAsString(attrib));
|
||||
afterDoc.setUpdatedDateTime(CommonUtils.convertUTCDate(LocalDateTime.now()));
|
||||
|
||||
update(afterDoc);
|
||||
|
||||
log.info("BuildingDoc Desc Init Update Success: {}", objectMapper.writeValueAsString(afterDoc));
|
||||
|
||||
dynamodbHistoryLogService.updateHistoryLog(
|
||||
HISTORYTYPE.LAND_DESC_INITIALIZE,
|
||||
HISTORYTYPE.LAND_DESC_INITIALIZE.name(),
|
||||
beforeDoc,
|
||||
afterDoc
|
||||
);
|
||||
return new DynamodbOperationResult(true, "Success", afterDoc);
|
||||
}
|
||||
return new DynamodbOperationResult(true, "null", beforeDoc);
|
||||
}catch (Exception e){
|
||||
log.error("Init Building Desc Error: {}", e.getMessage());
|
||||
return new DynamodbOperationResult(false, e.getMessage(), null);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -86,9 +86,7 @@ public class CaliumStorageRepositoryImpl extends BaseDynamoDBRepository<CaliumSt
|
||||
HISTORYTYPE.CALIUM_TOTAL_UPDATE,
|
||||
HISTORYTYPE.CALIUM_TOTAL_UPDATE.name(),
|
||||
beforeDoc,
|
||||
afterDoc,
|
||||
CommonUtils.getAdmin().getEmail(),
|
||||
CommonUtils.getClientIp()
|
||||
afterDoc
|
||||
);
|
||||
}
|
||||
}catch (Exception e){
|
||||
@@ -136,9 +134,7 @@ public class CaliumStorageRepositoryImpl extends BaseDynamoDBRepository<CaliumSt
|
||||
HISTORYTYPE.CALIUM_TOTAL_UPDATE,
|
||||
HISTORYTYPE.CALIUM_TOTAL_UPDATE.name(),
|
||||
beforeDoc,
|
||||
afterDoc,
|
||||
CommonUtils.getAdmin().getEmail(),
|
||||
CommonUtils.getClientIp()
|
||||
afterDoc
|
||||
);
|
||||
}
|
||||
}catch (Exception e){
|
||||
|
||||
@@ -4,6 +4,8 @@ import com.caliverse.admin.domain.entity.HISTORYTYPE;
|
||||
import com.caliverse.admin.domain.request.LandRequest;
|
||||
import com.caliverse.admin.dynamodb.domain.atrrib.LandAuctionActivityAttrib;
|
||||
import com.caliverse.admin.dynamodb.domain.doc.LandAuctionActivityDoc;
|
||||
import com.caliverse.admin.dynamodb.domain.doc.LandAuctionRegistryDoc;
|
||||
import com.caliverse.admin.dynamodb.entity.DynamodbOperationResult;
|
||||
import com.caliverse.admin.dynamodb.repository.BaseDynamoDBRepository;
|
||||
import com.caliverse.admin.dynamodb.repository.LandAuctionActivityRepository;
|
||||
import com.caliverse.admin.dynamodb.service.DynamoDBOperations;
|
||||
@@ -19,6 +21,7 @@ import org.springframework.stereotype.Component;
|
||||
import software.amazon.awssdk.enhanced.dynamodb.Key;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Component
|
||||
@Slf4j
|
||||
@@ -57,6 +60,35 @@ public class LandAuctionActivityRepositoryImpl extends BaseDynamoDBRepository<La
|
||||
return attrib.getAuctionNumber();
|
||||
}
|
||||
|
||||
@Override
|
||||
public DynamodbOperationResult initLandAuctionActivity(Integer landId, Integer auctionSeq) {
|
||||
try{
|
||||
Key key = Key.builder()
|
||||
.partitionValue(DynamoDBConstants.PK_KEY_LAND_AUCTION_ACTIVE)
|
||||
.sortValue(landId.toString())
|
||||
.build();
|
||||
LandAuctionActivityDoc doc = findById(key);
|
||||
|
||||
if(doc != null && doc.getAttribValue().getAuctionNumber().equals(auctionSeq)) {
|
||||
delete(key);
|
||||
|
||||
log.info("LandAuctionActivityDoc Delete Success: {}", objectMapper.writeValueAsString(doc));
|
||||
|
||||
dynamodbHistoryLogService.deleteHistoryLog(
|
||||
HISTORYTYPE.LAND_AUCTION_INITIALIZE,
|
||||
HISTORYTYPE.LAND_AUCTION_INITIALIZE.name(),
|
||||
doc
|
||||
);
|
||||
|
||||
return new DynamodbOperationResult(true, "delete success", doc);
|
||||
}
|
||||
return new DynamodbOperationResult(true, "null", doc);
|
||||
}catch (Exception e){
|
||||
log.error("Init LandAuctionActivity Error: {}", e.getMessage());
|
||||
return new DynamodbOperationResult(false, e.getMessage(), null);
|
||||
}
|
||||
}
|
||||
|
||||
private void insertLandAuctionActive(LandRequest landRequest){
|
||||
try {
|
||||
LocalDateTime nowDate = LocalDateTime.now();
|
||||
@@ -80,9 +112,7 @@ public class LandAuctionActivityRepositoryImpl extends BaseDynamoDBRepository<La
|
||||
dynamodbHistoryLogService.insertHistoryLog(
|
||||
HISTORYTYPE.LAND_AUCTION_ADD,
|
||||
HISTORYTYPE.LAND_AUCTION_ADD.name(),
|
||||
activityDoc,
|
||||
CommonUtils.getAdmin().getEmail(),
|
||||
CommonUtils.getClientIp()
|
||||
activityDoc
|
||||
);
|
||||
}catch (Exception e){
|
||||
throw new RestApiException(CommonCode.ERROR.getHttpStatus(), ErrorCode.DYNAMODB_CONNECTION_ERROR.getMessage());
|
||||
@@ -107,9 +137,7 @@ public class LandAuctionActivityRepositoryImpl extends BaseDynamoDBRepository<La
|
||||
HISTORYTYPE.LAND_AUCTION_ADD,
|
||||
HISTORYTYPE.LAND_AUCTION_ADD.name(),
|
||||
existingDoc,
|
||||
afterDoc,
|
||||
CommonUtils.getAdmin().getEmail(),
|
||||
CommonUtils.getClientIp()
|
||||
afterDoc
|
||||
);
|
||||
}catch (Exception e){
|
||||
throw new RestApiException(CommonCode.ERROR.getHttpStatus(), ErrorCode.DYNAMODB_CONNECTION_ERROR.getMessage());
|
||||
|
||||
@@ -4,8 +4,10 @@ import com.caliverse.admin.domain.entity.HISTORYTYPE;
|
||||
import com.caliverse.admin.domain.request.LandRequest;
|
||||
import com.caliverse.admin.dynamodb.domain.atrrib.LandAuctionHighestBidUserAttrib;
|
||||
import com.caliverse.admin.dynamodb.domain.atrrib.LandAuctionRegistryAttrib;
|
||||
import com.caliverse.admin.dynamodb.domain.doc.LandAuctionActivityDoc;
|
||||
import com.caliverse.admin.dynamodb.domain.doc.LandAuctionHighestBidUserDoc;
|
||||
import com.caliverse.admin.dynamodb.domain.doc.LandAuctionRegistryDoc;
|
||||
import com.caliverse.admin.dynamodb.entity.DynamodbOperationResult;
|
||||
import com.caliverse.admin.dynamodb.repository.BaseDynamoDBRepository;
|
||||
import com.caliverse.admin.dynamodb.repository.LandAuctionHighestBidUserRepository;
|
||||
import com.caliverse.admin.dynamodb.service.DynamoDBOperations;
|
||||
@@ -22,6 +24,7 @@ import org.springframework.stereotype.Component;
|
||||
import software.amazon.awssdk.enhanced.dynamodb.Key;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Component
|
||||
@Slf4j
|
||||
@@ -75,9 +78,7 @@ public class LandAuctionHighestBidUserRepositoryImpl extends BaseDynamoDBReposit
|
||||
dynamodbHistoryLogService.insertHistoryLog(
|
||||
HISTORYTYPE.LAND_AUCTION_ADD,
|
||||
HISTORYTYPE.LAND_AUCTION_ADD.name(),
|
||||
registry,
|
||||
CommonUtils.getAdmin().getEmail(),
|
||||
CommonUtils.getClientIp()
|
||||
registry
|
||||
);
|
||||
|
||||
save(registry);
|
||||
@@ -86,4 +87,34 @@ public class LandAuctionHighestBidUserRepositoryImpl extends BaseDynamoDBReposit
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public DynamodbOperationResult initLandAuctionHighestBidUser(Integer landId, Integer auctionSeq) {
|
||||
|
||||
try{
|
||||
Key key = Key.builder()
|
||||
.partitionValue(DynamoDBConstants.PK_KEY_LAND_AUCTION_HIGHEST_USER)
|
||||
.sortValue(String.format("%s#%s", landId, auctionSeq))
|
||||
.build();
|
||||
|
||||
LandAuctionHighestBidUserDoc doc = findById(key);
|
||||
|
||||
if(doc != null) {
|
||||
delete(key);
|
||||
|
||||
log.info("LandAuctionHighestBidUserDoc Delete Success: {}", objectMapper.writeValueAsString(doc));
|
||||
|
||||
dynamodbHistoryLogService.deleteHistoryLog(
|
||||
HISTORYTYPE.LAND_AUCTION_INITIALIZE,
|
||||
HISTORYTYPE.LAND_AUCTION_INITIALIZE.name(),
|
||||
doc
|
||||
);
|
||||
return new DynamodbOperationResult(true, "delete success", doc);
|
||||
}
|
||||
return new DynamodbOperationResult(true, "null", doc);
|
||||
}catch (Exception e){
|
||||
log.error("Init LandAuctionHighestBidUser Error: {}", e.getMessage());
|
||||
return new DynamodbOperationResult(false, e.getMessage(), null);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
package com.caliverse.admin.dynamodb.repository.Impl;
|
||||
|
||||
import com.caliverse.admin.domain.entity.HISTORYTYPE;
|
||||
import com.caliverse.admin.dynamodb.domain.doc.LandAuctionActivityDoc;
|
||||
import com.caliverse.admin.dynamodb.domain.doc.LandAuctionRecordDoc;
|
||||
import com.caliverse.admin.dynamodb.domain.doc.LandAuctionRegistryDoc;
|
||||
import com.caliverse.admin.dynamodb.entity.DynamodbOperationResult;
|
||||
import com.caliverse.admin.dynamodb.repository.BaseDynamoDBRepository;
|
||||
import com.caliverse.admin.dynamodb.repository.LandAuctionRecordRepository;
|
||||
import com.caliverse.admin.dynamodb.service.DynamoDBOperations;
|
||||
import com.caliverse.admin.global.common.code.CommonCode;
|
||||
import com.caliverse.admin.global.common.code.ErrorCode;
|
||||
import com.caliverse.admin.global.common.constants.DynamoDBConstants;
|
||||
import com.caliverse.admin.global.common.exception.RestApiException;
|
||||
import com.caliverse.admin.global.common.utils.CommonUtils;
|
||||
import com.caliverse.admin.history.service.DynamodbHistoryLogService;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
import software.amazon.awssdk.enhanced.dynamodb.Key;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Component
|
||||
@Slf4j
|
||||
public class LandAuctionRecordRepositoryImpl extends BaseDynamoDBRepository<LandAuctionRecordDoc> implements LandAuctionRecordRepository {
|
||||
public LandAuctionRecordRepositoryImpl(DynamoDBOperations operations, DynamodbHistoryLogService dynamodbHistoryLogService, ObjectMapper objectMapper) {
|
||||
super(operations, LandAuctionRecordDoc.class, dynamodbHistoryLogService, objectMapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DynamodbOperationResult initLandAuctionRecord(Integer landId) {
|
||||
|
||||
try{
|
||||
Key key = Key.builder()
|
||||
.partitionValue(DynamoDBConstants.PK_KEY_LAND_AUCTION_RECORD)
|
||||
.sortValue(String.valueOf(landId))
|
||||
.build();
|
||||
LandAuctionRecordDoc doc = findById(key);
|
||||
|
||||
if(doc != null) {
|
||||
|
||||
delete(key);
|
||||
|
||||
log.info("LandAuctionRecordDoc Delete Success: {}", objectMapper.writeValueAsString(doc));
|
||||
|
||||
dynamodbHistoryLogService.deleteHistoryLog(
|
||||
HISTORYTYPE.LAND_AUCTION_INITIALIZE,
|
||||
HISTORYTYPE.LAND_AUCTION_INITIALIZE.name(),
|
||||
doc
|
||||
);
|
||||
return new DynamodbOperationResult(true, "delete success", doc);
|
||||
}
|
||||
return new DynamodbOperationResult(true, "null", doc);
|
||||
}catch (Exception e){
|
||||
log.error("Init LandAuctionRecord Error: {}", e.getMessage());
|
||||
return new DynamodbOperationResult(false, e.getMessage(), null);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
package com.caliverse.admin.dynamodb.repository.Impl;
|
||||
|
||||
import com.caliverse.admin.domain.entity.HISTORYTYPE;
|
||||
import com.caliverse.admin.dynamodb.domain.doc.LandAuctionRefundBidPriceDoc;
|
||||
import com.caliverse.admin.dynamodb.entity.DynamodbOperationResult;
|
||||
import com.caliverse.admin.dynamodb.repository.BaseDynamoDBRepository;
|
||||
import com.caliverse.admin.dynamodb.repository.LandAuctionRefundBidPriceRepository;
|
||||
import com.caliverse.admin.dynamodb.service.DynamoDBOperations;
|
||||
import com.caliverse.admin.global.common.code.CommonCode;
|
||||
import com.caliverse.admin.global.common.code.ErrorCode;
|
||||
import com.caliverse.admin.global.common.constants.DynamoDBConstants;
|
||||
import com.caliverse.admin.global.common.exception.RestApiException;
|
||||
import com.caliverse.admin.global.common.utils.CommonUtils;
|
||||
import com.caliverse.admin.history.service.DynamodbHistoryLogService;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
import software.amazon.awssdk.enhanced.dynamodb.Key;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Component
|
||||
@Slf4j
|
||||
public class LandAuctionRefundBidPriceRepositoryImpl extends BaseDynamoDBRepository<LandAuctionRefundBidPriceDoc> implements LandAuctionRefundBidPriceRepository {
|
||||
|
||||
public LandAuctionRefundBidPriceRepositoryImpl(DynamoDBOperations operations, DynamodbHistoryLogService historyLogService, ObjectMapper objectMapper) {
|
||||
super(operations, LandAuctionRefundBidPriceDoc.class, historyLogService, objectMapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DynamodbOperationResult initLandAuctionRefundBidPrice(String guid, Integer landId, Integer auctionSeq) {
|
||||
|
||||
try{
|
||||
Key key = Key.builder()
|
||||
.partitionValue(DynamoDBConstants.PK_KEY_LAND_AUCTION_REFUND_BID_PRICE + guid)
|
||||
.sortValue(String.format("%s#%s", landId, auctionSeq))
|
||||
.build();
|
||||
|
||||
LandAuctionRefundBidPriceDoc doc = findById(key);
|
||||
|
||||
if(doc != null) {
|
||||
|
||||
delete(key);
|
||||
|
||||
log.info("LandAuctionRefundBidPriceDoc Delete Success: {}", objectMapper.writeValueAsString(doc));
|
||||
|
||||
dynamodbHistoryLogService.deleteHistoryLog(
|
||||
HISTORYTYPE.LAND_AUCTION_INITIALIZE,
|
||||
HISTORYTYPE.LAND_AUCTION_INITIALIZE.name(),
|
||||
doc
|
||||
);
|
||||
return new DynamodbOperationResult(true, "delete success", doc);
|
||||
}
|
||||
return new DynamodbOperationResult(true, "null", doc);
|
||||
}catch (Exception e){
|
||||
log.error("Init LandAuctionRefundBidPrice Error: {}", e.getMessage());
|
||||
return new DynamodbOperationResult(false, e.getMessage(), null);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,8 +2,13 @@ package com.caliverse.admin.dynamodb.repository.Impl;
|
||||
|
||||
import com.caliverse.admin.domain.entity.HISTORYTYPE;
|
||||
import com.caliverse.admin.domain.request.LandRequest;
|
||||
import com.caliverse.admin.dynamodb.domain.atrrib.BuildingAttrib;
|
||||
import com.caliverse.admin.dynamodb.domain.atrrib.LandAuctionRegistryAttrib;
|
||||
import com.caliverse.admin.dynamodb.domain.doc.BuildingDoc;
|
||||
import com.caliverse.admin.dynamodb.domain.doc.LandAuctionRegistryDoc;
|
||||
import com.caliverse.admin.dynamodb.domain.doc.OwnedBuildingDoc;
|
||||
import com.caliverse.admin.dynamodb.entity.DynamodbOperationResult;
|
||||
import com.caliverse.admin.dynamodb.entity.ECurrencyType;
|
||||
import com.caliverse.admin.dynamodb.entity.ELandAuctionResult;
|
||||
import com.caliverse.admin.dynamodb.repository.BaseDynamoDBRepository;
|
||||
import com.caliverse.admin.dynamodb.repository.LandAuctionRegistryRepository;
|
||||
@@ -34,7 +39,7 @@ public class LandAuctionRegistryRepositoryImpl extends BaseDynamoDBRepository<La
|
||||
@Override
|
||||
public int findAuctionNumber(Integer landId) {
|
||||
List<LandAuctionRegistryDoc> docs = findByPrefix(
|
||||
DynamoDBConstants.PK_KEY_LAND_AUCTION,
|
||||
DynamoDBConstants.PK_KEY_LAND_AUCTION_REGISTRY,
|
||||
landId.toString()
|
||||
);
|
||||
|
||||
@@ -53,7 +58,7 @@ public class LandAuctionRegistryRepositoryImpl extends BaseDynamoDBRepository<La
|
||||
@Override
|
||||
public LandAuctionRegistryAttrib findRegistryAttrib(Integer landId, Integer auctionSeq) {
|
||||
Key key = Key.builder()
|
||||
.partitionValue(DynamoDBConstants.PK_KEY_LAND_AUCTION)
|
||||
.partitionValue(DynamoDBConstants.PK_KEY_LAND_AUCTION_REGISTRY)
|
||||
.sortValue(String.format("%s#%s", landId, auctionSeq))
|
||||
.build();
|
||||
|
||||
@@ -83,7 +88,7 @@ public class LandAuctionRegistryRepositoryImpl extends BaseDynamoDBRepository<La
|
||||
String sk = String.format("%s#%s", landRequest.getLandId(), landRequest.getAuctionSeq());
|
||||
|
||||
LandAuctionRegistryDoc registry = new LandAuctionRegistryDoc();
|
||||
registry.setPK(DynamoDBConstants.PK_KEY_LAND_AUCTION);
|
||||
registry.setPK(DynamoDBConstants.PK_KEY_LAND_AUCTION_REGISTRY);
|
||||
registry.setSK(sk);
|
||||
registry.setDocType(DynamoDBConstants.DOC_LANDAUCTION);
|
||||
registry.setAttribValue(attrib);
|
||||
@@ -97,13 +102,12 @@ public class LandAuctionRegistryRepositoryImpl extends BaseDynamoDBRepository<La
|
||||
dynamodbHistoryLogService.insertHistoryLog(
|
||||
HISTORYTYPE.LAND_AUCTION_ADD,
|
||||
HISTORYTYPE.LAND_AUCTION_ADD.name(),
|
||||
registry,
|
||||
CommonUtils.getAdmin().getEmail(),
|
||||
CommonUtils.getClientIp()
|
||||
registry
|
||||
);
|
||||
|
||||
save(registry);
|
||||
}catch (Exception e){
|
||||
log.error("Insert LandAuctionRegistry Error: {}", e.getMessage());
|
||||
throw new RestApiException(CommonCode.ERROR.getHttpStatus(), ErrorCode.DYNAMODB_CONNECTION_ERROR.getMessage());
|
||||
}
|
||||
}
|
||||
@@ -112,7 +116,7 @@ public class LandAuctionRegistryRepositoryImpl extends BaseDynamoDBRepository<La
|
||||
public void updateAuction(LandRequest landRequest) {
|
||||
try {
|
||||
Key key = Key.builder()
|
||||
.partitionValue(DynamoDBConstants.PK_KEY_LAND_AUCTION)
|
||||
.partitionValue(DynamoDBConstants.PK_KEY_LAND_AUCTION_REGISTRY)
|
||||
.sortValue(String.format("%s#%s", landRequest.getLandId(), landRequest.getAuctionSeq()))
|
||||
.build();
|
||||
|
||||
@@ -139,12 +143,11 @@ public class LandAuctionRegistryRepositoryImpl extends BaseDynamoDBRepository<La
|
||||
HISTORYTYPE.LAND_AUCTION_UPDATE,
|
||||
HISTORYTYPE.LAND_AUCTION_UPDATE.name(),
|
||||
beforeDoc,
|
||||
afterDoc,
|
||||
CommonUtils.getAdmin().getEmail(),
|
||||
CommonUtils.getClientIp()
|
||||
afterDoc
|
||||
);
|
||||
}
|
||||
}catch (Exception e){
|
||||
log.error("Update LandAuctionRegistry Error: {}", e.getMessage());
|
||||
throw new RestApiException(CommonCode.ERROR.getHttpStatus(), ErrorCode.DYNAMODB_CONNECTION_ERROR.getMessage());
|
||||
}
|
||||
}
|
||||
@@ -153,7 +156,7 @@ public class LandAuctionRegistryRepositoryImpl extends BaseDynamoDBRepository<La
|
||||
public void cancelAuction(Integer landId, Integer auctionSeq) {
|
||||
try {
|
||||
Key key = Key.builder()
|
||||
.partitionValue(DynamoDBConstants.PK_KEY_LAND_AUCTION)
|
||||
.partitionValue(DynamoDBConstants.PK_KEY_LAND_AUCTION_REGISTRY)
|
||||
.sortValue(String.format("%s#%s", landId, auctionSeq))
|
||||
.build();
|
||||
|
||||
@@ -178,14 +181,46 @@ public class LandAuctionRegistryRepositoryImpl extends BaseDynamoDBRepository<La
|
||||
HISTORYTYPE.LAND_AUCTION_UPDATE,
|
||||
HISTORYTYPE.LAND_AUCTION_UPDATE.name(),
|
||||
beforeDoc,
|
||||
afterDoc,
|
||||
CommonUtils.getAdmin().getEmail(),
|
||||
CommonUtils.getClientIp()
|
||||
afterDoc
|
||||
);
|
||||
}
|
||||
}catch (Exception e){
|
||||
log.error("Cancel LandAuctionRegistry Error: {}", e.getMessage());
|
||||
throw new RestApiException(CommonCode.ERROR.getHttpStatus(), ErrorCode.DYNAMODB_CONNECTION_ERROR.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public DynamodbOperationResult initLandAuctionRegistry(Integer landId, Integer auctionSeq) {
|
||||
try{
|
||||
Key key = Key.builder()
|
||||
.partitionValue(DynamoDBConstants.PK_KEY_LAND_AUCTION_REGISTRY)
|
||||
.sortValue(String.format("%s#%s", landId, auctionSeq))
|
||||
.build();
|
||||
LandAuctionRegistryDoc doc = findById(key);
|
||||
|
||||
if(doc != null) {
|
||||
Key detailKey = Key.builder()
|
||||
.partitionValue(doc.getPK())
|
||||
.sortValue(doc.getSK())
|
||||
.build();
|
||||
|
||||
delete(detailKey);
|
||||
|
||||
log.info("LandAuctionRegistryDoc Delete Success: {}", objectMapper.writeValueAsString(doc));
|
||||
|
||||
dynamodbHistoryLogService.deleteHistoryLog(
|
||||
HISTORYTYPE.LAND_AUCTION_INITIALIZE,
|
||||
HISTORYTYPE.LAND_AUCTION_INITIALIZE.name(),
|
||||
doc
|
||||
);
|
||||
|
||||
return new DynamodbOperationResult(true, "", doc);
|
||||
}
|
||||
return new DynamodbOperationResult(true, "null", doc);
|
||||
}catch (Exception e){
|
||||
log.error("Init LandAuctionRegistry Error: {}", e.getMessage());
|
||||
return new DynamodbOperationResult(false, e.getMessage(), null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
package com.caliverse.admin.dynamodb.repository.Impl;
|
||||
|
||||
import com.caliverse.admin.domain.entity.HISTORYTYPE;
|
||||
import com.caliverse.admin.domain.request.LandRequest;
|
||||
import com.caliverse.admin.dynamodb.domain.atrrib.LandAttrib;
|
||||
import com.caliverse.admin.dynamodb.domain.doc.LandDoc;
|
||||
import com.caliverse.admin.dynamodb.entity.DynamodbOperationResult;
|
||||
import com.caliverse.admin.dynamodb.repository.BaseDynamoDBRepository;
|
||||
import com.caliverse.admin.dynamodb.repository.LandRepository;
|
||||
import com.caliverse.admin.dynamodb.service.DynamoDBOperations;
|
||||
@@ -10,6 +12,7 @@ import com.caliverse.admin.global.common.code.CommonCode;
|
||||
import com.caliverse.admin.global.common.code.ErrorCode;
|
||||
import com.caliverse.admin.global.common.constants.DynamoDBConstants;
|
||||
import com.caliverse.admin.global.common.exception.RestApiException;
|
||||
import com.caliverse.admin.global.common.utils.CommonUtils;
|
||||
import com.caliverse.admin.history.service.DynamodbHistoryLogService;
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
@@ -19,6 +22,8 @@ import software.amazon.awssdk.enhanced.dynamodb.Key;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static com.caliverse.admin.global.common.utils.CommonUtils.convertUTCDate;
|
||||
|
||||
@Component
|
||||
@Slf4j
|
||||
public class LandRepositoryImpl extends BaseDynamoDBRepository<LandDoc> implements LandRepository {
|
||||
@@ -49,46 +54,164 @@ public class LandRepositoryImpl extends BaseDynamoDBRepository<LandDoc> implemen
|
||||
try {
|
||||
LocalDateTime nowDate = LocalDateTime.now();
|
||||
|
||||
// String pk =
|
||||
//
|
||||
// LandAttrib attrib = new LandAttrib();
|
||||
// attrib.setLandName();
|
||||
// attrib.setMailId(event.getId().intValue());
|
||||
// attrib.setStartTime(convertUTCDate(event.getStartDt()));
|
||||
// attrib.setEndTime(convertUTCDate(event.getEndDt()));
|
||||
// attrib.setSenderNickName(createSystemMessages(event.getMailList(), DynamodbUtil::getSenderByLanguage));
|
||||
// attrib.setTitle(createSystemMessages(event.getMailList(), Message::getTitle));
|
||||
// attrib.setText(createSystemMessages(event.getMailList(), Message::getContent));
|
||||
// attrib.setItemList(createMailItems(event.getItemList()));
|
||||
//
|
||||
// LandDoc doc = new LandDoc();
|
||||
// doc.setPK(DynamoDBConstants.PK_KEY_LAND + landRequest.getLandId());
|
||||
// doc.setSK(String.valueOf(event.getId()));
|
||||
// doc.setDocType(DynamoDBConstants.DOC_SYSTEMMAIL);
|
||||
// doc.setAttribValue(objectMapper.writeValueAsString(attrib));
|
||||
// doc.setCreatedDateTime(convertUTCDate(nowDate));
|
||||
// doc.setUpdatedDateTime(convertUTCDate(nowDate));
|
||||
// doc.setDeletedDateTime(DynamoDBConstants.MIN_DATE);
|
||||
// doc.setRestoredDateTime(DynamoDBConstants.MIN_DATE);
|
||||
//
|
||||
// save(doc);
|
||||
//
|
||||
// dynamodbHistoryLogService.insertHistoryLog(
|
||||
// HISTORYTYPE.EVENT_ADD,
|
||||
// HISTORYTYPE.EVENT_ADD.name(),
|
||||
// doc,
|
||||
// CommonUtils.getAdmin().getEmail(),
|
||||
// CommonUtils.getClientIp()
|
||||
// );
|
||||
int land_id = landRequest.getLandId();
|
||||
String guid = landRequest.getUserGuid();
|
||||
|
||||
String pk = DynamoDBConstants.PK_KEY_LAND + land_id;
|
||||
|
||||
LandAttrib attrib = new LandAttrib();
|
||||
attrib.setAttribType(DynamoDBConstants.ATTRIB_LAND);
|
||||
attrib.setLandName("");
|
||||
attrib.setLandMetaId(land_id);
|
||||
attrib.setDescription("");
|
||||
attrib.setOwnerUserGuid(guid);
|
||||
|
||||
LandDoc doc = new LandDoc();
|
||||
doc.setPK(pk);
|
||||
doc.setSK(DynamoDBConstants.EMPTY);
|
||||
doc.setDocType(DynamoDBConstants.DOC_LAND);
|
||||
doc.setAttribValue(objectMapper.writeValueAsString(attrib));
|
||||
doc.setCreatedDateTime(convertUTCDate(nowDate));
|
||||
doc.setUpdatedDateTime(convertUTCDate(nowDate));
|
||||
doc.setDeletedDateTime(DynamoDBConstants.MIN_DATE);
|
||||
doc.setRestoredDateTime(DynamoDBConstants.MIN_DATE);
|
||||
|
||||
save(doc);
|
||||
|
||||
log.info("LandDoc Insert Success: {}", objectMapper.writeValueAsString(doc));
|
||||
|
||||
dynamodbHistoryLogService.insertHistoryLog(
|
||||
HISTORYTYPE.LAND_OWNER_CHANGE_ADD,
|
||||
HISTORYTYPE.LAND_OWNER_CHANGE_ADD.name(),
|
||||
doc
|
||||
);
|
||||
|
||||
}catch (Exception e){
|
||||
log.error("insert Error: {}", e.getMessage());
|
||||
log.error("insertLand Error: {}", e.getMessage());
|
||||
throw new RestApiException(CommonCode.ERROR.getHttpStatus(), ErrorCode.DYNAMODB_CONNECTION_ERROR.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateLand(LandRequest landRequest) {
|
||||
LocalDateTime nowDate = LocalDateTime.now();
|
||||
|
||||
int land_id = landRequest.getLandId();
|
||||
String guid = landRequest.getUserGuid();
|
||||
|
||||
try {
|
||||
Key key = Key.builder()
|
||||
.partitionValue(DynamoDBConstants.PK_KEY_LAND + land_id)
|
||||
.sortValue(DynamoDBConstants.EMPTY)
|
||||
.build();
|
||||
|
||||
LandDoc beforeDoc = findById(key);
|
||||
|
||||
if (beforeDoc != null) {
|
||||
LandDoc afterDoc = deepCopy(beforeDoc, LandDoc.class);
|
||||
|
||||
LandAttrib attrib = objectMapper.readValue(afterDoc.getAttribValue(), LandAttrib.class);
|
||||
attrib.setDescription("");
|
||||
attrib.setOwnerUserGuid(guid);
|
||||
|
||||
afterDoc.setAttribValue(objectMapper.writeValueAsString(attrib));
|
||||
afterDoc.setUpdatedDateTime(CommonUtils.convertUTCDate(nowDate));
|
||||
|
||||
update(afterDoc);
|
||||
|
||||
log.info("LandDoc Update Success: {}", objectMapper.writeValueAsString(afterDoc));
|
||||
|
||||
dynamodbHistoryLogService.updateHistoryLog(
|
||||
HISTORYTYPE.LAND_OWNER_CHANGE_UPDATE,
|
||||
HISTORYTYPE.LAND_OWNER_CHANGE_UPDATE.name(),
|
||||
beforeDoc,
|
||||
afterDoc
|
||||
);
|
||||
}
|
||||
}catch (Exception e){
|
||||
log.error("updateLand Error: {}", e.getMessage());
|
||||
throw new RestApiException(CommonCode.ERROR.getHttpStatus(), ErrorCode.DYNAMODB_CONNECTION_ERROR.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public DynamodbOperationResult initLandOwner(int landId) {
|
||||
LocalDateTime nowDate = LocalDateTime.now();
|
||||
|
||||
try {
|
||||
Key key = Key.builder()
|
||||
.partitionValue(DynamoDBConstants.PK_KEY_LAND + landId)
|
||||
.sortValue(DynamoDBConstants.EMPTY)
|
||||
.build();
|
||||
|
||||
LandDoc beforeDoc = findById(key);
|
||||
|
||||
if (beforeDoc != null) {
|
||||
LandDoc afterDoc = deepCopy(beforeDoc, LandDoc.class);
|
||||
|
||||
LandAttrib attrib = objectMapper.readValue(afterDoc.getAttribValue(), LandAttrib.class);
|
||||
attrib.setOwnerUserGuid("");
|
||||
|
||||
afterDoc.setAttribValue(objectMapper.writeValueAsString(attrib));
|
||||
afterDoc.setUpdatedDateTime(CommonUtils.convertUTCDate(nowDate));
|
||||
|
||||
update(afterDoc);
|
||||
|
||||
log.info("LandDoc Owned Init Update Success: {}", objectMapper.writeValueAsString(afterDoc));
|
||||
|
||||
dynamodbHistoryLogService.updateHistoryLog(
|
||||
HISTORYTYPE.LAND_OWNED_INITIALIZE,
|
||||
HISTORYTYPE.LAND_OWNED_INITIALIZE.name(),
|
||||
beforeDoc,
|
||||
afterDoc
|
||||
);
|
||||
|
||||
return new DynamodbOperationResult(true, "",afterDoc);
|
||||
}
|
||||
return new DynamodbOperationResult(false, "null",null);
|
||||
}catch (Exception e){
|
||||
log.error("Init Land Owner Error: {}", e.getMessage());
|
||||
return new DynamodbOperationResult(false, e.getMessage(),null);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public DynamodbOperationResult initLandDesc(int landId) {
|
||||
LocalDateTime nowDate = LocalDateTime.now();
|
||||
try {
|
||||
Key key = Key.builder()
|
||||
.partitionValue(DynamoDBConstants.PK_KEY_LAND + landId)
|
||||
.sortValue(DynamoDBConstants.EMPTY)
|
||||
.build();
|
||||
|
||||
LandDoc beforeDoc = findById(key);
|
||||
|
||||
if (beforeDoc != null) {
|
||||
LandDoc afterDoc = deepCopy(beforeDoc, LandDoc.class);
|
||||
|
||||
LandAttrib attrib = objectMapper.readValue(afterDoc.getAttribValue(), LandAttrib.class);
|
||||
attrib.setDescription("");
|
||||
attrib.setLandName("");
|
||||
|
||||
afterDoc.setAttribValue(objectMapper.writeValueAsString(attrib));
|
||||
afterDoc.setUpdatedDateTime(CommonUtils.convertUTCDate(nowDate));
|
||||
|
||||
update(afterDoc);
|
||||
|
||||
log.info("LandDoc Desc Init Update Success: {}", objectMapper.writeValueAsString(afterDoc));
|
||||
|
||||
dynamodbHistoryLogService.updateHistoryLog(
|
||||
HISTORYTYPE.LAND_DESC_INITIALIZE,
|
||||
HISTORYTYPE.LAND_DESC_INITIALIZE.name(),
|
||||
beforeDoc,
|
||||
afterDoc
|
||||
);
|
||||
return new DynamodbOperationResult(true, "Success",afterDoc);
|
||||
}
|
||||
return new DynamodbOperationResult(false, "null",beforeDoc);
|
||||
}catch (Exception e){
|
||||
log.error("Init Land Desc Error: {}", e.getMessage());
|
||||
return new DynamodbOperationResult(false, e.getMessage(),null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,144 @@
|
||||
package com.caliverse.admin.dynamodb.repository.Impl;
|
||||
|
||||
import com.caliverse.admin.domain.entity.HISTORYTYPE;
|
||||
import com.caliverse.admin.domain.entity.Mail;
|
||||
import com.caliverse.admin.domain.entity.SEARCHTYPE;
|
||||
import com.caliverse.admin.domain.entity.metadata.MetaSystemMailData;
|
||||
import com.caliverse.admin.dynamodb.domain.atrrib.MailJsonAttrib;
|
||||
import com.caliverse.admin.dynamodb.domain.doc.MailDoc;
|
||||
import com.caliverse.admin.dynamodb.domain.doc.MailJsonDoc;
|
||||
import com.caliverse.admin.dynamodb.dto.PageResult;
|
||||
import com.caliverse.admin.dynamodb.entity.MailItem;
|
||||
import com.caliverse.admin.dynamodb.repository.BaseDynamoDBRepository;
|
||||
import com.caliverse.admin.dynamodb.repository.MailJsonRepository;
|
||||
import com.caliverse.admin.dynamodb.repository.MailRepository;
|
||||
import com.caliverse.admin.dynamodb.service.DynamoDBOperations;
|
||||
import com.caliverse.admin.global.common.code.CommonCode;
|
||||
import com.caliverse.admin.global.common.code.ErrorCode;
|
||||
import com.caliverse.admin.global.common.constants.DynamoDBConstants;
|
||||
import com.caliverse.admin.global.common.exception.RestApiException;
|
||||
import com.caliverse.admin.global.common.utils.CommonUtils;
|
||||
import com.caliverse.admin.global.common.utils.DateUtils;
|
||||
import com.caliverse.admin.history.service.DynamodbHistoryLogService;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
import software.amazon.awssdk.services.dynamodb.model.AttributeValue;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static com.caliverse.admin.global.common.utils.CommonUtils.convertUTCDate;
|
||||
|
||||
@Component
|
||||
@Slf4j
|
||||
public class MailJsonRepositoryImpl extends BaseDynamoDBRepository<MailJsonDoc> implements MailJsonRepository {
|
||||
public MailJsonRepositoryImpl(DynamoDBOperations operations, DynamodbHistoryLogService dynamodbHistoryLogService, ObjectMapper objectMapper) {
|
||||
super(operations, MailJsonDoc.class, dynamodbHistoryLogService, objectMapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void insertRecvSystemMail(String userGuid, String nickname, List<MailItem> mailItems, MetaSystemMailData systemMailData, List<String> arguments) {
|
||||
try {
|
||||
LocalDateTime nowDate = LocalDateTime.now();
|
||||
LocalDateTime maxDate = DateUtils.getMaxTime();
|
||||
|
||||
String expireTime = DateUtils.stringToISODateTimeMillisNano(maxDate);
|
||||
|
||||
String pk = DynamoDBConstants.PK_KEY_RECV_MAIL + userGuid;
|
||||
String sk = String.format("%s-%s", DateUtils.getMailDateFormat(nowDate), CommonUtils.getCreateGuId().replace("-",""));
|
||||
|
||||
MailJsonAttrib attrib = new MailJsonAttrib();
|
||||
attrib.setMailGuid(sk);
|
||||
attrib.setRead(false);
|
||||
attrib.setGetItem(false);
|
||||
attrib.setSystemMail(true);
|
||||
attrib.setSenderNickName(systemMailData.getSender());
|
||||
attrib.setSenderGuid("");
|
||||
attrib.setReceiverNickName(nickname);
|
||||
attrib.setReceiverGuid(userGuid);
|
||||
attrib.setTitle(systemMailData.getMailTitle());
|
||||
attrib.setText(systemMailData.getMailDesc());
|
||||
attrib.setExpireTime(expireTime);
|
||||
attrib.setCreateTime(DateUtils.stringToISODateTimeMillisNano(nowDate));
|
||||
attrib.setTextByMetaData(true);
|
||||
attrib.setItemList(mailItems);
|
||||
attrib.setPackageOrderId("");
|
||||
attrib.setContentsArguments(arguments);
|
||||
|
||||
MailJsonDoc doc = new MailJsonDoc();
|
||||
doc.setPK(pk);
|
||||
doc.setSK(sk);
|
||||
doc.setDocType(DynamoDBConstants.DOC_Mail);
|
||||
doc.setAttribValue(objectMapper.writeValueAsString(attrib));
|
||||
doc.setCreatedDateTime(convertUTCDate(nowDate));
|
||||
doc.setUpdatedDateTime(convertUTCDate(nowDate));
|
||||
doc.setDeletedDateTime(DynamoDBConstants.MIN_DATE);
|
||||
doc.setRestoredDateTime(DynamoDBConstants.MIN_DATE);
|
||||
doc.setTtl(DateUtils.dateToISOUnixTime(maxDate));
|
||||
|
||||
save(doc);
|
||||
|
||||
log.info("MailDoc Recv Insert Success: {}", objectMapper.writeValueAsString(doc));
|
||||
|
||||
dynamodbHistoryLogService.insertHistoryLog(
|
||||
HISTORYTYPE.LAND_OWNER_CHANGE_MAIL,
|
||||
HISTORYTYPE.LAND_OWNER_CHANGE_MAIL.name(),
|
||||
doc
|
||||
);
|
||||
|
||||
}catch (Exception e){
|
||||
log.error("insert Error: {}", e.getMessage());
|
||||
throw new RestApiException(CommonCode.ERROR.getHttpStatus(), ErrorCode.DYNAMODB_CONNECTION_ERROR.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void insertSentMail(Mail mail) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MailJsonDoc> getMailList(String type, String userGuid, String sortKeyPrefix) {
|
||||
String pk;
|
||||
|
||||
if(type.equals(SEARCHTYPE.SEND.name())){
|
||||
pk = DynamoDBConstants.PK_KEY_RECV_MAIL + userGuid;
|
||||
}else{
|
||||
pk = DynamoDBConstants.PK_KEY_SENT_MAIL + userGuid;
|
||||
}
|
||||
|
||||
List<MailJsonDoc> mailList = findByPrefix(pk, sortKeyPrefix);
|
||||
|
||||
return mailList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<MailJsonDoc> getMailListWithPaging(
|
||||
SEARCHTYPE type,
|
||||
String userGuid,
|
||||
String sortKeyPrefix,
|
||||
String filterAttributeName,
|
||||
String filterAttributeValue,
|
||||
Map<String, AttributeValue> exclusiveStartKey,
|
||||
boolean sortIndex
|
||||
) {
|
||||
|
||||
String pk;
|
||||
if(type.equals(SEARCHTYPE.SEND)){
|
||||
pk = DynamoDBConstants.PK_KEY_SENT_MAIL + userGuid;
|
||||
} else {
|
||||
pk = DynamoDBConstants.PK_KEY_RECV_MAIL + userGuid;
|
||||
}
|
||||
|
||||
return findByPaging(
|
||||
pk,
|
||||
sortKeyPrefix,
|
||||
filterAttributeName,
|
||||
filterAttributeValue,
|
||||
exclusiveStartKey,
|
||||
sortIndex
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,144 @@
|
||||
package com.caliverse.admin.dynamodb.repository.Impl;
|
||||
|
||||
import com.caliverse.admin.domain.entity.HISTORYTYPE;
|
||||
import com.caliverse.admin.domain.entity.Mail;
|
||||
import com.caliverse.admin.domain.entity.SEARCHTYPE;
|
||||
import com.caliverse.admin.domain.entity.metadata.MetaSystemMailData;
|
||||
import com.caliverse.admin.dynamodb.domain.atrrib.MailAttrib;
|
||||
import com.caliverse.admin.dynamodb.domain.atrrib.MailItemAttrib;
|
||||
import com.caliverse.admin.dynamodb.domain.doc.MailDoc;
|
||||
import com.caliverse.admin.dynamodb.dto.PageResult;
|
||||
import com.caliverse.admin.dynamodb.entity.MailItem;
|
||||
import com.caliverse.admin.dynamodb.repository.BaseDynamoDBRepository;
|
||||
import com.caliverse.admin.dynamodb.repository.MailRepository;
|
||||
import com.caliverse.admin.dynamodb.service.DynamoDBOperations;
|
||||
import com.caliverse.admin.global.common.code.CommonCode;
|
||||
import com.caliverse.admin.global.common.code.ErrorCode;
|
||||
import com.caliverse.admin.global.common.constants.CommonConstants;
|
||||
import com.caliverse.admin.global.common.constants.DynamoDBConstants;
|
||||
import com.caliverse.admin.global.common.exception.RestApiException;
|
||||
import com.caliverse.admin.global.common.utils.CommonUtils;
|
||||
import com.caliverse.admin.global.common.utils.DateUtils;
|
||||
import com.caliverse.admin.history.service.DynamodbHistoryLogService;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
import software.amazon.awssdk.services.dynamodb.model.AttributeValue;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static com.caliverse.admin.global.common.utils.CommonUtils.convertUTCDate;
|
||||
|
||||
@Component
|
||||
@Slf4j
|
||||
public class MailRepositoryImpl extends BaseDynamoDBRepository<MailDoc> implements MailRepository {
|
||||
public MailRepositoryImpl(DynamoDBOperations operations, DynamodbHistoryLogService dynamodbHistoryLogService, ObjectMapper objectMapper) {
|
||||
super(operations, MailDoc.class, dynamodbHistoryLogService, objectMapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void insertRecvSystemMail(String userGuid, String nickname, List<MailItemAttrib> mailItems, MetaSystemMailData systemMailData, List<String> arguments) {
|
||||
try {
|
||||
LocalDateTime nowDate = LocalDateTime.now();
|
||||
LocalDateTime maxDate = DateUtils.getMaxTime();
|
||||
|
||||
String expireTime = DateUtils.stringToISODateTimeMillisNano(maxDate);
|
||||
|
||||
String pk = DynamoDBConstants.PK_KEY_RECV_MAIL + userGuid;
|
||||
String sk = String.format("%s-%s", DateUtils.getMailDateFormat(nowDate), CommonUtils.getCreateGuId().replace("-",""));
|
||||
|
||||
MailAttrib attrib = new MailAttrib();
|
||||
attrib.setMailGuid(sk);
|
||||
attrib.setIsRead(CommonConstants.FALSE);
|
||||
attrib.setIsGetItem(CommonConstants.FALSE);
|
||||
attrib.setIsSystemMail(CommonConstants.TRUE);
|
||||
attrib.setSenderNickName(systemMailData.getSender());
|
||||
attrib.setSenderGuid("");
|
||||
attrib.setReceiverNickName(nickname);
|
||||
attrib.setReceiverGuid(userGuid);
|
||||
attrib.setTitle(systemMailData.getMailTitle());
|
||||
attrib.setText(systemMailData.getMailDesc());
|
||||
attrib.setExpireTime(expireTime);
|
||||
attrib.setCreateTime(DateUtils.stringToISODateTimeMillisNano(nowDate));
|
||||
attrib.setIsTextByMetaData(CommonConstants.TRUE);
|
||||
attrib.setItemList(mailItems);
|
||||
attrib.setPackageOrderId("");
|
||||
attrib.setContentsArguments(arguments);
|
||||
|
||||
MailDoc doc = new MailDoc();
|
||||
doc.setPK(pk);
|
||||
doc.setSK(sk);
|
||||
doc.setDocType(DynamoDBConstants.DOC_Mail);
|
||||
doc.setAttribValue(attrib);
|
||||
doc.setCreatedDateTime(convertUTCDate(nowDate));
|
||||
doc.setUpdatedDateTime(convertUTCDate(nowDate));
|
||||
doc.setDeletedDateTime(DynamoDBConstants.MIN_DATE);
|
||||
doc.setRestoredDateTime(DynamoDBConstants.MIN_DATE);
|
||||
doc.setTtl(DateUtils.dateToISOUnixTime(maxDate));
|
||||
|
||||
save(doc);
|
||||
|
||||
log.info("MailDoc Recv Insert Success: {}", objectMapper.writeValueAsString(doc));
|
||||
|
||||
dynamodbHistoryLogService.insertHistoryLog(
|
||||
HISTORYTYPE.LAND_OWNER_CHANGE_MAIL,
|
||||
HISTORYTYPE.LAND_OWNER_CHANGE_MAIL.name(),
|
||||
doc
|
||||
);
|
||||
|
||||
}catch (Exception e){
|
||||
log.error("insert Error: {}", e.getMessage());
|
||||
throw new RestApiException(CommonCode.ERROR.getHttpStatus(), ErrorCode.DYNAMODB_CONNECTION_ERROR.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void insertSentMail(Mail mail) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MailDoc> getMailList(String type, String userGuid, String sortKeyPrefix) {
|
||||
String pk;
|
||||
|
||||
if(type.equals(SEARCHTYPE.SEND.name())){
|
||||
pk = DynamoDBConstants.PK_KEY_RECV_MAIL + userGuid;
|
||||
}else{
|
||||
pk = DynamoDBConstants.PK_KEY_SENT_MAIL + userGuid;
|
||||
}
|
||||
|
||||
List<MailDoc> mailList = findByPrefix(pk, sortKeyPrefix);
|
||||
|
||||
return mailList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<MailDoc> getMailListWithPaging(
|
||||
SEARCHTYPE type,
|
||||
String userGuid,
|
||||
String sortKeyPrefix,
|
||||
String filterAttributeName,
|
||||
String filterAttributeValue,
|
||||
Map<String, AttributeValue> exclusiveStartKey,
|
||||
boolean sortIndex
|
||||
) {
|
||||
|
||||
String pk;
|
||||
if(type.equals(SEARCHTYPE.SEND)){
|
||||
pk = DynamoDBConstants.PK_KEY_SENT_MAIL + userGuid;
|
||||
} else {
|
||||
pk = DynamoDBConstants.PK_KEY_RECV_MAIL + userGuid;
|
||||
}
|
||||
|
||||
return findByPaging(
|
||||
pk,
|
||||
sortKeyPrefix,
|
||||
filterAttributeName,
|
||||
filterAttributeValue,
|
||||
exclusiveStartKey,
|
||||
sortIndex
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -32,6 +32,8 @@ public class NicknameRepositoryImpl extends BaseDynamoDBRepository<NicknameDoc>
|
||||
|
||||
NicknameDoc doc = findById(key);
|
||||
|
||||
if (doc == null) return null;
|
||||
|
||||
try {
|
||||
return objectMapper.readValue(doc.getAttribValue(), NicknameAttrib.class);
|
||||
} catch (JsonProcessingException e) {
|
||||
|
||||
@@ -0,0 +1,139 @@
|
||||
package com.caliverse.admin.dynamodb.repository.Impl;
|
||||
|
||||
import com.caliverse.admin.domain.entity.HISTORYTYPE;
|
||||
import com.caliverse.admin.dynamodb.domain.atrrib.OwnedBuildingAttrib;
|
||||
import com.caliverse.admin.dynamodb.domain.doc.OwnedBuildingDoc;
|
||||
import com.caliverse.admin.dynamodb.entity.EOwnedType;
|
||||
import com.caliverse.admin.dynamodb.entity.DynamodbOperationResult;
|
||||
import com.caliverse.admin.dynamodb.repository.BaseDynamoDBRepository;
|
||||
import com.caliverse.admin.dynamodb.repository.OwnedBuildingRepository;
|
||||
import com.caliverse.admin.dynamodb.service.DynamoDBOperations;
|
||||
import com.caliverse.admin.global.common.code.CommonCode;
|
||||
import com.caliverse.admin.global.common.code.ErrorCode;
|
||||
import com.caliverse.admin.global.common.constants.DynamoDBConstants;
|
||||
import com.caliverse.admin.global.common.exception.RestApiException;
|
||||
import com.caliverse.admin.global.common.utils.CommonUtils;
|
||||
import com.caliverse.admin.history.service.DynamodbHistoryLogService;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
import software.amazon.awssdk.enhanced.dynamodb.Key;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static com.caliverse.admin.global.common.utils.CommonUtils.convertUTCDate;
|
||||
|
||||
@Component
|
||||
@Slf4j
|
||||
public class OwnedBuildingRepositoryImpl extends BaseDynamoDBRepository<OwnedBuildingDoc> implements OwnedBuildingRepository {
|
||||
public OwnedBuildingRepositoryImpl(DynamoDBOperations operations, DynamodbHistoryLogService dynamodbHistoryLogService, ObjectMapper objectMapper) {
|
||||
super(operations, OwnedBuildingDoc.class, dynamodbHistoryLogService, objectMapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public OwnedBuildingDoc findOwnedBuilding(String guid, Integer buildingId) {
|
||||
Key key = Key.builder()
|
||||
.partitionValue(DynamoDBConstants.PK_KEY_OWNED_BUILDING + guid)
|
||||
.sortValue(String.valueOf(buildingId))
|
||||
.build();
|
||||
|
||||
return findById(key);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void insert(String guid, Integer buildingId) {
|
||||
OwnedBuildingDoc ownedBuilding = findOwnedBuilding(guid, buildingId);
|
||||
if (ownedBuilding != null){
|
||||
log.warn("OwnedBuilding guid: {}, buildingId: {} Exist", guid, buildingId);
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
LocalDateTime nowDate = LocalDateTime.now();
|
||||
|
||||
String pk = DynamoDBConstants.PK_KEY_OWNED_BUILDING + guid;
|
||||
|
||||
OwnedBuildingAttrib attrib = new OwnedBuildingAttrib();
|
||||
attrib.setAttribType(DynamoDBConstants.ATTRIB_OWNED_BUILDING);
|
||||
attrib.setBuildingMetaId(buildingId);
|
||||
attrib.setOwnedType(EOwnedType.Own.getValue());
|
||||
|
||||
OwnedBuildingDoc doc = new OwnedBuildingDoc();
|
||||
doc.setPK(pk);
|
||||
doc.setSK(String.valueOf(buildingId));
|
||||
doc.setDocType(DynamoDBConstants.DOC_OWNED_BUILDING);
|
||||
doc.setAttribValue(objectMapper.writeValueAsString(attrib));
|
||||
doc.setCreatedDateTime(convertUTCDate(nowDate));
|
||||
doc.setUpdatedDateTime(convertUTCDate(nowDate));
|
||||
doc.setDeletedDateTime(DynamoDBConstants.MIN_DATE);
|
||||
doc.setRestoredDateTime(DynamoDBConstants.MIN_DATE);
|
||||
|
||||
save(doc);
|
||||
|
||||
log.info("OwnedBuildingDoc Insert Success: {}", objectMapper.writeValueAsString(doc));
|
||||
|
||||
dynamodbHistoryLogService.insertHistoryLog(
|
||||
HISTORYTYPE.LAND_OWNER_CHANGE_ADD,
|
||||
HISTORYTYPE.LAND_OWNER_CHANGE_ADD.name(),
|
||||
doc
|
||||
);
|
||||
|
||||
}catch (Exception e){
|
||||
log.error("insert Error: {}", e.getMessage());
|
||||
throw new RestApiException(CommonCode.ERROR.getHttpStatus(), ErrorCode.DYNAMODB_CONNECTION_ERROR.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delete(String guid, Integer buildingId) {
|
||||
try{
|
||||
Key key = Key.builder()
|
||||
.partitionValue(DynamoDBConstants.PK_KEY_OWNED_BUILDING + guid)
|
||||
.sortValue(String.valueOf(buildingId))
|
||||
.build();
|
||||
|
||||
OwnedBuildingDoc doc = findById(key);
|
||||
|
||||
delete(key);
|
||||
|
||||
log.info("OwnedBuildingDoc Delete Success: {}", objectMapper.writeValueAsString(doc));
|
||||
|
||||
dynamodbHistoryLogService.deleteHistoryLog(
|
||||
HISTORYTYPE.LAND_OWNER_CHANGE_UPDATE,
|
||||
HISTORYTYPE.LAND_OWNER_CHANGE_UPDATE.name(),
|
||||
doc
|
||||
);
|
||||
}catch (Exception e){
|
||||
log.error("delete Error: {}", e.getMessage());
|
||||
throw new RestApiException(CommonCode.ERROR.getHttpStatus(), ErrorCode.DYNAMODB_CONNECTION_ERROR.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public DynamodbOperationResult initOwnedBuilding(String guid, Integer buildingId) {
|
||||
try{
|
||||
Key key = Key.builder()
|
||||
.partitionValue(DynamoDBConstants.PK_KEY_OWNED_BUILDING + guid)
|
||||
.sortValue(String.valueOf(buildingId))
|
||||
.build();
|
||||
|
||||
OwnedBuildingDoc doc = findById(key);
|
||||
|
||||
delete(key);
|
||||
|
||||
log.info("OwnedBuildingDoc Delete Success: {}", objectMapper.writeValueAsString(doc));
|
||||
|
||||
dynamodbHistoryLogService.deleteHistoryLog(
|
||||
HISTORYTYPE.LAND_OWNED_INITIALIZE,
|
||||
HISTORYTYPE.LAND_OWNED_INITIALIZE.name(),
|
||||
doc
|
||||
);
|
||||
|
||||
return new DynamodbOperationResult(true, "", doc);
|
||||
}catch (Exception e){
|
||||
log.error("Init OwnedBuilding Error: {}", e.getMessage());
|
||||
return new DynamodbOperationResult(false, e.getMessage(), null);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,137 @@
|
||||
package com.caliverse.admin.dynamodb.repository.Impl;
|
||||
|
||||
import com.caliverse.admin.domain.entity.HISTORYTYPE;
|
||||
import com.caliverse.admin.dynamodb.domain.atrrib.OwnedLandAttrib;
|
||||
import com.caliverse.admin.dynamodb.domain.doc.OwnedLandDoc;
|
||||
import com.caliverse.admin.dynamodb.entity.EOwnedType;
|
||||
import com.caliverse.admin.dynamodb.entity.DynamodbOperationResult;
|
||||
import com.caliverse.admin.dynamodb.repository.BaseDynamoDBRepository;
|
||||
import com.caliverse.admin.dynamodb.repository.OwnedLandRepository;
|
||||
import com.caliverse.admin.dynamodb.service.DynamoDBOperations;
|
||||
import com.caliverse.admin.global.common.code.CommonCode;
|
||||
import com.caliverse.admin.global.common.code.ErrorCode;
|
||||
import com.caliverse.admin.global.common.constants.DynamoDBConstants;
|
||||
import com.caliverse.admin.global.common.exception.RestApiException;
|
||||
import com.caliverse.admin.global.common.utils.CommonUtils;
|
||||
import com.caliverse.admin.history.service.DynamodbHistoryLogService;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
import software.amazon.awssdk.enhanced.dynamodb.Key;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static com.caliverse.admin.global.common.utils.CommonUtils.convertUTCDate;
|
||||
|
||||
@Component
|
||||
@Slf4j
|
||||
public class OwnedLandRepositoryImpl extends BaseDynamoDBRepository<OwnedLandDoc> implements OwnedLandRepository {
|
||||
public OwnedLandRepositoryImpl(DynamoDBOperations operations, DynamodbHistoryLogService dynamodbHistoryLogService, ObjectMapper objectMapper) {
|
||||
super(operations, OwnedLandDoc.class, dynamodbHistoryLogService, objectMapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public OwnedLandDoc findOwnedLand(String guid, Integer landId) {
|
||||
Key key = Key.builder()
|
||||
.partitionValue(DynamoDBConstants.PK_KEY_OWNED_LAND + guid)
|
||||
.sortValue(String.valueOf(landId))
|
||||
.build();
|
||||
|
||||
return findById(key);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void insert(String guid, Integer landId) {
|
||||
OwnedLandDoc ownedLand = findOwnedLand(guid, landId);
|
||||
if (ownedLand != null) {
|
||||
log.warn("OwnedLand guid: {}, landId: {} Exist", guid, landId);
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
LocalDateTime nowDate = LocalDateTime.now();
|
||||
|
||||
String pk = DynamoDBConstants.PK_KEY_OWNED_LAND + guid;
|
||||
|
||||
OwnedLandAttrib attrib = new OwnedLandAttrib();
|
||||
attrib.setAttribType(DynamoDBConstants.ATTRIB_OWNED_LAND);
|
||||
attrib.setLandMetaId(landId);
|
||||
attrib.setOwnedType(EOwnedType.Own.getValue());
|
||||
|
||||
OwnedLandDoc doc = new OwnedLandDoc();
|
||||
doc.setPK(pk);
|
||||
doc.setSK(String.valueOf(landId));
|
||||
doc.setDocType(DynamoDBConstants.DOC_OWNED_LAND);
|
||||
doc.setAttribValue(objectMapper.writeValueAsString(attrib));
|
||||
doc.setCreatedDateTime(convertUTCDate(nowDate));
|
||||
doc.setUpdatedDateTime(convertUTCDate(nowDate));
|
||||
doc.setDeletedDateTime(DynamoDBConstants.MIN_DATE);
|
||||
doc.setRestoredDateTime(DynamoDBConstants.MIN_DATE);
|
||||
|
||||
save(doc);
|
||||
|
||||
log.info("OwnedLandDoc Insert Success: {}", objectMapper.writeValueAsString(doc));
|
||||
|
||||
dynamodbHistoryLogService.insertHistoryLog(
|
||||
HISTORYTYPE.LAND_OWNER_CHANGE_ADD,
|
||||
HISTORYTYPE.LAND_OWNER_CHANGE_ADD.name(),
|
||||
doc
|
||||
);
|
||||
|
||||
}catch (Exception e){
|
||||
log.error("insert Error: {}", e.getMessage());
|
||||
throw new RestApiException(CommonCode.ERROR.getHttpStatus(), ErrorCode.DYNAMODB_CONNECTION_ERROR.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delete(String guid, Integer landId) {
|
||||
try {
|
||||
Key key = Key.builder()
|
||||
.partitionValue(DynamoDBConstants.PK_KEY_OWNED_LAND + guid)
|
||||
.sortValue(String.valueOf(landId))
|
||||
.build();
|
||||
|
||||
OwnedLandDoc doc = findById(key);
|
||||
|
||||
delete(key);
|
||||
|
||||
log.info("OwnedLandDoc Delete Success: {}", objectMapper.writeValueAsString(doc));
|
||||
|
||||
dynamodbHistoryLogService.deleteHistoryLog(
|
||||
HISTORYTYPE.LAND_OWNER_CHANGE_UPDATE,
|
||||
HISTORYTYPE.LAND_OWNER_CHANGE_UPDATE.name(),
|
||||
doc
|
||||
);
|
||||
}catch (Exception e){
|
||||
log.error("delete Error: {}", e.getMessage());
|
||||
throw new RestApiException(CommonCode.ERROR.getHttpStatus(), ErrorCode.DYNAMODB_CONNECTION_ERROR.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public DynamodbOperationResult initOwnedLand(String guid, Integer landId) {
|
||||
try {
|
||||
Key key = Key.builder()
|
||||
.partitionValue(DynamoDBConstants.PK_KEY_OWNED_LAND + guid)
|
||||
.sortValue(String.valueOf(landId))
|
||||
.build();
|
||||
|
||||
OwnedLandDoc doc = findById(key);
|
||||
|
||||
delete(key);
|
||||
|
||||
log.info("OwnedLandDoc Delete Success: {}", objectMapper.writeValueAsString(doc));
|
||||
|
||||
dynamodbHistoryLogService.deleteHistoryLog(
|
||||
HISTORYTYPE.LAND_OWNER_CHANGE_UPDATE,
|
||||
HISTORYTYPE.LAND_OWNER_CHANGE_UPDATE.name(),
|
||||
doc
|
||||
);
|
||||
return new DynamodbOperationResult(true, "", doc);
|
||||
}catch (Exception e){
|
||||
log.error("Init OwnedLand Error: {}", e.getMessage());
|
||||
return new DynamodbOperationResult(false, e.getMessage(), null);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -63,9 +63,7 @@ public class SystemMetaMailRepositoryImpl extends BaseDynamoDBRepository<SystemM
|
||||
dynamodbHistoryLogService.insertHistoryLog(
|
||||
HISTORYTYPE.EVENT_ADD,
|
||||
HISTORYTYPE.EVENT_ADD.name(),
|
||||
doc,
|
||||
CommonConstants.SCHEDULE,
|
||||
""
|
||||
doc
|
||||
);
|
||||
|
||||
}catch (Exception e){
|
||||
|
||||
@@ -31,6 +31,7 @@ public class UserBaseRepositoryImpl extends BaseDynamoDBRepository<UserBaseDoc>
|
||||
.build();
|
||||
|
||||
UserBaseDoc doc = findById(key);
|
||||
if(doc == null) return null;
|
||||
|
||||
try {
|
||||
return objectMapper.readValue(doc.getAttribValue(), UserBaseAttrib.class);
|
||||
|
||||
@@ -2,8 +2,10 @@ package com.caliverse.admin.dynamodb.repository;
|
||||
|
||||
import com.caliverse.admin.domain.request.LandRequest;
|
||||
import com.caliverse.admin.dynamodb.domain.doc.LandAuctionActivityDoc;
|
||||
import com.caliverse.admin.dynamodb.entity.DynamodbOperationResult;
|
||||
|
||||
public interface LandAuctionActivityRepository extends DynamoDBRepository<LandAuctionActivityDoc> {
|
||||
void upsertActivity(LandRequest landRequest);
|
||||
int findAuctionNumber(Integer landId);
|
||||
DynamodbOperationResult initLandAuctionActivity(Integer landId, Integer auctionSeq);
|
||||
}
|
||||
|
||||
@@ -3,8 +3,10 @@ package com.caliverse.admin.dynamodb.repository;
|
||||
import com.caliverse.admin.domain.request.LandRequest;
|
||||
import com.caliverse.admin.dynamodb.domain.atrrib.LandAuctionHighestBidUserAttrib;
|
||||
import com.caliverse.admin.dynamodb.domain.doc.LandAuctionHighestBidUserDoc;
|
||||
import com.caliverse.admin.dynamodb.entity.DynamodbOperationResult;
|
||||
|
||||
public interface LandAuctionHighestBidUserRepository extends DynamoDBRepository<LandAuctionHighestBidUserDoc> {
|
||||
LandAuctionHighestBidUserAttrib findHighestBidUserAttrib(Integer landId, Integer auctionSeq);
|
||||
void insertHighestBidUser(LandRequest landRequest);
|
||||
DynamodbOperationResult initLandAuctionHighestBidUser(Integer landId, Integer auctionSeq);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
package com.caliverse.admin.dynamodb.repository;
|
||||
|
||||
import com.caliverse.admin.dynamodb.domain.doc.LandAuctionRecordDoc;
|
||||
import com.caliverse.admin.dynamodb.entity.DynamodbOperationResult;
|
||||
|
||||
public interface LandAuctionRecordRepository extends DynamoDBRepository<LandAuctionRecordDoc> {
|
||||
DynamodbOperationResult initLandAuctionRecord(Integer landId);
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package com.caliverse.admin.dynamodb.repository;
|
||||
|
||||
import com.caliverse.admin.dynamodb.domain.doc.LandAuctionRefundBidPriceDoc;
|
||||
import com.caliverse.admin.dynamodb.entity.DynamodbOperationResult;
|
||||
|
||||
public interface LandAuctionRefundBidPriceRepository extends DynamoDBRepository<LandAuctionRefundBidPriceDoc> {
|
||||
DynamodbOperationResult initLandAuctionRefundBidPrice(String guid, Integer landId, Integer auctionSeq);
|
||||
}
|
||||
@@ -3,6 +3,7 @@ package com.caliverse.admin.dynamodb.repository;
|
||||
import com.caliverse.admin.domain.request.LandRequest;
|
||||
import com.caliverse.admin.dynamodb.domain.atrrib.LandAuctionRegistryAttrib;
|
||||
import com.caliverse.admin.dynamodb.domain.doc.LandAuctionRegistryDoc;
|
||||
import com.caliverse.admin.dynamodb.entity.DynamodbOperationResult;
|
||||
|
||||
public interface LandAuctionRegistryRepository extends DynamoDBRepository<LandAuctionRegistryDoc> {
|
||||
LandAuctionRegistryAttrib findRegistryAttrib(Integer landId, Integer auctionSeq);
|
||||
@@ -10,4 +11,5 @@ public interface LandAuctionRegistryRepository extends DynamoDBRepository<LandAu
|
||||
void insertAuction(LandRequest landRequest);
|
||||
void updateAuction(LandRequest landRequest);
|
||||
int findAuctionNumber(Integer landId);
|
||||
DynamodbOperationResult initLandAuctionRegistry(Integer landId, Integer auctionSeq);
|
||||
}
|
||||
|
||||
@@ -3,9 +3,12 @@ package com.caliverse.admin.dynamodb.repository;
|
||||
import com.caliverse.admin.domain.request.LandRequest;
|
||||
import com.caliverse.admin.dynamodb.domain.atrrib.LandAttrib;
|
||||
import com.caliverse.admin.dynamodb.domain.doc.LandDoc;
|
||||
import com.caliverse.admin.dynamodb.entity.DynamodbOperationResult;
|
||||
|
||||
public interface LandRepository extends DynamoDBRepository<LandDoc> {
|
||||
LandAttrib findLandAttrib(Integer landId);
|
||||
void insertLand(LandRequest landRequest);
|
||||
void updateLand(LandRequest landRequest);
|
||||
DynamodbOperationResult initLandOwner(int landId);
|
||||
DynamodbOperationResult initLandDesc(int landId);
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user