initial commit
This commit is contained in:
54
.classpath
Normal file
54
.classpath
Normal file
@@ -0,0 +1,54 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" output="target/classes" path="src/main/java">
|
||||
<attributes>
|
||||
<attribute name="optional" value="true"/>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
|
||||
<attributes>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
<attribute name="optional" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
|
||||
<attributes>
|
||||
<attribute name="optional" value="true"/>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
<attribute name="test" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
|
||||
<attributes>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
<attribute name="test" value="true"/>
|
||||
<attribute name="optional" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17">
|
||||
<attributes>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
|
||||
<attributes>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="src" output="target/test-classes" path="target/generated-test-sources/test-annotations">
|
||||
<attributes>
|
||||
<attribute name="optional" value="true"/>
|
||||
<attribute name="test" value="true"/>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
<attribute name="ignore_optional_problems" value="true"/>
|
||||
<attribute name="m2e-apt" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="src" path="target/generated-sources/annotations">
|
||||
<attributes>
|
||||
<attribute name="optional" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="output" path="target/classes"/>
|
||||
</classpath>
|
||||
169
.factorypath
Normal file
169
.factorypath
Normal file
@@ -0,0 +1,169 @@
|
||||
<factorypath>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/boot/spring-boot-starter-web/3.0.0/spring-boot-starter-web-3.0.0.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/boot/spring-boot-starter/3.0.0/spring-boot-starter-3.0.0.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/boot/spring-boot/3.0.0/spring-boot-3.0.0.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/boot/spring-boot-autoconfigure/3.0.0/spring-boot-autoconfigure-3.0.0.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/boot/spring-boot-starter-logging/3.0.0/spring-boot-starter-logging-3.0.0.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/ch/qos/logback/logback-classic/1.4.5/logback-classic-1.4.5.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/ch/qos/logback/logback-core/1.4.5/logback-core-1.4.5.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/apache/logging/log4j/log4j-to-slf4j/2.19.0/log4j-to-slf4j-2.19.0.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/apache/logging/log4j/log4j-api/2.19.0/log4j-api-2.19.0.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/slf4j/jul-to-slf4j/2.0.4/jul-to-slf4j-2.0.4.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/yaml/snakeyaml/1.33/snakeyaml-1.33.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/boot/spring-boot-starter-json/3.0.0/spring-boot-starter-json-3.0.0.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/com/fasterxml/jackson/datatype/jackson-datatype-jdk8/2.14.1/jackson-datatype-jdk8-2.14.1.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/com/fasterxml/jackson/datatype/jackson-datatype-jsr310/2.14.1/jackson-datatype-jsr310-2.14.1.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/com/fasterxml/jackson/module/jackson-module-parameter-names/2.14.1/jackson-module-parameter-names-2.14.1.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/spring-web/6.0.2/spring-web-6.0.2.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/spring-webmvc/6.0.2/spring-webmvc-6.0.2.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/spring-context/6.0.2/spring-context-6.0.2.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/spring-expression/6.0.2/spring-expression-6.0.2.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/boot/spring-boot-starter-tomcat/3.0.0/spring-boot-starter-tomcat-3.0.0.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/jakarta/annotation/jakarta.annotation-api/2.1.1/jakarta.annotation-api-2.1.1.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/apache/tomcat/embed/tomcat-embed-core/10.1.1/tomcat-embed-core-10.1.1.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/apache/tomcat/embed/tomcat-embed-el/10.1.1/tomcat-embed-el-10.1.1.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/apache/tomcat/embed/tomcat-embed-websocket/10.1.1/tomcat-embed-websocket-10.1.1.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/boot/spring-boot-starter-security/3.0.0/spring-boot-starter-security-3.0.0.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/spring-aop/6.0.2/spring-aop-6.0.2.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/security/spring-security-config/6.0.0/spring-security-config-6.0.0.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/security/spring-security-core/6.0.0/spring-security-core-6.0.0.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/security/spring-security-crypto/6.0.0/spring-security-crypto-6.0.0.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/security/spring-security-web/6.0.0/spring-security-web-6.0.0.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/boot/spring-boot-starter-websocket/3.0.0/spring-boot-starter-websocket-3.0.0.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/spring-websocket/6.0.2/spring-websocket-6.0.2.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/boot/spring-boot-starter-jdbc/3.0.0/spring-boot-starter-jdbc-3.0.0.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/com/zaxxer/HikariCP/5.0.1/HikariCP-5.0.1.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/spring-jdbc/6.0.2/spring-jdbc-6.0.2.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/spring-tx/6.0.2/spring-tx-6.0.2.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/mybatis/spring/boot/mybatis-spring-boot-starter/3.0.4/mybatis-spring-boot-starter-3.0.4.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/mybatis/spring/boot/mybatis-spring-boot-autoconfigure/3.0.4/mybatis-spring-boot-autoconfigure-3.0.4.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/mybatis/mybatis/3.5.17/mybatis-3.5.17.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/mybatis/mybatis-spring/3.0.4/mybatis-spring-3.0.4.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/boot/spring-boot-starter-validation/3.0.0/spring-boot-starter-validation-3.0.0.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/hibernate/validator/hibernate-validator/8.0.0.Final/hibernate-validator-8.0.0.Final.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/jboss/logging/jboss-logging/3.5.0.Final/jboss-logging-3.5.0.Final.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/com/fasterxml/classmate/1.5.1/classmate-1.5.1.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/spring-core/6.0.12/spring-core-6.0.12.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/spring-jcl/6.0.2/spring-jcl-6.0.2.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/jakarta/validation/jakarta.validation-api/3.0.0/jakarta.validation-api-3.0.0.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/thymeleaf/thymeleaf/3.1.0.RELEASE/thymeleaf-3.1.0.RELEASE.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/ognl/ognl/3.3.4/ognl-3.3.4.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/javassist/javassist/3.29.0-GA/javassist-3.29.0-GA.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/attoparser/attoparser/2.0.6.RELEASE/attoparser-2.0.6.RELEASE.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/unbescape/unbescape/1.1.6.RELEASE/unbescape-1.1.6.RELEASE.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/slf4j/slf4j-api/2.0.4/slf4j-api-2.0.4.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/nz/net/ultraq/thymeleaf/thymeleaf-layout-dialect/3.1.0/thymeleaf-layout-dialect-3.1.0.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/apache/groovy/groovy/4.0.6/groovy-4.0.6.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/nz/net/ultraq/groovy/groovy-extensions/2.0.0/groovy-extensions-2.0.0.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/nz/net/ultraq/thymeleaf/thymeleaf-expression-processor/3.1.0/thymeleaf-expression-processor-3.1.0.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/session/spring-session-core/3.0.0/spring-session-core-3.0.0.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/com/mysql/mysql-connector-j/8.0.33/mysql-connector-j-8.0.33.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/mariadb/jdbc/mariadb-java-client/3.0.9/mariadb-java-client-3.0.9.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/boot/spring-boot-configuration-processor/3.0.0/spring-boot-configuration-processor-3.0.0.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/projectlombok/lombok/1.18.30/lombok-1.18.30.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/boot/spring-boot-starter-webflux/3.0.0/spring-boot-starter-webflux-3.0.0.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/boot/spring-boot-starter-reactor-netty/3.0.0/spring-boot-starter-reactor-netty-3.0.0.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/io/projectreactor/netty/reactor-netty-http/1.1.0/reactor-netty-http-1.1.0.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/io/netty/netty-codec-http/4.1.85.Final/netty-codec-http-4.1.85.Final.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/io/netty/netty-common/4.1.85.Final/netty-common-4.1.85.Final.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/io/netty/netty-buffer/4.1.85.Final/netty-buffer-4.1.85.Final.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/io/netty/netty-transport/4.1.85.Final/netty-transport-4.1.85.Final.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/io/netty/netty-codec/4.1.85.Final/netty-codec-4.1.85.Final.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/io/netty/netty-handler/4.1.85.Final/netty-handler-4.1.85.Final.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/io/netty/netty-codec-http2/4.1.85.Final/netty-codec-http2-4.1.85.Final.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/io/netty/netty-resolver-dns/4.1.85.Final/netty-resolver-dns-4.1.85.Final.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/io/netty/netty-resolver/4.1.85.Final/netty-resolver-4.1.85.Final.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/io/netty/netty-codec-dns/4.1.85.Final/netty-codec-dns-4.1.85.Final.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/io/netty/netty-resolver-dns-native-macos/4.1.85.Final/netty-resolver-dns-native-macos-4.1.85.Final-osx-x86_64.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/io/netty/netty-resolver-dns-classes-macos/4.1.85.Final/netty-resolver-dns-classes-macos-4.1.85.Final.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/io/netty/netty-transport-native-epoll/4.1.85.Final/netty-transport-native-epoll-4.1.85.Final-linux-x86_64.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/io/netty/netty-transport-native-unix-common/4.1.85.Final/netty-transport-native-unix-common-4.1.85.Final.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/io/netty/netty-transport-classes-epoll/4.1.85.Final/netty-transport-classes-epoll-4.1.85.Final.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/io/projectreactor/netty/reactor-netty-core/1.1.0/reactor-netty-core-1.1.0.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/io/netty/netty-handler-proxy/4.1.85.Final/netty-handler-proxy-4.1.85.Final.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/io/netty/netty-codec-socks/4.1.85.Final/netty-codec-socks-4.1.85.Final.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/spring-webflux/6.0.2/spring-webflux-6.0.2.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/io/projectreactor/reactor-core/3.5.0/reactor-core-3.5.0.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/reactivestreams/reactive-streams/1.0.4/reactive-streams-1.0.4.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/io/jsonwebtoken/jjwt-api/0.11.2/jjwt-api-0.11.2.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/io/jsonwebtoken/jjwt-impl/0.11.2/jjwt-impl-0.11.2.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/io/jsonwebtoken/jjwt-jackson/0.11.2/jjwt-jackson-0.11.2.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/com/fasterxml/jackson/core/jackson-databind/2.14.1/jackson-databind-2.14.1.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/com/fasterxml/jackson/core/jackson-annotations/2.14.1/jackson-annotations-2.14.1.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/io/jsonwebtoken/jjwt-gson/0.11.2/jjwt-gson-0.11.2.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/com/google/code/gson/gson/2.9.1/gson-2.9.1.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/javax/xml/bind/jaxb-api/2.3.1/jaxb-api-2.3.1.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/javax/activation/javax.activation-api/1.2.0/javax.activation-api-1.2.0.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/com/sun/xml/bind/jaxb-core/2.3.0.1/jaxb-core-2.3.0.1.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/com/sun/xml/bind/jaxb-impl/2.3.1/jaxb-impl-2.3.1.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/springdoc/springdoc-openapi-ui/1.5.4/springdoc-openapi-ui-1.5.4.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/springdoc/springdoc-openapi-webmvc-core/1.5.4/springdoc-openapi-webmvc-core-1.5.4.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/springdoc/springdoc-openapi-common/1.5.4/springdoc-openapi-common-1.5.4.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/io/swagger/core/v3/swagger-models/2.1.6/swagger-models-2.1.6.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/io/swagger/core/v3/swagger-annotations/2.1.6/swagger-annotations-2.1.6.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/io/swagger/core/v3/swagger-integration/2.1.6/swagger-integration-2.1.6.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/io/swagger/core/v3/swagger-core/2.1.6/swagger-core-2.1.6.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/jakarta/xml/bind/jakarta.xml.bind-api/4.0.0/jakarta.xml.bind-api-4.0.0.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/jakarta/activation/jakarta.activation-api/2.1.0/jakarta.activation-api-2.1.0.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/com/fasterxml/jackson/dataformat/jackson-dataformat-yaml/2.14.1/jackson-dataformat-yaml-2.14.1.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/apache/commons/commons-lang3/3.12.0/commons-lang3-3.12.0.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/webjars/swagger-ui/3.42.0/swagger-ui-3.42.0.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/json/json/20230227/json-20230227.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/net/sf/json-lib/json-lib/2.4/json-lib-2.4-jdk15.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/commons-beanutils/commons-beanutils/1.8.0/commons-beanutils-1.8.0.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/commons-collections/commons-collections/3.2.1/commons-collections-3.2.1.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/commons-lang/commons-lang/2.5/commons-lang-2.5.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/net/sf/ezmorph/ezmorph/1.0.6/ezmorph-1.0.6.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/jsoup/jsoup/1.14.3/jsoup-1.14.3.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/apache/httpcomponents/httpclient/4.5.13/httpclient-4.5.13.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/apache/httpcomponents/httpcore/4.4.15/httpcore-4.4.15.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/commons-codec/commons-codec/1.15/commons-codec-1.15.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/apache/httpcomponents/client5/httpclient5/5.3.1/httpclient5-5.3.1.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/apache/httpcomponents/core5/httpcore5/5.1.5/httpcore5-5.1.5.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/apache/httpcomponents/core5/httpcore5-h2/5.1.5/httpcore5-h2-5.1.5.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/com/squareup/okhttp3/okhttp/4.11.0/okhttp-4.11.0.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/com/squareup/okio/okio/3.2.0/okio-3.2.0.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/com/squareup/okio/okio-jvm/3.2.0/okio-jvm-3.2.0.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/jetbrains/kotlin/kotlin-stdlib/1.7.21/kotlin-stdlib-1.7.21.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/jetbrains/kotlin/kotlin-stdlib-common/1.7.21/kotlin-stdlib-common-1.7.21.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/jetbrains/annotations/13.0/annotations-13.0.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/jetbrains/kotlin/kotlin-stdlib-jdk8/1.7.21/kotlin-stdlib-jdk8-1.7.21.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/jetbrains/kotlin/kotlin-stdlib-jdk7/1.7.21/kotlin-stdlib-jdk7-1.7.21.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/boot/spring-boot-starter-actuator/3.1.4/spring-boot-starter-actuator-3.1.4.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/boot/spring-boot-actuator-autoconfigure/3.0.0/spring-boot-actuator-autoconfigure-3.0.0.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/boot/spring-boot-actuator/3.0.0/spring-boot-actuator-3.0.0.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/io/micrometer/micrometer-observation/1.10.2/micrometer-observation-1.10.2.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/io/micrometer/micrometer-commons/1.10.2/micrometer-commons-1.10.2.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/io/micrometer/micrometer-core/1.10.2/micrometer-core-1.10.2.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/hdrhistogram/HdrHistogram/2.1.12/HdrHistogram-2.1.12.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/latencyutils/LatencyUtils/2.0.3/LatencyUtils-2.0.3.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/io/micrometer/micrometer-registry-prometheus/1.10.2/micrometer-registry-prometheus-1.10.2.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/io/prometheus/simpleclient_common/0.16.0/simpleclient_common-0.16.0.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/io/prometheus/simpleclient/0.16.0/simpleclient-0.16.0.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/io/prometheus/simpleclient_tracer_otel/0.16.0/simpleclient_tracer_otel-0.16.0.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/io/prometheus/simpleclient_tracer_common/0.16.0/simpleclient_tracer_common-0.16.0.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/io/prometheus/simpleclient_tracer_otel_agent/0.16.0/simpleclient_tracer_otel_agent-0.16.0.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/com/warrenstrange/googleauth/1.5.0/googleauth-1.5.0.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/codehaus/jettison/jettison/1.4.1/jettison-1.4.1.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/webjars/webjars-locator-core/0.46/webjars-locator-core-0.46.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/com/fasterxml/jackson/core/jackson-core/2.14.1/jackson-core-2.14.1.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/io/github/classgraph/classgraph/4.8.90/classgraph-4.8.90.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/commons-io/commons-io/2.11.0/commons-io-2.11.0.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/spring-messaging/6.0.12/spring-messaging-6.0.12.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/spring-beans/6.0.2/spring-beans-6.0.2.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/integration/spring-integration-security/6.0.0/spring-integration-security-6.0.0.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/integration/spring-integration-core/6.0.0/spring-integration-core-6.0.0.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/retry/spring-retry/2.0.0/spring-retry-2.0.0.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/security/spring-security-messaging/6.0.0/spring-security-messaging-6.0.0.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/integration/spring-integration-stomp/6.0.0/spring-integration-stomp-6.0.0.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/org/springframework/integration/spring-integration-websocket/6.0.0/spring-integration-websocket-6.0.0.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/jakarta/servlet/jakarta.servlet-api/6.0.0/jakarta.servlet-api-6.0.0.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/io/netty/netty-tcnative-boringssl-static/2.0.61.Final/netty-tcnative-boringssl-static-2.0.61.Final.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/io/netty/netty-tcnative-classes/2.0.54.Final/netty-tcnative-classes-2.0.54.Final.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/io/netty/netty-tcnative-boringssl-static/2.0.54.Final/netty-tcnative-boringssl-static-2.0.54.Final-linux-x86_64.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/io/netty/netty-tcnative-boringssl-static/2.0.54.Final/netty-tcnative-boringssl-static-2.0.54.Final-linux-aarch_64.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/io/netty/netty-tcnative-boringssl-static/2.0.54.Final/netty-tcnative-boringssl-static-2.0.54.Final-osx-x86_64.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/io/netty/netty-tcnative-boringssl-static/2.0.54.Final/netty-tcnative-boringssl-static-2.0.54.Final-osx-aarch_64.jar" enabled="true" runInBatchMode="false"/>
|
||||
<factorypathentry kind="VARJAR" id="M2_REPO/io/netty/netty-tcnative-boringssl-static/2.0.54.Final/netty-tcnative-boringssl-static-2.0.54.Final-windows-x86_64.jar" enabled="true" runInBatchMode="false"/>
|
||||
</factorypath>
|
||||
5
.gitignore
vendored
Normal file
5
.gitignore
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
HELP.md
|
||||
target/
|
||||
!.mvn/wrapper/maven-wrapper.jar
|
||||
!**/src/main/**/target/
|
||||
!**/src/test/**/target/
|
||||
117
.mvn/wrapper/MavenWrapperDownloader.java
vendored
Normal file
117
.mvn/wrapper/MavenWrapperDownloader.java
vendored
Normal file
@@ -0,0 +1,117 @@
|
||||
/*
|
||||
* Copyright 2007-present the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import java.net.*;
|
||||
import java.io.*;
|
||||
import java.nio.channels.*;
|
||||
import java.util.Properties;
|
||||
|
||||
public class MavenWrapperDownloader {
|
||||
|
||||
private static final String WRAPPER_VERSION = "0.5.6";
|
||||
/**
|
||||
* Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
|
||||
*/
|
||||
private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/"
|
||||
+ WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar";
|
||||
|
||||
/**
|
||||
* Path to the maven-wrapper.properties file, which might contain a downloadUrl property to
|
||||
* use instead of the default one.
|
||||
*/
|
||||
private static final String MAVEN_WRAPPER_PROPERTIES_PATH =
|
||||
".mvn/wrapper/maven-wrapper.properties";
|
||||
|
||||
/**
|
||||
* Path where the maven-wrapper.jar will be saved to.
|
||||
*/
|
||||
private static final String MAVEN_WRAPPER_JAR_PATH =
|
||||
".mvn/wrapper/maven-wrapper.jar";
|
||||
|
||||
/**
|
||||
* Name of the property which should be used to override the default download url for the wrapper.
|
||||
*/
|
||||
private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl";
|
||||
|
||||
public static void main(String args[]) {
|
||||
System.out.println("- Downloader started");
|
||||
File baseDirectory = new File(args[0]);
|
||||
System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath());
|
||||
|
||||
// If the maven-wrapper.properties exists, read it and check if it contains a custom
|
||||
// wrapperUrl parameter.
|
||||
File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH);
|
||||
String url = DEFAULT_DOWNLOAD_URL;
|
||||
if(mavenWrapperPropertyFile.exists()) {
|
||||
FileInputStream mavenWrapperPropertyFileInputStream = null;
|
||||
try {
|
||||
mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile);
|
||||
Properties mavenWrapperProperties = new Properties();
|
||||
mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream);
|
||||
url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url);
|
||||
} catch (IOException e) {
|
||||
System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'");
|
||||
} finally {
|
||||
try {
|
||||
if(mavenWrapperPropertyFileInputStream != null) {
|
||||
mavenWrapperPropertyFileInputStream.close();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
// Ignore ...
|
||||
}
|
||||
}
|
||||
}
|
||||
System.out.println("- Downloading from: " + url);
|
||||
|
||||
File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH);
|
||||
if(!outputFile.getParentFile().exists()) {
|
||||
if(!outputFile.getParentFile().mkdirs()) {
|
||||
System.out.println(
|
||||
"- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'");
|
||||
}
|
||||
}
|
||||
System.out.println("- Downloading to: " + outputFile.getAbsolutePath());
|
||||
try {
|
||||
downloadFileFromURL(url, outputFile);
|
||||
System.out.println("Done");
|
||||
System.exit(0);
|
||||
} catch (Throwable e) {
|
||||
System.out.println("- Error downloading");
|
||||
e.printStackTrace();
|
||||
System.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
private static void downloadFileFromURL(String urlString, File destination) throws Exception {
|
||||
if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) {
|
||||
String username = System.getenv("MVNW_USERNAME");
|
||||
char[] password = System.getenv("MVNW_PASSWORD").toCharArray();
|
||||
Authenticator.setDefault(new Authenticator() {
|
||||
@Override
|
||||
protected PasswordAuthentication getPasswordAuthentication() {
|
||||
return new PasswordAuthentication(username, password);
|
||||
}
|
||||
});
|
||||
}
|
||||
URL website = new URL(urlString);
|
||||
ReadableByteChannel rbc;
|
||||
rbc = Channels.newChannel(website.openStream());
|
||||
FileOutputStream fos = new FileOutputStream(destination);
|
||||
fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
|
||||
fos.close();
|
||||
rbc.close();
|
||||
}
|
||||
|
||||
}
|
||||
BIN
.mvn/wrapper/maven-wrapper.jar
vendored
Normal file
BIN
.mvn/wrapper/maven-wrapper.jar
vendored
Normal file
Binary file not shown.
2
.mvn/wrapper/maven-wrapper.properties
vendored
Normal file
2
.mvn/wrapper/maven-wrapper.properties
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.2/apache-maven-3.8.2-bin.zip
|
||||
wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar
|
||||
39
.project
Normal file
39
.project
Normal file
@@ -0,0 +1,39 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>new_apiServer_oms</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.springframework.ide.eclipse.boot.validation.springbootbuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.m2e.core.maven2Builder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
<nature>org.eclipse.m2e.core.maven2Nature</nature>
|
||||
</natures>
|
||||
<filteredResources>
|
||||
<filter>
|
||||
<id>1772723702901</id>
|
||||
<name></name>
|
||||
<type>30</type>
|
||||
<matcher>
|
||||
<id>org.eclipse.core.resources.regexFilterMatcher</id>
|
||||
<arguments>node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
|
||||
</matcher>
|
||||
</filter>
|
||||
</filteredResources>
|
||||
</projectDescription>
|
||||
4
.settings/org.eclipse.core.resources.prefs
Normal file
4
.settings/org.eclipse.core.resources.prefs
Normal file
@@ -0,0 +1,4 @@
|
||||
eclipse.preferences.version=1
|
||||
encoding//src/main/java=UTF-8
|
||||
encoding//src/main/resources=UTF-8
|
||||
encoding/<project>=UTF-8
|
||||
4
.settings/org.eclipse.jdt.apt.core.prefs
Normal file
4
.settings/org.eclipse.jdt.apt.core.prefs
Normal file
@@ -0,0 +1,4 @@
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.apt.aptEnabled=true
|
||||
org.eclipse.jdt.apt.genSrcDir=target/generated-sources/annotations
|
||||
org.eclipse.jdt.apt.genTestSrcDir=target/generated-test-sources/test-annotations
|
||||
14
.settings/org.eclipse.jdt.core.prefs
Normal file
14
.settings/org.eclipse.jdt.core.prefs
Normal file
@@ -0,0 +1,14 @@
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.methodParameters=generate
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=17
|
||||
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
|
||||
org.eclipse.jdt.core.compiler.compliance=17
|
||||
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
|
||||
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
||||
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
|
||||
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
|
||||
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
|
||||
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
|
||||
org.eclipse.jdt.core.compiler.processAnnotations=enabled
|
||||
org.eclipse.jdt.core.compiler.release=disabled
|
||||
org.eclipse.jdt.core.compiler.source=17
|
||||
4
.settings/org.eclipse.m2e.core.prefs
Normal file
4
.settings/org.eclipse.m2e.core.prefs
Normal file
@@ -0,0 +1,4 @@
|
||||
activeProfiles=
|
||||
eclipse.preferences.version=1
|
||||
resolveWorkspaceProjects=true
|
||||
version=1
|
||||
6
.settings/org.sonarlint.eclipse.core.prefs
Normal file
6
.settings/org.sonarlint.eclipse.core.prefs
Normal file
@@ -0,0 +1,6 @@
|
||||
autoEnabled=true
|
||||
bindingSuggestionsDisabled=true
|
||||
eclipse.preferences.version=1
|
||||
indexingBasedOnEclipsePlugIns=true
|
||||
projectKey=TESTOMS
|
||||
serverId=s.net-all.cc
|
||||
2
.settings/org.springframework.ide.eclipse.prefs
Normal file
2
.settings/org.springframework.ide.eclipse.prefs
Normal file
@@ -0,0 +1,2 @@
|
||||
boot.validation.initialized=true
|
||||
eclipse.preferences.version=1
|
||||
4
.sonarlint/connectedMode.json
Normal file
4
.sonarlint/connectedMode.json
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"sonarQubeUri": "http://s.net-all.cc:9000",
|
||||
"projectKey": "TESTOMS"
|
||||
}
|
||||
83
deploy-aws.sh
Normal file
83
deploy-aws.sh
Normal file
@@ -0,0 +1,83 @@
|
||||
#!/bin/bash
|
||||
|
||||
# AWS 서버 파일 업로드 스크립트
|
||||
# 사용법: ./deploy-aws.sh <aws-server> <aws-user> <aws-key> <jar-file> <deploy-path>
|
||||
|
||||
set -e
|
||||
|
||||
AWS_SERVER=$1
|
||||
AWS_USER=$2
|
||||
AWS_KEY_PATH=$3
|
||||
JAR_FILE=$4
|
||||
DEPLOY_PATH=$5
|
||||
|
||||
if [ -z "$AWS_SERVER" ] || [ -z "$AWS_USER" ] || [ -z "$AWS_KEY_PATH" ] || [ -z "$JAR_FILE" ] || [ -z "$DEPLOY_PATH" ]; then
|
||||
echo "사용법: $0 <aws-server> <aws-user> <aws-key> <jar-file> <deploy-path>"
|
||||
echo "예시: $0 47.129.51.216 root /path/to/key.pem target/core.jar /home/run"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "=== AWS 서버 파일 업로드 시작 ==="
|
||||
echo "AWS Server: $AWS_SERVER"
|
||||
echo "AWS User: $AWS_USER"
|
||||
echo "JAR File: $JAR_FILE"
|
||||
echo "Deploy Path: $DEPLOY_PATH"
|
||||
|
||||
# JAR 파일 존재 확인
|
||||
if [ ! -f "$JAR_FILE" ]; then
|
||||
echo "❌ JAR 파일을 찾을 수 없습니다: $JAR_FILE"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# AWS 키 파일 존재 확인
|
||||
if [ ! -f "$AWS_KEY_PATH" ]; then
|
||||
echo "❌ AWS 키 파일을 찾을 수 없습니다: $AWS_KEY_PATH"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# AWS 서버 연결 테스트
|
||||
echo "AWS 서버 연결 테스트 중..."
|
||||
ssh -i "$AWS_KEY_PATH" -o ConnectTimeout=10 -o StrictHostKeyChecking=no "$AWS_USER@$AWS_SERVER" "echo 'AWS 서버 연결 성공'"
|
||||
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "❌ AWS 서버 연결 실패"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# AWS 서버에서 배포 디렉토리 생성 및 권한 설정 (root 권한으로)
|
||||
echo "AWS 서버에서 배포 디렉토리 생성 중... (root 권한)"
|
||||
ssh -i "$AWS_KEY_PATH" "$AWS_USER@$AWS_SERVER" "sudo su - root <<'ROOT_SETUP'
|
||||
# 배포 디렉토리 및 로그 디렉토리 생성
|
||||
mkdir -p $DEPLOY_PATH/logs
|
||||
chmod -R 755 $DEPLOY_PATH
|
||||
echo '배포 디렉토리 생성 완료: $DEPLOY_PATH'
|
||||
ROOT_SETUP
|
||||
"
|
||||
|
||||
# JAR 파일 이름 추출
|
||||
JAR_FILENAME=$(basename "$JAR_FILE")
|
||||
|
||||
# JAR 파일을 AWS 서버로 전송
|
||||
echo "JAR 파일을 AWS 서버로 전송 중..."
|
||||
scp -i "$AWS_KEY_PATH" "$JAR_FILE" "$AWS_USER@$AWS_SERVER:$DEPLOY_PATH/$JAR_FILENAME"
|
||||
|
||||
# JAR 파일 권한 설정 (root가 읽을 수 있도록)
|
||||
echo "JAR 파일 권한 설정 중... (root 권한)"
|
||||
ssh -i "$AWS_KEY_PATH" "$AWS_USER@$AWS_SERVER" "sudo su - root <<'ROOT_CHMOD'
|
||||
chmod 644 $DEPLOY_PATH/$JAR_FILENAME
|
||||
echo 'JAR 파일 권한 설정 완료'
|
||||
echo '업로드된 파일: $DEPLOY_PATH/$JAR_FILENAME'
|
||||
ls -lh $DEPLOY_PATH/$JAR_FILENAME
|
||||
ROOT_CHMOD
|
||||
"
|
||||
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "✅ AWS 서버 파일 업로드 성공!"
|
||||
echo "JAR 파일이 $DEPLOY_PATH/$JAR_FILENAME 에 업로드되었습니다."
|
||||
else
|
||||
echo "❌ AWS 서버 파일 업로드 실패!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "=== AWS 서버 파일 업로드 완료 ==="
|
||||
|
||||
96
deploy-aws2.sh
Normal file
96
deploy-aws2.sh
Normal file
@@ -0,0 +1,96 @@
|
||||
#!/bin/bash
|
||||
|
||||
# AWS 서버 파일 업로드 스크립트
|
||||
# 사용법: ./deploy-aws.sh <aws-server> <aws-user> <aws-key> <jar-file> <deploy-path>
|
||||
|
||||
set -e
|
||||
|
||||
AWS_SERVER=$1
|
||||
AWS_USER=$2
|
||||
AWS_KEY_PATH=$3
|
||||
JAR_FILE=$4
|
||||
DEPLOY_PATH=$5
|
||||
|
||||
if [ -z "$AWS_SERVER" ] || [ -z "$AWS_USER" ] || [ -z "$AWS_KEY_PATH" ] || [ -z "$JAR_FILE" ] || [ -z "$DEPLOY_PATH" ]; then
|
||||
echo "사용법: $0 <aws-server> <aws-user> <aws-key> <jar-file> <deploy-path>"
|
||||
echo "예시: $0 47.129.51.216 root /path/to/key.pem target/core.jar /home/run"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "=== AWS 서버 파일 업로드 시작 ==="
|
||||
echo "AWS Server: $AWS_SERVER"
|
||||
echo "AWS User: $AWS_USER"
|
||||
echo "JAR File: $JAR_FILE"
|
||||
echo "Deploy Path: $DEPLOY_PATH"
|
||||
|
||||
# JAR 파일 존재 확인
|
||||
if [ ! -f "$JAR_FILE" ]; then
|
||||
echo "❌ JAR 파일을 찾을 수 없습니다: $JAR_FILE"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# AWS 키 파일 존재 확인
|
||||
if [ ! -f "$AWS_KEY_PATH" ]; then
|
||||
echo "❌ AWS 키 파일을 찾을 수 없습니다: $AWS_KEY_PATH"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# AWS 서버 연결 테스트
|
||||
echo "AWS 서버 연결 테스트 중..."
|
||||
ssh -i "$AWS_KEY_PATH" -o ConnectTimeout=10 -o StrictHostKeyChecking=no "$AWS_USER@$AWS_SERVER" "echo 'AWS 서버 연결 성공'"
|
||||
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "❌ AWS 서버 연결 실패"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# AWS 서버에서 배포 디렉토리 생성 및 권한 설정 (root 권한으로)
|
||||
echo "AWS 서버에서 배포 디렉토리 생성 중... (root 권한)"
|
||||
ssh -i "$AWS_KEY_PATH" "$AWS_USER@$AWS_SERVER" "sudo su - root <<ROOT_SETUP
|
||||
# 배포 디렉토리 및 로그 디렉토리 생성
|
||||
mkdir -p $DEPLOY_PATH/logs
|
||||
chmod -R 755 $DEPLOY_PATH
|
||||
echo '배포 디렉토리 생성 완료: $DEPLOY_PATH'
|
||||
ROOT_SETUP
|
||||
"
|
||||
|
||||
# JAR 파일 이름 추출
|
||||
JAR_FILENAME=$(basename "$JAR_FILE")
|
||||
|
||||
# 임시 업로드 경로 (rocky 계정 홈 디렉토리)
|
||||
TEMP_PATH="/home/$AWS_USER/temp_${JAR_FILENAME}"
|
||||
|
||||
# JAR 파일을 AWS 서버의 임시 위치로 전송 (rocky 계정 권한으로)
|
||||
echo "JAR 파일을 AWS 서버 임시 위치로 전송 중..."
|
||||
scp -i "$AWS_KEY_PATH" "$JAR_FILE" "$AWS_USER@$AWS_SERVER:$TEMP_PATH"
|
||||
|
||||
# 임시 파일을 최종 위치로 이동 및 권한 설정 (root 권한으로)
|
||||
echo "JAR 파일을 최종 위치로 이동 중... (root 권한)"
|
||||
ssh -i "$AWS_KEY_PATH" "$AWS_USER@$AWS_SERVER" "sudo su - root <<ROOT_MOVE
|
||||
# 배포 디렉토리 확인 및 생성
|
||||
mkdir -p $DEPLOY_PATH
|
||||
chmod -R 755 $DEPLOY_PATH
|
||||
|
||||
# 임시 파일을 최종 위치로 이동
|
||||
mv $TEMP_PATH $DEPLOY_PATH/$JAR_FILENAME
|
||||
|
||||
# 파일 권한 설정
|
||||
chmod 644 $DEPLOY_PATH/$JAR_FILENAME
|
||||
chown root:root $DEPLOY_PATH/$JAR_FILENAME
|
||||
|
||||
echo 'JAR 파일 이동 및 권한 설정 완료'
|
||||
echo '업로드된 파일: $DEPLOY_PATH/$JAR_FILENAME'
|
||||
ls -lh $DEPLOY_PATH/$JAR_FILENAME
|
||||
ROOT_MOVE
|
||||
"
|
||||
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "✅ AWS 서버 파일 업로드 성공!"
|
||||
echo "JAR 파일이 $DEPLOY_PATH/$JAR_FILENAME 에 업로드되었습니다."
|
||||
else
|
||||
echo "❌ AWS 서버 파일 업로드 실패!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "=== AWS 서버 파일 업로드 완료 ==="
|
||||
|
||||
BIN
filePath_IS_UNDEFINED/app.2024-07-03.0.gz
Normal file
BIN
filePath_IS_UNDEFINED/app.2024-07-03.0.gz
Normal file
Binary file not shown.
BIN
filePath_IS_UNDEFINED/app.2024-07-08.0.gz
Normal file
BIN
filePath_IS_UNDEFINED/app.2024-07-08.0.gz
Normal file
Binary file not shown.
2475
filePath_IS_UNDEFINED/app.log
Normal file
2475
filePath_IS_UNDEFINED/app.log
Normal file
File diff suppressed because it is too large
Load Diff
BIN
filePath_IS_UNDEFINED/error-2024-06-24.0.gz
Normal file
BIN
filePath_IS_UNDEFINED/error-2024-06-24.0.gz
Normal file
Binary file not shown.
BIN
filePath_IS_UNDEFINED/error-2024-06-25.0.gz
Normal file
BIN
filePath_IS_UNDEFINED/error-2024-06-25.0.gz
Normal file
Binary file not shown.
BIN
filePath_IS_UNDEFINED/error-2024-06-26.0.gz
Normal file
BIN
filePath_IS_UNDEFINED/error-2024-06-26.0.gz
Normal file
Binary file not shown.
BIN
filePath_IS_UNDEFINED/error-2024-06-27.0.gz
Normal file
BIN
filePath_IS_UNDEFINED/error-2024-06-27.0.gz
Normal file
Binary file not shown.
BIN
filePath_IS_UNDEFINED/error-2024-06-28.0.gz
Normal file
BIN
filePath_IS_UNDEFINED/error-2024-06-28.0.gz
Normal file
Binary file not shown.
BIN
filePath_IS_UNDEFINED/error-2024-07-08.0.gz
Normal file
BIN
filePath_IS_UNDEFINED/error-2024-07-08.0.gz
Normal file
Binary file not shown.
2302
filePath_IS_UNDEFINED/error.log
Normal file
2302
filePath_IS_UNDEFINED/error.log
Normal file
File diff suppressed because it is too large
Load Diff
90
jenkinsfile
Normal file
90
jenkinsfile
Normal file
@@ -0,0 +1,90 @@
|
||||
pipeline {
|
||||
agent any
|
||||
|
||||
environment {
|
||||
JAVA_HOME = '/var/lib/jenkins/tools/openjdk17'
|
||||
MAVEN_HOME = '/usr/share/maven'
|
||||
PATH = "${MAVEN_HOME}/bin:${JAVA_HOME}/bin:${PATH}"
|
||||
APP_NAME = 'oms'
|
||||
VERSION = '0.0.1-SNAPSHOT'
|
||||
JAR_FILE = "target/oms.jar"
|
||||
AWS_SERVER = '54.179.159.145'
|
||||
AWS_USER = 'root'
|
||||
DEPLOY_PATH = '/home/build' // 빌드 산출물 업로드 경로
|
||||
RUN_PATH = '/home/run' // 실행 경로
|
||||
}
|
||||
|
||||
stages {
|
||||
stage('Checkout') {
|
||||
steps {
|
||||
checkout scm
|
||||
}
|
||||
}
|
||||
|
||||
stage('Build') {
|
||||
steps {
|
||||
sh 'echo "Building application..."'
|
||||
script {
|
||||
def mvnHome = tool 'maven'
|
||||
sh "${mvnHome}/bin/mvn clean package -Pdev -DskipTests -Dspring.profiles.active=dev"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('Archive Artifacts') {
|
||||
steps {
|
||||
sh 'echo "Checking JAR file..."'
|
||||
sh 'ls -la target/'
|
||||
sh 'ls -la target/*.jar'
|
||||
archiveArtifacts artifacts: 'target/*.jar', fingerprint: true
|
||||
}
|
||||
}
|
||||
|
||||
stage('Deploy to AWS') {
|
||||
steps {
|
||||
script {
|
||||
// 실제 빌드된 JAR 파일 찾기
|
||||
def jarFiles = sh(
|
||||
script: 'find target -name "*.jar" -not -name "*-sources.jar" -not -name "*-javadoc.jar" | head -1',
|
||||
returnStdout: true
|
||||
).trim()
|
||||
|
||||
if (!jarFiles) {
|
||||
error "JAR 파일을 찾을 수 없습니다."
|
||||
}
|
||||
|
||||
def actualJarFile = jarFiles.split('\n')[0]
|
||||
echo "실제 JAR 파일: ${actualJarFile}"
|
||||
|
||||
withCredentials([sshUserPrivateKey(credentialsId: 'coreserver', keyFileVariable: 'SSH_KEY')]) {
|
||||
sh """
|
||||
echo "Deploying to AWS server..."
|
||||
chmod +x deploy-aws.sh
|
||||
./deploy-aws.sh ${AWS_SERVER} ${AWS_USER} "\${SSH_KEY}" ${actualJarFile} ${DEPLOY_PATH}
|
||||
echo "Uploading and running runApi.sh..."
|
||||
chmod +x runApi.sh
|
||||
scp -i "\${SSH_KEY}" runApi.sh ${AWS_USER}@${AWS_SERVER}:${RUN_PATH}/runApi.sh
|
||||
ssh -i "\${SSH_KEY}" ${AWS_USER}@${AWS_SERVER} "chmod +x ${RUN_PATH}/runApi.sh && JAR_NAME=\$(basename ${actualJarFile}) BUILD_DIR=${DEPLOY_PATH} RUN_DIR=${RUN_PATH} ${RUN_PATH}/runApi.sh"
|
||||
"""
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
post {
|
||||
success {
|
||||
echo 'Pipeline succeeded!'
|
||||
// 슬랙 알림 등 추가 가능
|
||||
}
|
||||
failure {
|
||||
echo 'Pipeline failed!'
|
||||
// 실패 알림 등 추가 가능
|
||||
}
|
||||
always {
|
||||
// 빌드 결과 정리
|
||||
sh 'echo "Build completed"'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
90
jenkinsfile2
Normal file
90
jenkinsfile2
Normal file
@@ -0,0 +1,90 @@
|
||||
pipeline {
|
||||
agent any
|
||||
|
||||
environment {
|
||||
JAVA_HOME = '/var/lib/jenkins/tools/openjdk17'
|
||||
MAVEN_HOME = '/usr/share/maven'
|
||||
PATH = "${MAVEN_HOME}/bin:${JAVA_HOME}/bin:${PATH}"
|
||||
APP_NAME = 'oms'
|
||||
VERSION = '0.0.1-SNAPSHOT'
|
||||
JAR_FILE = "target/oms.jar"
|
||||
AWS_SERVER = '47.128.247.197'
|
||||
AWS_USER = 'rocky'
|
||||
DEPLOY_PATH = '/home/build' // 빌드 산출물 업로드 경로
|
||||
RUN_PATH = '/home/run' // 실행 경로
|
||||
}
|
||||
|
||||
stages {
|
||||
stage('Checkout') {
|
||||
steps {
|
||||
checkout scm
|
||||
}
|
||||
}
|
||||
|
||||
stage('Build') {
|
||||
steps {
|
||||
sh 'echo "Building application..."'
|
||||
script {
|
||||
def mvnHome = tool 'maven'
|
||||
sh "${mvnHome}/bin/mvn clean package -Pdev -DskipTests -Dspring.profiles.active=dev"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage('Archive Artifacts') {
|
||||
steps {
|
||||
sh 'echo "Checking JAR file..."'
|
||||
sh 'ls -la target/'
|
||||
sh 'ls -la target/*.jar'
|
||||
archiveArtifacts artifacts: 'target/*.jar', fingerprint: true
|
||||
}
|
||||
}
|
||||
|
||||
stage('Deploy to AWS') {
|
||||
steps {
|
||||
script {
|
||||
// 실제 빌드된 JAR 파일 찾기
|
||||
def jarFiles = sh(
|
||||
script: 'find target -name "*.jar" -not -name "*-sources.jar" -not -name "*-javadoc.jar" | head -1',
|
||||
returnStdout: true
|
||||
).trim()
|
||||
|
||||
if (!jarFiles) {
|
||||
error "JAR 파일을 찾을 수 없습니다."
|
||||
}
|
||||
|
||||
def actualJarFile = jarFiles.split('\n')[0]
|
||||
echo "실제 JAR 파일: ${actualJarFile}"
|
||||
|
||||
withCredentials([sshUserPrivateKey(credentialsId: 'coreserver2', keyFileVariable: 'SSH_KEY')]) {
|
||||
sh """
|
||||
echo "Deploying to AWS server..."
|
||||
chmod +x deploy-aws2.sh
|
||||
./deploy-aws2.sh ${AWS_SERVER} ${AWS_USER} "\${SSH_KEY}" ${actualJarFile} ${DEPLOY_PATH}
|
||||
echo "Uploading and running runApi.sh..."
|
||||
chmod +x runApi.sh
|
||||
scp -i "\${SSH_KEY}" runApi.sh ${AWS_USER}@${AWS_SERVER}:/home/${AWS_USER}/temp_runApi.sh
|
||||
ssh -i "\${SSH_KEY}" ${AWS_USER}@${AWS_SERVER} "sudo -i bash -c 'mv /home/${AWS_USER}/temp_runApi.sh ${RUN_PATH}/runApi.sh && chmod +x ${RUN_PATH}/runApi.sh && JAR_NAME=\$(basename ${actualJarFile}) BUILD_DIR=${DEPLOY_PATH} RUN_DIR=${RUN_PATH} ${RUN_PATH}/runApi.sh'"
|
||||
"""
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
post {
|
||||
success {
|
||||
echo 'Pipeline succeeded!'
|
||||
// 슬랙 알림 등 추가 가능
|
||||
}
|
||||
failure {
|
||||
echo 'Pipeline failed!'
|
||||
// 실패 알림 등 추가 가능
|
||||
}
|
||||
always {
|
||||
// 빌드 결과 정리
|
||||
sh 'echo "Build completed"'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
310
mvnw
vendored
Normal file
310
mvnw
vendored
Normal file
@@ -0,0 +1,310 @@
|
||||
#!/bin/sh
|
||||
# ----------------------------------------------------------------------------
|
||||
# Licensed to the Apache Software Foundation (ASF) under one
|
||||
# or more contributor license agreements. See the NOTICE file
|
||||
# distributed with this work for additional information
|
||||
# regarding copyright ownership. The ASF licenses this file
|
||||
# to you under the Apache License, Version 2.0 (the
|
||||
# "License"); you may not use this file except in compliance
|
||||
# with the License. You may obtain a copy of the License at
|
||||
#
|
||||
# https://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing,
|
||||
# software distributed under the License is distributed on an
|
||||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
# ----------------------------------------------------------------------------
|
||||
|
||||
# ----------------------------------------------------------------------------
|
||||
# Maven Start Up Batch script
|
||||
#
|
||||
# Required ENV vars:
|
||||
# ------------------
|
||||
# JAVA_HOME - location of a JDK home dir
|
||||
#
|
||||
# Optional ENV vars
|
||||
# -----------------
|
||||
# M2_HOME - location of maven2's installed home dir
|
||||
# MAVEN_OPTS - parameters passed to the Java VM when running Maven
|
||||
# e.g. to debug Maven itself, use
|
||||
# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
|
||||
# MAVEN_SKIP_RC - flag to disable loading of mavenrc files
|
||||
# ----------------------------------------------------------------------------
|
||||
|
||||
if [ -z "$MAVEN_SKIP_RC" ] ; then
|
||||
|
||||
if [ -f /etc/mavenrc ] ; then
|
||||
. /etc/mavenrc
|
||||
fi
|
||||
|
||||
if [ -f "$HOME/.mavenrc" ] ; then
|
||||
. "$HOME/.mavenrc"
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
# OS specific support. $var _must_ be set to either true or false.
|
||||
cygwin=false;
|
||||
darwin=false;
|
||||
mingw=false
|
||||
case "`uname`" in
|
||||
CYGWIN*) cygwin=true ;;
|
||||
MINGW*) mingw=true;;
|
||||
Darwin*) darwin=true
|
||||
# Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home
|
||||
# See https://developer.apple.com/library/mac/qa/qa1170/_index.html
|
||||
if [ -z "$JAVA_HOME" ]; then
|
||||
if [ -x "/usr/libexec/java_home" ]; then
|
||||
export JAVA_HOME="`/usr/libexec/java_home`"
|
||||
else
|
||||
export JAVA_HOME="/Library/Java/Home"
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ -z "$JAVA_HOME" ] ; then
|
||||
if [ -r /etc/gentoo-release ] ; then
|
||||
JAVA_HOME=`java-config --jre-home`
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -z "$M2_HOME" ] ; then
|
||||
## resolve links - $0 may be a link to maven's home
|
||||
PRG="$0"
|
||||
|
||||
# need this for relative symlinks
|
||||
while [ -h "$PRG" ] ; do
|
||||
ls=`ls -ld "$PRG"`
|
||||
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||
if expr "$link" : '/.*' > /dev/null; then
|
||||
PRG="$link"
|
||||
else
|
||||
PRG="`dirname "$PRG"`/$link"
|
||||
fi
|
||||
done
|
||||
|
||||
saveddir=`pwd`
|
||||
|
||||
M2_HOME=`dirname "$PRG"`/..
|
||||
|
||||
# make it fully qualified
|
||||
M2_HOME=`cd "$M2_HOME" && pwd`
|
||||
|
||||
cd "$saveddir"
|
||||
# echo Using m2 at $M2_HOME
|
||||
fi
|
||||
|
||||
# For Cygwin, ensure paths are in UNIX format before anything is touched
|
||||
if $cygwin ; then
|
||||
[ -n "$M2_HOME" ] &&
|
||||
M2_HOME=`cygpath --unix "$M2_HOME"`
|
||||
[ -n "$JAVA_HOME" ] &&
|
||||
JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
|
||||
[ -n "$CLASSPATH" ] &&
|
||||
CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
|
||||
fi
|
||||
|
||||
# For Mingw, ensure paths are in UNIX format before anything is touched
|
||||
if $mingw ; then
|
||||
[ -n "$M2_HOME" ] &&
|
||||
M2_HOME="`(cd "$M2_HOME"; pwd)`"
|
||||
[ -n "$JAVA_HOME" ] &&
|
||||
JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`"
|
||||
fi
|
||||
|
||||
if [ -z "$JAVA_HOME" ]; then
|
||||
javaExecutable="`which javac`"
|
||||
if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then
|
||||
# readlink(1) is not available as standard on Solaris 10.
|
||||
readLink=`which readlink`
|
||||
if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then
|
||||
if $darwin ; then
|
||||
javaHome="`dirname \"$javaExecutable\"`"
|
||||
javaExecutable="`cd \"$javaHome\" && pwd -P`/javac"
|
||||
else
|
||||
javaExecutable="`readlink -f \"$javaExecutable\"`"
|
||||
fi
|
||||
javaHome="`dirname \"$javaExecutable\"`"
|
||||
javaHome=`expr "$javaHome" : '\(.*\)/bin'`
|
||||
JAVA_HOME="$javaHome"
|
||||
export JAVA_HOME
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -z "$JAVACMD" ] ; then
|
||||
if [ -n "$JAVA_HOME" ] ; then
|
||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||
# IBM's JDK on AIX uses strange locations for the executables
|
||||
JAVACMD="$JAVA_HOME/jre/sh/java"
|
||||
else
|
||||
JAVACMD="$JAVA_HOME/bin/java"
|
||||
fi
|
||||
else
|
||||
JAVACMD="`which java`"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ ! -x "$JAVACMD" ] ; then
|
||||
echo "Error: JAVA_HOME is not defined correctly." >&2
|
||||
echo " We cannot execute $JAVACMD" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "$JAVA_HOME" ] ; then
|
||||
echo "Warning: JAVA_HOME environment variable is not set."
|
||||
fi
|
||||
|
||||
CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
|
||||
|
||||
# traverses directory structure from process work directory to filesystem root
|
||||
# first directory with .mvn subdirectory is considered project base directory
|
||||
find_maven_basedir() {
|
||||
|
||||
if [ -z "$1" ]
|
||||
then
|
||||
echo "Path not specified to find_maven_basedir"
|
||||
return 1
|
||||
fi
|
||||
|
||||
basedir="$1"
|
||||
wdir="$1"
|
||||
while [ "$wdir" != '/' ] ; do
|
||||
if [ -d "$wdir"/.mvn ] ; then
|
||||
basedir=$wdir
|
||||
break
|
||||
fi
|
||||
# workaround for JBEAP-8937 (on Solaris 10/Sparc)
|
||||
if [ -d "${wdir}" ]; then
|
||||
wdir=`cd "$wdir/.."; pwd`
|
||||
fi
|
||||
# end of workaround
|
||||
done
|
||||
echo "${basedir}"
|
||||
}
|
||||
|
||||
# concatenates all lines of a file
|
||||
concat_lines() {
|
||||
if [ -f "$1" ]; then
|
||||
echo "$(tr -s '\n' ' ' < "$1")"
|
||||
fi
|
||||
}
|
||||
|
||||
BASE_DIR=`find_maven_basedir "$(pwd)"`
|
||||
if [ -z "$BASE_DIR" ]; then
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
##########################################################################################
|
||||
# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
|
||||
# This allows using the maven wrapper in projects that prohibit checking in binary data.
|
||||
##########################################################################################
|
||||
if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then
|
||||
if [ "$MVNW_VERBOSE" = true ]; then
|
||||
echo "Found .mvn/wrapper/maven-wrapper.jar"
|
||||
fi
|
||||
else
|
||||
if [ "$MVNW_VERBOSE" = true ]; then
|
||||
echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..."
|
||||
fi
|
||||
if [ -n "$MVNW_REPOURL" ]; then
|
||||
jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
|
||||
else
|
||||
jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
|
||||
fi
|
||||
while IFS="=" read key value; do
|
||||
case "$key" in (wrapperUrl) jarUrl="$value"; break ;;
|
||||
esac
|
||||
done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties"
|
||||
if [ "$MVNW_VERBOSE" = true ]; then
|
||||
echo "Downloading from: $jarUrl"
|
||||
fi
|
||||
wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar"
|
||||
if $cygwin; then
|
||||
wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"`
|
||||
fi
|
||||
|
||||
if command -v wget > /dev/null; then
|
||||
if [ "$MVNW_VERBOSE" = true ]; then
|
||||
echo "Found wget ... using wget"
|
||||
fi
|
||||
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
|
||||
wget "$jarUrl" -O "$wrapperJarPath"
|
||||
else
|
||||
wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath"
|
||||
fi
|
||||
elif command -v curl > /dev/null; then
|
||||
if [ "$MVNW_VERBOSE" = true ]; then
|
||||
echo "Found curl ... using curl"
|
||||
fi
|
||||
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
|
||||
curl -o "$wrapperJarPath" "$jarUrl" -f
|
||||
else
|
||||
curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f
|
||||
fi
|
||||
|
||||
else
|
||||
if [ "$MVNW_VERBOSE" = true ]; then
|
||||
echo "Falling back to using Java to download"
|
||||
fi
|
||||
javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java"
|
||||
# For Cygwin, switch paths to Windows format before running javac
|
||||
if $cygwin; then
|
||||
javaClass=`cygpath --path --windows "$javaClass"`
|
||||
fi
|
||||
if [ -e "$javaClass" ]; then
|
||||
if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
|
||||
if [ "$MVNW_VERBOSE" = true ]; then
|
||||
echo " - Compiling MavenWrapperDownloader.java ..."
|
||||
fi
|
||||
# Compiling the Java class
|
||||
("$JAVA_HOME/bin/javac" "$javaClass")
|
||||
fi
|
||||
if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
|
||||
# Running the downloader
|
||||
if [ "$MVNW_VERBOSE" = true ]; then
|
||||
echo " - Running MavenWrapperDownloader.java ..."
|
||||
fi
|
||||
("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR")
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
##########################################################################################
|
||||
# End of extension
|
||||
##########################################################################################
|
||||
|
||||
export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}
|
||||
if [ "$MVNW_VERBOSE" = true ]; then
|
||||
echo $MAVEN_PROJECTBASEDIR
|
||||
fi
|
||||
MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
|
||||
|
||||
# For Cygwin, switch paths to Windows format before running java
|
||||
if $cygwin; then
|
||||
[ -n "$M2_HOME" ] &&
|
||||
M2_HOME=`cygpath --path --windows "$M2_HOME"`
|
||||
[ -n "$JAVA_HOME" ] &&
|
||||
JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
|
||||
[ -n "$CLASSPATH" ] &&
|
||||
CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
|
||||
[ -n "$MAVEN_PROJECTBASEDIR" ] &&
|
||||
MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"`
|
||||
fi
|
||||
|
||||
# Provide a "standardized" way to retrieve the CLI args that will
|
||||
# work with both Windows and non-Windows executions.
|
||||
MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@"
|
||||
export MAVEN_CMD_LINE_ARGS
|
||||
|
||||
WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
|
||||
|
||||
exec "$JAVACMD" \
|
||||
$MAVEN_OPTS \
|
||||
-classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
|
||||
"-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
|
||||
${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"
|
||||
182
mvnw.cmd
vendored
Normal file
182
mvnw.cmd
vendored
Normal file
@@ -0,0 +1,182 @@
|
||||
@REM ----------------------------------------------------------------------------
|
||||
@REM Licensed to the Apache Software Foundation (ASF) under one
|
||||
@REM or more contributor license agreements. See the NOTICE file
|
||||
@REM distributed with this work for additional information
|
||||
@REM regarding copyright ownership. The ASF licenses this file
|
||||
@REM to you under the Apache License, Version 2.0 (the
|
||||
@REM "License"); you may not use this file except in compliance
|
||||
@REM with the License. You may obtain a copy of the License at
|
||||
@REM
|
||||
@REM https://www.apache.org/licenses/LICENSE-2.0
|
||||
@REM
|
||||
@REM Unless required by applicable law or agreed to in writing,
|
||||
@REM software distributed under the License is distributed on an
|
||||
@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
@REM KIND, either express or implied. See the License for the
|
||||
@REM specific language governing permissions and limitations
|
||||
@REM under the License.
|
||||
@REM ----------------------------------------------------------------------------
|
||||
|
||||
@REM ----------------------------------------------------------------------------
|
||||
@REM Maven Start Up Batch script
|
||||
@REM
|
||||
@REM Required ENV vars:
|
||||
@REM JAVA_HOME - location of a JDK home dir
|
||||
@REM
|
||||
@REM Optional ENV vars
|
||||
@REM M2_HOME - location of maven2's installed home dir
|
||||
@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
|
||||
@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending
|
||||
@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
|
||||
@REM e.g. to debug Maven itself, use
|
||||
@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
|
||||
@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
|
||||
@REM ----------------------------------------------------------------------------
|
||||
|
||||
@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
|
||||
@echo off
|
||||
@REM set title of command window
|
||||
title %0
|
||||
@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on'
|
||||
@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
|
||||
|
||||
@REM set %HOME% to equivalent of $HOME
|
||||
if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
|
||||
|
||||
@REM Execute a user defined script before this one
|
||||
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
|
||||
@REM check for pre script, once with legacy .bat ending and once with .cmd ending
|
||||
if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat"
|
||||
if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd"
|
||||
:skipRcPre
|
||||
|
||||
@setlocal
|
||||
|
||||
set ERROR_CODE=0
|
||||
|
||||
@REM To isolate internal variables from possible post scripts, we use another setlocal
|
||||
@setlocal
|
||||
|
||||
@REM ==== START VALIDATION ====
|
||||
if not "%JAVA_HOME%" == "" goto OkJHome
|
||||
|
||||
echo.
|
||||
echo Error: JAVA_HOME not found in your environment. >&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the >&2
|
||||
echo location of your Java installation. >&2
|
||||
echo.
|
||||
goto error
|
||||
|
||||
:OkJHome
|
||||
if exist "%JAVA_HOME%\bin\java.exe" goto init
|
||||
|
||||
echo.
|
||||
echo Error: JAVA_HOME is set to an invalid directory. >&2
|
||||
echo JAVA_HOME = "%JAVA_HOME%" >&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the >&2
|
||||
echo location of your Java installation. >&2
|
||||
echo.
|
||||
goto error
|
||||
|
||||
@REM ==== END VALIDATION ====
|
||||
|
||||
:init
|
||||
|
||||
@REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
|
||||
@REM Fallback to current working directory if not found.
|
||||
|
||||
set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
|
||||
IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
|
||||
|
||||
set EXEC_DIR=%CD%
|
||||
set WDIR=%EXEC_DIR%
|
||||
:findBaseDir
|
||||
IF EXIST "%WDIR%"\.mvn goto baseDirFound
|
||||
cd ..
|
||||
IF "%WDIR%"=="%CD%" goto baseDirNotFound
|
||||
set WDIR=%CD%
|
||||
goto findBaseDir
|
||||
|
||||
:baseDirFound
|
||||
set MAVEN_PROJECTBASEDIR=%WDIR%
|
||||
cd "%EXEC_DIR%"
|
||||
goto endDetectBaseDir
|
||||
|
||||
:baseDirNotFound
|
||||
set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
|
||||
cd "%EXEC_DIR%"
|
||||
|
||||
:endDetectBaseDir
|
||||
|
||||
IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
|
||||
|
||||
@setlocal EnableExtensions EnableDelayedExpansion
|
||||
for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
|
||||
@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
|
||||
|
||||
:endReadAdditionalConfig
|
||||
|
||||
SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
|
||||
set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
|
||||
set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
|
||||
|
||||
set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
|
||||
|
||||
FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO (
|
||||
IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B
|
||||
)
|
||||
|
||||
@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
|
||||
@REM This allows using the maven wrapper in projects that prohibit checking in binary data.
|
||||
if exist %WRAPPER_JAR% (
|
||||
if "%MVNW_VERBOSE%" == "true" (
|
||||
echo Found %WRAPPER_JAR%
|
||||
)
|
||||
) else (
|
||||
if not "%MVNW_REPOURL%" == "" (
|
||||
SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
|
||||
)
|
||||
if "%MVNW_VERBOSE%" == "true" (
|
||||
echo Couldn't find %WRAPPER_JAR%, downloading it ...
|
||||
echo Downloading from: %DOWNLOAD_URL%
|
||||
)
|
||||
|
||||
powershell -Command "&{"^
|
||||
"$webclient = new-object System.Net.WebClient;"^
|
||||
"if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^
|
||||
"$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^
|
||||
"}"^
|
||||
"[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^
|
||||
"}"
|
||||
if "%MVNW_VERBOSE%" == "true" (
|
||||
echo Finished downloading %WRAPPER_JAR%
|
||||
)
|
||||
)
|
||||
@REM End of extension
|
||||
|
||||
@REM Provide a "standardized" way to retrieve the CLI args that will
|
||||
@REM work with both Windows and non-Windows executions.
|
||||
set MAVEN_CMD_LINE_ARGS=%*
|
||||
|
||||
%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
|
||||
if ERRORLEVEL 1 goto error
|
||||
goto end
|
||||
|
||||
:error
|
||||
set ERROR_CODE=1
|
||||
|
||||
:end
|
||||
@endlocal & set ERROR_CODE=%ERROR_CODE%
|
||||
|
||||
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost
|
||||
@REM check for post script, once with legacy .bat ending and once with .cmd ending
|
||||
if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"
|
||||
if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd"
|
||||
:skipRcPost
|
||||
|
||||
@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
|
||||
if "%MAVEN_BATCH_PAUSE%" == "on" pause
|
||||
|
||||
if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE%
|
||||
|
||||
exit /B %ERROR_CODE%
|
||||
284
pom.xml
Normal file
284
pom.xml
Normal file
@@ -0,0 +1,284 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>3.0.0</version>
|
||||
<relativePath /> <!-- lookup parent from repository -->
|
||||
</parent>
|
||||
<groupId>com.example</groupId>
|
||||
<artifactId>apiServer</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
<name>newApiServer</name>
|
||||
<description>Demo project for Spring Boot</description>
|
||||
<properties>
|
||||
<env>real</env>
|
||||
<java.version>17</java.version>
|
||||
<maven.compiler.source>17</maven.compiler.source>
|
||||
<maven.compiler.target>17</maven.compiler.target>
|
||||
<repackage.classifier />
|
||||
</properties>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-tomcat</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-security</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-websocket</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-jdbc</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mybatis.spring.boot</groupId>
|
||||
<artifactId>mybatis-spring-boot-starter</artifactId>
|
||||
<version>3.0.4</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-validation</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-core</artifactId>
|
||||
<version>6.0.12</version> <!-- Updated to match Spring Boot version -->
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>jakarta.validation</groupId>
|
||||
<artifactId>jakarta.validation-api</artifactId>
|
||||
<version>3.0.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.thymeleaf</groupId>
|
||||
<artifactId>thymeleaf</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>nz.net.ultraq.thymeleaf</groupId>
|
||||
<artifactId>thymeleaf-layout-dialect</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.session</groupId>
|
||||
<artifactId>spring-session-core</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
<version>8.0.33</version>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mariadb.jdbc</groupId>
|
||||
<artifactId>mariadb-java-client</artifactId>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-configuration-processor</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<version>1.18.30</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-webflux</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.jsonwebtoken</groupId>
|
||||
<artifactId>jjwt-api</artifactId>
|
||||
<version>0.11.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.jsonwebtoken</groupId>
|
||||
<artifactId>jjwt-impl</artifactId>
|
||||
<version>0.11.2</version>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.jsonwebtoken</groupId>
|
||||
<artifactId>jjwt-jackson</artifactId>
|
||||
<version>0.11.2</version>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.jsonwebtoken</groupId>
|
||||
<artifactId>jjwt-gson</artifactId>
|
||||
<version>0.11.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.xml.bind</groupId>
|
||||
<artifactId>jaxb-api</artifactId>
|
||||
<version>2.3.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.sun.xml.bind</groupId>
|
||||
<artifactId>jaxb-core</artifactId>
|
||||
<version>2.3.0.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.sun.xml.bind</groupId>
|
||||
<artifactId>jaxb-impl</artifactId>
|
||||
<version>2.3.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springdoc</groupId>
|
||||
<artifactId>springdoc-openapi-ui</artifactId>
|
||||
<version>1.5.4</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.json</groupId>
|
||||
<artifactId>json</artifactId>
|
||||
<version>20230227</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.sf.json-lib</groupId>
|
||||
<artifactId>json-lib</artifactId>
|
||||
<version>2.4</version>
|
||||
<classifier>jdk15</classifier>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jsoup</groupId>
|
||||
<artifactId>jsoup</artifactId>
|
||||
<version>1.14.3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.httpcomponents</groupId>
|
||||
<artifactId>httpclient</artifactId>
|
||||
<version>4.5.13</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.httpcomponents.client5</groupId>
|
||||
<artifactId>httpclient5</artifactId>
|
||||
<version>5.4.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.squareup.okhttp3</groupId>
|
||||
<artifactId>okhttp</artifactId>
|
||||
<version>4.11.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||
<version>3.1.4</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.micrometer</groupId>
|
||||
<artifactId>micrometer-registry-prometheus</artifactId>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.warrenstrange</groupId>
|
||||
<artifactId>googleauth</artifactId>
|
||||
<version>1.5.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.codehaus.jettison</groupId>
|
||||
<artifactId>jettison</artifactId>
|
||||
<version>1.4.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.httpcomponents.client5</groupId>
|
||||
<artifactId>httpclient5</artifactId>
|
||||
<version>5.3.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.webjars</groupId>
|
||||
<artifactId>webjars-locator-core</artifactId>
|
||||
<version>0.46</version> <!-- 호환되는 버전으로 업데이트 -->
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.github.classgraph</groupId>
|
||||
<artifactId>classgraph</artifactId>
|
||||
<version>4.8.90</version> <!-- 호환되는 버전으로 업데이트 -->
|
||||
</dependency>
|
||||
|
||||
<!-- https://mvnrepository.com/artifact/commons-io/commons-io -->
|
||||
<dependency>
|
||||
<groupId>commons-io</groupId>
|
||||
<artifactId>commons-io</artifactId>
|
||||
<version>2.11.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-messaging</artifactId>
|
||||
<version>6.0.12</version> <!-- 프로젝트에 맞는 Spring 버전을 사용하세요 -->
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.integration</groupId>
|
||||
<artifactId>spring-integration-security</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.integration</groupId>
|
||||
<artifactId>spring-integration-stomp</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.integration</groupId>
|
||||
<artifactId>spring-integration-websocket</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>jakarta.servlet</groupId>
|
||||
<artifactId>jakarta.servlet-api</artifactId>
|
||||
<version>6.0.0</version> <!-- Match your Spring Boot version -->
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>io.netty</groupId>
|
||||
<artifactId>netty-tcnative-boringssl-static</artifactId>
|
||||
<version>2.0.61.Final</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
<excludes>
|
||||
<exclude>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
</exclude>
|
||||
</excludes>
|
||||
<classifier>${repackage.classifier}</classifier>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>spring-releases</id>
|
||||
<name>Spring Releases</name>
|
||||
<url>https://repo.spring.io/release</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
<pluginRepositories>
|
||||
<pluginRepository>
|
||||
<id>spring-releases</id>
|
||||
<name>Spring Releases</name>
|
||||
<url>https://repo.spring.io/release</url>
|
||||
<snapshots>
|
||||
<enabled>false</enabled>
|
||||
</snapshots>
|
||||
</pluginRepository>
|
||||
</pluginRepositories>
|
||||
</project>
|
||||
108
runApi.sh
Normal file
108
runApi.sh
Normal file
@@ -0,0 +1,108 @@
|
||||
#!/bin/bash
|
||||
|
||||
# API 서버 배포 및 실행 스크립트
|
||||
# 사용법: sudo ./runApi.sh
|
||||
# 필요한 경로/파일이 다를 경우 아래 변수만 수정하세요.
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
JAR_NAME="${JAR_NAME:-apiServer-0.0.1-SNAPSHOT.jar}"
|
||||
PID_FILE="${PID_FILE:-/home/api.pid}"
|
||||
RUN_DIR="${RUN_DIR:-/home/run}"
|
||||
BUILD_DIR="${BUILD_DIR:-/home/build}"
|
||||
BACKUP_DIR="${BACKUP_DIR:-/home/backup}"
|
||||
JAVA_BIN="${JAVA_BIN:-/home/openjdk17/bin/java}"
|
||||
# SCOUTER_AGENT="${SCOUTER_AGENT:-/home/scouter/agent.java/scouter.agent.jar}"
|
||||
# SCOUTER_CONF="${SCOUTER_CONF:-/home/scouter/agent.java/conf/scouter.conf}"
|
||||
SPRING_PROFILE="${SPRING_PROFILE:-real}"
|
||||
|
||||
timestamp() {
|
||||
date +"%Y%m%d_%H%M%S"
|
||||
}
|
||||
|
||||
log() {
|
||||
echo "[runApi] $*"
|
||||
}
|
||||
|
||||
ensure_paths() {
|
||||
mkdir -p "$RUN_DIR" "$BACKUP_DIR" "$BUILD_DIR"
|
||||
}
|
||||
|
||||
stop_app() {
|
||||
if [[ -f "$PID_FILE" ]]; then
|
||||
local pid
|
||||
pid=$(cat "$PID_FILE" 2>/dev/null || true)
|
||||
if [[ -n "${pid:-}" ]] && ps -p "$pid" > /dev/null 2>&1; then
|
||||
log "기존 프로세스 종료: $pid"
|
||||
kill -9 "$pid" || true
|
||||
else
|
||||
log "PID 파일은 있으나 실행 중인 프로세스가 없습니다."
|
||||
fi
|
||||
rm -f "$PID_FILE"
|
||||
else
|
||||
log "종료할 PID 파일이 없습니다."
|
||||
fi
|
||||
}
|
||||
|
||||
backup_old() {
|
||||
local current="$RUN_DIR/$JAR_NAME"
|
||||
if [[ -f "$current" ]]; then
|
||||
local backup="$BACKUP_DIR/oldApi_$(timestamp).jar"
|
||||
log "기존 JAR 백업 -> $backup"
|
||||
mv "$current" "$backup"
|
||||
else
|
||||
log "백업할 기존 JAR이 없습니다."
|
||||
fi
|
||||
}
|
||||
|
||||
copy_new() {
|
||||
local source="$BUILD_DIR/$JAR_NAME"
|
||||
local target="$RUN_DIR/$JAR_NAME"
|
||||
|
||||
# 소스와 타겟이 같으면 복사 불필요
|
||||
if [[ "$source" == "$target" ]]; then
|
||||
if [[ -f "$target" ]]; then
|
||||
log "배포된 JAR 확인 -> $target"
|
||||
return 0
|
||||
else
|
||||
log "새 JAR을 찾을 수 없습니다: $target"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ ! -f "$source" ]]; then
|
||||
log "새 JAR을 찾을 수 없습니다: $source"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
log "새 JAR 복사 -> $target"
|
||||
cp "$source" "$target"
|
||||
}
|
||||
|
||||
start_app() {
|
||||
local target="$RUN_DIR/$JAR_NAME"
|
||||
log "애플리케이션 시작"
|
||||
local log_dir="${LOG_DIR:-/home/log/core}"
|
||||
local log_file="${LOG_FILE:-$log_dir/apiServer.log}"
|
||||
mkdir -p "$log_dir"
|
||||
|
||||
nohup "$JAVA_BIN" \
|
||||
-Duser.timezone=GMT+09:00 \
|
||||
-Dspring.profiles.active="$SPRING_PROFILE" \
|
||||
-jar "$target" \
|
||||
>> "$log_file" 2>&1 &
|
||||
echo $! > "$PID_FILE"
|
||||
log "시작 완료 (PID: $(cat "$PID_FILE"))"
|
||||
}
|
||||
|
||||
main() {
|
||||
ensure_paths
|
||||
stop_app
|
||||
backup_old
|
||||
copy_new
|
||||
start_app
|
||||
log "배포 완료"
|
||||
}
|
||||
|
||||
main "$@"
|
||||
|
||||
20
src/main/java/com/bb/ApiServerApplication.java
Normal file
20
src/main/java/com/bb/ApiServerApplication.java
Normal file
@@ -0,0 +1,20 @@
|
||||
package com.bb;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.web.servlet.ServletComponentScan;
|
||||
import org.springframework.scheduling.annotation.EnableAsync;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
|
||||
@EnableAsync
|
||||
@ServletComponentScan(basePackages = {"com.bb.config"})
|
||||
@SpringBootApplication
|
||||
@EnableScheduling
|
||||
public class ApiServerApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
System.out.println(" >>> Using Java Version: " + System.getProperty("java.version"));
|
||||
SpringApplication.run(ApiServerApplication.class, args);
|
||||
}
|
||||
|
||||
}
|
||||
806
src/main/java/com/bb/admin/controller/AdminApiBetController.java
Normal file
806
src/main/java/com/bb/admin/controller/AdminApiBetController.java
Normal file
@@ -0,0 +1,806 @@
|
||||
package com.bb.admin.controller;
|
||||
|
||||
import java.net.SocketTimeoutException;
|
||||
import java.text.DecimalFormat;
|
||||
import java.text.NumberFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.http.conn.ConnectTimeoutException;
|
||||
import org.codehaus.jettison.json.JSONObject;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestHeader;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.client.ResourceAccessException;
|
||||
|
||||
import com.bb.exception.ApiException;
|
||||
import com.bb.jwt.JwtManager;
|
||||
import com.bb.model.AdminBetSearch;
|
||||
import com.bb.model.ApiResponse;
|
||||
import com.bb.model.ApiVendorCompInfo;
|
||||
import com.bb.model.BetDetail;
|
||||
import com.bb.model.BetSearch;
|
||||
import com.bb.model.BetSplusSearch;
|
||||
import com.bb.model.GameUseInfo;
|
||||
import com.bb.model.PageFormVO;
|
||||
import com.bb.model.Site;
|
||||
import com.bb.model.SiteOption;
|
||||
import com.bb.model.SiteSearch;
|
||||
import com.bb.model.TrxSearchVO;
|
||||
import com.bb.service.BetService;
|
||||
import com.bb.service.CommonService;
|
||||
import com.bb.service.TripleService;
|
||||
import com.bb.service.UserService;
|
||||
import com.bb.util.PagingUtil;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.validation.Valid;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
|
||||
@RestController
|
||||
@Slf4j
|
||||
@RequestMapping("/api/admin/bet")
|
||||
@RequiredArgsConstructor
|
||||
@SecurityRequirement(name = "Authorization")
|
||||
public class AdminApiBetController {
|
||||
|
||||
private final UserService userService;
|
||||
|
||||
private final BetService betService;
|
||||
|
||||
private final TripleService tripleService;
|
||||
|
||||
private final CommonService commonService;
|
||||
|
||||
private final JwtManager jwtManager;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
private static NumberFormat formatter = new DecimalFormat("#0.00");
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value={"/gameUseUpdate"})
|
||||
public ApiResponse gameUseInfo(@RequestHeader String token, HttpServletRequest request, @Valid @RequestBody GameUseInfo gui) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
try {
|
||||
//Site site = getSiteByCheck(request);
|
||||
if(token==null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
JwtManager.TokenInfo tokenInfo = jwtManager.getTokenInfo(token);
|
||||
if(tokenInfo.getType()==null || tokenInfo.getType().equals("")) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
gui.setSiteId(tokenInfo.getSid());
|
||||
userService.gameUseUpdate(gui);
|
||||
|
||||
apiResponse.success();
|
||||
|
||||
} catch(ApiException e) {
|
||||
log.error(e.toString());
|
||||
apiResponse = e.getApiResponse();
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value={"/gameUse"})
|
||||
public ApiResponse gameUse(@RequestHeader String token, HttpServletRequest request, @Valid @RequestBody GameUseInfo gui) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
try {
|
||||
//Site site = getSiteByCheck(request);
|
||||
if(token==null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
JwtManager.TokenInfo tokenInfo = jwtManager.getTokenInfo(token);
|
||||
gui.setSiteId(tokenInfo.getSid());
|
||||
|
||||
List<HashMap> gameuseList = userService.gameUseList(gui);
|
||||
|
||||
apiResponse.put("list", gameuseList);
|
||||
|
||||
apiResponse.success();
|
||||
} catch(ApiException e) {
|
||||
log.error(e.toString());
|
||||
apiResponse = e.getApiResponse();
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value="/betlist")
|
||||
public ApiResponse betlist( @RequestHeader String token, HttpServletRequest request, @RequestBody BetSearch search) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
try {
|
||||
//Site site = getSiteByCheck(request);
|
||||
if(token==null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
JwtManager.TokenInfo tokenInfo = jwtManager.getTokenInfo(token);
|
||||
search.setSiteId(tokenInfo.getSid());
|
||||
|
||||
final String LOG_PREFIX = "#-ADMIN::betlist::"+tokenInfo.getSid()+":::";
|
||||
|
||||
SiteSearch paramSite = new SiteSearch();
|
||||
paramSite.setSiteId(tokenInfo.getSid());
|
||||
SiteOption siteOption = commonService.getSiteSetting(paramSite);
|
||||
search.setBlankSpinSetType(siteOption.getBlankSpinSetType());
|
||||
|
||||
if(search.getOldYn() == null || search.getOldYn().equals("")) {
|
||||
search.setOldYn("N");
|
||||
}
|
||||
|
||||
if(search.getIdType() == null || search.getIdType().equals("")) {
|
||||
search.setIdType("NORMAL");
|
||||
}
|
||||
|
||||
if(search.getIdType().equals("PTN")) {
|
||||
search.setRecommenderId(search.getMemId());
|
||||
search.setMemId(null);
|
||||
} else {
|
||||
search.setRecommenderId(null);
|
||||
}
|
||||
|
||||
if(search.getOrderColumn() == null || search.getOrderColumn().equals("")) {
|
||||
if(search.getOldYn().equals("N")) {
|
||||
search.setOrderColumn("betIdx");
|
||||
}
|
||||
}
|
||||
|
||||
if(search.getOrderType() == null || search.getOrderType().equals("")) {
|
||||
if(search.getOldYn().equals("N")) {
|
||||
search.setOrderType("DESC");
|
||||
}
|
||||
}
|
||||
|
||||
if(search.getIsBlankSpinYn() == null) {
|
||||
search.setIsBlankSpinYn("");
|
||||
}
|
||||
if(!search.getIsBlankSpinYn().equals("Y")) {
|
||||
search.setIsBlankSpinYn("");
|
||||
}
|
||||
|
||||
ObjectMapper objectMapper = new ObjectMapper();
|
||||
String reqJsonStr = objectMapper.writeValueAsString(search);
|
||||
JSONObject reqObj = new JSONObject(reqJsonStr);
|
||||
log.info(LOG_PREFIX+ "Request {}", reqObj);
|
||||
|
||||
PageFormVO pageVo= new PageFormVO();
|
||||
if(search.getPage()==0)search.setPage(1);
|
||||
|
||||
int totalCount = betService.getBetListCnt(search);
|
||||
if (totalCount != 0) {
|
||||
PageFormVO commonForm = new PageFormVO();
|
||||
commonForm.setFunction_name("goPage");
|
||||
commonForm.setPage(search.getPage());
|
||||
commonForm.setCount_per_page(20);
|
||||
if(search.getCount_per_list()==0) {
|
||||
commonForm.setCount_per_list(10);
|
||||
} else {
|
||||
commonForm.setCount_per_list(search.getCount_per_list());
|
||||
}
|
||||
commonForm.setTatal_list_count(totalCount);
|
||||
pageVo = PagingUtil.setPageUtil(commonForm);
|
||||
search.setLimit(pageVo.getLimit());
|
||||
search.setOffset(pageVo.getOffset());
|
||||
search.setTatal_list_count(totalCount);
|
||||
|
||||
apiResponse.put("pageInfo", pageVo);
|
||||
}
|
||||
|
||||
List<BetDetail> betList = betService.getBetList(search);
|
||||
|
||||
apiResponse.put("list", betList);
|
||||
apiResponse.success();
|
||||
|
||||
} catch(ApiException e) {
|
||||
log.error(e.toString());
|
||||
apiResponse = e.getApiResponse();
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value="/betlistNew")
|
||||
public ApiResponse betlistNew( @RequestHeader String token, HttpServletRequest request, @RequestBody AdminBetSearch search) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
try {
|
||||
//Site site = getSiteByCheck(request);
|
||||
if(token==null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
JwtManager.TokenInfo tokenInfo = jwtManager.getTokenInfo(token);
|
||||
search.setSiteId(tokenInfo.getSid());
|
||||
|
||||
final String LOG_PREFIX = "#-ADMIN::betlist::"+tokenInfo.getSid()+":::";
|
||||
|
||||
|
||||
if(search.getOldYn() == null || search.getOldYn().equals("")) {
|
||||
search.setOldYn("N");
|
||||
}
|
||||
|
||||
if(search.getIdType() == null || search.getIdType().equals("")) {
|
||||
search.setIdType("NORMAL");
|
||||
}
|
||||
|
||||
search.setOrderColumn("regDate");
|
||||
if(search.getOrderType() == null || search.getOrderType().equals("")) {
|
||||
search.setOrderType("DESC");
|
||||
}
|
||||
|
||||
if(search.getIsBlankSpinYn() == null) {
|
||||
search.setIsBlankSpinYn("");
|
||||
}
|
||||
if(!search.getIsBlankSpinYn().equals("Y")) {
|
||||
search.setIsBlankSpinYn("");
|
||||
}
|
||||
|
||||
if(search.getStartDate() != null && !search.getStartDate().equals("")) {
|
||||
String startDate = search.getStartDate() + ".000";
|
||||
search.setStartDate(startDate);
|
||||
}
|
||||
if(search.getEndDate() != null && !search.getEndDate().equals("")) {
|
||||
String endDate = search.getEndDate() + ".999";
|
||||
search.setEndDate(endDate);
|
||||
}
|
||||
|
||||
ObjectMapper objectMapper = new ObjectMapper();
|
||||
String reqJsonStr = objectMapper.writeValueAsString(search);
|
||||
JSONObject reqObj = new JSONObject(reqJsonStr);
|
||||
log.info(LOG_PREFIX+ "Request {}", reqObj);
|
||||
|
||||
PageFormVO pageVo= new PageFormVO();
|
||||
if(search.getPage()==0)search.setPage(1);
|
||||
|
||||
int totalCount = betService.getFastBetIdListCnt(search);
|
||||
if (totalCount != 0) {
|
||||
PageFormVO commonForm = new PageFormVO();
|
||||
commonForm.setFunction_name("goPage");
|
||||
commonForm.setPage(search.getPage());
|
||||
commonForm.setCount_per_page(20);
|
||||
if(search.getCount_per_list()==0) {
|
||||
commonForm.setCount_per_list(10);
|
||||
} else {
|
||||
commonForm.setCount_per_list(search.getCount_per_list());
|
||||
}
|
||||
commonForm.setTatal_list_count(totalCount);
|
||||
pageVo = PagingUtil.setPageUtil(commonForm);
|
||||
search.setLimit(pageVo.getLimit());
|
||||
search.setOffset(pageVo.getOffset());
|
||||
search.setTatal_list_count(totalCount);
|
||||
|
||||
apiResponse.put("pageInfo", pageVo);
|
||||
}
|
||||
List<HashMap<String, String>> betIdList = betService.getFastBetIdList(search);
|
||||
List<HashMap<String, String>> betList = new ArrayList<HashMap<String,String>>();
|
||||
for(HashMap<String, String> item : betIdList) {
|
||||
item.put("oldYn", search.getOldYn());
|
||||
HashMap<String, String> betItem = betService.getFastBetItem(item);
|
||||
betList.add(betItem);
|
||||
}
|
||||
|
||||
apiResponse.put("list", betList);
|
||||
apiResponse.success();
|
||||
|
||||
} catch(ApiException e) {
|
||||
log.error(e.toString());
|
||||
apiResponse = e.getApiResponse();
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value="/betWinList")
|
||||
public ApiResponse betWinList( @RequestHeader String token, HttpServletRequest request, @RequestBody AdminBetSearch search) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
try {
|
||||
//Site site = getSiteByCheck(request);
|
||||
if(token==null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
JwtManager.TokenInfo tokenInfo = jwtManager.getTokenInfo(token);
|
||||
search.setSiteId(tokenInfo.getSid());
|
||||
|
||||
final String LOG_PREFIX = "#-ADMIN::betlist::"+tokenInfo.getSid()+":::";
|
||||
|
||||
|
||||
if(search.getOldYn() == null || search.getOldYn().equals("")) {
|
||||
search.setOldYn("N");
|
||||
}
|
||||
|
||||
if(search.getIdType() == null || search.getIdType().equals("")) {
|
||||
search.setIdType("NORMAL");
|
||||
}
|
||||
|
||||
if(search.getOrderColumn() == null || search.getOrderColumn().equals("")) {
|
||||
search.setOrderColumn("betAmt");
|
||||
}
|
||||
|
||||
if(search.getOrderType() == null || search.getOrderType().equals("")) {
|
||||
search.setOrderType("DESC");
|
||||
}
|
||||
|
||||
if(search.getIsBlankSpinYn() == null) {
|
||||
search.setIsBlankSpinYn("");
|
||||
}
|
||||
if(!search.getIsBlankSpinYn().equals("Y")) {
|
||||
search.setIsBlankSpinYn("");
|
||||
}
|
||||
|
||||
if(search.getStartDate() != null && !search.getStartDate().equals("")) {
|
||||
String startDate = search.getStartDate() + ".000";
|
||||
search.setStartDate(startDate);
|
||||
}
|
||||
if(search.getEndDate() != null && !search.getEndDate().equals("")) {
|
||||
String endDate = search.getEndDate() + ".999";
|
||||
search.setEndDate(endDate);
|
||||
}
|
||||
|
||||
ObjectMapper objectMapper = new ObjectMapper();
|
||||
String reqJsonStr = objectMapper.writeValueAsString(search);
|
||||
JSONObject reqObj = new JSONObject(reqJsonStr);
|
||||
log.info(LOG_PREFIX+ "Request {}", reqObj);
|
||||
|
||||
PageFormVO pageVo= new PageFormVO();
|
||||
if(search.getPage()==0)search.setPage(1);
|
||||
|
||||
int totalCount = betService.getBetListNewCnt(search);
|
||||
if (totalCount != 0) {
|
||||
PageFormVO commonForm = new PageFormVO();
|
||||
commonForm.setFunction_name("goPage");
|
||||
commonForm.setPage(search.getPage());
|
||||
commonForm.setCount_per_page(20);
|
||||
if(search.getCount_per_list()==0) {
|
||||
commonForm.setCount_per_list(10);
|
||||
} else {
|
||||
commonForm.setCount_per_list(search.getCount_per_list());
|
||||
}
|
||||
commonForm.setTatal_list_count(totalCount);
|
||||
pageVo = PagingUtil.setPageUtil(commonForm);
|
||||
search.setLimit(pageVo.getLimit());
|
||||
search.setOffset(pageVo.getOffset());
|
||||
search.setTatal_list_count(totalCount);
|
||||
|
||||
apiResponse.put("pageInfo", pageVo);
|
||||
}
|
||||
List<HashMap> betList = betService.getBetListNew(search);
|
||||
|
||||
apiResponse.put("list", betList);
|
||||
apiResponse.success();
|
||||
|
||||
} catch(ApiException e) {
|
||||
log.error(e.toString());
|
||||
apiResponse = e.getApiResponse();
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value="/sportBetlist")
|
||||
public ApiResponse sportBetlist( @RequestHeader String token, HttpServletRequest request, @RequestBody BetSplusSearch search) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
try {
|
||||
//Site site = getSiteByCheck(request);
|
||||
if(token==null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
JwtManager.TokenInfo tokenInfo = jwtManager.getTokenInfo(token);
|
||||
search.setSiteId(tokenInfo.getSid());
|
||||
|
||||
if(search.getOldYn() == null || search.getOldYn().equals("")) {
|
||||
search.setOldYn("N");
|
||||
}
|
||||
|
||||
log.info("[REQUEST: "+request.getRequestURI()+"] " + search);
|
||||
|
||||
PageFormVO pageVo= new PageFormVO();
|
||||
if(search.getPage()==0)search.setPage(1);
|
||||
|
||||
int totalCount = betService.getSportBetListCnt(search);
|
||||
if (totalCount != 0) {
|
||||
PageFormVO commonForm = new PageFormVO();
|
||||
commonForm.setFunction_name("goPage");
|
||||
commonForm.setPage(search.getPage());
|
||||
commonForm.setCount_per_page(20);
|
||||
if(search.getCount_per_list()==0) {
|
||||
commonForm.setCount_per_list(10);
|
||||
} else {
|
||||
commonForm.setCount_per_list(search.getCount_per_list());
|
||||
}
|
||||
commonForm.setTatal_list_count(totalCount);
|
||||
pageVo = PagingUtil.setPageUtil(commonForm);
|
||||
search.setLimit(pageVo.getLimit());
|
||||
search.setOffset(pageVo.getOffset());
|
||||
search.setTatal_list_count(totalCount);
|
||||
|
||||
apiResponse.put("pageInfo", pageVo);
|
||||
}
|
||||
|
||||
List<HashMap> betList = betService.getSportBetList(search);
|
||||
apiResponse.put("list", betList);
|
||||
|
||||
apiResponse.success();
|
||||
|
||||
} catch(ApiException e) {
|
||||
log.error(e.toString());
|
||||
apiResponse = e.getApiResponse();
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value="/sportEventlist")
|
||||
public ApiResponse sportEventlist( @RequestHeader String token, HttpServletRequest request, @RequestBody BetSplusSearch search) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
try {
|
||||
//Site site = getSiteByCheck(request);
|
||||
if(token==null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
JwtManager.TokenInfo tokenInfo = jwtManager.getTokenInfo(token);
|
||||
search.setSiteId(tokenInfo.getSid());
|
||||
|
||||
if(search.getOldYn() == null || search.getOldYn().equals("")) {
|
||||
search.setOldYn("N");
|
||||
}
|
||||
|
||||
log.info("[REQUEST: "+request.getRequestURI()+"] " + search);
|
||||
|
||||
PageFormVO pageVo= new PageFormVO();
|
||||
if(search.getPage()==0)search.setPage(1);
|
||||
|
||||
int totalCount = betService.getSportEventListCnt(search);
|
||||
if (totalCount != 0) {
|
||||
PageFormVO commonForm = new PageFormVO();
|
||||
commonForm.setFunction_name("goPage");
|
||||
commonForm.setPage(search.getPage());
|
||||
commonForm.setCount_per_page(20);
|
||||
if(search.getCount_per_list()==0) {
|
||||
commonForm.setCount_per_list(10);
|
||||
} else {
|
||||
commonForm.setCount_per_list(search.getCount_per_list());
|
||||
}
|
||||
commonForm.setTatal_list_count(totalCount);
|
||||
pageVo = PagingUtil.setPageUtil(commonForm);
|
||||
search.setLimit(pageVo.getLimit());
|
||||
search.setOffset(pageVo.getOffset());
|
||||
search.setTatal_list_count(totalCount);
|
||||
|
||||
apiResponse.put("pageInfo", pageVo);
|
||||
}
|
||||
|
||||
List<HashMap> betList = betService.getSportEventList(search);
|
||||
|
||||
apiResponse.put("list", betList);
|
||||
apiResponse.success();
|
||||
|
||||
} catch(ApiException e) {
|
||||
log.error(e.toString());
|
||||
apiResponse = e.getApiResponse();
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value="/sportEventDetaillist")
|
||||
public ApiResponse sportEventDetaillist( @RequestHeader String token, HttpServletRequest request, @RequestBody BetSplusSearch search) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
try {
|
||||
//Site site = getSiteByCheck(request);
|
||||
if(token==null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
JwtManager.TokenInfo tokenInfo = jwtManager.getTokenInfo(token);
|
||||
search.setSiteId(tokenInfo.getSid());
|
||||
|
||||
if(search.getOldYn() == null || search.getOldYn().equals("")) {
|
||||
search.setOldYn("N");
|
||||
}
|
||||
|
||||
log.info("[REQUEST: "+request.getRequestURI()+"] " + search);
|
||||
|
||||
PageFormVO pageVo= new PageFormVO();
|
||||
if(search.getPage()==0)search.setPage(1);
|
||||
|
||||
int totalCount = betService.getSportEventDetailListCnt(search);
|
||||
if (totalCount != 0) {
|
||||
PageFormVO commonForm = new PageFormVO();
|
||||
commonForm.setFunction_name("goPage");
|
||||
commonForm.setPage(search.getPage());
|
||||
commonForm.setCount_per_page(20);
|
||||
if(search.getCount_per_list()==0) {
|
||||
commonForm.setCount_per_list(10);
|
||||
} else {
|
||||
commonForm.setCount_per_list(search.getCount_per_list());
|
||||
}
|
||||
commonForm.setTatal_list_count(totalCount);
|
||||
pageVo = PagingUtil.setPageUtil(commonForm);
|
||||
search.setLimit(pageVo.getLimit());
|
||||
search.setOffset(pageVo.getOffset());
|
||||
search.setTatal_list_count(totalCount);
|
||||
|
||||
apiResponse.put("pageInfo", pageVo);
|
||||
}
|
||||
|
||||
List<HashMap> betList = betService.getSportEventDetailList(search);
|
||||
|
||||
apiResponse.put("list", betList);
|
||||
apiResponse.success();
|
||||
|
||||
} catch(ApiException e) {
|
||||
log.error(e.toString());
|
||||
apiResponse = e.getApiResponse();
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value="/betDetail")
|
||||
public ApiResponse betDetail( @RequestHeader String token, HttpServletRequest request, @RequestBody BetSearch search) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
try {
|
||||
//Site site = getSiteByCheck(request);
|
||||
if(token==null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
JwtManager.TokenInfo tokenInfo = jwtManager.getTokenInfo(token);
|
||||
search.setSiteId(tokenInfo.getSid());
|
||||
|
||||
if(search.getOldYn() == null || search.getOldYn().equals("")) {
|
||||
search.setOldYn("N");
|
||||
}
|
||||
|
||||
log.info("[REQUEST: "+request.getRequestURI()+"] " + search);
|
||||
String betType = betService.getBetType(search.getBetId());
|
||||
|
||||
String detail = "";
|
||||
if(betType.equals("triple")) {
|
||||
HashMap<String, String> param = new HashMap<String, String>();
|
||||
param.put("siteId", tokenInfo.getSid());
|
||||
param.put("apiVendorCode", betType);
|
||||
ApiVendorCompInfo vendorCompInfo = userService.getApiVendorCompInfo(param);
|
||||
if(vendorCompInfo != null) {
|
||||
detail = tripleService.getBetDetail(vendorCompInfo, search.getBetId());
|
||||
}
|
||||
log.info("triple bet detail: " + detail);
|
||||
} else {
|
||||
log.info("not found bet detail");
|
||||
}
|
||||
|
||||
apiResponse.put("detail", detail);
|
||||
apiResponse.success();
|
||||
|
||||
} catch (ResourceAccessException rae) {
|
||||
if(rae.getCause() instanceof ConnectTimeoutException) {
|
||||
log.error("[ConnectTimeoutException]"+rae.getMessage());
|
||||
apiResponse.setResultCode("TE99");
|
||||
apiResponse.setResultMessage("ConnectTimeoutException");
|
||||
}
|
||||
|
||||
if(rae.getCause() instanceof SocketTimeoutException) {
|
||||
log.error("[SocketTimeoutException]"+rae.getMessage());
|
||||
apiResponse.setResultCode("TE99");
|
||||
apiResponse.setResultMessage("SocketTimeoutException");
|
||||
}
|
||||
|
||||
if(rae.getCause() instanceof InterruptedException) {
|
||||
log.error("[InterruptedException]"+rae.getMessage());
|
||||
apiResponse.setResultCode("TE99");
|
||||
apiResponse.setResultMessage("InterruptedException");
|
||||
}
|
||||
} catch(ApiException e) {
|
||||
log.error(e.toString());
|
||||
apiResponse = e.getApiResponse();
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value="/betDetailTest")
|
||||
public ApiResponse betDetailTest( @RequestHeader String token, HttpServletRequest request, @RequestBody BetSearch search) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
try {
|
||||
//Site site = getSiteByCheck(request);
|
||||
if(token==null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
JwtManager.TokenInfo tokenInfo = jwtManager.getTokenInfo(token);
|
||||
search.setSiteId(tokenInfo.getSid());
|
||||
|
||||
if(search.getOldYn() == null || search.getOldYn().equals("")) {
|
||||
search.setOldYn("N");
|
||||
}
|
||||
|
||||
log.info("[REQUEST: "+request.getRequestURI()+"] " + search);
|
||||
String betType = betService.getBetType(search.getBetId());
|
||||
|
||||
String detail = "";
|
||||
if(betType.equals("triple")) {
|
||||
HashMap<String, String> param = new HashMap<String, String>();
|
||||
param.put("siteId", tokenInfo.getSid());
|
||||
param.put("apiVendorCode", betType);
|
||||
ApiVendorCompInfo vendorCompInfo = userService.getApiVendorCompInfo(param);
|
||||
if(vendorCompInfo != null) {
|
||||
detail = tripleService.getBetDetailTest(vendorCompInfo, search.getBetId());
|
||||
}
|
||||
log.info("triple bet detail: " + detail);
|
||||
} else {
|
||||
log.info("not found bet detail");
|
||||
}
|
||||
|
||||
apiResponse.put("detail", detail);
|
||||
apiResponse.success();
|
||||
|
||||
} catch (ResourceAccessException rae) {
|
||||
if(rae.getCause() instanceof ConnectTimeoutException) {
|
||||
log.error("[ConnectTimeoutException]"+rae.getMessage());
|
||||
apiResponse.setResultCode("TE99");
|
||||
apiResponse.setResultMessage("ConnectTimeoutException");
|
||||
}
|
||||
|
||||
if(rae.getCause() instanceof SocketTimeoutException) {
|
||||
log.error("[SocketTimeoutException]"+rae.getMessage());
|
||||
apiResponse.setResultCode("TE99");
|
||||
apiResponse.setResultMessage("SocketTimeoutException");
|
||||
}
|
||||
|
||||
if(rae.getCause() instanceof InterruptedException) {
|
||||
log.error("[InterruptedException]"+rae.getMessage());
|
||||
apiResponse.setResultCode("TE99");
|
||||
apiResponse.setResultMessage("InterruptedException");
|
||||
}
|
||||
} catch(ApiException e) {
|
||||
log.error(e.toString());
|
||||
apiResponse = e.getApiResponse();
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value="/trxlist")
|
||||
public ApiResponse trxlist(@RequestHeader String token, HttpServletRequest request, @RequestBody TrxSearchVO searchVO) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
try {
|
||||
//Site site = getSiteByCheck(request);
|
||||
if(token==null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
if(searchVO.getMemId()==null || searchVO.getMemId().equals("")) {
|
||||
if(searchVO.getBetId()==null || searchVO.getBetId().equals("")) {
|
||||
throw new ApiException("TX99", "유저ID 또는 배팅ID를 입력 후 검색하세요.");
|
||||
}
|
||||
}
|
||||
|
||||
JwtManager.TokenInfo tokenInfo = jwtManager.getTokenInfo(token);
|
||||
searchVO.setSiteId(tokenInfo.getSid());
|
||||
|
||||
if(searchVO.getOldYn() == null || searchVO.getOldYn().equals("")) {
|
||||
searchVO.setOldYn("N");
|
||||
}
|
||||
|
||||
log.info("[REQUEST: "+request.getRequestURI()+"] " + searchVO);
|
||||
|
||||
PageFormVO pageVo= new PageFormVO();
|
||||
if(searchVO.getPage()==0) searchVO.setPage(1);
|
||||
|
||||
int totalCount = betService.getTrxListCnt(searchVO);
|
||||
if (totalCount != 0) {
|
||||
PageFormVO commonForm = new PageFormVO();
|
||||
commonForm.setFunction_name("goPage");
|
||||
commonForm.setPage(searchVO.getPage());
|
||||
commonForm.setCount_per_page(20);
|
||||
if(searchVO.getCount_per_list()==0) {
|
||||
commonForm.setCount_per_list(30);
|
||||
} else {
|
||||
commonForm.setCount_per_list(searchVO.getCount_per_list());
|
||||
}
|
||||
commonForm.setTatal_list_count(totalCount);
|
||||
pageVo = PagingUtil.setPageUtil(commonForm);
|
||||
searchVO.setLimit(pageVo.getLimit());
|
||||
searchVO.setOffset(pageVo.getOffset());
|
||||
searchVO.setTatal_list_count(totalCount);
|
||||
|
||||
apiResponse.put("pageInfo", pageVo);
|
||||
}
|
||||
|
||||
List<HashMap<String, Object>> betList = betService.getTrxList(searchVO);
|
||||
|
||||
apiResponse.put("list", betList);
|
||||
apiResponse.success();
|
||||
|
||||
} catch(ApiException e) {
|
||||
log.error(e.toString());
|
||||
apiResponse = e.getApiResponse();
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
|
||||
private Site getSiteByCheck(HttpServletRequest request) {
|
||||
Site site = userService.getSiteInfoByKey(request.getHeader("Authorization").toString());
|
||||
return site;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,919 @@
|
||||
package com.bb.admin.controller;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestHeader;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.bb.exception.ApiException;
|
||||
import com.bb.jwt.JwtManager;
|
||||
import com.bb.model.AnswerVo;
|
||||
import com.bb.model.ApiResponse;
|
||||
import com.bb.model.Board;
|
||||
import com.bb.model.BoardListSearch;
|
||||
import com.bb.model.Code;
|
||||
import com.bb.model.CodeSearch;
|
||||
import com.bb.model.Comment;
|
||||
import com.bb.model.Message;
|
||||
import com.bb.model.MessageListSearch;
|
||||
import com.bb.model.PageFormVO;
|
||||
import com.bb.model.Site;
|
||||
import com.bb.model.SiteOption;
|
||||
import com.bb.model.SiteSearch;
|
||||
import com.bb.service.BoardService;
|
||||
import com.bb.service.CommonService;
|
||||
import com.bb.service.UserService;
|
||||
import com.bb.util.IPKit;
|
||||
import com.bb.util.PagingUtil;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.validation.Valid;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.sf.json.JSONArray;
|
||||
import net.sf.json.JSONObject;
|
||||
|
||||
@RestController
|
||||
@Slf4j
|
||||
@RequestMapping("/api/admin/board")
|
||||
@RequiredArgsConstructor
|
||||
@SecurityRequirement(name = "Authorization")
|
||||
public class AdminApiBoardController {
|
||||
|
||||
private final BoardService boardService;
|
||||
|
||||
private final UserService userService;
|
||||
|
||||
private final CommonService commonService;
|
||||
|
||||
private final JwtManager jwtManager;
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value = { "/{boardType}/list" })
|
||||
public ApiResponse boardList(@RequestHeader String token, HttpServletRequest request,
|
||||
@PathVariable String boardType, @Valid @RequestBody BoardListSearch search) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
|
||||
String LOG_PREFIX = "#-admin::boardList::";
|
||||
|
||||
try {
|
||||
// Site site = getSiteByCheck(request);
|
||||
if (token == null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
final String boardTypeKeyword = "answer|bbs|faq|favor|nt|snt";
|
||||
|
||||
if (boardType.equals("qna")) {
|
||||
boardType = "faq";
|
||||
}
|
||||
|
||||
if (!boardTypeKeyword.contains(boardType)) {
|
||||
log.error("[REQUEST: " + request.getRequestURI() + "] Board[" + boardType + "] boardType Error");
|
||||
throw new ApiException("BRD02", "boardType Error");
|
||||
}
|
||||
search.setBoardType(boardType);
|
||||
|
||||
JwtManager.TokenInfo tokenInfo = jwtManager.getTokenInfo(token);
|
||||
LOG_PREFIX = LOG_PREFIX + tokenInfo.getSid() + ":::";
|
||||
search.setSiteId(tokenInfo.getSid());
|
||||
|
||||
PageFormVO pageVo = new PageFormVO();
|
||||
if (search.getPage() == 0)
|
||||
search.setPage(1);
|
||||
|
||||
log.info(LOG_PREFIX + "[REQUEST: " + request.getRequestURI() + "] " + search);
|
||||
if (boardType.equals("nt")) {
|
||||
Board flowBoard = boardService.getSiteFlowBoard(search);
|
||||
apiResponse.put("flowBoard", flowBoard);
|
||||
}
|
||||
|
||||
int totalCount = boardService.getBoardListCnt(search);
|
||||
if (totalCount != 0) {
|
||||
PageFormVO commonForm = new PageFormVO();
|
||||
commonForm.setFunction_name("goPage");
|
||||
commonForm.setPage(search.getPage());
|
||||
commonForm.setCount_per_page(20);
|
||||
if (search.getCount_per_list() == 0) {
|
||||
commonForm.setCount_per_list(10);
|
||||
} else {
|
||||
commonForm.setCount_per_list(search.getCount_per_list());
|
||||
}
|
||||
commonForm.setTatal_list_count(totalCount);
|
||||
pageVo = PagingUtil.setPageUtil(commonForm);
|
||||
search.setLimit(pageVo.getLimit());
|
||||
search.setOffset(pageVo.getOffset());
|
||||
search.setTatal_list_count(totalCount);
|
||||
|
||||
apiResponse.put("pageInfo", pageVo);
|
||||
}
|
||||
|
||||
List<Board> boardList = boardService.getBoardList(search);
|
||||
apiResponse.put("list", boardList);
|
||||
apiResponse.success();
|
||||
} catch (ApiException e) {
|
||||
log.error(e.toString());
|
||||
apiResponse = e.getApiResponse();
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value = { "/{boardType}/save" })
|
||||
public ApiResponse boardSave(@RequestHeader String token, HttpServletRequest request,
|
||||
@PathVariable String boardType, @Valid @RequestBody Board board) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
|
||||
String LOG_PREFIX = "#-admin::boardSave::";
|
||||
|
||||
try {
|
||||
// Site site = getSiteByCheck(request);
|
||||
if (token == null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
final String boardTypeKeyword = "answer|bbs|faq|favor|nt|snt";
|
||||
|
||||
if (boardType.equals("qna")) {
|
||||
boardType = "faq";
|
||||
}
|
||||
|
||||
if (!boardTypeKeyword.contains(boardType)) {
|
||||
log.error("[REQUEST: " + request.getRequestURI() + "] Board[" + boardType + "] boardType Error");
|
||||
throw new ApiException("BRD02", "boardType Error");
|
||||
}
|
||||
board.setBoardType(boardType);
|
||||
|
||||
JwtManager.TokenInfo tokenInfo = jwtManager.getTokenInfo(token);
|
||||
LOG_PREFIX = LOG_PREFIX + tokenInfo.getSid() + ":::";
|
||||
board.setSiteId(tokenInfo.getSid());
|
||||
board.setRegId(tokenInfo.getMid());
|
||||
|
||||
log.info(LOG_PREFIX + "[REQUEST: " + request.getRequestURI() + "] " + board);
|
||||
if (boardType.equals("snt")) {
|
||||
board.setTitle("");
|
||||
board.setBoardType(boardType);
|
||||
board.setCategory("");
|
||||
board.setIsReadUser("N");
|
||||
|
||||
BoardListSearch search = new BoardListSearch();
|
||||
search.setSiteId(tokenInfo.getSid());
|
||||
Board flowBoard = boardService.getSiteFlowBoard(search);
|
||||
if (flowBoard != null) {
|
||||
Integer flowBoardIdx = flowBoard.getBoardIdx();
|
||||
board.setBoardIdx(flowBoardIdx);
|
||||
}
|
||||
}
|
||||
|
||||
int boardIdx = 0;
|
||||
if (board.getBoardIdx() != null)
|
||||
boardIdx = board.getBoardIdx();
|
||||
int res = boardService.saveBoard(board);
|
||||
if (boardIdx == 0)
|
||||
boardIdx = board.getBoardIdx();
|
||||
|
||||
log.info(LOG_PREFIX + "Board[" + board.getBoardType() + "][" + board.getCategory() + "] Save Result: "
|
||||
+ res);
|
||||
log.info(LOG_PREFIX + "Board[" + board.getBoardType() + "][" + board.getCategory() + "] Save Result idx: "
|
||||
+ boardIdx);
|
||||
if (res > 0) {
|
||||
String boardTypeStr = "";
|
||||
if (boardType.equals("nt")) {
|
||||
boardTypeStr = "공지사항";
|
||||
} else if (boardType.equals("bbs")) {
|
||||
boardTypeStr = "게시판";
|
||||
} else if (boardType.equals("faq")) {
|
||||
boardTypeStr = "문의사항";
|
||||
} else if (boardType.equals("favor")) {
|
||||
boardTypeStr = "자주묻는질문";
|
||||
} else if (boardType.equals("answer")) {
|
||||
boardTypeStr = "faqAnswer";
|
||||
} else if (boardType.equals("snt")) {
|
||||
boardTypeStr = "흐르는 공지";
|
||||
} else {
|
||||
boardTypeStr = boardType;
|
||||
}
|
||||
|
||||
String crudType = "";
|
||||
if (res == 1)
|
||||
crudType = "등록 처리";
|
||||
if (res > 1)
|
||||
crudType = "수정 처리";
|
||||
if (board.getDelYn() != null && board.getDelYn().equals("Y"))
|
||||
crudType = "삭제 처리";
|
||||
|
||||
try {
|
||||
HashMap<String, String> logParam = new HashMap<String, String>();
|
||||
logParam.put("siteId", tokenInfo.getSid());
|
||||
logParam.put("memId", tokenInfo.getMid());
|
||||
logParam.put("logType", "CREATE");
|
||||
logParam.put("logoutYn", "");
|
||||
logParam.put("logEndPoint", request.getRequestURI());
|
||||
logParam.put("logName", boardIdx + "::" + boardTypeStr + "::관리자::" + crudType);
|
||||
logParam.put("logDesc", board.toString());
|
||||
logParam.put("regId", tokenInfo.getMid());
|
||||
logParam.put("regIp", IPKit.getIpAddressByRequest(request));
|
||||
logParam.put("token", "");
|
||||
commonService.insertAdminlog(logParam);
|
||||
} catch (Exception e) {
|
||||
System.out.print(e.toString());
|
||||
}
|
||||
}
|
||||
|
||||
apiResponse.success();
|
||||
|
||||
} catch (ApiException e) {
|
||||
log.error(e.toString());
|
||||
apiResponse = e.getApiResponse();
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value = { "/{boardType}/deletes" })
|
||||
public ApiResponse boardDeletes(@RequestHeader String token, HttpServletRequest request,
|
||||
@PathVariable String boardType, @RequestBody JSONObject requestBody) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
|
||||
String LOG_PREFIX = "#-admin::boardDeletes::";
|
||||
|
||||
try {
|
||||
// Site site = getSiteByCheck(request);
|
||||
if (token == null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
final String boardTypeKeyword = "answer|bbs|faq|favor|nt|snt";
|
||||
|
||||
if (boardType.equals("qna")) {
|
||||
boardType = "faq";
|
||||
}
|
||||
|
||||
if (!boardTypeKeyword.contains(boardType)) {
|
||||
log.error("Board[" + boardType + "] boardType Error");
|
||||
throw new ApiException("BRD02", "boardType Error");
|
||||
}
|
||||
|
||||
JwtManager.TokenInfo tokenInfo = jwtManager.getTokenInfo(token);
|
||||
LOG_PREFIX = LOG_PREFIX + tokenInfo.getSid() + ":::";
|
||||
log.info(LOG_PREFIX + "[REQUEST] " + requestBody);
|
||||
|
||||
JSONArray boardIdxList = requestBody.getJSONArray("boardIdxList");
|
||||
if (boardIdxList == null || boardIdxList.size() == 0) {
|
||||
log.error("boardIdxList Error");
|
||||
throw new ApiException("BRD03", "boardIdxList Error");
|
||||
}
|
||||
|
||||
for (int i = 0; i < boardIdxList.size(); i++) {
|
||||
int boardIdx = boardIdxList.getInt(i);
|
||||
int res = boardService.deleteYBoard(boardIdx);
|
||||
}
|
||||
|
||||
String boardTypeStr = "";
|
||||
if (boardType.equals("nt")) {
|
||||
boardTypeStr = "공지사항";
|
||||
} else if (boardType.equals("bbs")) {
|
||||
boardTypeStr = "게시판";
|
||||
} else if (boardType.equals("faq")) {
|
||||
boardTypeStr = "문의사항";
|
||||
} else if (boardType.equals("favor")) {
|
||||
boardTypeStr = "자주묻는질문";
|
||||
} else if (boardType.equals("answer")) {
|
||||
boardTypeStr = "faqAnswer";
|
||||
} else if (boardType.equals("snt")) {
|
||||
boardTypeStr = "흐르는 공지";
|
||||
} else {
|
||||
boardTypeStr = boardType;
|
||||
}
|
||||
|
||||
String crudType = "일괄삭제 처리";
|
||||
|
||||
try {
|
||||
HashMap<String, String> logParam = new HashMap<String, String>();
|
||||
logParam.put("siteId", tokenInfo.getSid());
|
||||
logParam.put("memId", tokenInfo.getMid());
|
||||
logParam.put("logType", "CREATE");
|
||||
logParam.put("logoutYn", "");
|
||||
logParam.put("logEndPoint", request.getRequestURI());
|
||||
logParam.put("logName", boardTypeStr + "::관리자::" + crudType);
|
||||
logParam.put("logDesc", boardIdxList.toString());
|
||||
logParam.put("regId", tokenInfo.getMid());
|
||||
logParam.put("regIp", IPKit.getIpAddressByRequest(request));
|
||||
logParam.put("token", "");
|
||||
commonService.insertAdminlog(logParam);
|
||||
} catch (Exception e) {
|
||||
System.out.print(e.toString());
|
||||
}
|
||||
|
||||
apiResponse.success();
|
||||
|
||||
} catch (ApiException e) {
|
||||
log.error(e.toString());
|
||||
apiResponse = e.getApiResponse();
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value = { "/noticeTopChange" })
|
||||
public ApiResponse noticeTopChange(@RequestHeader String token, HttpServletRequest request,
|
||||
@RequestBody Board board) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
try {
|
||||
// Site site = getSiteByCheck(request);
|
||||
if (token == null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
JwtManager.TokenInfo tokenInfo = jwtManager.getTokenInfo(token);
|
||||
board.setSiteId(tokenInfo.getSid());
|
||||
board.setRegId(tokenInfo.getSid());
|
||||
|
||||
log.info("[REQUEST: " + request.getRequestURI() + "] boardIdx: " + board.getBoardIdx());
|
||||
Board boardDetail = boardService.getBoard(board);
|
||||
int boardIdx = boardDetail.getBoardIdx();
|
||||
int result = boardService.deleteBoard(boardIdx);
|
||||
if (result > 0) {
|
||||
boardDetail.setBoardIdx(null);
|
||||
log.info("[REQUEST: " + request.getRequestURI() + "] Top Change Board Info: " + boardDetail.toString());
|
||||
int res = boardService.saveBoard(boardDetail);
|
||||
log.info("[REQUEST: " + request.getRequestURI() + "] Top Change Board Result: " + res);
|
||||
log.info("[REQUEST: " + request.getRequestURI() + "] Top Change Board Result idx: "
|
||||
+ board.getBoardIdx());
|
||||
if (res > 0) {
|
||||
String boardType = boardDetail.getBoardType();
|
||||
String boardTypeStr = "";
|
||||
if (boardType.equals("nt")) {
|
||||
boardTypeStr = "공지사항";
|
||||
} else if (boardType.equals("bbs")) {
|
||||
boardTypeStr = "게시판";
|
||||
} else if (boardType.equals("faq")) {
|
||||
boardTypeStr = "문의사항";
|
||||
} else if (boardType.equals("favor")) {
|
||||
boardTypeStr = "자주묻는질문";
|
||||
} else if (boardType.equals("answer")) {
|
||||
boardTypeStr = "faqAnswer";
|
||||
} else if (boardType.equals("snt")) {
|
||||
boardTypeStr = "흐르는 공지";
|
||||
} else {
|
||||
boardTypeStr = boardType;
|
||||
}
|
||||
|
||||
try {
|
||||
HashMap<String, String> logParam = new HashMap<String, String>();
|
||||
logParam.put("siteId", tokenInfo.getSid());
|
||||
logParam.put("memId", tokenInfo.getMid());
|
||||
logParam.put("logType", "CREATE");
|
||||
logParam.put("logoutYn", "");
|
||||
logParam.put("logEndPoint", request.getRequestURI());
|
||||
logParam.put("logName", board.getBoardIdx() + "::" + boardTypeStr + "::최상위로 변경처리");
|
||||
logParam.put("logDesc", board.toString());
|
||||
logParam.put("regId", tokenInfo.getMid());
|
||||
logParam.put("regIp", IPKit.getIpAddressByRequest(request));
|
||||
logParam.put("token", "");
|
||||
commonService.insertAdminlog(logParam);
|
||||
} catch (Exception e) {
|
||||
System.out.print(e.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
apiResponse.success();
|
||||
|
||||
} catch (ApiException e) {
|
||||
log.error(e.toString());
|
||||
apiResponse = e.getApiResponse();
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value = { "/viewYn" })
|
||||
public ApiResponse viewYn(@RequestHeader String token, HttpServletRequest request, @RequestBody Board board)
|
||||
throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
try {
|
||||
// Site site = getSiteByCheck(request);
|
||||
if (token == null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
JwtManager.TokenInfo tokenInfo = jwtManager.getTokenInfo(token);
|
||||
board.setSiteId(tokenInfo.getSid());
|
||||
board.setRegId(tokenInfo.getSid());
|
||||
|
||||
if (board.getBoardIdx() == null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
if (board.getViewYn() == null && board.getViewYn().equals("")) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
log.info("[REQUEST: " + request.getRequestURI() + "] boardIdx: " + board.getBoardIdx() + ", viewYn: "
|
||||
+ board.getViewYn());
|
||||
int result = boardService.setBoardViewYn(board);
|
||||
log.info("[REQUEST: " + request.getRequestURI() + "] setBoardViewYn() result: " + result);
|
||||
|
||||
apiResponse.success();
|
||||
|
||||
} catch (ApiException e) {
|
||||
log.error(e.toString());
|
||||
apiResponse = e.getApiResponse();
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value = { "/cmtSsave" })
|
||||
public ApiResponse cmtsave(@RequestHeader String token, HttpServletRequest request,
|
||||
@Valid @RequestBody Comment comment) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
try {
|
||||
// Site site = getSiteByCheck(request);
|
||||
if (token == null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
JwtManager.TokenInfo tokenInfo = jwtManager.getTokenInfo(token);
|
||||
comment.setRegId(tokenInfo.getSid());
|
||||
final String LOG_PREFIX = "#-admin::cmtSsave::"+tokenInfo.getSid()+"::"+tokenInfo.getMid()+"::::";
|
||||
|
||||
ObjectMapper objectMapper = new ObjectMapper();
|
||||
String reqJson = objectMapper.writeValueAsString(comment);
|
||||
log.info(LOG_PREFIX+ "Request Comment::" + reqJson);
|
||||
|
||||
int res = boardService.saveCmt(comment);
|
||||
|
||||
SiteSearch siteSearch = new SiteSearch();
|
||||
siteSearch.setSiteId(tokenInfo.getSid());
|
||||
SiteOption siteOption = commonService.getSiteSetting(siteSearch);
|
||||
String alarmQnaYn = siteOption.getAlarmQnaYn();
|
||||
|
||||
if("Y".equals(alarmQnaYn)) {
|
||||
log.info(LOG_PREFIX+ "Send to message!!");
|
||||
// 답변달고 쪽지 알림 보내기
|
||||
int boardIdx = comment.getBoardIdx();
|
||||
Board param = new Board();
|
||||
param.setBoardIdx(boardIdx);
|
||||
Board boardDetail = boardService.getBoard(param);
|
||||
String memId = boardDetail.getRegId();
|
||||
String memNick = boardDetail.getMemNick();
|
||||
String msgTitle = "\""+memNick+"\"님 1:1 문의 답변 알림입니다.";
|
||||
|
||||
StringBuilder msgDesc = new StringBuilder();
|
||||
msgDesc.append("\""+memNick+"\"의 문의에 답변이 완료되었습니다.\r\n");
|
||||
msgDesc.append("[문의 제목] \""+boardDetail.getTitle()+"\" \r\n");
|
||||
msgDesc.append("문의 내역에서 답변을 확인해주세요.");
|
||||
|
||||
Message message = new Message();
|
||||
message.setSiteId(tokenInfo.getSid());
|
||||
message.setRegId(tokenInfo.getMid());
|
||||
message.setMsgType("msg");
|
||||
message.setRecieveId(memId);
|
||||
message.setMsgTitle(msgTitle);
|
||||
message.setMsgDesc(msgDesc.toString());
|
||||
message.setHiddenYn("N");
|
||||
message.setTargetType("member");
|
||||
log.info(LOG_PREFIX+ "Create Message : " + message.toString());
|
||||
boardService.msgSend(message);
|
||||
}
|
||||
|
||||
apiResponse.success();
|
||||
|
||||
} catch (ApiException e) {
|
||||
log.error(e.toString());
|
||||
apiResponse = e.getApiResponse();
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value = { "/{boardType}/datail" })
|
||||
public ApiResponse datail(@RequestHeader String token, HttpServletRequest request, @PathVariable String boardType,
|
||||
@Valid @RequestBody Board board) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
|
||||
String LOG_PREFIX = "#-admin::boardDatail::";
|
||||
|
||||
try {
|
||||
// Site site = getSiteByCheck(request);
|
||||
if (token == null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
final String boardTypeKeyword = "answer|bbs|faq|favor|nt|snt";
|
||||
|
||||
if (boardType.equals("qna")) {
|
||||
boardType = "faq";
|
||||
}
|
||||
|
||||
if (!boardTypeKeyword.contains(boardType)) {
|
||||
log.error("[REQUEST: " + request.getRequestURI() + "] Board[" + boardType + "] boardType Error");
|
||||
throw new ApiException("BRD02", "boardType Error");
|
||||
}
|
||||
board.setBoardType(boardType);
|
||||
|
||||
JwtManager.TokenInfo tokenInfo = jwtManager.getTokenInfo(token);
|
||||
LOG_PREFIX = LOG_PREFIX + tokenInfo.getSid() + ":::";
|
||||
board.setSiteId(tokenInfo.getSid());
|
||||
|
||||
log.info(LOG_PREFIX + "[REQUEST: " + request.getRequestURI() + "] " + board);
|
||||
|
||||
Board boardDetail = boardService.getBoard(board);
|
||||
if ("faq".equals(boardDetail.getBoardType())) {
|
||||
boardService.adminRead(boardDetail);
|
||||
}
|
||||
apiResponse.put("board", boardDetail);
|
||||
apiResponse.success();
|
||||
|
||||
} catch (ApiException e) {
|
||||
log.error(e.toString());
|
||||
apiResponse = e.getApiResponse();
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value = { "/category" })
|
||||
public ApiResponse category(@RequestHeader String token, HttpServletRequest request,
|
||||
@Valid @RequestBody CodeSearch search) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
try {
|
||||
// Site site = getSiteByCheck(request);
|
||||
if (token == null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
JwtManager.TokenInfo tokenInfo = jwtManager.getTokenInfo(token);
|
||||
search.setMasterCode("category");
|
||||
search.setGroupCode("ctgy");
|
||||
// search.
|
||||
|
||||
log.info("[REQUEST: " + request.getRequestURI() + "] " + search);
|
||||
|
||||
List<HashMap> codeList = commonService.getCodeList(search);
|
||||
apiResponse.put("codes", codeList);
|
||||
apiResponse.success();
|
||||
|
||||
} catch (ApiException e) {
|
||||
log.error(e.toString());
|
||||
apiResponse = e.getApiResponse();
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value = { "/categorySave" })
|
||||
public ApiResponse categorySave(@RequestHeader String token, HttpServletRequest request,
|
||||
@Valid @RequestBody Code code) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
try {
|
||||
// Site site = getSiteByCheck(request);
|
||||
if (token == null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
JwtManager.TokenInfo tokenInfo = jwtManager.getTokenInfo(token);
|
||||
code.setMasterCode("category");
|
||||
code.setGroupCode("ctgy");
|
||||
|
||||
log.info("[REQUEST: " + request.getRequestURI() + "] " + code);
|
||||
|
||||
commonService.insertCode(code);
|
||||
apiResponse.success();
|
||||
|
||||
} catch (ApiException e) {
|
||||
log.error(e.toString());
|
||||
apiResponse = e.getApiResponse();
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value = { "/msgSend", "/msgUpdate", "/msgHeadSave", "/msgJoinSave" })
|
||||
public ApiResponse msgSend(@RequestHeader String token, HttpServletRequest request,
|
||||
@Valid @RequestBody Message message) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
try {
|
||||
// Site site = getSiteByCheck(request);
|
||||
if (token == null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
JwtManager.TokenInfo tokenInfo = jwtManager.getTokenInfo(token);
|
||||
message.setSiteId(tokenInfo.getSid());
|
||||
message.setRegId(tokenInfo.getSid());
|
||||
if (request.getRequestURI().indexOf("msgHeadSave") > -1) {
|
||||
message.setMsgType("head");
|
||||
} else if (request.getRequestURI().indexOf("msgJoinSave") > -1) {
|
||||
message.setMsgType("join");
|
||||
} else {
|
||||
message.setMsgType("msg");
|
||||
}
|
||||
|
||||
log.info("[REQUEST: " + request.getRequestURI() + "] " + message);
|
||||
if (message.getMsgType().equals("msg") && message.getTargetLevel() != null
|
||||
&& !message.getTargetLevel().equals("")) {
|
||||
// 회원 레벨 별 쪽지전송
|
||||
boardService.levelMsgSend(message);
|
||||
} else {
|
||||
// 기본 쪽지전송
|
||||
boardService.msgSend(message);
|
||||
}
|
||||
|
||||
apiResponse.success();
|
||||
|
||||
} catch (ApiException e) {
|
||||
log.error(e.toString());
|
||||
apiResponse = e.getApiResponse();
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value = { "/msgList", "/msgHeadList", "/msgJoinList" })
|
||||
public ApiResponse msgList(@RequestHeader String token, HttpServletRequest request,
|
||||
@Valid @RequestBody MessageListSearch search) throws Exception {
|
||||
log.info("###-KHO-### msgList() \"/msgList\", \"/msgHeadList\", \"/msgJoinList\" call..");
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
try {
|
||||
// Site site = getSiteByCheck(request);
|
||||
if (token == null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
JwtManager.TokenInfo tokenInfo = jwtManager.getTokenInfo(token);
|
||||
|
||||
PageFormVO pageVo = new PageFormVO();
|
||||
if (search.getPage() == 0)
|
||||
search.setPage(1);
|
||||
search.setSiteId(tokenInfo.getSid());
|
||||
|
||||
log.info("###-KHO-### msgList() request: " + request.getRequestURI());
|
||||
if (request.getRequestURI().indexOf("msgHeadList") > -1) {
|
||||
log.info("###-KHO-### /msgHeadList call..");
|
||||
search.setMsgType("head");
|
||||
} else if (request.getRequestURI().indexOf("msgJoinList") > -1) {
|
||||
log.info("###-KHO-### /msgJoinList call..");
|
||||
search.setMsgType("join");
|
||||
} else {
|
||||
log.info("###-KHO-### /msgList call..");
|
||||
search.setMsgType("msg");
|
||||
}
|
||||
|
||||
log.info("[REQUEST: " + request.getRequestURI() + "] " + search);
|
||||
|
||||
int totalCount = boardService.getMsgListCnt(search);
|
||||
if (totalCount != 0) {
|
||||
PageFormVO commonForm = new PageFormVO();
|
||||
commonForm.setFunction_name("goPage");
|
||||
commonForm.setPage(search.getPage());
|
||||
commonForm.setCount_per_page(20);
|
||||
if (search.getCount_per_list() == 0) {
|
||||
commonForm.setCount_per_list(10);
|
||||
} else {
|
||||
commonForm.setCount_per_list(search.getCount_per_list());
|
||||
}
|
||||
commonForm.setTatal_list_count(totalCount);
|
||||
pageVo = PagingUtil.setPageUtil(commonForm);
|
||||
search.setLimit(pageVo.getLimit());
|
||||
search.setOffset(pageVo.getOffset());
|
||||
search.setTatal_list_count(totalCount);
|
||||
|
||||
apiResponse.put("pageInfo", pageVo);
|
||||
}
|
||||
|
||||
List<Message> msgList = boardService.getMsgList(search);
|
||||
// log.info("###-KHO-### msgList: " + msgList);
|
||||
apiResponse.put("list", msgList);
|
||||
apiResponse.success();
|
||||
|
||||
} catch (ApiException e) {
|
||||
log.error(e.toString());
|
||||
apiResponse = e.getApiResponse();
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value = { "/partnerMsgSend" })
|
||||
public ApiResponse partnerMsgSend(@RequestHeader String token, HttpServletRequest request,
|
||||
@Valid @RequestBody Message message) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
try {
|
||||
// Site site = getSiteByCheck(request);
|
||||
if (token == null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
if (message.getRecieveId() == null || message.getRecieveId().equals("")) {
|
||||
throw new ApiException("M001", "파트너 아이디를 입력하세요.");
|
||||
}
|
||||
if (message.getMsgTitle() == null || message.getMsgTitle().equals("")) {
|
||||
throw new ApiException("M002", "쪽지 제목을 입력하세요.");
|
||||
}
|
||||
if (message.getMsgDesc() == null || message.getMsgDesc().equals("")) {
|
||||
throw new ApiException("M003", "쪽지 내용을 입력하세요.");
|
||||
}
|
||||
|
||||
if (message.getHiddenYn() == null || message.getHiddenYn().equals("")) {
|
||||
message.setHiddenYn("N");
|
||||
}
|
||||
|
||||
JwtManager.TokenInfo tokenInfo = jwtManager.getTokenInfo(token);
|
||||
message.setSiteId(tokenInfo.getSid());
|
||||
message.setRegId(tokenInfo.getSid());
|
||||
|
||||
log.info("[REQUEST: " + request.getRequestURI() + "] " + message);
|
||||
boardService.partnerMsgSend(message);
|
||||
apiResponse.success();
|
||||
|
||||
} catch (ApiException e) {
|
||||
log.error(e.toString());
|
||||
apiResponse = e.getApiResponse();
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value = { "/answer/list" })
|
||||
public ApiResponse answerList(@RequestHeader String token, HttpServletRequest request, @RequestBody AnswerVo search)
|
||||
throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
try {
|
||||
if (token == null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
JwtManager.TokenInfo tokenInfo = jwtManager.getTokenInfo(token);
|
||||
search.setSiteId(tokenInfo.getSid());
|
||||
|
||||
log.info("[REQUEST: " + request.getRequestURI() + "] " + search);
|
||||
|
||||
List<AnswerVo> answerList = boardService.getAnswerList(search);
|
||||
apiResponse.put("list", answerList);
|
||||
|
||||
apiResponse.success();
|
||||
} catch (ApiException e) {
|
||||
log.error(e.toString());
|
||||
apiResponse = e.getApiResponse();
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value = { "/answer/save" })
|
||||
public ApiResponse answerSave(@RequestHeader String token, HttpServletRequest request, @RequestBody AnswerVo answer)
|
||||
throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
try {
|
||||
if (token == null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
JwtManager.TokenInfo tokenInfo = jwtManager.getTokenInfo(token);
|
||||
answer.setSiteId(tokenInfo.getSid());
|
||||
|
||||
log.info("[REQUEST: " + request.getRequestURI() + "] " + answer);
|
||||
int res;
|
||||
|
||||
if (answer.getIdx() != null) {
|
||||
res = boardService.updateAnswer(answer);
|
||||
} else {
|
||||
res = boardService.saveAnswer(answer);
|
||||
}
|
||||
|
||||
if (res > 0) {
|
||||
apiResponse.success();
|
||||
} else {
|
||||
throw new ApiException("A999", "처리중 문제가 발생했습니다. 관리자에게 문의하세요.");
|
||||
}
|
||||
} catch (ApiException e) {
|
||||
log.error(e.toString());
|
||||
apiResponse = e.getApiResponse();
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value = { "/answer/delete" })
|
||||
public ApiResponse answerDelete(@RequestHeader String token, HttpServletRequest request,
|
||||
@RequestBody AnswerVo answer) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
try {
|
||||
if (token == null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
JwtManager.TokenInfo tokenInfo = jwtManager.getTokenInfo(token);
|
||||
answer.setSiteId(tokenInfo.getSid());
|
||||
|
||||
if (answer.getIdx() == null) {
|
||||
throw new ApiException("A009", "삭제할 답변을 선택하세요.");
|
||||
}
|
||||
|
||||
log.info("[REQUEST: " + request.getRequestURI() + "] " + answer);
|
||||
|
||||
int res = boardService.deleteAnswer(answer);
|
||||
if (res > 0) {
|
||||
apiResponse.success();
|
||||
} else {
|
||||
throw new ApiException("A999", "처리중 문제가 발생했습니다. 관리자에게 문의하세요.");
|
||||
}
|
||||
} catch (ApiException e) {
|
||||
log.error(e.toString());
|
||||
apiResponse = e.getApiResponse();
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
private Site getSiteByCheck(HttpServletRequest request) {
|
||||
Site site = userService.getSiteInfoByKey(request.getHeader("Authorization").toString());
|
||||
return site;
|
||||
}
|
||||
|
||||
}
|
||||
1158
src/main/java/com/bb/admin/controller/AdminApiCashController.java
Normal file
1158
src/main/java/com/bb/admin/controller/AdminApiCashController.java
Normal file
File diff suppressed because it is too large
Load Diff
1384
src/main/java/com/bb/admin/controller/AdminApiController.java
Normal file
1384
src/main/java/com/bb/admin/controller/AdminApiController.java
Normal file
File diff suppressed because it is too large
Load Diff
2854
src/main/java/com/bb/admin/controller/AdminApiMemberController.java
Normal file
2854
src/main/java/com/bb/admin/controller/AdminApiMemberController.java
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,232 @@
|
||||
package com.bb.admin.controller;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
import java.text.NumberFormat;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestHeader;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.bb.exception.ApiException;
|
||||
import com.bb.jwt.JwtManager;
|
||||
import com.bb.model.ApiResponse;
|
||||
import com.bb.model.BetSearch;
|
||||
import com.bb.model.MiniGameSearch;
|
||||
import com.bb.model.MinigameBetRate;
|
||||
import com.bb.model.MinigameSet;
|
||||
import com.bb.model.PageFormVO;
|
||||
import com.bb.model.Site;
|
||||
import com.bb.service.BetService;
|
||||
import com.bb.service.MinigameService;
|
||||
import com.bb.service.UserService;
|
||||
import com.bb.util.PagingUtil;
|
||||
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
|
||||
@RestController
|
||||
@Slf4j
|
||||
@RequestMapping("/api/admin/minigame")
|
||||
@RequiredArgsConstructor
|
||||
@SecurityRequirement(name = "Authorization")
|
||||
public class AdminApiMiniGameController {
|
||||
|
||||
private final UserService userService;
|
||||
|
||||
private final MinigameService minigameService;
|
||||
|
||||
private final BetService betService;
|
||||
|
||||
private final JwtManager jwtManager;
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
private static NumberFormat formatter = new DecimalFormat("#0.00");
|
||||
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value={"/setSave"})
|
||||
public ApiResponse setSave(@RequestHeader String token, HttpServletRequest request, @Valid @RequestBody MinigameSet mgs) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
try {
|
||||
//Site site = getSiteByCheck(request);
|
||||
if(token==null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
JwtManager.TokenInfo tokenInfo = jwtManager.getTokenInfo(token);
|
||||
mgs.setSiteId(tokenInfo.getSid());
|
||||
minigameService.setSave(mgs);
|
||||
|
||||
apiResponse.success();
|
||||
|
||||
} catch(ApiException e) {
|
||||
log.error(e.toString());
|
||||
apiResponse = e.getApiResponse();
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value={"/betRateSave"})
|
||||
public ApiResponse betRateSave(@RequestHeader String token, HttpServletRequest request, @Valid @RequestBody MinigameBetRate mbr) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
try {
|
||||
//Site site = getSiteByCheck(request);
|
||||
if(token==null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
JwtManager.TokenInfo tokenInfo = jwtManager.getTokenInfo(token);
|
||||
mbr.setSiteId(tokenInfo.getSid());
|
||||
mbr.setUpdId(tokenInfo.getMid());
|
||||
minigameService.betRateSave(mbr);
|
||||
|
||||
apiResponse.success();
|
||||
} catch(ApiException e) {
|
||||
log.error(e.toString());
|
||||
apiResponse = e.getApiResponse();
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value="/setList")
|
||||
public ApiResponse setList( @RequestHeader String token, HttpServletRequest request, @RequestBody MiniGameSearch search ) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
try {
|
||||
//Site site = getSiteByCheck(request);
|
||||
if(token==null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
JwtManager.TokenInfo tokenInfo = jwtManager.getTokenInfo(token);
|
||||
search.setSiteId(tokenInfo.getSid());
|
||||
|
||||
List<HashMap> setList = minigameService.getSetList(search);
|
||||
|
||||
apiResponse.put("list", setList);
|
||||
apiResponse.success();
|
||||
|
||||
} catch(ApiException e) {
|
||||
log.error(e.toString());
|
||||
apiResponse = e.getApiResponse();
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value="/betRateList")
|
||||
public ApiResponse betRateList( @RequestHeader String token, HttpServletRequest request, @RequestBody MiniGameSearch search ) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
try {
|
||||
//Site site = getSiteByCheck(request);
|
||||
if(token==null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
JwtManager.TokenInfo tokenInfo = jwtManager.getTokenInfo(token);
|
||||
search.setSiteId(tokenInfo.getSid());
|
||||
|
||||
List<HashMap> betRateList = minigameService.getBetRateList(search);
|
||||
apiResponse.put("list", betRateList);
|
||||
apiResponse.success();
|
||||
|
||||
} catch(ApiException e) {
|
||||
log.error(e.toString());
|
||||
apiResponse = e.getApiResponse();
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value={"/powerballResult"})
|
||||
public ApiResponse minigameResult(@RequestHeader String token, HttpServletRequest request, @Valid @RequestBody BetSearch search ) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
try {
|
||||
//Site site = getSiteByCheck(request);
|
||||
if(token==null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
JwtManager.TokenInfo tokenInfo = jwtManager.getTokenInfo(token);
|
||||
|
||||
PageFormVO pageVo= new PageFormVO();
|
||||
if(search.getPage()==0)search.setPage(1);
|
||||
|
||||
search.setSiteId(tokenInfo.getSid());
|
||||
int totalCount = betService.getPowerballResultListCnt(search);
|
||||
if (totalCount != 0) {
|
||||
PageFormVO commonForm = new PageFormVO();
|
||||
commonForm.setFunction_name("goPage");
|
||||
commonForm.setPage(search.getPage());
|
||||
commonForm.setCount_per_page(20);
|
||||
if(search.getCount_per_list()==0) {
|
||||
commonForm.setCount_per_list(10);
|
||||
} else {
|
||||
commonForm.setCount_per_list(search.getCount_per_list());
|
||||
}
|
||||
commonForm.setTatal_list_count(totalCount);
|
||||
pageVo = PagingUtil.setPageUtil(commonForm);
|
||||
search.setLimit(pageVo.getLimit());
|
||||
search.setOffset(pageVo.getOffset());
|
||||
search.setTatal_list_count(totalCount);
|
||||
apiResponse.put("pageInfo", pageVo);
|
||||
}
|
||||
|
||||
System.out.println(search.getLimit());
|
||||
System.out.println(search.getOffset());
|
||||
|
||||
List<HashMap> list = betService.getPowerballResultList(search);
|
||||
apiResponse.put("list", list);
|
||||
apiResponse.success();
|
||||
|
||||
} catch(ApiException e) {
|
||||
log.error(e.toString());
|
||||
apiResponse = e.getApiResponse();
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
|
||||
private Site getSiteByCheck(HttpServletRequest request) {
|
||||
Site site = userService.getSiteInfoByKey(request.getHeader("Authorization").toString());
|
||||
return site;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,855 @@
|
||||
package com.bb.admin.controller;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.security.crypto.password.PasswordEncoder;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestHeader;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.bb.exception.ApiException;
|
||||
import com.bb.jwt.JwtManager;
|
||||
import com.bb.model.ApiResponse;
|
||||
import com.bb.model.CompDetail;
|
||||
import com.bb.model.CompSearch;
|
||||
import com.bb.model.Member;
|
||||
import com.bb.model.MemberInsert;
|
||||
import com.bb.model.MemberListSearch;
|
||||
import com.bb.model.MemberRate;
|
||||
import com.bb.model.MemberSearch;
|
||||
import com.bb.model.MemberStatus;
|
||||
import com.bb.model.PageFormVO;
|
||||
import com.bb.model.PartnerCompInfo;
|
||||
import com.bb.model.Site;
|
||||
import com.bb.model.SiteSearch;
|
||||
import com.bb.model.TreeListSearch;
|
||||
import com.bb.service.CommonService;
|
||||
import com.bb.service.CompService;
|
||||
import com.bb.service.UserService;
|
||||
import com.bb.util.IPKit;
|
||||
import com.bb.util.PagingUtil;
|
||||
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.validation.Valid;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@RestController
|
||||
@Slf4j
|
||||
@RequestMapping("/api/admin/partner")
|
||||
@RequiredArgsConstructor
|
||||
@SecurityRequirement(name = "Authorization")
|
||||
public class AdminApiPartnerController {
|
||||
|
||||
private final UserService userService;
|
||||
|
||||
private final CompService compService;
|
||||
|
||||
private final CommonService commonService;
|
||||
|
||||
private final PasswordEncoder passwordEncoder;
|
||||
|
||||
private final JwtManager jwtManager;
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value="/signup")
|
||||
public ApiResponse signup(@RequestHeader String token, HttpServletRequest request, @Valid @RequestBody MemberInsert signupMember) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
try {
|
||||
//Site site = getSiteByCheck(request);
|
||||
if(token==null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
JwtManager.TokenInfo tokenInfo = jwtManager.getTokenInfo(token);
|
||||
if(tokenInfo.getType()==null || tokenInfo.getType().equals("")) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
String createSiteId = signupMember.getMemId().replaceAll(" ", "").replaceAll(" ", "").toLowerCase();
|
||||
final String LOG_PREFIX = "#-admin::addCompany::"+createSiteId+"::::";
|
||||
|
||||
if(createSiteId.equals("")) {
|
||||
throw new ApiException("U005", "idCheckByAdmin");
|
||||
}
|
||||
|
||||
String myType = tokenInfo.getType();
|
||||
String targetType = signupMember.getPartnerType();
|
||||
|
||||
if(myType.equals("agency")) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
if(myType.equals(targetType)) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
if(myType.equals("master") && targetType.equals("senior")) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
signupMember.setMemId(createSiteId);
|
||||
signupMember.setSiteId(createSiteId);
|
||||
signupMember.setAdminId(createSiteId);
|
||||
signupMember.setRegId(tokenInfo.getMid());
|
||||
// System.out.print(tokenInfo.getSid());
|
||||
// System.out.print(signupMember.getMemId());
|
||||
signupMember.setMemLevel("99");
|
||||
signupMember.setPartnerLevel("COMP");
|
||||
signupMember.setMemStatus("1");
|
||||
signupMember.setRecommenderId(tokenInfo.getSid());
|
||||
|
||||
Member checkMember = new Member();
|
||||
checkMember.setSiteId(createSiteId);
|
||||
checkMember.setMemId(createSiteId);
|
||||
checkMember.setRecommenderId(signupMember.getRecommenderId());
|
||||
/*
|
||||
int idCheck =userService.idCheck(checkMember);
|
||||
if(idCheck>0) {
|
||||
throw new ApiException("U005", "idCheck");
|
||||
}
|
||||
*/
|
||||
int idCheckByAdmin =userService.idCheckByAdmin(checkMember);
|
||||
if(idCheckByAdmin>0) {
|
||||
throw new ApiException("U005", "idCheckByAdmin");
|
||||
}
|
||||
|
||||
int nameCheck =userService.nameCheck(checkMember);
|
||||
if(nameCheck>0) {
|
||||
throw new ApiException("U006", "nameCheck");
|
||||
}
|
||||
|
||||
log.info("[REQUEST: "+request.getRequestURI()+"] " + signupMember);
|
||||
|
||||
int result = userService.adminSignUp(LOG_PREFIX, signupMember, passwordEncoder);
|
||||
if(result == 0) {
|
||||
throw new ApiException("SP99", "site prefix check");
|
||||
}
|
||||
|
||||
Member search = new Member();
|
||||
search.setMemId(signupMember.getMemId());
|
||||
search.setSiteId(tokenInfo.getSid());
|
||||
search.setPartnerLevel("COMP");
|
||||
|
||||
if(signupMember.getRateList() != null) {
|
||||
MemberRate rateparam = new MemberRate();
|
||||
rateparam.setMemId(signupMember.getMemId());
|
||||
rateparam.setRateList(signupMember.getRateList());
|
||||
userService.getMemberRateUpdate(search, rateparam);
|
||||
userService.getMemberbetYnUpdate(search, rateparam);
|
||||
}
|
||||
|
||||
apiResponse.success();
|
||||
} catch(ApiException e) {
|
||||
log.debug(e.toString());
|
||||
apiResponse = e.getApiResponse();
|
||||
} catch (Exception e) {
|
||||
log.info(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value="/modify/compInfo")
|
||||
public ApiResponse modifyCompInfo(@RequestHeader String token, HttpServletRequest request, @RequestBody PartnerCompInfo compInfo) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
try {
|
||||
//Site site = getSiteByCheck(request);
|
||||
if(token==null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
if(compInfo.getSiteDomain() == null) {
|
||||
compInfo.setSiteDomain("");
|
||||
}
|
||||
|
||||
JwtManager.TokenInfo tokenInfo = jwtManager.getTokenInfo(token);
|
||||
if(tokenInfo.getType()==null || tokenInfo.getType().equals("")) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
|
||||
compInfo.setTopCompId(tokenInfo.getSid());
|
||||
int chkTopComp = compService.getCheckTopComp(compInfo);
|
||||
if(chkTopComp == 1) {
|
||||
if(compInfo.getUserCountLimit() == null || compInfo.getUserCountLimit().equals("")) { compInfo.setUserCountLimit("1000"); }
|
||||
if(compInfo.getCompCountLimit() == null || compInfo.getCompCountLimit().equals("")) { compInfo.setCompCountLimit("10"); }
|
||||
|
||||
if(compInfo.getPassword() != null && !compInfo.getPassword().equals("")) {
|
||||
String password = passwordEncoder.encode(compInfo.getPassword());
|
||||
log.info("[ADMIN PWD:" + password + "]");
|
||||
compInfo.setPassword(password);
|
||||
}
|
||||
|
||||
log.info("[REQUEST: "+request.getRequestURI()+"] " + compInfo);
|
||||
|
||||
int result = compService.modifyCompInfo(compInfo);
|
||||
try{
|
||||
HashMap<String, String> logParam = new HashMap<String, String>();
|
||||
logParam.put("siteId", tokenInfo.getSid());
|
||||
logParam.put("memId", tokenInfo.getMid());
|
||||
logParam.put("logType", "UPDATE");
|
||||
logParam.put("logoutYn", "");
|
||||
logParam.put("logEndPoint", request.getRequestURI());
|
||||
logParam.put("logName", compInfo.getSiteId()+"::업체 수정");
|
||||
logParam.put("logDesc", compInfo.toString());
|
||||
logParam.put("regId", tokenInfo.getSid());
|
||||
logParam.put("regIp", IPKit.getIpAddressByRequest(request));
|
||||
logParam.put("token", "");
|
||||
commonService.insertAdminlog(logParam);
|
||||
} catch(Exception e) { System.out.print(e.toString()); }
|
||||
|
||||
if(result > 0) {
|
||||
apiResponse.success();
|
||||
} else {
|
||||
throw new ApiException("COMP009", "회사정보 설정에 문제가 발생하였습니다. 관리자에게 문의하세요.");
|
||||
}
|
||||
} else {
|
||||
throw new ApiException("COMP099", "권한이 없는 사용자 입니다.");
|
||||
}
|
||||
|
||||
apiResponse.success();
|
||||
} catch(ApiException e) {
|
||||
log.error(e.toString());
|
||||
apiResponse = e.getApiResponse();
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value="/modify/siteSettings")
|
||||
public ApiResponse modifySiteSettings(@RequestHeader String token, HttpServletRequest request, @RequestBody PartnerCompInfo compInfo) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
try {
|
||||
//Site site = getSiteByCheck(request);
|
||||
if(token==null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
JwtManager.TokenInfo tokenInfo = jwtManager.getTokenInfo(token);
|
||||
if(tokenInfo.getType()==null || tokenInfo.getType().equals("")) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
compInfo.setTopCompId(tokenInfo.getSid());
|
||||
int chkTopComp = compService.getCheckTopComp(compInfo);
|
||||
if(chkTopComp == 1) {
|
||||
|
||||
log.info("[REQUEST: "+request.getRequestURI()+"] " + compInfo);
|
||||
int result = compService.modifySiteSettings(compInfo);
|
||||
|
||||
try{
|
||||
HashMap<String, String> logParam = new HashMap<String, String>();
|
||||
logParam.put("siteId", tokenInfo.getSid());
|
||||
logParam.put("memId", tokenInfo.getMid());
|
||||
logParam.put("regId", tokenInfo.getMid());
|
||||
logParam.put("logType", "UPDATE");
|
||||
logParam.put("logoutYn", "");
|
||||
logParam.put("logEndPoint", request.getRequestURI());
|
||||
logParam.put("logName", compInfo.getSiteId()+"::업체 세팅 수정");
|
||||
logParam.put("logDesc", compInfo.toString());
|
||||
|
||||
logParam.put("regIp", IPKit.getIpAddressByRequest(request));
|
||||
logParam.put("token", "");
|
||||
commonService.insertAdminlog(logParam);
|
||||
} catch(Exception e) { System.out.print(e.toString()); }
|
||||
|
||||
if(result > 0) {
|
||||
apiResponse.success();
|
||||
} else {
|
||||
throw new ApiException("COMP009", "사이트 기능 설정에 문제가 발생하였습니다. 관리자에게 문의하세요.");
|
||||
}
|
||||
} else {
|
||||
throw new ApiException("COMP099", "권한이 없는 사용자 입니다.");
|
||||
}
|
||||
|
||||
} catch(ApiException e) {
|
||||
log.debug(e.toString());
|
||||
apiResponse = e.getApiResponse();
|
||||
} catch (Exception e) {
|
||||
log.info(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value="/modify/creditSettings")
|
||||
public ApiResponse modifyCreditSettings(@RequestHeader String token, HttpServletRequest request, @RequestBody PartnerCompInfo compInfo) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
try {
|
||||
//Site site = getSiteByCheck(request);
|
||||
if(token==null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
JwtManager.TokenInfo tokenInfo = jwtManager.getTokenInfo(token);
|
||||
if(tokenInfo.getType()==null || tokenInfo.getType().equals("")) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
compInfo.setTopCompId(tokenInfo.getSid());
|
||||
int chkTopComp = compService.getCheckTopComp(compInfo);
|
||||
if(chkTopComp == 1) {
|
||||
|
||||
log.info("[REQUEST: "+request.getRequestURI()+"] " + compInfo);
|
||||
|
||||
// TODO: 기본수수료율 변경 전 해당 사이트 크레딧(알) 잔액이 0인지 체크. 0이아니면 변경 불가능
|
||||
Site search = new Site();
|
||||
search.setSiteId(compInfo.getSiteId());
|
||||
CompDetail comp = compService.getPartnerComp(search);
|
||||
int creditAmt = Integer.parseInt(comp.getCreditAmt());
|
||||
if(creditAmt > 0) {
|
||||
throw new ApiException("COMP010", "보유알이 0일때만 기본수수료율 변경이 가능합니다.");
|
||||
}
|
||||
|
||||
int result = compService.modifyCreditSettings(compInfo);
|
||||
try{
|
||||
HashMap<String, String> logParam = new HashMap<String, String>();
|
||||
logParam.put("siteId", tokenInfo.getSid());
|
||||
logParam.put("memId", tokenInfo.getMid());
|
||||
logParam.put("regId", tokenInfo.getMid());
|
||||
logParam.put("logType", "UPDATE");
|
||||
logParam.put("logoutYn", "");
|
||||
logParam.put("logEndPoint", request.getRequestURI());
|
||||
logParam.put("logName", compInfo.getSiteId()+"::업체 크레딧 세팅 수정");
|
||||
logParam.put("logDesc", compInfo.toString());
|
||||
|
||||
logParam.put("regIp", IPKit.getIpAddressByRequest(request));
|
||||
logParam.put("token", "");
|
||||
commonService.insertAdminlog(logParam);
|
||||
} catch(Exception e) { System.out.print(e.toString()); }
|
||||
|
||||
if(result > 0) {
|
||||
apiResponse.success();
|
||||
} else {
|
||||
throw new ApiException("COMP009", "PT 설정에 문제가 발생하였습니다. 관리자에게 문의하세요.");
|
||||
}
|
||||
} else {
|
||||
throw new ApiException("COMP099", "권한이 없는 사용자 입니다.");
|
||||
}
|
||||
|
||||
} catch(ApiException e) {
|
||||
log.debug(e.toString());
|
||||
apiResponse = e.getApiResponse();
|
||||
} catch (Exception e) {
|
||||
log.info(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value="/modify/creditRates")
|
||||
public ApiResponse modifyCreditRates(@RequestHeader String token, HttpServletRequest request, @RequestBody MemberRate memberRate) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
try {
|
||||
//Site site = getSiteByCheck(request);
|
||||
if(token==null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
JwtManager.TokenInfo tokenInfo = jwtManager.getTokenInfo(token);
|
||||
if(tokenInfo.getType()==null || tokenInfo.getType().equals("")) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
PartnerCompInfo compInfo = new PartnerCompInfo();
|
||||
compInfo.setSiteId(memberRate.getSiteId());
|
||||
compInfo.setTopCompId(tokenInfo.getSid());
|
||||
int chkTopComp = compService.getCheckTopComp(compInfo);
|
||||
if(chkTopComp == 1) {
|
||||
Member search = new Member();
|
||||
search.setSiteId(memberRate.getSiteId());
|
||||
|
||||
log.info("[REQUEST: "+request.getRequestURI()+"] " + memberRate);
|
||||
int result = compService.modifyCreditRates(search, memberRate);
|
||||
try{
|
||||
HashMap<String, String> logParam = new HashMap<String, String>();
|
||||
logParam.put("siteId", tokenInfo.getSid());
|
||||
logParam.put("memId", tokenInfo.getMid());
|
||||
logParam.put("regId", tokenInfo.getMid());
|
||||
logParam.put("logType", "UPDATE");
|
||||
logParam.put("logoutYn", "");
|
||||
logParam.put("logEndPoint", request.getRequestURI());
|
||||
logParam.put("logName", compInfo.getSiteId()+"::업체 크레딧 요율 수정");
|
||||
logParam.put("logDesc", compInfo.toString());
|
||||
|
||||
logParam.put("regIp", IPKit.getIpAddressByRequest(request));
|
||||
logParam.put("token", "");
|
||||
commonService.insertAdminlog(logParam);
|
||||
} catch(Exception e) { System.out.print(e.toString()); }
|
||||
|
||||
if(result > 0) {
|
||||
apiResponse.success();
|
||||
} else {
|
||||
throw new ApiException("COMP009", "게임별 PT수수료율 설정에 문제가 발생하였습니다. 관리자에게 문의하세요.");
|
||||
}
|
||||
} else {
|
||||
throw new ApiException("COMP099", "권한이 없는 사용자 입니다.");
|
||||
}
|
||||
|
||||
} catch(ApiException e) {
|
||||
log.debug(e.toString());
|
||||
apiResponse = e.getApiResponse();
|
||||
} catch (Exception e) {
|
||||
log.info(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value="/modify/biSubPointRates")
|
||||
public ApiResponse modifyBiSubPointRates(@RequestHeader String token, HttpServletRequest request, @RequestBody PartnerCompInfo compInfo) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
try {
|
||||
//Site site = getSiteByCheck(request);
|
||||
if(token==null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
JwtManager.TokenInfo tokenInfo = jwtManager.getTokenInfo(token);
|
||||
if(tokenInfo.getType()==null || tokenInfo.getType().equals("")) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
compInfo.setTopCompId(tokenInfo.getSid());
|
||||
int chkTopComp = compService.getCheckTopComp(compInfo);
|
||||
if(chkTopComp == 1) {
|
||||
|
||||
log.info("[REQUEST: "+request.getRequestURI()+"] " + compInfo);
|
||||
int result = compService.modifySiteGameSetting(compInfo);
|
||||
try{
|
||||
HashMap<String, String> logParam = new HashMap<String, String>();
|
||||
logParam.put("siteId", tokenInfo.getSid());
|
||||
logParam.put("memId", tokenInfo.getMid());
|
||||
logParam.put("regId", tokenInfo.getMid());
|
||||
logParam.put("logType", "UPDATE");
|
||||
logParam.put("logoutYn", "");
|
||||
logParam.put("logEndPoint", request.getRequestURI());
|
||||
logParam.put("logName", compInfo.getSiteId()+"::업체 보험포인트 요율 수정");
|
||||
logParam.put("logDesc", compInfo.toString());
|
||||
|
||||
logParam.put("regIp", IPKit.getIpAddressByRequest(request));
|
||||
logParam.put("token", "");
|
||||
commonService.insertAdminlog(logParam);
|
||||
} catch(Exception e) { System.out.print(e.toString()); }
|
||||
|
||||
if(result > 0) {
|
||||
apiResponse.success();
|
||||
} else {
|
||||
throw new ApiException("COMP009", "서브포인트요율 설정에 문제가 발생하였습니다. 관리자에게 문의하세요.");
|
||||
}
|
||||
} else {
|
||||
throw new ApiException("COMP099", "권한이 없는 사용자 입니다.");
|
||||
}
|
||||
|
||||
} catch(ApiException e) {
|
||||
log.debug(e.toString());
|
||||
apiResponse = e.getApiResponse();
|
||||
} catch (Exception e) {
|
||||
log.info(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value="/modify/betSettings")
|
||||
public ApiResponse modifyBetSettings(@RequestHeader String token, HttpServletRequest request, @RequestBody PartnerCompInfo compInfo) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
try {
|
||||
//Site site = getSiteByCheck(request);
|
||||
if(token==null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
JwtManager.TokenInfo tokenInfo = jwtManager.getTokenInfo(token);
|
||||
if(tokenInfo.getType()==null || tokenInfo.getType().equals("")) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
compInfo.setTopCompId(tokenInfo.getSid());
|
||||
int chkTopComp = compService.getCheckTopComp(compInfo);
|
||||
if(chkTopComp == 1) {
|
||||
|
||||
log.info("[REQUEST: "+request.getRequestURI()+"] " + compInfo);
|
||||
int result = compService.modifySiteGameSetting(compInfo);
|
||||
try{
|
||||
HashMap<String, String> logParam = new HashMap<String, String>();
|
||||
logParam.put("siteId", tokenInfo.getSid());
|
||||
logParam.put("memId", tokenInfo.getMid());
|
||||
logParam.put("regId", tokenInfo.getMid());
|
||||
logParam.put("logType", "UPDATE");
|
||||
logParam.put("logoutYn", "");
|
||||
logParam.put("logEndPoint", request.getRequestURI());
|
||||
logParam.put("logName", compInfo.getSiteId()+"::업체 게임세팅 수정");
|
||||
logParam.put("logDesc", compInfo.toString());
|
||||
|
||||
logParam.put("regIp", IPKit.getIpAddressByRequest(request));
|
||||
logParam.put("token", "");
|
||||
commonService.insertAdminlog(logParam);
|
||||
} catch(Exception e) { System.out.print(e.toString()); }
|
||||
|
||||
if(result > 0) {
|
||||
apiResponse.success();
|
||||
} else {
|
||||
throw new ApiException("COMP009", "배팅 가능유/무 설정에 문제가 발생하였습니다. 관리자에게 문의하세요.");
|
||||
}
|
||||
} else {
|
||||
throw new ApiException("COMP099", "권한이 없는 사용자 입니다.");
|
||||
}
|
||||
|
||||
} catch(ApiException e) {
|
||||
log.debug(e.toString());
|
||||
apiResponse = e.getApiResponse();
|
||||
} catch (Exception e) {
|
||||
log.info(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value="/detail")
|
||||
public ApiResponse detail(@RequestHeader String token, HttpServletRequest request, @Valid @RequestBody MemberSearch memberSearch) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
try {
|
||||
//Site site = getSiteByCheck(request);
|
||||
if(token==null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
Member search2 = new Member();
|
||||
search2.setMemId(memberSearch.getMemId());
|
||||
search2.setSiteId(memberSearch.getSiteId());
|
||||
|
||||
log.info("[REQUEST: "+request.getRequestURI()+"] " + memberSearch);
|
||||
HashMap memberDetail = compService.getPartnerCompDetail(search2);
|
||||
memberDetail.put("memPass", "");
|
||||
|
||||
memberDetail.put("memberCommissionRate", compService.getCompanyRate(search2));
|
||||
memberDetail.put("BI_SubPointRate", userService.getBISubPointRate(search2));
|
||||
|
||||
List<HashMap> memberFlow = userService.getMemberFlowList(memberDetail);
|
||||
List<HashMap> partnerFlow = userService.getPartnerFlowList(memberDetail);
|
||||
|
||||
apiResponse.put("memberDetail", memberDetail);
|
||||
apiResponse.put("memberFlow", memberFlow);
|
||||
apiResponse.put("partnerFlow", partnerFlow);
|
||||
apiResponse.success();
|
||||
|
||||
} catch(ApiException e) {
|
||||
log.debug(e.toString());
|
||||
apiResponse = e.getApiResponse();
|
||||
} catch (Exception e) {
|
||||
log.info(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value="/getTripleGameRate")
|
||||
public ApiResponse getTripleGameRate(@RequestHeader String token, HttpServletRequest request, @RequestBody CompSearch search) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
try {
|
||||
//Site site = getSiteByCheck(request);
|
||||
if(token==null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
JwtManager.TokenInfo tokenInfo = jwtManager.getTokenInfo(token);
|
||||
|
||||
log.info("[REQUEST: "+request.getRequestURI()+"] " + search);
|
||||
List<HashMap<String, String>> rateList = compService.getOmsRateListByTripleGame(search);
|
||||
apiResponse.put("list", rateList);
|
||||
|
||||
apiResponse.success();
|
||||
|
||||
} catch(ApiException e) {
|
||||
log.debug(e.toString());
|
||||
apiResponse = e.getApiResponse();
|
||||
} catch (Exception e) {
|
||||
log.info(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value="/setTripleGameRate")
|
||||
public ApiResponse setTripleGameRate(@RequestHeader String token, HttpServletRequest request, @RequestBody CompSearch search) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
try {
|
||||
//Site site = getSiteByCheck(request);
|
||||
if(token==null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
JwtManager.TokenInfo tokenInfo = jwtManager.getTokenInfo(token);
|
||||
if(tokenInfo.getType()==null || tokenInfo.getType().equals("")) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
|
||||
log.info("[REQUEST: "+request.getRequestURI()+"] " + search);
|
||||
HashMap<String, String> tripleParam = compService.getTripleParam(search);
|
||||
log.info("[REQUEST: "+request.getRequestURI()+"] " + tripleParam);
|
||||
if(tokenInfo.getSid().equals(tripleParam.get("topCompId").toString()) || tokenInfo.getType().equals("super")) {
|
||||
List<HashMap<String, String>> tripleRateList = compService.getTripleGameRate(tripleParam);
|
||||
|
||||
compService.insertTripleRateList(search, tripleRateList);
|
||||
|
||||
compService.updateOmsRateList(search);
|
||||
|
||||
List<HashMap<String, String>> rateList = compService.getOmsRateListByTripleGame(search);
|
||||
apiResponse.put("list", rateList);
|
||||
} else {
|
||||
throw new ApiException("COMP099", "권한이 없는 사용자 입니다.");
|
||||
}
|
||||
|
||||
apiResponse.success();
|
||||
|
||||
} catch(ApiException e) {
|
||||
log.debug(e.toString());
|
||||
apiResponse = e.getApiResponse();
|
||||
} catch (Exception e) {
|
||||
log.info(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value="/passChg")
|
||||
public ApiResponse passwsChg(@RequestHeader String token, HttpServletRequest request, @Valid @RequestBody Site site) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
try {
|
||||
//Site site = getSiteByCheck(request);
|
||||
if(token==null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
log.info("[REQUEST: "+request.getRequestURI()+"] " + site);
|
||||
|
||||
JwtManager.TokenInfo tokenInfo = jwtManager.getTokenInfo(token);
|
||||
if(tokenInfo.getType()==null || tokenInfo.getType().equals("")) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
site.setSiteId(tokenInfo.getSid());
|
||||
|
||||
if(site.getSitePass() == null || site.getSitePass().equals("")) {
|
||||
throw new ApiException("S999", "현재 비밀번호를 입력하세요.");
|
||||
}
|
||||
|
||||
if(site.getNewSitePass() != null && !site.getNewSitePass().equals("")) {
|
||||
String password = passwordEncoder.encode(site.getNewSitePass());
|
||||
log.info("[ADMIN NEW PWD:" + password + "]");
|
||||
site.setNewSitePass(password);
|
||||
}
|
||||
|
||||
SiteSearch search = new SiteSearch();
|
||||
search.setSiteId(site.getSiteId());
|
||||
HashMap siteinfo= userService.adminLogin(search);
|
||||
|
||||
boolean chkPassword = passwordEncoder.matches(site.getSitePass(), siteinfo.get("sitePass").toString());
|
||||
log.info("[ADMIN chkPassword:" + chkPassword + "]");
|
||||
|
||||
if(!chkPassword) {
|
||||
throw new ApiException("S999", "현재 비밀번호가 다릅니다.");
|
||||
}
|
||||
|
||||
if(!tokenInfo.getSid().equals(tokenInfo.getMid())) {
|
||||
site.setAdminId(tokenInfo.getMid());
|
||||
userService.updateAdminPwd(site);
|
||||
}
|
||||
|
||||
userService.updatePwd(site);
|
||||
|
||||
apiResponse.success();
|
||||
|
||||
} catch(ApiException e) {
|
||||
log.debug(e.toString());
|
||||
apiResponse = e.getApiResponse();
|
||||
} catch (Exception e) {
|
||||
log.info(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value="/updateStatus")
|
||||
public ApiResponse updateStatus(@RequestHeader String token, HttpServletRequest request, @Valid @RequestBody MemberStatus status) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
try {
|
||||
//Site site = getSiteByCheck(request);
|
||||
if(token==null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
JwtManager.TokenInfo tokenInfo = jwtManager.getTokenInfo(token);
|
||||
if(tokenInfo.getType()==null || tokenInfo.getType().equals("")) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
status.setSiteId(tokenInfo.getSid());
|
||||
|
||||
log.info("[REQUEST: "+request.getRequestURI()+"] " + status);
|
||||
userService.updateStatus(status);
|
||||
try{
|
||||
HashMap<String, String> logParam = new HashMap<String, String>();
|
||||
logParam.put("siteId", tokenInfo.getSid());
|
||||
logParam.put("memId", tokenInfo.getMid());
|
||||
logParam.put("regId", tokenInfo.getMid());
|
||||
logParam.put("logType", "UPDATE");
|
||||
logParam.put("logoutYn", "");
|
||||
logParam.put("logEndPoint", request.getRequestURI());
|
||||
logParam.put("logName", status.getMemId()+"::업체 세팅 수정");
|
||||
logParam.put("logDesc", status.toString());
|
||||
|
||||
logParam.put("regIp", IPKit.getIpAddressByRequest(request));
|
||||
logParam.put("token", "");
|
||||
commonService.insertAdminlog(logParam);
|
||||
} catch(Exception e) { System.out.print(e.toString()); }
|
||||
|
||||
apiResponse.success();
|
||||
|
||||
} catch(ApiException e) {
|
||||
log.debug(e.toString());
|
||||
apiResponse = e.getApiResponse();
|
||||
} catch (Exception e) {
|
||||
log.info(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value={"/list"} )
|
||||
public ApiResponse list(@RequestHeader String token, HttpServletRequest request, @Valid @RequestBody MemberListSearch search) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
try {
|
||||
//Site site = getSiteByCheck(request);
|
||||
if(token==null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
JwtManager.TokenInfo tokenInfo = jwtManager.getTokenInfo(token);
|
||||
PageFormVO pageVo= new PageFormVO();
|
||||
search.setSiteId(tokenInfo.getSid());
|
||||
|
||||
int totalCount = compService.getPartnerCompListCnt(search);
|
||||
if (totalCount != 0) {
|
||||
PageFormVO commonForm = new PageFormVO();
|
||||
commonForm.setFunction_name("goPage");
|
||||
commonForm.setPage(search.getPage());
|
||||
commonForm.setCount_per_page(20);
|
||||
if(search.getCount_per_list()==0) {
|
||||
commonForm.setCount_per_list(10);
|
||||
} else {
|
||||
commonForm.setCount_per_list(search.getCount_per_list());
|
||||
}
|
||||
commonForm.setTatal_list_count(totalCount);
|
||||
pageVo = PagingUtil.setPageUtil(commonForm);
|
||||
search.setLimit(pageVo.getLimit());
|
||||
search.setOffset(pageVo.getOffset());
|
||||
search.setTatal_list_count(totalCount);
|
||||
apiResponse.put("pageInfo", pageVo);
|
||||
}
|
||||
|
||||
log.info("[REQUEST: "+request.getRequestURI()+"] " + search);
|
||||
|
||||
List<CompDetail> compList = compService.getPartnerCompList(search);
|
||||
apiResponse.put("list", compList);
|
||||
apiResponse.success();
|
||||
|
||||
} catch(ApiException e) {
|
||||
log.debug(e.toString());
|
||||
apiResponse = e.getApiResponse();
|
||||
} catch (Exception e) {
|
||||
log.info(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value={"/treeList"} )
|
||||
public ApiResponse treeList(@RequestHeader String token, HttpServletRequest request, @Valid @RequestBody TreeListSearch search) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
try {
|
||||
//Site site = getSiteByCheck(request);
|
||||
if(token==null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
JwtManager.TokenInfo tokenInfo = jwtManager.getTokenInfo(token);
|
||||
|
||||
if("".equals(search.getTargetId()) || search.getTargetId() == null) {
|
||||
search.setTargetId(tokenInfo.getSid());
|
||||
}
|
||||
search.setSearchType("partner"); // 여기서 "partner"는 컴퍼니를 지칭함. 파트너유저가 아님.
|
||||
|
||||
log.info("[REQUEST: "+request.getRequestURI()+"] " + search);
|
||||
List<HashMap> treeList = userService.getMemTreeList(search);
|
||||
apiResponse.put("list", treeList);
|
||||
|
||||
apiResponse.success();
|
||||
|
||||
} catch(ApiException e) {
|
||||
log.debug(e.toString());
|
||||
apiResponse = e.getApiResponse();
|
||||
} catch (Exception e) {
|
||||
log.info(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
|
||||
private Site getSiteByCheck(HttpServletRequest request) {
|
||||
Site site = userService.getSiteInfoByKey(request.getHeader("Authorization").toString());
|
||||
return site;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,496 @@
|
||||
package com.bb.admin.controller;
|
||||
|
||||
import java.net.SocketTimeoutException;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.http.conn.ConnectTimeoutException;
|
||||
import org.codehaus.jettison.json.JSONObject;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestHeader;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.client.ResourceAccessException;
|
||||
|
||||
import com.bb.exception.ApiException;
|
||||
import com.bb.jwt.JwtManager;
|
||||
import com.bb.model.ApiResponse;
|
||||
import com.bb.model.CashDetail;
|
||||
import com.bb.model.Member;
|
||||
import com.bb.model.MemberDetail;
|
||||
import com.bb.model.PageFormVO;
|
||||
import com.bb.model.Point;
|
||||
import com.bb.model.PointInOut;
|
||||
import com.bb.model.PointSearchAdm;
|
||||
import com.bb.model.SiteOption;
|
||||
import com.bb.model.SiteSearch;
|
||||
import com.bb.service.CashService;
|
||||
import com.bb.service.CommonService;
|
||||
import com.bb.service.PointService;
|
||||
import com.bb.service.TripleService;
|
||||
import com.bb.service.UserService;
|
||||
import com.bb.util.IPKit;
|
||||
import com.bb.util.PagingUtil;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@RestController
|
||||
@Slf4j
|
||||
@RequestMapping("/api/admin/point")
|
||||
@RequiredArgsConstructor
|
||||
@SecurityRequirement(name = "Authorization")
|
||||
public class AdminApiPointController {
|
||||
|
||||
private final UserService userService;
|
||||
|
||||
private final PointService pointService;
|
||||
|
||||
private final CashService cashService;
|
||||
|
||||
private final CommonService commonService;
|
||||
|
||||
private final TripleService tripleService;
|
||||
|
||||
private final JwtManager jwtManager;
|
||||
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value="/pointList")
|
||||
public ApiResponse pointList(@RequestHeader String token, HttpServletRequest request, @RequestBody PointSearchAdm search) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
try {
|
||||
//Site site = getSiteByCheck(request);
|
||||
if(token==null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
if(search.getOldYn() == null || search.getOldYn().equals("")) {
|
||||
search.setOldYn("N");
|
||||
}
|
||||
|
||||
JwtManager.TokenInfo tokenInfo = jwtManager.getTokenInfo(token);
|
||||
|
||||
search.setSiteId(tokenInfo.getSid());
|
||||
|
||||
PageFormVO pageVo= new PageFormVO();
|
||||
if(search.getPage()==0)search.setPage(1);
|
||||
|
||||
int totalCount = pointService.getAdminPointListCnt(search);
|
||||
if (totalCount != 0) {
|
||||
PageFormVO commonForm = new PageFormVO();
|
||||
if(search.getPage()==0)search.setPage(1);
|
||||
commonForm.setFunction_name("goPage");
|
||||
commonForm.setPage(search.getPage());
|
||||
commonForm.setCount_per_page(20);
|
||||
if(search.getCount_per_list()==0) {
|
||||
commonForm.setCount_per_list(10);
|
||||
} else {
|
||||
commonForm.setCount_per_list(search.getCount_per_list());
|
||||
}
|
||||
commonForm.setTatal_list_count(totalCount);
|
||||
pageVo = PagingUtil.setPageUtil(commonForm);
|
||||
search.setLimit(pageVo.getLimit());
|
||||
search.setOffset(pageVo.getOffset());
|
||||
search.setTatal_list_count(totalCount);
|
||||
|
||||
apiResponse.put("pageInfo", pageVo);
|
||||
}
|
||||
|
||||
log.info("[REQUEST: "+request.getRequestURI()+"] " + search);
|
||||
|
||||
List<HashMap<String, String>> cashList = pointService.getAdminPointList(search);
|
||||
apiResponse.put("list", cashList);
|
||||
|
||||
apiResponse.success();
|
||||
|
||||
} catch(ApiException e) {
|
||||
log.error(e.toString());
|
||||
apiResponse = e.getApiResponse();
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value="/pointListNew")
|
||||
public ApiResponse pointListNew(@RequestHeader String token, HttpServletRequest request, @RequestBody PointSearchAdm search) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
try {
|
||||
//Site site = getSiteByCheck(request);
|
||||
if(token==null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
if(search.getOldYn() == null || search.getOldYn().equals("")) {
|
||||
search.setOldYn("N");
|
||||
}
|
||||
|
||||
JwtManager.TokenInfo tokenInfo = jwtManager.getTokenInfo(token);
|
||||
search.setSiteId(tokenInfo.getSid());
|
||||
final String LOG_PREFIX = "#-admin::pointListNew::"+tokenInfo.getSid()+":::";
|
||||
|
||||
ObjectMapper objectMapper = new ObjectMapper();
|
||||
String reqJsonStr = objectMapper.writeValueAsString(search);
|
||||
JSONObject reqObj = new JSONObject(reqJsonStr);
|
||||
log.info(LOG_PREFIX+ "Request {}", reqObj);
|
||||
|
||||
PageFormVO pageVo= new PageFormVO();
|
||||
if(search.getPage()==0)search.setPage(1);
|
||||
|
||||
int totalCount = pointService.getAdminPointListNewCnt(search);
|
||||
if (totalCount != 0) {
|
||||
PageFormVO commonForm = new PageFormVO();
|
||||
if(search.getPage()==0)search.setPage(1);
|
||||
commonForm.setFunction_name("goPage");
|
||||
commonForm.setPage(search.getPage());
|
||||
commonForm.setCount_per_page(20);
|
||||
if(search.getCount_per_list()==0) {
|
||||
commonForm.setCount_per_list(10);
|
||||
} else {
|
||||
commonForm.setCount_per_list(search.getCount_per_list());
|
||||
}
|
||||
commonForm.setTatal_list_count(totalCount);
|
||||
pageVo = PagingUtil.setPageUtil(commonForm);
|
||||
search.setLimit(pageVo.getLimit());
|
||||
search.setOffset(pageVo.getOffset());
|
||||
search.setTatal_list_count(totalCount);
|
||||
|
||||
apiResponse.put("pageInfo", pageVo);
|
||||
}
|
||||
|
||||
List<HashMap<String, String>> cashList = pointService.getAdminPointListNew(search);
|
||||
apiResponse.put("list", cashList);
|
||||
|
||||
apiResponse.success();
|
||||
|
||||
} catch(ApiException e) {
|
||||
log.error(e.toString());
|
||||
apiResponse = e.getApiResponse();
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value="/botRateList")
|
||||
public ApiResponse botRateList(@RequestHeader String token, HttpServletRequest request, @RequestBody PointSearchAdm search) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
try {
|
||||
//Site site = getSiteByCheck(request);
|
||||
if(token==null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
JwtManager.TokenInfo tokenInfo = jwtManager.getTokenInfo(token);
|
||||
search.setSiteId(tokenInfo.getSid());
|
||||
|
||||
if(search.getMemId() == null || search.getMemId().equals("")) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
if(search.getBetMemId() == null || search.getBetMemId().equals("")) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
if(search.getVendorCode() == null || search.getVendorCode().equals("")) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
log.info("[REQUEST: "+request.getRequestURI()+"] " + search);
|
||||
|
||||
List<HashMap<String, String>> botRateList = null;
|
||||
if(search.getRateTypeCode() == null || search.getRateTypeCode().equals("")) {
|
||||
botRateList = pointService.getPointBotRateList(search);
|
||||
} else {
|
||||
botRateList = pointService.getPointBotMultiRateList(search);
|
||||
}
|
||||
|
||||
|
||||
apiResponse.put("botRateList", botRateList);
|
||||
|
||||
apiResponse.success();
|
||||
|
||||
} catch(ApiException e) {
|
||||
log.error(e.toString());
|
||||
apiResponse = e.getApiResponse();
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value="/pointInOut")
|
||||
public ApiResponse pointInOut(@RequestHeader String token, HttpServletRequest request, @RequestBody PointInOut pointInout) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
try {
|
||||
//Site site = getSiteByCheck(request);
|
||||
if(token==null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
JwtManager.TokenInfo tokenInfo = jwtManager.getTokenInfo(token);
|
||||
if(tokenInfo.getType()==null || tokenInfo.getType().equals("")) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
|
||||
Point point = new Point();
|
||||
|
||||
Member search = new Member();
|
||||
search.setMemId(pointInout.getMemId());
|
||||
search.setSiteId(tokenInfo.getSid());
|
||||
|
||||
MemberDetail loginMember= userService.getMember(search);
|
||||
if(loginMember == null) {
|
||||
throw new ApiException("U003", "unknown user");
|
||||
}
|
||||
|
||||
long prePoint = loginMember.getPointAmt();
|
||||
if("-2".equals(pointInout.getPointType())){
|
||||
if(prePoint < pointInout.getPointAmt()) {
|
||||
throw new ApiException("P003", "보유 포인트를 초과하여 회수 할 수 없습니다.");
|
||||
}
|
||||
}
|
||||
|
||||
if(pointInout.getPointType().equals("2")) {
|
||||
pointInout.setPointDesc("관리자 포인트 지급");
|
||||
}
|
||||
|
||||
if(pointInout.getPointType().equals("-2")) {
|
||||
pointInout.setPointDesc("관리자 포인트 회수");
|
||||
}
|
||||
|
||||
log.info("[REQUEST: "+request.getRequestURI()+"] " + pointInout);
|
||||
|
||||
if(pointInout.getPointType().equals("2") && pointInout.getPointAmt() <= 0) {
|
||||
throw new ApiException("P004", "포인트 금액을 입력하세요.");
|
||||
}
|
||||
|
||||
if(pointInout.getPointType().equals("-2") && pointInout.getPointAmt() >= 0) {
|
||||
throw new ApiException("P004", "포인트 금액을 입력하세요.");
|
||||
}
|
||||
|
||||
double pointAmtD = pointInout.getPointAmt() * 1.0;
|
||||
|
||||
point.setSiteId(tokenInfo.getSid());
|
||||
point.setMemId(pointInout.getMemId());
|
||||
point.setPointType(pointInout.getPointType());
|
||||
point.setPointDesc(pointInout.getPointDesc());
|
||||
point.setPointAmt(pointAmtD);
|
||||
point.setBetIdx(null);
|
||||
point.setPointStatus("1");
|
||||
point.setRegId(tokenInfo.getMid());
|
||||
point.setAdminId(tokenInfo.getMid());
|
||||
point.setMemo(pointInout.getMemo());
|
||||
point.setPrePointAmt(loginMember.getPointAmt());
|
||||
// cashService.pointInsert(point);
|
||||
long pointIdx = pointService.pointInsert(point);
|
||||
if(pointIdx == 0) {
|
||||
throw new ApiException("P006", "포인트지급,회수 처리는 1분에 1건씩 처리됩니다. 잠시후 다시 시도해주세요");
|
||||
} else {
|
||||
try {
|
||||
HashMap<String, String> logParam = new HashMap<String, String>();
|
||||
logParam.put("siteId", tokenInfo.getSid());
|
||||
logParam.put("memId", tokenInfo.getMid());
|
||||
logParam.put("logType", "CREATE");
|
||||
logParam.put("logoutYn", "");
|
||||
logParam.put("logEndPoint", request.getRequestURI());
|
||||
logParam.put("logName", pointInout.getMemId()+"::관리자 포인트 지급/회수");
|
||||
logParam.put("logDesc", pointInout.toString());
|
||||
logParam.put("regId", tokenInfo.getMid());
|
||||
logParam.put("regIp", IPKit.getIpAddressByRequest(request));
|
||||
logParam.put("token", "");
|
||||
commonService.insertAdminlog(logParam);
|
||||
} catch(Exception e) { System.out.print(e.toString()); }
|
||||
}
|
||||
|
||||
apiResponse.success();
|
||||
|
||||
} catch(ApiException e) {
|
||||
log.error(e.toString());
|
||||
apiResponse = e.getApiResponse();
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value="/pointChg")
|
||||
public ApiResponse pointChg(@RequestHeader String token, HttpServletRequest request, @RequestBody Point point) throws Exception {
|
||||
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
|
||||
try {
|
||||
if(token==null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
if(point.getSiteId() == null || point.getSiteId().equals("")) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
if(point.getMemId() == null || point.getMemId().equals("")) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
JwtManager.TokenInfo tokenInfo = jwtManager.getTokenInfo(token);
|
||||
if(tokenInfo.getType()==null || tokenInfo.getType().equals("")) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
final String LOG_PREFIX = "#-admin::pointChg::"+point.getSiteId()+"::"+point.getMemId()+"::::";
|
||||
|
||||
Member search = new Member();
|
||||
search.setSiteId(point.getSiteId());
|
||||
search.setMemId(point.getMemId());
|
||||
MemberDetail memDetail= userService.getMember(search);
|
||||
if(memDetail == null) {
|
||||
throw new ApiException("U003", "unknown user");
|
||||
}
|
||||
|
||||
log.info(LOG_PREFIX+ "[REQUEST: "+request.getRequestURI()+"] " + point);
|
||||
|
||||
SiteSearch paramSite = new SiteSearch();
|
||||
paramSite.setSiteId(point.getSiteId());
|
||||
SiteOption siteOption = commonService.getSiteSetting(paramSite);
|
||||
|
||||
if(point.getPointAmt() == null || point.getPointAmt() <= 0) {
|
||||
throw new ApiException("P001", "전환할 포인트를 입력하세요.");
|
||||
}
|
||||
|
||||
int pointAmt = point.getPointAmt().intValue();
|
||||
int pointInMax = Integer.parseInt(siteOption.getPointChangeAmtLimit());
|
||||
int pointInUnit = Integer.parseInt(siteOption.getPointChangeAmtUnit());
|
||||
if((pointInMax != 0) && (pointAmt > pointInMax)) {
|
||||
throw new ApiException("P101", "1회 포인트전환 최대한도는 " + pointInMax + "입니다.");
|
||||
}
|
||||
if((pointInUnit != 0) && (pointAmt % pointInUnit != 0)) {
|
||||
throw new ApiException("P102", "포인트전환 금액 단위는 " + pointInUnit + "입니다.");
|
||||
}
|
||||
|
||||
int cashAmt = pointAmt;
|
||||
double pointAmtD = pointAmt * -1.0;
|
||||
|
||||
if(memDetail.getPointAmt() >= point.getPointAmt() ) {
|
||||
point.setPointType("-44");
|
||||
point.setPointDesc("관리자 포인트전환");
|
||||
point.setPointAmt(pointAmtD);
|
||||
point.setBetIdx(null);
|
||||
point.setPointStatus("1");
|
||||
point.setRegId(tokenInfo.getSid());
|
||||
point.setAdminId(tokenInfo.getSid());
|
||||
point.setMemo("");
|
||||
point.setPrePointAmt(memDetail.getPointAmt());
|
||||
log.info(LOG_PREFIX+ point);
|
||||
long pointIdx = pointService.pointInsert(point);
|
||||
log.info(LOG_PREFIX+ "pointIdx: " + pointIdx);
|
||||
if(pointIdx == 0) {
|
||||
throw new ApiException("P005", "포인트전환은 1분에 1건씩 처리됩니다. 잠시후 다시 시도해주세요");
|
||||
} else {
|
||||
CashDetail paramCash = new CashDetail();
|
||||
paramCash.setSiteId(point.getSiteId());
|
||||
paramCash.setMemId(point.getMemId());
|
||||
paramCash.setCashType("44");
|
||||
paramCash.setCashAmt(cashAmt);
|
||||
paramCash.setCashDesc("관리자 포인트전환");
|
||||
paramCash.setDelYn("N");
|
||||
paramCash.setCashStatus("1");
|
||||
paramCash.setMemo("");
|
||||
paramCash.setRegId(tokenInfo.getSid());
|
||||
paramCash.setAdminId(tokenInfo.getSid());
|
||||
paramCash.setPreCashAmt(Integer.toString(memDetail.getCashAmt()));
|
||||
paramCash.setWaitTime(-60);
|
||||
log.info(LOG_PREFIX+ paramCash);
|
||||
long cashIdx = cashService.insertCash(paramCash);
|
||||
log.info(LOG_PREFIX+ "cashIdx: " + cashIdx);
|
||||
if(cashIdx == 0) {
|
||||
throw new ApiException("P005", "포인트전환은 1분에 1건씩 처리됩니다. 잠시후 다시 시도해주세요");
|
||||
} else {
|
||||
try {
|
||||
HashMap<String, String> logParam = new HashMap<String, String>();
|
||||
logParam.put("siteId", tokenInfo.getSid());
|
||||
logParam.put("memId", tokenInfo.getMid());
|
||||
logParam.put("logType", "CREATE");
|
||||
logParam.put("logoutYn", "");
|
||||
logParam.put("logEndPoint", request.getRequestURI());
|
||||
logParam.put("logName", point.getMemId()+"::관리자 포인트 전환");
|
||||
logParam.put("logDesc", point.toString());
|
||||
logParam.put("regId", tokenInfo.getMid());
|
||||
logParam.put("regIp", IPKit.getIpAddressByRequest(request));
|
||||
logParam.put("token", "");
|
||||
commonService.insertAdminlog(logParam);
|
||||
} catch(Exception e) { System.out.print(e.toString()); }
|
||||
}
|
||||
}
|
||||
} else {
|
||||
throw new ApiException("P002", "보유 포인트를 초과하여 전환신청을 할 수 없습니다.");
|
||||
}
|
||||
|
||||
apiResponse.success();
|
||||
|
||||
} catch (ResourceAccessException rae) {
|
||||
JwtManager.TokenInfo tokenInfo = jwtManager.getTokenInfo(token);
|
||||
String siteId = tokenInfo.getSid();
|
||||
String memId = tokenInfo.getMid();
|
||||
|
||||
if(rae.getCause() instanceof ConnectTimeoutException) {
|
||||
log.error("#-admin::pointChg::"+siteId+"::"+memId+"::::"+"[ConnectTimeoutException]"+rae.getMessage());
|
||||
apiResponse.setResultCode("TE99");
|
||||
apiResponse.setResultMessage("ConnectTimeoutException");
|
||||
}
|
||||
|
||||
if(rae.getCause() instanceof SocketTimeoutException) {
|
||||
log.error("#-admin::pointChg::"+siteId+"::"+memId+"::::"+"[SocketTimeoutException]"+rae.getMessage());
|
||||
apiResponse.setResultCode("TE99");
|
||||
apiResponse.setResultMessage("SocketTimeoutException");
|
||||
}
|
||||
|
||||
if(rae.getCause() instanceof InterruptedException) {
|
||||
log.error("#-admin::pointChg::"+siteId+"::"+memId+"::::"+"[InterruptedException]"+rae.getMessage());
|
||||
apiResponse.setResultCode("TE99");
|
||||
apiResponse.setResultMessage("InterruptedException");
|
||||
}
|
||||
|
||||
apiResponse.success();
|
||||
} catch(ApiException e) {
|
||||
JwtManager.TokenInfo tokenInfo = jwtManager.getTokenInfo(token);
|
||||
String siteId = tokenInfo.getSid();
|
||||
String memId = tokenInfo.getMid();
|
||||
log.error("#-admin::pointChg::"+siteId+"::"+memId+"::::"+"ApiException::"+e.toString());
|
||||
apiResponse = e.getApiResponse();
|
||||
} catch (Exception e) {
|
||||
JwtManager.TokenInfo tokenInfo = jwtManager.getTokenInfo(token);
|
||||
String siteId = tokenInfo.getSid();
|
||||
String memId = tokenInfo.getMid();
|
||||
log.error("#-admin::pointChg::"+siteId+"::"+memId+"::::"+"Exception::"+e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,622 @@
|
||||
package com.bb.admin.controller;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestHeader;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.bb.exception.ApiException;
|
||||
import com.bb.jwt.JwtManager;
|
||||
import com.bb.model.ApiResponse;
|
||||
import com.bb.model.DailyReportSearch;
|
||||
import com.bb.model.DayilPartnerReport;
|
||||
import com.bb.model.DayilPeriodicReports;
|
||||
import com.bb.model.PageFormVO;
|
||||
import com.bb.model.ReportSearch;
|
||||
import com.bb.model.SiteOption;
|
||||
import com.bb.model.SiteSearch;
|
||||
import com.bb.service.CommonService;
|
||||
import com.bb.service.ReportService;
|
||||
import com.bb.util.PagingUtil;
|
||||
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.validation.Valid;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@RestController
|
||||
@Slf4j
|
||||
@RequestMapping("/api/admin/report")
|
||||
@RequiredArgsConstructor
|
||||
@SecurityRequirement(name = "Authorization")
|
||||
public class AdminApiReportController {
|
||||
|
||||
private final ReportService reportService;
|
||||
|
||||
private final CommonService commonService;
|
||||
|
||||
private final JwtManager jwtManager;
|
||||
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value={"/calculateSearch"})
|
||||
public ApiResponse dailyCalculateSearch(@RequestHeader String token, HttpServletRequest request, @RequestBody DailyReportSearch search) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
final String LOG_PREFIX = "#-admin::dailyCalculateSearch:::";
|
||||
try {
|
||||
if(token==null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
JwtManager.TokenInfo tokenInfo = jwtManager.getTokenInfo(token);
|
||||
search.setSiteId(tokenInfo.getSid());
|
||||
|
||||
PageFormVO pageVo = new PageFormVO();
|
||||
if(search.getPage() == 0) search.setPage(1);
|
||||
|
||||
SiteSearch paramSite = new SiteSearch();
|
||||
paramSite.setSiteId(tokenInfo.getSid());
|
||||
SiteOption siteOption = commonService.getSiteSetting(paramSite);
|
||||
search.setBlankSpinSetType(siteOption.getBlankSpinSetType());
|
||||
|
||||
log.info(LOG_PREFIX+ "[REQUEST: "+request.getRequestURI()+"] " + search);
|
||||
|
||||
List<HashMap<String,String>> reportCateInfo = reportService.getReportCateInfo(search.getSiteId());
|
||||
apiResponse.put("reportCateInfo", reportCateInfo);
|
||||
|
||||
int totalCount = reportService.getReportsListCntForAdmin(search);
|
||||
|
||||
if (totalCount != 0) {
|
||||
PageFormVO commonForm = new PageFormVO();
|
||||
commonForm.setFunction_name("goPage");
|
||||
commonForm.setPage(search.getPage());
|
||||
if(search.getCount_per_page() == 0) {
|
||||
commonForm.setCount_per_page(10);
|
||||
} else {
|
||||
commonForm.setCount_per_page(search.getCount_per_page());
|
||||
}
|
||||
if(search.getCount_per_list() == 0) {
|
||||
commonForm.setCount_per_list(10);
|
||||
} else {
|
||||
commonForm.setCount_per_list(search.getCount_per_list());
|
||||
}
|
||||
commonForm.setTatal_list_count(totalCount);
|
||||
pageVo = PagingUtil.setPageUtil(commonForm);
|
||||
search.setLimit(pageVo.getLimit());
|
||||
// search.setOffset(pageVo.getOffset());
|
||||
search.setOffset(-1);
|
||||
search.setTatal_list_count(totalCount);
|
||||
apiResponse.put("pageInfo", pageVo);
|
||||
}
|
||||
|
||||
if(search.getSearchType().equals("OUTER")) {
|
||||
List<DayilPeriodicReports> list = reportService.getReportsListForAdmin(search); // Use blankSpinSetType
|
||||
DayilPeriodicReports total = reportService.getReportsTotalForAdmin(search); // Use blankSpinSetType
|
||||
apiResponse.put("search", search);
|
||||
apiResponse.put("outSearchList", list);
|
||||
apiResponse.put("outSearchTotal", total);
|
||||
} else {
|
||||
List<DayilPeriodicReports> list = reportService.getReportsListForAdmin(search); // Use blankSpinSetType
|
||||
search.setSearchType("OUTER");
|
||||
List<DayilPeriodicReports> total = reportService.getReportsListForAdmin(search); // Use blankSpinSetType
|
||||
DayilPeriodicReports inSearchTotal = total.get(0);
|
||||
apiResponse.put("search", search);
|
||||
apiResponse.put("inSearchList", list);
|
||||
apiResponse.put("inSearchTotal", inSearchTotal);
|
||||
}
|
||||
|
||||
apiResponse.success();
|
||||
|
||||
} catch(ApiException e) {
|
||||
log.error(LOG_PREFIX+ "ApiException: "+e.toString());
|
||||
apiResponse = e.getApiResponse();
|
||||
} catch (Exception e) {
|
||||
log.error(LOG_PREFIX+ "Exception: "+e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
|
||||
@PostMapping(value={"/reportByUser"})
|
||||
public ApiResponse reportByUser(@RequestHeader String token, HttpServletRequest request, @RequestBody DailyReportSearch search) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
try {
|
||||
if(token==null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
JwtManager.TokenInfo tokenInfo = jwtManager.getTokenInfo(token);
|
||||
if(search.getSearchMemId() == null) {
|
||||
search.setSearchMemId("");
|
||||
}
|
||||
search.setSiteId(tokenInfo.getSid());
|
||||
if(search.getSearchRecommandId() == null) {
|
||||
search.setSearchRecommandId("");
|
||||
}
|
||||
|
||||
if(search.getOrderStr() == null) {
|
||||
search.setOrderStr("");
|
||||
}
|
||||
|
||||
PageFormVO pageVo = new PageFormVO();
|
||||
if(search.getPage() == 0) search.setPage(1);
|
||||
|
||||
SiteSearch paramSite = new SiteSearch();
|
||||
paramSite.setSiteId(tokenInfo.getSid());
|
||||
SiteOption siteOption = commonService.getSiteSetting(paramSite);
|
||||
search.setBlankSpinSetType(siteOption.getBlankSpinSetType());
|
||||
|
||||
log.info("[REQUEST: "+request.getRequestURI()+"] " + search);
|
||||
|
||||
List<HashMap<String,String>> reportCateInfo = reportService.getReportCateInfo(search.getSiteId());
|
||||
apiResponse.put("reportCateInfo", reportCateInfo);
|
||||
|
||||
int totalCount = reportService.getReportsByUserListCntForAdmin(search);
|
||||
|
||||
if (totalCount != 0) {
|
||||
PageFormVO commonForm = new PageFormVO();
|
||||
commonForm.setFunction_name("goPage");
|
||||
commonForm.setPage(search.getPage());
|
||||
if(search.getCount_per_page() == 0) {
|
||||
commonForm.setCount_per_page(10);
|
||||
} else {
|
||||
commonForm.setCount_per_page(search.getCount_per_page());
|
||||
}
|
||||
if(search.getCount_per_list() == 0) {
|
||||
commonForm.setCount_per_list(10);
|
||||
} else {
|
||||
commonForm.setCount_per_list(search.getCount_per_list());
|
||||
}
|
||||
commonForm.setTatal_list_count(totalCount);
|
||||
pageVo = PagingUtil.setPageUtil(commonForm);
|
||||
search.setLimit(pageVo.getLimit());
|
||||
search.setOffset(pageVo.getOffset());
|
||||
search.setTatal_list_count(totalCount);
|
||||
apiResponse.put("pageInfo", pageVo);
|
||||
}
|
||||
|
||||
DayilPeriodicReports total = reportService.getReportsByUserTotalForAdmin(search); // Use blankSpinSetType
|
||||
apiResponse.put("searchTotal", total);
|
||||
|
||||
List<DayilPeriodicReports> list = reportService.getReportsByUserListForAdmin(search); // Use blankSpinSetType
|
||||
apiResponse.put("searchList", list);
|
||||
|
||||
apiResponse.success();
|
||||
|
||||
} catch(ApiException e) {
|
||||
log.error(e.toString());
|
||||
apiResponse = e.getApiResponse();
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value={"/dailyCalculate"})
|
||||
public ApiResponse dailyCalculate(@RequestHeader String token, HttpServletRequest request, @RequestBody DailyReportSearch search) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
try {
|
||||
if(token==null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
JwtManager.TokenInfo tokenInfo = jwtManager.getTokenInfo(token);
|
||||
search.setSiteId(tokenInfo.getSid());
|
||||
|
||||
SiteSearch paramSite = new SiteSearch();
|
||||
paramSite.setSiteId(tokenInfo.getSid());
|
||||
SiteOption siteOption = commonService.getSiteSetting(paramSite);
|
||||
search.setBlankSpinSetType(siteOption.getBlankSpinSetType());
|
||||
|
||||
log.info("[REQUEST: "+request.getRequestURI()+"] " + search);
|
||||
|
||||
List<HashMap<String,String>> reportCateInfo = reportService.getReportCateInfo(search.getSiteId());
|
||||
apiResponse.put("reportCateInfo", reportCateInfo);
|
||||
|
||||
HashMap<String, String> partnerInfo = reportService.getPartnerInfo(search); // Use blankSpinSetType
|
||||
List<DayilPartnerReport> dailyList = reportService.getDayilPartnerReport(search); // Use blankSpinSetType
|
||||
|
||||
apiResponse.put("partnerInfo", partnerInfo);
|
||||
apiResponse.put("dailyList", dailyList);
|
||||
|
||||
apiResponse.success();
|
||||
|
||||
} catch(ApiException e) {
|
||||
log.error(e.toString());
|
||||
apiResponse = e.getApiResponse();
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value={"/memWL"})
|
||||
public ApiResponse logList(@RequestHeader String token, HttpServletRequest request, @Valid @RequestBody ReportSearch search) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
try {
|
||||
//Site site = getSiteByCheck(request);
|
||||
if(token==null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
if(search.getOldYn() == null || search.getOldYn().equals("")) {
|
||||
search.setOldYn("N");
|
||||
}
|
||||
|
||||
JwtManager.TokenInfo tokenInfo = jwtManager.getTokenInfo(token);
|
||||
PageFormVO pageVo= new PageFormVO();
|
||||
if(search.getPage()==0)search.setPage(1);
|
||||
|
||||
search.setSiteId(tokenInfo.getSid());
|
||||
|
||||
int totalCount = reportService.getReportMemwlListCnt(search);
|
||||
if (totalCount != 0) {
|
||||
PageFormVO commonForm = new PageFormVO();
|
||||
commonForm.setFunction_name("goPage");
|
||||
commonForm.setPage(search.getPage());
|
||||
commonForm.setCount_per_page(20);
|
||||
if(search.getCount_per_list()==0) {
|
||||
commonForm.setCount_per_list(10);
|
||||
} else {
|
||||
commonForm.setCount_per_list(search.getCount_per_list());
|
||||
}
|
||||
commonForm.setTatal_list_count(totalCount);
|
||||
pageVo = PagingUtil.setPageUtil(commonForm);
|
||||
search.setLimit(pageVo.getLimit());
|
||||
search.setOffset(pageVo.getOffset());
|
||||
search.setTatal_list_count(totalCount);
|
||||
|
||||
apiResponse.put("pageInfo", pageVo);
|
||||
|
||||
}
|
||||
|
||||
log.info("[REQUEST: "+request.getRequestURI()+"] " + search);
|
||||
|
||||
List<HashMap> list = reportService.getReportMemwlList(search);
|
||||
apiResponse.put("list", list);
|
||||
|
||||
apiResponse.success();
|
||||
|
||||
} catch(ApiException e) {
|
||||
log.error(e.toString());
|
||||
apiResponse = e.getApiResponse();
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value={"/period"})
|
||||
public ApiResponse period(@RequestHeader String token, HttpServletRequest request, @Valid @RequestBody ReportSearch search) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
try {
|
||||
//Site site = getSiteByCheck(request);
|
||||
if(token==null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
if(search.getOldYn() == null || search.getOldYn().equals("")) {
|
||||
search.setOldYn("N");
|
||||
}
|
||||
|
||||
JwtManager.TokenInfo tokenInfo = jwtManager.getTokenInfo(token);
|
||||
|
||||
PageFormVO pageVo= new PageFormVO();
|
||||
if(search.getPage()==0)search.setPage(1);
|
||||
|
||||
search.setSiteId(tokenInfo.getSid());
|
||||
log.info("AdminApiReportController /period ReportSearch : " + search);
|
||||
|
||||
|
||||
HashMap cashInfo = reportService.getPeriodCash(search);
|
||||
|
||||
apiResponse.put("total_cashInAmt", cashInfo.get("total_cashInAmt"));
|
||||
apiResponse.put("total_cashOutAmt",cashInfo.get("total_cashOutAmt"));
|
||||
|
||||
apiResponse.put("total_cashManualAmt", cashInfo.get("total_cashManualAmt"));
|
||||
apiResponse.put("total_couponUseAmt", "0");
|
||||
apiResponse.put("total_couponAmt", "0");
|
||||
apiResponse.put("total_discrepancyAmt", "0");
|
||||
apiResponse.put("total_pointManualAmt", "0");
|
||||
|
||||
// total_bonusAmt_list
|
||||
|
||||
log.info("[REQUEST: "+request.getRequestURI()+"] " + search);
|
||||
|
||||
List<HashMap> rollPoint = reportService.getPeriodRollPoint(search);
|
||||
apiResponse.put("total_rollBonusAmt_list", rollPoint);
|
||||
|
||||
List<HashMap> wlAmt = reportService.getPeriodWlAmt(search);
|
||||
apiResponse.put("total_wlAmt_list", wlAmt);
|
||||
|
||||
|
||||
|
||||
apiResponse.success();
|
||||
|
||||
} catch(ApiException e) {
|
||||
log.error(e.toString());
|
||||
apiResponse = e.getApiResponse();
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value={"/gameType"})
|
||||
public ApiResponse gameType(@RequestHeader String token, HttpServletRequest request, @Valid @RequestBody ReportSearch search) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
try {
|
||||
//Site site = getSiteByCheck(request);
|
||||
if(token==null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
if(search.getOldYn() == null || search.getOldYn().equals("")) {
|
||||
search.setOldYn("N");
|
||||
}
|
||||
|
||||
JwtManager.TokenInfo tokenInfo = jwtManager.getTokenInfo(token);
|
||||
|
||||
PageFormVO pageVo= new PageFormVO();
|
||||
if(search.getPage()==0)search.setPage(1);
|
||||
search.setSiteId(tokenInfo.getSid());
|
||||
|
||||
|
||||
log.info("[REQUEST: "+request.getRequestURI()+"] " + search);
|
||||
List<HashMap> gameTypeList = reportService.getGameTypeList(search);
|
||||
apiResponse.put("list", gameTypeList);
|
||||
|
||||
apiResponse.success();
|
||||
} catch(ApiException e) {
|
||||
log.error(e.toString());
|
||||
apiResponse = e.getApiResponse();
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value={"/day"})
|
||||
public ApiResponse day(@RequestHeader String token, HttpServletRequest request, @RequestBody ReportSearch search) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
try {
|
||||
//Site site = getSiteByCheck(request);
|
||||
if(token==null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
JwtManager.TokenInfo tokenInfo = jwtManager.getTokenInfo(token);
|
||||
search.setSiteId(tokenInfo.getSid());
|
||||
|
||||
SiteSearch paramSite = new SiteSearch();
|
||||
paramSite.setSiteId(tokenInfo.getSid());
|
||||
SiteOption siteOption = commonService.getSiteSetting(paramSite);
|
||||
search.setBlankSpinSetType(siteOption.getBlankSpinSetType());
|
||||
|
||||
log.info("[REQUEST: "+request.getRequestURI()+"] " + search);
|
||||
|
||||
List<HashMap<String, String>> dayList = reportService.getDayList(search); // Use blankSpinSetType
|
||||
HashMap<String, String> dayTotal = reportService.getDayTotal(search); // Use blankSpinSetType
|
||||
|
||||
apiResponse.put("list", dayList);
|
||||
apiResponse.put("total", dayTotal);
|
||||
|
||||
apiResponse.success();
|
||||
} catch(ApiException e) {
|
||||
log.error(e.toString());
|
||||
apiResponse = e.getApiResponse();
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value={"/trade"})
|
||||
public ApiResponse trade(@RequestHeader String token, HttpServletRequest request, @Valid @RequestBody ReportSearch search) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
try {
|
||||
//Site site = getSiteByCheck(request);
|
||||
if(token==null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
if(search.getOldYn() == null || search.getOldYn().equals("")) {
|
||||
search.setOldYn("N");
|
||||
}
|
||||
|
||||
JwtManager.TokenInfo tokenInfo = jwtManager.getTokenInfo(token);
|
||||
|
||||
PageFormVO pageVo= new PageFormVO();
|
||||
if(search.getPage()==0)search.setPage(1);
|
||||
search.setSiteId(tokenInfo.getSid());
|
||||
log.info("AdminApiReportController /trade ReportSearch : " + search);
|
||||
|
||||
int totalCount = reportService.getReportTradeListCnt(search);
|
||||
if (totalCount != 0) {
|
||||
PageFormVO commonForm = new PageFormVO();
|
||||
commonForm.setFunction_name("goPage");
|
||||
commonForm.setPage(search.getPage());
|
||||
commonForm.setCount_per_page(20);
|
||||
if(search.getCount_per_list()==0) {
|
||||
commonForm.setCount_per_list(10);
|
||||
} else {
|
||||
commonForm.setCount_per_list(search.getCount_per_list());
|
||||
}
|
||||
commonForm.setTatal_list_count(totalCount);
|
||||
pageVo = PagingUtil.setPageUtil(commonForm);
|
||||
search.setLimit(pageVo.getLimit());
|
||||
search.setOffset(pageVo.getOffset());
|
||||
search.setTatal_list_count(totalCount);
|
||||
apiResponse.put("pageInfo", pageVo);
|
||||
}
|
||||
|
||||
log.info("[REQUEST: "+request.getRequestURI()+"] " + search);
|
||||
List<HashMap> list = reportService.getReportTradeList(search);
|
||||
apiResponse.put("list", list);
|
||||
apiResponse.success();
|
||||
} catch(ApiException e) {
|
||||
log.error(e.toString());
|
||||
apiResponse = e.getApiResponse();
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value={"/partner"})
|
||||
public ApiResponse partner(@RequestHeader String token, HttpServletRequest request, @Valid @RequestBody ReportSearch search) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
try {
|
||||
//Site site = getSiteByCheck(request);
|
||||
if(token==null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
JwtManager.TokenInfo tokenInfo = jwtManager.getTokenInfo(token);
|
||||
|
||||
PageFormVO pageVo= new PageFormVO();
|
||||
if(search.getPage()==0)search.setPage(1);
|
||||
|
||||
search.setSiteId(tokenInfo.getSid());
|
||||
log.info("AdminApiReportController /partner ReportSearch : " + search);
|
||||
|
||||
int totalCount = reportService.getReportPartnerListCnt(search);
|
||||
if (totalCount != 0) {
|
||||
PageFormVO commonForm = new PageFormVO();
|
||||
commonForm.setFunction_name("goPage");
|
||||
commonForm.setPage(search.getPage());
|
||||
commonForm.setCount_per_page(20);
|
||||
if(search.getCount_per_list()==0) {
|
||||
commonForm.setCount_per_list(10);
|
||||
}else {
|
||||
commonForm.setCount_per_list(search.getCount_per_list());
|
||||
}
|
||||
commonForm.setTatal_list_count(totalCount);
|
||||
pageVo = PagingUtil.setPageUtil(commonForm);
|
||||
search.setLimit(pageVo.getLimit());
|
||||
search.setOffset(pageVo.getOffset());
|
||||
search.setTatal_list_count(totalCount);
|
||||
|
||||
apiResponse.put("pageInfo", pageVo);
|
||||
|
||||
}
|
||||
|
||||
log.info("[REQUEST: "+request.getRequestURI()+"] " + search);
|
||||
List<HashMap> list = reportService.getReportPartnerList(search);
|
||||
apiResponse.put("list", list);
|
||||
|
||||
apiResponse.success();
|
||||
|
||||
} catch(ApiException e) {
|
||||
log.error(e.toString());
|
||||
apiResponse = e.getApiResponse();
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value={"/pay"})
|
||||
public ApiResponse pay(@RequestHeader String token, HttpServletRequest request, @Valid @RequestBody ReportSearch search) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
try {
|
||||
//Site site = getSiteByCheck(request);
|
||||
if(token==null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
JwtManager.TokenInfo tokenInfo = jwtManager.getTokenInfo(token);
|
||||
|
||||
PageFormVO pageVo= new PageFormVO();
|
||||
if(search.getPage()==0)search.setPage(1);
|
||||
|
||||
search.setSiteId(tokenInfo.getSid());
|
||||
log.info("AdminApiReportController /pay ReportSearch : " + search);
|
||||
|
||||
int totalCount = reportService.getReportPayListCnt(search);
|
||||
if (totalCount != 0) {
|
||||
PageFormVO commonForm = new PageFormVO();
|
||||
commonForm.setFunction_name("goPage");
|
||||
commonForm.setPage(search.getPage());
|
||||
commonForm.setCount_per_page(40);
|
||||
if(search.getCount_per_list()==0) {
|
||||
commonForm.setCount_per_list(10);
|
||||
}else {
|
||||
commonForm.setCount_per_list(search.getCount_per_list());
|
||||
}
|
||||
commonForm.setTatal_list_count(totalCount);
|
||||
pageVo = PagingUtil.setPageUtil(commonForm);
|
||||
search.setLimit(pageVo.getLimit());
|
||||
search.setOffset(pageVo.getOffset());
|
||||
search.setTatal_list_count(totalCount);
|
||||
|
||||
apiResponse.put("pageInfo", pageVo);
|
||||
|
||||
}
|
||||
|
||||
log.info("[REQUEST: "+request.getRequestURI()+"] " + search);
|
||||
List<HashMap> list = reportService.getReportPayList(search);
|
||||
apiResponse.put("list", list);
|
||||
|
||||
apiResponse.success();
|
||||
|
||||
} catch(ApiException e) {
|
||||
log.error(e.toString());
|
||||
apiResponse = e.getApiResponse();
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
}
|
||||
1790
src/main/java/com/bb/admin/controller/AdminApiRetailController.java
Normal file
1790
src/main/java/com/bb/admin/controller/AdminApiRetailController.java
Normal file
File diff suppressed because it is too large
Load Diff
1848
src/main/java/com/bb/admin/controller/AdminApiSettingController.java
Normal file
1848
src/main/java/com/bb/admin/controller/AdminApiSettingController.java
Normal file
File diff suppressed because it is too large
Load Diff
527
src/main/java/com/bb/admin/controller/AdminSuperController.java
Normal file
527
src/main/java/com/bb/admin/controller/AdminSuperController.java
Normal file
@@ -0,0 +1,527 @@
|
||||
package com.bb.admin.controller;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.crypto.password.PasswordEncoder;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestHeader;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.bb.exception.ApiException;
|
||||
import com.bb.jwt.JwtManager;
|
||||
import com.bb.model.ApiResponse;
|
||||
import com.bb.model.Member;
|
||||
import com.bb.model.MemberDetail;
|
||||
import com.bb.model.MemberInsert;
|
||||
import com.bb.model.MemberListSearch;
|
||||
import com.bb.model.MemberRate;
|
||||
import com.bb.model.PageFormVO;
|
||||
import com.bb.model.PartnerListVO;
|
||||
import com.bb.model.RetailSearch;
|
||||
import com.bb.service.CommonService;
|
||||
import com.bb.service.CompService;
|
||||
import com.bb.service.RetailService;
|
||||
import com.bb.service.SuperService;
|
||||
import com.bb.service.UserService;
|
||||
import com.bb.util.IPKit;
|
||||
import com.bb.util.PagingUtil;
|
||||
import com.bb.util.StringUtils;
|
||||
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@RestController
|
||||
@Slf4j
|
||||
@RequestMapping("/api/super")
|
||||
@RequiredArgsConstructor
|
||||
@SecurityRequirement(name = "Authorization")
|
||||
public class AdminSuperController {
|
||||
|
||||
private final SuperService superService;
|
||||
|
||||
private final JwtManager jwtManager;
|
||||
|
||||
private final CommonService commonService;
|
||||
|
||||
private final UserService userService;
|
||||
|
||||
private final CompService compService;
|
||||
|
||||
private final RetailService retailService;
|
||||
|
||||
private final PasswordEncoder passwordEncoder;
|
||||
|
||||
private final String ISSUER = "super.oms-admin.com";
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value = "/addCompany")
|
||||
public ApiResponse addCompany(@RequestHeader String token, HttpServletRequest request,
|
||||
@Valid @RequestBody MemberInsert signupMember) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
try {
|
||||
// Site site = getSiteByCheck(request);
|
||||
if (token == null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
JwtManager.TokenInfo tokenInfo = jwtManager.getTokenInfo(token);
|
||||
if (tokenInfo.getType() == null || tokenInfo.getType().equals("")) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
String createSiteId = signupMember.getMemId().replaceAll(" ", "").replaceAll(" ", "").toLowerCase();
|
||||
final String LOG_PREFIX = "#-admin::addCompany::" + createSiteId + "::::";
|
||||
|
||||
signupMember.setSiteId(createSiteId);
|
||||
signupMember.setMemId(createSiteId);
|
||||
signupMember.setAdminId(createSiteId);
|
||||
System.out.print(tokenInfo.getMid());
|
||||
System.out.print(signupMember.getMemId());
|
||||
signupMember.setMemLevel("99");
|
||||
signupMember.setPartnerLevel("COMP");
|
||||
signupMember.setMemStatus("1");
|
||||
signupMember.setRecommenderId("");
|
||||
signupMember.setPartnerType("senior");
|
||||
|
||||
String password = passwordEncoder.encode(signupMember.getMemPass());
|
||||
log.info("[MEMBER PWD:" + password + "]");
|
||||
signupMember.setMemPass(password);
|
||||
|
||||
Member checkMember = new Member();
|
||||
checkMember.setSiteId(signupMember.getMemId());
|
||||
checkMember.setMemId(signupMember.getMemId());
|
||||
checkMember.setRecommenderId(signupMember.getRecommenderId());
|
||||
/*
|
||||
* int idCheck = userService.idCheck(checkMember); if(idCheck>0) { throw new
|
||||
* ApiException("SC005", "idCheck"); }
|
||||
*/
|
||||
|
||||
int idCheckByAdmin = userService.idCheckByAdmin(checkMember);
|
||||
if (idCheckByAdmin > 0) {
|
||||
throw new ApiException("U005", "idCheckByAdmin");
|
||||
}
|
||||
|
||||
int nameCheck = userService.nameCheck(checkMember);
|
||||
if (nameCheck > 0) {
|
||||
throw new ApiException("SC006", "nameCheck");
|
||||
}
|
||||
|
||||
int adminCheck = userService.adminCheck(signupMember.getSiteId());
|
||||
if (nameCheck > 0) {
|
||||
throw new ApiException("SC007", "Super admin account duplication");
|
||||
}
|
||||
|
||||
log.info("##-SUPER addCompany() -## [REQUEST: " + request.getRequestURI() + "] " + signupMember);
|
||||
int result = userService.adminSignUp(LOG_PREFIX, signupMember, passwordEncoder);
|
||||
|
||||
try {
|
||||
HashMap<String, String> logParam = new HashMap<String, String>();
|
||||
logParam.put("siteId", tokenInfo.getMid());
|
||||
logParam.put("memId", tokenInfo.getMid());
|
||||
logParam.put("logType", "CREATE");
|
||||
logParam.put("logoutYn", "");
|
||||
logParam.put("logEndPoint", request.getRequestURI());
|
||||
logParam.put("logName", signupMember.getSiteId() + "::슈퍼관리자 업체 생성");
|
||||
logParam.put("logDesc", signupMember.toString());
|
||||
logParam.put("regId", tokenInfo.getMid());
|
||||
logParam.put("regIp", IPKit.getIpAddressByRequest(request));
|
||||
logParam.put("token", "");
|
||||
commonService.insertAdminlog(logParam);
|
||||
} catch (Exception e) {
|
||||
System.out.print(e.toString());
|
||||
}
|
||||
|
||||
Member search = new Member();
|
||||
search.setMemId(signupMember.getMemId());
|
||||
search.setSiteId(signupMember.getMemId());
|
||||
search.setPartnerLevel("COMP");
|
||||
|
||||
if (signupMember.getRateList() != null) {
|
||||
MemberRate rateparam = new MemberRate();
|
||||
rateparam.setMemId(signupMember.getMemId());
|
||||
rateparam.setRateList(signupMember.getRateList());
|
||||
|
||||
userService.getMemberRateUpdate(search, rateparam);
|
||||
userService.getMemberbetYnUpdate(search, rateparam);
|
||||
|
||||
try {
|
||||
HashMap<String, String> logParam = new HashMap<String, String>();
|
||||
logParam.put("siteId", tokenInfo.getMid());
|
||||
logParam.put("memId", tokenInfo.getMid());
|
||||
logParam.put("logType", "UPDATE");
|
||||
logParam.put("logoutYn", "");
|
||||
logParam.put("logEndPoint", request.getRequestURI());
|
||||
logParam.put("logName", signupMember.getSiteId() + "::슈퍼관리자 업체 생성 요율 세팅");
|
||||
logParam.put("logDesc", rateparam.toString());
|
||||
logParam.put("regId", tokenInfo.getMid());
|
||||
logParam.put("regIp", IPKit.getIpAddressByRequest(request));
|
||||
logParam.put("token", "");
|
||||
commonService.insertAdminlog(logParam);
|
||||
} catch (Exception e) {
|
||||
System.out.print(e.toString());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
apiResponse.success();
|
||||
|
||||
} catch (ApiException e) {
|
||||
log.debug(e.toString());
|
||||
apiResponse = e.getApiResponse();
|
||||
} catch (Exception e) {
|
||||
log.info(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value = "/updateRate")
|
||||
public ApiResponse updateRate(@RequestHeader String token, HttpServletRequest request,
|
||||
@Valid @RequestBody MemberRate memberRate) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
try {
|
||||
// System.out.println("ddd" + request.getAttribute("Authorization").toString());
|
||||
// Site site = getSiteByCheck(request);
|
||||
if (token == null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
JwtManager.TokenInfo tokenInfo = jwtManager.getTokenInfo(token);
|
||||
if (tokenInfo.getType() == null || tokenInfo.getType().equals("")) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
Member search = new Member();
|
||||
search.setMemId(memberRate.getMemId());
|
||||
search.setSiteId(memberRate.getSiteId());
|
||||
|
||||
MemberDetail member = userService.getMember(search);
|
||||
if (member == null) {
|
||||
throw new ApiException("U003", "unknown user");
|
||||
}
|
||||
|
||||
search.setPartnerLevel(member.getPartnerLevel());
|
||||
|
||||
userService.getMemberRateUpdate(search, memberRate);
|
||||
try {
|
||||
HashMap<String, String> logParam = new HashMap<String, String>();
|
||||
logParam.put("siteId", tokenInfo.getMid());
|
||||
logParam.put("memId", tokenInfo.getMid());
|
||||
logParam.put("logType", "UPDATE");
|
||||
logParam.put("logoutYn", "");
|
||||
logParam.put("logEndPoint", request.getRequestURI());
|
||||
logParam.put("logName", memberRate.getMemId() + "::슈퍼관리자 요율 변경");
|
||||
logParam.put("logDesc", memberRate.toString());
|
||||
logParam.put("regId", tokenInfo.getMid());
|
||||
logParam.put("regIp", IPKit.getIpAddressByRequest(request));
|
||||
logParam.put("token", "");
|
||||
commonService.insertAdminlog(logParam);
|
||||
} catch (Exception e) {
|
||||
System.out.print(e.toString());
|
||||
}
|
||||
|
||||
apiResponse.success();
|
||||
|
||||
} catch (ApiException e) {
|
||||
log.debug(e.toString());
|
||||
apiResponse = e.getApiResponse();
|
||||
} catch (Exception e) {
|
||||
log.info(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value = "/addUser")
|
||||
public ApiResponse addUser(@RequestHeader String token, HttpServletRequest request,
|
||||
@Valid @RequestBody MemberInsert signupMember) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
String LOG_PREFIX = "#-super::join::";
|
||||
|
||||
try {
|
||||
// Site site = getSiteByCheck(request);
|
||||
if (token == null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
JwtManager.TokenInfo tokenInfo = jwtManager.getTokenInfo(token);
|
||||
if (tokenInfo.getType() == null || tokenInfo.getType().equals("")) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
LOG_PREFIX = LOG_PREFIX + signupMember.getSiteId() + "::" + signupMember.getMemId() + "::::";
|
||||
|
||||
signupMember.setPartnerType("");
|
||||
signupMember.setMemStatus("1");
|
||||
|
||||
String password = passwordEncoder.encode(signupMember.getMemPass());
|
||||
log.info("[MEMBER PWD:" + password + "]");
|
||||
signupMember.setMemPass(password);
|
||||
|
||||
signupMember.setPartnerLevel("NORMAL");
|
||||
|
||||
signupMember.setRecommendYn("N");
|
||||
signupMember.setPointExchangeYn("Y");
|
||||
signupMember.setRollingYn("Y");
|
||||
signupMember.setCashSendYn("N");
|
||||
signupMember.setCashReceiveYn("N");
|
||||
|
||||
signupMember.setNationCode("");
|
||||
signupMember.setPartSendYn("N");
|
||||
signupMember.setMaxCredit("");
|
||||
signupMember.setCreditRate("");
|
||||
signupMember.setCreditStatus("");
|
||||
|
||||
if (signupMember.getRecommenderId() == null || signupMember.getRecommenderId().equals("")) {
|
||||
throw new ApiException("U097", "추천인 계정을 입력해주세요.");
|
||||
}
|
||||
|
||||
String refer = request.getHeader("Referer");
|
||||
String domain = "unknown";
|
||||
if (refer != null) {
|
||||
String[] urls = StringUtils.extractUrlParts(refer);
|
||||
domain = urls[2];
|
||||
log.info(LOG_PREFIX + "::domain::" + domain + "::recommandId::" + signupMember.getRecommenderId());
|
||||
}
|
||||
signupMember.setJoinDomain(domain);
|
||||
|
||||
Member recommendUser = new Member();
|
||||
recommendUser.setSiteId(signupMember.getSiteId());
|
||||
recommendUser.setMemId(signupMember.getRecommenderId());
|
||||
MemberDetail partner = userService.getMember(recommendUser);
|
||||
|
||||
if (partner == null) {
|
||||
throw new ApiException("U096", "존재하지 않는 추천인 계정입니다.");
|
||||
}
|
||||
|
||||
if (partner.getPartnerLevel().equals("COMP") || partner.getPartnerLevel().equals("AUTO")
|
||||
|| partner.getPartnerLevel().equals("NORMAL")) {
|
||||
throw new ApiException("U099", "추천인으로 사용할 수 없는 계정입니다.");
|
||||
}
|
||||
|
||||
if (partner.getRecommendYn().equals("N")) {
|
||||
throw new ApiException("U099", "추천인으로 사용할 수 없는 계정입니다.");
|
||||
}
|
||||
|
||||
if (!partner.getMemStatus().equals("1")) {
|
||||
throw new ApiException("U114", "추천인으로 사용할 수 없는 계정입니다.");
|
||||
}
|
||||
|
||||
Member checkMember = new Member();
|
||||
checkMember.setSiteId(signupMember.getSiteId());
|
||||
checkMember.setMemId(signupMember.getMemId());
|
||||
checkMember.setRecommenderId(signupMember.getRecommenderId());
|
||||
checkMember.setMemName(signupMember.getMemName());
|
||||
checkMember.setMemNick(signupMember.getMemNick());
|
||||
|
||||
int idCheck = userService.idCheck(checkMember);
|
||||
if (idCheck > 0) {
|
||||
throw new ApiException("U005", "idCheck");
|
||||
}
|
||||
/*
|
||||
* int idCheckByAdmin =userService.idCheckByAdmin(checkMember);
|
||||
* if(idCheckByAdmin>0) { throw new ApiException("U005", "idCheckByAdmin"); }
|
||||
*/
|
||||
int nameCheck = userService.nameCheck(checkMember);
|
||||
if (nameCheck > 0) {
|
||||
throw new ApiException("U006", "nameCheck");
|
||||
}
|
||||
|
||||
if (signupMember.getSiteId().equals(signupMember.getRecommenderId())) {
|
||||
throw new ApiException("U099", "recommenderIdCheck");
|
||||
}
|
||||
|
||||
log.info("Insert Member:" + signupMember);
|
||||
userService.adminJoin(signupMember);
|
||||
|
||||
try {
|
||||
HashMap<String, String> logParam = new HashMap<String, String>();
|
||||
logParam.put("siteId", tokenInfo.getMid());
|
||||
logParam.put("memId", tokenInfo.getMid());
|
||||
logParam.put("logType", "CREATE");
|
||||
logParam.put("logoutYn", "");
|
||||
logParam.put("logEndPoint", request.getRequestURI());
|
||||
logParam.put("logName", signupMember.getMemId() + "::슈퍼관리자 회원 생성");
|
||||
logParam.put("logDesc", signupMember.toString());
|
||||
logParam.put("regId", tokenInfo.getMid());
|
||||
logParam.put("regIp", IPKit.getIpAddressByRequest(request));
|
||||
logParam.put("token", "");
|
||||
commonService.insertAdminlog(logParam);
|
||||
} catch (Exception e) {
|
||||
System.out.print(e.toString());
|
||||
}
|
||||
|
||||
Member search = new Member();
|
||||
search.setSiteId(signupMember.getSiteId());
|
||||
search.setMemId(signupMember.getMemId());
|
||||
search.setPartnerLevel("NORMAL");
|
||||
|
||||
try {
|
||||
if (signupMember.getRateList() != null) {
|
||||
MemberRate rateparam = new MemberRate();
|
||||
rateparam.setMemId(signupMember.getMemId());
|
||||
rateparam.setRateList(signupMember.getRateList());
|
||||
|
||||
userService.getMemberRateUpdate(search, rateparam);
|
||||
try {
|
||||
HashMap<String, String> logParam = new HashMap<String, String>();
|
||||
logParam.put("siteId", tokenInfo.getMid());
|
||||
logParam.put("memId", tokenInfo.getMid());
|
||||
logParam.put("logType", "UPDATE");
|
||||
logParam.put("logoutYn", "");
|
||||
logParam.put("logEndPoint", request.getRequestURI());
|
||||
logParam.put("logName", signupMember.getMemId() + "::슈퍼관리자 회원 생성 요율 세팅");
|
||||
logParam.put("logDesc", rateparam.toString());
|
||||
logParam.put("regId", tokenInfo.getMid());
|
||||
logParam.put("regIp", IPKit.getIpAddressByRequest(request));
|
||||
logParam.put("token", "");
|
||||
commonService.insertAdminlog(logParam);
|
||||
} catch (Exception e) {
|
||||
System.out.print(e.toString());
|
||||
}
|
||||
}
|
||||
|
||||
} catch (Exception eee) {
|
||||
}
|
||||
|
||||
apiResponse.success();
|
||||
} catch (ApiException e) {
|
||||
log.debug(e.toString());
|
||||
apiResponse = e.getApiResponse();
|
||||
} catch (Exception e) {
|
||||
log.info(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value = { "/memberList" })
|
||||
public ApiResponse memberList(@RequestHeader String token, HttpServletRequest request,
|
||||
@Valid @RequestBody MemberListSearch search) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
try {
|
||||
// Site site = getSiteByCheck(request);
|
||||
if (token == null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
JwtManager.TokenInfo tokenInfo = jwtManager.getTokenInfo(token);
|
||||
|
||||
PageFormVO pageVo = new PageFormVO();
|
||||
if (search.getPage() == 0)
|
||||
search.setPage(1);
|
||||
search.setPartnerType("");
|
||||
search.setSiteId(search.getSiteId());
|
||||
HashMap totalInfo = userService.getMemberListCnt(search);
|
||||
|
||||
int totalCount = Integer.parseInt(totalInfo.get("totalCnt").toString());
|
||||
if (totalCount != 0) {
|
||||
PageFormVO commonForm = new PageFormVO();
|
||||
commonForm.setFunction_name("goPage");
|
||||
commonForm.setPage(search.getPage());
|
||||
commonForm.setCount_per_page(20);
|
||||
if (search.getCount_per_list() == 0) {
|
||||
commonForm.setCount_per_list(10);
|
||||
} else {
|
||||
commonForm.setCount_per_list(search.getCount_per_list());
|
||||
}
|
||||
commonForm.setTatal_list_count(totalCount);
|
||||
pageVo = PagingUtil.setPageUtil(commonForm);
|
||||
search.setLimit(pageVo.getLimit());
|
||||
search.setOffset(pageVo.getOffset());
|
||||
search.setTatal_list_count(totalCount);
|
||||
|
||||
apiResponse.put("pageInfo", pageVo);
|
||||
|
||||
}
|
||||
System.out.println(search.getLimit());
|
||||
System.out.println(search.getOffset());
|
||||
List<HashMap> memList = userService.getMemberList(search);
|
||||
apiResponse.put("list", memList);
|
||||
apiResponse.put("totalInfo", totalInfo);
|
||||
apiResponse.success();
|
||||
|
||||
} catch (ApiException e) {
|
||||
log.debug(e.toString());
|
||||
apiResponse = e.getApiResponse();
|
||||
} catch (Exception e) {
|
||||
log.info(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value = { "/retailList" })
|
||||
public ApiResponse retailList(@RequestHeader String token, HttpServletRequest request,
|
||||
@Valid @RequestBody RetailSearch search) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
try {
|
||||
// Site site = getSiteByCheck(request);
|
||||
if (token == null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
JwtManager.TokenInfo tokenInfo = jwtManager.getTokenInfo(token);
|
||||
|
||||
PageFormVO pageVo = new PageFormVO();
|
||||
if (search.getPage() == 0)
|
||||
search.setPage(1);
|
||||
|
||||
search.setSiteId(search.getSiteId());
|
||||
|
||||
int totalCount = retailService.getRetailListCnt2(search);
|
||||
if (totalCount != 0) {
|
||||
PageFormVO commonForm = new PageFormVO();
|
||||
commonForm.setFunction_name("goPage");
|
||||
commonForm.setPage(search.getPage());
|
||||
commonForm.setCount_per_page(20);
|
||||
if (search.getCount_per_list() == 0) {
|
||||
commonForm.setCount_per_list(10);
|
||||
} else {
|
||||
commonForm.setCount_per_list(search.getCount_per_list());
|
||||
}
|
||||
commonForm.setTatal_list_count(totalCount);
|
||||
pageVo = PagingUtil.setPageUtil(commonForm);
|
||||
search.setLimit(pageVo.getLimit());
|
||||
search.setOffset(pageVo.getOffset());
|
||||
search.setTatal_list_count(totalCount);
|
||||
apiResponse.put("pageInfo", pageVo);
|
||||
}
|
||||
|
||||
List<PartnerListVO> list = retailService.getRetailList2(search);
|
||||
apiResponse.put("list", list);
|
||||
apiResponse.success();
|
||||
|
||||
} catch (ApiException e) {
|
||||
log.debug(e.toString());
|
||||
apiResponse = e.getApiResponse();
|
||||
} catch (Exception e) {
|
||||
log.info(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,996 @@
|
||||
package com.bb.admintop.controller;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.security.crypto.password.PasswordEncoder;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestHeader;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.bb.exception.ApiException;
|
||||
import com.bb.jwt.JwtManager;
|
||||
import com.bb.model.ApiResponse;
|
||||
import com.bb.model.CodeSearch;
|
||||
import com.bb.model.CompResetInfo;
|
||||
import com.bb.model.Member;
|
||||
import com.bb.model.MemberInsert;
|
||||
import com.bb.model.MemberListSearch;
|
||||
import com.bb.model.MemberRate;
|
||||
import com.bb.model.MenuVO;
|
||||
import com.bb.model.PageFormVO;
|
||||
import com.bb.model.PartnerCompInfo;
|
||||
import com.bb.model.SiteSearch;
|
||||
import com.bb.service.CommonService;
|
||||
import com.bb.service.CompService;
|
||||
import com.bb.service.SuperService;
|
||||
import com.bb.service.UserService;
|
||||
import com.bb.util.IPKit;
|
||||
import com.bb.util.PagingUtil;
|
||||
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.validation.Valid;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@RestController
|
||||
@Slf4j
|
||||
@RequestMapping("/api/super/company")
|
||||
@RequiredArgsConstructor
|
||||
@SecurityRequirement(name = "Authorization")
|
||||
public class SuperApiCompController {
|
||||
|
||||
private final SuperService superService;
|
||||
|
||||
private final JwtManager jwtManager;
|
||||
|
||||
private final CommonService commonService;
|
||||
|
||||
private final UserService userService;
|
||||
|
||||
private final CompService compService;
|
||||
|
||||
private final PasswordEncoder passwordEncoder;
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value = "/addCompany")
|
||||
public ApiResponse addCompany(@RequestHeader String token, HttpServletRequest request,
|
||||
@Valid @RequestBody MemberInsert signupMember) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
try {
|
||||
// Site site = getSiteByCheck(request);
|
||||
if (token == null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
JwtManager.TokenInfo tokenInfo = jwtManager.getTokenInfo(token);
|
||||
if (tokenInfo.getType() == null || !tokenInfo.getType().equals("super")) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
String createSiteId = signupMember.getMemId().replaceAll(" ", "").replaceAll(" ", "").toLowerCase();
|
||||
final String LOG_PREFIX = "#-super::addCompany::" + createSiteId + "::::";
|
||||
|
||||
signupMember.setMemId(createSiteId);
|
||||
signupMember.setSiteId(createSiteId);
|
||||
signupMember.setAdminId(createSiteId);
|
||||
signupMember.setMemLevel("99");
|
||||
signupMember.setPartnerLevel("COMP");
|
||||
signupMember.setMemStatus("1");
|
||||
signupMember.setRecommenderId("");
|
||||
signupMember.setPartnerType("senior");
|
||||
|
||||
String password = passwordEncoder.encode(signupMember.getMemPass());
|
||||
log.info(LOG_PREFIX + "[MEMBER PWD:" + password + "]");
|
||||
signupMember.setMemPass(password);
|
||||
|
||||
Member checkMember = new Member();
|
||||
checkMember.setSiteId(signupMember.getMemId());
|
||||
checkMember.setMemId(signupMember.getMemId());
|
||||
checkMember.setRecommenderId(signupMember.getRecommenderId());
|
||||
|
||||
/*
|
||||
* int idCheck = userService.idCheck(checkMember); if(idCheck>0) { throw new
|
||||
* ApiException("SC005", "idCheck"); }
|
||||
*/
|
||||
|
||||
int idCheckByAdmin = userService.idCheckByAdmin(checkMember);
|
||||
if (idCheckByAdmin > 0) {
|
||||
log.error(LOG_PREFIX + "idCheckByAdmin");
|
||||
throw new ApiException("U005", "idCheckByAdmin");
|
||||
}
|
||||
|
||||
int nameCheck = userService.nameCheck(checkMember);
|
||||
if (nameCheck > 0) {
|
||||
log.error(LOG_PREFIX + "nameCheck");
|
||||
throw new ApiException("SC006", "nameCheck");
|
||||
}
|
||||
|
||||
int adminCheck = userService.adminCheck(signupMember.getSiteId());
|
||||
if (nameCheck > 0) {
|
||||
log.error(LOG_PREFIX + "Super admin account duplication");
|
||||
throw new ApiException("SC007", "Super admin account duplication");
|
||||
}
|
||||
|
||||
log.info(LOG_PREFIX + "Company::" + signupMember);
|
||||
int result = userService.adminSignUp(LOG_PREFIX, signupMember, passwordEncoder);
|
||||
log.info(LOG_PREFIX + "adminSignUp result::" + result);
|
||||
if (result == 0) {
|
||||
log.error(LOG_PREFIX + "site prefix check");
|
||||
throw new ApiException("SP99", "site prefix check");
|
||||
}
|
||||
|
||||
try {
|
||||
HashMap<String, String> logParam = new HashMap<String, String>();
|
||||
logParam.put("siteId", tokenInfo.getMid());
|
||||
logParam.put("memId", tokenInfo.getMid());
|
||||
logParam.put("logType", "save");
|
||||
logParam.put("logoutYn", "");
|
||||
logParam.put("logEndPoint", request.getRequestURI());
|
||||
logParam.put("logName", "SuperApiCompController.addCompany() => UserService.adminSignUp()");
|
||||
logParam.put("logDesc", signupMember.toString());
|
||||
logParam.put("regId", tokenInfo.getMid());
|
||||
logParam.put("regIp", IPKit.getIpAddressByRequest(request));
|
||||
logParam.put("token", "");
|
||||
commonService.insertAdminlog(logParam);
|
||||
} catch (Exception e) {
|
||||
log.error(LOG_PREFIX + "insertAdminlog Exception::" + e.toString());
|
||||
}
|
||||
|
||||
Member search = new Member();
|
||||
search.setMemId(signupMember.getMemId());
|
||||
search.setSiteId(signupMember.getMemId());
|
||||
search.setPartnerLevel("COMP");
|
||||
|
||||
if (signupMember.getRateList() != null) {
|
||||
log.info(LOG_PREFIX + "RateList::" + signupMember.getRateList());
|
||||
MemberRate rateparam = new MemberRate();
|
||||
rateparam.setMemId(signupMember.getMemId());
|
||||
rateparam.setRateList(signupMember.getRateList());
|
||||
|
||||
userService.getMemberRateUpdate(search, rateparam);
|
||||
log.info(LOG_PREFIX + "getMemberRateUpdate::End");
|
||||
try {
|
||||
HashMap<String, String> logParam = new HashMap<String, String>();
|
||||
logParam.put("siteId", tokenInfo.getMid());
|
||||
logParam.put("memId", tokenInfo.getMid());
|
||||
logParam.put("logType", "save");
|
||||
logParam.put("logoutYn", "");
|
||||
logParam.put("logEndPoint", request.getRequestURI());
|
||||
logParam.put("logName", "SuperApiCompController.addCompany() => UserService.getMemberRateUpdate()");
|
||||
logParam.put("logDesc", rateparam.toString());
|
||||
logParam.put("regId", tokenInfo.getMid());
|
||||
logParam.put("regIp", IPKit.getIpAddressByRequest(request));
|
||||
logParam.put("token", "");
|
||||
commonService.insertAdminlog(logParam);
|
||||
} catch (Exception e) {
|
||||
log.error(LOG_PREFIX + "insertAdminlog Exception::" + e.toString());
|
||||
}
|
||||
|
||||
userService.getMemberbetYnUpdate(search, rateparam);
|
||||
log.info(LOG_PREFIX + "getMemberbetYnUpdate::End");
|
||||
try {
|
||||
HashMap<String, String> logParam = new HashMap<String, String>();
|
||||
logParam.put("siteId", tokenInfo.getMid());
|
||||
logParam.put("memId", tokenInfo.getMid());
|
||||
logParam.put("logType", "save");
|
||||
logParam.put("logoutYn", "");
|
||||
logParam.put("logEndPoint", request.getRequestURI());
|
||||
logParam.put("logName",
|
||||
"SuperApiCompController.addCompany() => UserService.getMemberbetYnUpdate()");
|
||||
logParam.put("logDesc", rateparam.toString());
|
||||
logParam.put("regId", tokenInfo.getMid());
|
||||
logParam.put("regIp", IPKit.getIpAddressByRequest(request));
|
||||
logParam.put("token", "");
|
||||
commonService.insertAdminlog(logParam);
|
||||
} catch (Exception e) {
|
||||
log.error(LOG_PREFIX + "insertAdminlog Exception::" + e.toString());
|
||||
}
|
||||
}
|
||||
|
||||
apiResponse.success();
|
||||
|
||||
} catch (ApiException e) {
|
||||
log.debug(e.toString());
|
||||
apiResponse = e.getApiResponse();
|
||||
} catch (Exception e) {
|
||||
log.info(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value = "/detail")
|
||||
public ApiResponse detail(@RequestHeader String token, HttpServletRequest request, @RequestBody SiteSearch search)
|
||||
throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
try {
|
||||
// Site site = getSiteByCheck(request);
|
||||
if (token == null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
log.info("[REQUEST: " + request.getRequestURI() + "] " + search);
|
||||
|
||||
HashMap compInfo = compService.getCompInfoForDetail(search);
|
||||
HashMap settingInfo = compService.getSettingInfoForDetail(search);
|
||||
HashMap compStats = compService.getCompStatsForDetail(search);
|
||||
List<HashMap> topCompList = compService.getTopCompListForDetail(search);
|
||||
List<HashMap> botCompList = compService.getBotCompListForDetail(search);
|
||||
CodeSearch codesSearch = new CodeSearch();
|
||||
codesSearch.setSiteId(search.getSiteId());
|
||||
List<HashMap> gameList = commonService.getGameCodesForSuper(codesSearch);
|
||||
HashMap<String, String> param = new HashMap<>();
|
||||
param.put("siteId", search.getSiteId());
|
||||
param.put("isSuper", "N");
|
||||
List<MenuVO> menuList = commonService.getMenuList(param);
|
||||
|
||||
codesSearch.setMasterCode("vendorComp");
|
||||
List<HashMap> vendorCompList = commonService.getCodeList(codesSearch);
|
||||
|
||||
apiResponse.put("topCompId", compInfo.get("topCompId"));
|
||||
apiResponse.put("compInfo", compInfo);
|
||||
apiResponse.put("settingInfo", settingInfo);
|
||||
apiResponse.put("compStats", compStats);
|
||||
apiResponse.put("topCompList", topCompList);
|
||||
apiResponse.put("botCompList", botCompList);
|
||||
apiResponse.put("gameList", gameList);
|
||||
apiResponse.put("menuList", menuList);
|
||||
apiResponse.put("vendorCompList", vendorCompList);
|
||||
apiResponse.success();
|
||||
|
||||
} catch (ApiException e) {
|
||||
log.debug(e.toString());
|
||||
apiResponse = e.getApiResponse();
|
||||
} catch (Exception e) {
|
||||
log.info(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value = "/modify/compInfo")
|
||||
public ApiResponse modifyCompInfo(@RequestHeader String token, HttpServletRequest request,
|
||||
@RequestBody PartnerCompInfo compInfo) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
try {
|
||||
// Site site = getSiteByCheck(request);
|
||||
if (token == null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
JwtManager.TokenInfo tokenInfo = jwtManager.getTokenInfo(token);
|
||||
if (tokenInfo.getType() == null || !tokenInfo.getType().equals("super")) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
if (compInfo.getTopCompId() == null) {
|
||||
throw new ApiException("SC999", "상위 컴퍼니 아이디 누락");
|
||||
}
|
||||
|
||||
if (compInfo.getPassword() != null && !compInfo.getPassword().equals("")) {
|
||||
String password = passwordEncoder.encode(compInfo.getPassword());
|
||||
log.info("[ADMIN PWD:" + password + "]");
|
||||
compInfo.setPassword(password);
|
||||
}
|
||||
|
||||
if (compInfo.getSiteDomain() == null) {
|
||||
compInfo.setSiteDomain("");
|
||||
}
|
||||
|
||||
log.info("[REQUEST: " + request.getRequestURI() + "] " + compInfo);
|
||||
int result = compService.modifyCompInfo(compInfo);
|
||||
|
||||
try {
|
||||
HashMap<String, String> logParam = new HashMap<String, String>();
|
||||
logParam.put("siteId", tokenInfo.getMid());
|
||||
logParam.put("memId", tokenInfo.getMid());
|
||||
logParam.put("regId", tokenInfo.getMid());
|
||||
logParam.put("logType", "modify");
|
||||
logParam.put("logoutYn", "");
|
||||
logParam.put("logEndPoint", request.getRequestURI());
|
||||
logParam.put("logName", "SuperApiCompController.modifyCompInfo() => CompService.modifyCompInfo()");
|
||||
logParam.put("logDesc", compInfo.toString());
|
||||
|
||||
logParam.put("regIp", IPKit.getIpAddressByRequest(request));
|
||||
logParam.put("token", "");
|
||||
commonService.insertAdminlog(logParam);
|
||||
} catch (Exception e) {
|
||||
System.out.print(e.toString());
|
||||
}
|
||||
|
||||
if (result > 0) {
|
||||
apiResponse.success();
|
||||
} else {
|
||||
throw new ApiException("COMP009", "회사정보 설정에 문제가 발생하였습니다. 관리자에게 문의하세요.");
|
||||
}
|
||||
|
||||
apiResponse.success();
|
||||
} catch (ApiException e) {
|
||||
log.error(e.toString());
|
||||
apiResponse = e.getApiResponse();
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value = "/modify/apiSetting")
|
||||
public ApiResponse updateApiSetting(@RequestHeader String token, HttpServletRequest request,
|
||||
@RequestBody PartnerCompInfo compInfo) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
try {
|
||||
// Site site = getSiteByCheck(request);
|
||||
if (token == null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
JwtManager.TokenInfo tokenInfo = jwtManager.getTokenInfo(token);
|
||||
if (tokenInfo.getType() == null || !tokenInfo.getType().equals("super")) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
if (compInfo.getSiteId() == null || compInfo.getSiteId().equals("")) {
|
||||
throw new ApiException("SS99", "Not Found siteId");
|
||||
}
|
||||
|
||||
log.info("[REQUEST: " + request.getRequestURI() + "] " + compInfo);
|
||||
int result = compService.updateApiSetting(compInfo);
|
||||
|
||||
try {
|
||||
HashMap<String, String> logParam = new HashMap<String, String>();
|
||||
logParam.put("siteId", tokenInfo.getMid());
|
||||
logParam.put("memId", tokenInfo.getMid());
|
||||
logParam.put("regId", tokenInfo.getMid());
|
||||
logParam.put("logType", "modify");
|
||||
logParam.put("logoutYn", "");
|
||||
logParam.put("logEndPoint", request.getRequestURI());
|
||||
logParam.put("logName", "SuperApiCompController.updateApiSetting() => CompService.updateApiSetting()");
|
||||
logParam.put("logDesc", compInfo.toString());
|
||||
|
||||
logParam.put("regIp", IPKit.getIpAddressByRequest(request));
|
||||
logParam.put("token", "");
|
||||
commonService.insertAdminlog(logParam);
|
||||
} catch (Exception e) {
|
||||
System.out.print(e.toString());
|
||||
}
|
||||
|
||||
if (result > 0) {
|
||||
apiResponse.success();
|
||||
} else {
|
||||
throw new ApiException("COMP009", "회사정보 설정에 문제가 발생하였습니다. 관리자에게 문의하세요.");
|
||||
}
|
||||
|
||||
apiResponse.success();
|
||||
} catch (ApiException e) {
|
||||
log.debug(e.toString());
|
||||
apiResponse = e.getApiResponse();
|
||||
} catch (Exception e) {
|
||||
log.info(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value = "/modify/siteSettings")
|
||||
public ApiResponse modifySiteSettings(@RequestHeader String token, HttpServletRequest request,
|
||||
@RequestBody PartnerCompInfo compInfo) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
try {
|
||||
// Site site = getSiteByCheck(request);
|
||||
if (token == null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
JwtManager.TokenInfo tokenInfo = jwtManager.getTokenInfo(token);
|
||||
if (tokenInfo.getType() == null || !tokenInfo.getType().equals("super")) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
if (compInfo.getTopCompId() == null) {
|
||||
throw new ApiException("SC999", "상위 컴퍼니 아이디 누락");
|
||||
}
|
||||
|
||||
log.info("[REQUEST: " + request.getRequestURI() + "] " + compInfo);
|
||||
int result = compService.modifySiteSettings(compInfo);
|
||||
|
||||
try {
|
||||
HashMap<String, String> logParam = new HashMap<String, String>();
|
||||
logParam.put("siteId", tokenInfo.getMid());
|
||||
logParam.put("memId", tokenInfo.getMid());
|
||||
logParam.put("regId", tokenInfo.getMid());
|
||||
logParam.put("logType", "modify");
|
||||
logParam.put("logoutYn", "");
|
||||
logParam.put("logEndPoint", request.getRequestURI());
|
||||
logParam.put("logName",
|
||||
"SuperApiCompController.modifySiteSettings() => CompService.modifySiteSettings()");
|
||||
logParam.put("logDesc", compInfo.toString());
|
||||
|
||||
logParam.put("regIp", IPKit.getIpAddressByRequest(request));
|
||||
logParam.put("token", "");
|
||||
commonService.insertAdminlog(logParam);
|
||||
} catch (Exception e) {
|
||||
System.out.print(e.toString());
|
||||
}
|
||||
|
||||
if (result > 0) {
|
||||
apiResponse.success();
|
||||
} else {
|
||||
throw new ApiException("COMP009", "사이트 기능 설정에 문제가 발생하였습니다. 관리자에게 문의하세요.");
|
||||
}
|
||||
|
||||
} catch (ApiException e) {
|
||||
log.debug(e.toString());
|
||||
apiResponse = e.getApiResponse();
|
||||
} catch (Exception e) {
|
||||
log.info(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value = "/modify/creditSettings")
|
||||
public ApiResponse modifyCreditSettings(@RequestHeader String token, HttpServletRequest request,
|
||||
@RequestBody PartnerCompInfo compInfo) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
try {
|
||||
// Site site = getSiteByCheck(request);
|
||||
if (token == null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
JwtManager.TokenInfo tokenInfo = jwtManager.getTokenInfo(token);
|
||||
if (tokenInfo.getType() == null || !tokenInfo.getType().equals("super")) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
if (compInfo.getTopCompId() == null) {
|
||||
throw new ApiException("SC999", "상위 컴퍼니 아이디 누락");
|
||||
}
|
||||
|
||||
log.info("[REQUEST: " + request.getRequestURI() + "] " + compInfo);
|
||||
int result = compService.modifyCreditSettings(compInfo);
|
||||
|
||||
try {
|
||||
HashMap<String, String> logParam = new HashMap<String, String>();
|
||||
logParam.put("siteId", tokenInfo.getMid());
|
||||
logParam.put("memId", tokenInfo.getMid());
|
||||
logParam.put("regId", tokenInfo.getMid());
|
||||
logParam.put("logType", "modify");
|
||||
logParam.put("logoutYn", "");
|
||||
logParam.put("logEndPoint", request.getRequestURI());
|
||||
logParam.put("logName",
|
||||
"SuperApiCompController.modifyCreditSettings() => CompService.modifyCreditSettings()");
|
||||
logParam.put("logDesc", compInfo.toString());
|
||||
|
||||
logParam.put("regIp", IPKit.getIpAddressByRequest(request));
|
||||
logParam.put("token", "");
|
||||
commonService.insertAdminlog(logParam);
|
||||
} catch (Exception e) {
|
||||
System.out.print(e.toString());
|
||||
}
|
||||
|
||||
if (result > 0) {
|
||||
apiResponse.success();
|
||||
} else {
|
||||
throw new ApiException("COMP009", "PT 설정에 문제가 발생하였습니다. 관리자에게 문의하세요.");
|
||||
}
|
||||
|
||||
} catch (ApiException e) {
|
||||
log.debug(e.toString());
|
||||
apiResponse = e.getApiResponse();
|
||||
} catch (Exception e) {
|
||||
log.info(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value = "/modify/creditRates")
|
||||
public ApiResponse modifyCompCreditRates(@RequestHeader String token, HttpServletRequest request,
|
||||
@RequestBody PartnerCompInfo compInfo) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
try {
|
||||
// Site site = getSiteByCheck(request);
|
||||
if (token == null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
JwtManager.TokenInfo tokenInfo = jwtManager.getTokenInfo(token);
|
||||
if (tokenInfo.getType() == null || !tokenInfo.getType().equals("super")) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
if (compInfo.getTopCompId() == null) {
|
||||
throw new ApiException("SC999", "상위 컴퍼니 아이디 누락");
|
||||
}
|
||||
|
||||
log.info("[REQUEST: " + request.getRequestURI() + "] " + compInfo);
|
||||
int result = compService.modifyCompCreditRates(compInfo);
|
||||
|
||||
try {
|
||||
HashMap<String, String> logParam = new HashMap<String, String>();
|
||||
logParam.put("siteId", tokenInfo.getMid());
|
||||
logParam.put("memId", tokenInfo.getMid());
|
||||
logParam.put("regId", tokenInfo.getMid());
|
||||
logParam.put("logType", "modify");
|
||||
logParam.put("logoutYn", "");
|
||||
logParam.put("logEndPoint", request.getRequestURI());
|
||||
logParam.put("logName",
|
||||
"SuperApiCompController.modifyCompCreditRates() => CompService.modifyCompCreditRates()");
|
||||
logParam.put("logDesc", compInfo.toString());
|
||||
|
||||
logParam.put("regIp", IPKit.getIpAddressByRequest(request));
|
||||
logParam.put("token", "");
|
||||
commonService.insertAdminlog(logParam);
|
||||
} catch (Exception e) {
|
||||
System.out.print(e.toString());
|
||||
}
|
||||
|
||||
if (result > 0) {
|
||||
apiResponse.success();
|
||||
} else {
|
||||
throw new ApiException("COMP009", "게임별 PT수수료율 설정에 문제가 발생하였습니다. 관리자에게 문의하세요.");
|
||||
}
|
||||
|
||||
} catch (ApiException e) {
|
||||
log.debug(e.toString());
|
||||
apiResponse = e.getApiResponse();
|
||||
} catch (Exception e) {
|
||||
log.info(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value = "/modify/gameSettings")
|
||||
public ApiResponse modifyGameSettings(@RequestHeader String token, HttpServletRequest request,
|
||||
@RequestBody PartnerCompInfo compInfo) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
try {
|
||||
// Site site = getSiteByCheck(request);
|
||||
if (token == null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
JwtManager.TokenInfo tokenInfo = jwtManager.getTokenInfo(token);
|
||||
if (tokenInfo.getType() == null || !tokenInfo.getType().equals("super")) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
if (compInfo.getTopCompId() == null) {
|
||||
throw new ApiException("SC999", "상위 컴퍼니 아이디 누락");
|
||||
}
|
||||
|
||||
log.info("[REQUEST: " + request.getRequestURI() + "] " + compInfo);
|
||||
int result = compService.modifySiteGameSettingForSuper(compInfo);
|
||||
|
||||
try {
|
||||
HashMap<String, String> logParam = new HashMap<String, String>();
|
||||
logParam.put("siteId", tokenInfo.getMid());
|
||||
logParam.put("memId", tokenInfo.getMid());
|
||||
logParam.put("regId", tokenInfo.getMid());
|
||||
logParam.put("logType", "modify");
|
||||
logParam.put("logoutYn", "");
|
||||
logParam.put("logEndPoint", request.getRequestURI());
|
||||
logParam.put("logName",
|
||||
"SuperApiCompController.modifyGameSettings() => CompService.modifySiteGameSettingForSuper()");
|
||||
logParam.put("logDesc", compInfo.toString());
|
||||
|
||||
logParam.put("regIp", IPKit.getIpAddressByRequest(request));
|
||||
logParam.put("token", "");
|
||||
commonService.insertAdminlog(logParam);
|
||||
} catch (Exception e) {
|
||||
System.out.print(e.toString());
|
||||
}
|
||||
|
||||
if (result > 0) {
|
||||
apiResponse.success();
|
||||
} else {
|
||||
throw new ApiException("COMP009", "배팅 가능유/무 설정에 문제가 발생하였습니다. 관리자에게 문의하세요.");
|
||||
}
|
||||
|
||||
} catch (ApiException e) {
|
||||
log.debug(e.toString());
|
||||
apiResponse = e.getApiResponse();
|
||||
} catch (Exception e) {
|
||||
log.info(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value = "/modify/menuSettings")
|
||||
public ApiResponse modifyMenuSettings(@RequestHeader String token, HttpServletRequest request,
|
||||
@RequestBody PartnerCompInfo compInfo) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
try {
|
||||
// Site site = getSiteByCheck(request);
|
||||
if (token == null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
JwtManager.TokenInfo tokenInfo = jwtManager.getTokenInfo(token);
|
||||
if (tokenInfo.getType() == null || !tokenInfo.getType().equals("super")) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
if (compInfo.getTopCompId() == null) {
|
||||
throw new ApiException("SC999", "상위 컴퍼니 아이디 누락");
|
||||
}
|
||||
|
||||
log.info("[REQUEST: " + request.getRequestURI() + "] " + compInfo);
|
||||
int result = compService.modifyMenuSettings(compInfo);
|
||||
|
||||
try {
|
||||
HashMap<String, String> logParam = new HashMap<String, String>();
|
||||
logParam.put("siteId", tokenInfo.getMid());
|
||||
logParam.put("memId", tokenInfo.getMid());
|
||||
logParam.put("regId", tokenInfo.getMid());
|
||||
logParam.put("logType", "modify");
|
||||
logParam.put("logoutYn", "");
|
||||
logParam.put("logEndPoint", request.getRequestURI());
|
||||
logParam.put("logName",
|
||||
"SuperApiCompController.modifyMenuSettings() => CompService.modifyMenuSettings()");
|
||||
logParam.put("logDesc", compInfo.toString());
|
||||
logParam.put("regIp", IPKit.getIpAddressByRequest(request));
|
||||
logParam.put("token", "");
|
||||
commonService.insertAdminlog(logParam);
|
||||
} catch (Exception e) {
|
||||
System.out.print(e.toString());
|
||||
}
|
||||
|
||||
if (result > 0) {
|
||||
apiResponse.success();
|
||||
} else {
|
||||
throw new ApiException("COMP009", "배팅 가능유/무 설정에 문제가 발생하였습니다. 관리자에게 문의하세요.");
|
||||
}
|
||||
|
||||
} catch (ApiException e) {
|
||||
log.debug(e.toString());
|
||||
apiResponse = e.getApiResponse();
|
||||
} catch (Exception e) {
|
||||
log.info(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value = "/detail/siteIds")
|
||||
public ApiResponse getSiteIds(@RequestHeader String token, HttpServletRequest request,
|
||||
@RequestBody SiteSearch search) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
try {
|
||||
// Site site = getSiteByCheck(request);
|
||||
if (token == null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
log.info("[REQUEST: " + request.getRequestURI() + "] " + search);
|
||||
List<HashMap<String, String>> compIdList = compService.getCompIdList(search);
|
||||
apiResponse.put("siteIds", compIdList);
|
||||
apiResponse.success();
|
||||
|
||||
} catch (ApiException e) {
|
||||
log.debug(e.toString());
|
||||
apiResponse = e.getApiResponse();
|
||||
} catch (Exception e) {
|
||||
log.info(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value = "/detail/siteGameInfo")
|
||||
public ApiResponse getSiteGameInfo(@RequestHeader String token, HttpServletRequest request,
|
||||
@RequestBody SiteSearch search) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
try {
|
||||
// Site site = getSiteByCheck(request);
|
||||
if (token == null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
log.info("[REQUEST: " + request.getRequestURI() + "] " + search);
|
||||
List<HashMap> gameList = compService.getSiteGameInfo(search);
|
||||
|
||||
apiResponse.put("gameList", gameList);
|
||||
apiResponse.success();
|
||||
|
||||
} catch (ApiException e) {
|
||||
log.debug(e.toString());
|
||||
apiResponse = e.getApiResponse();
|
||||
} catch (Exception e) {
|
||||
log.info(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value = "/detail/siteMenuInfo")
|
||||
public ApiResponse getSiteMenuInfo(@RequestHeader String token, HttpServletRequest request,
|
||||
@RequestBody SiteSearch search) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
try {
|
||||
// Site site = getSiteByCheck(request);
|
||||
if (token == null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
log.info("[REQUEST: " + request.getRequestURI() + "] " + search);
|
||||
HashMap<String, String> param = new HashMap<>();
|
||||
List<MenuVO> menuList = compService.getSiteMenuInfo(search);
|
||||
|
||||
apiResponse.put("menuList", menuList);
|
||||
apiResponse.success();
|
||||
|
||||
} catch (ApiException e) {
|
||||
log.debug(e.toString());
|
||||
apiResponse = e.getApiResponse();
|
||||
} catch (Exception e) {
|
||||
log.info(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value = "/detail/otpInfo")
|
||||
public ApiResponse getSiteAdminOTPInfo(@RequestHeader String token, HttpServletRequest request,
|
||||
@RequestBody SiteSearch search) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
try {
|
||||
// Site site = getSiteByCheck(request);
|
||||
if (token == null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
if (search.getSiteId() == null || search.getSiteId().equals("")) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
log.info("[REQUEST: " + request.getRequestURI() + "] " + search);
|
||||
List<HashMap<String, String>> adminOtpList = compService.getAdminOtpInfoList(search.getSiteId());
|
||||
apiResponse.put("adminOtpList", adminOtpList);
|
||||
|
||||
apiResponse.success();
|
||||
|
||||
} catch (ApiException e) {
|
||||
log.debug(e.toString());
|
||||
apiResponse = e.getApiResponse();
|
||||
} catch (Exception e) {
|
||||
log.info(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value = "/reset")
|
||||
public ApiResponse reset(@RequestHeader String token, HttpServletRequest request,
|
||||
@RequestBody CompResetInfo compResetInfo) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
try {
|
||||
// Site site = getSiteByCheck(request);
|
||||
if (token == null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
JwtManager.TokenInfo tokenInfo = jwtManager.getTokenInfo(token);
|
||||
if (tokenInfo.getType() == null || !tokenInfo.getType().equals("super")) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
if (compResetInfo.getSiteId() == null || compResetInfo.getSiteId().equals("")) {
|
||||
throw new ApiException("SS99", "Not Found siteId");
|
||||
}
|
||||
|
||||
log.info("[REQUEST: " + request.getRequestURI() + "] [SUPER_ADMIN reset("+compResetInfo.getSiteId()+")] " + compResetInfo);
|
||||
int result = compService.resetComp(compResetInfo);
|
||||
|
||||
try {
|
||||
HashMap<String, String> logParam = new HashMap<String, String>();
|
||||
logParam.put("siteId", tokenInfo.getMid());
|
||||
logParam.put("memId", tokenInfo.getMid());
|
||||
logParam.put("regId", tokenInfo.getMid());
|
||||
logParam.put("logType", "modify");
|
||||
logParam.put("logoutYn", "");
|
||||
logParam.put("logEndPoint", request.getRequestURI());
|
||||
logParam.put("logName", "SuperApiCompController.reset() => CompService.resetComp()");
|
||||
logParam.put("logDesc", compResetInfo.toString());
|
||||
logParam.put("regIp", IPKit.getIpAddressByRequest(request));
|
||||
logParam.put("token", "");
|
||||
commonService.insertAdminlog(logParam);
|
||||
} catch (Exception e) {
|
||||
System.out.print(e.toString());
|
||||
}
|
||||
|
||||
if (result == 0) {
|
||||
apiResponse.success();
|
||||
} else {
|
||||
throw new ApiException("COMP010", "사이트 초기화에 문제가 발생하였습니다. 관리자에게 문의하세요.");
|
||||
}
|
||||
|
||||
log.info("[REQUEST: " + request.getRequestURI() + "] [SUPER_ADMIN reset("+compResetInfo.getSiteId()+")] END...");
|
||||
|
||||
} catch (ApiException e) {
|
||||
log.debug(e.toString());
|
||||
apiResponse = e.getApiResponse();
|
||||
} catch (Exception e) {
|
||||
log.info(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value = "/deleteUsers")
|
||||
public ApiResponse deleteUsers(@RequestHeader String token, HttpServletRequest request,
|
||||
@RequestBody CompResetInfo compResetInfo) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
try {
|
||||
// Site site = getSiteByCheck(request);
|
||||
if (token == null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
JwtManager.TokenInfo tokenInfo = jwtManager.getTokenInfo(token);
|
||||
if (tokenInfo.getType() == null || !tokenInfo.getType().equals("super")) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
if (compResetInfo.getSiteId() == null || compResetInfo.getSiteId().equals("")) {
|
||||
throw new ApiException("SS99", "Not Found siteId");
|
||||
}
|
||||
|
||||
final String LOG_PREFIX = "#super::deleteUsers::" + compResetInfo.getSiteId() + "::::";
|
||||
compResetInfo.setMemIds(compResetInfo.getMemIds().trim());
|
||||
|
||||
log.info(LOG_PREFIX + "[REQUEST: " + request.getRequestURI() + "] delete()::" + compResetInfo);
|
||||
// User check
|
||||
List<String> memIdList = Arrays.asList(compResetInfo.getMemIds().split(","));
|
||||
if (memIdList.size() > 10) {
|
||||
throw new ApiException("DU03", "User list size over");
|
||||
}
|
||||
compResetInfo.setMemIdList(memIdList);
|
||||
|
||||
List<HashMap<String, Object>> memList = userService.delCheckMemList(compResetInfo);
|
||||
for (HashMap<String, Object> mem : memList) {
|
||||
String memId = mem.get("memId").toString();
|
||||
// String partnerLevel = mem.get("partnerLevel").toString();
|
||||
int botCnt = Integer.parseInt(mem.get("botCnt").toString());
|
||||
/*
|
||||
* if(!"NORMAL".equals(partnerLevel)) { throw new ApiException("DU01",
|
||||
* "["+memId+"] is not normal user"); }
|
||||
*/
|
||||
if (botCnt != 0) {
|
||||
throw new ApiException("DU02", "[" + memId + "] has a bottom user(" + botCnt + ")");
|
||||
}
|
||||
}
|
||||
|
||||
// Delete user
|
||||
int result = userService.deleteUsers(LOG_PREFIX, compResetInfo);
|
||||
|
||||
try {
|
||||
HashMap<String, String> logParam = new HashMap<String, String>();
|
||||
logParam.put("siteId", tokenInfo.getMid());
|
||||
logParam.put("memId", tokenInfo.getMid());
|
||||
logParam.put("regId", tokenInfo.getMid());
|
||||
logParam.put("logType", "modify");
|
||||
logParam.put("logoutYn", "");
|
||||
logParam.put("logEndPoint", request.getRequestURI());
|
||||
logParam.put("logName", "SuperApiUserController.delete() => UserService.deleteUsers()");
|
||||
logParam.put("logDesc", compResetInfo.toString());
|
||||
logParam.put("regIp", IPKit.getIpAddressByRequest(request));
|
||||
logParam.put("token", "");
|
||||
commonService.insertAdminlog(logParam);
|
||||
} catch (Exception e) {
|
||||
log.error(LOG_PREFIX + "insertAdminlog Exception::" + e.toString());
|
||||
}
|
||||
|
||||
if (result >= 0) {
|
||||
apiResponse.success();
|
||||
} else {
|
||||
throw new ApiException("DU91", "유저 영구삭제 중 문제가 발생하였습니다. 관리자에게 문의하세요.");
|
||||
}
|
||||
|
||||
} catch (ApiException e) {
|
||||
JwtManager.TokenInfo tokenInfo = jwtManager.getTokenInfo(token);
|
||||
final String LOG_PREFIX = "#super:memberDelete::" + compResetInfo.getSiteId() + "::::";
|
||||
log.error(LOG_PREFIX + "ApiException::" + e.getApiResponse());
|
||||
apiResponse = e.getApiResponse();
|
||||
} catch (Exception e) {
|
||||
JwtManager.TokenInfo tokenInfo = jwtManager.getTokenInfo(token);
|
||||
final String LOG_PREFIX = "#super:memberDelete::" + compResetInfo.getSiteId() + "::::";
|
||||
log.error(LOG_PREFIX + "Exception::" + e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value = { "/statistics" })
|
||||
public ApiResponse statistics(@RequestHeader String token, HttpServletRequest request,
|
||||
@Valid @RequestBody MemberListSearch search) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
|
||||
try {
|
||||
// Site site = getSiteByCheck(request);
|
||||
if (token == null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
JwtManager.TokenInfo tokenInfo = jwtManager.getTokenInfo(token);
|
||||
|
||||
PageFormVO pageVo = new PageFormVO();
|
||||
int totalCount = superService.getCompanyListCnt(search);
|
||||
|
||||
if (totalCount != 0) {
|
||||
PageFormVO commonForm = new PageFormVO();
|
||||
commonForm.setFunction_name("goPage");
|
||||
commonForm.setPage(search.getPage());
|
||||
commonForm.setCount_per_page(20);
|
||||
if (search.getCount_per_list() == 0) {
|
||||
commonForm.setCount_per_list(10);
|
||||
} else {
|
||||
commonForm.setCount_per_list(search.getCount_per_list());
|
||||
}
|
||||
commonForm.setTatal_list_count(totalCount);
|
||||
pageVo = PagingUtil.setPageUtil(commonForm);
|
||||
search.setLimit(pageVo.getLimit());
|
||||
search.setOffset(pageVo.getOffset());
|
||||
search.setTatal_list_count(totalCount);
|
||||
apiResponse.put("pageInfo", pageVo);
|
||||
}
|
||||
|
||||
List<HashMap> cashList = superService.getCompanyList(search);
|
||||
apiResponse.put("list", cashList);
|
||||
|
||||
apiResponse.success();
|
||||
|
||||
} catch (ApiException e) {
|
||||
log.debug(e.toString());
|
||||
apiResponse = e.getApiResponse();
|
||||
} catch (Exception e) {
|
||||
log.info(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
}
|
||||
583
src/main/java/com/bb/admintop/controller/SuperApiController.java
Normal file
583
src/main/java/com/bb/admintop/controller/SuperApiController.java
Normal file
@@ -0,0 +1,583 @@
|
||||
package com.bb.admintop.controller;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.crypto.password.PasswordEncoder;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestHeader;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.bb.exception.ApiException;
|
||||
import com.bb.jwt.JwtClame;
|
||||
import com.bb.jwt.JwtManager;
|
||||
import com.bb.model.ApiResponse;
|
||||
import com.bb.model.CodeSearch;
|
||||
import com.bb.model.OTPInfo;
|
||||
import com.bb.model.Site;
|
||||
import com.bb.model.SiteOption;
|
||||
import com.bb.model.SiteSearch;
|
||||
import com.bb.model.TOtpVO;
|
||||
import com.bb.service.CommonService;
|
||||
import com.bb.service.CompService;
|
||||
import com.bb.service.SuperService;
|
||||
import com.bb.service.UserService;
|
||||
import com.bb.util.IPKit;
|
||||
import com.bb.util.TOTPTokenGenerator;
|
||||
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@RestController
|
||||
@Slf4j
|
||||
@RequestMapping("/api/super")
|
||||
@RequiredArgsConstructor
|
||||
@SecurityRequirement(name = "Authorization")
|
||||
public class SuperApiController {
|
||||
|
||||
private final SuperService superService;
|
||||
|
||||
private final JwtManager jwtManager;
|
||||
|
||||
private final CommonService commonService;
|
||||
|
||||
private final UserService userService;
|
||||
|
||||
private final CompService compService;
|
||||
|
||||
private final PasswordEncoder passwordEncoder;
|
||||
|
||||
private final String ISSUER = "super.oms-admin.com";
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value = "/login")
|
||||
public ApiResponse admonLogin(HttpServletRequest request, @RequestBody SiteSearch search) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
String loginAdminId = search.getSiteId();
|
||||
final String LOG_PREFIX = "#-super::login::" + loginAdminId + "::::";
|
||||
String logDesc = "";
|
||||
|
||||
try {
|
||||
String adminOtpYN = compService.getAdminOtpUseYN(search.getSiteId());
|
||||
|
||||
if (adminOtpYN.equals("Y")) {
|
||||
// OTP Login = Y
|
||||
apiResponse.put("useOtp", adminOtpYN);
|
||||
if (search.getOtp() == null || "".equals(search.getOtp())) {
|
||||
log.error(LOG_PREFIX + "ApiException::5000::OTP 번호를 입력하세요.");
|
||||
throw new ApiException("5000", "OTP 번호를 입력하세요.");
|
||||
}
|
||||
|
||||
// Check OTP
|
||||
String account = search.getSiteId();
|
||||
int otpNum = 0;
|
||||
try {
|
||||
otpNum = Integer.parseInt(search.getOtp());
|
||||
} catch (NumberFormatException ne) {
|
||||
log.error(LOG_PREFIX + "ApiException::4000::OTP 번호는 숫자 형식입니다.");
|
||||
throw new ApiException("4000", "OTP 번호는 숫자 형식입니다.");
|
||||
}
|
||||
|
||||
OTPInfo otpInfo = compService.getOtpInfo(account);
|
||||
if (otpInfo == null || otpInfo.getAccount().equals("")) {
|
||||
log.error(LOG_PREFIX + "ApiException::6000::OTP 정보를 찾을 수 없습니다.");
|
||||
throw new ApiException("6000", "OTP 정보를 찾을 수 없습니다.");
|
||||
}
|
||||
log.info(LOG_PREFIX + "OTP Info : " + otpInfo);
|
||||
String secret = otpInfo.getSecretKey();
|
||||
|
||||
// long l = new Date().getTime();
|
||||
// long ll = l / 30000;
|
||||
// boolean chkOtp = TOTPTokenGenerator.check_code(secret, otpNum, ll);
|
||||
boolean chkOtp = TOTPTokenGenerator.otpVerify(secret, otpNum);
|
||||
if (chkOtp) {
|
||||
apiResponse.put("useOtp", "Y");
|
||||
|
||||
String password = passwordEncoder.encode(search.getSitePass());
|
||||
log.info(LOG_PREFIX + "[ADMIN PWD:" + password + "]");
|
||||
HashMap admininfo = userService.adminSuperLogin(search);
|
||||
|
||||
boolean chkPassword = passwordEncoder.matches(search.getSitePass(),
|
||||
admininfo.get("adminPass").toString());
|
||||
log.info(LOG_PREFIX + "[ADMIN chkPassword:" + chkPassword + "]");
|
||||
|
||||
if (!chkPassword) {
|
||||
log.error(LOG_PREFIX + "ApiException::2000::no site");
|
||||
throw new ApiException("2000", "no site");
|
||||
}
|
||||
|
||||
// ipchck
|
||||
Map ipParam = new HashMap();
|
||||
ipParam.put("adminId", admininfo.get("adminId").toString());
|
||||
ipParam.put("ip", IPKit.getIpAddressByRequest(request));
|
||||
apiResponse.put("site", admininfo);
|
||||
|
||||
JwtClame jwtinfo = new JwtClame();
|
||||
jwtinfo.setSiteIdx(0);
|
||||
jwtinfo.setMemIdx(0);
|
||||
jwtinfo.setSiteId(admininfo.get("adminId").toString());
|
||||
jwtinfo.setMemId(admininfo.get("adminId").toString());
|
||||
jwtinfo.setType("super");
|
||||
String tok = jwtManager.generateToken(jwtinfo);
|
||||
apiResponse.put("token", tok);
|
||||
|
||||
try {
|
||||
Map logParam = new HashMap();
|
||||
logParam.put("siteId", admininfo.get("adminId").toString());
|
||||
logParam.put("memId", admininfo.get("adminId").toString());
|
||||
logParam.put("logType", "SUPERLOGIN");
|
||||
logParam.put("logoutYn", "");
|
||||
logParam.put("logEndPoint", request.getRequestURI());
|
||||
logParam.put("logName", "로그인");
|
||||
logParam.put("logDesc", logParam.toString());
|
||||
logParam.put("regId", admininfo.get("adminId").toString());
|
||||
logParam.put("regIp", IPKit.getIpAddressByRequest(request));
|
||||
logParam.put("token", tok);
|
||||
commonService.insertAdminlog(logParam);
|
||||
} catch (Exception e) {
|
||||
System.out.print(e.toString());
|
||||
}
|
||||
|
||||
apiResponse.success();
|
||||
} else {
|
||||
// TODO: 잘못된 OTP번호
|
||||
log.error(LOG_PREFIX + "ApiException::3000::OTP 번호가 일치하지 않습니다.");
|
||||
throw new ApiException("3000", "OTP 번호가 일치하지 않습니다.");
|
||||
}
|
||||
} else {
|
||||
// OTP Login = N
|
||||
apiResponse.put("useOtp", adminOtpYN);
|
||||
|
||||
String password = passwordEncoder.encode(search.getSitePass());
|
||||
log.info(LOG_PREFIX + "[ADMIN PWD:" + password + "]");
|
||||
HashMap admininfo = userService.adminSuperLogin(search);
|
||||
|
||||
boolean chkPassword = passwordEncoder.matches(search.getSitePass(),
|
||||
admininfo.get("adminPass").toString());
|
||||
log.info(LOG_PREFIX + "[ADMIN chkPassword:" + chkPassword + "]");
|
||||
|
||||
if (!chkPassword) {
|
||||
log.error(LOG_PREFIX + "ApiException::2000::no site");
|
||||
throw new ApiException("2000", "no site");
|
||||
}
|
||||
|
||||
// ipchck
|
||||
Map ipParam = new HashMap();
|
||||
ipParam.put("adminId", admininfo.get("adminId").toString());
|
||||
ipParam.put("ip", IPKit.getIpAddressByRequest(request));
|
||||
apiResponse.put("site", admininfo);
|
||||
|
||||
JwtClame jwtinfo = new JwtClame();
|
||||
jwtinfo.setSiteIdx(0);
|
||||
jwtinfo.setMemIdx(0);
|
||||
jwtinfo.setSiteId(admininfo.get("adminId").toString());
|
||||
jwtinfo.setMemId(admininfo.get("adminId").toString());
|
||||
jwtinfo.setType("super");
|
||||
String tok = jwtManager.generateToken(jwtinfo);
|
||||
apiResponse.put("token", tok);
|
||||
|
||||
try {
|
||||
Map logParam = new HashMap();
|
||||
logParam.put("siteId", admininfo.get("adminId").toString());
|
||||
logParam.put("memId", admininfo.get("adminId").toString());
|
||||
logParam.put("logType", "SUPERLOGIN");
|
||||
logParam.put("logoutYn", "");
|
||||
logParam.put("logEndPoint", request.getRequestURI());
|
||||
logParam.put("logName", "로그인");
|
||||
logParam.put("logDesc", logParam.toString());
|
||||
logParam.put("regId", admininfo.get("adminId").toString());
|
||||
logParam.put("regIp", IPKit.getIpAddressByRequest(request));
|
||||
logParam.put("token", tok);
|
||||
commonService.insertAdminlog(logParam);
|
||||
} catch (Exception e) {
|
||||
System.out.print(e.toString());
|
||||
}
|
||||
}
|
||||
|
||||
apiResponse.success();
|
||||
} catch (ApiException e) {
|
||||
log.error(e.toString());
|
||||
apiResponse = e.getApiResponse();
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value = "/makeOtp")
|
||||
public ApiResponse makeOtp(@RequestHeader String token, HttpServletRequest request) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
try {
|
||||
if (token == null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
JwtManager.TokenInfo tokenInfo = jwtManager.getTokenInfo(token);
|
||||
if (tokenInfo.getType() == null || !tokenInfo.getType().equals("super")) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
OTPInfo param = new OTPInfo();
|
||||
param.setAccount(tokenInfo.getMid());
|
||||
param.setIssuer(ISSUER);
|
||||
param.setUseYn("Y");
|
||||
param.setType("S");
|
||||
param = TOTPTokenGenerator.getGoogleAuthQRUrl(param);
|
||||
|
||||
log.info("#-super::makeOtp:: SUPER ADMIN secret : " + param.getSecretKey());
|
||||
log.info("#-super::makeOtp:: SUPER ADMIN account : " + param.getAccount());
|
||||
log.info("#-super::makeOtp:: SUPER ADMIN issuer : " + ISSUER);
|
||||
log.info("#-super::makeOtp:: SUPER ADMIN URL : " + param.getUrl());
|
||||
|
||||
int result = compService.registSuperOtp(param);
|
||||
if (result > 0) {
|
||||
String adminOtpYN = compService.getAdminOtpUseYN(tokenInfo.getMid());
|
||||
apiResponse.put("useOtp", adminOtpYN);
|
||||
apiResponse.put("otpUrl", param.getUrl());
|
||||
|
||||
try {
|
||||
HashMap<String, String> logParam = new HashMap<String, String>();
|
||||
logParam.put("siteId", tokenInfo.getMid());
|
||||
logParam.put("memId", tokenInfo.getMid());
|
||||
logParam.put("regId", tokenInfo.getMid());
|
||||
logParam.put("logType", "modify");
|
||||
logParam.put("logoutYn", "");
|
||||
logParam.put("logEndPoint", request.getRequestURI());
|
||||
logParam.put("logName", "SuperApiController.makeOtp() => userService.registAdminOtp()");
|
||||
logParam.put("logDesc", param.toString());
|
||||
logParam.put("regIp", IPKit.getIpAddressByRequest(request));
|
||||
logParam.put("token", "");
|
||||
commonService.insertAdminlog(logParam);
|
||||
} catch (Exception e) {
|
||||
System.out.print(e.toString());
|
||||
}
|
||||
|
||||
apiResponse.success();
|
||||
} else {
|
||||
throw new ApiException("9999", "FAIL");
|
||||
}
|
||||
|
||||
} catch (ApiException e) {
|
||||
log.debug(e.toString());
|
||||
apiResponse = e.getApiResponse();
|
||||
} catch (Exception e) {
|
||||
log.info(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value = "/getOtpUrl")
|
||||
public ApiResponse getOtpUrl(@RequestHeader String token, HttpServletRequest request) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
try {
|
||||
if (token == null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
JwtManager.TokenInfo tokenInfo = jwtManager.getTokenInfo(token);
|
||||
if (tokenInfo.getType() == null || !tokenInfo.getType().equals("super")) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
String account = tokenInfo.getMid();
|
||||
OTPInfo otpInfo = compService.getOtpInfo(account);
|
||||
log.info("#-super::getOtpUrl::OTP info: " + otpInfo);
|
||||
apiResponse.put("otpUrl", otpInfo.getUrl());
|
||||
|
||||
String adminOtpYN = compService.getAdminOtpUseYN(tokenInfo.getMid());
|
||||
apiResponse.put("useOtp", adminOtpYN);
|
||||
|
||||
apiResponse.success();
|
||||
|
||||
} catch (ApiException e) {
|
||||
log.debug(e.toString());
|
||||
apiResponse = e.getApiResponse();
|
||||
} catch (Exception e) {
|
||||
log.info(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value = "/updateOtpUseYN")
|
||||
public ApiResponse updateOtpUseYN(@RequestHeader String token, HttpServletRequest request,
|
||||
@RequestBody OTPInfo info) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
try {
|
||||
if (token == null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
if (info.getUseYn() == null || info.getUseYn().equals("")) {
|
||||
throw new ApiException("1009", "The value 'useYN' does not exist.");
|
||||
}
|
||||
|
||||
int result = 0;
|
||||
JwtManager.TokenInfo tokenInfo = jwtManager.getTokenInfo(token);
|
||||
if (tokenInfo.getType() == null || !tokenInfo.getType().equals("super")) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
if (info.getAccount() != null && !info.getAccount().equals("")) {
|
||||
String adminId = info.getAccount();
|
||||
String adminType = compService.getAdminType(adminId);
|
||||
info.setType(adminType);
|
||||
result = compService.updateAdminOtpUseYN(info);
|
||||
} else {
|
||||
info.setAccount(tokenInfo.getMid());
|
||||
result = compService.updateSuperOtpUseYN(info);
|
||||
}
|
||||
|
||||
if (result > 0) {
|
||||
try {
|
||||
HashMap<String, String> logParam = new HashMap<String, String>();
|
||||
logParam.put("siteId", tokenInfo.getMid());
|
||||
logParam.put("memId", tokenInfo.getMid());
|
||||
logParam.put("regId", tokenInfo.getMid());
|
||||
logParam.put("logType", "modify");
|
||||
logParam.put("logoutYn", "");
|
||||
logParam.put("logEndPoint", request.getRequestURI());
|
||||
logParam.put("logName", "SuperApiController.updateOtpUseYN() => userService.updateOtpUseYN()");
|
||||
logParam.put("logDesc", info.toString());
|
||||
logParam.put("regIp", IPKit.getIpAddressByRequest(request));
|
||||
logParam.put("token", "");
|
||||
commonService.insertAdminlog(logParam);
|
||||
} catch (Exception e) {
|
||||
System.out.print(e.toString());
|
||||
}
|
||||
|
||||
apiResponse.success();
|
||||
} else {
|
||||
throw new ApiException("9999", "FAIL");
|
||||
}
|
||||
|
||||
} catch (ApiException e) {
|
||||
log.debug(e.toString());
|
||||
apiResponse = e.getApiResponse();
|
||||
} catch (Exception e) {
|
||||
log.info(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
return apiResponse;
|
||||
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value = "/makeSiteOtp")
|
||||
public ApiResponse makeSiteOtp(@RequestHeader String token, HttpServletRequest request,
|
||||
@Valid @RequestBody TOtpVO otpVO) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
try {
|
||||
if (token == null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
JwtManager.TokenInfo tokenInfo = jwtManager.getTokenInfo(token);
|
||||
if (tokenInfo.getType() == null || !tokenInfo.getType().equals("super")) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
String siteId = otpVO.getSiteId();
|
||||
String account = otpVO.getAdminId();
|
||||
Site site = userService.getSiteInfo(siteId);
|
||||
String issuer = site.getSiteDomain();
|
||||
String adminType = compService.getAdminType(account);
|
||||
|
||||
OTPInfo param = new OTPInfo();
|
||||
param.setAccount(account);
|
||||
param.setIssuer(issuer);
|
||||
param.setUseYn("N");
|
||||
param.setType(adminType);
|
||||
param = TOTPTokenGenerator.getGoogleAuthQRUrl(param);
|
||||
|
||||
log.info("#-admin::makeOtp:: secret : " + param.getSecretKey());
|
||||
log.info("#-admin::makeOtp:: account : " + param.getAccount());
|
||||
log.info("#-admin::makeOtp:: issuer : " + issuer);
|
||||
log.info("#-admin::makeOtp:: URL : " + param.getUrl());
|
||||
|
||||
int result = compService.registAdminOtp(param);
|
||||
if (result > 0) {
|
||||
String siteOtpYN = compService.getAdminOtpUseYN(account);
|
||||
apiResponse.put("useOtp", siteOtpYN);
|
||||
apiResponse.put("otpUrl", param.getUrl());
|
||||
|
||||
try {
|
||||
HashMap<String, String> logParam = new HashMap<String, String>();
|
||||
logParam.put("siteId", tokenInfo.getMid());
|
||||
logParam.put("memId", tokenInfo.getMid());
|
||||
logParam.put("regId", tokenInfo.getMid());
|
||||
logParam.put("logType", "modify");
|
||||
logParam.put("logoutYn", "");
|
||||
logParam.put("logEndPoint", request.getRequestURI());
|
||||
logParam.put("logName", "SuperApiController.makeSiteOtp() => userService.registAdminOtp()");
|
||||
logParam.put("logDesc", param.toString());
|
||||
logParam.put("regIp", IPKit.getIpAddressByRequest(request));
|
||||
logParam.put("token", "");
|
||||
commonService.insertAdminlog(logParam);
|
||||
} catch (Exception e) {
|
||||
System.out.print(e.toString());
|
||||
}
|
||||
|
||||
apiResponse.success();
|
||||
} else {
|
||||
throw new ApiException("9999", "FAIL");
|
||||
}
|
||||
|
||||
} catch (ApiException e) {
|
||||
log.debug(e.toString());
|
||||
apiResponse = e.getApiResponse();
|
||||
} catch (Exception e) {
|
||||
log.info(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value = "/getSiteOtpUrl")
|
||||
public ApiResponse getSiteOtpUrl(@RequestHeader String token, HttpServletRequest request,
|
||||
@Valid @RequestBody TOtpVO otpVO) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
try {
|
||||
if (token == null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
OTPInfo otpInfo = compService.getOtpInfo(otpVO.getAdminId());
|
||||
log.info("#-super::getSiteOtpUrl::OTP info: " + otpInfo);
|
||||
apiResponse.put("otpUrl", otpInfo.getUrl());
|
||||
apiResponse.success();
|
||||
|
||||
} catch (ApiException e) {
|
||||
log.debug(e.toString());
|
||||
apiResponse = e.getApiResponse();
|
||||
} catch (Exception e) {
|
||||
log.info(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value = "/optionSave")
|
||||
public ApiResponse optionSave(@RequestHeader String token, HttpServletRequest request,
|
||||
@RequestBody SiteOption option) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
try {
|
||||
if (token == null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
JwtManager.TokenInfo tokenInfo = jwtManager.getTokenInfo(token);
|
||||
if (tokenInfo.getType() == null || !tokenInfo.getType().equals("super")) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
option.setSiteId(option.getSiteId());
|
||||
commonService.optionSave(option);
|
||||
|
||||
try {
|
||||
Map logParam = new HashMap();
|
||||
logParam.put("siteId", tokenInfo.getMid());
|
||||
logParam.put("memId", tokenInfo.getMid());
|
||||
logParam.put("logType", "insert or update");
|
||||
logParam.put("logoutYn", "");
|
||||
logParam.put("logEndPoint", request.getRequestURI());
|
||||
logParam.put("logName", "AdminSuperController.optionSave() => CommonService.optionSave()");
|
||||
logParam.put("logDesc", option.toString());
|
||||
logParam.put("regId", tokenInfo.getMid());
|
||||
logParam.put("regIp", IPKit.getIpAddressByRequest(request));
|
||||
logParam.put("token", "");
|
||||
commonService.insertAdminlog(logParam);
|
||||
} catch (Exception e) {
|
||||
System.out.print(e.toString());
|
||||
}
|
||||
|
||||
apiResponse.success();
|
||||
|
||||
} catch (ApiException e) {
|
||||
log.debug(e.toString());
|
||||
apiResponse = e.getApiResponse();
|
||||
} catch (Exception e) {
|
||||
log.info(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value = "/gameCodes")
|
||||
public ApiResponse gameCodes(@RequestHeader String token, HttpServletRequest request,
|
||||
@RequestBody CodeSearch codesSearch) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
try {
|
||||
if (token == null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
if (codesSearch == null || codesSearch.getSiteId().equals("")) {
|
||||
codesSearch.setSiteId("");
|
||||
} else {
|
||||
codesSearch.setSiteId(codesSearch.getSiteId());
|
||||
}
|
||||
|
||||
List<HashMap> codeList = commonService.getGameCodesForSuper(codesSearch);
|
||||
apiResponse.put("codes", codeList);
|
||||
apiResponse.put("codesSearch", codesSearch);
|
||||
} catch (Exception e) {
|
||||
log.info(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value = "/gameGroupCodes")
|
||||
public ApiResponse gameGroupCodes(@RequestHeader String token, HttpServletRequest request,
|
||||
@RequestBody CodeSearch codesSearch) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
try {
|
||||
if (token == null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
if (codesSearch == null || codesSearch.getSiteId().equals("")) {
|
||||
codesSearch.setSiteId("");
|
||||
} else {
|
||||
codesSearch.setSiteId(codesSearch.getSiteId());
|
||||
}
|
||||
|
||||
String siteId = codesSearch.getSiteId();
|
||||
List<HashMap> codeList = commonService.getGameGroupCodesForSuper(siteId);
|
||||
apiResponse.put("groupCodes", codeList);
|
||||
} catch (Exception e) {
|
||||
log.info(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,178 @@
|
||||
package com.bb.admintop.controller;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestHeader;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.bb.exception.ApiException;
|
||||
import com.bb.jwt.JwtManager;
|
||||
import com.bb.model.ApiResponse;
|
||||
import com.bb.model.GameCodeSearchVO;
|
||||
import com.bb.model.GameCodeVO;
|
||||
import com.bb.service.CommonService;
|
||||
import com.bb.util.IPKit;
|
||||
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@RestController
|
||||
@Slf4j
|
||||
@RequestMapping("/api/super/setting")
|
||||
@RequiredArgsConstructor
|
||||
@SecurityRequirement(name = "Authorization")
|
||||
public class SuperApiSettingController {
|
||||
|
||||
private final JwtManager jwtManager;
|
||||
|
||||
private final CommonService commonService;
|
||||
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value="/gameCodeList")
|
||||
public ApiResponse gameCodeList(@RequestHeader String token, HttpServletRequest request, @RequestBody GameCodeSearchVO searchVO) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
try {
|
||||
if(token==null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
List<HashMap<String, String>> tabList = commonService.getGameCodeTabList(searchVO);
|
||||
List<HashMap<String, String>> colList = commonService.getGameCodeColList(searchVO);
|
||||
List<HashMap<String, String>> gameCodelist = commonService.getGameCodeList(searchVO);
|
||||
apiResponse.put("selectTab", searchVO.getGroupCode());
|
||||
apiResponse.put("selectOrderName", searchVO.getOrderName());
|
||||
apiResponse.put("selectOrderType", searchVO.getOrderType());
|
||||
apiResponse.put("tabList", tabList);
|
||||
apiResponse.put("colList", colList);
|
||||
apiResponse.put("gameCodelist", gameCodelist);
|
||||
apiResponse.success();
|
||||
|
||||
} catch(ApiException e) {
|
||||
log.debug(e.toString());
|
||||
apiResponse = e.getApiResponse();
|
||||
} catch (Exception e) {
|
||||
log.info(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
return apiResponse;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value="/gameCodeRegist")
|
||||
public ApiResponse gameCodeRegist(@RequestHeader String token, HttpServletRequest request, @RequestBody GameCodeVO gameCodeVO) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
try {
|
||||
if(token==null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
JwtManager.TokenInfo tokenInfo = jwtManager.getTokenInfo(token);
|
||||
if(tokenInfo.getType()==null || !tokenInfo.getType().equals("super")) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
log.info("#-gameCodeRegist::"+ gameCodeVO.toString());
|
||||
|
||||
if(gameCodeVO.getGroupCode() == null || gameCodeVO.getGroupCode().equals("")) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
if(gameCodeVO.getGroupCodeNameEN() == null || gameCodeVO.getGroupCodeNameEN().equals("")) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
if(gameCodeVO.getCode() == null || gameCodeVO.getCode().equals("")) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
int result = commonService.gameCodeRegist(gameCodeVO);
|
||||
if(result> 0) {
|
||||
try {
|
||||
HashMap<String, String> logParam = new HashMap<String, String>();
|
||||
logParam.put("siteId", tokenInfo.getMid());
|
||||
logParam.put("memId", tokenInfo.getMid());
|
||||
logParam.put("logType", "save");
|
||||
logParam.put("logoutYn", "");
|
||||
logParam.put("logEndPoint", request.getRequestURI());
|
||||
logParam.put("logName", "SuperApiSettingController.gameCodeRegist() => commonService.gameCodeRegist()");
|
||||
logParam.put("logDesc", gameCodeVO.toString());
|
||||
logParam.put("regId", tokenInfo.getMid());
|
||||
logParam.put("regIp", IPKit.getIpAddressByRequest(request));
|
||||
logParam.put("token", "");
|
||||
commonService.insertAdminlog(logParam);
|
||||
} catch(Exception e) { System.out.print(e.toString()); }
|
||||
|
||||
apiResponse.success();
|
||||
} else {
|
||||
apiResponse.fail();
|
||||
}
|
||||
|
||||
} catch(ApiException e) {
|
||||
log.debug(e.toString());
|
||||
apiResponse = e.getApiResponse();
|
||||
} catch (Exception e) {
|
||||
log.info(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value="/gameCodeUpdate")
|
||||
public ApiResponse gameCodeUpdate(@RequestHeader String token, HttpServletRequest request, @RequestBody GameCodeVO gameCodeVO) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
try {
|
||||
if(token==null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
JwtManager.TokenInfo tokenInfo = jwtManager.getTokenInfo(token);
|
||||
if(tokenInfo.getType()==null || !tokenInfo.getType().equals("super")) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
log.info(gameCodeVO.toString());
|
||||
|
||||
int result = commonService.gameCodeUpdate(gameCodeVO);
|
||||
if(result> 0) {
|
||||
try {
|
||||
HashMap<String, String> logParam = new HashMap<String, String>();
|
||||
logParam.put("siteId", tokenInfo.getMid());
|
||||
logParam.put("memId", tokenInfo.getMid());
|
||||
logParam.put("logType", "save");
|
||||
logParam.put("logoutYn", "");
|
||||
logParam.put("logEndPoint", request.getRequestURI());
|
||||
logParam.put("logName", "SuperApiSettingController.gameCodeUpdate() => commonService.gameCodeUpdate()");
|
||||
logParam.put("logDesc", gameCodeVO.toString());
|
||||
logParam.put("regId", tokenInfo.getMid());
|
||||
logParam.put("regIp", IPKit.getIpAddressByRequest(request));
|
||||
logParam.put("token", "");
|
||||
commonService.insertAdminlog(logParam);
|
||||
} catch(Exception e) { System.out.print(e.toString()); }
|
||||
apiResponse.success();
|
||||
} else {
|
||||
apiResponse.fail();
|
||||
}
|
||||
|
||||
} catch(ApiException e) {
|
||||
log.debug(e.toString());
|
||||
apiResponse = e.getApiResponse();
|
||||
} catch (Exception e) {
|
||||
log.info(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
return apiResponse;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,603 @@
|
||||
package com.bb.admintop.controller;
|
||||
|
||||
import java.net.SocketTimeoutException;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
import org.apache.http.conn.ConnectTimeoutException;
|
||||
import org.codehaus.jettison.json.JSONObject;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.crypto.password.PasswordEncoder;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestHeader;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.client.ResourceAccessException;
|
||||
|
||||
import com.bb.exception.ApiException;
|
||||
import com.bb.jwt.JwtManager;
|
||||
import com.bb.model.ApiResponse;
|
||||
import com.bb.model.ApiVendorCompInfo;
|
||||
import com.bb.model.Member;
|
||||
import com.bb.model.MemberDetail;
|
||||
import com.bb.model.MemberInsert;
|
||||
import com.bb.model.MemberListSearch;
|
||||
import com.bb.model.MemberRate;
|
||||
import com.bb.model.MemberRateVo;
|
||||
import com.bb.model.MemberSearch;
|
||||
import com.bb.model.MemberUpdate;
|
||||
import com.bb.model.NewMemRateItem;
|
||||
import com.bb.model.PageFormVO;
|
||||
import com.bb.model.SiteOption;
|
||||
import com.bb.model.SiteSearch;
|
||||
import com.bb.model.TripleAuthInfo;
|
||||
import com.bb.service.CommonService;
|
||||
import com.bb.service.TripleService;
|
||||
import com.bb.service.UserService;
|
||||
import com.bb.util.IPKit;
|
||||
import com.bb.util.PagingUtil;
|
||||
import com.bb.util.StringUtils;
|
||||
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@RestController
|
||||
@Slf4j
|
||||
@RequestMapping("/api/super/member")
|
||||
@RequiredArgsConstructor
|
||||
@SecurityRequirement(name = "Authorization")
|
||||
public class SuperApiUserController {
|
||||
|
||||
private final JwtManager jwtManager;
|
||||
|
||||
private final CommonService commonService;
|
||||
|
||||
private final UserService userService;
|
||||
|
||||
private final TripleService tripleService;
|
||||
|
||||
private final PasswordEncoder passwordEncoder;
|
||||
|
||||
private final String ISSUER = "super.oms-admin.com";
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value = "/addUser")
|
||||
public ApiResponse addUser(@RequestHeader String token, HttpServletRequest request,
|
||||
@Valid @RequestBody MemberInsert signupMember) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
String LOG_PREFIX = "#-super::join::";
|
||||
|
||||
try {
|
||||
// Site site = getSiteByCheck(request);
|
||||
if (token == null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
if (signupMember.getSiteId() == null || signupMember.getSiteId().equals("")) {
|
||||
throw new ApiException("SS99", "Not Found siteId");
|
||||
}
|
||||
|
||||
JwtManager.TokenInfo tokenInfo = jwtManager.getTokenInfo(token);
|
||||
if (tokenInfo.getType() == null || !tokenInfo.getType().equals("super")) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
LOG_PREFIX = LOG_PREFIX + signupMember.getSiteId() + "::" + signupMember.getMemId() + "::::";
|
||||
|
||||
signupMember.setMemId(signupMember.getMemId().replaceAll(" ", "").replaceAll(" ", "").toLowerCase());
|
||||
if (signupMember.getRecommenderId() == null || signupMember.getRecommenderId().equals("")) {
|
||||
throw new ApiException("U097", "추천인 계정을 입력해주세요.");
|
||||
}
|
||||
|
||||
String refer = request.getHeader("Referer");
|
||||
String domain = "unknown";
|
||||
if (refer != null) {
|
||||
String[] urls = StringUtils.extractUrlParts(refer);
|
||||
domain = urls[2];
|
||||
log.info(LOG_PREFIX + "::domain::" + domain + "::recommandId::" + signupMember.getRecommenderId());
|
||||
}
|
||||
signupMember.setJoinDomain(domain);
|
||||
|
||||
signupMember.setRecommenderId(signupMember.getRecommenderId().replaceAll(" ", "").toLowerCase());
|
||||
|
||||
signupMember.setPartnerType("");
|
||||
signupMember.setMemStatus("1");
|
||||
|
||||
String password = passwordEncoder.encode(signupMember.getMemPass());
|
||||
log.info("[MEMBER PWD:" + password + "]");
|
||||
signupMember.setMemPass(password);
|
||||
|
||||
signupMember.setPartnerLevel("NORMAL");
|
||||
|
||||
signupMember.setRecommendYn("N");
|
||||
signupMember.setPointExchangeYn("Y");
|
||||
signupMember.setRollingYn("Y");
|
||||
signupMember.setCashSendYn("N");
|
||||
signupMember.setCashReceiveYn("N");
|
||||
|
||||
signupMember.setNationCode("");
|
||||
signupMember.setPartSendYn("N");
|
||||
signupMember.setMaxCredit("");
|
||||
signupMember.setCreditRate("");
|
||||
signupMember.setCreditStatus("");
|
||||
|
||||
Member recommendUser = new Member();
|
||||
recommendUser.setSiteId(signupMember.getSiteId());
|
||||
recommendUser.setMemId(signupMember.getRecommenderId());
|
||||
MemberDetail partner = userService.getMember(recommendUser);
|
||||
|
||||
if (partner == null) {
|
||||
throw new ApiException("U096", "존재하지 않는 추천인 계정입니다.");
|
||||
}
|
||||
|
||||
if (partner.getPartnerLevel().equals("COMP") || partner.getPartnerLevel().equals("AUTO")) {
|
||||
throw new ApiException("U099", "추천인으로 사용할 수 없는 계정입니다.");
|
||||
}
|
||||
|
||||
if (partner.getRecommendYn().equals("N")) {
|
||||
throw new ApiException("U099", "추천인으로 사용할 수 없는 계정입니다.");
|
||||
}
|
||||
|
||||
if (!partner.getMemStatus().equals("1")) {
|
||||
throw new ApiException("U114", "추천인으로 사용할 수 없는 계정입니다.");
|
||||
}
|
||||
|
||||
SiteSearch paramSite = new SiteSearch();
|
||||
paramSite.setSiteId(signupMember.getSiteId());
|
||||
SiteOption siteOption = commonService.getSiteSetting(paramSite);
|
||||
if (partner.getPartnerLevel().equals("NORMAL") && siteOption.getUserRecommenderChgYn().equals("N")) {
|
||||
throw new ApiException("U099", "추천인으로 사용할 수 없는 계정입니다.");
|
||||
}
|
||||
|
||||
if (partner.getPartnerLevel().equals("NORMAL") && siteOption.getUserRecommenderChgYn().equals("Y")) {
|
||||
int cnt = userService.getNormalRetailCnt(recommendUser);
|
||||
if (cnt == 10) {
|
||||
// 일반회원 최대 추천인 가능 단계(10) 초과
|
||||
throw new ApiException("U099", "추천인으로 사용할 수 없는 계정입니다.");
|
||||
}
|
||||
}
|
||||
|
||||
Member checkMember = new Member();
|
||||
checkMember.setSiteId(signupMember.getSiteId());
|
||||
checkMember.setMemId(signupMember.getMemId());
|
||||
checkMember.setRecommenderId(signupMember.getRecommenderId());
|
||||
checkMember.setMemName(signupMember.getMemName());
|
||||
checkMember.setMemNick(signupMember.getMemNick());
|
||||
|
||||
int idCheck = userService.idCheck(checkMember);
|
||||
if (idCheck > 0) {
|
||||
throw new ApiException("U005", "idCheck");
|
||||
}
|
||||
|
||||
/*
|
||||
* int idCheckByAdmin =userService.idCheckByAdmin(checkMember);
|
||||
* if(idCheckByAdmin>0) { throw new ApiException("U005", "idCheckByAdmin"); }
|
||||
*/
|
||||
|
||||
int nameCheck = userService.nameCheck(checkMember);
|
||||
if (nameCheck > 0) {
|
||||
throw new ApiException("U006", "nameCheck");
|
||||
}
|
||||
|
||||
if (signupMember.getSiteId().equals(signupMember.getRecommenderId())) {
|
||||
throw new ApiException("U099", "recommenderIdCheck");
|
||||
}
|
||||
|
||||
log.info("Insert Member:" + signupMember);
|
||||
userService.adminJoin(signupMember);
|
||||
|
||||
try {
|
||||
HashMap<String, String> logParam = new HashMap<String, String>();
|
||||
logParam.put("siteId", tokenInfo.getMid());
|
||||
logParam.put("memId", tokenInfo.getMid());
|
||||
logParam.put("logType", "save");
|
||||
logParam.put("logoutYn", "");
|
||||
logParam.put("logEndPoint", request.getRequestURI());
|
||||
logParam.put("logName", "SuperApiUserController.addUser() => UserService.adminJoin()");
|
||||
logParam.put("logDesc", signupMember.toString());
|
||||
logParam.put("regId", tokenInfo.getMid());
|
||||
logParam.put("regIp", IPKit.getIpAddressByRequest(request));
|
||||
logParam.put("token", "");
|
||||
commonService.insertAdminlog(logParam);
|
||||
} catch (Exception e) {
|
||||
System.out.print(e.toString());
|
||||
}
|
||||
|
||||
Member search = new Member();
|
||||
search.setSiteId(signupMember.getSiteId());
|
||||
search.setMemId(signupMember.getMemId());
|
||||
search.setPartnerLevel("NORMAL");
|
||||
|
||||
try {
|
||||
if (signupMember.getRateList() != null) {
|
||||
MemberRate rateparam = new MemberRate();
|
||||
rateparam.setMemId(signupMember.getMemId());
|
||||
rateparam.setRateList(signupMember.getRateList());
|
||||
|
||||
userService.getMemberRateUpdate(search, rateparam);
|
||||
try {
|
||||
HashMap<String, String> logParam = new HashMap<String, String>();
|
||||
logParam.put("siteId", tokenInfo.getMid());
|
||||
logParam.put("memId", tokenInfo.getMid());
|
||||
logParam.put("logType", "save");
|
||||
logParam.put("logoutYn", "");
|
||||
logParam.put("logEndPoint", request.getRequestURI());
|
||||
logParam.put("logName",
|
||||
"SuperApiUserController.addUser() => UserService.getMemberRateUpdate()");
|
||||
logParam.put("logDesc", rateparam.toString());
|
||||
logParam.put("regId", tokenInfo.getMid());
|
||||
logParam.put("regIp", IPKit.getIpAddressByRequest(request));
|
||||
logParam.put("token", "");
|
||||
commonService.insertAdminlog(logParam);
|
||||
} catch (Exception e) {
|
||||
System.out.print(e.toString());
|
||||
}
|
||||
|
||||
/*
|
||||
* userService.getMemberbetYnUpdate(search, rateparam); try{ HashMap<String,
|
||||
* String> logParam = new HashMap<String, String>(); logParam.put("siteId",
|
||||
* tokenInfo.getMid()); logParam.put("memId", tokenInfo.getMid());
|
||||
* logParam.put("logType", "save"); logParam.put("logoutYn", "");
|
||||
* logParam.put("logEndPoint", request.getRequestURI()); logParam.put("logName",
|
||||
* "AdminSuperController.addUser() => UserService.getMemberbetYnUpdate()");
|
||||
* logParam.put("logDesc", rateparam.toString()); logParam.put("regId",
|
||||
* tokenInfo.getMid()); logParam.put("regIp",
|
||||
* IPKit.getIpAddressByRequest(request)); logParam.put("token", "");
|
||||
* commonService.insertAdminlog(logParam); } catch(Exception e) {
|
||||
* System.out.print(e.toString()); }
|
||||
*/
|
||||
}
|
||||
|
||||
} catch (Exception eee) {
|
||||
}
|
||||
|
||||
apiResponse.success();
|
||||
} catch (ApiException e) {
|
||||
log.debug(e.toString());
|
||||
apiResponse = e.getApiResponse();
|
||||
} catch (Exception e) {
|
||||
log.info(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value = { "/memberList" })
|
||||
public ApiResponse memberList(@RequestHeader String token, HttpServletRequest request,
|
||||
@Valid @RequestBody MemberListSearch search) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
try {
|
||||
// Site site = getSiteByCheck(request);
|
||||
if (token == null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
JwtManager.TokenInfo tokenInfo = jwtManager.getTokenInfo(token);
|
||||
|
||||
if (search.getSiteId() == null || search.getSiteId().equals("")) {
|
||||
throw new ApiException("SS99", "Not Found siteId");
|
||||
}
|
||||
|
||||
PageFormVO pageVo = new PageFormVO();
|
||||
if (search.getPage() == 0)
|
||||
search.setPage(1);
|
||||
search.setPartnerType("");
|
||||
search.setSiteId(search.getSiteId());
|
||||
|
||||
if (search.getUserType() == null) {
|
||||
search.setUserType(""); // 전체 검색
|
||||
}
|
||||
|
||||
HashMap totalInfo = userService.getMemberListCnt(search);
|
||||
|
||||
int totalCount = Integer.parseInt(totalInfo.get("totalCnt").toString());
|
||||
if (totalCount != 0) {
|
||||
PageFormVO commonForm = new PageFormVO();
|
||||
commonForm.setFunction_name("goPage");
|
||||
commonForm.setPage(search.getPage());
|
||||
commonForm.setCount_per_page(20);
|
||||
if (search.getCount_per_list() == 0) {
|
||||
commonForm.setCount_per_list(10);
|
||||
} else {
|
||||
commonForm.setCount_per_list(search.getCount_per_list());
|
||||
}
|
||||
commonForm.setTatal_list_count(totalCount);
|
||||
pageVo = PagingUtil.setPageUtil(commonForm);
|
||||
search.setLimit(pageVo.getLimit());
|
||||
search.setOffset(pageVo.getOffset());
|
||||
search.setTatal_list_count(totalCount);
|
||||
|
||||
apiResponse.put("pageInfo", pageVo);
|
||||
|
||||
}
|
||||
|
||||
log.info("[REQUEST: " + request.getRequestURI() + "] " + search);
|
||||
|
||||
List<HashMap> memList = userService.getMemberList(search);
|
||||
apiResponse.put("list", memList);
|
||||
apiResponse.put("totalInfo", totalInfo);
|
||||
|
||||
apiResponse.success();
|
||||
|
||||
} catch (ApiException e) {
|
||||
log.debug(e.toString());
|
||||
apiResponse = e.getApiResponse();
|
||||
} catch (Exception e) {
|
||||
log.info(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value = "/detail")
|
||||
public ApiResponse memberDetail(@RequestHeader String token, HttpServletRequest request,
|
||||
@Valid @RequestBody MemberSearch memberSearch) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
try {
|
||||
// Site site = getSiteByCheck(request);
|
||||
if (token == null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
JwtManager.TokenInfo tokenInfo = jwtManager.getTokenInfo(token);
|
||||
|
||||
if (memberSearch.getSiteId() == null || memberSearch.getSiteId().equals("")) {
|
||||
throw new ApiException("SS99", "Not Found siteId");
|
||||
}
|
||||
|
||||
Member search = new Member();
|
||||
search.setMemId(memberSearch.getMemId());
|
||||
search.setSiteId(memberSearch.getSiteId());
|
||||
|
||||
log.info("[REQUEST: " + request.getRequestURI() + "] " + search);
|
||||
|
||||
HashMap memberDetail = userService.getMemberDetail_1(search);
|
||||
int totalChangePointAmt = userService.getTotalChangePointAmt(search);
|
||||
memberDetail.put("totalChangePointAmt", totalChangePointAmt);
|
||||
memberDetail.put("memPass", "");
|
||||
memberDetail.put("memberCommissionRate", userService.getMemberRate(search));
|
||||
|
||||
List<HashMap> memberFlow = userService.getMemberFlowList(memberDetail);
|
||||
List<HashMap> partnerFlow = userService.getPartnerFlowList(memberDetail);
|
||||
|
||||
apiResponse.put("member", memberDetail);
|
||||
apiResponse.put("memberFlow", memberFlow);
|
||||
apiResponse.put("partnerFlow", partnerFlow);
|
||||
apiResponse.success();
|
||||
|
||||
} catch (ApiException e) {
|
||||
log.debug(e.toString());
|
||||
apiResponse = e.getApiResponse();
|
||||
} catch (Exception e) {
|
||||
log.info(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value = "/modify")
|
||||
public ApiResponse modify(@RequestHeader String token, HttpServletRequest request,
|
||||
@Valid @RequestBody MemberUpdate signupMember) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
try {
|
||||
// Site site = getSiteByCheck(request);
|
||||
if (token == null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
JwtManager.TokenInfo tokenInfo = jwtManager.getTokenInfo(token);
|
||||
if (tokenInfo.getType() == null || !tokenInfo.getType().equals("super")) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
if (signupMember.getSiteId() == null || signupMember.getSiteId().equals("")) {
|
||||
throw new ApiException("SS99", "Not Found siteId");
|
||||
}
|
||||
|
||||
signupMember.setUpdId(tokenInfo.getMid());
|
||||
|
||||
if (signupMember.getMemPass() != null && !signupMember.getMemPass().equals("")) {
|
||||
String password = passwordEncoder.encode(signupMember.getMemPass());
|
||||
log.info("[MEMBER PWD:" + password + "]");
|
||||
signupMember.setMemPass(password);
|
||||
}
|
||||
|
||||
log.info("[REQUEST: " + request.getRequestURI() + "] " + signupMember);
|
||||
userService.updateMember(signupMember);
|
||||
|
||||
try {
|
||||
HashMap<String, String> logParam = new HashMap<String, String>();
|
||||
logParam.put("siteId", tokenInfo.getMid());
|
||||
logParam.put("memId", tokenInfo.getMid());
|
||||
logParam.put("logType", "save");
|
||||
logParam.put("logoutYn", "");
|
||||
logParam.put("logEndPoint", request.getRequestURI());
|
||||
logParam.put("logName", "SuperApiUserController.modify() => UserService.updateMember()");
|
||||
logParam.put("logDesc", signupMember.toString());
|
||||
logParam.put("regId", tokenInfo.getMid());
|
||||
logParam.put("regIp", IPKit.getIpAddressByRequest(request));
|
||||
logParam.put("token", "");
|
||||
commonService.insertAdminlog(logParam);
|
||||
} catch (Exception e) {
|
||||
System.out.print(e.toString());
|
||||
}
|
||||
|
||||
apiResponse.success();
|
||||
|
||||
} catch (ResourceAccessException rae) {
|
||||
if (rae.getCause() instanceof ConnectTimeoutException) {
|
||||
log.error("[ConnectTimeoutException]" + rae.getMessage());
|
||||
apiResponse.setResultCode("TE99");
|
||||
apiResponse.setResultMessage("ConnectTimeoutException");
|
||||
}
|
||||
|
||||
if (rae.getCause() instanceof SocketTimeoutException) {
|
||||
log.error("[SocketTimeoutException]" + rae.getMessage());
|
||||
apiResponse.setResultCode("TE99");
|
||||
apiResponse.setResultMessage("SocketTimeoutException");
|
||||
}
|
||||
|
||||
if (rae.getCause() instanceof InterruptedException) {
|
||||
log.error("[InterruptedException]" + rae.getMessage());
|
||||
apiResponse.setResultCode("TE99");
|
||||
apiResponse.setResultMessage("InterruptedException");
|
||||
}
|
||||
} catch (ApiException e) {
|
||||
log.debug(e.toString());
|
||||
apiResponse = e.getApiResponse();
|
||||
} catch (Exception e) {
|
||||
log.info(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value = "/updateRate")
|
||||
public ApiResponse updateRate(@RequestHeader String token, HttpServletRequest request,
|
||||
@Valid @RequestBody MemberRate memberRate) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
try {
|
||||
// System.out.println("ddd" + request.getAttribute("Authorization").toString());
|
||||
// Site site = getSiteByCheck(request);
|
||||
if (token == null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
JwtManager.TokenInfo tokenInfo = jwtManager.getTokenInfo(token);
|
||||
if (tokenInfo.getType() == null || !tokenInfo.getType().equals("super")) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
Member search = new Member();
|
||||
search.setSiteId(memberRate.getSiteId());
|
||||
search.setMemId(memberRate.getMemId());
|
||||
search.setPartnerLevel("NORMAL");
|
||||
|
||||
MemberDetail member = userService.getMember(search);
|
||||
if (member == null) {
|
||||
throw new ApiException("U003", "unknown user");
|
||||
}
|
||||
search.setPartnerLevel(member.getPartnerLevel());
|
||||
|
||||
log.info("[REQUEST: " + request.getRequestURI() + "] " + memberRate);
|
||||
|
||||
/*
|
||||
* MemberDetail myInfo = userService.getMember(search); Member topSearch = new
|
||||
* Member(); topSearch.setSiteId(search.getSiteId());
|
||||
* topSearch.setMemId(myInfo.getRecommenderId()); List<HashMap> topRateList =
|
||||
* userService.getMemberRateByNormal(topSearch); for(MemberRateVo
|
||||
* mvo:memberRate.getRateList()) { String botCode = mvo.getGameType(); Double
|
||||
* botPR = Double.valueOf(mvo.getPointRate()); Double botLR =
|
||||
* Double.valueOf(mvo.getLoseRate());
|
||||
*
|
||||
* for(HashMap topRate : topRateList) { String topCode =
|
||||
* topRate.get("gameType").toString(); Double topPR =
|
||||
* Double.valueOf(topRate.get("pointRate").toString()); Double topLR =
|
||||
* Double.valueOf(topRate.get("loseRate").toString());
|
||||
* if(botCode.equals(topCode)) { if(botPR > topPR || botLR > topLR) {
|
||||
* log.info("## updateRate ## botCode : " + botCode + ", topCode : " + topCode);
|
||||
* log.info("## updateRate ## botPR : " + botPR + ", topPR : " + topPR);
|
||||
* log.info("## updateRate ## botLR : " + botLR + ", topLR : " + topLR); String
|
||||
* resultMsg = "["+topRate.get("codeName").toString()+"] 롤링:"+topPR+", 루징:"
|
||||
* +topLR+" 보다 작은값을 입력하세요"; log.info("## updateRate ## resultMsg : " +
|
||||
* resultMsg);
|
||||
*
|
||||
* throw new ApiException("U031", resultMsg); } } } }
|
||||
*/
|
||||
|
||||
NewMemRateItem rateItem = new NewMemRateItem();
|
||||
rateItem.setSiteId(memberRate.getSiteId());
|
||||
rateItem.setMemId(memberRate.getMemId());
|
||||
List<NewMemRateItem> myRateList = userService.getMemRateItemList(rateItem);
|
||||
for (MemberRateVo mvo : memberRate.getRateList()) {
|
||||
String vendorCode = mvo.getGameType();
|
||||
Double pointRate = Double.valueOf(mvo.getPointRate());
|
||||
Double loseRate = Double.valueOf(mvo.getLoseRate());
|
||||
|
||||
for (NewMemRateItem myRateInfo : myRateList) {
|
||||
String myCode = myRateInfo.getVendorCode();
|
||||
Double maxPointRate = myRateInfo.getMaxPointRate();
|
||||
Double minPointRate = myRateInfo.getMinPointRate();
|
||||
Double maxLoseRate = myRateInfo.getMaxLoseRate();
|
||||
Double minLoseRate = myRateInfo.getMinLoseRate();
|
||||
if (vendorCode.equals(myCode)) {
|
||||
if (maxPointRate < pointRate || minPointRate > pointRate) {
|
||||
log.info("#-updateRate::" + myRateInfo.getSiteId() + "::" + myRateInfo.getMemId()
|
||||
+ "::vendorcode::" + myCode + "::pointRate::" + pointRate);
|
||||
log.info("#-updateRate::" + myRateInfo.getSiteId() + "::" + myRateInfo.getMemId()
|
||||
+ "::vendorcode::" + myCode + "::MaxPointRate::" + maxPointRate + "::MinPointRate::"
|
||||
+ minPointRate);
|
||||
String resultMsg = "롤링:" + "::vendorcode::" + myCode + "::" + maxPointRate + ", "
|
||||
+ minPointRate + " 사이값을 입력하세요";
|
||||
log.info("#-updateRate::" + myRateInfo.getSiteId() + "::" + myRateInfo.getMemId()
|
||||
+ "::vendorcode::" + myCode + "::resultMsg : " + resultMsg);
|
||||
throw new ApiException("U031", resultMsg);
|
||||
}
|
||||
|
||||
if (maxLoseRate < loseRate || minLoseRate > loseRate) {
|
||||
log.info("#-updateRate::" + myRateInfo.getSiteId() + "::" + myRateInfo.getMemId()
|
||||
+ "::vendorcode::" + myCode + "::loseRate::" + loseRate);
|
||||
log.info("#-updateRate::" + myRateInfo.getSiteId() + "::" + myRateInfo.getMemId()
|
||||
+ "::vendorcode::" + myCode + "::MaxLoseRate::" + maxLoseRate + "::MinLoseRate::"
|
||||
+ minLoseRate);
|
||||
String resultMsg = "루징:" + "::vendorcode::" + myCode + "::" + maxLoseRate + ", "
|
||||
+ minLoseRate + " 사이값을 입력하세요";
|
||||
log.info("#-updateRate::" + myRateInfo.getSiteId() + "::" + myRateInfo.getMemId()
|
||||
+ "::vendorcode::" + myCode + "::resultMsg : " + resultMsg);
|
||||
throw new ApiException("U031", resultMsg);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
userService.getMemberRateUpdate(search, memberRate);
|
||||
|
||||
try {
|
||||
HashMap<String, String> logParam = new HashMap<String, String>();
|
||||
logParam.put("siteId", tokenInfo.getMid());
|
||||
logParam.put("memId", tokenInfo.getMid());
|
||||
logParam.put("logType", "save");
|
||||
logParam.put("logoutYn", "");
|
||||
logParam.put("logEndPoint", request.getRequestURI());
|
||||
logParam.put("logName", "SuperApiUserController.updateRate() => UserService.getMemberRateUpdate()");
|
||||
logParam.put("logDesc", memberRate.toString());
|
||||
logParam.put("regId", tokenInfo.getMid());
|
||||
logParam.put("regIp", IPKit.getIpAddressByRequest(request));
|
||||
logParam.put("token", "");
|
||||
commonService.insertAdminlog(logParam);
|
||||
} catch (Exception e) {
|
||||
System.out.print(e.toString());
|
||||
}
|
||||
|
||||
apiResponse.success();
|
||||
|
||||
} catch (ApiException e) {
|
||||
log.debug(e.toString());
|
||||
apiResponse = e.getApiResponse();
|
||||
} catch (Exception e) {
|
||||
log.info(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,208 @@
|
||||
package com.bb.admintop.controller;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestHeader;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.bb.exception.ApiException;
|
||||
import com.bb.jwt.JwtManager;
|
||||
import com.bb.model.ApiResponse;
|
||||
import com.bb.model.SiteSearch;
|
||||
import com.bb.service.CompService;
|
||||
import com.bb.service.VendorService;
|
||||
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.sf.json.JSONObject;
|
||||
|
||||
@RestController
|
||||
@Slf4j
|
||||
@RequestMapping("/api/super/vendor")
|
||||
@RequiredArgsConstructor
|
||||
@SecurityRequirement(name = "Authorization")
|
||||
public class SuperApiVendorController {
|
||||
|
||||
private final JwtManager jwtManager;
|
||||
|
||||
private final CompService compService;
|
||||
|
||||
private final VendorService vendorService;
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value = "/nexusSkinInfo")
|
||||
public ApiResponse nexusSkinInfo(@RequestHeader String token, HttpServletRequest request,
|
||||
@RequestBody SiteSearch search) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
final String LOG_PREFIX = "#-super::nexusSkinInfo::" + search.getSiteId() + "::::";
|
||||
|
||||
try {
|
||||
// Site site = getSiteByCheck(request);
|
||||
if (token == null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
log.info(LOG_PREFIX + "Request::" + search.toString());
|
||||
if (search.getSiteId() == null || search.getSiteId().equals("")) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
HashMap<String, Object> tripleSiteInfo = compService.getTripleCreditInfo(search.getSiteId());
|
||||
|
||||
List<HashMap<String, Object>> skinInfo = vendorService.getNexusSkinInfo(tripleSiteInfo);
|
||||
for (HashMap<String, Object> item : skinInfo) {
|
||||
long vendorIdx = (long) item.get("vendorIdx");
|
||||
HashMap<String, Object> vendorInfo = new HashMap<>();
|
||||
vendorInfo.put("vendorIdx", vendorIdx);
|
||||
|
||||
List<HashMap<String, Object>> skinList = vendorService.getNexusSkinList(vendorInfo);
|
||||
item.put("skinList", skinList);
|
||||
}
|
||||
|
||||
apiResponse.put("skinInfo", skinInfo);
|
||||
apiResponse.success();
|
||||
|
||||
} catch (ApiException e) {
|
||||
apiResponse = e.getApiResponse();
|
||||
log.error(LOG_PREFIX + "ApiException::" + e.getApiResponse());
|
||||
} catch (Exception e) {
|
||||
log.error(LOG_PREFIX + "Exception::" + e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
|
||||
log.error(LOG_PREFIX + "Response::" + apiResponse.toString());
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value = "/nexusSkinList")
|
||||
public ApiResponse nexusSkinList(@RequestHeader String token, HttpServletRequest request,
|
||||
@RequestBody JSONObject requestObj) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
final String LOG_PREFIX = "#-super::nexusSkinList::" + requestObj.getString("siteId") + "::::";
|
||||
log.info(LOG_PREFIX + "Request::" + requestObj.toString());
|
||||
|
||||
try {
|
||||
// Site site = getSiteByCheck(request);
|
||||
if (token == null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
if (requestObj.getString("siteId") == null || requestObj.getString("siteId").equals("")) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
HashMap<String, Object> vendorInfo = new HashMap<>();
|
||||
vendorInfo.put("vendorIdx", requestObj.getInt("vendorIdx"));
|
||||
|
||||
List<HashMap<String, Object>> skinList = vendorService.getNexusSkinList(vendorInfo);
|
||||
|
||||
apiResponse.put("skinList", skinList);
|
||||
apiResponse.success();
|
||||
|
||||
} catch (ApiException e) {
|
||||
apiResponse = e.getApiResponse();
|
||||
log.error(LOG_PREFIX + "ApiException::" + e.getApiResponse());
|
||||
} catch (Exception e) {
|
||||
log.error(LOG_PREFIX + "Exception::" + e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
|
||||
log.error(LOG_PREFIX + "Response::" + apiResponse.toString());
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value = "/nexusSkinUpdate")
|
||||
public ApiResponse nexusSkinUpdate(@RequestHeader String token, HttpServletRequest request,
|
||||
@RequestBody JSONObject requestObj) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
final String LOG_PREFIX = "#-super::nexusSkinUpdate::" + requestObj.getString("siteId") + "::::";
|
||||
log.info(LOG_PREFIX + "Request::" + requestObj.toString());
|
||||
|
||||
try {
|
||||
// Site site = getSiteByCheck(request);
|
||||
if (token == null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
if (requestObj.getString("siteId") == null || requestObj.getString("siteId").equals("")) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
HashMap<String, Object> skinInfo = new HashMap<>();
|
||||
skinInfo.put("siteIdx", requestObj.getInt("siteIdx"));
|
||||
skinInfo.put("vendorIdx", requestObj.getInt("vendorIdx"));
|
||||
skinInfo.put("nexusSkinType", requestObj.getString("nexusSkinType"));
|
||||
|
||||
int updResult = vendorService.nexusSkinUpdate(skinInfo);
|
||||
log.info(LOG_PREFIX + "nexusSkinUpdate Result::" + updResult);
|
||||
|
||||
HashMap<String, Object> skin = vendorService.getNexusSkin(skinInfo);
|
||||
skin.put("siteId", requestObj.getString("siteId"));
|
||||
updResult = compService.updateVendoMinMax(skin);
|
||||
log.info(LOG_PREFIX + "updateVendoMinMax Result::" + updResult);
|
||||
|
||||
apiResponse.success();
|
||||
|
||||
} catch (ApiException e) {
|
||||
apiResponse = e.getApiResponse();
|
||||
log.error(LOG_PREFIX + "ApiException::" + e.getApiResponse());
|
||||
} catch (Exception e) {
|
||||
log.error(LOG_PREFIX + "Exception::" + e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
|
||||
log.error(LOG_PREFIX + "Response::" + apiResponse.toString());
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value = "/list")
|
||||
public ApiResponse vendorList(@RequestHeader String token, HttpServletRequest request,
|
||||
@RequestBody SiteSearch search) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
final String LOG_PREFIX = "#-super::vendorList::" + search.getSiteId() + "::::";
|
||||
|
||||
try {
|
||||
// Site site = getSiteByCheck(request);
|
||||
if (token == null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
log.info(LOG_PREFIX + "Request::" + search.toString());
|
||||
if (search.getSiteId() == null || search.getSiteId().equals("")) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
HashMap<String, Object> tripleSiteInfo = compService.getTripleCreditInfo(search.getSiteId());
|
||||
|
||||
List<HashMap<String, Object>> vendorList = vendorService.getTripleVendorList(tripleSiteInfo);
|
||||
|
||||
apiResponse.put("vendorList", vendorList);
|
||||
apiResponse.success();
|
||||
|
||||
} catch (ApiException e) {
|
||||
apiResponse = e.getApiResponse();
|
||||
log.error(LOG_PREFIX + "ApiException::" + e.getApiResponse());
|
||||
} catch (Exception e) {
|
||||
log.error(LOG_PREFIX + "Exception::" + e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
|
||||
log.error(LOG_PREFIX + "Response::" + apiResponse.toString());
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
}
|
||||
348
src/main/java/com/bb/common/controller/CommonApiController.java
Normal file
348
src/main/java/com/bb/common/controller/CommonApiController.java
Normal file
@@ -0,0 +1,348 @@
|
||||
package com.bb.common.controller;
|
||||
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import javax.crypto.Cipher;
|
||||
import javax.crypto.spec.SecretKeySpec;
|
||||
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestHeader;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.bb.exception.ApiException;
|
||||
import com.bb.jwt.JwtManager;
|
||||
import com.bb.model.ApiResponse;
|
||||
import com.bb.model.CodeSearch;
|
||||
import com.bb.model.Member;
|
||||
import com.bb.model.MemberCheckVo;
|
||||
import com.bb.model.Site;
|
||||
import com.bb.model.SiteCheckReq;
|
||||
import com.bb.model.SiteOption;
|
||||
import com.bb.model.SiteSearch;
|
||||
import com.bb.service.CommonService;
|
||||
import com.bb.service.CompService;
|
||||
import com.bb.service.UserService;
|
||||
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
|
||||
|
||||
@RestController
|
||||
@Slf4j
|
||||
@RequestMapping("/api/common")
|
||||
@RequiredArgsConstructor
|
||||
public class CommonApiController {
|
||||
|
||||
private final CommonService commonService;
|
||||
|
||||
private final UserService userService;
|
||||
|
||||
private final CompService compService;
|
||||
|
||||
private final JwtManager jwtManager;
|
||||
|
||||
public static String securityKey = "20cb7d92d7ac36900840a5fda92286ff";
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value="/code")
|
||||
public ApiResponse codes(HttpServletRequest request, @RequestBody CodeSearch codesSearch) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
try {
|
||||
List<HashMap> codeList = commonService.getCodeList(codesSearch);
|
||||
apiResponse.put("codes", codeList);
|
||||
apiResponse.put("codesSearch",codesSearch);
|
||||
} catch (Exception e) {
|
||||
log.info(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value="/gameCodes")
|
||||
public ApiResponse gameCodes(HttpServletRequest request, @RequestBody CodeSearch codesSearch) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
try {
|
||||
|
||||
Site site = getSiteByCheck(request);
|
||||
if(site==null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
codesSearch.setSiteId(site.getSiteId());
|
||||
|
||||
List<HashMap> codeList = commonService.getGameCodes(codesSearch);
|
||||
apiResponse.put("codes", codeList);
|
||||
apiResponse.put("codesSearch",codesSearch);
|
||||
} catch (Exception e) {
|
||||
log.info(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value="/gameGroupCodes")
|
||||
public ApiResponse gameGroupCodes(HttpServletRequest request) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
try {
|
||||
|
||||
Site site = getSiteByCheck(request);
|
||||
if(site==null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
String siteId = site.getSiteId();
|
||||
List<HashMap> codeList = commonService.getGameGroupCodes(siteId);
|
||||
apiResponse.put("groupCodes", codeList);
|
||||
} catch (Exception e) {
|
||||
log.info(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value="/rateCategory")
|
||||
public ApiResponse rateCategory(HttpServletRequest request, @RequestHeader String token) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
try {
|
||||
|
||||
if(token==null) {
|
||||
throw new ApiException("1000", "accessDinied");
|
||||
}
|
||||
|
||||
JwtManager.TokenInfo tokenInfo = jwtManager.getTokenInfo(token);
|
||||
|
||||
String siteId = tokenInfo.getSid();
|
||||
List<HashMap> codeList = commonService.getRateCategory(siteId);
|
||||
apiResponse.put("category", codeList);
|
||||
} catch (Exception e) {
|
||||
log.info(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value="/siteCheckInfo")
|
||||
public ApiResponse siteCheckInfo(HttpServletRequest request, @RequestBody SiteCheckReq siteCheckReq) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
try {
|
||||
HashMap detail = commonService.siteCheckInfo(siteCheckReq);
|
||||
if(detail == null) {
|
||||
SiteSearch search = new SiteSearch();
|
||||
search.setSiteId(siteCheckReq.getSiteId());
|
||||
SiteOption option = commonService.getSiteSetting(search);
|
||||
if(option.getSiteCheckYn().equals("Y")) {
|
||||
detail = new HashMap<>();
|
||||
detail.put("siteCheckIdx", 0);
|
||||
detail.put("siteId", siteCheckReq.getSiteId());
|
||||
detail.put("checkType", "site");
|
||||
detail.put("checkTypeName", "사이트점검");
|
||||
detail.put("checkCode", "site");
|
||||
detail.put("checkCodeName", "사이트점검");
|
||||
DateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
long sDateL = System.currentTimeMillis();
|
||||
long eDateL = sDateL + (1000 * 60 * 60 * 24);
|
||||
String sDateStr = sdf.format(sDateL);
|
||||
String eDateStr = sdf.format(eDateL);
|
||||
detail.put("startDate", sDateStr);
|
||||
detail.put("endDate", eDateStr);
|
||||
detail.put("isEmergency", "Y");
|
||||
detail.put("isCheckOff", "N");
|
||||
detail.put("siteCheckStatus", "open");
|
||||
detail.put("contents", "사이트 점검입니다. 조속히 마무리 하겠습니다. 감사합니다.");
|
||||
}
|
||||
}
|
||||
apiResponse.put("siteCheckInfo", detail);
|
||||
apiResponse.success();
|
||||
|
||||
} catch (Exception e) {
|
||||
log.info(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value="/isOtpLogin")
|
||||
public ApiResponse isOtpLogin(HttpServletRequest request, @RequestBody SiteSearch search) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
try {
|
||||
String adminOtpYN = compService.getAdminOtpUseYN(search.getSiteId());
|
||||
apiResponse.put("useOtp", adminOtpYN);
|
||||
apiResponse.success();
|
||||
|
||||
} catch (Exception e) {
|
||||
log.info(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
return apiResponse;
|
||||
} // Duplicate check
|
||||
|
||||
|
||||
@ResponseBody
|
||||
@PostMapping(value="/duplicateCheck")
|
||||
public ApiResponse duplicateCheck(HttpServletRequest request, @RequestBody MemberCheckVo search) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
try {
|
||||
log.info("[REQUEST: "+request.getRequestURI()+"] " + search);
|
||||
Member checkMember = new Member();
|
||||
checkMember.setSiteId(search.getSiteId());
|
||||
checkMember.setMemId(search.getMemId());
|
||||
checkMember.setMemNick(search.getMemNick());
|
||||
|
||||
if(search.getCheckType().equals("memId")) {
|
||||
// ID Check
|
||||
int idCheck = userService.idCheck(checkMember);
|
||||
int result = idCheck;
|
||||
//int idCheckByAdmin = userService.idCheckByAdmin(checkMember);
|
||||
//int result = idCheck + idCheckByAdmin;
|
||||
|
||||
if(result == 0) {
|
||||
apiResponse.put("checkType", "memId");
|
||||
apiResponse.put("checkResult", "succ");
|
||||
} else {
|
||||
apiResponse.put("checkType", "memId");
|
||||
apiResponse.put("checkResult", "duplicate");
|
||||
}
|
||||
|
||||
} else if(search.getCheckType().equals("memNick")) {
|
||||
// NickName Check
|
||||
int nickNameCheck = userService.nameCheck(checkMember);
|
||||
if(nickNameCheck == 0) {
|
||||
apiResponse.put("checkType", "memNick");
|
||||
apiResponse.put("checkResult", "succ");
|
||||
} else {
|
||||
apiResponse.put("checkType", "memNick");
|
||||
apiResponse.put("checkResult", "duplicate");
|
||||
}
|
||||
} else {
|
||||
apiResponse.fail();
|
||||
}
|
||||
|
||||
apiResponse.success();
|
||||
|
||||
} catch (Exception e) {
|
||||
log.info(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
|
||||
@PostMapping(value="/test")
|
||||
public ApiResponse test(HttpServletRequest request) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
try {
|
||||
String message = "박도울";
|
||||
SecretKeySpec skeySpec = new SecretKeySpec(hexStringToByteArray(securityKey), "AES");
|
||||
|
||||
// Instantiate the cipher
|
||||
Cipher cipher = Cipher.getInstance("AES");
|
||||
cipher.init(Cipher.ENCRYPT_MODE, skeySpec);
|
||||
byte[] encrypted = cipher.doFinal(message.getBytes("EUC-KR"));
|
||||
System.out.println(byteArrayToHex(encrypted));
|
||||
|
||||
} catch (Exception e) {
|
||||
log.info(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
@PostMapping(value="/test2")
|
||||
public ApiResponse test2(HttpServletRequest request) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
try {
|
||||
HashMap data = commonService.getSessionTransactionIsolation();
|
||||
apiResponse.put("data", data);
|
||||
} catch (Exception e) {
|
||||
log.info(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
@PostMapping(value="/test3")
|
||||
public ApiResponse test3(HttpServletRequest request, @RequestBody String param) throws Exception {
|
||||
ApiResponse apiResponse = new ApiResponse();
|
||||
try {
|
||||
log.info("###-test3::::param::"+param);
|
||||
String[] gameNameArr = param.split("\\|\\|");
|
||||
String gameName = "Golden Wealth Baccarat";
|
||||
boolean isMatchKeyword = false;
|
||||
|
||||
for(int i=0; i<gameNameArr.length; i++) {
|
||||
if(gameName.equals(gameNameArr[i])) {
|
||||
isMatchKeyword = true;
|
||||
log.info("###-test3::::gameName::"+gameName+",keyword::"+gameNameArr[i]+"::is match");
|
||||
break;
|
||||
}
|
||||
log.info("###-test3::::gameNameArr::"+gameNameArr[i]);
|
||||
}
|
||||
|
||||
apiResponse.put("data", param);
|
||||
} catch (Exception e) {
|
||||
log.info(e.toString());
|
||||
e.printStackTrace();
|
||||
apiResponse.fail();
|
||||
}
|
||||
|
||||
return apiResponse;
|
||||
}
|
||||
|
||||
|
||||
public static String byteArrayToHex(byte[] ba) {
|
||||
if (ba == null || ba.length == 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
StringBuffer sb = new StringBuffer(ba.length * 2);
|
||||
String hexNumber;
|
||||
|
||||
for (int x = 0; x < ba.length; x++) {
|
||||
hexNumber = "0" + Integer.toHexString(0xff & ba[x]);
|
||||
sb.append(hexNumber.substring(hexNumber.length() - 2));
|
||||
}
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
//hex->byte 변환
|
||||
public static byte[] hexStringToByteArray(String s) {
|
||||
int len = s.length();
|
||||
byte[] data = new byte[len / 2];
|
||||
for (int i = 0; i < len; i += 2) {
|
||||
data[i / 2] = (byte) ((Character.digit(s.charAt(i), 16) << 4) + Character.digit(s.charAt(i+1), 16));
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
private Site getSiteByCheck(HttpServletRequest request) {
|
||||
Site site = userService.getSiteInfoByKey(request.getHeader("Authorization").toString());
|
||||
return site;
|
||||
}
|
||||
}
|
||||
38
src/main/java/com/bb/config/ApiKeyFilter.java
Normal file
38
src/main/java/com/bb/config/ApiKeyFilter.java
Normal file
@@ -0,0 +1,38 @@
|
||||
package com.bb.config;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import jakarta.servlet.Filter;
|
||||
import jakarta.servlet.FilterChain;
|
||||
import jakarta.servlet.ServletException;
|
||||
import jakarta.servlet.ServletRequest;
|
||||
import jakarta.servlet.ServletResponse;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
|
||||
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
|
||||
import com.bb.util.StringUtils;
|
||||
|
||||
@Component
|
||||
public class ApiKeyFilter implements Filter {
|
||||
|
||||
@Override
|
||||
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
|
||||
HttpServletRequest req = (HttpServletRequest) request;
|
||||
HttpServletResponse res = (HttpServletResponse) response;
|
||||
|
||||
|
||||
String reqKey = req.getHeader("Authorization");
|
||||
|
||||
if (StringUtils.isEmpty(reqKey)) {
|
||||
res.setStatus(HttpStatus.UNAUTHORIZED.value());
|
||||
} else {
|
||||
request.setAttribute("Authorization", reqKey);
|
||||
chain.doFilter(request, response);
|
||||
}
|
||||
}
|
||||
}
|
||||
44
src/main/java/com/bb/config/AsyncConfig.java
Normal file
44
src/main/java/com/bb/config/AsyncConfig.java
Normal file
@@ -0,0 +1,44 @@
|
||||
package com.bb.config;
|
||||
|
||||
import java.util.concurrent.Executor;
|
||||
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.scheduling.annotation.AsyncConfigurerSupport;
|
||||
import org.springframework.scheduling.annotation.EnableAsync;
|
||||
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
||||
|
||||
@Configuration
|
||||
@EnableAsync
|
||||
public class AsyncConfig extends AsyncConfigurerSupport {
|
||||
|
||||
// 기본 실행 대기하는 Thread의 수
|
||||
private final int CORE_POOL_SIZE = 20;
|
||||
|
||||
// 동시 동작하는 최대 Thread의 수
|
||||
private final int MAX_POOL_SIZE = 100;
|
||||
|
||||
// MaxPoolSize 초과 요청에서 Thread 생성 요청 시, 해당 요청을 Queue에 저장하는데 이때 최대 수용 가능한 Queue의 수
|
||||
private final int QUEUE_CAPACITY = 1000;
|
||||
|
||||
// maxPoolSize가 모두 사용되다가 idle(쓰레드 휴식상태)로 돌아갔을 때 종료하기까지 대기하는 걸리는 시간
|
||||
private final int KEEP_ALIVE_SECONDS = 60;
|
||||
|
||||
// 생성되는 Thread 접두사 지정
|
||||
private final String CUSTOM_THREAD_NAME_PREFIX = "BET-ASYNC-";
|
||||
|
||||
// 시스템을 종료(shutdown)할 때 queue에 남아있는 작업을 모두 완료한 후 종료 하도록 처리
|
||||
private final boolean WAIT_FOR_TASKS_TO_COMPLETE_ON_SHOUTDOWN = true;
|
||||
|
||||
@Override
|
||||
public Executor getAsyncExecutor() {
|
||||
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
|
||||
executor.setCorePoolSize(CORE_POOL_SIZE);
|
||||
executor.setMaxPoolSize(MAX_POOL_SIZE);
|
||||
executor.setQueueCapacity(QUEUE_CAPACITY);
|
||||
executor.setKeepAliveSeconds(KEEP_ALIVE_SECONDS);
|
||||
executor.setThreadNamePrefix(CUSTOM_THREAD_NAME_PREFIX);
|
||||
executor.setWaitForTasksToCompleteOnShutdown(WAIT_FOR_TASKS_TO_COMPLETE_ON_SHOUTDOWN);
|
||||
executor.initialize();
|
||||
return executor;
|
||||
}
|
||||
}
|
||||
35
src/main/java/com/bb/config/AuthFailureHandler.java
Normal file
35
src/main/java/com/bb/config/AuthFailureHandler.java
Normal file
@@ -0,0 +1,35 @@
|
||||
package com.bb.config;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import jakarta.servlet.ServletException;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import javax.xml.transform.Result;
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
|
||||
import org.springframework.security.core.AuthenticationException;
|
||||
import org.springframework.security.web.authentication.SimpleUrlAuthenticationFailureHandler;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* 로그인 실패 핸들러
|
||||
*
|
||||
* @author wedul
|
||||
*
|
||||
*/
|
||||
@Component
|
||||
public class AuthFailureHandler extends SimpleUrlAuthenticationFailureHandler {
|
||||
|
||||
@Override
|
||||
public void onAuthenticationFailure(HttpServletRequest request, HttpServletResponse response,
|
||||
AuthenticationException exception) throws IOException, ServletException {
|
||||
|
||||
ObjectMapper om = new ObjectMapper();
|
||||
response.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
|
||||
//response.getWriter().print(om.writeValueAsString("FAIL"));
|
||||
//response.getWriter().flush();
|
||||
response.sendRedirect(request.getContextPath() + "/login");
|
||||
}
|
||||
}
|
||||
81
src/main/java/com/bb/config/AuthProvider.java
Normal file
81
src/main/java/com/bb/config/AuthProvider.java
Normal file
@@ -0,0 +1,81 @@
|
||||
package com.bb.config;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.authentication.AuthenticationProvider;
|
||||
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
|
||||
import org.springframework.security.core.Authentication;
|
||||
import org.springframework.security.core.AuthenticationException;
|
||||
import org.springframework.security.core.GrantedAuthority;
|
||||
import org.springframework.security.core.authority.SimpleGrantedAuthority;
|
||||
import org.springframework.security.crypto.password.PasswordEncoder;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.bb.front.ApiMemberController;
|
||||
import com.bb.model.Site;
|
||||
import com.bb.service.UserService;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Description: 스프링시큐리티 로그인 인증
|
||||
* Path : 스프링시큐리티
|
||||
* @FileName : AsRepairController.java
|
||||
* @Version : 2019. 8. 27.
|
||||
* @Author : LeeChunghan
|
||||
* @Comment :
|
||||
*/
|
||||
@Slf4j
|
||||
@Component("authProvider")
|
||||
public class AuthProvider implements AuthenticationProvider {
|
||||
|
||||
@Autowired
|
||||
private UserService userService;
|
||||
|
||||
@Autowired
|
||||
private PasswordEncoder passwordEncoder;
|
||||
|
||||
@Override
|
||||
public Authentication authenticate(Authentication authentication) throws AuthenticationException {
|
||||
String id = authentication.getName();
|
||||
String password = authentication.getCredentials().toString();
|
||||
String encodePassword = passwordEncoder.encode(password);
|
||||
log.info("[PWD:" + encodePassword + "]");
|
||||
|
||||
HashMap param = new HashMap();
|
||||
param.put("siteId", id);
|
||||
param.put("sitePass", password);
|
||||
|
||||
Site loginMember = userService.swaggerlogin(param);
|
||||
boolean chkPassword = passwordEncoder.matches(password, loginMember.getSitePass());
|
||||
log.info("[ADMIN chkPassword:" + chkPassword + "]");
|
||||
|
||||
if(!chkPassword) {
|
||||
return null;
|
||||
} else {
|
||||
Site loginVO = new Site();
|
||||
loginVO = loginMember;
|
||||
|
||||
List<GrantedAuthority> roles = new ArrayList<GrantedAuthority>();
|
||||
roles.add(new SimpleGrantedAuthority("SITE"));
|
||||
|
||||
UsernamePasswordAuthenticationToken result = new UsernamePasswordAuthenticationToken(id, password, roles);
|
||||
result.setDetails(loginVO);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supports(Class<?> authentication) {
|
||||
return authentication.equals(UsernamePasswordAuthenticationToken.class);
|
||||
}
|
||||
|
||||
}
|
||||
106
src/main/java/com/bb/config/AuthSuccessHandler.java
Normal file
106
src/main/java/com/bb/config/AuthSuccessHandler.java
Normal file
@@ -0,0 +1,106 @@
|
||||
package com.bb.config;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import jakarta.servlet.ServletException;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.servlet.http.HttpSession;
|
||||
|
||||
import com.bb.dao.UserDao;
|
||||
import com.bb.model.Site;
|
||||
import com.bb.util.IPKit;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
|
||||
|
||||
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.core.Authentication;
|
||||
import org.springframework.security.core.context.SecurityContextHolder;
|
||||
import org.springframework.security.web.authentication.SimpleUrlAuthenticationSuccessHandler;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* Description: 스프링시큐리티 인증
|
||||
* Path : 스프링시큐리티
|
||||
* @FileName : AsRepairController.java
|
||||
* @Version : 2019. 8. 27.
|
||||
* @Author : LeeChunghan
|
||||
* @Comment :
|
||||
*/
|
||||
@Component
|
||||
public class AuthSuccessHandler extends SimpleUrlAuthenticationSuccessHandler {
|
||||
|
||||
//@Autowired
|
||||
//private RedisSession redisSession;
|
||||
//
|
||||
@Autowired
|
||||
private UserDao userDao;
|
||||
|
||||
|
||||
@Override
|
||||
public void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse response,
|
||||
Authentication authentication) throws ServletException, IOException {
|
||||
|
||||
ObjectMapper om = new ObjectMapper();
|
||||
response.setStatus(HttpServletResponse.SC_OK);
|
||||
response.getWriter().print(om.writeValueAsString("SUCCESS"));
|
||||
HttpSession session = request.getSession(true);
|
||||
|
||||
Site login = (Site)authentication.getDetails();
|
||||
|
||||
|
||||
|
||||
// 채팅서버와 공유할 세션 정보
|
||||
/*
|
||||
OutLoginVO outLoginVO = new OutLoginVO();
|
||||
outLoginVO.setDomain(login.getDomain());
|
||||
outLoginVO.setName(login.getName());
|
||||
outLoginVO.setId(login.getId());
|
||||
|
||||
|
||||
login.setToken(redisSession.getToken(outLoginVO));
|
||||
*/
|
||||
|
||||
// front 세션 저장
|
||||
//session.setAttribute("user", login);
|
||||
|
||||
|
||||
|
||||
System.out.println(login.getSiteName());
|
||||
|
||||
if(login.getIp().equals(IPKit.getIpAddressByRequest(request)) || "0.0.0.0".equals(login.getIp()) || "".equals(login.getIp())) {
|
||||
/*
|
||||
HashMap logParam = new HashMap();
|
||||
logParam.put("memId",login.getId());
|
||||
logParam.put("logType", "LOGIN");
|
||||
logParam.put("logName", "로그인");
|
||||
logParam.put("logDesc", login.getId() +" "+ IPKit.getIpAddressByRequest(request) + " 로그인");
|
||||
logParam.put("regIp", IPKit.getIpAddressByRequest(request));
|
||||
logParam.put("regId", login.getId());
|
||||
logDao.insertLog(logParam);
|
||||
*/
|
||||
response.sendRedirect(request.getContextPath() + "/swagger-ui.html");
|
||||
}else {
|
||||
/*
|
||||
HashMap logParam = new HashMap();
|
||||
logParam.put("memId",login.getId());
|
||||
logParam.put("logType", "LOGINFAIL");
|
||||
logParam.put("logName", "IP제한 - ");
|
||||
logParam.put("logDesc", login.getId() +" "+ IPKit.getIpAddressByRequest(request) + " 로그인 IP제한");
|
||||
logParam.put("regIp", IPKit.getIpAddressByRequest(request));
|
||||
logParam.put("regId", login.getId());
|
||||
logDao.insertLog(logParam);
|
||||
|
||||
response.sendRedirect(request.getContextPath() + "/Admin/logout");
|
||||
*/
|
||||
response.sendRedirect(request.getContextPath() + "/logout");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}}
|
||||
23
src/main/java/com/bb/config/CorsConfig.java
Normal file
23
src/main/java/com/bb/config/CorsConfig.java
Normal file
@@ -0,0 +1,23 @@
|
||||
package com.bb.config;
|
||||
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.servlet.config.annotation.CorsRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
|
||||
@Configuration
|
||||
public class CorsConfig implements WebMvcConfigurer{
|
||||
|
||||
|
||||
@Override
|
||||
public void addCorsMappings(CorsRegistry registry) {
|
||||
registry.addMapping("/api/**")
|
||||
.allowedOriginPatterns("*")
|
||||
.allowedHeaders("*") // 어떤 헤더들을 허용할 것인지
|
||||
.allowedMethods("*") // 어떤 메서드를 허용할 것인지 (GET, POST...)
|
||||
.allowCredentials(true) // 쿠키 요청을 허용한다(다른 도메인 서버
|
||||
.maxAge(86400);
|
||||
|
||||
WebMvcConfigurer.super.addCorsMappings(registry);
|
||||
|
||||
}
|
||||
}
|
||||
166
src/main/java/com/bb/config/DbConfig.java
Normal file
166
src/main/java/com/bb/config/DbConfig.java
Normal file
@@ -0,0 +1,166 @@
|
||||
package com.bb.config;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
|
||||
import org.apache.ibatis.session.AutoMappingBehavior;
|
||||
import org.apache.ibatis.session.ExecutorType;
|
||||
import org.apache.ibatis.session.SqlSession;
|
||||
import org.apache.ibatis.session.SqlSessionFactory;
|
||||
import org.apache.ibatis.type.JdbcType;
|
||||
import org.mybatis.spring.SqlSessionFactoryBean;
|
||||
import org.mybatis.spring.SqlSessionTemplate;
|
||||
import org.mybatis.spring.boot.autoconfigure.SpringBootVFS;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.boot.jdbc.DataSourceBuilder;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.Primary;
|
||||
import org.springframework.core.io.Resource;
|
||||
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
|
||||
import org.springframework.core.io.support.ResourcePatternResolver;
|
||||
|
||||
import com.zaxxer.hikari.HikariDataSource;
|
||||
|
||||
@Configuration
|
||||
public class DbConfig {
|
||||
|
||||
|
||||
|
||||
/** DataSource OMS Master 생성 */
|
||||
@Bean
|
||||
@Primary
|
||||
@ConfigurationProperties(prefix = "spring.datasource1")
|
||||
public DataSource masterDataSource() {
|
||||
return DataSourceBuilder.create()
|
||||
.type(HikariDataSource.class)
|
||||
.build();
|
||||
}
|
||||
|
||||
/** DataSource OMS Slave 생성 */
|
||||
@Bean
|
||||
@Primary
|
||||
@ConfigurationProperties(prefix = "spring.datasource2")
|
||||
public DataSource slaveDataSource() {
|
||||
return DataSourceBuilder.create()
|
||||
.type(HikariDataSource.class)
|
||||
.build();
|
||||
}
|
||||
|
||||
/** DataSource Triple 생성 */
|
||||
@Bean
|
||||
@ConfigurationProperties(prefix = "spring.datasource3")
|
||||
public DataSource tripleDataSource() {
|
||||
return DataSourceBuilder.create()
|
||||
.type(HikariDataSource.class)
|
||||
.build();
|
||||
}
|
||||
|
||||
/** sqlSessionFactory OMS Master 생성 */
|
||||
@Bean
|
||||
@Primary
|
||||
public SqlSessionFactory sqlSessionFactoryMain(@Autowired @Qualifier("masterDataSource") DataSource dataSource) throws Exception {
|
||||
// logger.info("SqlSessionFactory Main Start");
|
||||
org.apache.ibatis.session.Configuration configuration = this.getMybatisConfig();
|
||||
|
||||
SqlSessionFactoryBean factoryBean = new SqlSessionFactoryBean();
|
||||
factoryBean.setDataSource(dataSource);
|
||||
factoryBean.setVfs(SpringBootVFS.class);
|
||||
factoryBean.setConfiguration(configuration);
|
||||
factoryBean.setTypeHandlersPackage("com.commax.tool.framework.mybatis.typehandler");
|
||||
|
||||
ResourcePatternResolver resolver = new PathMatchingResourcePatternResolver();
|
||||
Resource[] resource = resolver.getResources("db1/**/*.xml");
|
||||
factoryBean.setMapperLocations(resource);
|
||||
|
||||
return factoryBean.getObject();
|
||||
}
|
||||
|
||||
/** sqlSessionFactory OMS Slave 생성 */
|
||||
@Bean
|
||||
@Primary
|
||||
public SqlSessionFactory sqlSessionFactorySub(@Autowired @Qualifier("slaveDataSource") DataSource dataSource) throws Exception {
|
||||
// logger.info("SqlSessionFactory Main Start");
|
||||
org.apache.ibatis.session.Configuration configuration = this.getMybatisConfig();
|
||||
|
||||
SqlSessionFactoryBean factoryBean = new SqlSessionFactoryBean();
|
||||
factoryBean.setDataSource(dataSource);
|
||||
factoryBean.setVfs(SpringBootVFS.class);
|
||||
factoryBean.setConfiguration(configuration);
|
||||
factoryBean.setTypeHandlersPackage("com.commax.tool.framework.mybatis.typehandler");
|
||||
|
||||
ResourcePatternResolver resolver = new PathMatchingResourcePatternResolver();
|
||||
Resource[] resource = resolver.getResources("db1/**/*.xml");
|
||||
factoryBean.setMapperLocations(resource);
|
||||
|
||||
return factoryBean.getObject();
|
||||
}
|
||||
|
||||
/** sqlSessionFactory Triple 생성 */
|
||||
@Bean
|
||||
public SqlSessionFactory sqlSessionFactoryTriple(@Autowired @Qualifier("tripleDataSource") DataSource dataSource) throws Exception {
|
||||
// logger.info("SqlSessionFactory SUB Start");
|
||||
org.apache.ibatis.session.Configuration configuration = this.getMybatisConfig();
|
||||
|
||||
SqlSessionFactoryBean factoryBean = new SqlSessionFactoryBean();
|
||||
factoryBean.setDataSource(dataSource);
|
||||
factoryBean.setVfs(SpringBootVFS.class);
|
||||
factoryBean.setConfiguration(configuration);
|
||||
factoryBean.setTypeHandlersPackage("com.commax.tool.framework.mybatis.typehandler");
|
||||
|
||||
ResourcePatternResolver resolver = new PathMatchingResourcePatternResolver();
|
||||
Resource[] resource = resolver.getResources("db2/**/*.xml");
|
||||
factoryBean.setMapperLocations(resource);
|
||||
|
||||
return factoryBean.getObject();
|
||||
}
|
||||
|
||||
/** sqlSession OMS Master 생성 */
|
||||
@Bean
|
||||
@Primary
|
||||
public SqlSession sqlSessionMain(@Autowired @Qualifier("sqlSessionFactoryMain") SqlSessionFactory factory) {
|
||||
return new SqlSessionTemplate(factory);
|
||||
}
|
||||
|
||||
/** sqlSession OMS Slave 생성 */
|
||||
@Bean
|
||||
public SqlSession sqlSessionSub(@Autowired @Qualifier("sqlSessionFactorySub") SqlSessionFactory factory) {
|
||||
return new SqlSessionTemplate(factory);
|
||||
}
|
||||
|
||||
/** sqlSession Triple 생성 */
|
||||
@Bean
|
||||
public SqlSession sqlSessionTriple(@Autowired @Qualifier("sqlSessionFactoryTriple") SqlSessionFactory factory) {
|
||||
return new SqlSessionTemplate(factory);
|
||||
}
|
||||
|
||||
/** MybatisConfig 설정정보 */
|
||||
private org.apache.ibatis.session.Configuration getMybatisConfig() {
|
||||
org.apache.ibatis.session.Configuration configuration = new org.apache.ibatis.session.Configuration();
|
||||
configuration.setCacheEnabled(true);
|
||||
configuration.setLazyLoadingEnabled(false);
|
||||
configuration.setAggressiveLazyLoading(false);
|
||||
configuration.setMultipleResultSetsEnabled(true);
|
||||
configuration.setUseColumnLabel(true);
|
||||
configuration.setAutoMappingBehavior(AutoMappingBehavior.PARTIAL);
|
||||
configuration.setDefaultExecutorType(ExecutorType.SIMPLE);
|
||||
configuration.setDefaultStatementTimeout(25000);
|
||||
configuration.setMapUnderscoreToCamelCase(true);
|
||||
configuration.setJdbcTypeForNull(JdbcType.NVARCHAR);
|
||||
configuration.setLazyLoadTriggerMethods(new HashSet<>(Arrays.asList("equals", "clone", "hashCode", "toString")));
|
||||
configuration.setLogPrefix("[SQL]");
|
||||
|
||||
return configuration;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
35
src/main/java/com/bb/config/HttpEncryptionFilter.java
Normal file
35
src/main/java/com/bb/config/HttpEncryptionFilter.java
Normal file
@@ -0,0 +1,35 @@
|
||||
package com.bb.config;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import jakarta.servlet.Filter;
|
||||
import jakarta.servlet.FilterChain;
|
||||
import jakarta.servlet.ServletException;
|
||||
import jakarta.servlet.ServletRequest;
|
||||
import jakarta.servlet.ServletResponse;
|
||||
import jakarta.servlet.annotation.WebFilter;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@Slf4j
|
||||
@WebFilter("/api/*")
|
||||
public class HttpEncryptionFilter implements Filter {
|
||||
|
||||
@Override
|
||||
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
|
||||
// log.info("HttpEncryptionFilter.doFilter() call...");
|
||||
// TODO Auto-generated method stub
|
||||
HttpServletRequest httpServletRequest = (HttpServletRequest) request;
|
||||
HttpServletResponse httpServletResponse = (HttpServletResponse) response;
|
||||
|
||||
RequestDecryptWrapper requestDecryptWrapper = new RequestDecryptWrapper(httpServletRequest);
|
||||
ResponseEncryptWrapper responseEncryptWrapper = new ResponseEncryptWrapper(httpServletResponse);
|
||||
|
||||
chain.doFilter(requestDecryptWrapper, responseEncryptWrapper);
|
||||
|
||||
httpServletResponse.getOutputStream().write(responseEncryptWrapper.encryptResponse());
|
||||
}
|
||||
|
||||
}
|
||||
35
src/main/java/com/bb/config/HttpInterceptor.java
Normal file
35
src/main/java/com/bb/config/HttpInterceptor.java
Normal file
@@ -0,0 +1,35 @@
|
||||
package com.bb.config;
|
||||
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.servlet.HandlerInterceptor;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@Slf4j
|
||||
@Component
|
||||
public class HttpInterceptor implements HandlerInterceptor {
|
||||
|
||||
@Override
|
||||
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
|
||||
// log.info("[preHandle] " + request.getRequestURI());
|
||||
// log.info("[preHandle] " + request.toString());
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {
|
||||
// log.info("[postHandle] " + request.getRequestURI());
|
||||
// log.info("[postHandle] " + request.toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object object, Exception ex) throws Exception {
|
||||
// log.info("[afterCompletion] " + request.getRequestURI());
|
||||
// log.info("[afterCompletion] " + request.toString());
|
||||
}
|
||||
}
|
||||
|
||||
17
src/main/java/com/bb/config/InterceptorConfig.java
Normal file
17
src/main/java/com/bb/config/InterceptorConfig.java
Normal file
@@ -0,0 +1,17 @@
|
||||
package com.bb.config;
|
||||
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
|
||||
@Configuration
|
||||
public class InterceptorConfig implements WebMvcConfigurer {
|
||||
@Override
|
||||
public void addInterceptors(InterceptorRegistry registry) {
|
||||
registry.addInterceptor(new HttpInterceptor())
|
||||
.addPathPatterns("/api/**/**/**/**")
|
||||
.excludePathPatterns("/api/login", "/api/signUp"); // 해당 경로는 인터셉터가 가로채지 않는다.
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
55
src/main/java/com/bb/config/OpenapiConfig.java
Normal file
55
src/main/java/com/bb/config/OpenapiConfig.java
Normal file
@@ -0,0 +1,55 @@
|
||||
package com.bb.config;
|
||||
|
||||
import org.springdoc.core.GroupedOpenApi;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import io.swagger.v3.oas.annotations.OpenAPIDefinition;
|
||||
import io.swagger.v3.oas.annotations.enums.SecuritySchemeIn;
|
||||
import io.swagger.v3.oas.annotations.enums.SecuritySchemeType;
|
||||
import io.swagger.v3.oas.annotations.info.Info;
|
||||
import io.swagger.v3.oas.annotations.security.SecurityScheme;
|
||||
import io.swagger.v3.oas.models.Components;
|
||||
import io.swagger.v3.oas.models.OpenAPI;
|
||||
import io.swagger.v3.oas.models.security.SecurityRequirement;
|
||||
|
||||
@Configuration
|
||||
@OpenAPIDefinition(info = @Info(title = "My API", version = "v1"))
|
||||
@SecurityScheme(
|
||||
name = "Authorization",
|
||||
// type = SecuritySchemeType.HTTP,
|
||||
scheme = "basic", type = SecuritySchemeType.APIKEY , in=SecuritySchemeIn.HEADER
|
||||
)
|
||||
|
||||
|
||||
|
||||
public class OpenapiConfig {
|
||||
@Bean
|
||||
public GroupedOpenApi publicOpenAPI( ) {
|
||||
return GroupedOpenApi
|
||||
.builder()
|
||||
.group("front")
|
||||
.packagesToScan("com.bb.front")
|
||||
.build();
|
||||
}
|
||||
|
||||
@Bean
|
||||
public GroupedOpenApi adminAPI( ) {
|
||||
return GroupedOpenApi
|
||||
.builder()
|
||||
.group("admin")
|
||||
.packagesToScan("com.bb.admin")
|
||||
.build();
|
||||
}
|
||||
|
||||
@Bean
|
||||
public GroupedOpenApi commonAPI( ) {
|
||||
return GroupedOpenApi
|
||||
.builder()
|
||||
.group("common")
|
||||
.packagesToScan("com.bb.common")
|
||||
.build();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
86
src/main/java/com/bb/config/RequestDecryptWrapper.java
Normal file
86
src/main/java/com/bb/config/RequestDecryptWrapper.java
Normal file
@@ -0,0 +1,86 @@
|
||||
package com.bb.config;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.nio.charset.Charset;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
import jakarta.servlet.ReadListener;
|
||||
import jakarta.servlet.ServletInputStream;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletRequestWrapper;
|
||||
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
|
||||
import com.bb.util.AESUtil;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@Slf4j
|
||||
public class RequestDecryptWrapper extends HttpServletRequestWrapper {
|
||||
|
||||
private final Charset encoding;
|
||||
private String decodingBody;
|
||||
private byte[] rawData;
|
||||
|
||||
public RequestDecryptWrapper(HttpServletRequest request) {
|
||||
super(request);
|
||||
String charEncoding = request.getCharacterEncoding();
|
||||
this.encoding = ObjectUtils.isEmpty(charEncoding) ? StandardCharsets.UTF_8 : Charset.forName(charEncoding);
|
||||
|
||||
try {
|
||||
InputStream inputStream = request.getInputStream();
|
||||
rawData = IOUtils.toByteArray(inputStream);
|
||||
|
||||
if (ObjectUtils.isEmpty(rawData)) {
|
||||
return;
|
||||
}
|
||||
|
||||
AESUtil aesUtil = new AESUtil();
|
||||
this.decodingBody = aesUtil.decrypt(new String(rawData, StandardCharsets.UTF_8));
|
||||
} catch (IOException e) {
|
||||
log.error(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ServletInputStream getInputStream() {
|
||||
final ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(decodingBody == null ? "".getBytes(encoding) : decodingBody.getBytes(encoding));
|
||||
return new ServletInputStream() {
|
||||
|
||||
@Override
|
||||
public boolean isFinished() {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isReady() {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setReadListener(ReadListener listener) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int read() throws IOException {
|
||||
// TODO Auto-generated method stub
|
||||
return byteArrayInputStream.read();
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public BufferedReader getReader() {
|
||||
return new BufferedReader(new InputStreamReader(this.getInputStream()));
|
||||
}
|
||||
}
|
||||
54
src/main/java/com/bb/config/ResponseEncryptWrapper.java
Normal file
54
src/main/java/com/bb/config/ResponseEncryptWrapper.java
Normal file
@@ -0,0 +1,54 @@
|
||||
package com.bb.config;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
import jakarta.servlet.ServletOutputStream;
|
||||
import jakarta.servlet.WriteListener;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.servlet.http.HttpServletResponseWrapper;
|
||||
|
||||
import com.bb.util.AESUtil;
|
||||
|
||||
public class ResponseEncryptWrapper extends HttpServletResponseWrapper {
|
||||
|
||||
private final ByteArrayOutputStream output;
|
||||
|
||||
public ResponseEncryptWrapper(HttpServletResponse response) {
|
||||
super(response);
|
||||
// TODO Auto-generated constructor stub
|
||||
output = new ByteArrayOutputStream();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ServletOutputStream getOutputStream() throws IOException {
|
||||
return new ServletOutputStream() {
|
||||
|
||||
@Override
|
||||
public boolean isReady() {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setWriteListener(WriteListener listener) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(int b) throws IOException {
|
||||
// TODO Auto-generated method stub
|
||||
output.write(b);
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
public byte[] encryptResponse() {
|
||||
String responseMessage = new String(output.toByteArray(), StandardCharsets.UTF_8);
|
||||
AESUtil aesUtil = new AESUtil();
|
||||
return aesUtil.encrypt(responseMessage).getBytes(StandardCharsets.UTF_8);
|
||||
}
|
||||
}
|
||||
46
src/main/java/com/bb/config/RestTemplateConfig.java
Normal file
46
src/main/java/com/bb/config/RestTemplateConfig.java
Normal file
@@ -0,0 +1,46 @@
|
||||
package com.bb.config;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.apache.hc.client5.http.classic.HttpClient;
|
||||
import org.apache.hc.client5.http.config.ConnectionConfig;
|
||||
import org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManagerBuilder;
|
||||
import org.apache.hc.client5.http.io.HttpClientConnectionManager;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
|
||||
@Configuration
|
||||
public class RestTemplateConfig {
|
||||
static final int READ_TIMEOUT = 1500;
|
||||
static final int CONN_TIMEOUT = 3000;
|
||||
|
||||
@Bean
|
||||
public RestTemplate restTemplate() {
|
||||
var factory = new HttpComponentsClientHttpRequestFactory();
|
||||
factory.setHttpClient(createHttpClient());
|
||||
return new RestTemplate(factory);
|
||||
}
|
||||
|
||||
private HttpClient createHttpClient() {
|
||||
return org.apache.hc.client5.http.impl.classic
|
||||
.HttpClientBuilder.create()
|
||||
.setConnectionManager(createHttpClientConnectionManager())
|
||||
|
||||
.build();
|
||||
|
||||
}
|
||||
|
||||
private HttpClientConnectionManager createHttpClientConnectionManager() {
|
||||
return PoolingHttpClientConnectionManagerBuilder.create()
|
||||
.setMaxConnTotal(4096) //최대 오픈되는 커넥션 수
|
||||
.setMaxConnPerRoute(200) //IP, 포트 1쌍에 대해 수행할 커넥션 수
|
||||
.setDefaultConnectionConfig(ConnectionConfig.custom()
|
||||
.setSocketTimeout(READ_TIMEOUT, TimeUnit.MILLISECONDS)
|
||||
.setConnectTimeout(CONN_TIMEOUT, TimeUnit.MILLISECONDS)
|
||||
.build())
|
||||
.build();
|
||||
}
|
||||
}
|
||||
116
src/main/java/com/bb/config/SecurityConfig.java
Normal file
116
src/main/java/com/bb/config/SecurityConfig.java
Normal file
@@ -0,0 +1,116 @@
|
||||
package com.bb.config;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.web.servlet.FilterRegistrationBean;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.security.authentication.AuthenticationManager;
|
||||
import org.springframework.security.config.annotation.authentication.configuration.AuthenticationConfiguration;
|
||||
import org.springframework.security.config.annotation.method.configuration.EnableMethodSecurity;
|
||||
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
||||
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
||||
import org.springframework.security.web.SecurityFilterChain;
|
||||
import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
|
||||
import org.springframework.web.cors.CorsConfiguration;
|
||||
import org.springframework.web.cors.CorsConfigurationSource;
|
||||
import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
|
||||
|
||||
@Configuration
|
||||
@EnableMethodSecurity(securedEnabled = true)
|
||||
@ComponentScan(basePackages = {"com.bb.*"})
|
||||
public class SecurityConfig {
|
||||
|
||||
@Autowired
|
||||
@Lazy
|
||||
AuthProvider authProvider;
|
||||
|
||||
@Autowired
|
||||
AuthFailureHandler authFailureHandler;
|
||||
|
||||
@Autowired
|
||||
AuthSuccessHandler authSuccessHandler;
|
||||
|
||||
@Bean
|
||||
public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
|
||||
http.cors().configurationSource(corsConfigurationSource())
|
||||
.and().csrf().disable()
|
||||
.authorizeHttpRequests(auth -> auth
|
||||
.requestMatchers(
|
||||
"/v3/api-docs",
|
||||
"/swagger-resources/**",
|
||||
"/webjars/**",
|
||||
"/swagger/**",
|
||||
"/favicon.ico",
|
||||
"/html/**",
|
||||
"/resources/**",
|
||||
"/triple/**",
|
||||
"/triple",
|
||||
"/excb/**",
|
||||
"/excb",
|
||||
"/passim/**",
|
||||
"/passim",
|
||||
"/websocket",
|
||||
"/websocket/**",
|
||||
"/test",
|
||||
"/test/**"
|
||||
).permitAll()
|
||||
.requestMatchers("/api/**", "/actuator/**", "/triple/**", "/websocket", "/websocket/**", "/test/**", "/excb/**", "/passim/**").permitAll()
|
||||
.anyRequest().authenticated()
|
||||
)
|
||||
.formLogin(form -> form
|
||||
.loginProcessingUrl("/authenticate")
|
||||
.defaultSuccessUrl("/swagger-ui.html")
|
||||
.failureHandler(authFailureHandler)
|
||||
.successHandler(authSuccessHandler)
|
||||
.usernameParameter("id")
|
||||
.passwordParameter("pw")
|
||||
)
|
||||
.logout(logout -> logout
|
||||
.logoutRequestMatcher(new AntPathRequestMatcher("/logoutProc"))
|
||||
.invalidateHttpSession(true)
|
||||
)
|
||||
.authenticationProvider(authProvider)
|
||||
.headers(headers -> headers.frameOptions().disable());
|
||||
|
||||
return http.build();
|
||||
}
|
||||
|
||||
@Bean
|
||||
public BCryptPasswordEncoder bCryptPasswordEncoder() {
|
||||
return new BCryptPasswordEncoder();
|
||||
}
|
||||
|
||||
@Bean
|
||||
public FilterRegistrationBean<ApiKeyFilter> filterRegistrationBean() {
|
||||
FilterRegistrationBean<ApiKeyFilter> registrationBean = new FilterRegistrationBean<>();
|
||||
ApiKeyFilter customURLFilter = new ApiKeyFilter();
|
||||
|
||||
registrationBean.setFilter(customURLFilter);
|
||||
registrationBean.addUrlPatterns("/api/login");
|
||||
registrationBean.setOrder(1);
|
||||
|
||||
return registrationBean;
|
||||
}
|
||||
|
||||
@Bean
|
||||
public CorsConfigurationSource corsConfigurationSource() {
|
||||
final CorsConfiguration configuration = new CorsConfiguration();
|
||||
configuration.setAllowedOriginPatterns(Arrays.asList("*"));
|
||||
configuration.addAllowedHeader("*");
|
||||
configuration.addAllowedMethod("*");
|
||||
configuration.setAllowCredentials(true);
|
||||
|
||||
final UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
|
||||
source.registerCorsConfiguration("/**", configuration);
|
||||
return source;
|
||||
}
|
||||
|
||||
@Bean
|
||||
public AuthenticationManager authenticationManager(AuthenticationConfiguration authenticationConfiguration) throws Exception {
|
||||
return authenticationConfiguration.getAuthenticationManager();
|
||||
}
|
||||
}
|
||||
189
src/main/java/com/bb/config/WebClientConfig.java
Normal file
189
src/main/java/com/bb/config/WebClientConfig.java
Normal file
@@ -0,0 +1,189 @@
|
||||
package com.bb.config;
|
||||
|
||||
import java.time.Duration;
|
||||
|
||||
import javax.net.ssl.SSLException;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.http.client.reactive.ReactorClientHttpConnector;
|
||||
import org.springframework.web.reactive.function.client.ExchangeFilterFunction;
|
||||
import org.springframework.web.reactive.function.client.WebClient;
|
||||
|
||||
import io.netty.channel.ChannelOption;
|
||||
import io.netty.handler.ssl.SslContext;
|
||||
import io.netty.handler.ssl.SslContextBuilder;
|
||||
import io.netty.handler.ssl.SslProvider;
|
||||
import io.netty.handler.ssl.util.InsecureTrustManagerFactory;
|
||||
import io.netty.handler.timeout.ReadTimeoutHandler;
|
||||
import io.netty.handler.timeout.WriteTimeoutHandler;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import reactor.core.publisher.Mono;
|
||||
import reactor.netty.http.client.HttpClient;
|
||||
import reactor.netty.tcp.TcpClient;
|
||||
|
||||
@Slf4j
|
||||
@Configuration
|
||||
public class WebClientConfig {
|
||||
|
||||
@Bean
|
||||
public WebClient webClient() {
|
||||
return WebClient.builder()
|
||||
.filter(logRequest())
|
||||
.filter(logResponse())
|
||||
.build();
|
||||
}
|
||||
|
||||
|
||||
@Bean
|
||||
public WebClient webClientTimeout_1500() {
|
||||
|
||||
HttpClient httpClient = HttpClient.create()
|
||||
.option(ChannelOption.CONNECT_TIMEOUT_MILLIS, 1500);
|
||||
|
||||
return WebClient.builder()
|
||||
.clientConnector(new ReactorClientHttpConnector(httpClient))
|
||||
.filter(logRequest())
|
||||
.filter(logResponse())
|
||||
|
||||
.build();
|
||||
}
|
||||
|
||||
@Bean
|
||||
public WebClient webClientTimeout_3000() {
|
||||
|
||||
HttpClient httpClient = HttpClient.create()
|
||||
.option(ChannelOption.CONNECT_TIMEOUT_MILLIS, 3000);
|
||||
|
||||
return WebClient.builder()
|
||||
.clientConnector(new ReactorClientHttpConnector(httpClient))
|
||||
.filter(logRequest())
|
||||
.filter(logResponse())
|
||||
|
||||
.build();
|
||||
}
|
||||
|
||||
@Bean
|
||||
public WebClient secureTls12WebClient() throws SSLException {
|
||||
|
||||
// TLS 1.2 강제
|
||||
SslContext sslContext = SslContextBuilder.forClient()
|
||||
.protocols("TLSv1.2")
|
||||
.build();
|
||||
|
||||
// Timeout 적용 (Spring Boot 3.0.0 호환 방식)
|
||||
TcpClient tcpClient = TcpClient.create()
|
||||
.option(ChannelOption.CONNECT_TIMEOUT_MILLIS, 5000) // 연결 timeout (5초)
|
||||
.doOnConnected(conn -> conn
|
||||
.addHandlerLast(new ReadTimeoutHandler(10)) // 읽기 timeout 10초
|
||||
.addHandlerLast(new WriteTimeoutHandler(10)) // 쓰기 timeout 10초
|
||||
)
|
||||
.secure(ssl -> ssl.sslContext(sslContext));
|
||||
|
||||
HttpClient httpClient = HttpClient.from(tcpClient);
|
||||
|
||||
return WebClient.builder()
|
||||
.clientConnector(new ReactorClientHttpConnector(httpClient))
|
||||
.defaultHeader("Content-Type", "application/json")
|
||||
.defaultHeader("Accept", "application/json")
|
||||
.defaultHeader("Accept-Charset", "utf-8")
|
||||
.defaultHeader("User-Agent", "PostmanRuntime/7.28.4")
|
||||
.filter(logRequest2())
|
||||
.filter(logResponse2())
|
||||
.build();
|
||||
}
|
||||
|
||||
@Bean
|
||||
public WebClient webClientOpenSslFull() throws SSLException {
|
||||
SslContext sslContext = SslContextBuilder.forClient()
|
||||
.sslProvider(SslProvider.OPENSSL)
|
||||
.protocols("TLSv1.3", "TLSv1.2")
|
||||
.build();
|
||||
|
||||
TcpClient tcpClient = TcpClient.create()
|
||||
.option(ChannelOption.CONNECT_TIMEOUT_MILLIS, 5000)
|
||||
.doOnConnected(conn -> conn.addHandlerLast(new ReadTimeoutHandler(10)))
|
||||
.secure(spec -> spec.sslContext(sslContext));
|
||||
|
||||
HttpClient httpClient = HttpClient.from(tcpClient);
|
||||
|
||||
return WebClient.builder()
|
||||
.clientConnector(new ReactorClientHttpConnector(httpClient))
|
||||
.defaultHeader("User-Agent", "PostmanRuntime/7.28.4")
|
||||
.defaultHeader("Content-Type", "application/json")
|
||||
.filter(logRequest2())
|
||||
.filter(logResponse2())
|
||||
.build();
|
||||
}
|
||||
|
||||
@Bean
|
||||
public WebClient insecureTrustAllWebClient() throws SSLException {
|
||||
|
||||
// Netty용 SSLContext 생성 (Trust 모든 인증서)
|
||||
SslContext sslContext = SslContextBuilder.forClient()
|
||||
.trustManager(InsecureTrustManagerFactory.INSTANCE)
|
||||
.protocols("TLSv1.2")
|
||||
.build();
|
||||
|
||||
HttpClient httpClient = HttpClient.create()
|
||||
.secure(spec -> spec.sslContext(sslContext))
|
||||
.responseTimeout(Duration.ofSeconds(10))
|
||||
.option(io.netty.channel.ChannelOption.CONNECT_TIMEOUT_MILLIS, 5000);
|
||||
|
||||
return WebClient.builder()
|
||||
.clientConnector(new ReactorClientHttpConnector(httpClient))
|
||||
.build();
|
||||
}
|
||||
|
||||
@Bean
|
||||
public WebClient insecureJdkTlsWebClient() throws SSLException {
|
||||
|
||||
// JDK SSLContext 사용, 인증서 검증 무시
|
||||
SslContext sslContext = SslContextBuilder.forClient()
|
||||
.sslProvider(SslProvider.JDK) // JDK SSLContext 사용 강제
|
||||
.trustManager(InsecureTrustManagerFactory.INSTANCE) // 인증서 무시
|
||||
.protocols("TLSv1.2") // TLS 1.2 강제
|
||||
.build();
|
||||
|
||||
HttpClient httpClient = HttpClient.create()
|
||||
.secure(spec -> spec.sslContext(sslContext))
|
||||
.responseTimeout(Duration.ofSeconds(10))
|
||||
.option(io.netty.channel.ChannelOption.CONNECT_TIMEOUT_MILLIS, 5000);
|
||||
|
||||
return WebClient.builder()
|
||||
.clientConnector(new ReactorClientHttpConnector(httpClient))
|
||||
.build();
|
||||
}
|
||||
|
||||
/** Request 로깅 **/
|
||||
private ExchangeFilterFunction logRequest2() {
|
||||
return ExchangeFilterFunction.ofRequestProcessor(request -> {
|
||||
System.out.println("### WebClient Request: " + request.method() + " " + request.url());
|
||||
return reactor.core.publisher.Mono.just(request);
|
||||
});
|
||||
}
|
||||
|
||||
/** Response 로깅 **/
|
||||
private ExchangeFilterFunction logResponse2() {
|
||||
return ExchangeFilterFunction.ofResponseProcessor(response -> {
|
||||
System.out.println("### WebClient Response Status: " + response.statusCode());
|
||||
return reactor.core.publisher.Mono.just(response);
|
||||
});
|
||||
}
|
||||
|
||||
private ExchangeFilterFunction logRequest() {
|
||||
return ExchangeFilterFunction.ofRequestProcessor(clientRequest -> {
|
||||
// log.info("Request: {} {}", clientRequest.method(), clientRequest.url());
|
||||
// clientRequest.headers().forEach((name, values) -> values.forEach(value -> log.info("{}={}", name, value)));
|
||||
return Mono.just(clientRequest);
|
||||
});
|
||||
}
|
||||
|
||||
private ExchangeFilterFunction logResponse() {
|
||||
return ExchangeFilterFunction.ofResponseProcessor(clientResponse -> {
|
||||
// log.info("Response Status: {}", clientResponse.statusCode());
|
||||
// clientResponse.headers().asHttpHeaders().forEach((name, values) -> values.forEach(value -> log.info("{}={}", name, value)));
|
||||
return Mono.just(clientResponse);
|
||||
});
|
||||
}
|
||||
}
|
||||
29
src/main/java/com/bb/config/WebSocketConfig.java
Normal file
29
src/main/java/com/bb/config/WebSocketConfig.java
Normal file
@@ -0,0 +1,29 @@
|
||||
package com.bb.config;
|
||||
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.messaging.simp.config.ChannelRegistration;
|
||||
import org.springframework.messaging.simp.config.MessageBrokerRegistry;
|
||||
import org.springframework.web.socket.config.annotation.EnableWebSocketMessageBroker;
|
||||
import org.springframework.web.socket.config.annotation.StompEndpointRegistry;
|
||||
import org.springframework.web.socket.config.annotation.WebSocketMessageBrokerConfigurer;
|
||||
|
||||
@Configuration
|
||||
@EnableWebSocketMessageBroker
|
||||
public class WebSocketConfig implements WebSocketMessageBrokerConfigurer {
|
||||
|
||||
@Override
|
||||
public void configureMessageBroker(MessageBrokerRegistry config) {
|
||||
config.enableSimpleBroker("/topic");
|
||||
config.setApplicationDestinationPrefixes("/app");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerStompEndpoints(StompEndpointRegistry registry) {
|
||||
registry.addEndpoint("/websocket").setAllowedOriginPatterns("*").withSockJS();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void configureClientInboundChannel(ChannelRegistration registration) {
|
||||
registration.interceptors(new WebSocketInterceptor());
|
||||
}
|
||||
}
|
||||
32
src/main/java/com/bb/config/WebSocketInterceptor.java
Normal file
32
src/main/java/com/bb/config/WebSocketInterceptor.java
Normal file
@@ -0,0 +1,32 @@
|
||||
package com.bb.config;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.messaging.Message;
|
||||
import org.springframework.messaging.MessageChannel;
|
||||
import org.springframework.messaging.support.ChannelInterceptor;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class WebSocketInterceptor implements ChannelInterceptor {
|
||||
|
||||
private final Set<String> sessionSet = new HashSet<>();
|
||||
|
||||
@Override
|
||||
public Message<?> preSend(Message<?> message, MessageChannel channel) {
|
||||
String simpMessageType = String.valueOf(message.getHeaders().get("simpMessageType"));
|
||||
if (StringUtils.equals(simpMessageType, "CONNECT")) {
|
||||
String simpSessionId = String.valueOf(message.getHeaders().get("simpSessionId"));
|
||||
sessionSet.add(simpSessionId);
|
||||
} else if (StringUtils.equals(simpMessageType, "DISCONNECT")) {
|
||||
String simpSessionId = String.valueOf(message.getHeaders().get("simpSessionId"));
|
||||
sessionSet.remove(simpSessionId);
|
||||
}
|
||||
|
||||
int uniqueJoinSessionCount = sessionSet.size();
|
||||
// System.out.println("connectCnt: " + uniqueJoinSessionCount);
|
||||
return message;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package com.bb.controller;
|
||||
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.bb.model.PassimVo;
|
||||
import com.bb.service.PassimService;
|
||||
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@Slf4j
|
||||
@EnableScheduling
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping(value = "/passim")
|
||||
public class CallbackPassimController {
|
||||
|
||||
private final PassimService passimService;
|
||||
|
||||
@PostMapping(value="/notification")
|
||||
public ResponseEntity<String> notificationWebHook(HttpServletRequest request, @RequestBody PassimVo webhook) {
|
||||
|
||||
// 멱등 처리: txHash 기준
|
||||
|
||||
// TODO: 비즈니스 처리 (포인트 충전 등)
|
||||
|
||||
return ResponseEntity.ok("OK");
|
||||
}
|
||||
}
|
||||
443
src/main/java/com/bb/controller/CallbackRvHoldemController.java
Normal file
443
src/main/java/com/bb/controller/CallbackRvHoldemController.java
Normal file
@@ -0,0 +1,443 @@
|
||||
package com.bb.controller;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import org.springframework.dao.DataIntegrityViolationException;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.bb.model.Member;
|
||||
import com.bb.model.RvHoldemResponse;
|
||||
import com.bb.model.RvHoldemVO;
|
||||
import com.bb.service.AsyncBetService;
|
||||
import com.bb.service.BetService;
|
||||
import com.bb.service.UserService;
|
||||
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.sf.json.JSONObject;
|
||||
|
||||
@Slf4j
|
||||
@EnableScheduling
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping(value = "/excb/rvholdem")
|
||||
public class CallbackRvHoldemController {
|
||||
|
||||
private final UserService userService;
|
||||
|
||||
private final BetService betService;
|
||||
|
||||
private final AsyncBetService asyncService;
|
||||
|
||||
/**
|
||||
* APICode
|
||||
* FAILED = 0,
|
||||
* INVALID_ARGUMENT = -4,
|
||||
* UNKNOWN_ERROR = -3,
|
||||
* INVALID_PK = -2,
|
||||
* UNAUTH = -1,
|
||||
* SUCCESS = 1
|
||||
*/
|
||||
|
||||
@PostMapping(value="/ping")
|
||||
public ResponseEntity<RvHoldemResponse> ping(HttpServletRequest request) throws Exception {
|
||||
RvHoldemResponse response = new RvHoldemResponse();
|
||||
response.setCode(1);
|
||||
HttpStatus httpStatus = HttpStatus.OK;
|
||||
|
||||
return new ResponseEntity<RvHoldemResponse>(response, httpStatus);
|
||||
}
|
||||
|
||||
@PostMapping(value="/user/balance")
|
||||
public ResponseEntity<RvHoldemResponse> userBalance(HttpServletRequest request, @RequestBody JSONObject requestBody) {
|
||||
RvHoldemResponse response = new RvHoldemResponse();
|
||||
HttpStatus httpStatus = HttpStatus.OK;
|
||||
|
||||
String apiKey = request.getHeader("apikey").toString();
|
||||
String uid = requestBody.getString("uid");
|
||||
String cbUid = requestBody.getString("cb_uid");
|
||||
|
||||
int siteIdx = Integer.parseInt(uid.substring(0, 3), 16);
|
||||
String memberId = uid.substring(3, uid.length());
|
||||
final String LOG_PREFIX = "#-CB::RV_HOLDEM::"+uid+"::"+cbUid+"::userBalance:::";
|
||||
log.info(LOG_PREFIX+ "Request Body : " + requestBody.toString());
|
||||
|
||||
HashMap<String, String> checkInfo = userService.getRvHoldemCheckInfo(uid);
|
||||
if(checkInfo == null) {
|
||||
log.error(LOG_PREFIX + "UNAUTH::NOT_FOUND_USER");
|
||||
response.setCode(-1);
|
||||
return new ResponseEntity<RvHoldemResponse>(response, httpStatus);
|
||||
}
|
||||
|
||||
if(!checkInfo.get("apiKey").toString().equals(apiKey)) {
|
||||
log.error(LOG_PREFIX + "UNAUTH::INVALID_APIKEY");
|
||||
response.setCode(-1);
|
||||
return new ResponseEntity<RvHoldemResponse>(response, httpStatus);
|
||||
}
|
||||
|
||||
Member memInfo = new Member();
|
||||
memInfo.setSiteIdx(siteIdx);
|
||||
memInfo.setMemId(memberId);
|
||||
int balance = betService.getCurBalance(memInfo);
|
||||
|
||||
response.setCode(1);
|
||||
response.setPayload(balance);
|
||||
|
||||
return new ResponseEntity<RvHoldemResponse>(response, httpStatus);
|
||||
}
|
||||
|
||||
@PostMapping(value="/game/buyin")
|
||||
public ResponseEntity<RvHoldemResponse> gameBuyIn(HttpServletRequest request, @RequestBody JSONObject requestBody) {
|
||||
RvHoldemResponse response = new RvHoldemResponse();
|
||||
HttpStatus httpStatus = HttpStatus.OK;
|
||||
|
||||
String apiKey = request.getHeader("apikey").toString();
|
||||
String uid = requestBody.getString("uid");
|
||||
String cbUid = requestBody.getString("cb_uid");
|
||||
|
||||
int siteIdx = Integer.parseInt(uid.substring(0, 3), 16);
|
||||
String memberId = uid.substring(3, uid.length());
|
||||
final String LOG_PREFIX = "#-CB::RV_HOLDEM::"+uid+"::"+cbUid+"::gameBuyIn:::";
|
||||
log.info(LOG_PREFIX+ "Request Body : " + requestBody.toString());
|
||||
|
||||
HashMap<String, String> checkInfo = userService.getRvHoldemCheckInfo(uid);
|
||||
if(checkInfo == null) {
|
||||
log.error(LOG_PREFIX + "UNAUTH::NOT_FOUND_USER");
|
||||
response.setCode(-1);
|
||||
return new ResponseEntity<RvHoldemResponse>(response, httpStatus);
|
||||
}
|
||||
|
||||
if(!checkInfo.get("apiKey").toString().equals(apiKey)) {
|
||||
log.error(LOG_PREFIX + "UNAUTH::INVALID_APIKEY");
|
||||
response.setCode(-1);
|
||||
return new ResponseEntity<RvHoldemResponse>(response, httpStatus);
|
||||
}
|
||||
|
||||
Member memInfo = new Member();
|
||||
memInfo.setSiteIdx(siteIdx);
|
||||
memInfo.setMemId(memberId);
|
||||
HashMap memberVo = userService.getMemberMap(memInfo);
|
||||
|
||||
// Insert rvholdem_callback_log
|
||||
RvHoldemVO rvParam = RvHoldemVO.fromJSONObject(LOG_PREFIX, requestBody);
|
||||
rvParam.setSiteId(memberVo.get("siteId").toString());
|
||||
rvParam.setMemId(memberId);
|
||||
rvParam.setCallbackType("buyin");
|
||||
log.info(LOG_PREFIX+ "rvParam : " + rvParam.toString());
|
||||
|
||||
int balance = Integer.parseInt(memberVo.get("cashAmt").toString());
|
||||
int amount = rvParam.getAmount();
|
||||
rvParam.setBfBalance(balance);
|
||||
rvParam.setAfBalance(balance+amount);
|
||||
|
||||
int cbIdx = 0;
|
||||
try {
|
||||
cbIdx = betService.insertRvhCallbackLog(rvParam);
|
||||
} catch(DataIntegrityViolationException de) {
|
||||
log.error(LOG_PREFIX + "Duplicate cb_uid!!! " + de.getMessage(), de);
|
||||
response.setCode(-2);
|
||||
return new ResponseEntity<RvHoldemResponse>(response, httpStatus);
|
||||
}
|
||||
|
||||
if(cbIdx > 0) {
|
||||
HashMap balanceParam = new HashMap();
|
||||
balanceParam.put("siteIdx", memInfo.getSiteIdx());
|
||||
balanceParam.put("memId", memInfo.getMemId());
|
||||
balanceParam.put("cashAmt", Integer.toString(amount));
|
||||
balanceParam.put("changeFlag", "N");
|
||||
long chs4 = System.currentTimeMillis();
|
||||
int memCashResult = betService.updateUserCashByAmountNew(balanceParam);
|
||||
long che4 = System.currentTimeMillis(); // 코드 실행 후에 시간 받아오기
|
||||
double diff4 = (chs4 - che4)/1000.0; //두 시간에 차 계산
|
||||
log.info(LOG_PREFIX+ "updateUserCashByAmountNew() : " + String.format("%.3f", diff4));
|
||||
if(diff4 < -1.0) log.error(LOG_PREFIX+ "updateUserCashByAmountNew() : " + String.format("%.3f", diff4));
|
||||
|
||||
asyncService.cashProc(LOG_PREFIX, rvParam);
|
||||
} else {
|
||||
log.error(LOG_PREFIX + "INSERT_CALLBACK_LOG_FAIL");
|
||||
response.setCode(-3);
|
||||
return new ResponseEntity<RvHoldemResponse>(response, httpStatus);
|
||||
}
|
||||
|
||||
response.setCode(1);
|
||||
response.setPayload(balance+amount);
|
||||
|
||||
return new ResponseEntity<RvHoldemResponse>(response, httpStatus);
|
||||
}
|
||||
|
||||
@PostMapping(value="/game/rebuyin")
|
||||
public ResponseEntity<RvHoldemResponse> gameReBuyIn(HttpServletRequest request, @RequestBody JSONObject requestBody) {
|
||||
RvHoldemResponse response = new RvHoldemResponse();
|
||||
HttpStatus httpStatus = HttpStatus.OK;
|
||||
|
||||
String apiKey = request.getHeader("apikey").toString();
|
||||
String uid = requestBody.getString("uid");
|
||||
String cbUid = requestBody.getString("cb_uid");
|
||||
|
||||
int siteIdx = Integer.parseInt(uid.substring(0, 3), 16);
|
||||
String memberId = uid.substring(3, uid.length());
|
||||
final String LOG_PREFIX = "#-CB::RV_HOLDEM::"+uid+"::"+cbUid+"::gameReBuyIn:::";
|
||||
log.info(LOG_PREFIX+ "Request Body : " + requestBody.toString());
|
||||
|
||||
HashMap<String, String> checkInfo = userService.getRvHoldemCheckInfo(uid);
|
||||
if(checkInfo == null) {
|
||||
log.error(LOG_PREFIX + "UNAUTH::NOT_FOUND_USER");
|
||||
response.setCode(-1);
|
||||
return new ResponseEntity<RvHoldemResponse>(response, httpStatus);
|
||||
}
|
||||
|
||||
if(!checkInfo.get("apiKey").toString().equals(apiKey)) {
|
||||
log.error(LOG_PREFIX + "UNAUTH::INVALID_APIKEY");
|
||||
response.setCode(-1);
|
||||
return new ResponseEntity<RvHoldemResponse>(response, httpStatus);
|
||||
}
|
||||
|
||||
Member memInfo = new Member();
|
||||
memInfo.setSiteIdx(siteIdx);
|
||||
memInfo.setMemId(memberId);
|
||||
HashMap memberVo = userService.getMemberMap(memInfo);
|
||||
|
||||
// Insert rvholdem_callback_log
|
||||
RvHoldemVO rvParam = RvHoldemVO.fromJSONObject(LOG_PREFIX, requestBody);
|
||||
rvParam.setSiteId(memberVo.get("siteId").toString());
|
||||
rvParam.setMemId(memberId);
|
||||
rvParam.setCallbackType("rebuyin");
|
||||
log.info(LOG_PREFIX+ "rvParam : " + rvParam.toString());
|
||||
|
||||
int balance = Integer.parseInt(memberVo.get("cashAmt").toString());
|
||||
int amount = rvParam.getAmount();
|
||||
rvParam.setBfBalance(balance);
|
||||
rvParam.setAfBalance(balance+amount);
|
||||
|
||||
int cbIdx = 0;
|
||||
try {
|
||||
cbIdx = betService.insertRvhCallbackLog(rvParam);
|
||||
} catch(DataIntegrityViolationException de) {
|
||||
log.error(LOG_PREFIX + "Duplicate cb_uid!!! " + de.getMessage(), de);
|
||||
response.setCode(-2);
|
||||
return new ResponseEntity<RvHoldemResponse>(response, httpStatus);
|
||||
}
|
||||
|
||||
if(cbIdx > 0) {
|
||||
HashMap balanceParam = new HashMap();
|
||||
balanceParam.put("siteIdx", memInfo.getSiteIdx());
|
||||
balanceParam.put("memId", memInfo.getMemId());
|
||||
balanceParam.put("cashAmt", Integer.toString(amount));
|
||||
balanceParam.put("changeFlag", "N");
|
||||
long chs4 = System.currentTimeMillis();
|
||||
int memCashResult = betService.updateUserCashByAmountNew(balanceParam);
|
||||
long che4 = System.currentTimeMillis(); // 코드 실행 후에 시간 받아오기
|
||||
double diff4 = (chs4 - che4)/1000.0; //두 시간에 차 계산
|
||||
log.info(LOG_PREFIX+ "updateUserCashByAmountNew() : " + String.format("%.3f", diff4));
|
||||
if(diff4 < -1.0) log.error(LOG_PREFIX+ "updateUserCashByAmountNew() : " + String.format("%.3f", diff4));
|
||||
|
||||
asyncService.cashProc(LOG_PREFIX, rvParam);
|
||||
} else {
|
||||
log.error(LOG_PREFIX + "INSERT_CALLBACK_LOG_FAIL");
|
||||
response.setCode(-3);
|
||||
return new ResponseEntity<RvHoldemResponse>(response, httpStatus);
|
||||
}
|
||||
|
||||
response.setCode(1);
|
||||
response.setPayload(balance+amount);
|
||||
|
||||
return new ResponseEntity<RvHoldemResponse>(response, httpStatus);
|
||||
}
|
||||
|
||||
@PostMapping(value="/game/win")
|
||||
public ResponseEntity<RvHoldemResponse> gameWin(HttpServletRequest request, @RequestBody JSONObject requestBody) {
|
||||
RvHoldemResponse response = new RvHoldemResponse();
|
||||
HttpStatus httpStatus = HttpStatus.OK;
|
||||
|
||||
String apiKey = request.getHeader("apikey").toString();
|
||||
String uid = requestBody.getString("uid");
|
||||
String cbUid = requestBody.getString("cb_uid");
|
||||
|
||||
int siteIdx = Integer.parseInt(uid.substring(0, 3), 16);
|
||||
String memberId = uid.substring(3, uid.length());
|
||||
final String LOG_PREFIX = "#-CB::RV_HOLDEM::"+uid+"::"+cbUid+"::gameWin:::";
|
||||
log.info(LOG_PREFIX+ "Request Body : " + requestBody.toString());
|
||||
|
||||
HashMap<String, String> checkInfo = userService.getRvHoldemCheckInfo(uid);
|
||||
if(checkInfo == null) {
|
||||
log.error(LOG_PREFIX + "UNAUTH::NOT_FOUND_USER");
|
||||
response.setCode(-1);
|
||||
return new ResponseEntity<RvHoldemResponse>(response, httpStatus);
|
||||
}
|
||||
|
||||
if(!checkInfo.get("apiKey").toString().equals(apiKey)) {
|
||||
log.error(LOG_PREFIX + "UNAUTH::INVALID_APIKEY");
|
||||
response.setCode(-1);
|
||||
return new ResponseEntity<RvHoldemResponse>(response, httpStatus);
|
||||
}
|
||||
|
||||
Member memInfo = new Member();
|
||||
memInfo.setSiteIdx(siteIdx);
|
||||
memInfo.setMemId(memberId);
|
||||
HashMap memberVo = userService.getMemberMap(memInfo);
|
||||
|
||||
// Insert rvholdem_callback_log
|
||||
RvHoldemVO rvParam = RvHoldemVO.fromJSONObject(LOG_PREFIX, requestBody);
|
||||
rvParam.setSiteId(memberVo.get("siteId").toString());
|
||||
rvParam.setMemId(memberId);
|
||||
rvParam.setCallbackType("win");
|
||||
log.info(LOG_PREFIX+ "rvParam : " + rvParam.toString());
|
||||
|
||||
int balance = Integer.parseInt(memberVo.get("cashAmt").toString());
|
||||
int amount = rvParam.getAmount();
|
||||
rvParam.setBfBalance(balance);
|
||||
rvParam.setAfBalance(balance+amount);
|
||||
|
||||
int cbIdx = 0;
|
||||
try {
|
||||
cbIdx = betService.insertRvhCallbackLog(rvParam);
|
||||
} catch(DataIntegrityViolationException de) {
|
||||
log.error(LOG_PREFIX + "Duplicate cb_uid!!! " + de.getMessage(), de);
|
||||
response.setCode(-2);
|
||||
return new ResponseEntity<RvHoldemResponse>(response, httpStatus);
|
||||
}
|
||||
|
||||
if(cbIdx > 0) {
|
||||
HashMap balanceParam = new HashMap();
|
||||
balanceParam.put("siteIdx", memInfo.getSiteIdx());
|
||||
balanceParam.put("memId", memInfo.getMemId());
|
||||
balanceParam.put("cashAmt", Integer.toString(amount));
|
||||
balanceParam.put("changeFlag", "N");
|
||||
long chs4 = System.currentTimeMillis();
|
||||
int memCashResult = betService.updateUserCashByAmountNew(balanceParam);
|
||||
long che4 = System.currentTimeMillis(); // 코드 실행 후에 시간 받아오기
|
||||
double diff4 = (chs4 - che4)/1000.0; //두 시간에 차 계산
|
||||
log.info(LOG_PREFIX+ "updateUserCashByAmountNew() : " + String.format("%.3f", diff4));
|
||||
if(diff4 < -1.0) log.error(LOG_PREFIX+ "updateUserCashByAmountNew() : " + String.format("%.3f", diff4));
|
||||
|
||||
asyncService.cashProc(LOG_PREFIX, rvParam);
|
||||
} else {
|
||||
log.error(LOG_PREFIX + "INSERT_CALLBACK_LOG_FAIL");
|
||||
response.setCode(-3);
|
||||
return new ResponseEntity<RvHoldemResponse>(response, httpStatus);
|
||||
}
|
||||
|
||||
response.setCode(1);
|
||||
response.setPayload(balance+amount);
|
||||
|
||||
return new ResponseEntity<RvHoldemResponse>(response, httpStatus);
|
||||
}
|
||||
|
||||
@PostMapping(value="/game/leave")
|
||||
public ResponseEntity<RvHoldemResponse> gameLeave(HttpServletRequest request, @RequestBody JSONObject requestBody) throws Exception {
|
||||
RvHoldemResponse response = new RvHoldemResponse();
|
||||
HttpStatus httpStatus = HttpStatus.OK;
|
||||
|
||||
String apiKey = request.getHeader("apikey").toString();
|
||||
String uid = requestBody.getString("uid");
|
||||
String cbUid = requestBody.getString("cb_uid");
|
||||
|
||||
int siteIdx = Integer.parseInt(uid.substring(0, 3), 16);
|
||||
String memberId = uid.substring(3, uid.length());
|
||||
final String LOG_PREFIX = "#-CB::RV_HOLDEM::"+uid+"::"+cbUid+"::gameLeave:::";
|
||||
log.info(LOG_PREFIX+ "Request Body : " + requestBody.toString());
|
||||
|
||||
HashMap<String, String> checkInfo = userService.getRvHoldemCheckInfo(uid);
|
||||
if(checkInfo == null) {
|
||||
log.error(LOG_PREFIX + "UNAUTH::NOT_FOUND_USER");
|
||||
response.setCode(-1);
|
||||
return new ResponseEntity<RvHoldemResponse>(response, httpStatus);
|
||||
}
|
||||
|
||||
if(!checkInfo.get("apiKey").toString().equals(apiKey)) {
|
||||
log.error(LOG_PREFIX + "UNAUTH::INVALID_APIKEY");
|
||||
response.setCode(-1);
|
||||
return new ResponseEntity<RvHoldemResponse>(response, httpStatus);
|
||||
}
|
||||
|
||||
Member memInfo = new Member();
|
||||
memInfo.setSiteIdx(siteIdx);
|
||||
memInfo.setMemId(memberId);
|
||||
HashMap memberVo = userService.getMemberMap(memInfo);
|
||||
|
||||
// Insert rvholdem_callback_log
|
||||
RvHoldemVO rvParam = RvHoldemVO.fromJSONObject(LOG_PREFIX, requestBody);
|
||||
rvParam.setSiteId(memberVo.get("siteId").toString());
|
||||
rvParam.setMemId(memberId);
|
||||
rvParam.setCallbackType("leave");
|
||||
log.info(LOG_PREFIX+ "rvParam : " + rvParam.toString());
|
||||
|
||||
int balance = Integer.parseInt(memberVo.get("cashAmt").toString());
|
||||
int amount = rvParam.getAmount();
|
||||
rvParam.setBfBalance(balance);
|
||||
rvParam.setAfBalance(balance+amount);
|
||||
|
||||
int cbIdx = 0;
|
||||
try {
|
||||
cbIdx = betService.insertRvhCallbackLog(rvParam);
|
||||
} catch(DataIntegrityViolationException de) {
|
||||
log.error(LOG_PREFIX + "Duplicate cb_uid!!! " + de.getMessage(), de);
|
||||
response.setCode(-2);
|
||||
return new ResponseEntity<RvHoldemResponse>(response, httpStatus);
|
||||
}
|
||||
|
||||
if(cbIdx > 0) {
|
||||
HashMap balanceParam = new HashMap();
|
||||
balanceParam.put("siteIdx", memInfo.getSiteIdx());
|
||||
balanceParam.put("memId", memInfo.getMemId());
|
||||
balanceParam.put("cashAmt", Integer.toString(amount));
|
||||
balanceParam.put("changeFlag", "N");
|
||||
long chs4 = System.currentTimeMillis();
|
||||
int memCashResult = betService.updateUserCashByAmountNew(balanceParam);
|
||||
long che4 = System.currentTimeMillis(); // 코드 실행 후에 시간 받아오기
|
||||
double diff4 = (chs4 - che4)/1000.0; //두 시간에 차 계산
|
||||
log.info(LOG_PREFIX+ "updateUserCashByAmountNew() : " + String.format("%.3f", diff4));
|
||||
if(diff4 < -1.0) log.error(LOG_PREFIX+ "updateUserCashByAmountNew() : " + String.format("%.3f", diff4));
|
||||
|
||||
asyncService.cashProc(LOG_PREFIX, rvParam);
|
||||
} else {
|
||||
log.error(LOG_PREFIX + "INSERT_CALLBACK_LOG_FAIL");
|
||||
response.setCode(-3);
|
||||
return new ResponseEntity<RvHoldemResponse>(response, httpStatus);
|
||||
}
|
||||
|
||||
response.setCode(1);
|
||||
response.setPayload(balance+amount);
|
||||
|
||||
return new ResponseEntity<RvHoldemResponse>(response, httpStatus);
|
||||
}
|
||||
|
||||
@PostMapping(value="/game/result")
|
||||
public ResponseEntity<RvHoldemResponse> gameResult(HttpServletRequest request, @RequestBody JSONObject requestBody) throws Exception {
|
||||
RvHoldemResponse response = new RvHoldemResponse();
|
||||
HttpStatus httpStatus = HttpStatus.OK;
|
||||
|
||||
String apiKey = request.getHeader("apikey").toString();
|
||||
String uid = requestBody.getString("uid");
|
||||
String cbUid = requestBody.getString("cb_uid");
|
||||
|
||||
int siteIdx = Integer.parseInt(uid.substring(0, 3), 16);
|
||||
String memberId = uid.substring(3, uid.length());
|
||||
final String LOG_PREFIX = "#-CB::RV_HOLDEM::"+uid+"::"+cbUid+"::gameResult:::";
|
||||
log.info(LOG_PREFIX+ "Request Body : " + requestBody.toString());
|
||||
|
||||
HashMap<String, String> checkInfo = userService.getRvHoldemCheckInfo(uid);
|
||||
if(checkInfo == null) {
|
||||
log.error(LOG_PREFIX + "UNAUTH::NOT_FOUND_USER");
|
||||
response.setCode(-1);
|
||||
return new ResponseEntity<RvHoldemResponse>(response, httpStatus);
|
||||
}
|
||||
|
||||
if(!checkInfo.get("apiKey").toString().equals(apiKey)) {
|
||||
log.error(LOG_PREFIX + "UNAUTH::INVALID_APIKEY");
|
||||
response.setCode(-1);
|
||||
return new ResponseEntity<RvHoldemResponse>(response, httpStatus);
|
||||
}
|
||||
|
||||
response.setCode(1);
|
||||
|
||||
return new ResponseEntity<RvHoldemResponse>(response, httpStatus);
|
||||
}
|
||||
}
|
||||
997
src/main/java/com/bb/controller/CallbackTripleController.java
Normal file
997
src/main/java/com/bb/controller/CallbackTripleController.java
Normal file
@@ -0,0 +1,997 @@
|
||||
package com.bb.controller;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.HashMap;
|
||||
|
||||
import org.springframework.dao.DataIntegrityViolationException;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.bb.model.Member;
|
||||
import com.bb.model.TripleResponse;
|
||||
import com.bb.model.TripleVO;
|
||||
import com.bb.service.AsyncBetService;
|
||||
import com.bb.service.BetService;
|
||||
import com.bb.service.SportService;
|
||||
import com.bb.service.UserService;
|
||||
import com.google.gson.Gson;
|
||||
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.sf.json.JSONObject;
|
||||
|
||||
@Slf4j
|
||||
@EnableScheduling
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping(value = "/triple")
|
||||
public class CallbackTripleController {
|
||||
|
||||
private final UserService userService;
|
||||
|
||||
private final BetService betService;
|
||||
|
||||
private final SportService sportService;
|
||||
|
||||
private final AsyncBetService asyncService;
|
||||
|
||||
|
||||
@PostMapping(value="/balance")
|
||||
public ResponseEntity<TripleResponse> balance(HttpServletRequest request, @RequestBody JSONObject requestBody) throws Exception {
|
||||
long startTime = System.currentTimeMillis();
|
||||
TripleResponse response = new TripleResponse();
|
||||
HttpStatus httpStatus = null;
|
||||
String tripleUserId = requestBody.getString("userId");
|
||||
int siteIdx = Integer.parseInt(tripleUserId.substring(0, 3), 16);
|
||||
String memberId = tripleUserId.substring(3, tripleUserId.length());
|
||||
final String LOG_PREFIX = "#-CB::TRIPLE::balance::"+requestBody.getString("userId")+"::"+requestBody.getString("requestAt")+":::";
|
||||
log.info(LOG_PREFIX+ "Request Body : " + requestBody.toString());
|
||||
|
||||
try {
|
||||
Member memInfo = new Member();
|
||||
memInfo.setSiteIdx(siteIdx);
|
||||
memInfo.setMemId(memberId);
|
||||
int balance = betService.getCurBalance(memInfo);
|
||||
response.setResult_code(0);
|
||||
response.setBalance(balance);
|
||||
httpStatus = HttpStatus.OK;
|
||||
|
||||
} catch(Exception e) {
|
||||
response.setResult_code(9999);
|
||||
response.setError_msg("UNKNOWN_ERROR");
|
||||
httpStatus = HttpStatus.INTERNAL_SERVER_ERROR;
|
||||
log.error(LOG_PREFIX+ "Exception : "+e.getMessage());
|
||||
}
|
||||
|
||||
log.info(LOG_PREFIX+ "Response Data : " + response.toString());
|
||||
long endTime = System.currentTimeMillis(); // 코드 실행 후에 시간 받아오기
|
||||
double diffTime = (startTime - endTime)/1000.0; //두 시간에 차 계산
|
||||
if(diffTime < -2.0) {
|
||||
log.error(LOG_PREFIX+ "[### balance diffTime : " + String.format("%.3f", diffTime) + " ###]");
|
||||
}
|
||||
|
||||
return new ResponseEntity<TripleResponse>(response, httpStatus);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping(value="/changebalance")
|
||||
public ResponseEntity<TripleResponse> changeBalance(HttpServletRequest request, @RequestBody JSONObject transaction) throws Exception {
|
||||
long startTime = System.currentTimeMillis();
|
||||
ResponseEntity<TripleResponse> resEntity = null;
|
||||
HttpStatus httpStatus = null;
|
||||
String tripleUserId = transaction.getString("userId");
|
||||
int siteIdx = Integer.parseInt(tripleUserId.substring(0, 3), 16);
|
||||
String memberId = tripleUserId.substring(3, tripleUserId.length());
|
||||
final String LOG_PREFIX = "#-CB::TRIPLE::changeBalance::"+transaction.getString("userId")+"::"+transaction.getString("tranId")+":::";
|
||||
log.info(LOG_PREFIX+ "Request Body : " + transaction.toString());
|
||||
|
||||
try {
|
||||
String transactionType = transaction.getString("tranType");
|
||||
int isCancel = transaction.getInt("isCancel");
|
||||
int isBonus = transaction.getInt("isBonus");
|
||||
|
||||
Member memInfo = new Member();
|
||||
memInfo.setSiteIdx(siteIdx);
|
||||
memInfo.setMemId(memberId);
|
||||
|
||||
if(!transaction.has("requestAt") || transaction.getString("requestAt").equals("")) {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
|
||||
long nDate = System.currentTimeMillis();
|
||||
String nDateStr = sdf.format(nDate);
|
||||
transaction.put("requestAt", nDateStr);
|
||||
}
|
||||
|
||||
int vendorIdx = transaction.getInt("vendorIdx");
|
||||
if(vendorIdx == 83 || vendorIdx == 84) {
|
||||
// 스포츠 배팅
|
||||
TripleVO tripleVO = new Gson().fromJson(transaction.toString(), TripleVO.class);
|
||||
net.sf.json.JSONObject responseObj = sportService.betProc(memInfo, tripleVO);
|
||||
TripleResponse response = new Gson().fromJson(responseObj.toString(), TripleResponse.class);
|
||||
if(responseObj.getString("result_code").equals("0") ||
|
||||
responseObj.getString("result_code").equals("70") ||
|
||||
responseObj.getString("result_code").equals("80") ||
|
||||
responseObj.getString("result_code").equals("98") ||
|
||||
responseObj.getString("result_code").equals("99") ||
|
||||
responseObj.getString("result_code").equals("44") ||
|
||||
responseObj.getString("result_code").equals("1005") ||
|
||||
responseObj.getString("result_code").equals("3333") ) {
|
||||
|
||||
// 0 70 80 98 99
|
||||
httpStatus = HttpStatus.OK;
|
||||
} else {
|
||||
httpStatus = HttpStatus.INTERNAL_SERVER_ERROR;
|
||||
}
|
||||
resEntity = new ResponseEntity<TripleResponse>(response, httpStatus);
|
||||
} else {
|
||||
if(transactionType.equals("debit") && isCancel == 0) {
|
||||
log.info(LOG_PREFIX+ "callBet() =================");
|
||||
resEntity = callBet(LOG_PREFIX, memInfo, transaction);
|
||||
|
||||
} else if(transactionType.equals("credit") && isCancel == 0 && isBonus == 0) {
|
||||
log.info(LOG_PREFIX+ "callWin() =================");
|
||||
resEntity = callWin(LOG_PREFIX, memInfo, transaction);
|
||||
|
||||
} else if(transactionType.equals("credit") && isCancel == 1) {
|
||||
log.info(LOG_PREFIX+ "callCancel() =================");
|
||||
resEntity = callCancel(LOG_PREFIX, memInfo, transaction);
|
||||
|
||||
} else if(transactionType.equals("credit") && isBonus == 1) {
|
||||
log.info(LOG_PREFIX+ "callBonus() =================");
|
||||
resEntity = callBonus(LOG_PREFIX, memInfo, transaction);
|
||||
|
||||
} else if(transactionType.equals("adjust")) {
|
||||
// 해당 타입은 "조정" 이라는 의미로, 해당 내역은 이미 처리된 내역에 대한 조정을 의미합니다.
|
||||
// amount 값은 + (재지급), - (오지급 회수)가 될 수 있습니다.
|
||||
log.info(LOG_PREFIX+ "callAdjust() =================");
|
||||
resEntity = callAdjust(LOG_PREFIX, memInfo, transaction);
|
||||
|
||||
} else if(transactionType.equals("tip")) {
|
||||
log.info(LOG_PREFIX+ "callTip() =================");
|
||||
resEntity = callTip(LOG_PREFIX, memInfo, transaction);
|
||||
|
||||
} else if(transactionType.equals("credit_wait")) {
|
||||
log.info(LOG_PREFIX+ "callCreditWait() =================");
|
||||
int balance = betService.getCurBalance(memInfo);
|
||||
TripleResponse response = new TripleResponse();
|
||||
response.setResult_code(0);
|
||||
response.setBalance(balance);
|
||||
httpStatus = HttpStatus.OK;
|
||||
resEntity = new ResponseEntity<TripleResponse>(response, httpStatus);
|
||||
|
||||
} else {
|
||||
log.error(LOG_PREFIX+ "unknown_transaction_type");
|
||||
TripleResponse response = new TripleResponse();
|
||||
response.setResult_code(8888);
|
||||
response.setError_msg("UNKNOWN_TRAN_TYPE");
|
||||
httpStatus = HttpStatus.INTERNAL_SERVER_ERROR;
|
||||
resEntity = new ResponseEntity<TripleResponse>(response, httpStatus);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
} catch(Exception e) {
|
||||
log.error(LOG_PREFIX+ "Exception : "+e.getMessage());
|
||||
TripleResponse response = new TripleResponse();
|
||||
response.setResult_code(9999);
|
||||
response.setError_msg("UNKNOWN_ERROR");
|
||||
httpStatus = HttpStatus.INTERNAL_SERVER_ERROR;
|
||||
resEntity = new ResponseEntity<TripleResponse>(response, httpStatus);
|
||||
}
|
||||
|
||||
log.info(LOG_PREFIX+ "Response Data : " + resEntity.toString());
|
||||
long endTime = System.currentTimeMillis(); // 코드 실행 후에 시간 받아오기
|
||||
double diffTime = (startTime - endTime)/1000.0; //두 시간에 차 계산
|
||||
if(diffTime < -2.0) {
|
||||
log.error(LOG_PREFIX+ "[### balance diffTime : " + String.format("%.3f", diffTime) + " ###]");
|
||||
}
|
||||
|
||||
return resEntity;
|
||||
}
|
||||
|
||||
|
||||
@PostMapping(value="/changebalance/slot")
|
||||
public ResponseEntity<TripleResponse> changeBalanceSlot(HttpServletRequest request, @RequestBody JSONObject transaction) throws Exception {
|
||||
long startTime = System.currentTimeMillis();
|
||||
ResponseEntity<TripleResponse> resEntity = null;
|
||||
HttpStatus httpStatus = null;
|
||||
String tripleUserId = transaction.getString("userId");
|
||||
int siteIdx = Integer.parseInt(tripleUserId.substring(0, 3), 16);
|
||||
String memberId = tripleUserId.substring(3, tripleUserId.length());
|
||||
final String LOG_PREFIX = "#-CB::TRIPLE::changeBalanceSlot::"+transaction.getString("userId")+"::"+transaction.getString("tranId")+":::";
|
||||
log.info(LOG_PREFIX+ "Request Body : " + transaction.toString());
|
||||
|
||||
try {
|
||||
String transactionType = transaction.getString("tranType");
|
||||
int isCancel = transaction.getInt("isCancel");
|
||||
int isBonus = transaction.getInt("isBonus");
|
||||
|
||||
Member memInfo = new Member();
|
||||
memInfo.setSiteIdx(siteIdx);
|
||||
memInfo.setMemId(memberId);
|
||||
|
||||
if(!transaction.has("requestAt") || transaction.getString("requestAt").equals("")) {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
|
||||
long nDate = System.currentTimeMillis();
|
||||
String nDateStr = sdf.format(nDate);
|
||||
transaction.put("requestAt", nDateStr);
|
||||
}
|
||||
|
||||
if(transactionType.equals("debit") && isCancel == 0) {
|
||||
log.info(LOG_PREFIX+ "callBet() =================");
|
||||
resEntity = callBetSlot(LOG_PREFIX, memInfo, transaction);
|
||||
|
||||
} else if(transactionType.equals("credit") && isCancel == 0 && isBonus == 0) {
|
||||
log.info(LOG_PREFIX+ "callWin() =================");
|
||||
resEntity = callWinSlot(LOG_PREFIX, memInfo, transaction);
|
||||
|
||||
} else if(transactionType.equals("credit") && isCancel == 1) {
|
||||
log.info(LOG_PREFIX+ "callCancel() =================");
|
||||
resEntity = callCancel(LOG_PREFIX, memInfo, transaction);
|
||||
|
||||
} else if(transactionType.equals("credit") && isBonus == 1) {
|
||||
log.info(LOG_PREFIX+ "callBonus() =================");
|
||||
resEntity = callBonus(LOG_PREFIX, memInfo, transaction);
|
||||
|
||||
} else if(transactionType.equals("adjust")) {
|
||||
// 해당 타입은 "조정" 이라는 의미로, 해당 내역은 이미 처리된 내역에 대한 조정을 의미합니다.
|
||||
// amount 값은 + (재지급), - (오지급 회수)가 될 수 있습니다.
|
||||
log.info(LOG_PREFIX+ "callAdjust() =================");
|
||||
resEntity = callAdjust(LOG_PREFIX, memInfo, transaction);
|
||||
|
||||
} else if(transactionType.equals("tip")) {
|
||||
log.info(LOG_PREFIX+ "callTip() =================");
|
||||
resEntity = callTip(LOG_PREFIX, memInfo, transaction);
|
||||
|
||||
} else if(transactionType.equals("credit_wait")) {
|
||||
log.info(LOG_PREFIX+ "callCreditWait() =================");
|
||||
int balance = betService.getCurBalance(memInfo);
|
||||
TripleResponse response = new TripleResponse();
|
||||
response.setResult_code(0);
|
||||
response.setBalance(balance);
|
||||
httpStatus = HttpStatus.OK;
|
||||
resEntity = new ResponseEntity<TripleResponse>(response, httpStatus);
|
||||
|
||||
} else {
|
||||
log.error(LOG_PREFIX+ "unknown_transaction_type");
|
||||
TripleResponse response = new TripleResponse();
|
||||
response.setResult_code(8888);
|
||||
response.setError_msg("UNKNOWN_TRAN_TYPE");
|
||||
httpStatus = HttpStatus.INTERNAL_SERVER_ERROR;
|
||||
resEntity = new ResponseEntity<TripleResponse>(response, httpStatus);
|
||||
|
||||
}
|
||||
|
||||
} catch(Exception e) {
|
||||
log.error(LOG_PREFIX+ "Exception : "+e.getMessage());
|
||||
TripleResponse response = new TripleResponse();
|
||||
response.setResult_code(9999);
|
||||
response.setError_msg("UNKNOWN_ERROR");
|
||||
httpStatus = HttpStatus.INTERNAL_SERVER_ERROR;
|
||||
resEntity = new ResponseEntity<TripleResponse>(response, httpStatus);
|
||||
}
|
||||
|
||||
log.info(LOG_PREFIX+ "Response Data : " + resEntity.toString());
|
||||
long endTime = System.currentTimeMillis(); // 코드 실행 후에 시간 받아오기
|
||||
double diffTime = (startTime - endTime)/1000.0; //두 시간에 차 계산
|
||||
if(diffTime < -2.0) {
|
||||
log.error(LOG_PREFIX+ "[### balance diffTime : " + String.format("%.3f", diffTime) + " ###]");
|
||||
}
|
||||
|
||||
return resEntity;
|
||||
}
|
||||
|
||||
|
||||
private ResponseEntity<TripleResponse> callBet(String LOG_PREFIX, Member memInfo, JSONObject transaction) {
|
||||
LOG_PREFIX = LOG_PREFIX + "BET:::";
|
||||
ResponseEntity<TripleResponse> resEntity = null;
|
||||
TripleResponse response = new TripleResponse();
|
||||
|
||||
HashMap memberVo = userService.getMemberMap(memInfo);
|
||||
if(memberVo == null) {
|
||||
log.error(LOG_PREFIX+ "NOT_FOUND_USER");
|
||||
response.setResult_code(1111);
|
||||
response.setError_msg("NOT_FOUND_USER");
|
||||
resEntity = new ResponseEntity<TripleResponse>(response, HttpStatus.OK);
|
||||
return resEntity;
|
||||
}
|
||||
|
||||
if(memberVo.get("betYn").toString().equals("N") || memberVo.get("memLockYn").toString().equals("Y")) {
|
||||
log.error(LOG_PREFIX+ "betYn : "+memberVo.get("betYn").toString());
|
||||
log.error(LOG_PREFIX+ "memLockYn : "+memberVo.get("memLockYn").toString());
|
||||
response.setResult_code(1005);
|
||||
response.setError_msg("THIS_USER_BETTING_LOCK");
|
||||
resEntity = new ResponseEntity<TripleResponse>(response, HttpStatus.OK);
|
||||
return resEntity;
|
||||
}
|
||||
|
||||
int balance = Integer.parseInt(memberVo.get("cashAmt").toString());
|
||||
int amount = transaction.getInt("debit");
|
||||
amount = Math.abs(amount) * -1;
|
||||
if(balance < Math.abs(amount)) {
|
||||
log.error(LOG_PREFIX+ "유저 잔액부족::balance::"+balance+"::amount::"+amount);
|
||||
response.setResult_code(80);
|
||||
response.setBalance(balance);
|
||||
response.setError_msg("INSUFFICIENT_FUNDS");
|
||||
resEntity = new ResponseEntity<TripleResponse>(response, HttpStatus.OK);
|
||||
return resEntity;
|
||||
}
|
||||
|
||||
String tranId = transaction.getString("tranId");
|
||||
String betId = transaction.getString("betId");
|
||||
String apiVendorCode = transaction.getString("vendorKey");
|
||||
String gameName = transaction.getString("gameKey");
|
||||
|
||||
HashMap<String, String> vParam = new HashMap<>();
|
||||
vParam.put("siteId", memberVo.get("siteId").toString());
|
||||
vParam.put("apiCompCode", "triple");
|
||||
vParam.put("apiVendorCode", apiVendorCode);
|
||||
vParam.put("memLevel", memberVo.get("memLevel").toString());
|
||||
HashMap<String, String> siteVendorInfo = betService.getSiteVendorInfo(vParam);
|
||||
if(siteVendorInfo == null) {
|
||||
log.error(LOG_PREFIX+ "NOT_FOUND_VENDOR");
|
||||
response.setResult_code(70);
|
||||
response.setError_msg("NOT_FOUND_VENDOR");
|
||||
resEntity = new ResponseEntity<TripleResponse>(response, HttpStatus.OK);
|
||||
return resEntity;
|
||||
}
|
||||
|
||||
int maxBetAmt = Integer.parseInt(siteVendorInfo.get("betAmtMax").toString());
|
||||
if(maxBetAmt < Math.abs(amount)) {
|
||||
log.error(LOG_PREFIX+ "MAX_BET_OVER");
|
||||
log.error(LOG_PREFIX+ "siteMaxBet : " + maxBetAmt +", amount : " + amount);
|
||||
response.setResult_code(81);
|
||||
response.setBalance(balance);
|
||||
response.setError_msg("MAX_BET_OVER");
|
||||
resEntity = new ResponseEntity<TripleResponse>(response, HttpStatus.OK);
|
||||
return resEntity;
|
||||
}
|
||||
|
||||
HashMap betData = new HashMap();
|
||||
betData.put("tranId", tranId);
|
||||
betData.put("betId", betId);
|
||||
betData.put("siteId", memberVo.get("siteId").toString());
|
||||
betData.put("memId", memberVo.get("memId").toString());
|
||||
betData.put("apiCompCode", "triple");
|
||||
betData.put("apiVendor", transaction.getString("vendor"));
|
||||
betData.put("gameCategory", siteVendorInfo.get("gameCategory").toString());
|
||||
betData.put("vendorCode", siteVendorInfo.get("vendorCode").toString());
|
||||
betData.put("gameName", gameName);
|
||||
betData.put("tranType", "DEBIT");
|
||||
betData.put("betAmt", Math.abs(amount));
|
||||
betData.put("betWinAmt", 0);
|
||||
betData.put("balance", (balance+amount));
|
||||
betData.put("isBlankSpinYn", "N");
|
||||
betData.put("pointRegYn", "N");
|
||||
betData.put("regDate", transaction.getString("requestAt"));
|
||||
betData.put("updDate", transaction.getString("requestAt"));
|
||||
int betResult = 0;
|
||||
try {
|
||||
log.info(LOG_PREFIX+ "betData : "+betData.toString());
|
||||
betResult = betService.insertBetNew(betData);
|
||||
log.info(LOG_PREFIX+ "insertBet result : "+betResult);
|
||||
} catch(DataIntegrityViolationException de) {
|
||||
log.error(LOG_PREFIX+ "Duplicate tranId!!!");
|
||||
response.setResult_code(98);
|
||||
response.setBalance(balance);
|
||||
response.setError_msg("BET_ALREADY_SETTLED");
|
||||
resEntity = new ResponseEntity<TripleResponse>(response, HttpStatus.OK);
|
||||
return resEntity;
|
||||
}
|
||||
|
||||
if(betResult > 0) {
|
||||
HashMap balanceParam = new HashMap();
|
||||
balanceParam.put("siteIdx", memInfo.getSiteIdx());
|
||||
balanceParam.put("memId", memInfo.getMemId());
|
||||
balanceParam.put("cashAmt", Integer.toString(amount));
|
||||
balanceParam.put("changeFlag", "N");
|
||||
long chs4 = System.currentTimeMillis();
|
||||
int memCashResult = betService.updateUserCashByAmountNew(balanceParam);
|
||||
long che4 = System.currentTimeMillis(); // 코드 실행 후에 시간 받아오기
|
||||
double diff4 = (chs4 - che4)/1000.0; //두 시간에 차 계산
|
||||
log.info(LOG_PREFIX+ "updateUserCashByAmountNew() : " + String.format("%.3f", diff4));
|
||||
if(diff4 < -1.0) log.error(LOG_PREFIX+ "updateUserCashByAmountNew() : " + String.format("%.3f", diff4));
|
||||
|
||||
asyncService.rollingProc(LOG_PREFIX, betData);
|
||||
|
||||
} else {
|
||||
log.error(LOG_PREFIX+ "BET_FAIL");
|
||||
response.setResult_code(9999);
|
||||
response.setError_msg("BET_FAIL");
|
||||
resEntity = new ResponseEntity<TripleResponse>(response, HttpStatus.INTERNAL_SERVER_ERROR);
|
||||
return resEntity;
|
||||
}
|
||||
|
||||
log.info(LOG_PREFIX+ "beforeBalance : "+balance);
|
||||
log.info(LOG_PREFIX+ "amount : "+amount);
|
||||
log.info(LOG_PREFIX+ "responseBalance : "+(balance+amount));
|
||||
|
||||
response.setResult_code(0);
|
||||
response.setBalance(balance+amount);
|
||||
response.setError_msg("");
|
||||
resEntity = new ResponseEntity<TripleResponse>(response, HttpStatus.OK);
|
||||
return resEntity;
|
||||
}
|
||||
|
||||
|
||||
private ResponseEntity<TripleResponse> callWin(String LOG_PREFIX, Member memInfo, JSONObject transaction) {
|
||||
LOG_PREFIX = LOG_PREFIX + "WIN:::";
|
||||
ResponseEntity<TripleResponse> resEntity = null;
|
||||
TripleResponse response = new TripleResponse();
|
||||
|
||||
String tranId = transaction.getString("tranId");
|
||||
String betId = transaction.getString("betId");
|
||||
|
||||
HashMap betData = betService.getReferenceData2(betId);
|
||||
if(betData == null) {
|
||||
log.error(LOG_PREFIX+ "NOT_FOUND_REF_DATA");
|
||||
response.setResult_code(99);
|
||||
response.setError_msg("NOT_FOUND_REF_DATA");
|
||||
resEntity = new ResponseEntity<TripleResponse>(response, HttpStatus.OK);
|
||||
return resEntity;
|
||||
}
|
||||
|
||||
int balance = betService.getCurBalance(memInfo);
|
||||
int amount = transaction.getInt("credit");
|
||||
betData.put("tranId", tranId);
|
||||
betData.put("betId", betId);
|
||||
betData.put("tranType", "CREDIT");
|
||||
betData.put("betAmt", 0);
|
||||
betData.put("betWinAmt", Math.abs(amount));
|
||||
betData.put("balance", (balance+amount));
|
||||
betData.put("updDate", transaction.getString("requestAt"));
|
||||
int betResult = 0;
|
||||
try {
|
||||
log.info(LOG_PREFIX+ "betData : "+betData.toString());
|
||||
betResult = betService.insertBetNew(betData);
|
||||
log.info(LOG_PREFIX+ "insertBet result : "+betResult);
|
||||
} catch(DataIntegrityViolationException de) {
|
||||
log.error(LOG_PREFIX+ "Duplicate tranId!!!");
|
||||
response.setResult_code(98);
|
||||
response.setBalance(balance);
|
||||
response.setError_msg("WIN_ALREADY_SETTLED");
|
||||
resEntity = new ResponseEntity<TripleResponse>(response, HttpStatus.OK);
|
||||
return resEntity;
|
||||
}
|
||||
|
||||
if(betResult > 0) {
|
||||
HashMap balanceParam = new HashMap();
|
||||
balanceParam.put("siteIdx", memInfo.getSiteIdx());
|
||||
balanceParam.put("memId", memInfo.getMemId());
|
||||
balanceParam.put("cashAmt", Integer.toString(amount));
|
||||
balanceParam.put("changeFlag", "N");
|
||||
long chs4 = System.currentTimeMillis();
|
||||
int memCashResult = betService.updateUserCashByAmountNew(balanceParam);
|
||||
long che4 = System.currentTimeMillis(); // 코드 실행 후에 시간 받아오기
|
||||
double diff4 = (chs4 - che4)/1000.0; //두 시간에 차 계산
|
||||
log.info(LOG_PREFIX+ "updateUserCashByAmountNew() : " + String.format("%.3f", diff4));
|
||||
if(diff4 < -1.0) log.error(LOG_PREFIX+ "updateUserCashByAmountNew() : " + String.format("%.3f", diff4));
|
||||
|
||||
if(betData.get("gameCategory").toString().equals("casino")) {
|
||||
// #-Rolling Tie Proc call
|
||||
asyncService.rollingTieProc(LOG_PREFIX, betId);
|
||||
}
|
||||
else {
|
||||
asyncService.losingResultProc(LOG_PREFIX, betData);
|
||||
}
|
||||
|
||||
//asyncService.losingResultProc(LOG_PREFIX, betData);
|
||||
} else {
|
||||
log.error(LOG_PREFIX+ "WIN_FAIL");
|
||||
response.setResult_code(9999);
|
||||
response.setError_msg("WIN_FAIL");
|
||||
resEntity = new ResponseEntity<TripleResponse>(response, HttpStatus.INTERNAL_SERVER_ERROR);
|
||||
return resEntity;
|
||||
}
|
||||
|
||||
log.info(LOG_PREFIX+ "beforeBalance : "+balance);
|
||||
log.info(LOG_PREFIX+ "amount : "+amount);
|
||||
log.info(LOG_PREFIX+ "responseBalance : "+(balance+amount));
|
||||
|
||||
response.setResult_code(0);
|
||||
response.setBalance(balance+amount);
|
||||
response.setError_msg("");
|
||||
resEntity = new ResponseEntity<TripleResponse>(response, HttpStatus.OK);
|
||||
return resEntity;
|
||||
}
|
||||
|
||||
|
||||
private ResponseEntity<TripleResponse> callCancel(String LOG_PREFIX, Member memInfo, JSONObject transaction) {
|
||||
LOG_PREFIX = LOG_PREFIX + "CANCEL:::";
|
||||
ResponseEntity<TripleResponse> resEntity = null;
|
||||
TripleResponse response = new TripleResponse();
|
||||
|
||||
String tranId = transaction.getString("tranId");
|
||||
String betId = transaction.getString("betId");
|
||||
|
||||
HashMap betData = betService.getReferenceData1(betId);
|
||||
if(betData == null) {
|
||||
log.error(LOG_PREFIX+ "NOT_FOUND_REF_DATA");
|
||||
response.setResult_code(99);
|
||||
response.setError_msg("NOT_FOUND_REF_DATA");
|
||||
resEntity = new ResponseEntity<TripleResponse>(response, HttpStatus.OK);
|
||||
return resEntity;
|
||||
}
|
||||
|
||||
int betAmt = Integer.parseInt(betData.get("betAmt").toString());
|
||||
int balance = betService.getCurBalance(memInfo);
|
||||
int amount = transaction.getInt("credit");
|
||||
|
||||
betData.put("tranId", tranId);
|
||||
betData.put("betId", betId);
|
||||
betData.put("tranType", "CANCEL");
|
||||
betData.put("betAmt", 0);
|
||||
betData.put("betWinAmt", Math.abs(amount));
|
||||
betData.put("balance", (balance+amount));
|
||||
betData.put("isCancel", "Y");
|
||||
betData.put("updDate", transaction.getString("requestAt"));
|
||||
int betResult = 0;
|
||||
try {
|
||||
log.info(LOG_PREFIX+ "betData : "+betData.toString());
|
||||
betResult = betService.insertBetNew(betData);
|
||||
log.info(LOG_PREFIX+ "insertBet result : "+betResult);
|
||||
} catch(DataIntegrityViolationException de) {
|
||||
log.error(LOG_PREFIX+ "Duplicate tranId!!!");
|
||||
response.setResult_code(98);
|
||||
response.setBalance(balance);
|
||||
response.setError_msg("CANCEL_ALREADY_SETTLED");
|
||||
resEntity = new ResponseEntity<TripleResponse>(response, HttpStatus.OK);
|
||||
return resEntity;
|
||||
}
|
||||
|
||||
if(betResult > 0) {
|
||||
HashMap balanceParam = new HashMap();
|
||||
balanceParam.put("siteIdx", memInfo.getSiteIdx());
|
||||
balanceParam.put("memId", memInfo.getMemId());
|
||||
balanceParam.put("cashAmt", Integer.toString(amount));
|
||||
balanceParam.put("changeFlag", "N");
|
||||
long chs4 = System.currentTimeMillis();
|
||||
int memCashResult = betService.updateUserCashByAmountNew(balanceParam);
|
||||
long che4 = System.currentTimeMillis(); // 코드 실행 후에 시간 받아오기
|
||||
double diff4 = (chs4 - che4)/1000.0; //두 시간에 차 계산
|
||||
log.info(LOG_PREFIX+ "updateUserCashByAmountNew() : " + String.format("%.3f", diff4));
|
||||
if(diff4 < -1.0) log.error(LOG_PREFIX+ "updateUserCashByAmountNew() : " + String.format("%.3f", diff4));
|
||||
|
||||
asyncService.rollingCancelProc(LOG_PREFIX, betAmt, betData);
|
||||
|
||||
//asyncService.losingResultProc(LOG_PREFIX, betData);
|
||||
|
||||
} else {
|
||||
log.error(LOG_PREFIX+ "CANCEL_FAIL");
|
||||
response.setResult_code(9999);
|
||||
response.setError_msg("CANCEL_FAIL");
|
||||
resEntity = new ResponseEntity<TripleResponse>(response, HttpStatus.INTERNAL_SERVER_ERROR);
|
||||
return resEntity;
|
||||
}
|
||||
|
||||
log.info(LOG_PREFIX+ "beforeBalance : "+balance);
|
||||
log.info(LOG_PREFIX+ "amount : "+amount);
|
||||
log.info(LOG_PREFIX+ "responseBalance : "+(balance+amount));
|
||||
|
||||
response.setResult_code(0);
|
||||
response.setBalance(balance+amount);
|
||||
response.setError_msg("");
|
||||
resEntity = new ResponseEntity<TripleResponse>(response, HttpStatus.OK);
|
||||
return resEntity;
|
||||
}
|
||||
|
||||
|
||||
private ResponseEntity<TripleResponse> callBetSlot(String LOG_PREFIX, Member memInfo, JSONObject transaction) {
|
||||
LOG_PREFIX = LOG_PREFIX + "BET:::";
|
||||
ResponseEntity<TripleResponse> resEntity = null;
|
||||
TripleResponse response = new TripleResponse();
|
||||
|
||||
HashMap memberVo = userService.getMemberMap(memInfo);
|
||||
if(memberVo == null) {
|
||||
log.error(LOG_PREFIX+ "NOT_FOUND_USER");
|
||||
response.setResult_code(1111);
|
||||
response.setError_msg("NOT_FOUND_USER");
|
||||
resEntity = new ResponseEntity<TripleResponse>(response, HttpStatus.OK);
|
||||
return resEntity;
|
||||
}
|
||||
|
||||
if(memberVo.get("betYn").toString().equals("N") || memberVo.get("memLockYn").toString().equals("Y")) {
|
||||
log.error(LOG_PREFIX+ "betYn : "+memberVo.get("betYn").toString());
|
||||
log.error(LOG_PREFIX+ "memLockYn : "+memberVo.get("memLockYn").toString());
|
||||
response.setResult_code(1005);
|
||||
response.setError_msg("THIS_USER_BETTING_LOCK");
|
||||
resEntity = new ResponseEntity<TripleResponse>(response, HttpStatus.OK);
|
||||
return resEntity;
|
||||
}
|
||||
|
||||
int balance = Integer.parseInt(memberVo.get("cashAmt").toString());
|
||||
int amount = transaction.getInt("debit");
|
||||
amount = Math.abs(amount) * -1;
|
||||
if(balance < Math.abs(amount)) {
|
||||
log.error(LOG_PREFIX+ "유저 잔액부족::balance::"+balance+"::amount::"+amount);
|
||||
response.setResult_code(80);
|
||||
response.setBalance(balance);
|
||||
response.setError_msg("INSUFFICIENT_FUNDS");
|
||||
resEntity = new ResponseEntity<TripleResponse>(response, HttpStatus.OK);
|
||||
return resEntity;
|
||||
}
|
||||
|
||||
String tranId = transaction.getString("tranId");
|
||||
String betId = transaction.getString("betId");
|
||||
String apiVendorCode = transaction.getString("vendorKey");
|
||||
String gameName = transaction.getString("gameKey");
|
||||
|
||||
HashMap<String, String> vParam = new HashMap<>();
|
||||
vParam.put("siteId", memberVo.get("siteId").toString());
|
||||
vParam.put("apiCompCode", "triple");
|
||||
vParam.put("apiVendorCode", apiVendorCode);
|
||||
vParam.put("memLevel", memberVo.get("memLevel").toString());
|
||||
HashMap<String, String> siteVendorInfo = betService.getSiteVendorInfo(vParam);
|
||||
if(siteVendorInfo == null) {
|
||||
log.error(LOG_PREFIX+ "NOT_FOUND_VENDOR");
|
||||
response.setResult_code(70);
|
||||
response.setError_msg("NOT_FOUND_VENDOR");
|
||||
resEntity = new ResponseEntity<TripleResponse>(response, HttpStatus.OK);
|
||||
return resEntity;
|
||||
}
|
||||
|
||||
int maxBetAmt = Integer.parseInt(siteVendorInfo.get("betAmtMaxSlot").toString());
|
||||
if(maxBetAmt < Math.abs(amount)) {
|
||||
log.error(LOG_PREFIX+ "MAX_BET_OVER");
|
||||
log.error(LOG_PREFIX+ "siteMaxBet : " + maxBetAmt +", amount : " + amount);
|
||||
response.setResult_code(81);
|
||||
response.setBalance(balance);
|
||||
response.setError_msg("MAX_BET_OVER");
|
||||
resEntity = new ResponseEntity<TripleResponse>(response, HttpStatus.OK);
|
||||
return resEntity;
|
||||
}
|
||||
|
||||
HashMap betData = new HashMap();
|
||||
betData.put("tranId", tranId);
|
||||
betData.put("betId", betId);
|
||||
betData.put("siteId", memberVo.get("siteId").toString());
|
||||
betData.put("memId", memberVo.get("memId").toString());
|
||||
betData.put("apiCompCode", "triple");
|
||||
betData.put("apiVendor", transaction.getString("vendor"));
|
||||
betData.put("gameCategory", siteVendorInfo.get("gameCategory").toString());
|
||||
betData.put("vendorCode", siteVendorInfo.get("vendorCode").toString());
|
||||
betData.put("gameName", gameName);
|
||||
betData.put("tranType", "DEBIT");
|
||||
betData.put("betAmt", Math.abs(amount));
|
||||
betData.put("betWinAmt", 0);
|
||||
betData.put("balance", (balance+amount));
|
||||
betData.put("isBlankSpinYn", "N");
|
||||
betData.put("pointRegYn", "N");
|
||||
betData.put("regDate", transaction.getString("requestAt"));
|
||||
betData.put("updDate", transaction.getString("requestAt"));
|
||||
int betResult = 0;
|
||||
try {
|
||||
log.info(LOG_PREFIX+ "betData : "+betData.toString());
|
||||
betResult = betService.insertBetNew(betData);
|
||||
log.info(LOG_PREFIX+ "insertBet result : "+betResult);
|
||||
} catch(DataIntegrityViolationException de) {
|
||||
log.error(LOG_PREFIX+ "Duplicate tranId!!!");
|
||||
response.setResult_code(98);
|
||||
response.setBalance(balance);
|
||||
response.setError_msg("BET_ALREADY_SETTLED");
|
||||
resEntity = new ResponseEntity<TripleResponse>(response, HttpStatus.OK);
|
||||
return resEntity;
|
||||
}
|
||||
|
||||
if(betResult > 0) {
|
||||
HashMap balanceParam = new HashMap();
|
||||
balanceParam.put("siteIdx", memInfo.getSiteIdx());
|
||||
balanceParam.put("memId", memInfo.getMemId());
|
||||
balanceParam.put("cashAmt", Integer.toString(amount));
|
||||
balanceParam.put("changeFlag", "N");
|
||||
long chs4 = System.currentTimeMillis();
|
||||
int memCashResult = betService.updateUserCashByAmountNew(balanceParam);
|
||||
long che4 = System.currentTimeMillis(); // 코드 실행 후에 시간 받아오기
|
||||
double diff4 = (chs4 - che4)/1000.0; //두 시간에 차 계산
|
||||
log.info(LOG_PREFIX+ "updateUserCashByAmountNew() : " + String.format("%.3f", diff4));
|
||||
if(diff4 < -1.0) log.error(LOG_PREFIX+ "updateUserCashByAmountNew() : " + String.format("%.3f", diff4));
|
||||
|
||||
asyncService.rollingProc(LOG_PREFIX, betData);
|
||||
} else {
|
||||
log.error(LOG_PREFIX+ "BET_FAIL");
|
||||
response.setResult_code(9999);
|
||||
response.setError_msg("BET_FAIL");
|
||||
resEntity = new ResponseEntity<TripleResponse>(response, HttpStatus.INTERNAL_SERVER_ERROR);
|
||||
return resEntity;
|
||||
}
|
||||
|
||||
log.info(LOG_PREFIX+ "beforeBalance : "+balance);
|
||||
log.info(LOG_PREFIX+ "amount : "+amount);
|
||||
log.info(LOG_PREFIX+ "responseBalance : "+(balance+amount));
|
||||
|
||||
response.setResult_code(0);
|
||||
response.setBalance(balance+amount);
|
||||
response.setError_msg("");
|
||||
resEntity = new ResponseEntity<TripleResponse>(response, HttpStatus.OK);
|
||||
return resEntity;
|
||||
}
|
||||
|
||||
|
||||
private ResponseEntity<TripleResponse> callWinSlot(String LOG_PREFIX, Member memInfo, JSONObject transaction) {
|
||||
LOG_PREFIX = LOG_PREFIX + "WIN:::";
|
||||
ResponseEntity<TripleResponse> resEntity = null;
|
||||
TripleResponse response = new TripleResponse();
|
||||
|
||||
String tranId = transaction.getString("tranId");
|
||||
String betId = transaction.getString("betId");
|
||||
|
||||
HashMap betData = betService.getReferenceData2(betId);
|
||||
if(betData == null) {
|
||||
log.error(LOG_PREFIX+ "NOT_FOUND_REF_DATA");
|
||||
response.setResult_code(99);
|
||||
response.setError_msg("NOT_FOUND_REF_DATA");
|
||||
resEntity = new ResponseEntity<TripleResponse>(response, HttpStatus.OK);
|
||||
return resEntity;
|
||||
}
|
||||
|
||||
int balance = betService.getCurBalance(memInfo);
|
||||
int amount = transaction.getInt("credit");
|
||||
betData.put("tranId", tranId);
|
||||
betData.put("betId", betId);
|
||||
betData.put("tranType", "CREDIT");
|
||||
betData.put("betAmt", 0);
|
||||
betData.put("betWinAmt", Math.abs(amount));
|
||||
betData.put("balance", (balance+amount));
|
||||
betData.put("updDate", transaction.getString("requestAt"));
|
||||
int betResult = 0;
|
||||
try {
|
||||
log.info(LOG_PREFIX+ "betData : "+betData.toString());
|
||||
betResult = betService.insertBetNew(betData);
|
||||
log.info(LOG_PREFIX+ "insertBet result : "+betResult);
|
||||
} catch(DataIntegrityViolationException de) {
|
||||
log.error(LOG_PREFIX+ "Duplicate tranId!!!");
|
||||
response.setResult_code(98);
|
||||
response.setBalance(balance);
|
||||
response.setError_msg("WIN_ALREADY_SETTLED");
|
||||
resEntity = new ResponseEntity<TripleResponse>(response, HttpStatus.OK);
|
||||
return resEntity;
|
||||
}
|
||||
|
||||
if(betResult > 0) {
|
||||
HashMap balanceParam = new HashMap();
|
||||
balanceParam.put("siteIdx", memInfo.getSiteIdx());
|
||||
balanceParam.put("memId", memInfo.getMemId());
|
||||
balanceParam.put("cashAmt", Integer.toString(amount));
|
||||
balanceParam.put("changeFlag", "N");
|
||||
long chs4 = System.currentTimeMillis();
|
||||
int memCashResult = betService.updateUserCashByAmountNew(balanceParam);
|
||||
long che4 = System.currentTimeMillis(); // 코드 실행 후에 시간 받아오기
|
||||
double diff4 = (chs4 - che4)/1000.0; //두 시간에 차 계산
|
||||
log.info(LOG_PREFIX+ "updateUserCashByAmountNew() : " + String.format("%.3f", diff4));
|
||||
if(diff4 < -1.0) log.error(LOG_PREFIX+ "updateUserCashByAmountNew() : " + String.format("%.3f", diff4));
|
||||
|
||||
asyncService.losingResultProc(LOG_PREFIX, betData);
|
||||
|
||||
} else {
|
||||
log.error(LOG_PREFIX+ "WIN_FAIL");
|
||||
response.setResult_code(9999);
|
||||
response.setError_msg("WIN_FAIL");
|
||||
resEntity = new ResponseEntity<TripleResponse>(response, HttpStatus.INTERNAL_SERVER_ERROR);
|
||||
return resEntity;
|
||||
}
|
||||
|
||||
log.info(LOG_PREFIX+ "beforeBalance : "+balance);
|
||||
log.info(LOG_PREFIX+ "amount : "+amount);
|
||||
log.info(LOG_PREFIX+ "responseBalance : "+(balance+amount));
|
||||
|
||||
response.setResult_code(0);
|
||||
response.setBalance(balance+amount);
|
||||
response.setError_msg("");
|
||||
resEntity = new ResponseEntity<TripleResponse>(response, HttpStatus.OK);
|
||||
return resEntity;
|
||||
}
|
||||
|
||||
|
||||
private ResponseEntity<TripleResponse> callBonus(String LOG_PREFIX, Member memInfo, JSONObject transaction) {
|
||||
LOG_PREFIX = LOG_PREFIX + "BONUS:::";
|
||||
ResponseEntity<TripleResponse> resEntity = null;
|
||||
TripleResponse response = new TripleResponse();
|
||||
|
||||
String tranId = transaction.getString("tranId");
|
||||
String betId = transaction.getString("betId");
|
||||
|
||||
int betResult = 0;
|
||||
int balance = 0;
|
||||
int amount = Math.abs(transaction.getInt("credit"));
|
||||
|
||||
HashMap betData = betService.getReferenceData2(betId);
|
||||
if(betData != null) {
|
||||
balance = betService.getCurBalance(memInfo);
|
||||
betData.put("tranId", tranId);
|
||||
betData.put("betId", betId);
|
||||
betData.put("tranType", "BONUS");
|
||||
betData.put("betAmt", 0);
|
||||
betData.put("betWinAmt", amount);
|
||||
betData.put("balance", (balance+amount));
|
||||
betData.put("updDate", transaction.getString("requestAt"));
|
||||
} else {
|
||||
log.error(LOG_PREFIX+ "NOT_FOUND_REF_DATA");
|
||||
String apiVendorCode = transaction.getString("vendorKey");
|
||||
String gameName = transaction.getString("gameKey");
|
||||
|
||||
HashMap memberVo = userService.getMemberMap(memInfo);
|
||||
if(memberVo == null) {
|
||||
log.error(LOG_PREFIX+ "NOT_FOUND_USER");
|
||||
response.setResult_code(1111);
|
||||
response.setError_msg("NOT_FOUND_USER");
|
||||
resEntity = new ResponseEntity<TripleResponse>(response, HttpStatus.OK);
|
||||
return resEntity;
|
||||
}
|
||||
|
||||
HashMap<String, String> vParam = new HashMap<>();
|
||||
vParam.put("siteId", memberVo.get("siteId").toString());
|
||||
vParam.put("apiCompCode", "triple");
|
||||
vParam.put("apiVendorCode", apiVendorCode);
|
||||
vParam.put("memLevel", memberVo.get("memLevel").toString());
|
||||
HashMap<String, String> siteVendorInfo = betService.getSiteVendorInfo(vParam);
|
||||
if(siteVendorInfo == null) {
|
||||
log.error(LOG_PREFIX+ "NOT_FOUND_VENDOR");
|
||||
response.setResult_code(70);
|
||||
response.setError_msg("NOT_FOUND_VENDOR");
|
||||
resEntity = new ResponseEntity<TripleResponse>(response, HttpStatus.OK);
|
||||
return resEntity;
|
||||
}
|
||||
|
||||
balance = Integer.parseInt(memberVo.get("cashAmt").toString());
|
||||
|
||||
betData = new HashMap<>();
|
||||
betData.put("tranId", tranId+"#"+transaction.getString("type"));
|
||||
betData.put("betId", tranId+"#"+transaction.getString("type"));
|
||||
betData.put("siteId", memberVo.get("siteId").toString());
|
||||
betData.put("memId", memberVo.get("memId").toString());
|
||||
betData.put("apiCompCode", "triple");
|
||||
betData.put("apiVendor", transaction.getString("vendor"));
|
||||
betData.put("gameCategory", siteVendorInfo.get("gameCategory").toString());
|
||||
betData.put("vendorCode", siteVendorInfo.get("vendorCode").toString());
|
||||
betData.put("gameName", gameName);
|
||||
betData.put("tranType", "BONUS");
|
||||
betData.put("betAmt", 0);
|
||||
betData.put("betWinAmt", amount);
|
||||
betData.put("balance", (balance+amount));
|
||||
betData.put("isBlankSpinYn", "N");
|
||||
betData.put("pointRegYn", "N");
|
||||
betData.put("regDate", transaction.getString("requestAt"));
|
||||
betData.put("updDate", transaction.getString("requestAt"));
|
||||
}
|
||||
|
||||
try {
|
||||
log.info(LOG_PREFIX+ "betData : "+betData.toString());
|
||||
betResult = betService.insertBetNew(betData);
|
||||
log.info(LOG_PREFIX+ "insertBet result : "+betResult);
|
||||
} catch(DataIntegrityViolationException de) {
|
||||
log.error(LOG_PREFIX+ "Duplicate tranId!!!");
|
||||
response.setResult_code(98);
|
||||
response.setBalance(balance);
|
||||
response.setError_msg("BONUS_ALREADY_SETTLED");
|
||||
resEntity = new ResponseEntity<TripleResponse>(response, HttpStatus.OK);
|
||||
return resEntity;
|
||||
}
|
||||
|
||||
if(betResult > 0) {
|
||||
int bonusResult = betService.bonusBetNew(betData);
|
||||
log.info(LOG_PREFIX+ "bonusBet result : "+bonusResult);
|
||||
|
||||
HashMap balanceParam = new HashMap();
|
||||
balanceParam.put("siteIdx", memInfo.getSiteIdx());
|
||||
balanceParam.put("memId", memInfo.getMemId());
|
||||
balanceParam.put("cashAmt", Integer.toString(amount));
|
||||
balanceParam.put("changeFlag", "N");
|
||||
long chs4 = System.currentTimeMillis();
|
||||
int memCashResult = betService.updateUserCashByAmountNew(balanceParam);
|
||||
long che4 = System.currentTimeMillis(); // 코드 실행 후에 시간 받아오기
|
||||
double diff4 = (chs4 - che4)/1000.0; //두 시간에 차 계산
|
||||
log.info(LOG_PREFIX+ "updateUserCashByAmountNew() : " + String.format("%.3f", diff4));
|
||||
if(diff4 < -1.0) log.error(LOG_PREFIX+ "updateUserCashByAmountNew() : " + String.format("%.3f", diff4));
|
||||
} else {
|
||||
log.error(LOG_PREFIX+ "BONUST_FAIL");
|
||||
response.setResult_code(9999);
|
||||
response.setError_msg("BONUST_FAIL");
|
||||
resEntity = new ResponseEntity<TripleResponse>(response, HttpStatus.INTERNAL_SERVER_ERROR);
|
||||
return resEntity;
|
||||
}
|
||||
|
||||
log.info(LOG_PREFIX+ "beforeBalance : "+balance);
|
||||
log.info(LOG_PREFIX+ "amount : "+amount);
|
||||
log.info(LOG_PREFIX+ "responseBalance : "+(balance+amount));
|
||||
|
||||
response.setResult_code(0);
|
||||
response.setBalance(balance+amount);
|
||||
response.setError_msg("");
|
||||
resEntity = new ResponseEntity<TripleResponse>(response, HttpStatus.OK);
|
||||
return resEntity;
|
||||
}
|
||||
|
||||
|
||||
private ResponseEntity<TripleResponse> callAdjust(String LOG_PREFIX, Member memInfo, JSONObject transaction) {
|
||||
LOG_PREFIX = LOG_PREFIX + "ADJUST:::";
|
||||
ResponseEntity<TripleResponse> resEntity = null;
|
||||
TripleResponse response = new TripleResponse();
|
||||
|
||||
String tranId = transaction.getString("tranId");
|
||||
String betId = transaction.getString("betId");
|
||||
|
||||
HashMap betData = betService.getReferenceData2(betId);
|
||||
if(betData == null) {
|
||||
log.error(LOG_PREFIX+ "NOT_FOUND_REF_DATA");
|
||||
response.setResult_code(99);
|
||||
response.setError_msg("NOT_FOUND_REF_DATA");
|
||||
resEntity = new ResponseEntity<TripleResponse>(response, HttpStatus.OK);
|
||||
return resEntity;
|
||||
}
|
||||
|
||||
int balance = betService.getCurBalance(memInfo);
|
||||
int debit = transaction.getInt("debit");
|
||||
debit = Math.abs(debit) * -1;
|
||||
int credit = transaction.getInt("credit");
|
||||
int amount = debit + credit;
|
||||
betData.put("tranId", tranId);
|
||||
betData.put("betId", betId);
|
||||
betData.put("tranType", "ADJUST");
|
||||
if(amount > 0) {
|
||||
betData.put("betAmt", 0);
|
||||
betData.put("betWinAmt", Math.abs(amount));
|
||||
} else {
|
||||
betData.put("betAmt", Math.abs(amount));
|
||||
betData.put("betWinAmt", 0);
|
||||
}
|
||||
betData.put("balance", (balance+amount));
|
||||
betData.put("updDate", transaction.getString("requestAt"));
|
||||
int betResult = 0;
|
||||
try {
|
||||
log.info(LOG_PREFIX+ "betData : "+betData.toString());
|
||||
betResult = betService.insertBetNew(betData);
|
||||
log.info(LOG_PREFIX+ "insertBet result : "+betResult);
|
||||
} catch(DataIntegrityViolationException de) {
|
||||
log.error(LOG_PREFIX+ "Duplicate tranId!!!");
|
||||
response.setResult_code(98);
|
||||
response.setBalance(balance);
|
||||
response.setError_msg("ADJUST_ALREADY_SETTLED");
|
||||
resEntity = new ResponseEntity<TripleResponse>(response, HttpStatus.OK);
|
||||
return resEntity;
|
||||
}
|
||||
|
||||
if(betResult > 0) {
|
||||
HashMap balanceParam = new HashMap();
|
||||
balanceParam.put("siteIdx", memInfo.getSiteIdx());
|
||||
balanceParam.put("memId", memInfo.getMemId());
|
||||
balanceParam.put("cashAmt", Integer.toString(amount));
|
||||
balanceParam.put("changeFlag", "N");
|
||||
long chs4 = System.currentTimeMillis();
|
||||
int memCashResult = betService.updateUserCashByAmountNew(balanceParam);
|
||||
long che4 = System.currentTimeMillis(); // 코드 실행 후에 시간 받아오기
|
||||
double diff4 = (chs4 - che4)/1000.0; //두 시간에 차 계산
|
||||
log.info(LOG_PREFIX+ "updateUserCashByAmountNew() : " + String.format("%.3f", diff4));
|
||||
if(diff4 < -1.0) log.error(LOG_PREFIX+ "updateUserCashByAmountNew() : " + String.format("%.3f", diff4));
|
||||
} else {
|
||||
log.error(LOG_PREFIX+ "ADJUST_FAIL");
|
||||
response.setResult_code(9999);
|
||||
response.setError_msg("ADJUST_FAIL");
|
||||
resEntity = new ResponseEntity<TripleResponse>(response, HttpStatus.INTERNAL_SERVER_ERROR);
|
||||
return resEntity;
|
||||
}
|
||||
|
||||
log.info(LOG_PREFIX+ "beforeBalance : "+balance);
|
||||
log.info(LOG_PREFIX+ "amount : "+amount);
|
||||
log.info(LOG_PREFIX+ "responseBalance : "+(balance+amount));
|
||||
|
||||
response.setResult_code(0);
|
||||
response.setBalance(balance+amount);
|
||||
response.setError_msg("");
|
||||
resEntity = new ResponseEntity<TripleResponse>(response, HttpStatus.OK);
|
||||
return resEntity;
|
||||
}
|
||||
|
||||
|
||||
private ResponseEntity<TripleResponse> callTip(String LOG_PREFIX, Member memInfo, JSONObject transaction) {
|
||||
LOG_PREFIX = LOG_PREFIX + "TIP:::";
|
||||
ResponseEntity<TripleResponse> resEntity = null;
|
||||
TripleResponse response = new TripleResponse();
|
||||
|
||||
return resEntity;
|
||||
}
|
||||
}
|
||||
127
src/main/java/com/bb/controller/CashCronController.java
Normal file
127
src/main/java/com/bb/controller/CashCronController.java
Normal file
@@ -0,0 +1,127 @@
|
||||
package com.bb.controller;
|
||||
|
||||
import java.net.InetAddress;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Controller;
|
||||
|
||||
import com.bb.model.CashQueVO;
|
||||
import com.bb.model.CronServerInfo;
|
||||
import com.bb.model.Member;
|
||||
import com.bb.model.TripleAuthInfo;
|
||||
import com.bb.service.CashService;
|
||||
import com.bb.service.CommonService;
|
||||
import com.bb.service.UserService;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@Slf4j
|
||||
@EnableScheduling
|
||||
@RequiredArgsConstructor
|
||||
@Controller
|
||||
public class CashCronController {
|
||||
|
||||
private final CashService cashService;
|
||||
|
||||
private final UserService userService;
|
||||
|
||||
private final CommonService commonService;
|
||||
|
||||
@Scheduled(fixedDelay = 2000) // 작업 종류 후 1초 마다
|
||||
public void cashProc() throws Exception {
|
||||
long startTime = System.currentTimeMillis();
|
||||
int queSize = 0;
|
||||
|
||||
try {
|
||||
CronServerInfo cronStatus = new CronServerInfo();
|
||||
cronStatus.setHostName(InetAddress.getLocalHost().getHostName());
|
||||
cronStatus.setIpAddress(InetAddress.getLocalHost().getHostAddress());
|
||||
cronStatus.setCronType("CASH");
|
||||
cronStatus = commonService.getServerCronStatus(cronStatus);
|
||||
log.debug("#-cashProc::" + "#[CRON STATUS] cronStatus: " + cronStatus);
|
||||
|
||||
if (cronStatus != null && cronStatus.getRunYn().equals("Y")) {
|
||||
List<CashQueVO> cashQueList = cashService.getCashQueList();
|
||||
queSize = cashQueList.size();
|
||||
if (queSize > 0) {
|
||||
log.info("#-cashProc::" + "cashQueList size: " + cashQueList.size());
|
||||
|
||||
for (CashQueVO item : cashQueList) {
|
||||
String LOG_PREFIX = "#-cashProc::" + item.getSiteId() + "::" + item.getCashIdx() + "::";
|
||||
|
||||
if (item.getRefCnt() == 0) {
|
||||
// log.info(LOG_PREFIX+ "not ready... RefCnt: " + item.getRefCnt());
|
||||
continue;
|
||||
}
|
||||
|
||||
long cashAmt = Long.parseLong(item.getCashAmt());
|
||||
long balance = cashService.getBalance(item);
|
||||
if ((balance + cashAmt) < 0) {
|
||||
// 보유금 마이너스 오류. 거래 실패처리
|
||||
HashMap<String, Object> wdParam = new HashMap<>();
|
||||
wdParam.put("cashIdx", item.getCashIdx());
|
||||
wdParam.put("refIdx", null);
|
||||
wdParam.put("cashStatus", "-1");
|
||||
wdParam.put("memo", "계정(" + item.getMemId() + ") 보유금(" + balance + ") 부족 처리실패");
|
||||
int wdResult = cashService.updateQueStatus(wdParam);
|
||||
log.info(LOG_PREFIX + item.getMemId() + " withdraw queue fail process result: " + wdResult);
|
||||
if (wdResult > 0) {
|
||||
HashMap<String, Object> dpParam = new HashMap<>();
|
||||
dpParam.put("cashIdx", null);
|
||||
dpParam.put("refIdx", item.getCashIdx());
|
||||
dpParam.put("cashStatus", "-1");
|
||||
dpParam.put("memo", "계정(" + item.getMemId() + ") 보유금(" + balance + ") 부족 처리실패");
|
||||
int dpResult = cashService.updateQueStatus(dpParam);
|
||||
log.info(LOG_PREFIX + item.getTargetId() + " deposit queue fail process result: "
|
||||
+ dpResult);
|
||||
}
|
||||
} else {
|
||||
// Triple API
|
||||
Member botUser = new Member();
|
||||
botUser.setSiteId(item.getSiteId());
|
||||
botUser.setMemId(item.getMemId());
|
||||
TripleAuthInfo tripleMember = userService.getTripleAuthInfo2(botUser);
|
||||
if (tripleMember != null && tripleMember.getPartnerLevel().equals("NORMAL")) {
|
||||
// asyncService.withdrawBalanceAsync2(LOG_PREFIX, tripleMember);
|
||||
}
|
||||
|
||||
// 거래 성공 처리
|
||||
HashMap<String, Object> wdParam = new HashMap<>();
|
||||
wdParam.put("cashIdx", item.getCashIdx());
|
||||
wdParam.put("refIdx", null);
|
||||
wdParam.put("cashStatus", "1");
|
||||
wdParam.put("memo", "");
|
||||
int wdResult = cashService.updateQueStatus(wdParam);
|
||||
log.info(LOG_PREFIX + item.getMemId() + " withdraw queue success process result: "
|
||||
+ wdResult);
|
||||
if (wdResult > 0) {
|
||||
HashMap<String, Object> dpParam = new HashMap<>();
|
||||
dpParam.put("cashIdx", null);
|
||||
dpParam.put("refIdx", item.getCashIdx());
|
||||
dpParam.put("cashStatus", "1");
|
||||
dpParam.put("memo", "");
|
||||
int dpResult = cashService.updateQueStatus(dpParam);
|
||||
log.info(LOG_PREFIX + item.getTargetId() + " deposit queue success process result: "
|
||||
+ dpResult);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
log.error("#-cashProc::" + "Exception::" + e.toString());
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
long endTime = System.currentTimeMillis(); // 코드 실행 후에 시간 받아오기
|
||||
double secDiffTime = (startTime - endTime) / 1000.0; // 두 시간에 차 계산
|
||||
if (queSize > 0)
|
||||
log.error("#-cashProc::" + "Proc Time(s) > 1s : " + String.format("%.3f", secDiffTime));
|
||||
}
|
||||
}
|
||||
331
src/main/java/com/bb/controller/PointCronController.java
Normal file
331
src/main/java/com/bb/controller/PointCronController.java
Normal file
@@ -0,0 +1,331 @@
|
||||
package com.bb.controller;
|
||||
|
||||
import java.net.InetAddress;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Controller;
|
||||
|
||||
import com.bb.model.CronServerInfo;
|
||||
import com.bb.service.BetService;
|
||||
import com.bb.service.CashService;
|
||||
import com.bb.service.CommonService;
|
||||
import com.bb.service.UserService;
|
||||
import com.bb.util.RandomRolling;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@Slf4j
|
||||
@RequiredArgsConstructor
|
||||
@EnableScheduling
|
||||
@Controller
|
||||
public class PointCronController {
|
||||
|
||||
private final BetService betService;
|
||||
|
||||
private final CashService cashService;
|
||||
|
||||
private final CommonService commonService;
|
||||
|
||||
|
||||
// 'jjanggu01', 'ichiban01', 'viva01', 'mvp001', 'black01' 제외 사이트
|
||||
//@Scheduled(fixedDelay = 10000) // 작업 종류 후 10초 마다
|
||||
public void pointProc() throws Exception {
|
||||
long startTime = System.currentTimeMillis();
|
||||
try {
|
||||
CronServerInfo cronStatus = new CronServerInfo();
|
||||
cronStatus.setHostName(InetAddress.getLocalHost().getHostName());
|
||||
cronStatus.setIpAddress(InetAddress.getLocalHost().getHostAddress());
|
||||
cronStatus.setCronType("POINT");
|
||||
log.debug("##- [OMS CRON STATUS] HostName: " + cronStatus.getHostName() + ", HostAddress: " + cronStatus.getIpAddress());
|
||||
cronStatus = commonService.getServerCronStatus(cronStatus);
|
||||
log.debug("##- [OMS CRON STATUS] cronStatus: " + cronStatus);
|
||||
|
||||
if(cronStatus != null && cronStatus.getRunYn().equals("Y")) {
|
||||
log.debug("### Triple API pointProc() Start -###");
|
||||
List<HashMap> biBetList = betService.getBetPointList();
|
||||
log.debug("### Triple API pointProc() biBetList.size() : " + biBetList.size());
|
||||
for(HashMap betItem : biBetList) {
|
||||
|
||||
log.debug("### Triple API betItem : " + betItem.toString());
|
||||
long betIdx = (long) betItem.get("betIdx");
|
||||
String betId = betItem.get("betId").toString();
|
||||
int betRate = Integer.parseInt(betItem.get("betRate").toString());
|
||||
String gameCategory = betItem.get("gameCategory").toString();
|
||||
String vendorCode = betItem.get("vendorCode").toString();
|
||||
|
||||
long betAmt = Long.parseLong(betItem.get("betAmt").toString());
|
||||
long betWinAmt = Long.parseLong(betItem.get("betWinAmt").toString());
|
||||
int bsCasinoRate = Integer.parseInt(betItem.get("blankSpinCasinoRate").toString());
|
||||
int bsSlotRate = Integer.parseInt(betItem.get("blankSpinSlotRate").toString());
|
||||
|
||||
String siteId = betItem.get("siteId").toString();
|
||||
String memId = betItem.get("memId").toString();
|
||||
String blankSpinSetType = betItem.get("blankSpinSetType").toString();
|
||||
int betCnt = 0;
|
||||
long sumWinAmt = 0;
|
||||
HashMap<String, String> totalInfo = betService.getBetTodayTotalInfo(betItem);
|
||||
if(totalInfo != null) {
|
||||
betCnt = Integer.parseInt(totalInfo.get("betCnt").toString());
|
||||
sumWinAmt = Long.parseLong(totalInfo.get("sumWinAmt").toString());
|
||||
}
|
||||
|
||||
int rate = 0;
|
||||
if( blankSpinSetType.equals("B") && ( betCnt < 20 || betAmt >= sumWinAmt ) ) {
|
||||
rate = 0;
|
||||
} else {
|
||||
if(gameCategory.equals("casino")) {
|
||||
//if(gameCategory.equals("casino") && (betAmt > betWinAmt)) { // 24.07.12 jinu 요청 수정
|
||||
rate = bsCasinoRate;
|
||||
//} else if(gameCategory.equals("slot") && (betAmt >= betWinAmt)) { // 24.08.27 CS팀 요청(Green)
|
||||
} else if(gameCategory.equals("slot")) { // 24.10.16 jinu 요청 수정
|
||||
rate = bsSlotRate;
|
||||
} else if(gameCategory.equals("undefind")) {
|
||||
rate = 100;
|
||||
} else {
|
||||
rate = 0;
|
||||
}
|
||||
}
|
||||
|
||||
// isBlankSpin = true (롤링공회전), isBlankSpin = false (롤링진행)
|
||||
boolean isBlankSpin = RandomRolling.isBlankSpin(rate);
|
||||
|
||||
HashMap mapParam = new HashMap();
|
||||
mapParam.put("betIdx", betIdx);
|
||||
mapParam.put("betRate", betRate);
|
||||
mapParam.put("gameCategory", gameCategory);
|
||||
mapParam.put("vendorCode", vendorCode);
|
||||
if(isBlankSpin) {
|
||||
mapParam.put("isBlankSpinYn", "Y");
|
||||
} else {
|
||||
mapParam.put("isBlankSpinYn", "N");
|
||||
}
|
||||
|
||||
String LOG_PREFIX = "#-pointProc::"+siteId+"::"+memId+"::betIdx::"+betIdx+"::::";
|
||||
try {
|
||||
log.debug(LOG_PREFIX+ "cashService.insertBetPoint(mapParam) start");
|
||||
int pointResult = cashService.insertBetPoint(LOG_PREFIX, mapParam);
|
||||
log.debug(LOG_PREFIX+ "cashService.insertBetPoint(mapParam) end: " + pointResult);
|
||||
} catch(Exception e) {
|
||||
log.error(LOG_PREFIX+ "POINT_ERROR::"+e.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch(Exception e) {
|
||||
log.error(e.toString());
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
long endTime = System.currentTimeMillis(); // 코드 실행 후에 시간 받아오기
|
||||
double secDiffTime = (startTime - endTime)/1000.0; //두 시간에 차 계산
|
||||
log.error("pointProc() Proc Time(s) > 1s : " + String.format("%.3f", secDiffTime));
|
||||
}
|
||||
|
||||
private void pointProcSite(final String SITE_ID) throws Exception {
|
||||
log.debug("### Triple API pointProc("+SITE_ID+") Start -###");
|
||||
List<HashMap> biBetList = betService.getBetPointListBySite(SITE_ID);
|
||||
log.debug("### Triple API pointProc("+SITE_ID+") biBetList.size() : " + biBetList.size());
|
||||
for(HashMap betItem : biBetList) {
|
||||
|
||||
log.debug("### Triple API pointProc("+SITE_ID+") betItem : " + betItem.toString());
|
||||
long betIdx = (long) betItem.get("betIdx");
|
||||
String betId = betItem.get("betId").toString();
|
||||
int betRate = Integer.parseInt(betItem.get("betRate").toString());
|
||||
String gameCategory = betItem.get("gameCategory").toString();
|
||||
String vendorCode = betItem.get("vendorCode").toString();
|
||||
|
||||
long betAmt = Long.parseLong(betItem.get("betAmt").toString());
|
||||
long betWinAmt = Long.parseLong(betItem.get("betWinAmt").toString());
|
||||
int bsCasinoRate = Integer.parseInt(betItem.get("blankSpinCasinoRate").toString());
|
||||
int bsSlotRate = Integer.parseInt(betItem.get("blankSpinSlotRate").toString());
|
||||
|
||||
String siteId = betItem.get("siteId").toString();
|
||||
String memId = betItem.get("memId").toString();
|
||||
String blankSpinSetType = betItem.get("blankSpinSetType").toString();
|
||||
int betCnt = 0;
|
||||
long sumWinAmt = 0;
|
||||
HashMap<String, String> totalInfo = betService.getBetTodayTotalInfo(betItem);
|
||||
if(totalInfo != null) {
|
||||
betCnt = Integer.parseInt(totalInfo.get("betCnt").toString());
|
||||
sumWinAmt = Long.parseLong(totalInfo.get("sumWinAmt").toString());
|
||||
}
|
||||
|
||||
int rate = 0;
|
||||
if( blankSpinSetType.equals("B") && ( betCnt < 20 || betAmt >= sumWinAmt ) ) {
|
||||
rate = 0;
|
||||
} else {
|
||||
if(gameCategory.equals("casino")) {
|
||||
//if(gameCategory.equals("casino") && (betAmt > betWinAmt)) { // 24.07.12 jinu 요청 수정
|
||||
rate = bsCasinoRate;
|
||||
//} else if(gameCategory.equals("slot") && (betAmt >= betWinAmt)) { // 24.08.27 CS팀 요청(Green)
|
||||
} else if(gameCategory.equals("slot")) { // 24.10.16 jinu 요청 수정
|
||||
rate = bsSlotRate;
|
||||
} else if(gameCategory.equals("undefind")) {
|
||||
rate = 100;
|
||||
} else {
|
||||
rate = 0;
|
||||
}
|
||||
}
|
||||
|
||||
// isBlankSpin = true (롤링공회전), isBlankSpin = false (롤링진행)
|
||||
boolean isBlankSpin = RandomRolling.isBlankSpin(rate);
|
||||
|
||||
HashMap mapParam = new HashMap();
|
||||
mapParam.put("betIdx", betIdx);
|
||||
mapParam.put("betRate", betRate);
|
||||
mapParam.put("gameCategory", gameCategory);
|
||||
mapParam.put("vendorCode", vendorCode);
|
||||
if(isBlankSpin) {
|
||||
mapParam.put("isBlankSpinYn", "Y");
|
||||
} else {
|
||||
mapParam.put("isBlankSpinYn", "N");
|
||||
}
|
||||
|
||||
String LOG_PREFIX = "#-pointProc::"+siteId+"::"+memId+"::betIdx::"+betIdx+"::::";
|
||||
try {
|
||||
log.debug(LOG_PREFIX+ "cashService.insertBetPoint(mapParam) start");
|
||||
int pointResult = cashService.insertBetPoint(LOG_PREFIX, mapParam);
|
||||
log.debug(LOG_PREFIX+ "cashService.insertBetPoint(mapParam) end: " + pointResult);
|
||||
} catch(Exception e) {
|
||||
log.error(LOG_PREFIX+ "POINT_ERROR::"+e.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 'jjanggu01', 'ichiban01', 'viva01', 'mvp001', 'black01'
|
||||
//@Scheduled(fixedDelay = 10000) // 작업 종류 후 10초 마다
|
||||
public void pointProc_jjanggu01() throws Exception {
|
||||
long startTime = System.currentTimeMillis();
|
||||
final String SITE_ID = "jjanggu01";
|
||||
try {
|
||||
CronServerInfo cronStatus = new CronServerInfo();
|
||||
cronStatus.setHostName(InetAddress.getLocalHost().getHostName());
|
||||
cronStatus.setIpAddress(InetAddress.getLocalHost().getHostAddress());
|
||||
cronStatus.setCronType("POINT");
|
||||
log.debug("##- [OMS CRON STATUS] HostName: " + cronStatus.getHostName() + ", HostAddress: " + cronStatus.getIpAddress());
|
||||
cronStatus = commonService.getServerCronStatus(cronStatus);
|
||||
log.debug("##- [OMS CRON STATUS] cronStatus: " + cronStatus);
|
||||
|
||||
if(cronStatus != null && cronStatus.getRunYn().equals("Y")) {
|
||||
pointProcSite(SITE_ID);
|
||||
}
|
||||
} catch(Exception e) {
|
||||
log.error(e.toString());
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
long endTime = System.currentTimeMillis(); // 코드 실행 후에 시간 받아오기
|
||||
double secDiffTime = (startTime - endTime)/1000.0; //두 시간에 차 계산
|
||||
log.error("pointProc("+SITE_ID+") Proc Time(s) > 1s : " + String.format("%.3f", secDiffTime));
|
||||
}
|
||||
|
||||
//@Scheduled(fixedDelay = 10000) // 작업 종류 후 10초 마다
|
||||
public void pointProc_ichiban01() throws Exception {
|
||||
long startTime = System.currentTimeMillis();
|
||||
final String SITE_ID = "ichiban01";
|
||||
try {
|
||||
CronServerInfo cronStatus = new CronServerInfo();
|
||||
cronStatus.setHostName(InetAddress.getLocalHost().getHostName());
|
||||
cronStatus.setIpAddress(InetAddress.getLocalHost().getHostAddress());
|
||||
cronStatus.setCronType("POINT");
|
||||
log.debug("##- [OMS CRON STATUS] HostName: " + cronStatus.getHostName() + ", HostAddress: " + cronStatus.getIpAddress());
|
||||
cronStatus = commonService.getServerCronStatus(cronStatus);
|
||||
log.debug("##- [OMS CRON STATUS] cronStatus: " + cronStatus);
|
||||
|
||||
if(cronStatus != null && cronStatus.getRunYn().equals("Y")) {
|
||||
pointProcSite(SITE_ID);
|
||||
}
|
||||
} catch(Exception e) {
|
||||
log.error(e.toString());
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
long endTime = System.currentTimeMillis(); // 코드 실행 후에 시간 받아오기
|
||||
double secDiffTime = (startTime - endTime)/1000.0; //두 시간에 차 계산
|
||||
log.error("pointProc("+SITE_ID+") Proc Time(s) > 1s : " + String.format("%.3f", secDiffTime));
|
||||
}
|
||||
|
||||
//@Scheduled(fixedDelay = 10000) // 작업 종류 후 10초 마다
|
||||
public void pointProc_viva01() throws Exception {
|
||||
long startTime = System.currentTimeMillis();
|
||||
final String SITE_ID = "viva01";
|
||||
try {
|
||||
CronServerInfo cronStatus = new CronServerInfo();
|
||||
cronStatus.setHostName(InetAddress.getLocalHost().getHostName());
|
||||
cronStatus.setIpAddress(InetAddress.getLocalHost().getHostAddress());
|
||||
cronStatus.setCronType("POINT");
|
||||
log.debug("##- [OMS CRON STATUS] HostName: " + cronStatus.getHostName() + ", HostAddress: " + cronStatus.getIpAddress());
|
||||
cronStatus = commonService.getServerCronStatus(cronStatus);
|
||||
log.debug("##- [OMS CRON STATUS] cronStatus: " + cronStatus);
|
||||
|
||||
if(cronStatus != null && cronStatus.getRunYn().equals("Y")) {
|
||||
pointProcSite(SITE_ID);
|
||||
}
|
||||
} catch(Exception e) {
|
||||
log.error(e.toString());
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
long endTime = System.currentTimeMillis(); // 코드 실행 후에 시간 받아오기
|
||||
double secDiffTime = (startTime - endTime)/1000.0; //두 시간에 차 계산
|
||||
log.error("pointProc("+SITE_ID+") Proc Time(s) > 1s : " + String.format("%.3f", secDiffTime));
|
||||
}
|
||||
|
||||
//@Scheduled(fixedDelay = 10000) // 작업 종류 후 10초 마다
|
||||
public void pointProc_black01() throws Exception {
|
||||
long startTime = System.currentTimeMillis();
|
||||
final String SITE_ID = "black01";
|
||||
try {
|
||||
CronServerInfo cronStatus = new CronServerInfo();
|
||||
cronStatus.setHostName(InetAddress.getLocalHost().getHostName());
|
||||
cronStatus.setIpAddress(InetAddress.getLocalHost().getHostAddress());
|
||||
cronStatus.setCronType("POINT");
|
||||
log.debug("##- [OMS CRON STATUS] HostName: " + cronStatus.getHostName() + ", HostAddress: " + cronStatus.getIpAddress());
|
||||
cronStatus = commonService.getServerCronStatus(cronStatus);
|
||||
log.debug("##- [OMS CRON STATUS] cronStatus: " + cronStatus);
|
||||
|
||||
if(cronStatus != null && cronStatus.getRunYn().equals("Y")) {
|
||||
pointProcSite(SITE_ID);
|
||||
}
|
||||
} catch(Exception e) {
|
||||
log.error(e.toString());
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
long endTime = System.currentTimeMillis(); // 코드 실행 후에 시간 받아오기
|
||||
double secDiffTime = (startTime - endTime)/1000.0; //두 시간에 차 계산
|
||||
log.error("pointProc("+SITE_ID+") Proc Time(s) > 1s : " + String.format("%.3f", secDiffTime));
|
||||
}
|
||||
|
||||
//@Scheduled(fixedDelay = 10000) // 작업 종류 후 10초 마다
|
||||
public void pointProc_mvp001() throws Exception {
|
||||
long startTime = System.currentTimeMillis();
|
||||
final String SITE_ID = "mvp001";
|
||||
try {
|
||||
CronServerInfo cronStatus = new CronServerInfo();
|
||||
cronStatus.setHostName(InetAddress.getLocalHost().getHostName());
|
||||
cronStatus.setIpAddress(InetAddress.getLocalHost().getHostAddress());
|
||||
cronStatus.setCronType("POINT");
|
||||
log.debug("##- [OMS CRON STATUS] HostName: " + cronStatus.getHostName() + ", HostAddress: " + cronStatus.getIpAddress());
|
||||
cronStatus = commonService.getServerCronStatus(cronStatus);
|
||||
log.debug("##- [OMS CRON STATUS] cronStatus: " + cronStatus);
|
||||
|
||||
if(cronStatus != null && cronStatus.getRunYn().equals("Y")) {
|
||||
pointProcSite(SITE_ID);
|
||||
}
|
||||
} catch(Exception e) {
|
||||
log.error(e.toString());
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
long endTime = System.currentTimeMillis(); // 코드 실행 후에 시간 받아오기
|
||||
double secDiffTime = (startTime - endTime)/1000.0; //두 시간에 차 계산
|
||||
log.error("pointProc("+SITE_ID+") Proc Time(s) > 1s : " + String.format("%.3f", secDiffTime));
|
||||
}
|
||||
|
||||
}
|
||||
176
src/main/java/com/bb/controller/SocketController.java
Normal file
176
src/main/java/com/bb/controller/SocketController.java
Normal file
@@ -0,0 +1,176 @@
|
||||
package com.bb.controller;
|
||||
|
||||
import java.net.InetAddress;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.messaging.simp.SimpMessagingTemplate;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Controller;
|
||||
|
||||
import com.bb.model.CronServerInfo;
|
||||
import com.bb.model.OutChatMessageVO;
|
||||
import com.bb.model.SiteCheckReq;
|
||||
import com.bb.service.CommonService;
|
||||
import com.bb.service.UserService;
|
||||
import com.bb.util.AESUtil;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
|
||||
@Slf4j
|
||||
@EnableScheduling
|
||||
@RequiredArgsConstructor
|
||||
@Controller
|
||||
public class SocketController {
|
||||
|
||||
private final SimpMessagingTemplate simpMessagingTemplate;
|
||||
|
||||
private final CommonService commonService;
|
||||
|
||||
private final UserService userService;
|
||||
|
||||
@Scheduled(fixedDelay = 8000L)
|
||||
public void sendPong() throws Exception {
|
||||
String nowtime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date(System.currentTimeMillis()));
|
||||
|
||||
OutChatMessageVO outMs = new OutChatMessageVO();
|
||||
AESUtil aesUtil = new AESUtil();
|
||||
String json = "";
|
||||
String encryptMsg = "";
|
||||
|
||||
try {
|
||||
CronServerInfo cronStatus = new CronServerInfo();
|
||||
cronStatus.setHostName(InetAddress.getLocalHost().getHostName());
|
||||
cronStatus.setIpAddress(InetAddress.getLocalHost().getHostAddress());
|
||||
cronStatus.setCronType("SOCKET");
|
||||
log.debug("##- [OMS CRON STATUS] HostName: " + cronStatus.getHostName() + ", HostAddress: " + cronStatus.getIpAddress());
|
||||
cronStatus = commonService.getServerCronStatus(cronStatus);
|
||||
log.debug("##- [OMS CRON STATUS] cronStatus: " + cronStatus);
|
||||
|
||||
if(cronStatus != null && cronStatus.getRunYn().equals("Y")) {
|
||||
HashMap superHeadCashInfo = userService.getSuperHeadCashInfo();
|
||||
|
||||
ObjectMapper oms = new ObjectMapper();
|
||||
// Map or List Object 를 JSON 문자열로 변환
|
||||
String superHeadCashInfoStr = oms.writeValueAsString(superHeadCashInfo);
|
||||
outMs.setContent(superHeadCashInfoStr);
|
||||
json = oms.writeValueAsString(outMs);
|
||||
encryptMsg = aesUtil.encrypt(json);
|
||||
|
||||
// this.simpMessagingTemplate.convertAndSend("/topic/super", outMs);
|
||||
this.simpMessagingTemplate.convertAndSend("/topic/super", encryptMsg);
|
||||
|
||||
List<HashMap> tokenList = commonService.getlastLoginToken();
|
||||
if(tokenList != null) {
|
||||
for(HashMap ti:tokenList) {
|
||||
if("admin".equals(ti.get("mt"))) {
|
||||
HashMap param = new HashMap();
|
||||
param.put("siteId", ti.get("siteId"));
|
||||
HashMap headCashInfo = userService.getHeadCashInfo(param);
|
||||
//log.info("###- SocketController.sendPong() headCashInfo: " + headCashInfo);
|
||||
|
||||
ObjectMapper om2 = new ObjectMapper();
|
||||
// Map or List Object 를 JSON 문자열로 변환
|
||||
String headCashInfoStr = om2.writeValueAsString(headCashInfo);
|
||||
|
||||
outMs.setContent(headCashInfoStr);
|
||||
json = om2.writeValueAsString(outMs);
|
||||
encryptMsg = aesUtil.encrypt(json);
|
||||
// this.simpMessagingTemplate.convertAndSend("/topic/adminfo/"+ti.get("lastToken").toString(), outMs);
|
||||
this.simpMessagingTemplate.convertAndSend("/topic/adminfo/"+ti.get("lastToken").toString(), encryptMsg);
|
||||
}
|
||||
|
||||
if("mem".equals(ti.get("mt"))) {
|
||||
List<HashMap> memInfo = userService.getMemInfo(ti);
|
||||
//log.info("###- SocketController.sendPong() memInfo: " + memInfo);
|
||||
|
||||
ObjectMapper om2 = new ObjectMapper();
|
||||
// Map or List Object 를 JSON 문자열로 변환
|
||||
String memInfoStr = om2.writeValueAsString(memInfo);
|
||||
|
||||
outMs.setContent(memInfoStr);
|
||||
json = om2.writeValueAsString(outMs);
|
||||
encryptMsg = aesUtil.encrypt(json);
|
||||
// this.simpMessagingTemplate.convertAndSend("/topic/"+ti.get("lastToken").toString(), outMs);
|
||||
this.simpMessagingTemplate.convertAndSend("/topic/"+ti.get("lastToken").toString(), encryptMsg);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch(Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// @Scheduled(fixedDelay = 2000L)
|
||||
public void sendMiniGame() throws Exception {
|
||||
String nowtime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date(System.currentTimeMillis()));
|
||||
|
||||
OutChatMessageVO outMs = new OutChatMessageVO();
|
||||
|
||||
List<HashMap> siteList = commonService.getLoginSite();
|
||||
|
||||
if(siteList != null) {
|
||||
for(HashMap ti:siteList) {
|
||||
// Map or List Object 를 JSON 문자열로 변환
|
||||
List<HashMap> miniGameInfo = userService.miniGameInfo(ti);
|
||||
|
||||
ObjectMapper om2 = new ObjectMapper();
|
||||
// Map or List Object 를 JSON 문자열로 변환
|
||||
String miniGameInfoStr = om2.writeValueAsString(miniGameInfo);
|
||||
//System.out.println("miniGameInfoStr" + miniGameInfoStr);
|
||||
outMs.setContent(miniGameInfoStr);
|
||||
|
||||
this.simpMessagingTemplate.convertAndSend("/topic/powerball/"+ti.get("siteId").toString(), outMs);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Scheduled(fixedDelay = 10000L)
|
||||
public void isSiteCheck() throws Exception {
|
||||
try {
|
||||
CronServerInfo cronStatus = new CronServerInfo();
|
||||
cronStatus.setHostName(InetAddress.getLocalHost().getHostName());
|
||||
cronStatus.setIpAddress(InetAddress.getLocalHost().getHostAddress());
|
||||
cronStatus.setCronType("CHECK");
|
||||
log.debug("##- [OMS CRON STATUS] HostName: " + cronStatus.getHostName() + ", HostAddress: " + cronStatus.getIpAddress());
|
||||
cronStatus = commonService.getServerCronStatus(cronStatus);
|
||||
log.debug("##- [OMS CRON STATUS] cronStatus: " + cronStatus);
|
||||
|
||||
if(cronStatus != null && cronStatus.getRunYn().equals("Y")) {
|
||||
List<HashMap> siteCheckList = commonService.isSiteCheck();
|
||||
|
||||
for(HashMap item : siteCheckList) {
|
||||
int siteCheckIdx = (int) item.get("siteCheckIdx");
|
||||
SiteCheckReq param = new SiteCheckReq();
|
||||
param.setSiteCheckIdx(siteCheckIdx);
|
||||
param.setSiteId((String) item.get("siteId"));
|
||||
if(item.get("checkStatus").equals("ON")) {
|
||||
// site_setting 테이블 siteCheckYn => 'Y'
|
||||
param.setSiteCheckYn("Y");
|
||||
log.info("#-isSiteCheck::ON::" + param.getSiteId()+"::"+param.getSiteCheckIdx()+"::"+param.getStartDate()+"-"+param.getEndDate());
|
||||
commonService.changeSiteSettingCheckYn(param);
|
||||
} else {
|
||||
// site_check_info 테이블 isCheckOff => 'Y'
|
||||
// site_setting 테이블 siteCheckYn => 'N'
|
||||
param.setIsCheckOff("Y");
|
||||
param.setSiteCheckYn("N");
|
||||
log.info("#-isSiteCheck::OFF::" + param.getSiteId()+"::"+param.getSiteCheckIdx()+"::"+param.getStartDate()+"-"+param.getEndDate());
|
||||
commonService.changeSiteCheckOff(param);
|
||||
commonService.changeSiteSettingCheckYn(param);
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch(Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
686
src/main/java/com/bb/controller/TripleController.java
Normal file
686
src/main/java/com/bb/controller/TripleController.java
Normal file
@@ -0,0 +1,686 @@
|
||||
package com.bb.controller;
|
||||
|
||||
import java.net.InetAddress;
|
||||
import java.text.DecimalFormat;
|
||||
import java.text.NumberFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.bb.model.CronServerInfo;
|
||||
import com.bb.model.Member;
|
||||
import com.bb.model.MemberDetail;
|
||||
import com.bb.model.TripleAuthInfo;
|
||||
import com.bb.model.TripleDVO;
|
||||
import com.bb.model.TripleGameRate;
|
||||
import com.bb.model.TriplePurchaseId;
|
||||
import com.bb.model.TripleVO;
|
||||
import com.bb.service.BetService;
|
||||
import com.bb.service.CommonService;
|
||||
import com.bb.service.CompService;
|
||||
import com.bb.service.SportDService;
|
||||
import com.bb.service.SportService;
|
||||
import com.bb.service.TripleService;
|
||||
import com.bb.service.UserService;
|
||||
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.sf.json.JSONObject;
|
||||
|
||||
@Slf4j
|
||||
@EnableScheduling
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping(value = "/triple")
|
||||
public class TripleController {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
private static NumberFormat formatter = new DecimalFormat("#0.00");
|
||||
|
||||
private final UserService userService;
|
||||
|
||||
private final BetService betService;
|
||||
|
||||
private final TripleService tripleService;
|
||||
|
||||
private final SportService sportService;
|
||||
|
||||
private final SportDService sportDService;
|
||||
|
||||
private final CommonService commonService;
|
||||
|
||||
private final CompService compService;
|
||||
|
||||
|
||||
@PostMapping("/balance/sports")
|
||||
public ResponseEntity<net.sf.json.JSONObject> balance(@RequestBody TripleVO tripleVO, HttpServletRequest request) throws Exception {
|
||||
long startTime = System.currentTimeMillis();
|
||||
|
||||
net.sf.json.JSONObject responseObj = new net.sf.json.JSONObject();
|
||||
HttpStatus httpStatus = null;
|
||||
final String LOG_PREFIX = "#-CB::balance::"+tripleVO.getUserId()+"::"+tripleVO.getRequestAt()+":::";
|
||||
|
||||
log.info(LOG_PREFIX+ "TripleVO : " + tripleVO);
|
||||
|
||||
try {
|
||||
long balance = 0;
|
||||
Member search = new Member();
|
||||
search.setSiteIdx(Integer.parseInt(tripleVO.getUserId().substring(0, 3), 16));
|
||||
search.setMemId(tripleVO.getUserId().substring(3, tripleVO.getUserId().length()));
|
||||
|
||||
// synchronized method getMemByTriple()
|
||||
MemberDetail memberVo = userService.getMemByTriple(search);
|
||||
long endTime1 = System.currentTimeMillis(); // 코드 실행 후에 시간 받아오기
|
||||
double diffTime1 = (startTime - endTime1)/1000.0; //두 시간에 차 계산
|
||||
log.error(LOG_PREFIX+ "[### userService.getMemByTriple() : " + String.format("%.3f", diffTime1) + " ###]");
|
||||
|
||||
if(memberVo != null && !"".equals(memberVo.getUsername())) {
|
||||
balance = memberVo.getCashAmt();
|
||||
responseObj.put("result_code", 0);
|
||||
responseObj.put("balance", balance);
|
||||
httpStatus = HttpStatus.OK;
|
||||
} else {
|
||||
if(memberVo != null && "".equals(memberVo.getUsername())) {
|
||||
TripleAuthInfo user = new TripleAuthInfo();
|
||||
user.setSiteId(search.getSiteId());
|
||||
user.setMemId(search.getMemId());
|
||||
user.setId(0);
|
||||
user.setUsername(tripleVO.getUserId());
|
||||
user.setNickname(tripleVO.getUserId());
|
||||
log.info(LOG_PREFIX+ "### Triple API ### - call \"/balance\" TripleAuthInfo: " + user);
|
||||
int result = userService.insertTripleAuthInfo(user);
|
||||
|
||||
if(result > 0) {
|
||||
balance = memberVo.getCashAmt();
|
||||
responseObj.put("result_code", 0);
|
||||
responseObj.put("balance", balance);
|
||||
httpStatus = HttpStatus.OK;
|
||||
} else {
|
||||
responseObj.put("result_code", 1999);
|
||||
responseObj.put("errors","INSERT_USER_ERROR");
|
||||
httpStatus = HttpStatus.OK;
|
||||
}
|
||||
} else {
|
||||
responseObj.put("result_code", 9999);
|
||||
responseObj.put("errors","INVALID_USER");
|
||||
httpStatus = HttpStatus.OK;
|
||||
}
|
||||
}
|
||||
|
||||
} catch(Exception e) {
|
||||
responseObj.put("result_code", 1111);
|
||||
responseObj.put("errors","UNKNOWN_ERROR");
|
||||
httpStatus = HttpStatus.INTERNAL_SERVER_ERROR;
|
||||
log.error(LOG_PREFIX+ e.getMessage());
|
||||
}
|
||||
log.info(LOG_PREFIX+ "### Triple API Controller ### - call \"/balance\" response : " + responseObj);
|
||||
|
||||
long endTime = System.currentTimeMillis(); // 코드 실행 후에 시간 받아오기
|
||||
double diffTime = (startTime - endTime)/1000.0; //두 시간에 차 계산
|
||||
if(diffTime < -2.0) {
|
||||
log.error(LOG_PREFIX+ "[### balance diffTime : " + String.format("%.3f", diffTime) + " ###]");
|
||||
}
|
||||
|
||||
return new ResponseEntity<net.sf.json.JSONObject>(responseObj, httpStatus);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/changebalance/sports")
|
||||
public ResponseEntity<net.sf.json.JSONObject> changeBalance(HttpServletRequest request, @RequestBody TripleVO tripleVO) {
|
||||
long startTime = System.currentTimeMillis();
|
||||
|
||||
net.sf.json.JSONObject responseObj = new net.sf.json.JSONObject();
|
||||
HttpStatus httpStatus = null;
|
||||
|
||||
final String LOG_PREFIX = "#-callback::"+tripleVO.getUserId()+"::"+tripleVO.getBetId()+"::"+tripleVO.getTranType()+"::::";
|
||||
|
||||
try {
|
||||
|
||||
|
||||
if(tripleVO.getTranType().equals("debit") && tripleVO.getIsCancel() == 0) {
|
||||
if(tripleVO.getRequestAt() != null && !tripleVO.getRequestAt().equals("")) {
|
||||
|
||||
SimpleDateFormat sdf = null;
|
||||
if(tripleVO.getRequestAt().length() >= 20) {
|
||||
// 2025-02-20 18:37:21.000
|
||||
sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
|
||||
} else {
|
||||
// 2025-02-20 18:37:21
|
||||
sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
}
|
||||
|
||||
String requestAtStr = tripleVO.getRequestAt();
|
||||
//long nDate = System.currentTimeMillis() - 32400000;
|
||||
long nDate = System.currentTimeMillis();
|
||||
String nDateStr = sdf.format(nDate);
|
||||
// Date타입으로 변경
|
||||
Date requestAt = sdf.parse(requestAtStr);
|
||||
double diff = (nDate - requestAt.getTime()) / 1000.0; // 초
|
||||
if(diff > 2.5) {
|
||||
log.error(LOG_PREFIX +"changebalance::debit::"+diff+"초 통신 지연발생[requestAt:"+requestAtStr+"][nDate:"+nDateStr+"]");
|
||||
responseObj.put("result_code", 44);
|
||||
responseObj.put("error_msg","TIMEOUT_ERROR");
|
||||
log.error(LOG_PREFIX+ "[### changeBalance() TIMEOUT_ERROR]");
|
||||
httpStatus = HttpStatus.OK;
|
||||
return new ResponseEntity<net.sf.json.JSONObject>(responseObj, httpStatus);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
log.info(LOG_PREFIX+ "TripleVO : " + tripleVO);
|
||||
|
||||
Member search = new Member();
|
||||
search.setSiteIdx(Integer.parseInt(tripleVO.getUserId().substring(0, 3), 16));
|
||||
search.setMemId(tripleVO.getUserId().substring(3, tripleVO.getUserId().length()));
|
||||
|
||||
if(tripleVO.getDetailStr() == null) {
|
||||
tripleVO.setDetailStr("{}");
|
||||
}
|
||||
|
||||
if(tripleVO.getMinusBalanceYn() == null) {
|
||||
tripleVO.setMinusBalanceYn("N");
|
||||
}
|
||||
|
||||
if(tripleVO.getVendorIdx() == 83) {
|
||||
// 스포츠 배팅
|
||||
responseObj = sportService.betProc(search, tripleVO);
|
||||
} else {
|
||||
responseObj = tripleService.betProc(search, tripleVO);
|
||||
}
|
||||
|
||||
if(responseObj.getString("result_code").equals("0") ||
|
||||
responseObj.getString("result_code").equals("70") ||
|
||||
responseObj.getString("result_code").equals("80") ||
|
||||
responseObj.getString("result_code").equals("98") ||
|
||||
responseObj.getString("result_code").equals("99") ||
|
||||
responseObj.getString("result_code").equals("44") ||
|
||||
responseObj.getString("result_code").equals("1005") ||
|
||||
responseObj.getString("result_code").equals("3333") ) {
|
||||
|
||||
// 0 70 80 98 99
|
||||
httpStatus = HttpStatus.OK;
|
||||
} else {
|
||||
httpStatus = HttpStatus.INTERNAL_SERVER_ERROR;
|
||||
}
|
||||
} catch(Exception e) {
|
||||
responseObj.put("result_code", 1111);
|
||||
responseObj.put("error_msg","UNKNOWN_ERROR");
|
||||
httpStatus = HttpStatus.INTERNAL_SERVER_ERROR;
|
||||
log.error(LOG_PREFIX+ "Exception::"+e.getMessage());
|
||||
}
|
||||
|
||||
log.info(LOG_PREFIX+ "Response::" + responseObj.toString());
|
||||
|
||||
long endTime = System.currentTimeMillis(); // 코드 실행 후에 시간 받아오기
|
||||
double diffTime = (startTime - endTime)/1000.0; //두 시간에 차 계산
|
||||
if(diffTime < -1.5) {
|
||||
log.error(LOG_PREFIX+ "[callback::diffTime : " + String.format("%.3f", diffTime) + "]");
|
||||
}
|
||||
return new ResponseEntity<net.sf.json.JSONObject>(responseObj, httpStatus);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/balance/sportsD")
|
||||
public ResponseEntity<net.sf.json.JSONObject> balanceD(@RequestBody TripleDVO tripleVO, HttpServletRequest request) throws Exception {
|
||||
long startTime = System.currentTimeMillis();
|
||||
|
||||
net.sf.json.JSONObject responseObj = new net.sf.json.JSONObject();
|
||||
HttpStatus httpStatus = null;
|
||||
final String LOG_PREFIX = "#-CB::balance::"+tripleVO.getUserId()+"::"+tripleVO.getRequestAt()+":::";
|
||||
|
||||
log.info(LOG_PREFIX+ "TripleVO : " + tripleVO);
|
||||
|
||||
try {
|
||||
Member search = new Member();
|
||||
search.setSiteIdx(Integer.parseInt(tripleVO.getUserId().substring(0, 3), 16));
|
||||
search.setMemId(tripleVO.getUserId().substring(3, tripleVO.getUserId().length()));
|
||||
|
||||
// synchronized method getMemByTriple()
|
||||
MemberDetail memberVo = userService.getMemByTriple(search);
|
||||
|
||||
long endTime1 = System.currentTimeMillis(); // 코드 실행 후에 시간 받아오기
|
||||
double diffTime1 = (startTime - endTime1)/1000.0; //두 시간에 차 계산
|
||||
log.error(LOG_PREFIX+ "[### userService.getMemByTriple() : " + String.format("%.3f", diffTime1) + " ###]");
|
||||
|
||||
if(memberVo != null && !"".equals(memberVo.getUsername())) {
|
||||
responseObj.put("result_code", 0);
|
||||
responseObj.put("balance", memberVo.getCashAmtD());
|
||||
httpStatus = HttpStatus.OK;
|
||||
} else {
|
||||
if(memberVo != null && "".equals(memberVo.getUsername())) {
|
||||
TripleAuthInfo user = new TripleAuthInfo();
|
||||
user.setSiteId(search.getSiteId());
|
||||
user.setMemId(search.getMemId());
|
||||
user.setId(0);
|
||||
user.setUsername(tripleVO.getUserId());
|
||||
user.setNickname(tripleVO.getUserId());
|
||||
log.info(LOG_PREFIX+ "### Triple API ### - call \"/balance\" TripleAuthInfo: " + user);
|
||||
int result = userService.insertTripleAuthInfo(user);
|
||||
|
||||
if(result > 0) {
|
||||
responseObj.put("result_code", 0);
|
||||
responseObj.put("balance", memberVo.getCashAmtD());
|
||||
// FOR-BTI
|
||||
responseObj.put("balanceD", memberVo.getCashAmtD());
|
||||
httpStatus = HttpStatus.OK;
|
||||
} else {
|
||||
responseObj.put("result_code", 1999);
|
||||
responseObj.put("errors","INSERT_USER_ERROR");
|
||||
httpStatus = HttpStatus.OK;
|
||||
}
|
||||
} else {
|
||||
responseObj.put("result_code", 9999);
|
||||
responseObj.put("errors","INVALID_USER");
|
||||
httpStatus = HttpStatus.OK;
|
||||
}
|
||||
}
|
||||
|
||||
} catch(Exception e) {
|
||||
responseObj.put("result_code", 1111);
|
||||
responseObj.put("errors","UNKNOWN_ERROR");
|
||||
httpStatus = HttpStatus.INTERNAL_SERVER_ERROR;
|
||||
log.error(LOG_PREFIX+ e.getMessage());
|
||||
}
|
||||
log.info(LOG_PREFIX+ "### Triple API Controller ### - call \"/balance\" response : " + responseObj);
|
||||
|
||||
long endTime = System.currentTimeMillis(); // 코드 실행 후에 시간 받아오기
|
||||
double diffTime = (startTime - endTime)/1000.0; //두 시간에 차 계산
|
||||
if(diffTime < -2.0) {
|
||||
log.error(LOG_PREFIX+ "[### balance diffTime : " + String.format("%.3f", diffTime) + " ###]");
|
||||
}
|
||||
|
||||
return new ResponseEntity<net.sf.json.JSONObject>(responseObj, httpStatus);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/changebalance/sportsD")
|
||||
public ResponseEntity<net.sf.json.JSONObject> changeBalanceD(HttpServletRequest request, @RequestBody TripleDVO tripleVO) {
|
||||
long startTime = System.currentTimeMillis();
|
||||
|
||||
net.sf.json.JSONObject responseObj = new net.sf.json.JSONObject();
|
||||
HttpStatus httpStatus = null;
|
||||
|
||||
final String LOG_PREFIX = "#-callback::"+tripleVO.getUserId()+"::"+tripleVO.getBetId()+"::"+tripleVO.getTranType()+"::::";
|
||||
|
||||
try {
|
||||
|
||||
|
||||
if(tripleVO.getTranType().equals("debit") && tripleVO.getIsCancel() == 0) {
|
||||
if(tripleVO.getRequestAt() != null && !tripleVO.getRequestAt().equals("")) {
|
||||
|
||||
SimpleDateFormat sdf = null;
|
||||
if(tripleVO.getRequestAt().length() >= 20) {
|
||||
// 2025-02-20 18:37:21.000
|
||||
sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
|
||||
} else {
|
||||
// 2025-02-20 18:37:21
|
||||
sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
}
|
||||
|
||||
String requestAtStr = tripleVO.getRequestAt();
|
||||
//long nDate = System.currentTimeMillis() - 32400000;
|
||||
long nDate = System.currentTimeMillis();
|
||||
String nDateStr = sdf.format(nDate);
|
||||
// Date타입으로 변경
|
||||
Date requestAt = sdf.parse(requestAtStr);
|
||||
double diff = (nDate - requestAt.getTime()) / 1000.0; // 초
|
||||
if(diff > 2.5) {
|
||||
log.error(LOG_PREFIX +"changebalance::debit::"+diff+"초 통신 지연발생[requestAt:"+requestAtStr+"][nDate:"+nDateStr+"]");
|
||||
responseObj.put("result_code", 44);
|
||||
responseObj.put("error_msg","TIMEOUT_ERROR");
|
||||
log.error(LOG_PREFIX+ "[### changeBalance() TIMEOUT_ERROR]");
|
||||
httpStatus = HttpStatus.OK;
|
||||
return new ResponseEntity<net.sf.json.JSONObject>(responseObj, httpStatus);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
log.info(LOG_PREFIX+ "TripleVO : " + tripleVO);
|
||||
|
||||
Member search = new Member();
|
||||
search.setSiteIdx(Integer.parseInt(tripleVO.getUserId().substring(0, 3), 16));
|
||||
search.setMemId(tripleVO.getUserId().substring(3, tripleVO.getUserId().length()));
|
||||
|
||||
if(tripleVO.getDetailStr() == null) {
|
||||
tripleVO.setDetailStr("{}");
|
||||
}
|
||||
|
||||
if(tripleVO.getMinusBalanceYn() == null) {
|
||||
tripleVO.setMinusBalanceYn("N");
|
||||
}
|
||||
|
||||
// 스포츠 배팅
|
||||
responseObj = sportDService.betProc(search, tripleVO);
|
||||
|
||||
if(responseObj.getString("result_code").equals("0") ||
|
||||
responseObj.getString("result_code").equals("70") ||
|
||||
responseObj.getString("result_code").equals("80") ||
|
||||
responseObj.getString("result_code").equals("98") ||
|
||||
responseObj.getString("result_code").equals("99") ||
|
||||
responseObj.getString("result_code").equals("44") ||
|
||||
responseObj.getString("result_code").equals("1005") ||
|
||||
responseObj.getString("result_code").equals("3333") ) {
|
||||
|
||||
// 0 70 80 98 99
|
||||
httpStatus = HttpStatus.OK;
|
||||
} else {
|
||||
httpStatus = HttpStatus.INTERNAL_SERVER_ERROR;
|
||||
}
|
||||
} catch(Exception e) {
|
||||
responseObj.put("result_code", 1111);
|
||||
responseObj.put("error_msg","UNKNOWN_ERROR");
|
||||
httpStatus = HttpStatus.INTERNAL_SERVER_ERROR;
|
||||
log.error(LOG_PREFIX+ "Exception::"+e.getMessage());
|
||||
}
|
||||
|
||||
log.info(LOG_PREFIX+ "Response::" + responseObj.toString());
|
||||
|
||||
long endTime = System.currentTimeMillis(); // 코드 실행 후에 시간 받아오기
|
||||
double diffTime = (startTime - endTime)/1000.0; //두 시간에 차 계산
|
||||
if(diffTime < -1.5) {
|
||||
log.error(LOG_PREFIX+ "[callback::diffTime : " + String.format("%.3f", diffTime) + "]");
|
||||
}
|
||||
return new ResponseEntity<net.sf.json.JSONObject>(responseObj, httpStatus);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/purchaseId")
|
||||
public ResponseEntity<net.sf.json.JSONObject> callPurchaseId(HttpServletRequest request, @RequestBody TriplePurchaseId tripleVO) {
|
||||
|
||||
JSONObject responseObj = new JSONObject();
|
||||
HttpStatus httpStatus = HttpStatus.OK;
|
||||
final String LOG_PREFIX = "#-SPORT::callPurchaseId::"+tripleVO.getBetId()+"::"+tripleVO.getPurchaseId()+"::";
|
||||
|
||||
|
||||
log.info(LOG_PREFIX + "request::"+tripleVO);
|
||||
|
||||
try {
|
||||
int result = sportService.updatePurchaseId(tripleVO);
|
||||
|
||||
if(result >= 0) {
|
||||
responseObj.put("result_code", 0);
|
||||
} else {
|
||||
responseObj.put("result_code", -99);
|
||||
responseObj.put("error_msg","UPDATE_ERROR");
|
||||
}
|
||||
} catch(Exception e) {
|
||||
responseObj.put("result_code", -11);
|
||||
responseObj.put("error_msg","UNKNOWN_ERROR");
|
||||
log.error(LOG_PREFIX + "Exception::"+e.getMessage());
|
||||
}
|
||||
|
||||
log.info(LOG_PREFIX + responseObj.toString());
|
||||
|
||||
return new ResponseEntity<net.sf.json.JSONObject>(responseObj, httpStatus);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/changebalance/slot2")
|
||||
public ResponseEntity<net.sf.json.JSONObject> changeBalanceSlot(HttpServletRequest request, @RequestBody TripleVO tripleVO) {
|
||||
long startTime = System.currentTimeMillis();
|
||||
|
||||
net.sf.json.JSONObject responseObj = new net.sf.json.JSONObject();
|
||||
HttpStatus httpStatus = null;
|
||||
|
||||
final String LOG_PREFIX = "#-callbackSlot::"+tripleVO.getUserId()+"::"+tripleVO.getBetId()+"::"+tripleVO.getTranType()+"::::";
|
||||
|
||||
if(tripleVO.getRequestAt() == null || tripleVO.getRequestAt().equals("")) {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
|
||||
long nDate = System.currentTimeMillis();
|
||||
String requestAtStr = sdf.format(nDate);
|
||||
tripleVO.setRequestAt(requestAtStr);
|
||||
}
|
||||
|
||||
log.info(LOG_PREFIX+ "changeBalanceSlot::TripleVO : " + tripleVO);
|
||||
|
||||
try {
|
||||
Member search = new Member();
|
||||
search.setSiteIdx(Integer.parseInt(tripleVO.getUserId().substring(0, 3), 16));
|
||||
search.setMemId(tripleVO.getUserId().substring(3, tripleVO.getUserId().length()));
|
||||
|
||||
responseObj = tripleService.betProcSlot(LOG_PREFIX, search, tripleVO);
|
||||
|
||||
if(responseObj.getString("result_code").equals("0") ||
|
||||
responseObj.getString("result_code").equals("70") ||
|
||||
responseObj.getString("result_code").equals("80") ||
|
||||
responseObj.getString("result_code").equals("98") ||
|
||||
responseObj.getString("result_code").equals("99") ||
|
||||
responseObj.getString("result_code").equals("44") ||
|
||||
responseObj.getString("result_code").equals("1005") ||
|
||||
responseObj.getString("result_code").equals("3333") ) {
|
||||
|
||||
// 0 70 80 98 99
|
||||
httpStatus = HttpStatus.OK;
|
||||
} else {
|
||||
httpStatus = HttpStatus.INTERNAL_SERVER_ERROR;
|
||||
}
|
||||
} catch(Exception e) {
|
||||
responseObj.put("result_code", 1111);
|
||||
responseObj.put("error_msg","UNKNOWN_ERROR");
|
||||
httpStatus = HttpStatus.INTERNAL_SERVER_ERROR;
|
||||
log.error(LOG_PREFIX+ "Exception::"+e.getMessage());
|
||||
}
|
||||
|
||||
log.info(LOG_PREFIX+ "changeBalanceSlot::Response::" + responseObj.toString());
|
||||
|
||||
long endTime = System.currentTimeMillis(); // 코드 실행 후에 시간 받아오기
|
||||
double diffTime = (startTime - endTime)/1000.0; //두 시간에 차 계산
|
||||
log.info(LOG_PREFIX+ "changeBalanceSlot::[diffTime : " + String.format("%.3f", diffTime) + "]");
|
||||
|
||||
return new ResponseEntity<net.sf.json.JSONObject>(responseObj, httpStatus);
|
||||
}
|
||||
|
||||
|
||||
//@Scheduled(fixedDelay = 30000) // 작업 종류 후 120초 마다
|
||||
public void betWaitAutoProcByCasino() throws Exception {
|
||||
|
||||
final String LOG_PREFIX = "#-WaitAutoProc::CASINO:::";
|
||||
|
||||
try {
|
||||
CronServerInfo cronStatus = new CronServerInfo();
|
||||
cronStatus.setHostName(InetAddress.getLocalHost().getHostName());
|
||||
cronStatus.setIpAddress(InetAddress.getLocalHost().getHostAddress());
|
||||
cronStatus.setCronType("WAIT");
|
||||
log.info(LOG_PREFIX+ "HostName: " + cronStatus.getHostName() + ", HostAddress: " + cronStatus.getIpAddress());
|
||||
cronStatus = commonService.getServerCronStatus(cronStatus);
|
||||
log.info(LOG_PREFIX+ "cronStatus: " + cronStatus);
|
||||
|
||||
if(cronStatus != null && cronStatus.getRunYn().equals("Y")) {
|
||||
List<HashMap> betWaitList = betService.getTripleBetWaitListByCasino();
|
||||
log.info(LOG_PREFIX+ "betWaitList.size() : " + betWaitList.size());
|
||||
for(HashMap betItem : betWaitList) {
|
||||
String siteId = betItem.get("siteId").toString();
|
||||
long betIdx = (long) betItem.get("betIdx");
|
||||
|
||||
try {
|
||||
// 배팅 패배 처리
|
||||
HashMap mapParam = new HashMap();
|
||||
mapParam.put("betIdx", betIdx);
|
||||
mapParam.put("betWinAmt", "0");
|
||||
|
||||
int afMoney = Integer.parseInt(betItem.get("afMoney").toString());
|
||||
int winAmt = 0;
|
||||
afMoney = afMoney + winAmt;
|
||||
mapParam.put("afMoney", Integer.toString(afMoney));
|
||||
|
||||
log.debug(LOG_PREFIX+ "배팅 자동 패배 처리중 ["+betIdx+"] - start: " + mapParam);
|
||||
betService.updateEndAutoLose(mapParam);
|
||||
log.debug(LOG_PREFIX+ "배팅 자동 패배 처리중 ["+betIdx+"] - end: " + mapParam);
|
||||
} catch(Exception e) {
|
||||
log.error(LOG_PREFIX+ "[Exception1]::"+e.toString());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} catch(Exception e) {
|
||||
log.error(LOG_PREFIX+ "[Exception2]::"+e.toString());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//@Scheduled(fixedDelay = 30000) // 작업 종류 후 120초 마다
|
||||
public void betWaitAutoProcBySlot() throws Exception {
|
||||
|
||||
final String LOG_PREFIX = "#-WaitAutoProc::SLOT:::";
|
||||
|
||||
try {
|
||||
CronServerInfo cronStatus = new CronServerInfo();
|
||||
cronStatus.setHostName(InetAddress.getLocalHost().getHostName());
|
||||
cronStatus.setIpAddress(InetAddress.getLocalHost().getHostAddress());
|
||||
cronStatus.setCronType("WAIT");
|
||||
log.info(LOG_PREFIX+ "HostName: " + cronStatus.getHostName() + ", HostAddress: " + cronStatus.getIpAddress());
|
||||
cronStatus = commonService.getServerCronStatus(cronStatus);
|
||||
log.info(LOG_PREFIX+ "cronStatus: " + cronStatus);
|
||||
|
||||
if(cronStatus != null && cronStatus.getRunYn().equals("Y")) {
|
||||
List<HashMap> betWaitList = betService.getTripleBetWaitListBySlot();
|
||||
log.info(LOG_PREFIX+ "betWaitList.size() : " + betWaitList.size());
|
||||
for(HashMap betItem : betWaitList) {
|
||||
String siteId = betItem.get("siteId").toString();
|
||||
long betIdx = (long) betItem.get("betIdx");
|
||||
|
||||
try {
|
||||
// 배팅 패배 처리
|
||||
HashMap mapParam = new HashMap();
|
||||
mapParam.put("betIdx", betIdx);
|
||||
mapParam.put("betWinAmt", "0");
|
||||
|
||||
int afMoney = Integer.parseInt(betItem.get("afMoney").toString());
|
||||
int winAmt = 0;
|
||||
afMoney = afMoney + winAmt;
|
||||
mapParam.put("afMoney", Integer.toString(afMoney));
|
||||
|
||||
log.debug(LOG_PREFIX+ "배팅 자동 패배 처리중 ["+betIdx+"] - start: " + mapParam);
|
||||
betService.updateEndAutoLose(mapParam);
|
||||
log.debug(LOG_PREFIX+ "배팅 자동 패배 처리중 ["+betIdx+"] - end: " + mapParam);
|
||||
} catch(Exception e) {
|
||||
log.error(LOG_PREFIX+ "[Exception1]::"+e.toString());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} catch(Exception e) {
|
||||
log.error(LOG_PREFIX+ "[Exception2]::"+e.toString());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//@Scheduled(fixedDelay = 60000) // 작업 종류 후 1분 마다
|
||||
public void betWaitAutoProc2() throws Exception {
|
||||
try {
|
||||
CronServerInfo cronStatus = new CronServerInfo();
|
||||
cronStatus.setHostName(InetAddress.getLocalHost().getHostName());
|
||||
cronStatus.setIpAddress(InetAddress.getLocalHost().getHostAddress());
|
||||
cronStatus.setCronType("WAIT2");
|
||||
log.debug("##- [WaitAutoProc2][OMS CRON STATUS] HostName: " + cronStatus.getHostName() + ", HostAddress: " + cronStatus.getIpAddress());
|
||||
cronStatus = commonService.getServerCronStatus(cronStatus);
|
||||
log.debug("##- [WaitAutoProc2][OMS CRON STATUS] cronStatus: " + cronStatus);
|
||||
|
||||
if(cronStatus != null && cronStatus.getRunYn().equals("Y")) {
|
||||
log.info("##- [WaitAutoProc2] Triple API getTripleBetWaitList2() Start -###");
|
||||
List<HashMap> betWaitList = betService.getTripleBetWaitList2();
|
||||
log.info("##- [WaitAutoProc2] Triple API getTripleBetWaitList2.size() : " + betWaitList.size());
|
||||
for(HashMap betItem : betWaitList) {
|
||||
log.debug("##- [WaitAutoProc2] Triple API betItem : " + betItem.toString());
|
||||
|
||||
String siteId = betItem.get("siteId").toString();
|
||||
String memId = betItem.get("memId").toString();
|
||||
long betIdx = (long) betItem.get("betIdx");
|
||||
String betId = betItem.get("betId").toString();
|
||||
String updDate = betItem.get("updDate").toString();
|
||||
|
||||
int isCancel = (int) betItem.get("isCancel");
|
||||
|
||||
if(isCancel == 0) {
|
||||
// 배팅 정상 처리
|
||||
log.debug("##- [WaitAutoProc2] 배팅 대기상태 정상 처리 -시작-");
|
||||
|
||||
int creditAmt = (int) betItem.get("credit");
|
||||
|
||||
HashMap mapParam = new HashMap();
|
||||
mapParam.put("betIdx", betIdx);
|
||||
mapParam.put("betWinAmt", Integer.toString(creditAmt));
|
||||
|
||||
int afMoney = Integer.parseInt(betItem.get("afMoney").toString());
|
||||
afMoney = afMoney + creditAmt;
|
||||
mapParam.put("afMoney", Integer.toString(afMoney));
|
||||
mapParam.put("siteId", siteId);
|
||||
mapParam.put("data", "{}");
|
||||
|
||||
log.debug("##- [WaitAutoProc2] 배팅 결과 처리중 ["+betId+"]["+betIdx+"] - start: " + mapParam);
|
||||
betService.updateEnd(mapParam);
|
||||
log.debug("##- [WaitAutoProc2] 배팅 결과 처리중 ["+betId+"]["+betIdx+"] - end: " + mapParam);
|
||||
|
||||
log.debug("##- [WaitAutoProc2] 배팅 대기상태 정상 처리 -끝-");
|
||||
} else {
|
||||
// 배팅 취소 처리
|
||||
log.info("##- [WaitAutoProc2] 배팅 대기상태 취소 처리 -시작-");
|
||||
int creditAmt = (int) betItem.get("credit");
|
||||
HashMap param = new HashMap();
|
||||
param.put("betIdx", betIdx);
|
||||
param.put("betStatus", "CANCEL");
|
||||
param.put("betWinAmt", Integer.toString(creditAmt));
|
||||
param.put("data", "{}");
|
||||
|
||||
int betCancelAmt = Integer.parseInt(betItem.get("betAmt").toString());
|
||||
|
||||
log.debug("##- [WaitAutoProc2] 배팅 취소 처리중 ["+betId+"]["+betIdx+"] - start: " + param);
|
||||
int resultBet = betService.betCancelTriple(param);
|
||||
log.debug("##- [WaitAutoProc2] 배팅 취소 처리중 ["+betId+"]["+betIdx+"] - end: " + param);
|
||||
|
||||
log.debug("##- [WaitAutoProc2] 배팅 대기상태 취소 처리 -끝-");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} catch(Exception e) {
|
||||
log.error(e.toString());
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/gameRateChange")
|
||||
public ResponseEntity<net.sf.json.JSONObject> gameRateChange(HttpServletRequest request, @RequestBody TripleGameRate gameRateVO) throws Exception {
|
||||
net.sf.json.JSONObject responseObj = new net.sf.json.JSONObject();
|
||||
HttpStatus httpStatus = null;
|
||||
log.info("### Triple API ### - call \"/gameRateChange\" gameRateVO: " + gameRateVO);
|
||||
|
||||
try {
|
||||
List<HashMap<String, String>> compList = compService.getGameRateCompList(gameRateVO);
|
||||
for(HashMap<String, String> compGameRateInfo : compList) {
|
||||
compGameRateInfo.put("vendor", gameRateVO.getVendor());
|
||||
compGameRateInfo.put("gameRate", gameRateVO.getGameRate());
|
||||
log.info("### Triple API ### gameRateChange() update start compGameRateInfo : " + compGameRateInfo);
|
||||
int updResult = compService.updateCompGameRate(compGameRateInfo);
|
||||
log.info("### Triple API ### gameRateChange() update result: " + updResult);
|
||||
}
|
||||
|
||||
responseObj.put("result_code", 0);
|
||||
httpStatus = HttpStatus.OK;
|
||||
} catch(Exception e) {
|
||||
responseObj.put("result_code", 1111);
|
||||
responseObj.put("errors","UNKNOWN_ERROR");
|
||||
httpStatus = HttpStatus.INTERNAL_SERVER_ERROR;
|
||||
log.error(e.getMessage());
|
||||
}
|
||||
log.info("### Triple API Controller ### - call \"/gameRateChange\" response : " + responseObj);
|
||||
return new ResponseEntity<net.sf.json.JSONObject>(responseObj, httpStatus);
|
||||
}
|
||||
}
|
||||
260
src/main/java/com/bb/dao/BetDao.java
Normal file
260
src/main/java/com/bb/dao/BetDao.java
Normal file
@@ -0,0 +1,260 @@
|
||||
package com.bb.dao;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
import com.bb.model.AdminBetSearch;
|
||||
import com.bb.model.BetAutoLoseVO;
|
||||
import com.bb.model.BetData;
|
||||
import com.bb.model.BetDetail;
|
||||
import com.bb.model.BetSearch;
|
||||
import com.bb.model.BetSplusSearch;
|
||||
import com.bb.model.Member;
|
||||
import com.bb.model.RetailBetSearch;
|
||||
import com.bb.model.RvHoldemVO;
|
||||
import com.bb.model.TriplePurchaseId;
|
||||
import com.bb.model.TripleVO;
|
||||
import com.bb.model.TrxSearchVO;
|
||||
|
||||
public interface BetDao {
|
||||
|
||||
int insertBet(HashMap param);
|
||||
|
||||
int insertBetMap(HashMap param);
|
||||
|
||||
int updateEnd(HashMap mapParam);
|
||||
|
||||
int updateEndOld(HashMap mapParam);
|
||||
|
||||
int updateMapEnd(HashMap mapParam);
|
||||
|
||||
int updateMapEndOld(HashMap mapParam);
|
||||
|
||||
void updateEndAutoLose(HashMap mapParam);
|
||||
|
||||
Long getBetIdxByGameIdx(String betId);
|
||||
|
||||
Long getBetIdxByBetId(String betId);
|
||||
|
||||
int getBetListCnt(BetSearch search);
|
||||
|
||||
List<BetDetail> getBetList(BetSearch search);
|
||||
|
||||
int getFastBetIdListCnt(AdminBetSearch search);
|
||||
|
||||
List<HashMap<String, String>> getFastBetIdList(AdminBetSearch search);
|
||||
|
||||
HashMap<String, String> getFastBetItem(HashMap<String, String> item);
|
||||
|
||||
int getBetListNewCnt(AdminBetSearch search);
|
||||
|
||||
List<HashMap> getBetListNew(AdminBetSearch search);
|
||||
|
||||
int getPowerballResultListCnt(BetSearch search);
|
||||
|
||||
List<HashMap> getPowerballResultList(BetSearch search);
|
||||
|
||||
HashMap getGameRataMiniGame(@Valid BetData betData);
|
||||
|
||||
List<HashMap> getWaitBetlist(Map pParam);
|
||||
|
||||
void updateBetInfoMapByPowerball(HashMap betInfo);
|
||||
|
||||
void updateBetInfoMapResultByPowerball(HashMap betInfo);
|
||||
|
||||
void insertCashByPowerball(HashMap betInfo);
|
||||
|
||||
void updateBetInfoByPowerball(HashMap betInfo);
|
||||
|
||||
void insertPointByPowerball(HashMap betInfo);
|
||||
|
||||
void updatePointRegYnByPowerball(HashMap betInfo);
|
||||
|
||||
int getTripleTxnCheck(String tranId);
|
||||
|
||||
int getTripleDebitCheckByBetId(String betId);
|
||||
|
||||
int getBetinfoCheckByBetId(String betId);
|
||||
|
||||
int getTripleDebitCheckByTranId(String tranid);
|
||||
|
||||
int getTripleCreditCheckByBetId(String betId);
|
||||
|
||||
int getTripleCreditCheckByTranId(String tranid);
|
||||
|
||||
int getTripleIsCancelCheck(String betId);
|
||||
|
||||
int insertTripleTxnData(TripleVO tripleVO);
|
||||
|
||||
BetDetail getBetDetail(long betIdx);
|
||||
|
||||
int betCancelTriple(HashMap param);
|
||||
|
||||
int betCancelOldTriple(HashMap param);
|
||||
|
||||
int betCancelMega(HashMap param);
|
||||
|
||||
int getTripleIsBonusCheck(String betid);
|
||||
|
||||
int getUserBetListCnt(BetSearch search);
|
||||
|
||||
List<HashMap> getUserBetList(BetSearch search);
|
||||
|
||||
int getUserBetListNewCnt(BetSearch search);
|
||||
|
||||
List<HashMap> getUserBetListNew(BetSearch search);
|
||||
|
||||
int insertBetBonus(HashMap param);
|
||||
|
||||
int updateBetInfo(HashMap param);
|
||||
|
||||
int updateBetInfoOld(HashMap param);
|
||||
|
||||
int updateBetInfoMap(HashMap param);
|
||||
|
||||
int updateBetInfoMapOld(HashMap param);
|
||||
|
||||
Long getCashIdx(HashMap param);
|
||||
|
||||
int updateCashInfo(HashMap param);
|
||||
|
||||
int updateUserCashByAmount(HashMap param);
|
||||
|
||||
int updateUserCashByBalance(HashMap param);
|
||||
|
||||
int getBottomBetListCnt(RetailBetSearch search);
|
||||
|
||||
List<HashMap> getBottomBetList(RetailBetSearch search);
|
||||
|
||||
int getTripleAutoCancelCheck(String tranId);
|
||||
|
||||
int updateTripleTxnData(TripleVO tripleVO);
|
||||
|
||||
int betAutoCancelTriple(HashMap param);
|
||||
|
||||
List<HashMap> getTripleBetWaitListByCasino();
|
||||
|
||||
List<HashMap> getTripleBetWaitListBySlot();
|
||||
|
||||
HashMap<String, String> getSiteBetLimitInfo(TripleVO tripleVO);
|
||||
|
||||
List<HashMap> getTripleBetWaitList2();
|
||||
|
||||
List<HashMap> getBetPointList();
|
||||
|
||||
List<HashMap> getBetPointListBySite(String siteId);
|
||||
|
||||
int getTrxListCnt(TrxSearchVO searchVO);
|
||||
|
||||
List<HashMap<String, Object>> getTrxList(TrxSearchVO searchVO);
|
||||
|
||||
BetAutoLoseVO getBetInfoByBetId(String betId);
|
||||
|
||||
int insertCashInfoByReserve(HashMap cashInsertParam);
|
||||
|
||||
int insertBetSplusInfo(HashMap param);
|
||||
|
||||
int updateSplusStatus(HashMap param);
|
||||
|
||||
int getSportBetListCnt(BetSplusSearch search);
|
||||
|
||||
List<HashMap> getSportBetList(BetSplusSearch search);
|
||||
|
||||
int getSportEventListCnt(BetSplusSearch search);
|
||||
|
||||
List<HashMap> getSportEventList(BetSplusSearch search);
|
||||
|
||||
int getSportEventDetailListCnt(BetSplusSearch search);
|
||||
|
||||
List<HashMap> getSportEventDetailList(BetSplusSearch search);
|
||||
|
||||
int getSportBottomBetListCnt(BetSplusSearch search);
|
||||
|
||||
List<HashMap> getSportBottomBetList(BetSplusSearch search);
|
||||
|
||||
int updateSplusBetCancel(HashMap param);
|
||||
|
||||
int updatePurchaseId(TriplePurchaseId tripleVO);
|
||||
|
||||
int insertSlotTranInfo(HashMap param);
|
||||
|
||||
int updateSportReport(HashMap repParam);
|
||||
|
||||
int updateSportReportDebit(HashMap repParam);
|
||||
|
||||
int updateSportReportCredit(HashMap repParam);
|
||||
|
||||
int updateSportReportCancel(HashMap repParam);
|
||||
|
||||
int updateSportReportRolling(long betIdx);
|
||||
|
||||
int updateSportReportRollingCancel(long betIdx);
|
||||
|
||||
String getBetType(String betId);
|
||||
|
||||
HashMap<String, String> getBetTodayTotalInfo(HashMap betItem);
|
||||
|
||||
int getCurBalance(Member memInfo);
|
||||
|
||||
HashMap<String, String> getSiteVendorInfo(HashMap<String, String> vParam);
|
||||
|
||||
int insertBetNew(HashMap betData);
|
||||
|
||||
HashMap getReferenceData1(String betId);
|
||||
|
||||
HashMap getReferenceData2(String betId);
|
||||
|
||||
int cancelBetNew(HashMap betData);
|
||||
|
||||
int cancelBetNew2(long betIdx);
|
||||
|
||||
int bonusBetNew(HashMap betData);
|
||||
|
||||
HashMap<String, String> getRollingInfo(HashMap betData);
|
||||
|
||||
HashMap<String, String> getBetTodayTotalInfoNew(HashMap betData);
|
||||
|
||||
int insertBetRolling(HashMap betData);
|
||||
|
||||
int updateRollingYn(HashMap betData);
|
||||
|
||||
List<HashMap> getCancelPointAmtList(String betId);
|
||||
|
||||
List<HashMap> getCancelPointAmtList2(long betIdx);
|
||||
|
||||
int deleteRollingCancel(String betId);
|
||||
|
||||
int deleteRollingCancel2(long betIdx);
|
||||
|
||||
int deleteLosingCancel(String betId);
|
||||
|
||||
int deleteLosingCancel2(long betIdx);
|
||||
|
||||
int updateUserCashByAmountNew(HashMap balanceParam);
|
||||
|
||||
HashMap<String, String> getPreBetData(HashMap betData);
|
||||
|
||||
int insertSportBetRolling(long betIdx);
|
||||
|
||||
int deleteSportRollingCancel(long betIdx);
|
||||
|
||||
int updateSportRollingYn(long betIdx);
|
||||
|
||||
int updateCancelPoint(HashMap betData);
|
||||
|
||||
Long getCancelTargetIdx(HashMap betData);
|
||||
|
||||
int updateUserCashByAmountD(HashMap param);
|
||||
|
||||
int insertRvhCallbackLog(RvHoldemVO rvParam);
|
||||
|
||||
int insertBetLosing(HashMap betData);
|
||||
|
||||
int insertBetLosingNew(HashMap betData);
|
||||
|
||||
int insertWinLosing(HashMap betData);
|
||||
|
||||
}
|
||||
747
src/main/java/com/bb/dao/BetDaoImpl.java
Normal file
747
src/main/java/com/bb/dao/BetDaoImpl.java
Normal file
@@ -0,0 +1,747 @@
|
||||
package com.bb.dao;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
import org.apache.ibatis.session.SqlSession;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.bb.model.AdminBetSearch;
|
||||
import com.bb.model.BetAutoLoseVO;
|
||||
import com.bb.model.BetData;
|
||||
import com.bb.model.BetDetail;
|
||||
import com.bb.model.BetSearch;
|
||||
import com.bb.model.BetSplusSearch;
|
||||
import com.bb.model.Member;
|
||||
import com.bb.model.RetailBetSearch;
|
||||
import com.bb.model.RvHoldemVO;
|
||||
import com.bb.model.TriplePurchaseId;
|
||||
import com.bb.model.TripleVO;
|
||||
import com.bb.model.TrxSearchVO;
|
||||
|
||||
@Repository("betDao")
|
||||
public class BetDaoImpl implements BetDao {
|
||||
|
||||
/** 메인DB 연결 */
|
||||
@Autowired @Qualifier("sqlSessionMain")
|
||||
protected SqlSession sqlSession;
|
||||
|
||||
/** 서브DB 연결 */
|
||||
@Autowired @Qualifier("sqlSessionSub")
|
||||
protected SqlSession sqlSessionSub;
|
||||
|
||||
|
||||
@Override
|
||||
public int insertBet(HashMap param) {
|
||||
return sqlSession.insert("insertBet", param);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertBetMap(HashMap param) {
|
||||
return sqlSession.insert("insertBetMap", param);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateEnd(HashMap mapParam) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.update("updateEnd", mapParam);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateEndOld(HashMap mapParam) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.update("updateEndOld", mapParam);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateMapEnd(HashMap mapParam) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.update("updateMapEnd", mapParam);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateMapEndOld(HashMap mapParam) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.update("updateMapEndOld", mapParam);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEndAutoLose(HashMap mapParam) {
|
||||
// TODO Auto-generated method stub
|
||||
sqlSession.update("updateEndAutoLose", mapParam);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long getBetIdxByGameIdx(String betId) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.selectOne("getBetIdxByGameIdx", betId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long getBetIdxByBetId(String betId) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.selectOne("getBetIdxByBetId", betId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getBetListCnt(BetSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getBetListCnt", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BetDetail> getBetList(BetSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getBetList", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFastBetIdListCnt(AdminBetSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getFastBetIdListCnt", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap<String, String>> getFastBetIdList(AdminBetSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getFastBetIdList", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HashMap<String, String> getFastBetItem(HashMap<String, String> item) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getFastBetItem", item);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getBetListNewCnt(AdminBetSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getBetListNewCnt", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap> getBetListNew(AdminBetSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getBetListNew", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPowerballResultListCnt(BetSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.selectOne("getPowerballResultListCnt", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap> getPowerballResultList(BetSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.selectList("getPowerballResultList", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HashMap getGameRataMiniGame(@Valid BetData betData) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.selectOne("getGameRataMiniGame", betData);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap> getWaitBetlist(Map pParam) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getWaitBetlist", pParam);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateBetInfoMapByPowerball(HashMap betInfo) {
|
||||
// TODO Auto-generated method stub
|
||||
sqlSession.update("updateBetInfoMapByPowerball", betInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateBetInfoMapResultByPowerball(HashMap betInfo) {
|
||||
// TODO Auto-generated method stub
|
||||
sqlSession.update("updateBetInfoMapResultByPowerball", betInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void insertCashByPowerball(HashMap betInfo) {
|
||||
// TODO Auto-generated method stub
|
||||
sqlSession.insert("insertCashByPowerball", betInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateBetInfoByPowerball(HashMap betInfo) {
|
||||
// TODO Auto-generated method stub
|
||||
sqlSession.update("updateBetInfoByPowerball", betInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void insertPointByPowerball(HashMap betInfo) {
|
||||
// TODO Auto-generated method stub
|
||||
sqlSession.insert("insertPointByPowerball", betInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updatePointRegYnByPowerball(HashMap betInfo) {
|
||||
// TODO Auto-generated method stub
|
||||
sqlSession.update("updatePointRegYnByPowerball", betInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTripleTxnCheck(String tranId) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.selectOne("getTripleTxnCheck", tranId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTripleDebitCheckByBetId(String betId) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.selectOne("getTripleDebitCheckByBetId", betId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getBetinfoCheckByBetId(String betId) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getBetinfoCheckByBetId", betId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTripleDebitCheckByTranId(String tranid) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.selectOne("getTripleDebitCheckByTranId", tranid);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTripleCreditCheckByBetId(String betId) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.selectOne("getTripleCreditCheckByBetId", betId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTripleCreditCheckByTranId(String tranid) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.selectOne("getTripleCreditCheckByTranId", tranid);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTripleIsCancelCheck(String betId) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.selectOne("getTripleIsCancelCheck", betId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTripleIsBonusCheck(String betId) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.selectOne("getTripleIsBonusCheck", betId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertTripleTxnData(TripleVO tripleVO) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.insert("insertTripleTxnData", tripleVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BetDetail getBetDetail(long betIdx) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.selectOne("getBetDetail", betIdx);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int betCancelTriple(HashMap param) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.update("betCancelTriple", param);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int betCancelOldTriple(HashMap param) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.update("betCancelOldTriple", param);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int betCancelMega(HashMap param) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.update("betCancelMega", param);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getUserBetListCnt(BetSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getUserBetListCnt", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap> getUserBetList(BetSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getUserBetList", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getUserBetListNewCnt(BetSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getUserBetListNewCnt", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap> getUserBetListNew(BetSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getUserBetListNew", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertBetBonus(HashMap param) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.insert("insertBetBonus", param);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateBetInfo(HashMap param) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.update("updateBetInfo", param);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateBetInfoOld(HashMap param) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.update("updateBetInfoOld", param);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateBetInfoMap(HashMap param) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.update("updateBetInfoMap", param);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateBetInfoMapOld(HashMap param) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.update("updateBetInfoMapOld", param);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long getCashIdx(HashMap param) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.selectOne("getCashIdx", param);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateCashInfo(HashMap param) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.update("updateCashInfo", param);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateUserCashByAmount(HashMap param) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.update("updateUserCashByAmount", param);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateUserCashByBalance(HashMap param) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.update("updateUserCashByBalance", param);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getBottomBetListCnt(RetailBetSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getBottomBetListCnt", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap> getBottomBetList(RetailBetSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getBottomBetList", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTripleAutoCancelCheck(String tranId) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.selectOne("getTripleAutoCancelCheck", tranId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateTripleTxnData(TripleVO tripleVO) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.update("updateTripleTxnData", tripleVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int betAutoCancelTriple(HashMap param) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.update("betAutoCancelTriple", param);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap> getTripleBetWaitListByCasino() {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getTripleBetWaitListByCasino");
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap> getTripleBetWaitListBySlot() {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getTripleBetWaitListBySlot");
|
||||
}
|
||||
|
||||
@Override
|
||||
public HashMap<String, String> getSiteBetLimitInfo(TripleVO tripleVO) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.selectOne("getSiteBetLimitInfo", tripleVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap> getTripleBetWaitList2() {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getTripleBetWaitList2");
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap> getBetPointList() {
|
||||
// TODO Auto-generated method stub
|
||||
// return sqlSessionSub.selectList("getBetPointList");
|
||||
return sqlSession.selectList("getBetPointList");
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap> getBetPointListBySite(String siteId) {
|
||||
// TODO Auto-generated method stub
|
||||
// return sqlSessionSub.selectList("getBetPointListBySite", siteId);
|
||||
return sqlSession.selectList("getBetPointListBySite", siteId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTrxListCnt(TrxSearchVO searchVO) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getTrxListCnt", searchVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap<String, Object>> getTrxList(TrxSearchVO searchVO) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getTrxList", searchVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BetAutoLoseVO getBetInfoByBetId(String betId) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getBetInfoByBetId", betId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertCashInfoByReserve(HashMap cashInsertParam) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.insert("insertCashInfoByReserve", cashInsertParam);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertBetSplusInfo(HashMap param) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.insert("insertBetSplusInfo", param);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateSplusStatus(HashMap param) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.update("updateSplusStatus", param);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSportBetListCnt(BetSplusSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getSportBetListCnt", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap> getSportBetList(BetSplusSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getSportBetList", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSportEventListCnt(BetSplusSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getSportEventListCnt", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap> getSportEventList(BetSplusSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getSportEventList", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSportEventDetailListCnt(BetSplusSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getSportEventDetailListCnt", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap> getSportEventDetailList(BetSplusSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getSportEventDetailList", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSportBottomBetListCnt(BetSplusSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getSportBottomBetListCnt", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap> getSportBottomBetList(BetSplusSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getSportBottomBetList", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateSplusBetCancel(HashMap param) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.update("updateSplusBetCancel", param);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updatePurchaseId(TriplePurchaseId tripleVO) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.update("updatePurchaseId", tripleVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertSlotTranInfo(HashMap param) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.insert("insertSlotTranInfo", param);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateSportReport(HashMap repParam) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.update("updateSportReport", repParam);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateSportReportDebit(HashMap repParam) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.update("updateSportReportDebit", repParam);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateSportReportCredit(HashMap repParam) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.update("updateSportReportCredit", repParam);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateSportReportCancel(HashMap repParam) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.update("updateSportReportCancel", repParam);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateSportReportRolling(long betIdx) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.update("updateSportReportRolling", betIdx);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateSportReportRollingCancel(long betIdx) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.update("updateSportReportRollingCancel", betIdx);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBetType(String betId) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getBetType", betId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HashMap<String, String> getBetTodayTotalInfo(HashMap betItem) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getBetTodayTotalInfo", betItem);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCurBalance(Member memInfo) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.selectOne("getCurBalance", memInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HashMap<String, String> getSiteVendorInfo(HashMap<String, String> vParam) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.selectOne("getSiteVendorInfo", vParam);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertBetNew(HashMap betData) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.insert("insertBetNew", betData);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HashMap getReferenceData1(String betId) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.selectOne("getReferenceData1", betId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HashMap getReferenceData2(String betId) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.selectOne("getReferenceData2", betId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int cancelBetNew(HashMap betData) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.update("cancelBetNew", betData);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int cancelBetNew2(long betIdx) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.update("cancelBetNew2", betIdx);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int bonusBetNew(HashMap betData) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.update("bonusBetNew", betData);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HashMap<String, String> getRollingInfo(HashMap betData) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.selectOne("getRollingInfo", betData);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HashMap<String, String> getBetTodayTotalInfoNew(HashMap betData) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getBetTodayTotalInfoNew", betData);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertBetRolling(HashMap betData) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.insert("insertBetRolling", betData);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateRollingYn(HashMap betData) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.update("updateRollingYn", betData);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap> getCancelPointAmtList(String betId) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.selectList("getCancelPointAmtList", betId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap> getCancelPointAmtList2(long betIdx) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.selectList("getCancelPointAmtList2", betIdx);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteRollingCancel(String betId) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.delete("deleteRollingCancel", betId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteRollingCancel2(long betIdx) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.delete("deleteRollingCancel2", betIdx);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteLosingCancel(String betId) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.delete("deleteLosingCancel", betId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteLosingCancel2(long betIdx) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.delete("deleteLosingCancel2", betIdx);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateUserCashByAmountNew(HashMap balanceParam) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.update("updateUserCashByAmountNew", balanceParam);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HashMap<String, String> getPreBetData(HashMap betData) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.selectOne("getPreBetData", betData);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertSportBetRolling(long betIdx) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.insert("insertSportBetRolling", betIdx);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteSportRollingCancel(long betIdx) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.delete("deleteSportRollingCancel", betIdx);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateSportRollingYn(long betIdx) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.update("updateSportRollingYn", betIdx);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateCancelPoint(HashMap betData) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.update("updateCancelPoint", betData);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long getCancelTargetIdx(HashMap betData) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.selectOne("getCancelTargetIdx", betData);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateUserCashByAmountD(HashMap param) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.update("updateUserCashByAmountD", param);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertRvhCallbackLog(RvHoldemVO rvParam) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.insert("insertRvhCallbackLog", rvParam);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertBetLosing(HashMap betData) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.insert("insertBetLosing", betData);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertBetLosingNew(HashMap betData) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.insert("insertBetLosingNew", betData);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertWinLosing(HashMap betData) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.insert("insertWinLosing", betData);
|
||||
}
|
||||
|
||||
}
|
||||
87
src/main/java/com/bb/dao/BoardDao.java
Normal file
87
src/main/java/com/bb/dao/BoardDao.java
Normal file
@@ -0,0 +1,87 @@
|
||||
package com.bb.dao;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
import com.bb.model.AnswerVo;
|
||||
import com.bb.model.Board;
|
||||
import com.bb.model.BoardListSearch;
|
||||
import com.bb.model.Comment;
|
||||
import com.bb.model.Message;
|
||||
import com.bb.model.MessageListSearch;
|
||||
|
||||
public interface BoardDao {
|
||||
|
||||
int getBoardListCnt(@Valid BoardListSearch search);
|
||||
|
||||
List<Board> getBoardList(@Valid BoardListSearch search);
|
||||
|
||||
List<Integer> getBoardIdxList(@Valid BoardListSearch search);
|
||||
|
||||
int saveBoard(@Valid Board board);
|
||||
|
||||
int saveCmt(@Valid Comment comment);
|
||||
|
||||
Board getBoard(@Valid Board board);
|
||||
|
||||
List<HashMap> getCmtList(Map param);
|
||||
|
||||
Comment getComment(@Valid Comment comment);
|
||||
|
||||
void viewAdd(Board boardetail);
|
||||
|
||||
void adminRead(Board boardetail);
|
||||
|
||||
void msgSend(@Valid Message message);
|
||||
|
||||
void msgRead(@Valid Message message);
|
||||
|
||||
void msgUpdate(@Valid Message message);
|
||||
|
||||
int getMsgListCnt(@Valid MessageListSearch search);
|
||||
|
||||
List<Message> getMsgList(@Valid MessageListSearch search);
|
||||
|
||||
void allRead(@Valid Message message);
|
||||
|
||||
void msgDel(@Valid Message message);
|
||||
|
||||
int updateFaqStatus(int boardIdx);
|
||||
|
||||
List<AnswerVo> getAnswerList(AnswerVo search);
|
||||
|
||||
int saveAnswer(AnswerVo answer);
|
||||
int updateAnswer(AnswerVo answer);
|
||||
|
||||
int deleteAnswer(AnswerVo answer);
|
||||
|
||||
List<HashMap<String, String>> getMainBoardList(BoardListSearch search);
|
||||
|
||||
List<HashMap<String, String>> getMainBoardList2(BoardListSearch search);
|
||||
|
||||
void msgDelList(@Valid Message message);
|
||||
|
||||
int getUserMsgListCnt(@Valid MessageListSearch search);
|
||||
|
||||
List<Message> getUserMsgList(@Valid MessageListSearch search);
|
||||
|
||||
void userAnswerCmtRead(Board boardetail);
|
||||
|
||||
void partnerMsgSend(@Valid Message message);
|
||||
|
||||
Message getJoinMessage(String siteId);
|
||||
|
||||
Board getSiteFlowBoard(BoardListSearch search);
|
||||
|
||||
int deleteBoard(int boardIdx);
|
||||
|
||||
void levelMsgSend(@Valid Message message);
|
||||
|
||||
int setBoardViewYn(Board board);
|
||||
|
||||
int deleteYBoard(int boardIdx);
|
||||
|
||||
}
|
||||
242
src/main/java/com/bb/dao/BoardDaoImpl.java
Normal file
242
src/main/java/com/bb/dao/BoardDaoImpl.java
Normal file
@@ -0,0 +1,242 @@
|
||||
package com.bb.dao;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
import org.apache.ibatis.session.SqlSession;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.bb.model.AnswerVo;
|
||||
import com.bb.model.Board;
|
||||
import com.bb.model.BoardListSearch;
|
||||
import com.bb.model.Comment;
|
||||
import com.bb.model.Message;
|
||||
import com.bb.model.MessageListSearch;
|
||||
|
||||
@Repository("boardDao")
|
||||
public class BoardDaoImpl implements BoardDao {
|
||||
|
||||
|
||||
/** 메인DB 연결 */
|
||||
@Autowired @Qualifier("sqlSessionMain")
|
||||
protected SqlSession sqlSession;
|
||||
|
||||
/** 서브DB 연결 */
|
||||
@Autowired @Qualifier("sqlSessionSub")
|
||||
protected SqlSession sqlSessionSub;
|
||||
|
||||
@Override
|
||||
public int getBoardListCnt(@Valid BoardListSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getBoardListCnt", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Board> getBoardList(@Valid BoardListSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getBoardList", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Integer> getBoardIdxList(@Valid BoardListSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getBoardIdxList", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int saveBoard(@Valid Board board) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.insert("saveBoard", board);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int saveCmt(@Valid Comment comment) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.insert("saveCmt", comment);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Board getBoard(@Valid Board board) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getBoard", board);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap> getCmtList(Map param) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getCmtList", param);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Comment getComment(@Valid Comment comment) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getComment", comment);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void viewAdd(Board boardetail) {
|
||||
// TODO Auto-generated method stub
|
||||
sqlSession.update("viewAdd", boardetail);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void adminRead(Board boardetail) {
|
||||
// TODO Auto-generated method stub
|
||||
sqlSession.update("adminRead", boardetail);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void msgSend(@Valid Message message) {
|
||||
// TODO Auto-generated method stub
|
||||
sqlSession.insert("msgSend", message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void msgRead(@Valid Message message) {
|
||||
// TODO Auto-generated method stub
|
||||
sqlSession.insert("msgRead", message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void msgUpdate(@Valid Message message) {
|
||||
// TODO Auto-generated method stub
|
||||
sqlSession.update("msgUpdate", message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMsgListCnt(@Valid MessageListSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getMsgListCnt", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Message> getMsgList(@Valid MessageListSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getMsgList", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void allRead(@Valid Message message) {
|
||||
// TODO Auto-generated method stub
|
||||
sqlSession.insert("allRead", message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void msgDel(@Valid Message message) {
|
||||
// TODO Auto-generated method stub
|
||||
sqlSession.insert("msgDel", message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateFaqStatus(int boardIdx) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.update("updateFaqStatus", boardIdx);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AnswerVo> getAnswerList(AnswerVo search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getAnswerList", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int saveAnswer(AnswerVo answer) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.insert("saveAnswer", answer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateAnswer(AnswerVo answer) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.insert("updateAnswer", answer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteAnswer(AnswerVo answer) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.update("deleteAnswer", answer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap<String, String>> getMainBoardList(BoardListSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getMainBoardList", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap<String, String>> getMainBoardList2(BoardListSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getMainBoardList2", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void msgDelList(@Valid Message message) {
|
||||
// TODO Auto-generated method stub
|
||||
sqlSession.update("msgDelList", message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getUserMsgListCnt(@Valid MessageListSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getUserMsgListCnt", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Message> getUserMsgList(@Valid MessageListSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getUserMsgList", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void userAnswerCmtRead(Board boardetail) {
|
||||
// TODO Auto-generated method stub
|
||||
sqlSession.update("userAnswerCmtRead", boardetail);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void partnerMsgSend(@Valid Message message) {
|
||||
// TODO Auto-generated method stub
|
||||
sqlSession.insert("partnerMsgSend", message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Message getJoinMessage(String siteId) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getJoinMessage", siteId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Board getSiteFlowBoard(BoardListSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getSiteFlowBoard", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteBoard(int boardIdx) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.delete("deleteBoard", boardIdx);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void levelMsgSend(@Valid Message message) {
|
||||
// TODO Auto-generated method stub
|
||||
sqlSession.insert("levelMsgSend", message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int setBoardViewYn(Board board) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.update("setBoardViewYn", board);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteYBoard(int boardIdx) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.update("deleteYBoard", boardIdx);
|
||||
}
|
||||
}
|
||||
97
src/main/java/com/bb/dao/CashDao.java
Normal file
97
src/main/java/com/bb/dao/CashDao.java
Normal file
@@ -0,0 +1,97 @@
|
||||
package com.bb.dao;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.bb.model.AdminCashSearch;
|
||||
import com.bb.model.CashDetail;
|
||||
import com.bb.model.CashQueVO;
|
||||
import com.bb.model.CashSearch;
|
||||
import com.bb.model.CashStatus;
|
||||
import com.bb.model.CashTranLogSrch;
|
||||
import com.bb.model.CouponSearch;
|
||||
import com.bb.model.CouponVO;
|
||||
import com.bb.model.Member;
|
||||
import com.bb.model.MemberSearch;
|
||||
import com.bb.model.Point;
|
||||
import com.bb.model.PointSearch;
|
||||
import com.bb.model.RetailCashSearch;
|
||||
|
||||
public interface CashDao {
|
||||
int insertCash(CashDetail cash);
|
||||
void updateMyCash(CashDetail cash);
|
||||
int getCashListCnt(CashSearch search);
|
||||
List<CashDetail> getCashList(CashSearch search);
|
||||
HashMap getCashListSum(CashSearch search);
|
||||
int updateStatus(CashStatus status);
|
||||
int insertBetPoint(String LOG_PREFIX, HashMap mapParam);
|
||||
HashMap<String, String> getCashInfo(CashStatus status);
|
||||
int updateCiAmt(Map param);
|
||||
int updateCoAmt(Map param);
|
||||
int getCashIOListCnt(CashSearch search);
|
||||
List<HashMap> getCashIOList(CashSearch search);
|
||||
HashMap getCashTotalListCnt(CashSearch search);
|
||||
List<HashMap> getCashTotalList(CashSearch search);
|
||||
int getPointListCnt(PointSearch search);
|
||||
List<HashMap> getPointList(PointSearch search);
|
||||
HashMap getPointSumInfo(PointSearch search);
|
||||
int getPointListNewCnt(PointSearch search);
|
||||
List<HashMap> getPointListNew(PointSearch search);
|
||||
List<HashMap> getPointSum(PointSearch search);
|
||||
long getMemCash(CashDetail cash);
|
||||
HashMap getAccBankInfo(Member search);
|
||||
long pointInsert(Point point);
|
||||
void delCash(CashSearch search);
|
||||
void updateMemPoint(Map param);
|
||||
void updateUserGameMoney(HashMap cashParam);
|
||||
String getCreditCheck(String siteId);
|
||||
|
||||
int getCashSendListCnt(CashSearch search);
|
||||
List<HashMap<String, Object>> getCashSendList(CashSearch search);
|
||||
int getAdminCashIOListCnt(AdminCashSearch search);
|
||||
List<HashMap> getAdminCashIOList(AdminCashSearch search);
|
||||
HashMap getAdminCashIOListSum(AdminCashSearch search);
|
||||
int getAdminPointIOListCnt(AdminCashSearch search);
|
||||
List<HashMap> getAdminPointIOList(AdminCashSearch search);
|
||||
HashMap getAdminPointIOListSum(AdminCashSearch search);
|
||||
int cashTransLogCnt(CashTranLogSrch search);
|
||||
List<HashMap> cashTransLogList(CashTranLogSrch search);
|
||||
int cashTransLogCnt2(CashTranLogSrch search);
|
||||
List<HashMap> cashTransLogList2(CashTranLogSrch search);
|
||||
List<HashMap<String, String>> getMainCashList(CashSearch param);
|
||||
int getCashInCnt(Member search);
|
||||
int getCashOutCnt(Member search);
|
||||
int insertCashInfo(HashMap cashInfoParam);
|
||||
int getCashinfoCnt(CashDetail paramCash);
|
||||
int getCashinfoRetailCnt(CashDetail paramCash);
|
||||
int getUserBalance(Member search);
|
||||
int getPointinfoCnt(Point point);
|
||||
int getBottomCashListCnt(RetailCashSearch search);
|
||||
List<HashMap> getBottomCashList(RetailCashSearch search);
|
||||
int getBottomCashListCnt2(RetailCashSearch search);
|
||||
List<HashMap> getBottomCashList2(RetailCashSearch search);
|
||||
int getMemCashForUpdate(MemberSearch search);
|
||||
HashMap<String, String> getLastCashIn(CashSearch search);
|
||||
HashMap<String, String> getLastCashInToBetSum(HashMap<String, String> param);
|
||||
HashMap<String, String> getLastCashInToBonusPoint(HashMap<String, String> param);
|
||||
Integer getFirstDailyCnt(HashMap pointParam);
|
||||
int getCashWaitTimeCheck(CashDetail paramCash);
|
||||
List<CashQueVO> getCashQueList();
|
||||
long getBalance(CashQueVO item);
|
||||
int updateQueStatus(HashMap<String, Object> param);
|
||||
long cashInsertByCoupon(CashDetail cash);
|
||||
int couponCreate(CouponVO coupon);
|
||||
int updateCouponItem(CouponVO coupon);
|
||||
int checkCouponNumber(String couponNumber);
|
||||
CouponVO getCouponItem(String couponNumber);
|
||||
int getCouponListCnt(CouponSearch search);
|
||||
List<HashMap<String, String>> getCouponList(CouponSearch search);
|
||||
int getMyCouponListCnt(CouponSearch search);
|
||||
List<HashMap<String, String>> getMyCouponList(CouponSearch search);
|
||||
HashMap<String, String> getLastCashInBy24H(CashSearch search);
|
||||
List<HashMap<String, String>> getLastCashInToBetSumBy24H(HashMap<String, String> param);
|
||||
int insertCashBonus(HashMap data);
|
||||
HashMap getCashBonusInfo(long cashIdx);
|
||||
int updateCashBonus(HashMap data);
|
||||
}
|
||||
533
src/main/java/com/bb/dao/CashDaoImpl.java
Normal file
533
src/main/java/com/bb/dao/CashDaoImpl.java
Normal file
@@ -0,0 +1,533 @@
|
||||
package com.bb.dao;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.ibatis.session.SqlSession;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.bb.model.AdminCashSearch;
|
||||
import com.bb.model.CashDetail;
|
||||
import com.bb.model.CashQueVO;
|
||||
import com.bb.model.CashSearch;
|
||||
import com.bb.model.CashStatus;
|
||||
import com.bb.model.CashTranLogSrch;
|
||||
import com.bb.model.CouponSearch;
|
||||
import com.bb.model.CouponVO;
|
||||
import com.bb.model.Member;
|
||||
import com.bb.model.MemberSearch;
|
||||
import com.bb.model.Point;
|
||||
import com.bb.model.PointSearch;
|
||||
import com.bb.model.RetailCashSearch;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@Slf4j
|
||||
@Repository("CashDao")
|
||||
public class CashDaoImpl implements CashDao {
|
||||
|
||||
/** 메인DB 연결 */
|
||||
@Autowired @Qualifier("sqlSessionMain")
|
||||
protected SqlSession sqlSession;
|
||||
|
||||
/** 서브DB 연결 */
|
||||
@Autowired @Qualifier("sqlSessionSub")
|
||||
protected SqlSession sqlSessionSub;
|
||||
|
||||
|
||||
@Override
|
||||
public int insertCash(CashDetail cash) {
|
||||
return sqlSession.insert("insertCash", cash);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateMyCash(CashDetail cash) {
|
||||
// TODO Auto-generated method stub
|
||||
sqlSession.update("updateMyCash", cash);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCashListCnt(CashSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getCashListCnt", search);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<CashDetail> getCashList(CashSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getCashList", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HashMap getCashListSum(CashSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getCashListSum", search);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int updateStatus(CashStatus status) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.update("cashUpdateStatus", status);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int insertBetPoint(String LOG_PREFIX, HashMap mapParam) {
|
||||
int pointResult = 0;
|
||||
|
||||
int betRate = (int) mapParam.get("betRate");
|
||||
String gameCategory = mapParam.get("gameCategory").toString();
|
||||
String vendorCode = mapParam.get("vendorCode").toString();
|
||||
String isBlankSpinYn = mapParam.get("isBlankSpinYn").toString();
|
||||
|
||||
if(isBlankSpinYn.equals("N")) {
|
||||
if(vendorCode.equals("33") || vendorCode.equals("powerball")) {
|
||||
// "하이로우" 멀티 롤링요율 처리
|
||||
pointResult = sqlSession.insert("insertMultiBetPoint", mapParam);
|
||||
log.debug("pointProc::SUCC::pointMultiResult::[" + pointResult + "]::betRate::[" + betRate + "]");
|
||||
} else {
|
||||
if((gameCategory.equals("casino") && betRate >= 12)) {
|
||||
log.info("pointProc::NONE::[betIdx::"+mapParam.get("betIdx")+"]::betRate::[" + betRate + "]");
|
||||
} else {
|
||||
// Slot
|
||||
// Sport
|
||||
// Minigame ("하이로우" 멀티 롤링요율 제외)
|
||||
// Casino AND betRate < 12
|
||||
pointResult = sqlSession.insert("insertBetPoint", mapParam);
|
||||
log.debug("pointProc::SUCC::[betIdx::"+mapParam.get("betIdx")+"]::pointResult::[" + pointResult + "]::betRate::[" + betRate + "]");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
int betResult = sqlSession.update("updatePointRegY", mapParam);
|
||||
log.debug(LOG_PREFIX+ "updatePointRegY::Result::" + betResult);
|
||||
|
||||
return pointResult;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public HashMap<String, String> getCashInfo(CashStatus status) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.selectOne("getCashInfo", status);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int updateCiAmt(Map param) {
|
||||
return sqlSession.update("updateCiAmt", param);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int updateCoAmt(Map param) {
|
||||
return sqlSession.update("updateCoAmt", param);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getCashIOListCnt(CashSearch search) {
|
||||
return sqlSessionSub.selectOne("getCashIOListCnt", search);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<HashMap> getCashIOList(CashSearch search) {
|
||||
return sqlSessionSub.selectList("getCashIOList", search);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public HashMap getCashTotalListCnt(CashSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getCashTotalListCnt", search);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<HashMap> getCashTotalList(CashSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getCashTotalList", search);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getPointListCnt(PointSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getPointListCnt", search);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<HashMap> getPointList(PointSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getPointList", search);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public HashMap getPointSumInfo(PointSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getPointSumInfo", search);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getPointListNewCnt(PointSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getPointListNewCnt", search);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<HashMap> getPointListNew(PointSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getPointListNew", search);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<HashMap> getPointSum(PointSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getPointSum", search);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public long getMemCash(CashDetail cash) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.selectOne("getMemCash", cash);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public HashMap getAccBankInfo(Member search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getAccBankInfo", search);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public long pointInsert(Point point) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.insert("pointInsert", point);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void delCash(CashSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
sqlSession.update("delCash", search);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void updateMemPoint(Map param) {
|
||||
// TODO Auto-generated method stub
|
||||
sqlSession.update("updateMemPoint", param);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void updateUserGameMoney(HashMap cashParam) {
|
||||
// TODO Auto-generated method stub
|
||||
sqlSession.update("updateUserGameMoney", cashParam);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getCreditCheck(String siteId) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.selectOne("getCreditCheck", siteId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCashSendListCnt(CashSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getCashSendListCnt", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap<String, Object>> getCashSendList(CashSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getCashSendList", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getAdminCashIOListCnt(AdminCashSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getAdminCashIOListCnt", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap> getAdminCashIOList(AdminCashSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getAdminCashIOList", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HashMap getAdminCashIOListSum(AdminCashSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getAdminCashIOListSum", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getAdminPointIOListCnt(AdminCashSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getAdminPointIOListCnt", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap> getAdminPointIOList(AdminCashSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getAdminPointIOList", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HashMap getAdminPointIOListSum(AdminCashSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getAdminPointIOListSum", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int cashTransLogCnt(CashTranLogSrch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("cashTransLogCnt", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap> cashTransLogList(CashTranLogSrch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("cashTransLogList", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int cashTransLogCnt2(CashTranLogSrch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("cashTransLogCnt2", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap> cashTransLogList2(CashTranLogSrch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("cashTransLogList2", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap<String, String>> getMainCashList(CashSearch param) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getMainCashList", param);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCashInCnt(Member search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.selectOne("getCashInCnt", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCashOutCnt(Member search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.selectOne("getCashOutCnt", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertCashInfo(HashMap cashInfoParam) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.insert("insertCashInfo", cashInfoParam);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCashinfoCnt(CashDetail paramCash) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.selectOne("getCashinfoCnt", paramCash);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCashinfoRetailCnt(CashDetail paramCash) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.selectOne("getCashinfoRetailCnt", paramCash);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getUserBalance(Member search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.selectOne("getUserBalance", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPointinfoCnt(Point point) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.selectOne("getPointinfoCnt", point);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getBottomCashListCnt(RetailCashSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getBottomCashListCnt", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap> getBottomCashList(RetailCashSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getBottomCashList", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getBottomCashListCnt2(RetailCashSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getBottomCashListCnt2", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap> getBottomCashList2(RetailCashSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getBottomCashList2", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMemCashForUpdate(MemberSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.selectOne("getMemCashForUpdate", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HashMap<String, String> getLastCashIn(CashSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getLastCashIn", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HashMap<String, String> getLastCashInToBetSum(HashMap<String, String> param) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getLastCashInToBetSum", param);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HashMap<String, String> getLastCashInToBonusPoint(HashMap<String, String> param) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getLastCashInToBonusPoint", param);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getFirstDailyCnt(HashMap pointParam) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.selectOne("getFirstDailyCnt", pointParam);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCashWaitTimeCheck(CashDetail paramCash) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.selectOne("getCashWaitTimeCheck", paramCash);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CashQueVO> getCashQueList() {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.selectList("getCashQueList");
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getBalance(CashQueVO item) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.selectOne("getBalance", item);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateQueStatus(HashMap<String, Object> param) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.update("updateQueStatus", param);
|
||||
}
|
||||
|
||||
@Override
|
||||
public long cashInsertByCoupon(CashDetail cash) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.insert("cashInsertByCoupon", cash);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int couponCreate(CouponVO couponVO) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.insert("couponCreate", couponVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateCouponItem(CouponVO couponVO) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.update("updateCouponItem", couponVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int checkCouponNumber(String couponNumber) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.selectOne("checkCouponNumber", couponNumber);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CouponVO getCouponItem(String couponNumber) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.selectOne("getCouponItem", couponNumber);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCouponListCnt(CouponSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getCouponListCnt", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap<String, String>> getCouponList(CouponSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getCouponList", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMyCouponListCnt(CouponSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getMyCouponListCnt", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap<String, String>> getMyCouponList(CouponSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getMyCouponList", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HashMap<String, String> getLastCashInBy24H(CashSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getLastCashInBy24H", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap<String, String>> getLastCashInToBetSumBy24H(HashMap<String, String> param) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getLastCashInToBetSumBy24H", param);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertCashBonus(HashMap data) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.insert("insertCashBonus", data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HashMap getCashBonusInfo(long cashIdx) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getCashBonusInfo", cashIdx);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateCashBonus(HashMap data) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.insert("updateCashBonus", data);
|
||||
}
|
||||
}
|
||||
275
src/main/java/com/bb/dao/CommonDao.java
Normal file
275
src/main/java/com/bb/dao/CommonDao.java
Normal file
@@ -0,0 +1,275 @@
|
||||
package com.bb.dao;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.bb.model.Admin;
|
||||
import com.bb.model.AdminIp;
|
||||
import com.bb.model.AdminLogSearch;
|
||||
import com.bb.model.AdminSearch;
|
||||
import com.bb.model.Bank;
|
||||
import com.bb.model.Banner;
|
||||
import com.bb.model.Block;
|
||||
import com.bb.model.BlockSearch;
|
||||
import com.bb.model.ChargingPointSettingVO;
|
||||
import com.bb.model.Code;
|
||||
import com.bb.model.CodeSearch;
|
||||
import com.bb.model.CronServerInfo;
|
||||
import com.bb.model.DomainPartnerVO;
|
||||
import com.bb.model.GameCodeSearchVO;
|
||||
import com.bb.model.GameCodeVO;
|
||||
import com.bb.model.GameSetting;
|
||||
import com.bb.model.GameSettingItem;
|
||||
import com.bb.model.LevelBank;
|
||||
import com.bb.model.LevelBetLimit;
|
||||
import com.bb.model.LevelDomain;
|
||||
import com.bb.model.LevelFailPoint;
|
||||
import com.bb.model.LevelOutPwd;
|
||||
import com.bb.model.Member;
|
||||
import com.bb.model.MenuVO;
|
||||
import com.bb.model.NotiBgmVo;
|
||||
import com.bb.model.SiteCashBonusSettingVO;
|
||||
import com.bb.model.SiteCheckReq;
|
||||
import com.bb.model.SiteOption;
|
||||
import com.bb.model.SiteSearch;
|
||||
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
public interface CommonDao {
|
||||
|
||||
List<HashMap> getCodeList(CodeSearch codesSearch);
|
||||
|
||||
HashMap getCode(CodeSearch codesSearch);
|
||||
|
||||
int getDupRepotCheck();
|
||||
|
||||
List<HashMap> getDailyList(String cmd);
|
||||
|
||||
int updateReport(HashMap report);
|
||||
|
||||
int updateReport2();
|
||||
|
||||
int insertReport(HashMap report);
|
||||
|
||||
int insertReport2();
|
||||
|
||||
List<HashMap> getDailyListYday();
|
||||
|
||||
int updateReportYday1(HashMap report);
|
||||
|
||||
int updateReportYday2();
|
||||
|
||||
int updateReportYday3();
|
||||
|
||||
// void updateReport(HashMap<String, String> setTime);
|
||||
|
||||
// void insertReport(HashMap<String, String> setTime);
|
||||
|
||||
HashMap getSiteOption(String siteId);
|
||||
|
||||
void insertlog(Map logParam);
|
||||
|
||||
void updateMemLogin(Map logParam);
|
||||
|
||||
List<HashMap> getlastLoginToken();
|
||||
|
||||
void updatelog(Map logParam);
|
||||
|
||||
int optionSave(SiteOption option);
|
||||
|
||||
SiteOption getSiteSetting(SiteSearch search);
|
||||
|
||||
HashMap getSiteAccoucnt(SiteSearch search);
|
||||
|
||||
void bankSave(Bank bank);
|
||||
|
||||
List<Bank> getAdminBankList(SiteSearch search);
|
||||
|
||||
List<Bank> getBankList(SiteSearch search);
|
||||
|
||||
void bannerSave(Banner banner);
|
||||
|
||||
List<Banner> getBannerList(SiteSearch search);
|
||||
|
||||
void insertCode(@Valid Code code);
|
||||
|
||||
List<HashMap> getLbList(SiteSearch search);
|
||||
|
||||
void accountSave(LevelBank levelBank);
|
||||
|
||||
List<LevelBetLimit> getLbetLimitList(SiteSearch search);
|
||||
|
||||
void setLbetLimitList(LevelBetLimit betLimit);
|
||||
|
||||
List<HashMap> getFailPointList(SiteSearch search);
|
||||
|
||||
void failPointSave(LevelFailPoint failPoint);
|
||||
|
||||
List<HashMap> getDomainList(SiteSearch search);
|
||||
|
||||
void domainSave(LevelDomain domain);
|
||||
|
||||
List<HashMap> getOutPwdList(SiteSearch search);
|
||||
|
||||
void outPwdSave(LevelOutPwd outPwd);
|
||||
|
||||
int getAdminLogListCnt(@Valid AdminLogSearch search);
|
||||
|
||||
List<HashMap> getAdminLogList(@Valid AdminLogSearch search);
|
||||
|
||||
void insertAdminlog(Map logParam);
|
||||
|
||||
int getSiteBlockListCnt(@Valid BlockSearch search);
|
||||
|
||||
List<HashMap> getSiteBlockList(@Valid BlockSearch search);
|
||||
|
||||
void blockSave(@Valid Block block);
|
||||
|
||||
int getSiteAdminListCnt(@Valid AdminSearch search);
|
||||
|
||||
List<HashMap> getSiteAdminList(@Valid AdminSearch search);
|
||||
|
||||
void adminSave(Admin admin);
|
||||
|
||||
void adminDelete(Admin admin);
|
||||
|
||||
int getSiteAdminIpListCnt(@Valid AdminSearch search);
|
||||
|
||||
List<HashMap> getSiteAdminIpList(@Valid AdminSearch search);
|
||||
|
||||
void adminIpSave(AdminIp adminIp);
|
||||
|
||||
void adminIpDelete(AdminIp adminIp);
|
||||
|
||||
void updateIpInfo(Map ipParam);
|
||||
|
||||
List<HashMap> getLoginSite();
|
||||
|
||||
int gameSettingSave(List<GameSettingItem> settingList);
|
||||
|
||||
List<HashMap> gameSettingList(GameSetting searchSetting);
|
||||
|
||||
int siteCheckSave(SiteCheckReq siteCheckReq);
|
||||
|
||||
List<HashMap> isSiteCheck();
|
||||
|
||||
void changeSiteCheckOff(SiteCheckReq param);
|
||||
|
||||
void changeSiteSettingCheckYn(SiteCheckReq param);
|
||||
|
||||
List<HashMap> siteCheckList(SiteCheckReq param);
|
||||
|
||||
HashMap siteCheckDetail(SiteCheckReq param);
|
||||
|
||||
HashMap siteCheckInfo(SiteCheckReq param);
|
||||
|
||||
List<HashMap<String, String>> getGameCodeTabList(GameCodeSearchVO searchVO);
|
||||
|
||||
List<HashMap<String, String>> getGameCodeColList(GameCodeSearchVO searchVO);
|
||||
|
||||
List<HashMap<String, String>> getGameCodeList(GameCodeSearchVO searchVO);
|
||||
|
||||
int gameCodeRegist(GameCodeVO gameCodeVO);
|
||||
|
||||
int gameCodeUpdate(GameCodeVO gameCodeVO);
|
||||
|
||||
int gameCodeAddMemRate(GameCodeVO gameCodeVO);
|
||||
|
||||
int gameCodeAddSiteGameSetting(GameCodeVO gameCodeVO);
|
||||
|
||||
List<Banner> getPopupList(SiteSearch search);
|
||||
|
||||
List<Banner> getBannerInfoList(SiteSearch search);
|
||||
|
||||
List<Banner> getLoginPopupList(SiteSearch paramSite);
|
||||
|
||||
List<HashMap> getGameCodes(CodeSearch codesSearch);
|
||||
|
||||
String getApiVendor(CodeSearch codeSearch);
|
||||
|
||||
List<MenuVO> getMenuList(HashMap<String, String> param);
|
||||
|
||||
List<String> getVendorList();
|
||||
|
||||
List<HashMap> getGameGroupCodes(String siteId);
|
||||
|
||||
List<HashMap> getGameCodesForSuper(CodeSearch codesSearch);
|
||||
|
||||
List<HashMap> getGameGroupCodesForSuper(String siteId);
|
||||
|
||||
CronServerInfo getServerCronStatus(CronServerInfo cronStatus);
|
||||
|
||||
List<HashMap<String, Object>> getDomainPartnerList(DomainPartnerVO domainPartnerVO);
|
||||
|
||||
int domainPartnerSave(DomainPartnerVO domainPartnerVO);
|
||||
|
||||
int domainPartnerDelete(DomainPartnerVO domainPartnerVO);
|
||||
|
||||
String getJoinRecommanderId(SiteSearch paramSite);
|
||||
|
||||
HashMap getSessionTransactionIsolation();
|
||||
|
||||
HashMap<String, String> getDailyTime();
|
||||
|
||||
void updateDailyTime(HashMap<String, String> setTime);
|
||||
|
||||
List<HashMap> getChargingPointSettingList(int siteIdx);
|
||||
|
||||
ChargingPointSettingVO getChargingPointSetting(ChargingPointSettingVO param);
|
||||
|
||||
int memChargingPointSettingSave(ChargingPointSettingVO settingVO);
|
||||
|
||||
int siteChargingPointSettingSave(ChargingPointSettingVO settingVO);
|
||||
|
||||
String getJackpot(HashMap params);
|
||||
|
||||
HashMap getCodeBySite(CodeSearch codeSrch);
|
||||
|
||||
int getSiteLogoutTimeLimit(String siteId);
|
||||
|
||||
List<HashMap> getRateCategory(String siteId);
|
||||
|
||||
HashMap<String, String> getUserInfoByToken(String token);
|
||||
|
||||
HashMap<String, String> getAdminInfoByToken(String token);
|
||||
|
||||
List<MenuVO> getMenuBookmarkList(HashMap<String, String> param);
|
||||
|
||||
HashMap<String, String> getSiteMemo(String siteId);
|
||||
|
||||
int updateBookmarkMenu(MenuVO param);
|
||||
|
||||
int updateSiteMemo(HashMap<String, String> param);
|
||||
|
||||
int getSiteCheckCount(SiteCheckReq siteCheckReq);
|
||||
|
||||
void updateDayCashInDate(HashMap dailyParam);
|
||||
|
||||
List<HashMap> getMonthList();
|
||||
|
||||
int insertMonthReport(HashMap report);
|
||||
|
||||
void updateAcctionLog(Map logParam);
|
||||
|
||||
List<HashMap> getRollingList(String days);
|
||||
|
||||
int insertRollingReport(HashMap report);
|
||||
|
||||
HashMap<String, String> getVassApiInfo(Member search);
|
||||
|
||||
List<NotiBgmVo> getNotiBgmList(SiteSearch search);
|
||||
|
||||
int setNotiBgmSave(NotiBgmVo notiBgmVo);
|
||||
|
||||
List<HashMap> getDailyAutoLevelUpList();
|
||||
|
||||
int updateAutoLevelUp(HashMap user);
|
||||
|
||||
List<SiteCashBonusSettingVO> getSiteCashBonusSettingList(Integer siteIdx);
|
||||
|
||||
int setSiteCashBonusSettingSave(SiteCashBonusSettingVO settingVO);
|
||||
|
||||
int bankDelete(Bank bank);
|
||||
|
||||
}
|
||||
758
src/main/java/com/bb/dao/CommonDaoImpl.java
Normal file
758
src/main/java/com/bb/dao/CommonDaoImpl.java
Normal file
@@ -0,0 +1,758 @@
|
||||
package com.bb.dao;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.ibatis.session.SqlSession;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.bb.model.Admin;
|
||||
import com.bb.model.AdminIp;
|
||||
import com.bb.model.AdminLogSearch;
|
||||
import com.bb.model.AdminSearch;
|
||||
import com.bb.model.Bank;
|
||||
import com.bb.model.Banner;
|
||||
import com.bb.model.Block;
|
||||
import com.bb.model.BlockSearch;
|
||||
import com.bb.model.ChargingPointSettingVO;
|
||||
import com.bb.model.Code;
|
||||
import com.bb.model.CodeSearch;
|
||||
import com.bb.model.CronServerInfo;
|
||||
import com.bb.model.DomainPartnerVO;
|
||||
import com.bb.model.GameCodeSearchVO;
|
||||
import com.bb.model.GameCodeVO;
|
||||
import com.bb.model.GameSetting;
|
||||
import com.bb.model.GameSettingItem;
|
||||
import com.bb.model.LevelBank;
|
||||
import com.bb.model.LevelBetLimit;
|
||||
import com.bb.model.LevelDomain;
|
||||
import com.bb.model.LevelFailPoint;
|
||||
import com.bb.model.LevelOutPwd;
|
||||
import com.bb.model.Member;
|
||||
import com.bb.model.MenuVO;
|
||||
import com.bb.model.NotiBgmVo;
|
||||
import com.bb.model.SiteCashBonusSettingVO;
|
||||
import com.bb.model.SiteCheckReq;
|
||||
import com.bb.model.SiteOption;
|
||||
import com.bb.model.SiteSearch;
|
||||
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
|
||||
@Repository("commonDao")
|
||||
public class CommonDaoImpl implements CommonDao {
|
||||
|
||||
|
||||
/** 메인DB 연결 */
|
||||
@Autowired @Qualifier("sqlSessionMain")
|
||||
protected SqlSession sqlSession;
|
||||
|
||||
/** 서브DB 연결 */
|
||||
@Autowired @Qualifier("sqlSessionSub")
|
||||
protected SqlSession sqlSessionSub;
|
||||
|
||||
@Override
|
||||
public List<HashMap> getCodeList(CodeSearch codesSearch) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getCodeList", codesSearch);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HashMap getCode(CodeSearch codesSearch) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.selectOne("getCode", codesSearch);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDupRepotCheck() {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getDupRepotCheck");
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap> getDailyList(String cmd) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getDailyList", cmd);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateReport(HashMap report) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.update("updateReport", report);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateReport2() {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.update("updateReport2");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertReport(HashMap report) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.insert("insertReport", report);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertReport2() {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.insert("insertReport2");
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap> getDailyListYday() {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getDailyListYday");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateReportYday1(HashMap report) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.update("updateReportYday1", report);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateReportYday2() {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.update("updateReportYday2");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateReportYday3() {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.update("updateReportYday3");
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public void updateReport(HashMap<String, String> setTime) {
|
||||
// // TODO Auto-generated method stub
|
||||
// sqlSession.update("updateReport", setTime);
|
||||
// }
|
||||
|
||||
// @Override
|
||||
// public void insertReport(HashMap<String, String> setTime) {
|
||||
// // TODO Auto-generated method stub
|
||||
// sqlSession.insert("insertReport", setTime);
|
||||
// }
|
||||
|
||||
@Override
|
||||
public HashMap getSiteOption(String siteId) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getSiteOption", siteId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void insertlog(Map logParam) {
|
||||
// TODO Auto-generated method stub
|
||||
sqlSession.insert("insertlog", logParam);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateMemLogin(Map logParam) {
|
||||
// TODO Auto-generated method stub
|
||||
sqlSession.update("updateMemLogin", logParam);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap> getlastLoginToken() {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getlastLoginToken");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updatelog(Map logParam) {
|
||||
// TODO Auto-generated method stub
|
||||
sqlSession.update("updatelog", logParam);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int optionSave(SiteOption option) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.insert("optionSave", option);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SiteOption getSiteSetting(SiteSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getSiteSetting", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HashMap getSiteAccoucnt(SiteSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getSiteAccoucnt", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bankSave(Bank bank) {
|
||||
// TODO Auto-generated method stub
|
||||
sqlSession.insert("bankSave", bank);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Bank> getAdminBankList(SiteSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getAdminBankList", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Bank> getBankList(SiteSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getBankList", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bannerSave(Banner banner) {
|
||||
// TODO Auto-generated method stub
|
||||
sqlSession.insert("bannerSave", banner);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Banner> getBannerList(SiteSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getBannerList", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void insertCode(@Valid Code code) {
|
||||
// TODO Auto-generated method stub
|
||||
sqlSession.insert("insertCode", code);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap> getLbList(SiteSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getLbList", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void accountSave(LevelBank levelBank) {
|
||||
// TODO Auto-generated method stub
|
||||
sqlSession.insert("accountSave", levelBank);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<LevelBetLimit> getLbetLimitList(SiteSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getLbetLimitList", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLbetLimitList(LevelBetLimit betLimit) {
|
||||
// TODO Auto-generated method stub
|
||||
sqlSession.update("setLbetLimitList", betLimit);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap> getFailPointList(SiteSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getFailPointList", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void failPointSave(LevelFailPoint failPoint) {
|
||||
// TODO Auto-generated method stub
|
||||
sqlSession.insert("failPointSave", failPoint);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap> getDomainList(SiteSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getDomainList", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void domainSave(LevelDomain domain) {
|
||||
// TODO Auto-generated method stub
|
||||
sqlSession.insert("domainSave", domain);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap> getOutPwdList(SiteSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getOutPwdList", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void outPwdSave(LevelOutPwd outPwd) {
|
||||
// TODO Auto-generated method stub
|
||||
sqlSession.insert("outPwdSave", outPwd);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getAdminLogListCnt(@Valid AdminLogSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getAdminLogListCnt", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap> getAdminLogList(@Valid AdminLogSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getAdminLogList", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void insertAdminlog(Map logParam) {
|
||||
// TODO Auto-generated method stub
|
||||
sqlSession.insert("insertAdminlog", logParam);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSiteBlockListCnt(@Valid BlockSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getSiteBlockListCnt", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap> getSiteBlockList(@Valid BlockSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getSiteBlockList", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void blockSave(@Valid Block block) {
|
||||
// TODO Auto-generated method stub
|
||||
sqlSession.insert("blockSave", block);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSiteAdminListCnt(@Valid AdminSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getSiteAdminListCnt", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap> getSiteAdminList(@Valid AdminSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getSiteAdminList", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void adminSave(Admin admin) {
|
||||
// TODO Auto-generated method stub
|
||||
sqlSession.insert("adminSave", admin);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void adminDelete(Admin admin) {
|
||||
// TODO Auto-generated method stub
|
||||
sqlSession.delete("adminDelete", admin);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSiteAdminIpListCnt(@Valid AdminSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getSiteAdminIpListCnt", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap> getSiteAdminIpList(@Valid AdminSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getSiteAdminIpList", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void adminIpSave(AdminIp adminIp) {
|
||||
// TODO Auto-generated method stub
|
||||
sqlSession.insert("adminIpSave", adminIp);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void adminIpDelete(AdminIp adminIp) {
|
||||
// TODO Auto-generated method stub
|
||||
sqlSession.insert("adminIpDelete", adminIp);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateIpInfo(Map ipParam) {
|
||||
// TODO Auto-generated method stub
|
||||
sqlSession.update("updateIpInfo", ipParam);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap> getLoginSite() {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getLoginSite", null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int gameSettingSave(List<GameSettingItem> settingList) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.insert("gameSettingSave", settingList);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap> gameSettingList(GameSetting searchSetting) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("gameSettingList", searchSetting);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int siteCheckSave(SiteCheckReq siteCheckReq) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.insert("siteCheckSave", siteCheckReq);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap> isSiteCheck() {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("isSiteCheck");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void changeSiteCheckOff(SiteCheckReq param) {
|
||||
// TODO Auto-generated method stub
|
||||
sqlSession.update("changeSiteCheckOff", param);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void changeSiteSettingCheckYn(SiteCheckReq param) {
|
||||
// TODO Auto-generated method stub
|
||||
sqlSession.update("changeSiteSettingCheckYn", param);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap> siteCheckList(SiteCheckReq param) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("siteCheckList", param);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HashMap siteCheckDetail(SiteCheckReq param) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("siteCheckDetail", param);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HashMap siteCheckInfo(SiteCheckReq param) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("siteCheckInfo", param);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap<String, String>> getGameCodeTabList(GameCodeSearchVO searchVO) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getGameCodeTabList", searchVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap<String, String>> getGameCodeColList(GameCodeSearchVO searchVO) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getGameCodeColList", searchVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap<String, String>> getGameCodeList(GameCodeSearchVO searchVO) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getGameCodeList", searchVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int gameCodeRegist(GameCodeVO gameCodeVO) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.insert("gameCodeRegist", gameCodeVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int gameCodeUpdate(GameCodeVO gameCodeVO) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.update("gameCodeUpdate", gameCodeVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int gameCodeAddMemRate(GameCodeVO gameCodeVO) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.insert("gameCodeAddMemRate", gameCodeVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int gameCodeAddSiteGameSetting(GameCodeVO gameCodeVO) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.insert("gameCodeAddSiteGameSetting", gameCodeVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Banner> getPopupList(SiteSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getPopupList", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Banner> getBannerInfoList(SiteSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getBannerInfoList", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Banner> getLoginPopupList(SiteSearch paramSite) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getLoginPopupList", paramSite);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap> getGameCodes(CodeSearch codesSearch) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getGameCodes", codesSearch);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap> getGameGroupCodes(String siteId) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getGameGroupCodes", siteId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getApiVendor(CodeSearch codeSearch) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getApiVendor", codeSearch);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MenuVO> getMenuList(HashMap<String, String> param) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getMenuList", param);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getVendorList() {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getVendorList");
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap> getGameCodesForSuper(CodeSearch codesSearch) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getGameCodesForSuper", codesSearch);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap> getGameGroupCodesForSuper(String siteId) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getGameGroupCodesForSuper", siteId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CronServerInfo getServerCronStatus(CronServerInfo cronStatus) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.selectOne("getServerCronStatus", cronStatus);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap<String, Object>> getDomainPartnerList(DomainPartnerVO domainPartnerVO) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getDomainPartnerList", domainPartnerVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int domainPartnerSave(DomainPartnerVO domainPartnerVO) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.insert("domainPartnerSave", domainPartnerVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int domainPartnerDelete(DomainPartnerVO domainPartnerVO) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.delete("domainPartnerDelete", domainPartnerVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getJoinRecommanderId(SiteSearch paramSite) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getJoinRecommanderId", paramSite);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HashMap getSessionTransactionIsolation() {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.selectOne("getSessionTransactionIsolation");
|
||||
}
|
||||
|
||||
@Override
|
||||
public HashMap<String, String> getDailyTime() {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.selectOne("getDailyTime");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateDailyTime(HashMap<String, String> setTime) {
|
||||
// TODO Auto-generated method stub
|
||||
sqlSession.update("updateDailyTime", setTime);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap> getChargingPointSettingList(int siteIdx) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getChargingPointSettingList", siteIdx);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ChargingPointSettingVO getChargingPointSetting(ChargingPointSettingVO param) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getChargingPointSetting", param);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int memChargingPointSettingSave(ChargingPointSettingVO settingVO) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.update("memChargingPointSettingSave", settingVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int siteChargingPointSettingSave(ChargingPointSettingVO settingVO) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.update("siteChargingPointSettingSave", settingVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getJackpot(HashMap params) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.selectOne("getJackpot", params);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HashMap getCodeBySite(CodeSearch codeSrch) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.selectOne("getCodeBySite", codeSrch);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSiteLogoutTimeLimit(String siteId) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getSiteLogoutTimeLimit", siteId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap> getRateCategory(String siteId) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getRateCategory", siteId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HashMap<String, String> getUserInfoByToken(String token) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.selectOne("getUserInfoByToken", token);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HashMap<String, String> getAdminInfoByToken(String token) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.selectOne("getAdminInfoByToken", token);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MenuVO> getMenuBookmarkList(HashMap<String, String> param) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getMenuBookmarkList", param);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateBookmarkMenu(MenuVO param) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.update("updateBookmarkMenu", param);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HashMap<String, String> getSiteMemo(String siteId) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getSiteMemo", siteId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateSiteMemo(HashMap<String, String> param) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.update("updateSiteMemo", param);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSiteCheckCount(SiteCheckReq siteCheckReq) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getSiteCheckCount", siteCheckReq);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateDayCashInDate(HashMap dailyParam) {
|
||||
// TODO Auto-generated method stub
|
||||
sqlSession.update("updateDayCashInDate", dailyParam);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap> getMonthList() {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getMonthList");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertMonthReport(HashMap report) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.insert("insertMonthReport", report);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateAcctionLog(Map logParam) {
|
||||
// TODO Auto-generated method stub
|
||||
sqlSession.update("updateAcctionLog", logParam);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap> getRollingList(String days) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getRollingList", days);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertRollingReport(HashMap report) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.insert("insertRollingReport", report);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HashMap<String, String> getVassApiInfo(Member search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getVassApiInfo", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<NotiBgmVo> getNotiBgmList(SiteSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getNotiBgmList", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int setNotiBgmSave(NotiBgmVo notiBgmVo) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.insert("setNotiBgmSave", notiBgmVo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap> getDailyAutoLevelUpList() {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getDailyAutoLevelUpList");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateAutoLevelUp(HashMap user) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.update("updateAutoLevelUp", user);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SiteCashBonusSettingVO> getSiteCashBonusSettingList(Integer siteIdx) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getSiteCashBonusSettingList", siteIdx);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int setSiteCashBonusSettingSave(SiteCashBonusSettingVO settingVO) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.update("setSiteCashBonusSettingSave", settingVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int bankDelete(Bank bank) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.delete("bankDelete", bank);
|
||||
}
|
||||
}
|
||||
126
src/main/java/com/bb/dao/CompDao.java
Normal file
126
src/main/java/com/bb/dao/CompDao.java
Normal file
@@ -0,0 +1,126 @@
|
||||
package com.bb.dao;
|
||||
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
import com.bb.model.BiSubPointRateVo;
|
||||
import com.bb.model.CompDetail;
|
||||
import com.bb.model.CompResetInfo;
|
||||
import com.bb.model.CompSearch;
|
||||
import com.bb.model.GameSettingInfo;
|
||||
import com.bb.model.Member;
|
||||
import com.bb.model.MemberListSearch;
|
||||
import com.bb.model.MenuVO;
|
||||
import com.bb.model.OTPInfo;
|
||||
import com.bb.model.PartnerCompInfo;
|
||||
import com.bb.model.Site;
|
||||
import com.bb.model.SiteOption;
|
||||
import com.bb.model.SiteSearch;
|
||||
import com.bb.model.TripleGameRate;
|
||||
|
||||
public interface CompDao {
|
||||
|
||||
int getPartnerCompListCnt(@Valid MemberListSearch search);
|
||||
|
||||
List<CompDetail> getPartnerCompList(@Valid MemberListSearch search);
|
||||
|
||||
CompDetail getPartnerComp(Site search);
|
||||
|
||||
HashMap getPartnerCompDetail(Member search);
|
||||
|
||||
int modifySiteGameSetting(BiSubPointRateVo biSubPointRateVo);
|
||||
|
||||
int modifyCreditSettings(PartnerCompInfo compInfo);
|
||||
|
||||
int modifyCreditRates(HashMap param);
|
||||
|
||||
int modifySiteSettings(SiteOption siteOption);
|
||||
|
||||
int getCheckTopComp(PartnerCompInfo compInfo);
|
||||
|
||||
int modifyCompInfo(PartnerCompInfo compInfo);
|
||||
|
||||
HashMap getCompInfoForDetail(SiteSearch search);
|
||||
|
||||
HashMap getSettingInfoForDetail(SiteSearch search);
|
||||
|
||||
HashMap getCompStatsForDetail(SiteSearch search);
|
||||
|
||||
List<HashMap> getTopCompListForDetail(SiteSearch search);
|
||||
|
||||
List<HashMap> getBotCompListForDetail(SiteSearch search);
|
||||
|
||||
int modifySiteGameSettingForSuper(GameSettingInfo item);
|
||||
|
||||
int modifyMenuSettings(MenuVO item);
|
||||
|
||||
List<HashMap> getCompanyRate(Member search);
|
||||
|
||||
List<HashMap<String, String>> getGameRateCompList(TripleGameRate gameRateVO);
|
||||
|
||||
int updateCompGameRate(HashMap<String, String> compGameRateInfo);
|
||||
|
||||
HashMap<String, String> getTripleParam(CompSearch search);
|
||||
|
||||
List<HashMap<String, String>> getTripleGameRate(HashMap<String, String> tripleParam);
|
||||
|
||||
int insertTripleRate(HashMap<String, String> tripleRate);
|
||||
|
||||
List<HashMap<String, String>> getOmsRateListByTripleGame(CompSearch search);
|
||||
|
||||
int updateOmsRateList(CompSearch search);
|
||||
|
||||
int resetDelete(CompResetInfo compResetInfo);
|
||||
|
||||
int resetUpdate(CompResetInfo compResetInfo);
|
||||
|
||||
int getResetMemIdCount(CompResetInfo compResetInfo);
|
||||
|
||||
int updateApiSetting(PartnerCompInfo compInfo);
|
||||
|
||||
List<HashMap<String, String>> getCompIdList(SiteSearch search);
|
||||
|
||||
List<HashMap> getSiteGameInfo(SiteSearch search);
|
||||
|
||||
List<MenuVO> getSiteMenuInfo(SiteSearch search);
|
||||
|
||||
void deleteTripleRate(CompSearch search);
|
||||
|
||||
int updateCompVictoryPassYn(SiteOption option);
|
||||
|
||||
|
||||
String getAdminOtpUseYN(String adminId);
|
||||
int registOtpInfo(OTPInfo otpParam);
|
||||
int updateAdminOtpUseYN(OTPInfo otpParam);
|
||||
int updateSuperOtpUseYN(OTPInfo otpParam);
|
||||
OTPInfo getOtpInfo(String adminId);
|
||||
String getAdminType(String adminId);
|
||||
|
||||
List<HashMap<String, String>> getAdminOtpInfoList(String siteId);
|
||||
|
||||
HashMap<String, Object> getTripleCreditInfo(String siteId);
|
||||
|
||||
void updateTripleSiteCredit(HashMap<String, Object> tripleCreditInfo);
|
||||
|
||||
int updateVendoMinMax(HashMap<String, Object> param);
|
||||
|
||||
String getLastMaxWinAmt(HashMap<String, Object> param);
|
||||
|
||||
String getLastMaxWinAmtCnt(HashMap<String, Object> param);
|
||||
|
||||
long getTripleSiteCredit(String tripleSiteId);
|
||||
|
||||
long getTripleSitePoint(String tripleSiteId);
|
||||
|
||||
HashMap<String, String> getTripleTargetSiteInfo(HashMap<String, Object> tripleCreditInfo);
|
||||
|
||||
void insertTripleCredit(HashMap<String, Object> creditParam);
|
||||
|
||||
void insertTripleCreditAiAo(HashMap<String, Object> creditParam);
|
||||
|
||||
String getSiteIdByAdminId(String adminId);
|
||||
|
||||
}
|
||||
363
src/main/java/com/bb/dao/CompDaoImpl.java
Normal file
363
src/main/java/com/bb/dao/CompDaoImpl.java
Normal file
@@ -0,0 +1,363 @@
|
||||
package com.bb.dao;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
import org.apache.ibatis.session.SqlSession;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.bb.model.BiSubPointRateVo;
|
||||
import com.bb.model.CompDetail;
|
||||
import com.bb.model.CompResetInfo;
|
||||
import com.bb.model.CompSearch;
|
||||
import com.bb.model.GameSettingInfo;
|
||||
import com.bb.model.Member;
|
||||
import com.bb.model.MemberListSearch;
|
||||
import com.bb.model.MenuVO;
|
||||
import com.bb.model.OTPInfo;
|
||||
import com.bb.model.PartnerCompInfo;
|
||||
import com.bb.model.Site;
|
||||
import com.bb.model.SiteOption;
|
||||
import com.bb.model.SiteSearch;
|
||||
import com.bb.model.TripleGameRate;
|
||||
|
||||
@Repository("compDao")
|
||||
public class CompDaoImpl implements CompDao {
|
||||
|
||||
/** 메인DB 연결 */
|
||||
@Autowired @Qualifier("sqlSessionMain")
|
||||
protected SqlSession sqlSession;
|
||||
|
||||
/** 서브DB 연결 */
|
||||
@Autowired @Qualifier("sqlSessionSub")
|
||||
protected SqlSession sqlSessionSub;
|
||||
|
||||
/** 트리플DB 연결 */
|
||||
@Autowired @Qualifier("sqlSessionTriple")
|
||||
protected SqlSession sqlSessionTriple;
|
||||
|
||||
@Override
|
||||
public int getPartnerCompListCnt(@Valid MemberListSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getPartnerCompListCnt", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CompDetail> getPartnerCompList(@Valid MemberListSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getPartnerCompList", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CompDetail getPartnerComp(Site search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getPartnerComp", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HashMap getPartnerCompDetail(Member search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getPartnerCompDetail", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int modifySiteGameSetting(BiSubPointRateVo biSubPointRateVo) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.insert("modifySiteGameSetting", biSubPointRateVo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int modifyCreditSettings(PartnerCompInfo compInfo) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.update("modifyCreditSettings", compInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int modifyCreditRates(HashMap param) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.update("modifyCreditRates", param);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int modifySiteSettings(SiteOption siteOption) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.update("modifySiteSettings", siteOption);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCheckTopComp(PartnerCompInfo compInfo) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getCheckTopComp", compInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int modifyCompInfo(PartnerCompInfo compInfo) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.update("modifyCompInfo", compInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HashMap getCompInfoForDetail(SiteSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getCompInfoForDetail", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HashMap getSettingInfoForDetail(SiteSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getSettingInfoForDetail", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HashMap getCompStatsForDetail(SiteSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getCompStatsForDetail", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap> getTopCompListForDetail(SiteSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getTopCompListForDetail", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap> getBotCompListForDetail(SiteSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getBotCompListForDetail", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int modifySiteGameSettingForSuper(GameSettingInfo item) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.insert("modifySiteGameSettingForSuper", item);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int modifyMenuSettings(MenuVO item) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.update("modifyMenuSettings", item);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap> getCompanyRate(Member search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getCompanyRate", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap<String, String>> getGameRateCompList(TripleGameRate gameRateVO) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getGameRateCompList", gameRateVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateCompGameRate(HashMap<String, String> compGameRateInfo) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.update("updateCompGameRate", compGameRateInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HashMap<String, String> getTripleParam(CompSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getTripleParam", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap<String, String>> getTripleGameRate(HashMap<String, String> tripleParam) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionTriple.selectList("getTripleGameRate", tripleParam);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertTripleRate(HashMap<String, String> tripleRate) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.insert("insertTripleRate", tripleRate);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap<String, String>> getOmsRateListByTripleGame(CompSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getOmsRateListByTripleGame", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateOmsRateList(CompSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.update("updateOmsRateList", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int resetDelete(CompResetInfo compResetInfo) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.delete("resetDelete", compResetInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int resetUpdate(CompResetInfo compResetInfo) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.update("resetUpdate", compResetInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getResetMemIdCount(CompResetInfo compResetInfo) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.selectOne("getResetMemIdCount", compResetInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateApiSetting(PartnerCompInfo compInfo) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.update("updateApiSetting", compInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap<String, String>> getCompIdList(SiteSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getCompIdList", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap> getSiteGameInfo(SiteSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getSiteGameInfo", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MenuVO> getSiteMenuInfo(SiteSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getSiteMenuInfo", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteTripleRate(CompSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
sqlSession.delete("deleteTripleRate", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateCompVictoryPassYn(SiteOption option) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.update("updateCompVictoryPassYn", option);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getAdminOtpUseYN(String adminId) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getAdminOtpUseYN", adminId);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int registOtpInfo(OTPInfo otpParam) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.insert("registOtpInfo", otpParam);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int updateAdminOtpUseYN(OTPInfo otpParam) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.update("updateAdminOtpUseYN", otpParam);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int updateSuperOtpUseYN(OTPInfo otpParam) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.update("updateSuperOtpUseYN", otpParam);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public OTPInfo getOtpInfo(String adminId) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getOtpInfo", adminId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getAdminType(String adminId) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getAdminType", adminId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap<String, String>> getAdminOtpInfoList(String siteId) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getAdminOtpInfoList", siteId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HashMap<String, Object> getTripleCreditInfo(String siteId) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getTripleCreditInfo", siteId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateTripleSiteCredit(HashMap<String, Object> tripleCreditInfo) {
|
||||
// TODO Auto-generated method stub
|
||||
sqlSessionTriple.update("updateTripleSiteCredit", tripleCreditInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateVendoMinMax(HashMap<String, Object> param) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.update("updateVendoMinMax", param);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLastMaxWinAmt(HashMap<String, Object> param) {
|
||||
// TODO Auto-generated method stub
|
||||
String lastMaxWinAmt = sqlSessionSub.selectOne("getLastMaxWinAmt", param);
|
||||
if(lastMaxWinAmt == null) lastMaxWinAmt = "0";
|
||||
return lastMaxWinAmt;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLastMaxWinAmtCnt(HashMap<String, Object> param) {
|
||||
// TODO Auto-generated method stub
|
||||
String lastMaxWinAmtCnt = sqlSessionSub.selectOne("getLastMaxWinAmtCnt", param);
|
||||
if(lastMaxWinAmtCnt == null) lastMaxWinAmtCnt = "0";
|
||||
return lastMaxWinAmtCnt;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getTripleSiteCredit(String tripleSiteId) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionTriple.selectOne("getTripleSiteCredit", tripleSiteId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getTripleSitePoint(String tripleSiteId) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionTriple.selectOne("getTripleSitePoint", tripleSiteId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HashMap<String, String> getTripleTargetSiteInfo(HashMap<String, Object> tripleCreditInfo) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionTriple.selectOne("getTripleTargetSiteInfo", tripleCreditInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void insertTripleCredit(HashMap<String, Object> creditParam) {
|
||||
// TODO Auto-generated method stub
|
||||
sqlSessionTriple.insert("insertTripleCredit", creditParam);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void insertTripleCreditAiAo(HashMap<String, Object> creditParam) {
|
||||
// TODO Auto-generated method stub
|
||||
sqlSessionTriple.insert("insertTripleCreditAiAo", creditParam);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSiteIdByAdminId(String adminId) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getSiteIdByAdminId", adminId);
|
||||
}
|
||||
}
|
||||
18
src/main/java/com/bb/dao/MainDao.java
Normal file
18
src/main/java/com/bb/dao/MainDao.java
Normal file
@@ -0,0 +1,18 @@
|
||||
package com.bb.dao;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
public interface MainDao {
|
||||
|
||||
HashMap<String, String> getMainTopInfo(HashMap<String, String> param);
|
||||
|
||||
HashMap<String, String> getMainStatistics(HashMap<String, String> param);
|
||||
|
||||
HashMap<String, String> getMainCashReport(HashMap<String, String> param);
|
||||
|
||||
HashMap<String, String> getMyCashReport(HashMap<String, String> param);
|
||||
|
||||
List<HashMap<String, String>> getMainNewPayLog(HashMap<String, String> param);
|
||||
|
||||
}
|
||||
51
src/main/java/com/bb/dao/MainDaoImpl.java
Normal file
51
src/main/java/com/bb/dao/MainDaoImpl.java
Normal file
@@ -0,0 +1,51 @@
|
||||
package com.bb.dao;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.session.SqlSession;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@Repository("mainDao")
|
||||
public class MainDaoImpl implements MainDao {
|
||||
|
||||
/** 메인DB 연결 */
|
||||
@Autowired @Qualifier("sqlSessionMain")
|
||||
protected SqlSession sqlSession;
|
||||
|
||||
/** 서브DB 연결 */
|
||||
@Autowired @Qualifier("sqlSessionSub")
|
||||
protected SqlSession sqlSessionSub;
|
||||
|
||||
@Override
|
||||
public HashMap<String, String> getMainTopInfo(HashMap<String, String> param) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getMainTopInfo", param);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HashMap<String, String> getMainStatistics(HashMap<String, String> param) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getMainStatistics", param);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HashMap<String, String> getMainCashReport(HashMap<String, String> param) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getMainCashReport", param);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HashMap<String, String> getMyCashReport(HashMap<String, String> param) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getMyCashReport", param);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap<String, String>> getMainNewPayLog(HashMap<String, String> param) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getMainNewPayLog", param);
|
||||
}
|
||||
}
|
||||
22
src/main/java/com/bb/dao/MinigameDao.java
Normal file
22
src/main/java/com/bb/dao/MinigameDao.java
Normal file
@@ -0,0 +1,22 @@
|
||||
package com.bb.dao;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
import com.bb.model.MiniGameSearch;
|
||||
import com.bb.model.MinigameBetRate;
|
||||
import com.bb.model.MinigameSet;
|
||||
|
||||
public interface MinigameDao {
|
||||
|
||||
void setSave(@Valid MinigameSet mgs);
|
||||
|
||||
void betRateSave(@Valid MinigameBetRate mbr);
|
||||
|
||||
List<HashMap> getSetList(MiniGameSearch search);
|
||||
|
||||
List<HashMap> getBetRateList(MiniGameSearch search);
|
||||
|
||||
}
|
||||
52
src/main/java/com/bb/dao/MinigameDaoImpl.java
Normal file
52
src/main/java/com/bb/dao/MinigameDaoImpl.java
Normal file
@@ -0,0 +1,52 @@
|
||||
package com.bb.dao;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
import org.apache.ibatis.session.SqlSession;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.bb.model.MiniGameSearch;
|
||||
import com.bb.model.MinigameBetRate;
|
||||
import com.bb.model.MinigameSet;
|
||||
|
||||
@Repository("minigameDaoImpl")
|
||||
public class MinigameDaoImpl implements MinigameDao {
|
||||
|
||||
/** 메인DB 연결 */
|
||||
@Autowired @Qualifier("sqlSessionMain")
|
||||
protected SqlSession sqlSession;
|
||||
|
||||
/** 서브DB 연결 */
|
||||
@Autowired @Qualifier("sqlSessionSub")
|
||||
protected SqlSession sqlSessionSub;
|
||||
|
||||
@Override
|
||||
public void setSave(@Valid MinigameSet mgs) {
|
||||
// TODO Auto-generated method stub
|
||||
sqlSession.insert("setSave", mgs);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void betRateSave(@Valid MinigameBetRate mbr) {
|
||||
// TODO Auto-generated method stub
|
||||
sqlSession.insert("betRateSave", mbr);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap> getSetList(MiniGameSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.selectList("getSetList", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap> getBetRateList(MiniGameSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.selectList("getBetRateList", search);
|
||||
}
|
||||
|
||||
}
|
||||
5
src/main/java/com/bb/dao/PassimDao.java
Normal file
5
src/main/java/com/bb/dao/PassimDao.java
Normal file
@@ -0,0 +1,5 @@
|
||||
package com.bb.dao;
|
||||
|
||||
public interface PassimDao {
|
||||
|
||||
}
|
||||
22
src/main/java/com/bb/dao/PassimDaoImpl.java
Normal file
22
src/main/java/com/bb/dao/PassimDaoImpl.java
Normal file
@@ -0,0 +1,22 @@
|
||||
package com.bb.dao;
|
||||
|
||||
import org.apache.ibatis.session.SqlSession;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@Slf4j
|
||||
@Repository("PassimDao")
|
||||
public class PassimDaoImpl implements PassimDao {
|
||||
|
||||
/** 메인DB 연결 */
|
||||
@Autowired @Qualifier("sqlSessionMain")
|
||||
protected SqlSession sqlSession;
|
||||
|
||||
/** 서브DB 연결 */
|
||||
@Autowired @Qualifier("sqlSessionSub")
|
||||
protected SqlSession sqlSessionSub;
|
||||
|
||||
}
|
||||
25
src/main/java/com/bb/dao/PointDao.java
Normal file
25
src/main/java/com/bb/dao/PointDao.java
Normal file
@@ -0,0 +1,25 @@
|
||||
package com.bb.dao;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import com.bb.model.Point;
|
||||
import com.bb.model.PointSearchAdm;
|
||||
|
||||
public interface PointDao {
|
||||
|
||||
int getAdminPointListCnt(PointSearchAdm search);
|
||||
|
||||
List<HashMap<String, String>> getAdminPointList(PointSearchAdm search);
|
||||
|
||||
int getAdminPointListNewCnt(PointSearchAdm search);
|
||||
|
||||
List<HashMap<String, String>> getAdminPointListNew(PointSearchAdm search);
|
||||
|
||||
List<HashMap<String, String>> getPointBotRateList(PointSearchAdm search);
|
||||
|
||||
List<HashMap<String, String>> getPointBotMultiRateList(PointSearchAdm search);
|
||||
|
||||
long pointInsert(Point point);
|
||||
|
||||
}
|
||||
70
src/main/java/com/bb/dao/PointDaoImpl.java
Normal file
70
src/main/java/com/bb/dao/PointDaoImpl.java
Normal file
@@ -0,0 +1,70 @@
|
||||
package com.bb.dao;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.session.SqlSession;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.bb.model.Point;
|
||||
import com.bb.model.PointSearchAdm;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@Slf4j
|
||||
@Repository("PointDao")
|
||||
public class PointDaoImpl implements PointDao {
|
||||
|
||||
/** 메인DB 연결 */
|
||||
@Autowired @Qualifier("sqlSessionMain")
|
||||
protected SqlSession sqlSession;
|
||||
|
||||
/** 서브DB 연결 */
|
||||
@Autowired @Qualifier("sqlSessionSub")
|
||||
protected SqlSession sqlSessionSub;
|
||||
|
||||
@Override
|
||||
public int getAdminPointListCnt(PointSearchAdm search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getAdminPointListCnt", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap<String, String>> getAdminPointList(PointSearchAdm search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getAdminPointList", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getAdminPointListNewCnt(PointSearchAdm search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getAdminPointListNewCnt", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap<String, String>> getAdminPointListNew(PointSearchAdm search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getAdminPointListNew", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap<String, String>> getPointBotRateList(PointSearchAdm search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getPointBotRateList", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap<String, String>> getPointBotMultiRateList(PointSearchAdm search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getPointBotMultiRateList", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public long pointInsert(Point point) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.insert("pointInsert2", point);
|
||||
}
|
||||
|
||||
}
|
||||
22
src/main/java/com/bb/dao/RateDao.java
Normal file
22
src/main/java/com/bb/dao/RateDao.java
Normal file
@@ -0,0 +1,22 @@
|
||||
package com.bb.dao;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import com.bb.model.Member;
|
||||
import com.bb.model.MemberSearch;
|
||||
import com.bb.model.RateVO;
|
||||
import com.bb.model.RetailSearch;
|
||||
|
||||
public interface RateDao {
|
||||
|
||||
List<HashMap<String,Object>> getMemRollingInfo(Member search);
|
||||
|
||||
int myRateInfoUpdate(RateVO rateVO);
|
||||
|
||||
int topMinRateInfoUpdate(RateVO rateVO);
|
||||
|
||||
int botMaxRateInfoUpdate(RateVO rateVO);
|
||||
|
||||
List<RateVO> getTopRate(MemberSearch search);
|
||||
}
|
||||
61
src/main/java/com/bb/dao/RateDaoImpl.java
Normal file
61
src/main/java/com/bb/dao/RateDaoImpl.java
Normal file
@@ -0,0 +1,61 @@
|
||||
package com.bb.dao;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.session.SqlSession;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.bb.model.Member;
|
||||
import com.bb.model.MemberSearch;
|
||||
import com.bb.model.RateVO;
|
||||
import com.bb.model.RetailSearch;
|
||||
|
||||
@Repository("rateDao")
|
||||
public class RateDaoImpl implements RateDao {
|
||||
|
||||
/** 메인DB 연결 */
|
||||
@Autowired @Qualifier("sqlSessionMain")
|
||||
protected SqlSession sqlSession;
|
||||
|
||||
/** 서브DB 연결 */
|
||||
@Autowired @Qualifier("sqlSessionSub")
|
||||
protected SqlSession sqlSessionSub;
|
||||
|
||||
|
||||
@Override
|
||||
public List<HashMap<String,Object>> getMemRollingInfo(Member search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getMemRollingInfo", search);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int myRateInfoUpdate(RateVO rateVO) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.update("myRateInfoUpdate", rateVO);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int topMinRateInfoUpdate(RateVO rateVO) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.update("topMinRateInfoUpdate", rateVO);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int botMaxRateInfoUpdate(RateVO rateVO) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.update("botMaxRateInfoUpdate", rateVO);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<RateVO> getTopRate(MemberSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getTopRate", search);
|
||||
}
|
||||
}
|
||||
71
src/main/java/com/bb/dao/ReportDao.java
Normal file
71
src/main/java/com/bb/dao/ReportDao.java
Normal file
@@ -0,0 +1,71 @@
|
||||
package com.bb.dao;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
import com.bb.model.As;
|
||||
import com.bb.model.DailyReportSearch;
|
||||
import com.bb.model.DayilPartnerReport;
|
||||
import com.bb.model.DayilPeriodicReports;
|
||||
import com.bb.model.ReportSearch;
|
||||
|
||||
public interface ReportDao {
|
||||
|
||||
int getReportMemwlListCnt(@Valid ReportSearch search);
|
||||
|
||||
List<HashMap> getReportMemwlList(@Valid ReportSearch search);
|
||||
|
||||
HashMap getPeriodCash(@Valid ReportSearch search);
|
||||
|
||||
List<HashMap> getPeriodRollPoint(@Valid ReportSearch search);
|
||||
|
||||
List<HashMap> getPeriodWlAmt(@Valid ReportSearch search);
|
||||
|
||||
List<HashMap> getGameTypeList(@Valid ReportSearch search);
|
||||
|
||||
List<HashMap<String, String>> getDayList(@Valid ReportSearch search);
|
||||
|
||||
HashMap<String, String> getDayTotal(ReportSearch search);
|
||||
|
||||
int getReportTradeListCnt(@Valid ReportSearch search);
|
||||
|
||||
List<HashMap> getReportTradeList(@Valid ReportSearch search);
|
||||
|
||||
int getReportPartnerListCnt(@Valid ReportSearch search);
|
||||
|
||||
List<HashMap> getReportPartnerList(@Valid ReportSearch search);
|
||||
|
||||
List<HashMap> getReportPartnerGroupBet(@Valid HashMap partner);
|
||||
|
||||
int getReportPayListCnt(@Valid ReportSearch search);
|
||||
|
||||
List<HashMap> getReportPayList(@Valid ReportSearch search);
|
||||
|
||||
List<HashMap> getReportPayGroupGameType(HashMap pay);
|
||||
|
||||
int getReportsListCntForAdmin(DailyReportSearch search);
|
||||
List<DayilPeriodicReports> getReportsListForAdmin(DailyReportSearch search);
|
||||
DayilPeriodicReports getReportsTotalForAdmin(DailyReportSearch search);
|
||||
String getReportsTotalCntForAdmin(DailyReportSearch search);
|
||||
|
||||
int getReportsByUserListCntForAdmin(DailyReportSearch search);
|
||||
List<DayilPeriodicReports> getReportsByUserListForAdmin(DailyReportSearch search);
|
||||
DayilPeriodicReports getReportsByUserTotalForAdmin(DailyReportSearch search);
|
||||
|
||||
|
||||
List<DayilPeriodicReports> getReportsListForPartner(DailyReportSearch search);
|
||||
DayilPeriodicReports getReportsTotalForPartner(DailyReportSearch search);
|
||||
String getReportsTotalCntForPartner(DailyReportSearch search);
|
||||
|
||||
int getReportsByUserListCntForPartner(DailyReportSearch search);
|
||||
List<DayilPeriodicReports> getReportsByUserListForPartner(DailyReportSearch search);
|
||||
DayilPeriodicReports getReportsByUserTotalForPartner(DailyReportSearch search);
|
||||
|
||||
HashMap<String, String> getPartnerInfo(DailyReportSearch search);
|
||||
List<DayilPartnerReport> getDayilPartnerReport(DailyReportSearch search);
|
||||
|
||||
List<HashMap<String, String>> getReportCateInfo(String siteId);
|
||||
|
||||
}
|
||||
234
src/main/java/com/bb/dao/ReportDaoImpl.java
Normal file
234
src/main/java/com/bb/dao/ReportDaoImpl.java
Normal file
@@ -0,0 +1,234 @@
|
||||
package com.bb.dao;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
import org.apache.ibatis.session.SqlSession;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.bb.model.As;
|
||||
import com.bb.model.DailyReportSearch;
|
||||
import com.bb.model.DayilPartnerReport;
|
||||
import com.bb.model.DayilPeriodicReports;
|
||||
import com.bb.model.ReportSearch;
|
||||
|
||||
|
||||
|
||||
@Repository("reportDao")
|
||||
public class ReportDaoImpl implements ReportDao {
|
||||
|
||||
|
||||
/** 메인DB 연결 */
|
||||
@Autowired @Qualifier("sqlSessionMain")
|
||||
protected SqlSession sqlSession;
|
||||
|
||||
/** 서브DB 연결 */
|
||||
@Autowired @Qualifier("sqlSessionSub")
|
||||
protected SqlSession sqlSessionSub;
|
||||
|
||||
|
||||
@Override
|
||||
public int getReportMemwlListCnt(@Valid ReportSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getReportMemwlListCnt", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap> getReportMemwlList(@Valid ReportSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getReportMemwlList", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HashMap getPeriodCash(@Valid ReportSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getPeriodCash", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap> getPeriodRollPoint(@Valid ReportSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getPeriodRollPoint", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap> getPeriodWlAmt(@Valid ReportSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getPeriodWlAmt", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap> getGameTypeList(@Valid ReportSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getGameTypeList", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap<String, String>> getDayList(@Valid ReportSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getDayList", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HashMap<String, String> getDayTotal(ReportSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getDayTotal", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getReportTradeListCnt(@Valid ReportSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getReportTradeListCnt", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap> getReportTradeList(@Valid ReportSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getReportTradeList", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getReportPartnerListCnt(@Valid ReportSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getReportPartnerListCnt", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap> getReportPartnerList(@Valid ReportSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getReportPartnerList", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap> getReportPartnerGroupBet(@Valid HashMap partner) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getReportPartnerGroupBet", partner);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getReportPayListCnt(@Valid ReportSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getReportPayListCnt", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap> getReportPayList(@Valid ReportSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getReportPayList", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap> getReportPayGroupGameType(HashMap pay) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getReportPayGroupGameType", pay);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public int getReportsListCntForAdmin(DailyReportSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getReportsListCntForAdmin", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DayilPeriodicReports> getReportsListForAdmin(DailyReportSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getReportsListForAdmin", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DayilPeriodicReports getReportsTotalForAdmin(DailyReportSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getReportsTotalForAdmin", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getReportsTotalCntForAdmin(DailyReportSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getReportsTotalCntForAdmin", search);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public int getReportsByUserListCntForAdmin(DailyReportSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getReportsByUserListCntForAdmin", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DayilPeriodicReports> getReportsByUserListForAdmin(DailyReportSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getReportsByUserListForAdmin", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DayilPeriodicReports getReportsByUserTotalForAdmin(DailyReportSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getReportsByUserTotalForAdmin", search);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public List<DayilPeriodicReports> getReportsListForPartner(DailyReportSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getReportsListForPartner", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DayilPeriodicReports getReportsTotalForPartner(DailyReportSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getReportsTotalForPartner", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getReportsTotalCntForPartner(DailyReportSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getReportsTotalCntForPartner", search);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getReportsByUserListCntForPartner(DailyReportSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getReportsByUserListCntForPartner", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DayilPeriodicReports> getReportsByUserListForPartner(DailyReportSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getReportsByUserListForPartner", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DayilPeriodicReports getReportsByUserTotalForPartner(DailyReportSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getReportsByUserTotalForPartner", search);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public HashMap<String, String> getPartnerInfo(DailyReportSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getPartnerInfo", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DayilPartnerReport> getDayilPartnerReport(DailyReportSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getDayilPartnerReport", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap<String, String>> getReportCateInfo(String siteId) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getReportCateInfo", siteId);
|
||||
}
|
||||
|
||||
}
|
||||
172
src/main/java/com/bb/dao/RetailDao.java
Normal file
172
src/main/java/com/bb/dao/RetailDao.java
Normal file
@@ -0,0 +1,172 @@
|
||||
package com.bb.dao;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
import com.bb.model.BotMemRateVo;
|
||||
import com.bb.model.CategoryRateVo;
|
||||
import com.bb.model.ChargingPointSettingVO;
|
||||
import com.bb.model.LoginUserVO;
|
||||
import com.bb.model.Member;
|
||||
import com.bb.model.MemberListSearch;
|
||||
import com.bb.model.MemberSearch;
|
||||
import com.bb.model.PartnerListVO;
|
||||
import com.bb.model.RetailListSearch;
|
||||
import com.bb.model.RetailLowerSearch;
|
||||
import com.bb.model.RetailPointSearch;
|
||||
import com.bb.model.RetailSearch;
|
||||
import com.bb.model.RetailSet;
|
||||
import com.bb.model.UserDetailInfo;
|
||||
import com.bb.model.UserListSearch;
|
||||
import com.bb.model.UserSearch;
|
||||
|
||||
public interface RetailDao {
|
||||
|
||||
int getRetailListCnt(@Valid RetailSearch search);
|
||||
|
||||
List<HashMap> getRetailList(@Valid RetailSearch search);
|
||||
|
||||
int getRetailListCnt2(@Valid RetailSearch search);
|
||||
|
||||
List<PartnerListVO> getRetailList2(@Valid RetailSearch search);
|
||||
|
||||
void settingSave(@Valid RetailSet retailSet);
|
||||
|
||||
int getRetailSettingListCnt(@Valid RetailSearch search);
|
||||
|
||||
List<HashMap> getRetailSettingList(@Valid RetailSearch search);
|
||||
|
||||
List<HashMap> getRetailBalanceList(@Valid RetailSearch search);
|
||||
|
||||
int getRetailBalanceListCnt(@Valid RetailSearch search);
|
||||
|
||||
int retailDetailListCnt(@Valid RetailSearch search);
|
||||
|
||||
List<HashMap> retailDetailList(@Valid RetailSearch search);
|
||||
|
||||
int retailSummryListCnt(@Valid RetailSearch search);
|
||||
|
||||
List<HashMap> retailSummryList(@Valid RetailSearch search);
|
||||
|
||||
List<HashMap> retailBalanceDetail(@Valid RetailSearch search);
|
||||
|
||||
List<HashMap> getMyBetPointInfo(@Valid RetailSearch search);
|
||||
|
||||
HashMap getMySummary(RetailSearch search);
|
||||
|
||||
HashMap getMySummaryNew(RetailSearch search);
|
||||
|
||||
HashMap getMyCashInfo(@Valid RetailSearch search);
|
||||
|
||||
List<HashMap> getMyLoginMem(@Valid RetailSearch search);
|
||||
|
||||
List<HashMap> getMemList(@Valid RetailSearch search);
|
||||
|
||||
long getRetailBalcePoint(@Valid RetailSearch search);
|
||||
|
||||
void updateRetailPointStatus(@Valid RetailSearch search);
|
||||
|
||||
List<HashMap> myMemIds(Member search);
|
||||
|
||||
List<CategoryRateVo> getMyCategoryRateList(MemberSearch search);
|
||||
|
||||
List<CategoryRateVo> getBotCategoryRateList(MemberSearch search);
|
||||
|
||||
int updateCasinoRate(BotMemRateVo item);
|
||||
|
||||
int updateHcasinoRate(BotMemRateVo item);
|
||||
|
||||
int updateSlotRate(BotMemRateVo item);
|
||||
|
||||
int updateMiniRate(BotMemRateVo item);
|
||||
|
||||
int updateSportRate(BotMemRateVo item);
|
||||
|
||||
List<HashMap> getMyUnderPartnerLevels(Member search);
|
||||
|
||||
int getMyMemListCnt(RetailSearch search);
|
||||
|
||||
List<HashMap> getMyMemList(RetailSearch search);
|
||||
|
||||
int getMyMemDirectListCnt(RetailSearch search);
|
||||
|
||||
List<HashMap> getMyMemDirectList(RetailSearch search);
|
||||
|
||||
|
||||
int getMyPartnerListCnt(RetailSearch search);
|
||||
|
||||
List<HashMap> getMyPartnerList(RetailSearch search);
|
||||
|
||||
List<HashMap> getMyPartnerList2(RetailSearch search);
|
||||
|
||||
List<HashMap> getMyPartnerDirectList(RetailSearch search);
|
||||
|
||||
int partnerBonusSettingSave(ChargingPointSettingVO settingVO);
|
||||
|
||||
int getRetailPointListCnt(RetailPointSearch search);
|
||||
|
||||
List<HashMap> getRetailPointList(RetailPointSearch search);
|
||||
|
||||
List<HashMap> getPartnerHierarchy(RetailSearch search);
|
||||
|
||||
List<HashMap<String, Object>> getBottomRateList(Member search);
|
||||
|
||||
int userLockWithBottom(HashMap<String, String> param);
|
||||
|
||||
HashMap<String, String> getBotCashInfo(RetailSearch search);
|
||||
|
||||
int getMyLoginMemListCnt(MemberListSearch search);
|
||||
|
||||
List<LoginUserVO> getMyLoginMemList(MemberListSearch search);
|
||||
|
||||
HashMap<String, String> getPartnerInfo(RetailSearch search);
|
||||
|
||||
String getNextTargetLevel(RetailLowerSearch param);
|
||||
|
||||
int getLowerPartnerListCnt(RetailLowerSearch search);
|
||||
|
||||
List<HashMap<String, Object>> getLowerPartnerList(RetailLowerSearch search);
|
||||
|
||||
UserDetailInfo getUserDetailInfo(UserSearch search);
|
||||
|
||||
int setUserDetailInfo(UserDetailInfo info);
|
||||
|
||||
List<HashMap<String, String>> getDetailLoginLog(UserSearch search);
|
||||
|
||||
int getDetailMsgLogCnt(UserListSearch search);
|
||||
|
||||
List<HashMap<String, Object>> getDetailMsgLog(UserListSearch search);
|
||||
|
||||
int getDetailCashLogCnt(UserListSearch search);
|
||||
|
||||
List<HashMap<String, Object>> getDetailCashLog(UserListSearch search);
|
||||
|
||||
int getDetailRollingLogCnt(UserListSearch search);
|
||||
|
||||
List<HashMap<String, Object>> getDetailRollingLog(UserListSearch search);
|
||||
|
||||
List<HashMap<String, Object>> getDetailRollingLogNew(UserListSearch search);
|
||||
|
||||
List<HashMap> getPartnerHierarchy2(RetailSearch search);
|
||||
|
||||
HashMap<String, String> getMyBetStatData(UserSearch search);
|
||||
|
||||
List<HashMap<String, String>> getBottomBetStatList(UserSearch search);
|
||||
|
||||
HashMap<String, String> getBottomBetStatSum(UserSearch search);
|
||||
|
||||
List<HashMap<String, String>> getDailyBetList(UserSearch search);
|
||||
|
||||
HashMap<String, String> getDailyBetSum(UserSearch search);
|
||||
|
||||
List<HashMap<String, String>> getDailyUserList(UserSearch search);
|
||||
|
||||
HashMap<String, String> getDailyUserSum(UserSearch search);
|
||||
|
||||
List<HashMap<String, String>> getDailyPartnerList(UserSearch search);
|
||||
|
||||
int getBotCnt(Member searchBot);
|
||||
|
||||
}
|
||||
474
src/main/java/com/bb/dao/RetailDaoImpl.java
Normal file
474
src/main/java/com/bb/dao/RetailDaoImpl.java
Normal file
@@ -0,0 +1,474 @@
|
||||
package com.bb.dao;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import jakarta.validation.Valid;
|
||||
|
||||
import org.apache.ibatis.session.SqlSession;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.bb.model.BotMemRateVo;
|
||||
import com.bb.model.CategoryRateVo;
|
||||
import com.bb.model.ChargingPointSettingVO;
|
||||
import com.bb.model.LoginUserVO;
|
||||
import com.bb.model.Member;
|
||||
import com.bb.model.MemberListSearch;
|
||||
import com.bb.model.MemberSearch;
|
||||
import com.bb.model.PartnerListVO;
|
||||
import com.bb.model.RetailListSearch;
|
||||
import com.bb.model.RetailLowerSearch;
|
||||
import com.bb.model.RetailPointSearch;
|
||||
import com.bb.model.RetailSearch;
|
||||
import com.bb.model.RetailSet;
|
||||
import com.bb.model.UserDetailInfo;
|
||||
import com.bb.model.UserListSearch;
|
||||
import com.bb.model.UserSearch;
|
||||
|
||||
@Repository("retailDao")
|
||||
public class RetailDaoImpl implements RetailDao {
|
||||
|
||||
/** 메인DB 연결 */
|
||||
@Autowired @Qualifier("sqlSessionMain")
|
||||
protected SqlSession sqlSession;
|
||||
|
||||
/** 서브DB 연결 */
|
||||
@Autowired @Qualifier("sqlSessionSub")
|
||||
protected SqlSession sqlSessionSub;
|
||||
|
||||
@Override
|
||||
public int getRetailListCnt(@Valid RetailSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getRetailListCnt", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap> getRetailList(@Valid RetailSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getRetailList", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRetailListCnt2(@Valid RetailSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getRetailListCnt2", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PartnerListVO> getRetailList2(@Valid RetailSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getRetailList2", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void settingSave(@Valid RetailSet retailSet) {
|
||||
// TODO Auto-generated method stub
|
||||
sqlSession.update("settingSave", retailSet);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRetailSettingListCnt(@Valid RetailSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getRetailSettingListCnt", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap> getRetailSettingList(@Valid RetailSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getRetailSettingList", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap> getRetailBalanceList(@Valid RetailSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getRetailBalanceList", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRetailBalanceListCnt(@Valid RetailSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getRetailBalanceListCnt", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int retailDetailListCnt(@Valid RetailSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("retailDetailListCnt", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap> retailDetailList(@Valid RetailSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("retailDetailList", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int retailSummryListCnt(@Valid RetailSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("retailSummryListCnt", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap> retailSummryList(@Valid RetailSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("summryList", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap> retailBalanceDetail(@Valid RetailSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("retailBalanceDetail", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap> getMyBetPointInfo(@Valid RetailSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getMyBetPointInfo", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HashMap getMySummary(RetailSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getMySummary", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HashMap getMySummaryNew(RetailSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getMySummaryNew", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HashMap getMyCashInfo(@Valid RetailSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getMyCashInfo", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap> getMyLoginMem(@Valid RetailSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getMyLoginMem", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap> getMemList(@Valid RetailSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getMemList", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getRetailBalcePoint(@Valid RetailSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getRetailBalcePoint", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateRetailPointStatus(@Valid RetailSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
sqlSession.update("updateRetailPointStatus", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap> myMemIds(Member search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("myMemIds", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CategoryRateVo> getMyCategoryRateList(MemberSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getMyCategoryRateList", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CategoryRateVo> getBotCategoryRateList(MemberSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getBotCategoryRateList", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateCasinoRate(BotMemRateVo item) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.update("updateCasinoRate", item);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateHcasinoRate(BotMemRateVo item) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.update("updateHcasinoRate", item);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateSlotRate(BotMemRateVo item) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.update("updateSlotRate", item);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateMiniRate(BotMemRateVo item) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.update("updateMiniRate", item);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateSportRate(BotMemRateVo item) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.update("updateSportRate", item);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap> getMyUnderPartnerLevels(Member search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getMyUnderPartnerLevels", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMyMemListCnt(RetailSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getMyMemListCnt", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap> getMyMemList(RetailSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getMyMemList", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMyMemDirectListCnt(RetailSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getMyMemDirectListCnt", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap> getMyMemDirectList(RetailSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getMyMemDirectList", search);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getMyPartnerListCnt(RetailSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getMyPartnerListCnt", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap> getMyPartnerList(RetailSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getMyPartnerList", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap> getMyPartnerList2(RetailSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getMyPartnerList2", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap> getMyPartnerDirectList(RetailSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getMyPartnerDirectList", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int partnerBonusSettingSave(ChargingPointSettingVO settingVO) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.update("partnerBonusSettingSave", settingVO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRetailPointListCnt(RetailPointSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getRetailPointListCnt", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap> getRetailPointList(RetailPointSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getRetailPointList", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap> getPartnerHierarchy(RetailSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getPartnerHierarchy", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap<String, Object>> getBottomRateList(Member search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getBottomRateList", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int userLockWithBottom(HashMap<String, String> param) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.update("userLockWithBottom", param);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HashMap<String, String> getBotCashInfo(RetailSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getBotCashInfo", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMyLoginMemListCnt(MemberListSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getMyLoginMemListCnt", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<LoginUserVO> getMyLoginMemList(MemberListSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getMyLoginMemList", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HashMap<String, String> getPartnerInfo(RetailSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getPartnerInfoV2", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNextTargetLevel(RetailLowerSearch param) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getNextTargetLevel", param);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getLowerPartnerListCnt(RetailLowerSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getLowerPartnerListCnt", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap<String, Object>> getLowerPartnerList(RetailLowerSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getLowerPartnerList", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public UserDetailInfo getUserDetailInfo(UserSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getUserDetailInfo", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int setUserDetailInfo(UserDetailInfo info) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSession.update("setUserDetailInfo", info);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap<String, String>> getDetailLoginLog(UserSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getDetailLoginLog", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDetailMsgLogCnt(UserListSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getDetailMsgLogCnt", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap<String, Object>> getDetailMsgLog(UserListSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getDetailMsgLog", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDetailCashLogCnt(UserListSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getDetailCashLogCnt", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap<String, Object>> getDetailCashLog(UserListSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getDetailCashLog", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDetailRollingLogCnt(UserListSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getDetailRollingLogCnt", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap<String, Object>> getDetailRollingLog(UserListSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getDetailRollingLog", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap<String, Object>> getDetailRollingLogNew(UserListSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getDetailRollingLogNew", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap> getPartnerHierarchy2(RetailSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getPartnerHierarchy2", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HashMap<String, String> getMyBetStatData(UserSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getMyBetStatData", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap<String, String>> getBottomBetStatList(UserSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getBottomBetStatList", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HashMap<String, String> getBottomBetStatSum(UserSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getBottomBetStatSum", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap<String, String>> getDailyBetList(UserSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getDailyBetList", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HashMap<String, String> getDailyBetSum(UserSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getDailyBetSum", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap<String, String>> getDailyUserList(UserSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getDailyUserList", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HashMap<String, String> getDailyUserSum(UserSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getDailyUserSum", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HashMap<String, String>> getDailyPartnerList(UserSearch search) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectList("getDailyPartnerList", search);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getBotCnt(Member searchBot) {
|
||||
// TODO Auto-generated method stub
|
||||
return sqlSessionSub.selectOne("getBotCnt", searchBot);
|
||||
}
|
||||
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user