우편 칼리움 첨부 및 차감 처리

아이템 수량 타입 int > double 변경
This commit is contained in:
2025-02-24 17:47:42 +09:00
parent 1a19b21f9a
commit 01271cbf72
18 changed files with 564 additions and 57 deletions

View File

@@ -23,6 +23,8 @@ private static final long serialVersionUID = 0L;
isTextByMetaData_ = 0; isTextByMetaData_ = 0;
itemList_ = java.util.Collections.emptyList(); itemList_ = java.util.Collections.emptyList();
guid_ = ""; guid_ = "";
isPermanentMail_ = 0;
contentsArguments_ = com.google.protobuf.LazyStringArrayList.EMPTY;
} }
@java.lang.Override @java.lang.Override
@@ -400,6 +402,76 @@ private static final long serialVersionUID = 0L;
} }
} }
public static final int ISPERMANENTMAIL_FIELD_NUMBER = 14;
private int isPermanentMail_ = 0;
/**
* <code>.BoolType isPermanentMail = 14;</code>
* @return The enum numeric value on the wire for isPermanentMail.
*/
@java.lang.Override public int getIsPermanentMailValue() {
return isPermanentMail_;
}
/**
* <code>.BoolType isPermanentMail = 14;</code>
* @return The isPermanentMail.
*/
@java.lang.Override public com.caliverse.admin.domain.RabbitMq.message.BoolType getIsPermanentMail() {
com.caliverse.admin.domain.RabbitMq.message.BoolType result = com.caliverse.admin.domain.RabbitMq.message.BoolType.forNumber(isPermanentMail_);
return result == null ? com.caliverse.admin.domain.RabbitMq.message.BoolType.UNRECOGNIZED : result;
}
public static final int CONTENTSARGUMENTS_FIELD_NUMBER = 15;
@SuppressWarnings("serial")
private com.google.protobuf.LazyStringList contentsArguments_;
/**
* <pre>
* isTextByMetaData == true <20>϶<EFBFBD> TextString.SourceString<6E><67> {index} ... <20><> <20>Ѱ<EFBFBD><D1B0>ֱ<EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD>ε<EFBFBD><CEB5><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
* </pre>
*
* <code>repeated string contentsArguments = 15;</code>
* @return A list containing the contentsArguments.
*/
public com.google.protobuf.ProtocolStringList
getContentsArgumentsList() {
return contentsArguments_;
}
/**
* <pre>
* isTextByMetaData == true <20>϶<EFBFBD> TextString.SourceString<6E><67> {index} ... <20><> <20>Ѱ<EFBFBD><D1B0>ֱ<EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD>ε<EFBFBD><CEB5><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
* </pre>
*
* <code>repeated string contentsArguments = 15;</code>
* @return The count of contentsArguments.
*/
public int getContentsArgumentsCount() {
return contentsArguments_.size();
}
/**
* <pre>
* isTextByMetaData == true <20>϶<EFBFBD> TextString.SourceString<6E><67> {index} ... <20><> <20>Ѱ<EFBFBD><D1B0>ֱ<EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD>ε<EFBFBD><CEB5><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
* </pre>
*
* <code>repeated string contentsArguments = 15;</code>
* @param index The index of the element to return.
* @return The contentsArguments at the given index.
*/
public java.lang.String getContentsArguments(int index) {
return contentsArguments_.get(index);
}
/**
* <pre>
* isTextByMetaData == true <20>϶<EFBFBD> TextString.SourceString<6E><67> {index} ... <20><> <20>Ѱ<EFBFBD><D1B0>ֱ<EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD>ε<EFBFBD><CEB5><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
* </pre>
*
* <code>repeated string contentsArguments = 15;</code>
* @param index The index of the value to return.
* @return The bytes of the contentsArguments at the given index.
*/
public com.google.protobuf.ByteString
getContentsArgumentsBytes(int index) {
return contentsArguments_.getByteString(index);
}
private byte memoizedIsInitialized = -1; private byte memoizedIsInitialized = -1;
@java.lang.Override @java.lang.Override
public final boolean isInitialized() { public final boolean isInitialized() {
@@ -453,6 +525,12 @@ private static final long serialVersionUID = 0L;
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(guid_)) { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(guid_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 13, guid_); com.google.protobuf.GeneratedMessageV3.writeString(output, 13, guid_);
} }
if (isPermanentMail_ != com.caliverse.admin.domain.RabbitMq.message.BoolType.BoolType_None.getNumber()) {
output.writeEnum(14, isPermanentMail_);
}
for (int i = 0; i < contentsArguments_.size(); i++) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 15, contentsArguments_.getRaw(i));
}
getUnknownFields().writeTo(output); getUnknownFields().writeTo(output);
} }
@@ -509,6 +587,18 @@ private static final long serialVersionUID = 0L;
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(guid_)) { if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(guid_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(13, guid_); size += com.google.protobuf.GeneratedMessageV3.computeStringSize(13, guid_);
} }
if (isPermanentMail_ != com.caliverse.admin.domain.RabbitMq.message.BoolType.BoolType_None.getNumber()) {
size += com.google.protobuf.CodedOutputStream
.computeEnumSize(14, isPermanentMail_);
}
{
int dataSize = 0;
for (int i = 0; i < contentsArguments_.size(); i++) {
dataSize += computeStringSizeNoTag(contentsArguments_.getRaw(i));
}
size += dataSize;
size += 1 * getContentsArgumentsList().size();
}
size += getUnknownFields().getSerializedSize(); size += getUnknownFields().getSerializedSize();
memoizedSize = size; memoizedSize = size;
return size; return size;
@@ -555,6 +645,9 @@ private static final long serialVersionUID = 0L;
.equals(other.getItemListList())) return false; .equals(other.getItemListList())) return false;
if (!getGuid() if (!getGuid()
.equals(other.getGuid())) return false; .equals(other.getGuid())) return false;
if (isPermanentMail_ != other.isPermanentMail_) return false;
if (!getContentsArgumentsList()
.equals(other.getContentsArgumentsList())) return false;
if (!getUnknownFields().equals(other.getUnknownFields())) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false;
return true; return true;
} }
@@ -598,6 +691,12 @@ private static final long serialVersionUID = 0L;
} }
hash = (37 * hash) + GUID_FIELD_NUMBER; hash = (37 * hash) + GUID_FIELD_NUMBER;
hash = (53 * hash) + getGuid().hashCode(); hash = (53 * hash) + getGuid().hashCode();
hash = (37 * hash) + ISPERMANENTMAIL_FIELD_NUMBER;
hash = (53 * hash) + isPermanentMail_;
if (getContentsArgumentsCount() > 0) {
hash = (37 * hash) + CONTENTSARGUMENTS_FIELD_NUMBER;
hash = (53 * hash) + getContentsArgumentsList().hashCode();
}
hash = (29 * hash) + getUnknownFields().hashCode(); hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash; memoizedHashCode = hash;
return hash; return hash;
@@ -754,6 +853,9 @@ private static final long serialVersionUID = 0L;
} }
bitField0_ = (bitField0_ & ~0x00000800); bitField0_ = (bitField0_ & ~0x00000800);
guid_ = ""; guid_ = "";
isPermanentMail_ = 0;
contentsArguments_ = com.google.protobuf.LazyStringArrayList.EMPTY;
bitField0_ = (bitField0_ & ~0x00004000);
return this; return this;
} }
@@ -796,6 +898,11 @@ private static final long serialVersionUID = 0L;
} else { } else {
result.itemList_ = itemListBuilder_.build(); result.itemList_ = itemListBuilder_.build();
} }
if (((bitField0_ & 0x00004000) != 0)) {
contentsArguments_ = contentsArguments_.getUnmodifiableView();
bitField0_ = (bitField0_ & ~0x00004000);
}
result.contentsArguments_ = contentsArguments_;
} }
private void buildPartial0(com.caliverse.admin.domain.RabbitMq.message.MailInfo result) { private void buildPartial0(com.caliverse.admin.domain.RabbitMq.message.MailInfo result) {
@@ -840,6 +947,9 @@ private static final long serialVersionUID = 0L;
if (((from_bitField0_ & 0x00001000) != 0)) { if (((from_bitField0_ & 0x00001000) != 0)) {
result.guid_ = guid_; result.guid_ = guid_;
} }
if (((from_bitField0_ & 0x00002000) != 0)) {
result.isPermanentMail_ = isPermanentMail_;
}
} }
@java.lang.Override @java.lang.Override
@@ -958,6 +1068,19 @@ private static final long serialVersionUID = 0L;
bitField0_ |= 0x00001000; bitField0_ |= 0x00001000;
onChanged(); onChanged();
} }
if (other.isPermanentMail_ != 0) {
setIsPermanentMailValue(other.getIsPermanentMailValue());
}
if (!other.contentsArguments_.isEmpty()) {
if (contentsArguments_.isEmpty()) {
contentsArguments_ = other.contentsArguments_;
bitField0_ = (bitField0_ & ~0x00004000);
} else {
ensureContentsArgumentsIsMutable();
contentsArguments_.addAll(other.contentsArguments_);
}
onChanged();
}
this.mergeUnknownFields(other.getUnknownFields()); this.mergeUnknownFields(other.getUnknownFields());
onChanged(); onChanged();
return this; return this;
@@ -1061,6 +1184,17 @@ private static final long serialVersionUID = 0L;
bitField0_ |= 0x00001000; bitField0_ |= 0x00001000;
break; break;
} // case 106 } // case 106
case 112: {
isPermanentMail_ = input.readEnum();
bitField0_ |= 0x00002000;
break;
} // case 112
case 122: {
java.lang.String s = input.readStringRequireUtf8();
ensureContentsArgumentsIsMutable();
contentsArguments_.add(s);
break;
} // case 122
default: { default: {
if (!super.parseUnknownField(input, extensionRegistry, tag)) { if (!super.parseUnknownField(input, extensionRegistry, tag)) {
done = true; // was an endgroup tag done = true; // was an endgroup tag
@@ -2096,6 +2230,199 @@ private static final long serialVersionUID = 0L;
onChanged(); onChanged();
return this; return this;
} }
private int isPermanentMail_ = 0;
/**
* <code>.BoolType isPermanentMail = 14;</code>
* @return The enum numeric value on the wire for isPermanentMail.
*/
@java.lang.Override public int getIsPermanentMailValue() {
return isPermanentMail_;
}
/**
* <code>.BoolType isPermanentMail = 14;</code>
* @param value The enum numeric value on the wire for isPermanentMail to set.
* @return This builder for chaining.
*/
public Builder setIsPermanentMailValue(int value) {
isPermanentMail_ = value;
bitField0_ |= 0x00002000;
onChanged();
return this;
}
/**
* <code>.BoolType isPermanentMail = 14;</code>
* @return The isPermanentMail.
*/
@java.lang.Override
public com.caliverse.admin.domain.RabbitMq.message.BoolType getIsPermanentMail() {
com.caliverse.admin.domain.RabbitMq.message.BoolType result = com.caliverse.admin.domain.RabbitMq.message.BoolType.forNumber(isPermanentMail_);
return result == null ? com.caliverse.admin.domain.RabbitMq.message.BoolType.UNRECOGNIZED : result;
}
/**
* <code>.BoolType isPermanentMail = 14;</code>
* @param value The isPermanentMail to set.
* @return This builder for chaining.
*/
public Builder setIsPermanentMail(com.caliverse.admin.domain.RabbitMq.message.BoolType value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00002000;
isPermanentMail_ = value.getNumber();
onChanged();
return this;
}
/**
* <code>.BoolType isPermanentMail = 14;</code>
* @return This builder for chaining.
*/
public Builder clearIsPermanentMail() {
bitField0_ = (bitField0_ & ~0x00002000);
isPermanentMail_ = 0;
onChanged();
return this;
}
private com.google.protobuf.LazyStringList contentsArguments_ = com.google.protobuf.LazyStringArrayList.EMPTY;
private void ensureContentsArgumentsIsMutable() {
if (!((bitField0_ & 0x00004000) != 0)) {
contentsArguments_ = new com.google.protobuf.LazyStringArrayList(contentsArguments_);
bitField0_ |= 0x00004000;
}
}
/**
* <pre>
* isTextByMetaData == true <20>϶<EFBFBD> TextString.SourceString<6E><67> {index} ... <20><> <20>Ѱ<EFBFBD><D1B0>ֱ<EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD>ε<EFBFBD><CEB5><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
* </pre>
*
* <code>repeated string contentsArguments = 15;</code>
* @return A list containing the contentsArguments.
*/
public com.google.protobuf.ProtocolStringList
getContentsArgumentsList() {
return contentsArguments_.getUnmodifiableView();
}
/**
* <pre>
* isTextByMetaData == true <20>϶<EFBFBD> TextString.SourceString<6E><67> {index} ... <20><> <20>Ѱ<EFBFBD><D1B0>ֱ<EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD>ε<EFBFBD><CEB5><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
* </pre>
*
* <code>repeated string contentsArguments = 15;</code>
* @return The count of contentsArguments.
*/
public int getContentsArgumentsCount() {
return contentsArguments_.size();
}
/**
* <pre>
* isTextByMetaData == true <20>϶<EFBFBD> TextString.SourceString<6E><67> {index} ... <20><> <20>Ѱ<EFBFBD><D1B0>ֱ<EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD>ε<EFBFBD><CEB5><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
* </pre>
*
* <code>repeated string contentsArguments = 15;</code>
* @param index The index of the element to return.
* @return The contentsArguments at the given index.
*/
public java.lang.String getContentsArguments(int index) {
return contentsArguments_.get(index);
}
/**
* <pre>
* isTextByMetaData == true <20>϶<EFBFBD> TextString.SourceString<6E><67> {index} ... <20><> <20>Ѱ<EFBFBD><D1B0>ֱ<EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD>ε<EFBFBD><CEB5><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
* </pre>
*
* <code>repeated string contentsArguments = 15;</code>
* @param index The index of the value to return.
* @return The bytes of the contentsArguments at the given index.
*/
public com.google.protobuf.ByteString
getContentsArgumentsBytes(int index) {
return contentsArguments_.getByteString(index);
}
/**
* <pre>
* isTextByMetaData == true <20>϶<EFBFBD> TextString.SourceString<6E><67> {index} ... <20><> <20>Ѱ<EFBFBD><D1B0>ֱ<EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD>ε<EFBFBD><CEB5><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
* </pre>
*
* <code>repeated string contentsArguments = 15;</code>
* @param index The index to set the value at.
* @param value The contentsArguments to set.
* @return This builder for chaining.
*/
public Builder setContentsArguments(
int index, java.lang.String value) {
if (value == null) { throw new NullPointerException(); }
ensureContentsArgumentsIsMutable();
contentsArguments_.set(index, value);
onChanged();
return this;
}
/**
* <pre>
* isTextByMetaData == true <20>϶<EFBFBD> TextString.SourceString<6E><67> {index} ... <20><> <20>Ѱ<EFBFBD><D1B0>ֱ<EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD>ε<EFBFBD><CEB5><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
* </pre>
*
* <code>repeated string contentsArguments = 15;</code>
* @param value The contentsArguments to add.
* @return This builder for chaining.
*/
public Builder addContentsArguments(
java.lang.String value) {
if (value == null) { throw new NullPointerException(); }
ensureContentsArgumentsIsMutable();
contentsArguments_.add(value);
onChanged();
return this;
}
/**
* <pre>
* isTextByMetaData == true <20>϶<EFBFBD> TextString.SourceString<6E><67> {index} ... <20><> <20>Ѱ<EFBFBD><D1B0>ֱ<EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD>ε<EFBFBD><CEB5><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
* </pre>
*
* <code>repeated string contentsArguments = 15;</code>
* @param values The contentsArguments to add.
* @return This builder for chaining.
*/
public Builder addAllContentsArguments(
java.lang.Iterable<java.lang.String> values) {
ensureContentsArgumentsIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(
values, contentsArguments_);
onChanged();
return this;
}
/**
* <pre>
* isTextByMetaData == true <20>϶<EFBFBD> TextString.SourceString<6E><67> {index} ... <20><> <20>Ѱ<EFBFBD><D1B0>ֱ<EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD>ε<EFBFBD><CEB5><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
* </pre>
*
* <code>repeated string contentsArguments = 15;</code>
* @return This builder for chaining.
*/
public Builder clearContentsArguments() {
contentsArguments_ = com.google.protobuf.LazyStringArrayList.EMPTY;
bitField0_ = (bitField0_ & ~0x00004000);
onChanged();
return this;
}
/**
* <pre>
* isTextByMetaData == true <20>϶<EFBFBD> TextString.SourceString<6E><67> {index} ... <20><> <20>Ѱ<EFBFBD><D1B0>ֱ<EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD>ε<EFBFBD><CEB5><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
* </pre>
*
* <code>repeated string contentsArguments = 15;</code>
* @param value The bytes of the contentsArguments to add.
* @return This builder for chaining.
*/
public Builder addContentsArgumentsBytes(
com.google.protobuf.ByteString value) {
if (value == null) { throw new NullPointerException(); }
checkByteStringIsUtf8(value);
ensureContentsArgumentsIsMutable();
contentsArguments_.add(value);
onChanged();
return this;
}
@java.lang.Override @java.lang.Override
public final Builder setUnknownFields( public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) { final com.google.protobuf.UnknownFieldSet unknownFields) {

View File

@@ -155,4 +155,56 @@ public interface MailInfoOrBuilder extends
*/ */
com.google.protobuf.ByteString com.google.protobuf.ByteString
getGuidBytes(); getGuidBytes();
/**
* <code>.BoolType isPermanentMail = 14;</code>
* @return The enum numeric value on the wire for isPermanentMail.
*/
int getIsPermanentMailValue();
/**
* <code>.BoolType isPermanentMail = 14;</code>
* @return The isPermanentMail.
*/
com.caliverse.admin.domain.RabbitMq.message.BoolType getIsPermanentMail();
/**
* <pre>
* isTextByMetaData == true <20>϶<EFBFBD> TextString.SourceString<6E><67> {index} ... <20><> <20>Ѱ<EFBFBD><D1B0>ֱ<EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD>ε<EFBFBD><CEB5><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
* </pre>
*
* <code>repeated string contentsArguments = 15;</code>
* @return A list containing the contentsArguments.
*/
java.util.List<java.lang.String>
getContentsArgumentsList();
/**
* <pre>
* isTextByMetaData == true <20>϶<EFBFBD> TextString.SourceString<6E><67> {index} ... <20><> <20>Ѱ<EFBFBD><D1B0>ֱ<EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD>ε<EFBFBD><CEB5><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
* </pre>
*
* <code>repeated string contentsArguments = 15;</code>
* @return The count of contentsArguments.
*/
int getContentsArgumentsCount();
/**
* <pre>
* isTextByMetaData == true <20>϶<EFBFBD> TextString.SourceString<6E><67> {index} ... <20><> <20>Ѱ<EFBFBD><D1B0>ֱ<EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD>ε<EFBFBD><CEB5><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
* </pre>
*
* <code>repeated string contentsArguments = 15;</code>
* @param index The index of the element to return.
* @return The contentsArguments at the given index.
*/
java.lang.String getContentsArguments(int index);
/**
* <pre>
* isTextByMetaData == true <20>϶<EFBFBD> TextString.SourceString<6E><67> {index} ... <20><> <20>Ѱ<EFBFBD><D1B0>ֱ<EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD>ε<EFBFBD><CEB5><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
* </pre>
*
* <code>repeated string contentsArguments = 15;</code>
* @param index The index of the value to return.
* @return The bytes of the contentsArguments at the given index.
*/
com.google.protobuf.ByteString
getContentsArgumentsBytes(int index);
} }

View File

@@ -55,13 +55,13 @@ private static final long serialVersionUID = 0L;
} }
public static final int COUNT_FIELD_NUMBER = 2; public static final int COUNT_FIELD_NUMBER = 2;
private int count_ = 0; private double count_ = 0D;
/** /**
* <code>int32 count = 2;</code> * <code>double count = 2;</code>
* @return The count. * @return The count.
*/ */
@java.lang.Override @java.lang.Override
public int getCount() { public double getCount() {
return count_; return count_;
} }
@@ -82,8 +82,8 @@ private static final long serialVersionUID = 0L;
if (itemId_ != 0) { if (itemId_ != 0) {
output.writeInt32(1, itemId_); output.writeInt32(1, itemId_);
} }
if (count_ != 0) { if (java.lang.Double.doubleToRawLongBits(count_) != 0) {
output.writeInt32(2, count_); output.writeDouble(2, count_);
} }
getUnknownFields().writeTo(output); getUnknownFields().writeTo(output);
} }
@@ -98,9 +98,9 @@ private static final long serialVersionUID = 0L;
size += com.google.protobuf.CodedOutputStream size += com.google.protobuf.CodedOutputStream
.computeInt32Size(1, itemId_); .computeInt32Size(1, itemId_);
} }
if (count_ != 0) { if (java.lang.Double.doubleToRawLongBits(count_) != 0) {
size += com.google.protobuf.CodedOutputStream size += com.google.protobuf.CodedOutputStream
.computeInt32Size(2, count_); .computeDoubleSize(2, count_);
} }
size += getUnknownFields().getSerializedSize(); size += getUnknownFields().getSerializedSize();
memoizedSize = size; memoizedSize = size;
@@ -119,8 +119,9 @@ private static final long serialVersionUID = 0L;
if (getItemId() if (getItemId()
!= other.getItemId()) return false; != other.getItemId()) return false;
if (getCount() if (java.lang.Double.doubleToLongBits(getCount())
!= other.getCount()) return false; != java.lang.Double.doubleToLongBits(
other.getCount())) return false;
if (!getUnknownFields().equals(other.getUnknownFields())) return false; if (!getUnknownFields().equals(other.getUnknownFields())) return false;
return true; return true;
} }
@@ -135,7 +136,8 @@ private static final long serialVersionUID = 0L;
hash = (37 * hash) + ITEMID_FIELD_NUMBER; hash = (37 * hash) + ITEMID_FIELD_NUMBER;
hash = (53 * hash) + getItemId(); hash = (53 * hash) + getItemId();
hash = (37 * hash) + COUNT_FIELD_NUMBER; hash = (37 * hash) + COUNT_FIELD_NUMBER;
hash = (53 * hash) + getCount(); hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
java.lang.Double.doubleToLongBits(getCount()));
hash = (29 * hash) + getUnknownFields().hashCode(); hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash; memoizedHashCode = hash;
return hash; return hash;
@@ -266,7 +268,7 @@ private static final long serialVersionUID = 0L;
super.clear(); super.clear();
bitField0_ = 0; bitField0_ = 0;
itemId_ = 0; itemId_ = 0;
count_ = 0; count_ = 0D;
return this; return this;
} }
@@ -355,7 +357,7 @@ private static final long serialVersionUID = 0L;
if (other.getItemId() != 0) { if (other.getItemId() != 0) {
setItemId(other.getItemId()); setItemId(other.getItemId());
} }
if (other.getCount() != 0) { if (other.getCount() != 0D) {
setCount(other.getCount()); setCount(other.getCount());
} }
this.mergeUnknownFields(other.getUnknownFields()); this.mergeUnknownFields(other.getUnknownFields());
@@ -389,11 +391,11 @@ private static final long serialVersionUID = 0L;
bitField0_ |= 0x00000001; bitField0_ |= 0x00000001;
break; break;
} // case 8 } // case 8
case 16: { case 17: {
count_ = input.readInt32(); count_ = input.readDouble();
bitField0_ |= 0x00000002; bitField0_ |= 0x00000002;
break; break;
} // case 16 } // case 17
default: { default: {
if (!super.parseUnknownField(input, extensionRegistry, tag)) { if (!super.parseUnknownField(input, extensionRegistry, tag)) {
done = true; // was an endgroup tag done = true; // was an endgroup tag
@@ -443,21 +445,21 @@ private static final long serialVersionUID = 0L;
return this; return this;
} }
private int count_ ; private double count_ ;
/** /**
* <code>int32 count = 2;</code> * <code>double count = 2;</code>
* @return The count. * @return The count.
*/ */
@java.lang.Override @java.lang.Override
public int getCount() { public double getCount() {
return count_; return count_;
} }
/** /**
* <code>int32 count = 2;</code> * <code>double count = 2;</code>
* @param value The count to set. * @param value The count to set.
* @return This builder for chaining. * @return This builder for chaining.
*/ */
public Builder setCount(int value) { public Builder setCount(double value) {
count_ = value; count_ = value;
bitField0_ |= 0x00000002; bitField0_ |= 0x00000002;
@@ -465,12 +467,12 @@ private static final long serialVersionUID = 0L;
return this; return this;
} }
/** /**
* <code>int32 count = 2;</code> * <code>double count = 2;</code>
* @return This builder for chaining. * @return This builder for chaining.
*/ */
public Builder clearCount() { public Builder clearCount() {
bitField0_ = (bitField0_ & ~0x00000002); bitField0_ = (bitField0_ & ~0x00000002);
count_ = 0; count_ = 0D;
onChanged(); onChanged();
return this; return this;
} }

View File

@@ -14,8 +14,8 @@ public interface MailItemOrBuilder extends
int getItemId(); int getItemId();
/** /**
* <code>int32 count = 2;</code> * <code>double count = 2;</code>
* @return The count. * @return The count.
*/ */
int getCount(); double getCount();
} }

View File

@@ -30,6 +30,7 @@ import lombok.RequiredArgsConstructor;
public class MailController { public class MailController {
private final MailService mailService; private final MailService mailService;
// 우편 조회 // 우편 조회
@GetMapping("/list") @GetMapping("/list")
public ResponseEntity<MailResponse> getList( public ResponseEntity<MailResponse> getList(
@@ -83,4 +84,10 @@ public class MailController {
@RequestBody Map<String, String> item) { @RequestBody Map<String, String> item) {
return ResponseEntity.ok().body(mailService.getMetaItem(item.get("item"))); return ResponseEntity.ok().body(mailService.getMetaItem(item.get("item")));
} }
// 칼리움 수량 조회
@GetMapping("/calium")
public ResponseEntity<MailResponse> getCalium(){
return ResponseEntity.ok().body(mailService.getStockCalium());
}
} }

View File

@@ -17,5 +17,5 @@ public class Item {
@JsonProperty("item_name") @JsonProperty("item_name")
private String itemName; private String itemName;
@JsonProperty("item_cnt") @JsonProperty("item_cnt")
private Integer itemCnt; private Double itemCnt;
} }

View File

@@ -74,7 +74,7 @@ public class MailRequest {
@JsonProperty("item_id") @JsonProperty("item_id")
private Long itemId; private Long itemId;
@JsonProperty("parrent_count") @JsonProperty("parrent_count")
private Integer parrentCount; private Double parrentCount;
private Integer count; private Double count;
} }
} }

View File

@@ -45,6 +45,9 @@ public class MailResponse {
@JsonProperty("page_no") @JsonProperty("page_no")
private int pageNo; private int pageNo;
@JsonProperty("stock_calium")
private double stockCalium;
@JsonProperty("item_info") @JsonProperty("item_info")
private Item itemInfo; private Item itemInfo;
} }

View File

@@ -264,7 +264,7 @@ public class UsersResponse {
private Long itemId; private Long itemId;
@JsonProperty("item_name") @JsonProperty("item_name")
private String itemName; private String itemName;
private Integer count; private Double count;
private Integer level; private Integer level;
private Integer slot; private Integer slot;
} }
@@ -273,7 +273,7 @@ public class UsersResponse {
public static class Item{ public static class Item{
@JsonProperty("item_id") @JsonProperty("item_id")
private String itemId; private String itemId;
private Integer count; private Double count;
@JsonProperty("item_name") @JsonProperty("item_name")
private String itemName; private String itemName;
@JsonProperty("item_guid") @JsonProperty("item_guid")
@@ -392,7 +392,7 @@ public class UsersResponse {
private String itemId; private String itemId;
@JsonProperty("item_name") @JsonProperty("item_name")
private String itemName; private String itemName;
private int count; private double count;
} }
} }

View File

@@ -1362,7 +1362,7 @@ public class DynamoDBService {
UsersResponse.Item inventory = UsersResponse.Item.builder() UsersResponse.Item inventory = UsersResponse.Item.builder()
.itemId(CommonUtils.objectToString(item_id)) .itemId(CommonUtils.objectToString(item_id))
.itemName(item_nm) .itemName(item_nm)
.count(CommonUtils.objectToInteger(attrMap.get("item_stack_count"))) .count(CommonUtils.objectToDouble(attrMap.get("item_stack_count")))
.itemGuid(CommonUtils.objectToString(attrMap.get("item_guid"))) .itemGuid(CommonUtils.objectToString(attrMap.get("item_guid")))
.build(); .build();
@@ -1415,7 +1415,7 @@ public class DynamoDBService {
for (Map<String,Object> val : (List<Map<String,Object>>)attrMap.get("item_list")){ for (Map<String,Object> val : (List<Map<String,Object>>)attrMap.get("item_list")){
UsersResponse.MailItem item = new UsersResponse.MailItem(); UsersResponse.MailItem item = new UsersResponse.MailItem();
item.setItemId(CommonUtils.objectToString(val.get("ItemId"))); item.setItemId(CommonUtils.objectToString(val.get("ItemId")));
item.setCount(CommonUtils.objectToInteger(val.get("Count"))); item.setCount(CommonUtils.objectToDouble(val.get("Count")));
String item_nm = metaDataHandler.getMetaItemNameData(CommonUtils.objectToInteger(val.get("ItemId"))); String item_nm = metaDataHandler.getMetaItemNameData(CommonUtils.objectToInteger(val.get("ItemId")));
item.setItemName(metaDataHandler.getTextStringData(item_nm)); item.setItemName(metaDataHandler.getTextStringData(item_nm));
itemList.add(item); itemList.add(item);
@@ -1485,7 +1485,7 @@ public class DynamoDBService {
} }
// 유저 조회 - 우편 아이템 삭제 // 유저 조회 - 우편 아이템 삭제
public JSONObject updateMailItem(String type, String guid, String mail_guid, Long itemId, int count, int newCount) { public JSONObject updateMailItem(String type, String guid, String mail_guid, Long itemId, double count, double newCount) {
try { try {
Map<String, AttributeValue> item = null; Map<String, AttributeValue> item = null;
Map<String, AttributeValue> key = new HashMap<>(); Map<String, AttributeValue> key = new HashMap<>();
@@ -1871,7 +1871,7 @@ public class DynamoDBService {
UsersResponse.Item item = UsersResponse.Item.builder() UsersResponse.Item item = UsersResponse.Item.builder()
.itemId(item_id) .itemId(item_id)
.itemName(metaDataHandler.getTextStringData(item_name)) .itemName(metaDataHandler.getTextStringData(item_name))
.count(CommonUtils.objectToInteger(attrMap2.get("item_stack_count"))) .count(CommonUtils.objectToDouble(attrMap2.get("item_stack_count")))
.itemGuid(CommonUtils.objectToString(attrMap2.get("item_guid"))) .itemGuid(CommonUtils.objectToString(attrMap2.get("item_guid")))
.build(); .build();
itemList.add(item); itemList.add(item);

View File

@@ -7,9 +7,11 @@ import com.caliverse.admin.domain.datacomponent.MetaDataHandler;
import com.caliverse.admin.domain.entity.*; import com.caliverse.admin.domain.entity.*;
import com.caliverse.admin.domain.request.MailRequest; import com.caliverse.admin.domain.request.MailRequest;
import com.caliverse.admin.domain.response.MailResponse; import com.caliverse.admin.domain.response.MailResponse;
import com.caliverse.admin.dynamodb.service.DynamodbCaliumService;
import com.caliverse.admin.global.common.code.CommonCode; import com.caliverse.admin.global.common.code.CommonCode;
import com.caliverse.admin.global.common.code.ErrorCode; import com.caliverse.admin.global.common.code.ErrorCode;
import com.caliverse.admin.global.common.code.SuccessCode; import com.caliverse.admin.global.common.code.SuccessCode;
import com.caliverse.admin.global.common.constants.CommonConstants;
import com.caliverse.admin.global.common.exception.RestApiException; import com.caliverse.admin.global.common.exception.RestApiException;
import com.caliverse.admin.global.common.utils.CommonUtils; import com.caliverse.admin.global.common.utils.CommonUtils;
import com.caliverse.admin.global.common.utils.ExcelUtils; import com.caliverse.admin.global.common.utils.ExcelUtils;
@@ -51,6 +53,20 @@ public class MailService {
private final ResourceLoader resourceLoader; private final ResourceLoader resourceLoader;
private final ScheduleService scheduleService; private final ScheduleService scheduleService;
private final HistoryService historyService; private final HistoryService historyService;
private final DynamodbCaliumService dynamodbCaliumService;
public MailResponse getStockCalium(){
double stock_calium = dynamodbCaliumService.getCaliumTotal();
return MailResponse.builder()
.status(CommonCode.SUCCESS.getHttpStatus())
.result(CommonCode.SUCCESS.getResult())
.resultData(MailResponse.ResultData.builder()
.stockCalium(stock_calium)
.build()
)
.build();
}
public MailResponse getList(Map requestParam){ public MailResponse getList(Map requestParam){
@@ -176,7 +192,7 @@ public class MailService {
guid = getGuid(guid, Mail.USERTYPE.NICKNAME.name()); guid = getGuid(guid, Mail.USERTYPE.NICKNAME.name());
if(guid == null || mailRequest.getGuid().equals(guid)){ if(guid == null || mailRequest.getGuid().equals(guid)){
log.error("postMail RECEIVETYPE Single Nickname Find Fail"); log.error("postMail RECEIVETYPE Single Nickname Find Fail");
throw new RestApiException(CommonCode.ERROR.getHttpStatus(), ErrorCode.DYNOMODB_CHECK.getMessage() ); throw new RestApiException(CommonCode.ERROR.getHttpStatus(), ErrorCode.NICKNAME_CHECK.getMessage() );
} }
}else if(mailRequest.getUserType().equals(Mail.USERTYPE.EMAIL)){ }else if(mailRequest.getUserType().equals(Mail.USERTYPE.EMAIL)){
guid = getGuid(guid, Mail.USERTYPE.EMAIL.name()); guid = getGuid(guid, Mail.USERTYPE.EMAIL.name());
@@ -192,7 +208,7 @@ public class MailService {
else{ else{
mailRequest.setReceiveType(Mail.RECEIVETYPE.MULTIPLE); mailRequest.setReceiveType(Mail.RECEIVETYPE.MULTIPLE);
if(mailRequest.getFileName() == null){ if(mailRequest.getFileName() == null){
throw new RestApiException(CommonCode.ERROR.getHttpStatus(), ErrorCode.NOT_EXIT_EXCEL.getMessage() ); //Excel 파일을 선택해주세요. throw new RestApiException(CommonCode.ERROR.getHttpStatus(), ErrorCode.NOT_EXIT_EXCEL.toString() ); //Excel 파일을 선택해주세요.
} }
List<Excel> excelList = excelUtils.getExcelListData(mailRequest.getFileName()); List<Excel> excelList = excelUtils.getExcelListData(mailRequest.getFileName());
for(Excel excel : excelList){ for(Excel excel : excelList){
@@ -200,25 +216,25 @@ public class MailService {
case "GUID" -> { case "GUID" -> {
if (dynamoDBService.isGuidChecked(excel.getUser())) { if (dynamoDBService.isGuidChecked(excel.getUser())) {
log.error("postMail Multi Guid({}) Find Fail", excel.getUser()); log.error("postMail Multi Guid({}) Find Fail", excel.getUser());
throw new RestApiException(CommonCode.ERROR.getHttpStatus(), ErrorCode.GUID_CHECK.getMessage()); throw new RestApiException(CommonCode.ERROR.getHttpStatus(), ErrorCode.GUID_CHECK.toString());
} }
} }
case "NICKNAME" -> { case "NICKNAME" -> {
String user = getGuid(excel.getUser(), Mail.USERTYPE.NICKNAME.name()); String user = getGuid(excel.getUser(), Mail.USERTYPE.NICKNAME.name());
if (user == null || user.isEmpty()) { if (user == null || user.isEmpty()) {
log.error("postMail Multi Nickname({}) Find Fail", excel.getUser()); log.error("postMail Multi Nickname({}) Find Fail", excel.getUser());
throw new RestApiException(CommonCode.ERROR.getHttpStatus(), ErrorCode.DYNOMODB_CHECK.getMessage()); throw new RestApiException(CommonCode.ERROR.getHttpStatus(), ErrorCode.NICKNAME_CHECK.toString());
} }
} }
case "EMAIL" -> { case "EMAIL" -> {
String user = getGuid(excel.getUser(), Mail.USERTYPE.EMAIL.name()); String user = getGuid(excel.getUser(), Mail.USERTYPE.EMAIL.name());
if (user == null || user.isEmpty()) { if (user == null || user.isEmpty()) {
log.error("postMail Multi Email({}) Find Fail", excel.getUser()); log.error("postMail Multi Email({}) Find Fail", excel.getUser());
throw new RestApiException(CommonCode.ERROR.getHttpStatus(), ErrorCode.EMAIL_CHECK.getMessage()); throw new RestApiException(CommonCode.ERROR.getHttpStatus(), ErrorCode.EMAIL_CHECK.toString());
} }
} }
default -> default ->
throw new RestApiException(CommonCode.ERROR.getHttpStatus(), ErrorCode.USERTYPE_CHECK_EXCEL.getMessage()); //Excel 파일을 선택해주세요. throw new RestApiException(CommonCode.ERROR.getHttpStatus(), ErrorCode.USERTYPE_CHECK_EXCEL.toString()); //Excel 파일을 선택해주세요.
} }
} }
mailRequest.setTarget(mailRequest.getFileName()); mailRequest.setTarget(mailRequest.getFileName());
@@ -232,26 +248,37 @@ public class MailService {
//아이템 저장 //아이템 저장
if(mailRequest.getItemList()!= null && !mailRequest.getItemList().isEmpty()){ if(mailRequest.getItemList()!= null && !mailRequest.getItemList().isEmpty()){
//칼리움일경우 수량체크
boolean hasCalium = mailRequest.getItemList().stream().anyMatch(item -> item.getItem().equals(CommonConstants.CALIUM_ITEM_CODE));
double caliumSum = 0;
if(hasCalium){
caliumSum = mailRequest.getItemList().stream()
.filter(item -> item.getItem().equals(CommonConstants.CALIUM_ITEM_CODE))
.mapToDouble(Item::getItemCnt)
.sum();
double stockCalium = dynamodbCaliumService.getCaliumTotal();
if(caliumSum > stockCalium){
throw new RestApiException(CommonCode.ERROR.getHttpStatus(), ErrorCode.ERROR_MAIL_ITEM_CALIUM_OVER.toString());
}
}
mailRequest.getItemList().forEach( mailRequest.getItemList().forEach(
item -> { item -> {
map.put("goodsId",item.getItem()); map.put("goodsId",item.getItem());
map.put("itemCnt",String.valueOf(item.getItemCnt())); map.put("itemCnt", String.valueOf(item.getItemCnt()));
mailMapper.insertItem(map); mailMapper.insertItem(map);
} }
); );
//재원저장소 칼리움 차감
if(hasCalium){
dynamodbCaliumService.caliumStockDeduction(caliumSum);
}
} }
//자원 저장
// if(mailRequest.getResourceList()!= null && mailRequest.getResourceList().size() > 0){
// mailRequest.getResourceList().forEach(
// item -> {
// map.put("goodsId",item.getItem());
// map.put("itemCnt",String.valueOf(item.getItemCnt()));
// mailMapper.insertItem(map);
// }
// );
// }
//메시지 저장 //메시지 저장
if(mailRequest.getMailList()!= null && mailRequest.getMailList().size() > 0){ if(mailRequest.getMailList()!= null && !mailRequest.getMailList().isEmpty()){
mailRequest.getMailList().forEach( mailRequest.getMailList().forEach(
item -> { item -> {
map.put("title",item.getTitle()); map.put("title",item.getTitle());

View File

@@ -10,7 +10,7 @@ public class MailItem {
@JsonProperty("itemId") @JsonProperty("itemId")
private Integer itemId; private Integer itemId;
@JsonProperty("count") @JsonProperty("count")
private Integer count; private Double count;
@JsonProperty("productId") @JsonProperty("productId")
private Integer productId; private Integer productId;
@JsonProperty("isRepeatProduct") @JsonProperty("isRepeatProduct")

View File

@@ -5,4 +5,5 @@ import com.caliverse.admin.dynamodb.domain.doc.CaliumStorageDoc;
public interface CaliumStorageRepository extends DynamoDBRepository<CaliumStorageDoc> { public interface CaliumStorageRepository extends DynamoDBRepository<CaliumStorageDoc> {
double getTotal(); double getTotal();
void updateTotal(double caliumCnt); void updateTotal(double caliumCnt);
void stockDeduction(double caliumCnt);
} }

View File

@@ -64,10 +64,60 @@ public class CaliumStorageRepositoryImpl extends BaseDynamoDBRepository<CaliumSt
double currentTotal = attrib.getCaliumOperatorStorage().getOperatorTotalCalium();; double currentTotal = attrib.getCaliumOperatorStorage().getOperatorTotalCalium();;
BigDecimal dclCurrentTotal = new BigDecimal(currentTotal); BigDecimal dclCurrentTotal = new BigDecimal(currentTotal);
BigDecimal dclCaliumCnt = new BigDecimal(caliumCnt); BigDecimal dclCaliumCnt = new BigDecimal(caliumCnt);
BigDecimal result = dclCurrentTotal.multiply(dclCaliumCnt); BigDecimal result = dclCurrentTotal.add(dclCaliumCnt);
// double sumTotal = currentTotal + caliumCnt; // 부동소수점으로 오차가 발생할수 있다(..000000001) // double sumTotal = currentTotal + caliumCnt; // 부동소수점으로 오차가 발생할수 있다(..000000001)
result = result.setScale(2, RoundingMode.HALF_UP);; result = result.setScale(2, RoundingMode.HALF_UP);;
log.info("updateTotal currentTotal: {}, newCaliumCnt: {}", currentTotal, caliumCnt); log.info("updateTotal currentTotal: {}, newCaliumCnt: {}, total: {}", currentTotal, caliumCnt, result);
CaliumStorageAttrib.CaliumOperatorStorage caliumOperatorStorage = attrib.getCaliumOperatorStorage();
caliumOperatorStorage.setOperatorTotalCalium(result.doubleValue());
caliumOperatorStorage.setOperatorCaliumFillUpDate(now_data);
attrib.setCaliumOperatorStorage(caliumOperatorStorage);
afterDoc.setAttribValue(attrib);
afterDoc.setUpdatedDateTime(now_data);
update(afterDoc);
log.info("CaliumStorageDoc Calium Total Update Success: {}", objectMapper.writeValueAsString(afterDoc));
dynamodbHistoryLogService.updateHistoryLog(
HISTORYTYPE.CALIUM_TOTAL_UPDATE,
HISTORYTYPE.CALIUM_TOTAL_UPDATE.name(),
beforeDoc,
afterDoc,
CommonUtils.getAdmin().getEmail(),
CommonUtils.getClientIp()
);
}
}catch (Exception e){
throw new RestApiException(CommonCode.ERROR.getHttpStatus(), ErrorCode.DYNAMODB_CONNECTION_ERROR.getMessage());
}
}
@Override
public void stockDeduction(double caliumCnt) {
try{
Key key = Key.builder()
.partitionValue(DynamoDBConstants.PK_KEY_CALIUM)
.sortValue(DynamoDBConstants.EMPTY)
.build();
CaliumStorageDoc beforeDoc = findById(key);
if (beforeDoc != null) {
CaliumStorageDoc afterDoc = deepCopy(beforeDoc, CaliumStorageDoc.class);
CaliumStorageAttrib attrib = afterDoc.getAttribValue();
String now_data = CommonUtils.convertUTCDate(LocalDateTime.now());
double currentTotal = attrib.getCaliumOperatorStorage().getOperatorTotalCalium();;
BigDecimal dclCurrentTotal = new BigDecimal(currentTotal);
BigDecimal dclCaliumCnt = new BigDecimal(caliumCnt);
BigDecimal result = dclCurrentTotal.subtract(dclCaliumCnt);
result = result.setScale(2, RoundingMode.HALF_UP);;
log.info("stockDeduction currentTotal: {}, newCaliumCnt: {}, total: {}", currentTotal, caliumCnt, result);
CaliumStorageAttrib.CaliumOperatorStorage caliumOperatorStorage = attrib.getCaliumOperatorStorage(); CaliumStorageAttrib.CaliumOperatorStorage caliumOperatorStorage = attrib.getCaliumOperatorStorage();
caliumOperatorStorage.setOperatorTotalCalium(result.doubleValue()); caliumOperatorStorage.setOperatorTotalCalium(result.doubleValue());

View File

@@ -19,6 +19,10 @@ public class DynamodbCaliumService {
@DynamoDBTransaction @DynamoDBTransaction
public void updateCaliumTotal(double caliumCnt){ public void updateCaliumTotal(double caliumCnt){
caliumStorageRepository.updateTotal(caliumCnt); caliumStorageRepository.updateTotal(caliumCnt);
log.info("updateCaliumCharged DynamoDB Update Complete"); }
@DynamoDBTransaction
public void caliumStockDeduction(double caliumCnt){
caliumStorageRepository.stockDeduction(caliumCnt);
} }
} }

View File

@@ -52,6 +52,9 @@ public enum ErrorCode {
//calium //calium
ERROR_CALIUM_FINISH("충전 완료된 칼리움입니다."), ERROR_CALIUM_FINISH("충전 완료된 칼리움입니다."),
//mail
ERROR_MAIL_ITEM_CALIUM_OVER("첨부 가능한 칼리움을 초과하였습니다."),
//Land //Land
ERROR_LAND_AUCTION_IMPOSSIBLE("경매를 진행할 수 없는 랜드입니다."), ERROR_LAND_AUCTION_IMPOSSIBLE("경매를 진행할 수 없는 랜드입니다."),
ERROR_AUCTION_STATUS_IMPOSSIBLE("수정할 수 없는 경매상태입니다."), ERROR_AUCTION_STATUS_IMPOSSIBLE("수정할 수 없는 경매상태입니다."),
@@ -68,7 +71,7 @@ public enum ErrorCode {
GUID_CHECK("Guid를 확인해주세요."), GUID_CHECK("Guid를 확인해주세요."),
EMAIL_CHECK("Email을 확인해주세요"), EMAIL_CHECK("Email을 확인해주세요"),
GUID_LENGTH_CHECK("guid(32자)를 확인해주세요."), GUID_LENGTH_CHECK("guid(32자)를 확인해주세요."),
DYNOMODB_CHECK("gameDB에 닉네임이 없습니다."), NICKNAME_CHECK("gameDB에 닉네임이 없습니다."),
DYNAMODB_CONNECTION_ERROR("dynamoDB_connection_error"), DYNAMODB_CONNECTION_ERROR("dynamoDB_connection_error"),
DYNAMODB_CONDITION_CHECK_ERROR("dynamoDB_Conditional_Check_error"), DYNAMODB_CONDITION_CHECK_ERROR("dynamoDB_Conditional_Check_error"),
DYNAMODB_PROCESS_ERROR("dynamoDB 처리 중 에러발생"), DYNAMODB_PROCESS_ERROR("dynamoDB 처리 중 에러발생"),

View File

@@ -7,6 +7,7 @@ public class CommonConstants {
public static final String SCHEDULE = "Schedule"; public static final String SCHEDULE = "Schedule";
public static final int BATTLE_SERVER_WAIT_TIME = 600; // (seconds) 이벤트 홍보시간이 300초인데 여유있게 처리하게 하기위해 600으로 준다. public static final int BATTLE_SERVER_WAIT_TIME = 600; // (seconds) 이벤트 홍보시간이 300초인데 여유있게 처리하게 하기위해 600으로 준다.
public static final int BATTLE_INSTANCE_ID = 1017007; public static final int BATTLE_INSTANCE_ID = 1017007;
public static final String CALIUM_ITEM_CODE = "19010003";
public static final String FORMAT_DATE_ISO_DATETIME_MILLIS = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"; public static final String FORMAT_DATE_ISO_DATETIME_MILLIS = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'";
public static final String FORMAT_DATE_DATETIME = "yyyy-MM-dd HH:mm:ss"; public static final String FORMAT_DATE_DATETIME = "yyyy-MM-dd HH:mm:ss";

View File

@@ -121,6 +121,36 @@ public class CommonUtils {
} }
} }
public static Double objectToDouble(Object object) {
if (object == null) {
return 0.0;
}
if (object instanceof Double) {
return (Double) object;
}
if (object instanceof Number) {
return ((Number) object).doubleValue();
}
if (object instanceof Boolean) {
return ((Boolean) object) ? 1.0 : 0.0;
}
try {
// String이나 다른 타입의 경우 문자열로 변환 후 처리
String strValue = String.valueOf(object).trim();
if (strValue.isEmpty()) {
return 0.0;
}
return Double.parseDouble(strValue);
} catch (NumberFormatException e) {
return 0.0;
}
}
public static Long objectToLong(Object object) { public static Long objectToLong(Object object) {
if (object == null) { if (object == null) {
return 0L; return 0L;