Merge branch 'master' of https://git.mashibing.com/msb_221930/beacon-cloud
Conflicts: .idea/compiler.xml beacon-api/target/classes/com/mashibing/api/controller/SmsController.class beacon-cache/pom.xml beacon-cache/src/main/java/com/mashibing/cache/CacheStarterApp.java beacon-cache/src/main/java/com/mashibing/cache/config/RedisConfig.java beacon-cache/src/main/java/com/mashibing/cache/controller/TestController.java beacon-cache/src/main/resources/bootstrap.yml pom.xmlmaster
commit
f6d20219a5
@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="DataSourceManagerImpl" format="xml" multifile-model="true">
|
||||||
|
<data-source source="LOCAL" name="beacon_cloud@localhost" uuid="702b1f07-0ea8-4a1f-b42e-119c036b73d5">
|
||||||
|
<driver-ref>mysql.8</driver-ref>
|
||||||
|
<synchronize>true</synchronize>
|
||||||
|
<jdbc-driver>com.mysql.cj.jdbc.Driver</jdbc-driver>
|
||||||
|
<jdbc-url>jdbc:mysql://localhost:3306/beacon_cloud</jdbc-url>
|
||||||
|
<working-dir>$ProjectFileDir$</working-dir>
|
||||||
|
</data-source>
|
||||||
|
</component>
|
||||||
|
</project>
|
@ -0,0 +1,12 @@
|
|||||||
|
package com.mashibing.api.client;
|
||||||
|
|
||||||
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author dch
|
||||||
|
* @create 2024-03-19 23:56
|
||||||
|
*/
|
||||||
|
@FeignClient(value="beacon-cache")
|
||||||
|
public class BeaconCacheClient {
|
||||||
|
|
||||||
|
}
|
Binary file not shown.
@ -0,0 +1,58 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<groupId>com.mashibing</groupId>
|
||||||
|
<artifactId>beacon-cloud</artifactId>
|
||||||
|
<version>1.0-SNAPSHOT</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>beacon-test</artifactId>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<maven.compiler.source>8</maven.compiler.source>
|
||||||
|
<maven.compiler.target>8</maven.compiler.target>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-web</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-test</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-starter-openfeign</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.mybatis.spring.boot</groupId>
|
||||||
|
<artifactId>mybatis-spring-boot-starter</artifactId>
|
||||||
|
<version>2.2.2</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>mysql</groupId>
|
||||||
|
<artifactId>mysql-connector-java</artifactId>
|
||||||
|
<version>5.1.49</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>junit</groupId>
|
||||||
|
<artifactId>junit</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework</groupId>
|
||||||
|
<artifactId>spring-test</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
</project>
|
@ -0,0 +1,22 @@
|
|||||||
|
package com.mashibing.test;
|
||||||
|
|
||||||
|
import org.mybatis.spring.annotation.MapperScan;
|
||||||
|
import org.springframework.boot.SpringApplication;
|
||||||
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
||||||
|
import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author dch
|
||||||
|
* @create 2024-03-20 0:15
|
||||||
|
*/
|
||||||
|
@SpringBootApplication
|
||||||
|
@EnableDiscoveryClient
|
||||||
|
@EnableFeignClients
|
||||||
|
@MapperScan(basePackages = "com.mashibing.test.mapper")
|
||||||
|
public class TestStarterApp {
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
SpringApplication.run(TestStarterApp.class,args);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,27 @@
|
|||||||
|
package com.mashibing.test.client;
|
||||||
|
|
||||||
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
|
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.RequestParam;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author dch
|
||||||
|
* @create 2024-03-20 0:50
|
||||||
|
*/
|
||||||
|
@FeignClient(value = "beacon-cache")
|
||||||
|
public interface CacheClient {
|
||||||
|
|
||||||
|
@PostMapping(value = "/cache/hmset/{key}")
|
||||||
|
void hmset(@PathVariable(value = "key")String key, @RequestBody Map<String,Object> map);
|
||||||
|
|
||||||
|
@PostMapping(value = "/cache/set/{key}")
|
||||||
|
void set(@PathVariable(value = "key")String key, @RequestParam(value = "value")Object value);
|
||||||
|
|
||||||
|
@PostMapping(value = "/cache/sadd/{key}")
|
||||||
|
void sadd(@PathVariable(value = "key")String key, @RequestBody Map<String,Object>... maps);
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,144 @@
|
|||||||
|
package com.mashibing.test.entity;
|
||||||
|
|
||||||
|
|
||||||
|
public class ClientBalance {
|
||||||
|
|
||||||
|
private long id;
|
||||||
|
private long clientId;
|
||||||
|
private long balance;
|
||||||
|
private java.sql.Timestamp created;
|
||||||
|
private long createId;
|
||||||
|
private java.sql.Timestamp updated;
|
||||||
|
private long updateId;
|
||||||
|
private long isDelete;
|
||||||
|
private String extend1;
|
||||||
|
private String extend2;
|
||||||
|
private String extend3;
|
||||||
|
private String extend4;
|
||||||
|
|
||||||
|
|
||||||
|
public long getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(long id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public long getClientId() {
|
||||||
|
return clientId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setClientId(long clientId) {
|
||||||
|
this.clientId = clientId;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public long getBalance() {
|
||||||
|
return balance;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBalance(long balance) {
|
||||||
|
this.balance = balance;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public java.sql.Timestamp getCreated() {
|
||||||
|
return created;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCreated(java.sql.Timestamp created) {
|
||||||
|
this.created = created;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public long getCreateId() {
|
||||||
|
return createId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCreateId(long createId) {
|
||||||
|
this.createId = createId;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public java.sql.Timestamp getUpdated() {
|
||||||
|
return updated;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUpdated(java.sql.Timestamp updated) {
|
||||||
|
this.updated = updated;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public long getUpdateId() {
|
||||||
|
return updateId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUpdateId(long updateId) {
|
||||||
|
this.updateId = updateId;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public long getIsDelete() {
|
||||||
|
return isDelete;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIsDelete(long isDelete) {
|
||||||
|
this.isDelete = isDelete;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String getExtend1() {
|
||||||
|
return extend1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setExtend1(String extend1) {
|
||||||
|
this.extend1 = extend1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String getExtend2() {
|
||||||
|
return extend2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setExtend2(String extend2) {
|
||||||
|
this.extend2 = extend2;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String getExtend3() {
|
||||||
|
return extend3;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setExtend3(String extend3) {
|
||||||
|
this.extend3 = extend3;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String getExtend4() {
|
||||||
|
return extend4;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setExtend4(String extend4) {
|
||||||
|
this.extend4 = extend4;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "ClientBalance{" +
|
||||||
|
"id=" + id +
|
||||||
|
", clientId=" + clientId +
|
||||||
|
", balance=" + balance +
|
||||||
|
", created=" + created +
|
||||||
|
", createId=" + createId +
|
||||||
|
", updated=" + updated +
|
||||||
|
", updateId=" + updateId +
|
||||||
|
", isDelete=" + isDelete +
|
||||||
|
", extend1='" + extend1 + '\'' +
|
||||||
|
", extend2='" + extend2 + '\'' +
|
||||||
|
", extend3='" + extend3 + '\'' +
|
||||||
|
", extend4='" + extend4 + '\'' +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,210 @@
|
|||||||
|
package com.mashibing.test.entity;
|
||||||
|
|
||||||
|
|
||||||
|
public class ClientBusiness {
|
||||||
|
|
||||||
|
private long id;
|
||||||
|
private String corpname;
|
||||||
|
private String apikey;
|
||||||
|
private String ipAddress;
|
||||||
|
private long isCallback;
|
||||||
|
private String callbackUrl;
|
||||||
|
private String clientLinkname;
|
||||||
|
private String clientPhone;
|
||||||
|
private String clientFilters;
|
||||||
|
private java.sql.Timestamp created;
|
||||||
|
private long createId;
|
||||||
|
private java.sql.Timestamp updated;
|
||||||
|
private long updateId;
|
||||||
|
private long isDelete;
|
||||||
|
private String extend1;
|
||||||
|
private String extend2;
|
||||||
|
private String extend3;
|
||||||
|
private String extend4;
|
||||||
|
|
||||||
|
|
||||||
|
public long getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(long id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String getCorpname() {
|
||||||
|
return corpname;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCorpname(String corpname) {
|
||||||
|
this.corpname = corpname;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String getApikey() {
|
||||||
|
return apikey;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setApikey(String apikey) {
|
||||||
|
this.apikey = apikey;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String getIpAddress() {
|
||||||
|
return ipAddress;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIpAddress(String ipAddress) {
|
||||||
|
this.ipAddress = ipAddress;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public long getIsCallback() {
|
||||||
|
return isCallback;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIsCallback(long isCallback) {
|
||||||
|
this.isCallback = isCallback;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String getCallbackUrl() {
|
||||||
|
return callbackUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCallbackUrl(String callbackUrl) {
|
||||||
|
this.callbackUrl = callbackUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String getClientLinkname() {
|
||||||
|
return clientLinkname;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setClientLinkname(String clientLinkname) {
|
||||||
|
this.clientLinkname = clientLinkname;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String getClientPhone() {
|
||||||
|
return clientPhone;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setClientPhone(String clientPhone) {
|
||||||
|
this.clientPhone = clientPhone;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String getClientFilters() {
|
||||||
|
return clientFilters;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setClientFilters(String clientFilters) {
|
||||||
|
this.clientFilters = clientFilters;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public java.sql.Timestamp getCreated() {
|
||||||
|
return created;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCreated(java.sql.Timestamp created) {
|
||||||
|
this.created = created;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public long getCreateId() {
|
||||||
|
return createId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCreateId(long createId) {
|
||||||
|
this.createId = createId;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public java.sql.Timestamp getUpdated() {
|
||||||
|
return updated;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUpdated(java.sql.Timestamp updated) {
|
||||||
|
this.updated = updated;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public long getUpdateId() {
|
||||||
|
return updateId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUpdateId(long updateId) {
|
||||||
|
this.updateId = updateId;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public long getIsDelete() {
|
||||||
|
return isDelete;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIsDelete(long isDelete) {
|
||||||
|
this.isDelete = isDelete;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String getExtend1() {
|
||||||
|
return extend1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setExtend1(String extend1) {
|
||||||
|
this.extend1 = extend1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String getExtend2() {
|
||||||
|
return extend2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setExtend2(String extend2) {
|
||||||
|
this.extend2 = extend2;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String getExtend3() {
|
||||||
|
return extend3;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setExtend3(String extend3) {
|
||||||
|
this.extend3 = extend3;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String getExtend4() {
|
||||||
|
return extend4;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setExtend4(String extend4) {
|
||||||
|
this.extend4 = extend4;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "ClientBusiness{" +
|
||||||
|
"id=" + id +
|
||||||
|
", corpname='" + corpname + '\'' +
|
||||||
|
", apikey='" + apikey + '\'' +
|
||||||
|
", ipAddress='" + ipAddress + '\'' +
|
||||||
|
", isCallback=" + isCallback +
|
||||||
|
", callbackUrl='" + callbackUrl + '\'' +
|
||||||
|
", clientLinkname='" + clientLinkname + '\'' +
|
||||||
|
", clientPhone='" + clientPhone + '\'' +
|
||||||
|
", clientFilters='" + clientFilters + '\'' +
|
||||||
|
", created=" + created +
|
||||||
|
", createId=" + createId +
|
||||||
|
", updated=" + updated +
|
||||||
|
", updateId=" + updateId +
|
||||||
|
", isDelete=" + isDelete +
|
||||||
|
", extend1='" + extend1 + '\'' +
|
||||||
|
", extend2='" + extend2 + '\'' +
|
||||||
|
", extend3='" + extend3 + '\'' +
|
||||||
|
", extend4='" + extend4 + '\'' +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,199 @@
|
|||||||
|
package com.mashibing.test.entity;
|
||||||
|
|
||||||
|
|
||||||
|
public class ClientSign {
|
||||||
|
|
||||||
|
private long id;
|
||||||
|
private long clientId;
|
||||||
|
private String signInfo;
|
||||||
|
private long signState;
|
||||||
|
private long signType;
|
||||||
|
private String businessWeb;
|
||||||
|
private String proveDescr;
|
||||||
|
private String proveFile;
|
||||||
|
private java.sql.Timestamp created;
|
||||||
|
private long createId;
|
||||||
|
private java.sql.Timestamp updated;
|
||||||
|
private long updateId;
|
||||||
|
private long isDelete;
|
||||||
|
private String extend1;
|
||||||
|
private String extend2;
|
||||||
|
private String extend3;
|
||||||
|
private String extend4;
|
||||||
|
|
||||||
|
|
||||||
|
public long getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(long id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public long getClientId() {
|
||||||
|
return clientId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setClientId(long clientId) {
|
||||||
|
this.clientId = clientId;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String getSignInfo() {
|
||||||
|
return signInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSignInfo(String signInfo) {
|
||||||
|
this.signInfo = signInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public long getSignState() {
|
||||||
|
return signState;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSignState(long signState) {
|
||||||
|
this.signState = signState;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public long getSignType() {
|
||||||
|
return signType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSignType(long signType) {
|
||||||
|
this.signType = signType;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String getBusinessWeb() {
|
||||||
|
return businessWeb;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBusinessWeb(String businessWeb) {
|
||||||
|
this.businessWeb = businessWeb;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String getProveDescr() {
|
||||||
|
return proveDescr;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProveDescr(String proveDescr) {
|
||||||
|
this.proveDescr = proveDescr;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String getProveFile() {
|
||||||
|
return proveFile;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setProveFile(String proveFile) {
|
||||||
|
this.proveFile = proveFile;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public java.sql.Timestamp getCreated() {
|
||||||
|
return created;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCreated(java.sql.Timestamp created) {
|
||||||
|
this.created = created;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public long getCreateId() {
|
||||||
|
return createId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCreateId(long createId) {
|
||||||
|
this.createId = createId;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public java.sql.Timestamp getUpdated() {
|
||||||
|
return updated;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUpdated(java.sql.Timestamp updated) {
|
||||||
|
this.updated = updated;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public long getUpdateId() {
|
||||||
|
return updateId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUpdateId(long updateId) {
|
||||||
|
this.updateId = updateId;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public long getIsDelete() {
|
||||||
|
return isDelete;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIsDelete(long isDelete) {
|
||||||
|
this.isDelete = isDelete;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String getExtend1() {
|
||||||
|
return extend1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setExtend1(String extend1) {
|
||||||
|
this.extend1 = extend1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String getExtend2() {
|
||||||
|
return extend2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setExtend2(String extend2) {
|
||||||
|
this.extend2 = extend2;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String getExtend3() {
|
||||||
|
return extend3;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setExtend3(String extend3) {
|
||||||
|
this.extend3 = extend3;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String getExtend4() {
|
||||||
|
return extend4;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setExtend4(String extend4) {
|
||||||
|
this.extend4 = extend4;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "ClientSign{" +
|
||||||
|
"id=" + id +
|
||||||
|
", clientId=" + clientId +
|
||||||
|
", signInfo='" + signInfo + '\'' +
|
||||||
|
", signState=" + signState +
|
||||||
|
", signType=" + signType +
|
||||||
|
", businessWeb='" + businessWeb + '\'' +
|
||||||
|
", proveDescr='" + proveDescr + '\'' +
|
||||||
|
", proveFile='" + proveFile + '\'' +
|
||||||
|
", created=" + created +
|
||||||
|
", createId=" + createId +
|
||||||
|
", updated=" + updated +
|
||||||
|
", updateId=" + updateId +
|
||||||
|
", isDelete=" + isDelete +
|
||||||
|
", extend1='" + extend1 + '\'' +
|
||||||
|
", extend2='" + extend2 + '\'' +
|
||||||
|
", extend3='" + extend3 + '\'' +
|
||||||
|
", extend4='" + extend4 + '\'' +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,188 @@
|
|||||||
|
package com.mashibing.test.entity;
|
||||||
|
|
||||||
|
|
||||||
|
public class ClientTemplate {
|
||||||
|
|
||||||
|
private long id;
|
||||||
|
private long signId;
|
||||||
|
private String templateText;
|
||||||
|
private long templateType;
|
||||||
|
private long templateState;
|
||||||
|
private long useId;
|
||||||
|
private String useWeb;
|
||||||
|
private java.sql.Timestamp created;
|
||||||
|
private long createId;
|
||||||
|
private java.sql.Timestamp updated;
|
||||||
|
private long updateId;
|
||||||
|
private long isDelete;
|
||||||
|
private String extend1;
|
||||||
|
private String extend2;
|
||||||
|
private String extend3;
|
||||||
|
private String extend4;
|
||||||
|
|
||||||
|
|
||||||
|
public long getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(long id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public long getSignId() {
|
||||||
|
return signId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSignId(long signId) {
|
||||||
|
this.signId = signId;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String getTemplateText() {
|
||||||
|
return templateText;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTemplateText(String templateText) {
|
||||||
|
this.templateText = templateText;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public long getTemplateType() {
|
||||||
|
return templateType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTemplateType(long templateType) {
|
||||||
|
this.templateType = templateType;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public long getTemplateState() {
|
||||||
|
return templateState;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTemplateState(long templateState) {
|
||||||
|
this.templateState = templateState;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public long getUseId() {
|
||||||
|
return useId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUseId(long useId) {
|
||||||
|
this.useId = useId;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String getUseWeb() {
|
||||||
|
return useWeb;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUseWeb(String useWeb) {
|
||||||
|
this.useWeb = useWeb;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public java.sql.Timestamp getCreated() {
|
||||||
|
return created;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCreated(java.sql.Timestamp created) {
|
||||||
|
this.created = created;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public long getCreateId() {
|
||||||
|
return createId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCreateId(long createId) {
|
||||||
|
this.createId = createId;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public java.sql.Timestamp getUpdated() {
|
||||||
|
return updated;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUpdated(java.sql.Timestamp updated) {
|
||||||
|
this.updated = updated;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public long getUpdateId() {
|
||||||
|
return updateId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUpdateId(long updateId) {
|
||||||
|
this.updateId = updateId;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public long getIsDelete() {
|
||||||
|
return isDelete;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIsDelete(long isDelete) {
|
||||||
|
this.isDelete = isDelete;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String getExtend1() {
|
||||||
|
return extend1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setExtend1(String extend1) {
|
||||||
|
this.extend1 = extend1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String getExtend2() {
|
||||||
|
return extend2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setExtend2(String extend2) {
|
||||||
|
this.extend2 = extend2;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String getExtend3() {
|
||||||
|
return extend3;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setExtend3(String extend3) {
|
||||||
|
this.extend3 = extend3;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public String getExtend4() {
|
||||||
|
return extend4;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setExtend4(String extend4) {
|
||||||
|
this.extend4 = extend4;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "ClientTemplate{" +
|
||||||
|
"id=" + id +
|
||||||
|
", signId=" + signId +
|
||||||
|
", templateText='" + templateText + '\'' +
|
||||||
|
", templateType=" + templateType +
|
||||||
|
", templateState=" + templateState +
|
||||||
|
", useId=" + useId +
|
||||||
|
", useWeb='" + useWeb + '\'' +
|
||||||
|
", created=" + created +
|
||||||
|
", createId=" + createId +
|
||||||
|
", updated=" + updated +
|
||||||
|
", updateId=" + updateId +
|
||||||
|
", isDelete=" + isDelete +
|
||||||
|
", extend1='" + extend1 + '\'' +
|
||||||
|
", extend2='" + extend2 + '\'' +
|
||||||
|
", extend3='" + extend3 + '\'' +
|
||||||
|
", extend4='" + extend4 + '\'' +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,14 @@
|
|||||||
|
package com.mashibing.test.mapper;
|
||||||
|
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.apache.ibatis.annotations.Select;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author dch
|
||||||
|
* @create 2024-03-20 1:28
|
||||||
|
*/
|
||||||
|
public interface ClientBalanceMapper {
|
||||||
|
@Select("select balance from client_balance where client_id = #{clientId}")
|
||||||
|
Long findByClientId(@Param("clientId")Long clientId);
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,16 @@
|
|||||||
|
package com.mashibing.test.mapper;
|
||||||
|
|
||||||
|
import com.mashibing.test.entity.ClientBusiness;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.apache.ibatis.annotations.Select;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author dch
|
||||||
|
* @create 2024-03-20 0:19
|
||||||
|
*/
|
||||||
|
public interface ClientBusinessMapper {
|
||||||
|
|
||||||
|
@Select("select * from client_business where id = #{id}")
|
||||||
|
ClientBusiness findById(@Param("id") Long id);
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,16 @@
|
|||||||
|
package com.mashibing.test.mapper;
|
||||||
|
|
||||||
|
import com.mashibing.test.entity.ClientSign;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.apache.ibatis.annotations.Select;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author dch
|
||||||
|
* @create 2024-03-20 1:06
|
||||||
|
*/
|
||||||
|
public interface ClientSignMapper {
|
||||||
|
@Select("select * from client_sign where client_id = #{clientId}")
|
||||||
|
List<ClientSign> findByClientId(@Param("clientId")Long clientId);
|
||||||
|
}
|
@ -0,0 +1,17 @@
|
|||||||
|
package com.mashibing.test.mapper;
|
||||||
|
|
||||||
|
import com.mashibing.test.entity.ClientTemplate;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.apache.ibatis.annotations.Select;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author dch
|
||||||
|
* @create 2024-03-20 1:24
|
||||||
|
*/
|
||||||
|
public interface ClientTemplateMapper {
|
||||||
|
@Select("select * from client_template where sign_id = #{signId}")
|
||||||
|
List<ClientTemplate> findBySignId(@Param("signId") Long signId);
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,23 @@
|
|||||||
|
# 服务名
|
||||||
|
spring:
|
||||||
|
application:
|
||||||
|
name: beacon-test
|
||||||
|
# nacos地址
|
||||||
|
cloud:
|
||||||
|
nacos:
|
||||||
|
discovery:
|
||||||
|
server-addr: 192.168.43.132:8848
|
||||||
|
# datasource
|
||||||
|
datasource:
|
||||||
|
driver-class-name: org.gjt.mm.mysql.Driver
|
||||||
|
url: jdbc:mysql://localhost:3306/beacon_cloud?characterEncoding=utf-8&useSSL=false
|
||||||
|
username: root
|
||||||
|
password: 1234
|
||||||
|
# 端口号
|
||||||
|
server:
|
||||||
|
port: 20000
|
||||||
|
|
||||||
|
# mybatis
|
||||||
|
mybatis:
|
||||||
|
configuration:
|
||||||
|
map-underscore-to-camel-case: true
|
@ -0,0 +1,33 @@
|
|||||||
|
package com.mashibing.test.mapper;
|
||||||
|
|
||||||
|
import com.mashibing.test.client.CacheClient;
|
||||||
|
import org.junit.Test;
|
||||||
|
import org.junit.runner.RunWith;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
|
import org.springframework.test.context.junit4.SpringRunner;
|
||||||
|
|
||||||
|
import static org.junit.Assert.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author dch
|
||||||
|
* @create 2024-03-20 1:29
|
||||||
|
*/
|
||||||
|
@SpringBootTest
|
||||||
|
@RunWith(SpringRunner.class)
|
||||||
|
public class ClientBalanceMapperTest {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ClientBalanceMapper mapper;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private CacheClient cacheClient;
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void findByClientId() {
|
||||||
|
Long balance = mapper.findByClientId(1L);
|
||||||
|
System.out.println(balance);
|
||||||
|
|
||||||
|
cacheClient.set("client_balance:1", balance);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,40 @@
|
|||||||
|
package com.mashibing.test.mapper;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||||
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
import com.mashibing.test.client.CacheClient;
|
||||||
|
import com.mashibing.test.entity.ClientBusiness;
|
||||||
|
import org.junit.Test;
|
||||||
|
import org.junit.runner.RunWith;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
|
import org.springframework.test.context.junit4.SpringRunner;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import static org.junit.Assert.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author dch
|
||||||
|
* @create 2024-03-20 0:36
|
||||||
|
*/
|
||||||
|
@SpringBootTest
|
||||||
|
@RunWith(SpringRunner.class)
|
||||||
|
public class ClientBusinessMapperTest {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ClientBusinessMapper mapper;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private CacheClient cacheClient;
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void findById() throws JsonProcessingException {
|
||||||
|
ClientBusiness cb = mapper.findById(1L);
|
||||||
|
ObjectMapper objectMapper = new ObjectMapper();
|
||||||
|
Map map = objectMapper.readValue(objectMapper.writeValueAsString(cb), Map.class);
|
||||||
|
cacheClient.hmset("client_business:"+cb.getApikey(),map);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,53 @@
|
|||||||
|
package com.mashibing.test.mapper;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||||
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
import com.mashibing.test.client.CacheClient;
|
||||||
|
import com.mashibing.test.entity.ClientSign;
|
||||||
|
import org.junit.Test;
|
||||||
|
import org.junit.runner.RunWith;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
|
import org.springframework.test.context.junit4.SpringRunner;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
import static org.junit.Assert.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author dch
|
||||||
|
* @create 2024-03-20 1:08
|
||||||
|
*/
|
||||||
|
@SpringBootTest
|
||||||
|
@RunWith(SpringRunner.class)
|
||||||
|
public class ClientSignMapperTest {
|
||||||
|
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private CacheClient cacheClient;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ClientSignMapper mapper;
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void findByClientId() {
|
||||||
|
List<ClientSign> list = mapper.findByClientId(1L);
|
||||||
|
for (ClientSign clientSign : list) {
|
||||||
|
System.out.println(clientSign);
|
||||||
|
}
|
||||||
|
|
||||||
|
ObjectMapper objectMapper = new ObjectMapper();
|
||||||
|
List<Map> value = list.stream().map(cs -> {
|
||||||
|
try {
|
||||||
|
return objectMapper.readValue(objectMapper.writeValueAsString(cs), Map.class);
|
||||||
|
} catch (JsonProcessingException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}).collect(Collectors.toList());
|
||||||
|
|
||||||
|
cacheClient.sadd("client_sign:1",value.toArray(new Map[]{}));
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,56 @@
|
|||||||
|
package com.mashibing.test.mapper;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||||
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
import com.mashibing.test.client.CacheClient;
|
||||||
|
import com.mashibing.test.entity.ClientTemplate;
|
||||||
|
import org.junit.Test;
|
||||||
|
import org.junit.runner.RunWith;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
|
import org.springframework.test.context.junit4.SpringRunner;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
import static org.junit.Assert.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author dch
|
||||||
|
* @create 2024-03-20 1:25
|
||||||
|
*/
|
||||||
|
@SpringBootTest
|
||||||
|
@RunWith(SpringRunner.class)
|
||||||
|
public class ClientTemplateMapperTest {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ClientTemplateMapper mapper;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private CacheClient cacheClient;
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void findBySignId() {
|
||||||
|
List<ClientTemplate> ct1 = mapper.findBySignId(15L);
|
||||||
|
List<ClientTemplate> ct2 = mapper.findBySignId(24L);
|
||||||
|
for (ClientTemplate clientTemplate : ct1) {
|
||||||
|
System.out.println(clientTemplate);
|
||||||
|
}
|
||||||
|
// ct2在现有的库中没有数据
|
||||||
|
System.out.println(ct2);
|
||||||
|
|
||||||
|
ObjectMapper objectMapper = new ObjectMapper();
|
||||||
|
List<Map> value = ct1.stream().map(ct -> {
|
||||||
|
try {
|
||||||
|
return objectMapper.readValue(objectMapper.writeValueAsString(ct), Map.class);
|
||||||
|
} catch (JsonProcessingException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}).collect(Collectors.toList());
|
||||||
|
|
||||||
|
|
||||||
|
cacheClient.sadd("client_template:15",value.toArray(new Map[]{}));
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in new issue