diff --git a/README.md b/README.md index 1821d7241430ccaf1042ce0571ae23be791f70d4..9f195113e4032314ac46a2bcf1d233b3d3c4a290 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,7 @@ com.mqttsnet.thinglinks │ └── thinglinks-modules-tdengine // TDengine服务 [19304] │ └── thinglinks-modules-link // Link服务 [19305] └── thinglinks-modules-broker // broker服务 [19306]、[MQTT-TCP:11883]、[MQTT-SSL:18443]、[MQTT-WS:18999] +├── thinglinks-registry // 注册中心微应用 ├── thinglinks-visual // 图形化管理模块 │ └── thinglinks-visual-monitor // 监控中心 [19400] │ └── thinglinks-visual-collection // 服务器监控采集服务 [19401] @@ -89,6 +90,8 @@ com.mqttsnet.thinglinks *、设备管理页面展示优化(实现中) +*、产品管理(后台接口已完成,web实现中) + *、设备消息列表(实现中) *、Docker容器化部署(实现中) diff --git a/doc/nacos-config/DEFAULT_GROUP/application-dev.yml b/doc/nacos-config/DEFAULT_GROUP/application-dev.yml index 3e6ca550278f189c76ce938f08b0b80e05b4018f..1c14e8244cb0f937f14726691ce3bdf5f177f963 100644 --- a/doc/nacos-config/DEFAULT_GROUP/application-dev.yml +++ b/doc/nacos-config/DEFAULT_GROUP/application-dev.yml @@ -1,5 +1,6 @@ spring: main: + allow-circular-references: true allow-bean-definition-overriding: true autoconfigure: exclude: com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceAutoConfigure diff --git a/doc/nacos-config/DEFAULT_GROUP/thinglinks-broker-dev.yml b/doc/nacos-config/DEFAULT_GROUP/thinglinks-broker-dev.yml index a5aaec2017bf6a319f42b9f5106d4301cc2a279e..989b5dddb1015ffbede5f43d39d4b50b32f99893 100644 --- a/doc/nacos-config/DEFAULT_GROUP/thinglinks-broker-dev.yml +++ b/doc/nacos-config/DEFAULT_GROUP/thinglinks-broker-dev.yml @@ -73,13 +73,13 @@ seata: nacos: serverAddr: 127.0.0.1:8848 group: SEATA_GROUP - namespace: 1e1aff6c-da73-43e2-9e5f-8e0b890189d9 + namespace: 8ea40c2e-64ba-4430-9bd8-a25336b2b45a registry: type: nacos nacos: application: seata-server server-addr: 127.0.0.1:8848 - namespace: 1e1aff6c-da73-43e2-9e5f-8e0b890189d9 + namespace: 8ea40c2e-64ba-4430-9bd8-a25336b2b45a #smqtt官方配置文件V1.1.2 smqtt: diff --git a/doc/nacos-config/DEFAULT_GROUP/thinglinks-link-dev.yml b/doc/nacos-config/DEFAULT_GROUP/thinglinks-link-dev.yml index 8b91d290ac24614616002488f5733f11c53b8265..4c80ecd37694f700df5fb5a55125da17e665c5f4 100644 --- a/doc/nacos-config/DEFAULT_GROUP/thinglinks-link-dev.yml +++ b/doc/nacos-config/DEFAULT_GROUP/thinglinks-link-dev.yml @@ -23,6 +23,8 @@ spring: loginUsername: admin loginPassword: 123456 dynamic: + # 开启seata代理 + seata: true druid: initial-size: 5 min-idle: 5 @@ -52,26 +54,6 @@ spring: # url: # driver-class-name: # seata: true # 开启seata代理,开启后默认每个数据源都代理,如果某个不需要代理可单独关闭 -#kafka - kafka: - bootstrap-servers: 127.0.0.1:9092 - producer: - retries: 0 - batch-size: 16384 - buffer-memory: 33554432 - key-serializer: org.apache.kafka.common.serialization.StringSerializer - value-serializer: org.apache.kafka.common.serialization.StringSerializer - properties: - linger.ms: 1 - - consumer: - enable-auto-commit: false - auto-commit-interval: 100ms - key-deserializer: org.apache.kafka.common.serialization.StringDeserializer - value-deserializer: org.apache.kafka.common.serialization.StringDeserializer - properties: - session.timeout.ms: 15000 - group-id: thinglinks # rocketmq地址 rocketmq: @@ -97,31 +79,30 @@ thinglinks: # seata配置 seata: - # 默认关闭,如需启用spring.datasource.dynami.seata需要同时开启 - enabled: false + enabled: true # Seata 应用编号,默认为 ${spring.application.name} - application-id: ${spring.application.name} + application-id: thinglinks-link # Seata 事务组编号,用于 TC 集群名 - tx-service-group: ${spring.application.name}-group + tx-service-group: thinglinks-link-group # 关闭自动代理 enable-auto-data-source-proxy: false # 服务配置项 service: # 虚拟组和分组的映射 vgroup-mapping: - ruoyi-system-group: default + thinglinks-link-group: default config: type: nacos nacos: serverAddr: 127.0.0.1:8848 group: SEATA_GROUP - namespace: 1e1aff6c-da73-43e2-9e5f-8e0b890189d9 + namespace: registry: type: nacos nacos: application: seata-server server-addr: 127.0.0.1:8848 - namespace: 1e1aff6c-da73-43e2-9e5f-8e0b890189d9 + namespace: # mybatis配置 mybatis: diff --git a/doc/nacos-config/SEATA_GROUP/seataServer.properties b/doc/nacos-config/SEATA_GROUP/seataServer.properties new file mode 100644 index 0000000000000000000000000000000000000000..3f6577e37c31ab8b8ebbea51338a4cf34a7ca3cf --- /dev/null +++ b/doc/nacos-config/SEATA_GROUP/seataServer.properties @@ -0,0 +1,15 @@ +service.vgroupMapping.thinglinks-link-group=default +store.mode=db +store.db.datasource=druid +store.db.dbType=mysql +store.db.driverClassName=com.mysql.jdbc.Driver +store.db.url=jdbc:mysql://127.0.0.1:3306/thinglinks_seata?useUnicode=true +store.db.user=thinglinks_seata +store.db.password=6d5zMnpZ4BNh54Sw +store.db.minConn=5 +store.db.maxConn=30 +store.db.globalTable=global_table +store.db.branchTable=branch_table +store.db.queryLimit=100 +store.db.lockTable=lock_table +store.db.maxWait=5000 \ No newline at end of file diff --git a/pom.xml b/pom.xml index 5b39ce3e7845530a6d2a1a427aaeede456329754..59d29a9a9553363fbec682e354bf4a64284ea36d 100644 --- a/pom.xml +++ b/pom.xml @@ -260,6 +260,7 @@ thinglinks-modules thinglinks-api thinglinks-common + thinglinks-registry pom diff --git a/sql/thinglinks_seata_20210128.sql b/sql/thinglinks_seata_20210128.sql index 1c59c8c63493a5f2eaabd902774684c1009233d9..9b57ab26ba79fb349dcf3464bd68dfdbe81a72d0 100644 --- a/sql/thinglinks_seata_20210128.sql +++ b/sql/thinglinks_seata_20210128.sql @@ -1,11 +1,11 @@ -DROP DATABASE IF EXISTS `mqtts_seata`; +DROP DATABASE IF EXISTS `thinglinks_seata`; -CREATE DATABASE `mqtts_seata` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci; +CREATE DATABASE `thinglinks_seata` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci; SET NAMES utf8mb4; SET FOREIGN_KEY_CHECKS = 0; -USE `mqtts_seata`; +USE `thinglinks_seata`; -- -------------------------------- The script used when storeMode is 'db' -------------------------------- -- the table to store GlobalSession data diff --git a/thinglinks-common/thinglinks-common-redis/src/main/java/com/mqttsnet/thinglinks/common/redis/service/RedisService.java b/thinglinks-common/thinglinks-common-redis/src/main/java/com/mqttsnet/thinglinks/common/redis/service/RedisService.java index 7110144d15a1b08d6c283f4039b8705ac1c7f963..89106f8d3c3c6fb1a9d32fc369af371ebcaaf285 100644 --- a/thinglinks-common/thinglinks-common-redis/src/main/java/com/mqttsnet/thinglinks/common/redis/service/RedisService.java +++ b/thinglinks-common/thinglinks-common-redis/src/main/java/com/mqttsnet/thinglinks/common/redis/service/RedisService.java @@ -1,16 +1,10 @@ package com.mqttsnet.thinglinks.common.redis.service; -import java.util.Collection; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Set; +import java.util.*; import java.util.concurrent.TimeUnit; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.data.redis.core.BoundSetOperations; -import org.springframework.data.redis.core.HashOperations; -import org.springframework.data.redis.core.RedisTemplate; -import org.springframework.data.redis.core.ValueOperations; +import org.springframework.data.redis.connection.DataType; +import org.springframework.data.redis.core.*; import org.springframework.stereotype.Component; /** @@ -242,4 +236,1303 @@ public class RedisService { return redisTemplate.keys(pattern); } + + /** -------------------key相关操作--------------------- */ + + /** + * 删除key + * + * @param key + */ + public void delete(String key) { + redisTemplate.delete(key); + } + + /** + * 批量删除key + * + * @param keys + */ + public void delete(Collection keys) { + redisTemplate.delete(keys); + } + + /** + * 序列化key + * + * @param key + * @return + */ + public byte[] dump(String key) { + return redisTemplate.dump(key); + } + + + /** + * 设置过期时间 + * + * @param key + * @param date + * @return + */ + public Boolean expireAt(String key, Date date) { + return redisTemplate.expireAt(key, date); + } + + + /** + * 将当前数据库的 key 移动到给定的数据库 db 当中 + * + * @param key + * @param dbIndex + * @return + */ + public Boolean move(String key, int dbIndex) { + return redisTemplate.move(key, dbIndex); + } + + /** + * 移除 key 的过期时间,key 将持久保持 + * + * @param key + * @return + */ + public Boolean persist(String key) { + return redisTemplate.persist(key); + } + + /** + * 返回 key 的剩余的过期时间 + * + * @param key + * @param unit + * @return + */ + public Long getExpire(String key, TimeUnit unit) { + return redisTemplate.getExpire(key, unit); + } + + /** + * 返回 key 的剩余的过期时间 + * + * @param key + * @return + */ + public Long getExpire(String key) { + return redisTemplate.getExpire(key); + } + + /** + * 从当前数据库中随机返回一个 key + * + * @return + */ + public String randomKey() { + return (String) redisTemplate.randomKey(); + } + + /** + * 修改 key 的名称 + * + * @param oldKey + * @param newKey + */ + public void rename(String oldKey, String newKey) { + redisTemplate.rename(oldKey, newKey); + } + + /** + * 仅当 newkey 不存在时,将 oldKey 改名为 newkey + * + * @param oldKey + * @param newKey + * @return + */ + public Boolean renameIfAbsent(String oldKey, String newKey) { + return redisTemplate.renameIfAbsent(oldKey, newKey); + } + + /** + * 返回 key 所储存的值的类型 + * + * @param key + * @return + */ + public DataType type(String key) { + return redisTemplate.type(key); + } + + /** -------------------string相关操作--------------------- */ + + /** + * 设置指定 key 的值 + * @param key + * @param value + */ + public void set(String key, String value) { + redisTemplate.opsForValue().set(key, value); + } + + /** + * 获取指定 key 的值 + * @param key + * @return + */ + public String get(String key) { + return (String) redisTemplate.opsForValue().get(key); + } + + /** + * 返回 key 中字符串值的子字符 + * @param key + * @param start + * @param end + * @return + */ + public String getRange(String key, long start, long end) { + return redisTemplate.opsForValue().get(key, start, end); + } + + /** + * 将给定 key 的值设为 value ,并返回 key 的旧值(old value) + * + * @param key + * @param value + * @return + */ + public String getAndSet(String key, String value) { + return (String) redisTemplate.opsForValue().getAndSet(key, value); + } + + /** + * 对 key 所储存的字符串值,获取指定偏移量上的位(bit) + * + * @param key + * @param offset + * @return + */ + public Boolean getBit(String key, long offset) { + return redisTemplate.opsForValue().getBit(key, offset); + } + + /** + * 批量获取 + * + * @param keys + * @return + */ + public List multiGet(Collection keys) { + return redisTemplate.opsForValue().multiGet(keys); + } + + /** + * 设置ASCII码, 字符串'a'的ASCII码是97, 转为二进制是'01100001', 此方法是将二进制第offset位值变为value + * + * @param key + * @param offset + * 位置 + * @param value + * 值,true为1, false为0 + * @return + */ + public boolean setBit(String key, long offset, boolean value) { + return redisTemplate.opsForValue().setBit(key, offset, value); + } + + /** + * 将值 value 关联到 key ,并将 key 的过期时间设为 timeout + * + * @param key + * @param value + * @param timeout + * 过期时间 + * @param unit + * 时间单位, 天:TimeUnit.DAYS 小时:TimeUnit.HOURS 分钟:TimeUnit.MINUTES + * 秒:TimeUnit.SECONDS 毫秒:TimeUnit.MILLISECONDS + */ + public void setEx(String key, String value, long timeout, TimeUnit unit) { + redisTemplate.opsForValue().set(key, value, timeout, unit); + } + + /** + * 只有在 key 不存在时设置 key 的值 + * + * @param key + * @param value + * @return 之前已经存在返回false,不存在返回true + */ + public boolean setIfAbsent(String key, String value) { + return redisTemplate.opsForValue().setIfAbsent(key, value); + } + + /** + * 用 value 参数覆写给定 key 所储存的字符串值,从偏移量 offset 开始 + * + * @param key + * @param value + * @param offset + * 从指定位置开始覆写 + */ + public void setRange(String key, String value, long offset) { + redisTemplate.opsForValue().set(key, value, offset); + } + + /** + * 获取字符串的长度 + * + * @param key + * @return + */ + public Long size(String key) { + return redisTemplate.opsForValue().size(key); + } + + /** + * 批量添加 + * + * @param maps + */ + public void multiSet(Map maps) { + redisTemplate.opsForValue().multiSet(maps); + } + + /** + * 同时设置一个或多个 key-value 对,当且仅当所有给定 key 都不存在 + * + * @param maps + * @return 之前已经存在返回false,不存在返回true + */ + public boolean multiSetIfAbsent(Map maps) { + return redisTemplate.opsForValue().multiSetIfAbsent(maps); + } + + /** + * 增加(自增长), 负数则为自减 + * + * @param key + * @param increment + * @return + */ + public Long incrBy(String key, long increment) { + return redisTemplate.opsForValue().increment(key, increment); + } + + /** + * + * @param key + * @param increment + * @return + */ + public Double incrByFloat(String key, double increment) { + return redisTemplate.opsForValue().increment(key, increment); + } + + /** + * 追加到末尾 + * + * @param key + * @param value + * @return + */ + public Integer append(String key, String value) { + return redisTemplate.opsForValue().append(key, value); + } + + /** -------------------hash相关操作------------------------- */ + + /** + * 获取存储在哈希表中指定字段的值 + * + * @param key + * @param field + * @return + */ + public Object hGet(String key, String field) { + return redisTemplate.opsForHash().get(key, field); + } + + /** + * 获取所有给定字段的值 + * + * @param key + * @return + */ + public Map hGetAll(String key) { + return redisTemplate.opsForHash().entries(key); + } + + /** + * 获取所有给定字段的值 + * + * @param key + * @param fields + * @return + */ + public List hMultiGet(String key, Collection fields) { + return redisTemplate.opsForHash().multiGet(key, fields); + } + + public void hPut(String key, String hashKey, String value) { + redisTemplate.opsForHash().put(key, hashKey, value); + } + + public void hPutAll(String key, Map maps) { + redisTemplate.opsForHash().putAll(key, maps); + } + + /** + * 仅当hashKey不存在时才设置 + * + * @param key + * @param hashKey + * @param value + * @return + */ + public Boolean hPutIfAbsent(String key, String hashKey, String value) { + return redisTemplate.opsForHash().putIfAbsent(key, hashKey, value); + } + + /** + * 删除一个或多个哈希表字段 + * + * @param key + * @param fields + * @return + */ + public Long hDelete(String key, Object... fields) { + return redisTemplate.opsForHash().delete(key, fields); + } + + /** + * 查看哈希表 key 中,指定的字段是否存在 + * + * @param key + * @param field + * @return + */ + public boolean hExists(String key, String field) { + return redisTemplate.opsForHash().hasKey(key, field); + } + + /** + * 为哈希表 key 中的指定字段的整数值加上增量 increment + * + * @param key + * @param field + * @param increment + * @return + */ + public Long hIncrBy(String key, Object field, long increment) { + return redisTemplate.opsForHash().increment(key, field, increment); + } + + /** + * 为哈希表 key 中的指定字段的整数值加上增量 increment + * + * @param key + * @param field + * @param delta + * @return + */ + public Double hIncrByFloat(String key, Object field, double delta) { + return redisTemplate.opsForHash().increment(key, field, delta); + } + + /** + * 获取所有哈希表中的字段 + * + * @param key + * @return + */ + public Set hKeys(String key) { + return redisTemplate.opsForHash().keys(key); + } + + /** + * 获取哈希表中字段的数量 + * + * @param key + * @return + */ + public Long hSize(String key) { + return redisTemplate.opsForHash().size(key); + } + + /** + * 获取哈希表中所有值 + * + * @param key + * @return + */ + public List hValues(String key) { + return redisTemplate.opsForHash().values(key); + } + + /** + * 迭代哈希表中的键值对 + * + * @param key + * @param options + * @return + */ + public Cursor> hScan(String key, ScanOptions options) { + return redisTemplate.opsForHash().scan(key, options); + } + + /** ------------------------list相关操作---------------------------- */ + + /** + * 通过索引获取列表中的元素 + * + * @param key + * @param index + * @return + */ + public String lIndex(String key, long index) { + return (String) redisTemplate.opsForList().index(key, index); + } + + /** + * 获取列表指定范围内的元素 + * + * @param key + * @param start + * 开始位置, 0是开始位置 + * @param end + * 结束位置, -1返回所有 + * @return + */ + public List lRange(String key, long start, long end) { + return redisTemplate.opsForList().range(key, start, end); + } + + /** + * 存储在list头部 + * + * @param key + * @param value + * @return + */ + public Long lLeftPush(String key, String value) { + return redisTemplate.opsForList().leftPush(key, value); + } + + /** + * + * @param key + * @param value + * @return + */ + public Long lLeftPushAll(String key, String... value) { + return redisTemplate.opsForList().leftPushAll(key, value); + } + + /** + * + * @param key + * @param value + * @return + */ + public Long lLeftPushAll(String key, Collection value) { + return redisTemplate.opsForList().leftPushAll(key, value); + } + + /** + * 当list存在的时候才加入 + * + * @param key + * @param value + * @return + */ + public Long lLeftPushIfPresent(String key, String value) { + return redisTemplate.opsForList().leftPushIfPresent(key, value); + } + + /** + * 如果pivot存在,再pivot前面添加 + * + * @param key + * @param pivot + * @param value + * @return + */ + public Long lLeftPush(String key, String pivot, String value) { + return redisTemplate.opsForList().leftPush(key, pivot, value); + } + + /** + * + * @param key + * @param value + * @return + */ + public Long lRightPush(String key, String value) { + return redisTemplate.opsForList().rightPush(key, value); + } + + /** + * + * @param key + * @param value + * @return + */ + public Long lRightPushAll(String key, String... value) { + return redisTemplate.opsForList().rightPushAll(key, value); + } + + /** + * + * @param key + * @param value + * @return + */ + public Long lRightPushAll(String key, Collection value) { + return redisTemplate.opsForList().rightPushAll(key, value); + } + + /** + * 为已存在的列表添加值 + * + * @param key + * @param value + * @return + */ + public Long lRightPushIfPresent(String key, String value) { + return redisTemplate.opsForList().rightPushIfPresent(key, value); + } + + /** + * 在pivot元素的右边添加值 + * + * @param key + * @param pivot + * @param value + * @return + */ + public Long lRightPush(String key, String pivot, String value) { + return redisTemplate.opsForList().rightPush(key, pivot, value); + } + + /** + * 通过索引设置列表元素的值 + * + * @param key + * @param index + * 位置 + * @param value + */ + public void lSet(String key, long index, String value) { + redisTemplate.opsForList().set(key, index, value); + } + + /** + * 移出并获取列表的第一个元素 + * + * @param key + * @return 删除的元素 + */ + public String lLeftPop(String key) { + return (String) redisTemplate.opsForList().leftPop(key); + } + + /** + * 移出并获取列表的第一个元素, 如果列表没有元素会阻塞列表直到等待超时或发现可弹出元素为止 + * + * @param key + * @param timeout + * 等待时间 + * @param unit + * 时间单位 + * @return + */ + public String lBLeftPop(String key, long timeout, TimeUnit unit) { + return (String) redisTemplate.opsForList().leftPop(key, timeout, unit); + } + + /** + * 移除并获取列表最后一个元素 + * + * @param key + * @return 删除的元素 + */ + public String lRightPop(String key) { + return (String) redisTemplate.opsForList().rightPop(key); + } + + /** + * 移出并获取列表的最后一个元素, 如果列表没有元素会阻塞列表直到等待超时或发现可弹出元素为止 + * + * @param key + * @param timeout + * 等待时间 + * @param unit + * 时间单位 + * @return + */ + public String lBRightPop(String key, long timeout, TimeUnit unit) { + return (String) redisTemplate.opsForList().rightPop(key, timeout, unit); + } + + /** + * 移除列表的最后一个元素,并将该元素添加到另一个列表并返回 + * + * @param sourceKey + * @param destinationKey + * @return + */ + public String lRightPopAndLeftPush(String sourceKey, String destinationKey) { + return (String) redisTemplate.opsForList().rightPopAndLeftPush(sourceKey, + destinationKey); + } + + /** + * 从列表中弹出一个值,将弹出的元素插入到另外一个列表中并返回它; 如果列表没有元素会阻塞列表直到等待超时或发现可弹出元素为止 + * + * @param sourceKey + * @param destinationKey + * @param timeout + * @param unit + * @return + */ + public String lBRightPopAndLeftPush(String sourceKey, String destinationKey, + long timeout, TimeUnit unit) { + return (String) redisTemplate.opsForList().rightPopAndLeftPush(sourceKey, + destinationKey, timeout, unit); + } + + /** + * 删除集合中值等于value得元素 + * + * @param key + * @param index + * index=0, 删除所有值等于value的元素; index>0, 从头部开始删除第一个值等于value的元素; + * index<0, 从尾部开始删除第一个值等于value的元素; + * @param value + * @return + */ + public Long lRemove(String key, long index, String value) { + return redisTemplate.opsForList().remove(key, index, value); + } + + /** + * 裁剪list + * + * @param key + * @param start + * @param end + */ + public void lTrim(String key, long start, long end) { + redisTemplate.opsForList().trim(key, start, end); + } + + /** + * 获取列表长度 + * + * @param key + * @return + */ + public Long lLen(String key) { + return redisTemplate.opsForList().size(key); + } + + /** --------------------set相关操作-------------------------- */ + + /** + * set添加元素 + * + * @param key + * @param values + * @return + */ + public Long sAdd(String key, String... values) { + return redisTemplate.opsForSet().add(key, values); + } + + /** + * set移除元素 + * + * @param key + * @param values + * @return + */ + public Long sRemove(String key, Object... values) { + return redisTemplate.opsForSet().remove(key, values); + } + + /** + * 移除并返回集合的一个随机元素 + * + * @param key + * @return + */ + public String sPop(String key) { + return (String) redisTemplate.opsForSet().pop(key); + } + + /** + * 将元素value从一个集合移到另一个集合 + * + * @param key + * @param value + * @param destKey + * @return + */ + public Boolean sMove(String key, String value, String destKey) { + return redisTemplate.opsForSet().move(key, value, destKey); + } + + /** + * 获取集合的大小 + * + * @param key + * @return + */ + public Long sSize(String key) { + return redisTemplate.opsForSet().size(key); + } + + /** + * 判断集合是否包含value + * + * @param key + * @param value + * @return + */ + public Boolean sIsMember(String key, Object value) { + return redisTemplate.opsForSet().isMember(key, value); + } + + /** + * 获取两个集合的交集 + * + * @param key + * @param otherKey + * @return + */ + public Set sIntersect(String key, String otherKey) { + return redisTemplate.opsForSet().intersect(key, otherKey); + } + + /** + * 获取key集合与多个集合的交集 + * + * @param key + * @param otherKeys + * @return + */ + public Set sIntersect(String key, Collection otherKeys) { + return redisTemplate.opsForSet().intersect(key, otherKeys); + } + + /** + * key集合与otherKey集合的交集存储到destKey集合中 + * + * @param key + * @param otherKey + * @param destKey + * @return + */ + public Long sIntersectAndStore(String key, String otherKey, String destKey) { + return redisTemplate.opsForSet().intersectAndStore(key, otherKey, + destKey); + } + + /** + * key集合与多个集合的交集存储到destKey集合中 + * + * @param key + * @param otherKeys + * @param destKey + * @return + */ + public Long sIntersectAndStore(String key, Collection otherKeys, + String destKey) { + return redisTemplate.opsForSet().intersectAndStore(key, otherKeys, + destKey); + } + + /** + * 获取两个集合的并集 + * + * @param key + * @param otherKeys + * @return + */ + public Set sUnion(String key, String otherKeys) { + return redisTemplate.opsForSet().union(key, otherKeys); + } + + /** + * 获取key集合与多个集合的并集 + * + * @param key + * @param otherKeys + * @return + */ + public Set sUnion(String key, Collection otherKeys) { + return redisTemplate.opsForSet().union(key, otherKeys); + } + + /** + * key集合与otherKey集合的并集存储到destKey中 + * + * @param key + * @param otherKey + * @param destKey + * @return + */ + public Long sUnionAndStore(String key, String otherKey, String destKey) { + return redisTemplate.opsForSet().unionAndStore(key, otherKey, destKey); + } + + /** + * key集合与多个集合的并集存储到destKey中 + * + * @param key + * @param otherKeys + * @param destKey + * @return + */ + public Long sUnionAndStore(String key, Collection otherKeys, + String destKey) { + return redisTemplate.opsForSet().unionAndStore(key, otherKeys, destKey); + } + + /** + * 获取两个集合的差集 + * + * @param key + * @param otherKey + * @return + */ + public Set sDifference(String key, String otherKey) { + return redisTemplate.opsForSet().difference(key, otherKey); + } + + /** + * 获取key集合与多个集合的差集 + * + * @param key + * @param otherKeys + * @return + */ + public Set sDifference(String key, Collection otherKeys) { + return redisTemplate.opsForSet().difference(key, otherKeys); + } + + /** + * key集合与otherKey集合的差集存储到destKey中 + * + * @param key + * @param otherKey + * @param destKey + * @return + */ + public Long sDifference(String key, String otherKey, String destKey) { + return redisTemplate.opsForSet().differenceAndStore(key, otherKey, + destKey); + } + + /** + * key集合与多个集合的差集存储到destKey中 + * + * @param key + * @param otherKeys + * @param destKey + * @return + */ + public Long sDifference(String key, Collection otherKeys, + String destKey) { + return redisTemplate.opsForSet().differenceAndStore(key, otherKeys, + destKey); + } + + /** + * 获取集合所有元素 + * + * @param key + * @return + */ + public Set setMembers(String key) { + return redisTemplate.opsForSet().members(key); + } + + /** + * 随机获取集合中的一个元素 + * + * @param key + * @return + */ + public String sRandomMember(String key) { + return (String) redisTemplate.opsForSet().randomMember(key); + } + + /** + * 随机获取集合中count个元素 + * + * @param key + * @param count + * @return + */ + public List sRandomMembers(String key, long count) { + return redisTemplate.opsForSet().randomMembers(key, count); + } + + /** + * 随机获取集合中count个元素并且去除重复的 + * + * @param key + * @param count + * @return + */ + public Set sDistinctRandomMembers(String key, long count) { + return redisTemplate.opsForSet().distinctRandomMembers(key, count); + } + + /** + * + * @param key + * @param options + * @return + */ + public Cursor sScan(String key, ScanOptions options) { + return redisTemplate.opsForSet().scan(key, options); + } + + /**------------------zSet相关操作--------------------------------*/ + + /** + * 添加元素,有序集合是按照元素的score值由小到大排列 + * + * @param key + * @param value + * @param score + * @return + */ + public Boolean zAdd(String key, String value, double score) { + return redisTemplate.opsForZSet().add(key, value, score); + } + + /** + * + * @param key + * @param values + * @return + */ + public Long zAdd(String key, Set> values) { + return redisTemplate.opsForZSet().add(key, values); + } + + /** + * + * @param key + * @param values + * @return + */ + public Long zRemove(String key, Object... values) { + return redisTemplate.opsForZSet().remove(key, values); + } + + /** + * 增加元素的score值,并返回增加后的值 + * + * @param key + * @param value + * @param delta + * @return + */ + public Double zIncrementScore(String key, String value, double delta) { + return redisTemplate.opsForZSet().incrementScore(key, value, delta); + } + + /** + * 返回元素在集合的排名,有序集合是按照元素的score值由小到大排列 + * + * @param key + * @param value + * @return 0表示第一位 + */ + public Long zRank(String key, Object value) { + return redisTemplate.opsForZSet().rank(key, value); + } + + /** + * 返回元素在集合的排名,按元素的score值由大到小排列 + * + * @param key + * @param value + * @return + */ + public Long zReverseRank(String key, Object value) { + return redisTemplate.opsForZSet().reverseRank(key, value); + } + + /** + * 获取集合的元素, 从小到大排序 + * + * @param key + * @param start + * 开始位置 + * @param end + * 结束位置, -1查询所有 + * @return + */ + public Set zRange(String key, long start, long end) { + return redisTemplate.opsForZSet().range(key, start, end); + } + + /** + * 获取集合元素, 并且把score值也获取 + * + * @param key + * @param start + * @param end + * @return + */ + public Set> zRangeWithScores(String key, long start, + long end) { + return redisTemplate.opsForZSet().rangeWithScores(key, start, end); + } + + /** + * 根据Score值查询集合元素 + * + * @param key + * @param min + * 最小值 + * @param max + * 最大值 + * @return + */ + public Set zRangeByScore(String key, double min, double max) { + return redisTemplate.opsForZSet().rangeByScore(key, min, max); + } + + /** + * 根据Score值查询集合元素, 从小到大排序 + * + * @param key + * @param min + * 最小值 + * @param max + * 最大值 + * @return + */ + public Set> zRangeByScoreWithScores(String key, + double min, double max) { + return redisTemplate.opsForZSet().rangeByScoreWithScores(key, min, max); + } + + /** + * + * @param key + * @param min + * @param max + * @param start + * @param end + * @return + */ + public Set> zRangeByScoreWithScores(String key, + double min, double max, long start, long end) { + return redisTemplate.opsForZSet().rangeByScoreWithScores(key, min, max, + start, end); + } + + /** + * 获取集合的元素, 从大到小排序 + * + * @param key + * @param start + * @param end + * @return + */ + public Set zReverseRange(String key, long start, long end) { + return redisTemplate.opsForZSet().reverseRange(key, start, end); + } + + /** + * 获取集合的元素, 从大到小排序, 并返回score值 + * + * @param key + * @param start + * @param end + * @return + */ + public Set> zReverseRangeWithScores(String key, + long start, long end) { + return redisTemplate.opsForZSet().reverseRangeWithScores(key, start, + end); + } + + /** + * 根据Score值查询集合元素, 从大到小排序 + * + * @param key + * @param min + * @param max + * @return + */ + public Set zReverseRangeByScore(String key, double min, + double max) { + return redisTemplate.opsForZSet().reverseRangeByScore(key, min, max); + } + + /** + * 根据Score值查询集合元素, 从大到小排序 + * + * @param key + * @param min + * @param max + * @return + */ + public Set> zReverseRangeByScoreWithScores( + String key, double min, double max) { + return redisTemplate.opsForZSet().reverseRangeByScoreWithScores(key, + min, max); + } + + /** + * + * @param key + * @param min + * @param max + * @param start + * @param end + * @return + */ + public Set zReverseRangeByScore(String key, double min, + double max, long start, long end) { + return redisTemplate.opsForZSet().reverseRangeByScore(key, min, max, + start, end); + } + + /** + * 根据score值获取集合元素数量 + * + * @param key + * @param min + * @param max + * @return + */ + public Long zCount(String key, double min, double max) { + return redisTemplate.opsForZSet().count(key, min, max); + } + + /** + * 获取集合大小 + * + * @param key + * @return + */ + public Long zSize(String key) { + return redisTemplate.opsForZSet().size(key); + } + + /** + * 获取集合大小 + * + * @param key + * @return + */ + public Long zZCard(String key) { + return redisTemplate.opsForZSet().zCard(key); + } + + /** + * 获取集合中value元素的score值 + * + * @param key + * @param value + * @return + */ + public Double zScore(String key, Object value) { + return redisTemplate.opsForZSet().score(key, value); + } + + /** + * 移除指定索引位置的成员 + * + * @param key + * @param start + * @param end + * @return + */ + public Long zRemoveRange(String key, long start, long end) { + return redisTemplate.opsForZSet().removeRange(key, start, end); + } + + /** + * 根据指定的score值的范围来移除成员 + * + * @param key + * @param min + * @param max + * @return + */ + public Long zRemoveRangeByScore(String key, double min, double max) { + return redisTemplate.opsForZSet().removeRangeByScore(key, min, max); + } + + /** + * 获取key和otherKey的并集并存储在destKey中 + * + * @param key + * @param otherKey + * @param destKey + * @return + */ + public Long zUnionAndStore(String key, String otherKey, String destKey) { + return redisTemplate.opsForZSet().unionAndStore(key, otherKey, destKey); + } + + /** + * + * @param key + * @param otherKeys + * @param destKey + * @return + */ + public Long zUnionAndStore(String key, Collection otherKeys, + String destKey) { + return redisTemplate.opsForZSet() + .unionAndStore(key, otherKeys, destKey); + } + + /** + * 交集 + * + * @param key + * @param otherKey + * @param destKey + * @return + */ + public Long zIntersectAndStore(String key, String otherKey, + String destKey) { + return redisTemplate.opsForZSet().intersectAndStore(key, otherKey, + destKey); + } + + /** + * 交集 + * + * @param key + * @param otherKeys + * @param destKey + * @return + */ + public Long zIntersectAndStore(String key, Collection otherKeys, + String destKey) { + return redisTemplate.opsForZSet().intersectAndStore(key, otherKeys, + destKey); + } + + /** + * + * @param key + * @param options + * @return + */ + public Cursor> zScan(String key, ScanOptions options) { + return redisTemplate.opsForZSet().scan(key, options); + } } diff --git a/thinglinks-modules/thinglinks-modules-link/src/main/java/com/mqttsnet/thinglinks/link/service/device/impl/DeviceServiceImpl.java b/thinglinks-modules/thinglinks-modules-link/src/main/java/com/mqttsnet/thinglinks/link/service/device/impl/DeviceServiceImpl.java index c5ee85c4ac9cd5cdaa10ec901be12e5ea5976c0c..83b2709626d8db40ac6ed7da0ca9fdac2c2ae35f 100644 --- a/thinglinks-modules/thinglinks-modules-link/src/main/java/com/mqttsnet/thinglinks/link/service/device/impl/DeviceServiceImpl.java +++ b/thinglinks-modules/thinglinks-modules-link/src/main/java/com/mqttsnet/thinglinks/link/service/device/impl/DeviceServiceImpl.java @@ -177,7 +177,7 @@ public class DeviceServiceImpl implements DeviceService { public int insertDevice(Device device) { Device oneByClientIdAndDeviceIdentification = deviceMapper.findOneByClientIdOrDeviceIdentification(device.getClientId(), device.getDeviceIdentification()); - if(StringUtils.isNull(oneByClientIdAndDeviceIdentification)){ + if(StringUtils.isNotNull(oneByClientIdAndDeviceIdentification)){ return 0; } LoginUser loginUser = tokenService.getLoginUser(); diff --git a/thinglinks-modules/thinglinks-modules-link/src/main/java/com/mqttsnet/thinglinks/link/service/product/impl/ProductServiceImpl.java b/thinglinks-modules/thinglinks-modules-link/src/main/java/com/mqttsnet/thinglinks/link/service/product/impl/ProductServiceImpl.java index 940d7cf85273c60c98c3e1308038cb57b1c694c4..9d8953af7f56bab97938774cb8a2a68bb83aca4b 100644 --- a/thinglinks-modules/thinglinks-modules-link/src/main/java/com/mqttsnet/thinglinks/link/service/product/impl/ProductServiceImpl.java +++ b/thinglinks-modules/thinglinks-modules-link/src/main/java/com/mqttsnet/thinglinks/link/service/product/impl/ProductServiceImpl.java @@ -354,7 +354,7 @@ public class ProductServiceImpl implements ProductService{ public int insertProduct(Product product) { Product oneByProductName = productMapper.findOneByProductName(product.getProductName()); - if(StringUtils.isNull(oneByProductName)){ + if(StringUtils.isNotNull(oneByProductName)){ return 0; } product.setProductIdentification(UUID.getUUID()); diff --git a/thinglinks-registry/pom.xml b/thinglinks-registry/pom.xml new file mode 100644 index 0000000000000000000000000000000000000000..f76a7574b7b2b8601f775388b5c21fb0e35106f2 --- /dev/null +++ b/thinglinks-registry/pom.xml @@ -0,0 +1,18 @@ + + + + thinglinks + com.mqttsnet + ${thinglinks.version} + + 4.0.0 + + thinglinks-registry + + + thinglinks-registry 注册中心微应用 + + + \ No newline at end of file diff --git a/thinglinks-registry/seata-server/LICENSE b/thinglinks-registry/seata-server/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..7f77f44e739b555b76538b83fe898a4d786c554d --- /dev/null +++ b/thinglinks-registry/seata-server/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (properties) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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 + + http://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. \ No newline at end of file diff --git a/thinglinks-registry/seata-server/bin/seata-server.bat b/thinglinks-registry/seata-server/bin/seata-server.bat new file mode 100644 index 0000000000000000000000000000000000000000..26e7f3cec7cc26ef8415e18f562d35e51bc3ce84 --- /dev/null +++ b/thinglinks-registry/seata-server/bin/seata-server.bat @@ -0,0 +1,113 @@ +@REM ---------------------------------------------------------------------------- +@REM Copyright 2001-2006 The Apache Software Foundation. +@REM +@REM Licensed under the Apache License, Version 2.0 (the "License"); +@REM you may not use this file except in compliance with the License. +@REM You may obtain a copy of the License at +@REM +@REM http://www.apache.org/licenses/LICENSE-2.0 +@REM +@REM Unless required by applicable law or agreed to in writing, software +@REM distributed under the License is distributed on an "AS IS" BASIS, +@REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@REM See the License for the specific language governing permissions and +@REM limitations under the License. +@REM ---------------------------------------------------------------------------- +@REM +@REM Copyright (c) 2001-2006 The Apache Software Foundation. All rights +@REM reserved. + +@echo off + +set ERROR_CODE=0 + +:init +@REM Decide how to startup depending on the version of windows + +@REM -- Win98ME +if NOT "%OS%"=="Windows_NT" goto Win9xArg + +@REM set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" @setlocal + +@REM -- 4NT shell +if "%eval[2+2]" == "4" goto 4NTArgs + +@REM -- Regular WinNT shell +set CMD_LINE_ARGS=%* +goto WinNTGetScriptDir + +@REM The 4NT Shell from jp software +:4NTArgs +set CMD_LINE_ARGS=%$ +goto WinNTGetScriptDir + +:Win9xArg +@REM Slurp the command line arguments. This loop allows for an unlimited number +@REM of arguments (up to the command line limit, anyway). +set CMD_LINE_ARGS= +:Win9xApp +if %1a==a goto Win9xGetScriptDir +set CMD_LINE_ARGS=%CMD_LINE_ARGS% %1 +shift +goto Win9xApp + +:Win9xGetScriptDir +set SAVEDIR=%CD% +%0\ +cd %0\..\.. +set BASEDIR=%CD% +cd %SAVEDIR% +set SAVE_DIR= +goto repoSetup + +:WinNTGetScriptDir +set BASEDIR=%~dp0\.. + +:repoSetup +set REPO= + + +if "%JAVACMD%"=="" set JAVACMD=java + +if "%REPO%"=="" set REPO=%BASEDIR%\lib + +set CLASSPATH="%BASEDIR%"\conf;"%REPO%"\* + +set ENDORSED_DIR= +if NOT "%ENDORSED_DIR%" == "" set CLASSPATH="%BASEDIR%"\%ENDORSED_DIR%\*;%CLASSPATH% + +if NOT "%CLASSPATH_PREFIX%" == "" set CLASSPATH=%CLASSPATH_PREFIX%;%CLASSPATH% + +@REM Reaching here means variables are defined and arguments have been captured +:endInit + +%JAVACMD% %JAVA_OPTS% -server -Xmx2048m -Xms2048m -Xmn1024m -Xss512k -XX:SurvivorRatio=10 -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=256m -XX:MaxDirectMemorySize=1024m -XX:-OmitStackTraceInFastThrow -XX:-UseAdaptiveSizePolicy -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath="%BASEDIR%"/logs/java_heapdump.hprof -XX:+DisableExplicitGC -XX:+CMSParallelRemarkEnabled -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=75 -Xloggc:"%BASEDIR%"/logs/seata_gc.log -verbose:gc -Dio.netty.leakDetectionLevel=advanced -Dlogback.color.disable-for-bat=true -classpath %CLASSPATH% -Dapp.name="seata-server" -Dapp.repo="%REPO%" -Dapp.home="%BASEDIR%" -Dbasedir="%BASEDIR%" io.seata.server.Server %CMD_LINE_ARGS% +if %ERRORLEVEL% NEQ 0 goto error +goto end + +:error +if "%OS%"=="Windows_NT" @endlocal +set ERROR_CODE=%ERRORLEVEL% + +:end +@REM set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" goto endNT + +@REM For old DOS remove the set variables from ENV - we assume they were not set +@REM before we started - at least we don't leave any baggage around +set CMD_LINE_ARGS= +goto postExec + +:endNT +@REM If error code is set to 1 then the endlocal was done already in :error. +if %ERROR_CODE% EQU 0 @endlocal + + +:postExec + +if "%FORCE_EXIT_ON_ERROR%" == "on" ( + if %ERROR_CODE% NEQ 0 exit %ERROR_CODE% +) + +exit /B %ERROR_CODE% diff --git a/thinglinks-registry/seata-server/bin/seata-server.sh b/thinglinks-registry/seata-server/bin/seata-server.sh new file mode 100644 index 0000000000000000000000000000000000000000..ec6fc16141af64de62e7d92bbe01faef796cdcec --- /dev/null +++ b/thinglinks-registry/seata-server/bin/seata-server.sh @@ -0,0 +1,128 @@ +#!/bin/sh +# ---------------------------------------------------------------------------- +# Copyright 2001-2006 The Apache Software Foundation. +# +# 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 +# +# http://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. +# ---------------------------------------------------------------------------- +# +# Copyright (c) 2001-2006 The Apache Software Foundation. All rights +# reserved. + + +# resolve links - $0 may be a softlink +PRG="$0" + +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 + +PRGDIR=`dirname "$PRG"` +BASEDIR=`cd "$PRGDIR/.." >/dev/null; pwd` + +# Reset the REPO variable. If you need to influence this use the environment setup file. +REPO= + + +# OS specific support. $var _must_ be set to either true or false. +cygwin=false; +darwin=false; +case "`uname`" in + CYGWIN*) cygwin=true ;; + Darwin*) darwin=true + if [ -z "$JAVA_VERSION" ] ; then + JAVA_VERSION="CurrentJDK" + else + echo "Using Java version: $JAVA_VERSION" + fi + if [ -z "$JAVA_HOME" ]; then + if [ -x "/usr/libexec/java_home" ]; then + JAVA_HOME=`/usr/libexec/java_home` + else + JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/${JAVA_VERSION}/Home + fi + fi + ;; +esac + +if [ -z "$JAVA_HOME" ] ; then + if [ -r /etc/gentoo-release ] ; then + JAVA_HOME=`java-config --jre-home` + fi +fi + +# For Cygwin, ensure paths are in UNIX format before anything is touched +if $cygwin ; then + [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` + [ -n "$CLASSPATH" ] && CLASSPATH=`cygpath --path --unix "$CLASSPATH"` +fi + +# If a specific java binary isn't specified search for the standard 'java' binary +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." 1>&2 + echo " We cannot execute $JAVACMD" 1>&2 + exit 1 +fi + +if [ -z "$REPO" ] +then + REPO="$BASEDIR"/lib +fi + +CLASSPATH="$BASEDIR"/conf:"$REPO"/* + +ENDORSED_DIR= +if [ -n "$ENDORSED_DIR" ] ; then + CLASSPATH=$BASEDIR/$ENDORSED_DIR/*:$CLASSPATH +fi + +if [ -n "$CLASSPATH_PREFIX" ] ; then + CLASSPATH=$CLASSPATH_PREFIX:$CLASSPATH +fi + +# For Cygwin, switch paths to Windows format before running java +if $cygwin; then + [ -n "$CLASSPATH" ] && CLASSPATH=`cygpath --path --windows "$CLASSPATH"` + [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"` + [ -n "$HOME" ] && HOME=`cygpath --path --windows "$HOME"` + [ -n "$BASEDIR" ] && BASEDIR=`cygpath --path --windows "$BASEDIR"` + [ -n "$REPO" ] && REPO=`cygpath --path --windows "$REPO"` +fi + +exec "$JAVACMD" $JAVA_OPTS -server -Xmx2048m -Xms2048m -Xmn1024m -Xss512k -XX:SurvivorRatio=10 -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=256m -XX:MaxDirectMemorySize=1024m -XX:-OmitStackTraceInFastThrow -XX:-UseAdaptiveSizePolicy -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath="$BASEDIR"/logs/java_heapdump.hprof -XX:+DisableExplicitGC -XX:+CMSParallelRemarkEnabled -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=75 -Xloggc:"$BASEDIR"/logs/seata_gc.log -verbose:gc -Dio.netty.leakDetectionLevel=advanced -Dlogback.color.disable-for-bat=true \ + -classpath "$CLASSPATH" \ + -Dapp.name="seata-server" \ + -Dapp.pid="$$" \ + -Dapp.repo="$REPO" \ + -Dapp.home="$BASEDIR" \ + -Dbasedir="$BASEDIR" \ + io.seata.server.Server \ + "$@" diff --git a/thinglinks-registry/seata-server/conf/META-INF/services/io.seata.core.rpc.RegisterCheckAuthHandler b/thinglinks-registry/seata-server/conf/META-INF/services/io.seata.core.rpc.RegisterCheckAuthHandler new file mode 100644 index 0000000000000000000000000000000000000000..1a54728bca5b24a390475c7270158b45c21cab92 --- /dev/null +++ b/thinglinks-registry/seata-server/conf/META-INF/services/io.seata.core.rpc.RegisterCheckAuthHandler @@ -0,0 +1 @@ +io.seata.server.auth.DefaultCheckAuthHandler \ No newline at end of file diff --git a/thinglinks-registry/seata-server/conf/META-INF/services/io.seata.core.store.db.DataSourceProvider b/thinglinks-registry/seata-server/conf/META-INF/services/io.seata.core.store.db.DataSourceProvider new file mode 100644 index 0000000000000000000000000000000000000000..ac04a85e02d0e5b156186b7f936ab221fdc20080 --- /dev/null +++ b/thinglinks-registry/seata-server/conf/META-INF/services/io.seata.core.store.db.DataSourceProvider @@ -0,0 +1,3 @@ +io.seata.server.store.DbcpDataSourceProvider +io.seata.server.store.DruidDataSourceProvider +io.seata.server.store.HikariDataSourceProvider \ No newline at end of file diff --git a/thinglinks-registry/seata-server/conf/META-INF/services/io.seata.server.coordinator.AbstractCore b/thinglinks-registry/seata-server/conf/META-INF/services/io.seata.server.coordinator.AbstractCore new file mode 100644 index 0000000000000000000000000000000000000000..a80662b025e4f366c42fc66d4f1ce5eac136809e --- /dev/null +++ b/thinglinks-registry/seata-server/conf/META-INF/services/io.seata.server.coordinator.AbstractCore @@ -0,0 +1,4 @@ +io.seata.server.transaction.at.ATCore +io.seata.server.transaction.tcc.TccCore +io.seata.server.transaction.saga.SagaCore +io.seata.server.transaction.xa.XACore \ No newline at end of file diff --git a/thinglinks-registry/seata-server/conf/META-INF/services/io.seata.server.lock.LockManager b/thinglinks-registry/seata-server/conf/META-INF/services/io.seata.server.lock.LockManager new file mode 100644 index 0000000000000000000000000000000000000000..bca40c8591bcade897348c8886143e88a354cf98 --- /dev/null +++ b/thinglinks-registry/seata-server/conf/META-INF/services/io.seata.server.lock.LockManager @@ -0,0 +1,3 @@ +io.seata.server.storage.db.lock.DataBaseLockManager +io.seata.server.storage.file.lock.FileLockManager +io.seata.server.storage.redis.lock.RedisLockManager \ No newline at end of file diff --git a/thinglinks-registry/seata-server/conf/META-INF/services/io.seata.server.session.SessionManager b/thinglinks-registry/seata-server/conf/META-INF/services/io.seata.server.session.SessionManager new file mode 100644 index 0000000000000000000000000000000000000000..f2e82316792e9779ed52c5926422f96ac68dadb8 --- /dev/null +++ b/thinglinks-registry/seata-server/conf/META-INF/services/io.seata.server.session.SessionManager @@ -0,0 +1,3 @@ +io.seata.server.storage.file.session.FileSessionManager +io.seata.server.storage.db.session.DataBaseSessionManager +io.seata.server.storage.redis.session.RedisSessionManager \ No newline at end of file diff --git a/thinglinks-registry/seata-server/conf/README-zh.md b/thinglinks-registry/seata-server/conf/README-zh.md new file mode 100644 index 0000000000000000000000000000000000000000..beb509215902cf752e70e8275fe047d6d9677e0e --- /dev/null +++ b/thinglinks-registry/seata-server/conf/README-zh.md @@ -0,0 +1,30 @@ +# 脚本说明 + +## [client](https://github.com/seata/seata/tree/develop/script/client) + +> 存放用于客户端的配置和SQL + +- at: AT模式下的 `undo_log` 建表语句 +- conf: 客户端的配置文件 +- saga: SAGA 模式下所需表的建表语句 +- spring: SpringBoot 应用支持的配置文件 + +## [server](https://github.com/seata/seata/tree/develop/script/server) + +> 存放server侧所需SQL和部署脚本 + +- db: server 侧的保存模式为 `db` 时所需表的建表语句 +- docker-compose: server 侧通过 docker-compose 部署的脚本 +- helm: server 侧通过 Helm 部署的脚本 +- kubernetes: server 侧通过 Kubernetes 部署的脚本 + +## [config-center](https://github.com/seata/seata/tree/develop/script/config-center) + +> 用于存放各种配置中心的初始化脚本,执行时都会读取 `config.txt`配置文件,并写入配置中心 + +- nacos: 用于向 Nacos 中添加配置 +- zk: 用于向 Zookeeper 中添加配置,脚本依赖 Zookeeper 的相关脚本,需要手动下载;ZooKeeper相关的配置可以写在 `zk-params.txt` 中,也可以在执行的时候输入 +- apollo: 向 Apollo 中添加配置,Apollo 的地址端口等可以写在 `apollo-params.txt`,也可以在执行的时候输入 +- etcd3: 用于向 Etcd3 中添加配置 +- consul: 用于向 consul 中添加配置 + diff --git a/thinglinks-registry/seata-server/conf/README.md b/thinglinks-registry/seata-server/conf/README.md new file mode 100644 index 0000000000000000000000000000000000000000..f48c6aac48418e852d3c4214e8528afffea234bf --- /dev/null +++ b/thinglinks-registry/seata-server/conf/README.md @@ -0,0 +1,30 @@ +# Script Description + +## [client](https://github.com/seata/seata/tree/develop/script/client) + +> Store configuration and SQL for client side + +- at: Script of create table `undo_log` for AT mode. +- conf: Configuration which client need. +- saga: Script of create table in SAGA mode +- spring: Configuration for Spring Boot + +## [server](https://github.com/seata/seata/tree/develop/script/server) + +> Store SQL and deploy script for server side + +- db: Create table script for server when store mode is `db` +- docker-compose: Script for deploy server by docker-compose +- helm: Script for deploy server by Helm +- kubernetes: Script for deploy server by Kubernetes + +## [config-center](https://github.com/seata/seata/tree/develop/script/config-center) + +> Store initialize script for configuration center, will use `config.txt` as configuration when initial + +- nacos: Initialize script for Nacos +- zk: Initialize script for ZooKeeper, the script need related script in Zookeeper, you need download yourself. You can modify `zk-params.txt` to change the ZooKeeper server configuration, or input when execute also +- apollo: Initialize script for Apollo. You can modify `apollo-params.txt` to change the Apollo server configuration, or input when execute also +- etcd3: Initialize script for Etcd3 +- consul: Initialize script for consul + diff --git a/thinglinks-registry/seata-server/conf/file.conf b/thinglinks-registry/seata-server/conf/file.conf new file mode 100644 index 0000000000000000000000000000000000000000..bf50039f3da93524ea4cb15a49d4a19abfd54b48 --- /dev/null +++ b/thinglinks-registry/seata-server/conf/file.conf @@ -0,0 +1,65 @@ +## transaction log store, only used in seata-server +store { + ## store mode: file、db、redis + mode = "file" + ## rsa decryption public key + publicKey = "" + ## file store property + file { + ## store location dir + dir = "sessionStore" + # branch session size , if exceeded first try compress lockkey, still exceeded throws exceptions + maxBranchSessionSize = 16384 + # globe session size , if exceeded throws exceptions + maxGlobalSessionSize = 512 + # file buffer size , if exceeded allocate new buffer + fileWriteBufferCacheSize = 16384 + # when recover batch read size + sessionReloadReadSize = 100 + # async, sync + flushDiskMode = async + } + + ## database store property + db { + ## the implement of javax.sql.DataSource, such as DruidDataSource(druid)/BasicDataSource(dbcp)/HikariDataSource(hikari) etc. + datasource = "druid" + ## mysql/oracle/postgresql/h2/oceanbase etc. + dbType = "mysql" + driverClassName = "com.mysql.jdbc.Driver" + ## if using mysql to store the data, recommend add rewriteBatchedStatements=true in jdbc connection param + url = "jdbc:mysql://127.0.0.1:3306/seata?rewriteBatchedStatements=true" + user = "mysql" + password = "mysql" + minConn = 5 + maxConn = 100 + globalTable = "global_table" + branchTable = "branch_table" + lockTable = "lock_table" + queryLimit = 100 + maxWait = 5000 + } + + ## redis store property + redis { + ## redis mode: single、sentinel + mode = "single" + ## single mode property + single { + host = "127.0.0.1" + port = "6379" + } + ## sentinel mode property + sentinel { + masterName = "" + ## such as "10.28.235.65:26379,10.28.235.65:26380,10.28.235.65:26381" + sentinelHosts = "" + } + password = "" + database = "0" + minConn = 1 + maxConn = 10 + maxTotal = 100 + queryLimit = 100 + } +} diff --git a/thinglinks-registry/seata-server/conf/file.conf.example b/thinglinks-registry/seata-server/conf/file.conf.example new file mode 100644 index 0000000000000000000000000000000000000000..7eb189dcbefce6d34ee43776bb2e903bc3898e6c --- /dev/null +++ b/thinglinks-registry/seata-server/conf/file.conf.example @@ -0,0 +1,104 @@ +transport { + # tcp, unix-domain-socket + type = "TCP" + #NIO, NATIVE + server = "NIO" + #enable heartbeat + heartbeat = true + # the client batch send request enable + enableClientBatchSendRequest = false + #thread factory for netty + threadFactory { + bossThreadPrefix = "NettyBoss" + workerThreadPrefix = "NettyServerNIOWorker" + serverExecutorThreadPrefix = "NettyServerBizHandler" + shareBossWorker = false + clientSelectorThreadPrefix = "NettyClientSelector" + clientSelectorThreadSize = 1 + clientWorkerThreadPrefix = "NettyClientWorkerThread" + # netty boss thread size + bossThreadSize = 1 + #auto default pin or 8 + workerThreadSize = "default" + } + shutdown { + # when destroy server, wait seconds + wait = 3 + } + serialization = "seata" + compressor = "none" +} + +## transaction log store, only used in server side +store { + ## store mode: file、db + mode = "file" + ## file store property + file { + ## store location dir + dir = "sessionStore" + # branch session size , if exceeded first try compress lockkey, still exceeded throws exceptions + maxBranchSessionSize = 16384 + # globe session size , if exceeded throws exceptions + maxGlobalSessionSize = 512 + # file buffer size , if exceeded allocate new buffer + fileWriteBufferCacheSize = 16384 + # when recover batch read size + sessionReloadReadSize = 100 + # async, sync + flushDiskMode = async + } + + ## database store property + db { + ## the implement of javax.sql.DataSource, such as DruidDataSource(druid)/BasicDataSource(dbcp) etc. + datasource = "druid" + ## mysql/oracle/postgresql/h2/oceanbase etc. + dbType = "mysql" + driverClassName = "com.mysql.jdbc.Driver" + ## if using mysql to store the data, recommend add rewriteBatchedStatements=true in jdbc connection param + url = "jdbc:mysql://127.0.0.1:3306/seata?rewriteBatchedStatements=true" + user = "mysql" + password = "mysql" + minConn = 5 + maxConn = 30 + globalTable = "global_table" + branchTable = "branch_table" + lockTable = "lock_table" + queryLimit = 100 + } +} +## server configuration, only used in server side +server { + recovery { + #schedule committing retry period in milliseconds + committingRetryPeriod = 1000 + #schedule asyn committing retry period in milliseconds + asynCommittingRetryPeriod = 1000 + #schedule rollbacking retry period in milliseconds + rollbackingRetryPeriod = 1000 + #schedule timeout retry period in milliseconds + timeoutRetryPeriod = 1000 + } + undo { + logSaveDays = 7 + #schedule delete expired undo_log in milliseconds + logDeletePeriod = 86400000 + } + #check auth + enableCheckAuth = true + #unit ms,s,m,h,d represents milliseconds, seconds, minutes, hours, days, default permanent + maxCommitRetryTimeout = "-1" + maxRollbackRetryTimeout = "-1" + rollbackRetryTimeoutUnlockEnable = false + retryDeadThreshold = 130000 +} + +## metrics configuration, only used in server side +metrics { + enabled = false + registryType = "compact" + # multi exporters use comma divided + exporterList = "prometheus" + exporterPrometheusPort = 9898 +} diff --git a/thinglinks-registry/seata-server/conf/logback.xml b/thinglinks-registry/seata-server/conf/logback.xml new file mode 100644 index 0000000000000000000000000000000000000000..02399e5dd985ea4f5cc8eea101805cc3ed5d7817 --- /dev/null +++ b/thinglinks-registry/seata-server/conf/logback.xml @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/thinglinks-registry/seata-server/conf/logback/console-appender.xml b/thinglinks-registry/seata-server/conf/logback/console-appender.xml new file mode 100644 index 0000000000000000000000000000000000000000..682b1969ae171ffa754315193505d1201dd4caf5 --- /dev/null +++ b/thinglinks-registry/seata-server/conf/logback/console-appender.xml @@ -0,0 +1,12 @@ + + + + + + + + ${CONSOLE_LOG_PATTERN} + UTF-8 + + + diff --git a/thinglinks-registry/seata-server/conf/logback/file-appender.xml b/thinglinks-registry/seata-server/conf/logback/file-appender.xml new file mode 100644 index 0000000000000000000000000000000000000000..cb54dd4e6b1b8bc5038a619b59e929566f5d99aa --- /dev/null +++ b/thinglinks-registry/seata-server/conf/logback/file-appender.xml @@ -0,0 +1,67 @@ + + + + + + + + + ${LOG_HOME}/${APPLICATION_NAME:-}.${PORT}.all.log + true + + ${LOG_HOME}/history/${APPLICATION_NAME:-}.${PORT}.all.%d{yyyy-MM-dd}.%i.log.gz + 2GB + 7 + 7GB + true + + + ${FILE_LOG_PATTERN} + UTF-8 + + + + + + + WARN + ACCEPT + DENY + + ${LOG_HOME}/${APPLICATION_NAME:-}.${PORT}.warn.log + true + + ${LOG_HOME}/history/${APPLICATION_NAME:-}.${PORT}.warn.%d{yyyy-MM-dd}.%i.log.gz + 2GB + 7 + 7GB + true + + + ${FILE_LOG_PATTERN} + UTF-8 + + + + + + + ERROR + ACCEPT + DENY + + ${LOG_HOME}/${APPLICATION_NAME:-}.${PORT}.error.log + true + + ${LOG_HOME}/history/${APPLICATION_NAME:-}.${PORT}.error.%d{yyyy-MM-dd}.%i.log.gz + 2GB + 7 + 7GB + true + + + ${FILE_LOG_PATTERN} + UTF-8 + + + diff --git a/thinglinks-registry/seata-server/conf/logback/kafka-appender.xml b/thinglinks-registry/seata-server/conf/logback/kafka-appender.xml new file mode 100644 index 0000000000000000000000000000000000000000..2b30a75985fb339451102a84c3ce76e3b57a5f7a --- /dev/null +++ b/thinglinks-registry/seata-server/conf/logback/kafka-appender.xml @@ -0,0 +1,32 @@ + + + + + + + + + + { + "@timestamp": "%d{yyyy-MM-dd HH:mm:ss.SSS}", + "level":"%p", + "app_name":"${APPLICATION_NAME:-}", + "PORT": ${PORT:-0}, + "thread_name": "%t", + "logger_name": "%logger", + "X-TX-XID": "%X{X-TX-XID:-}", + "X-TX-BRANCH-ID": "%X{X-TX-BRANCH-ID:-}", + "message": "%m", + "stack_trace": "%wex" +} + + + ${KAFKA_TOPIC} + + + bootstrap.servers=${KAFKA_BOOTSTRAP_SERVERS} + acks=0 + linger.ms=1000 + max.block.ms=0 + + diff --git a/thinglinks-registry/seata-server/conf/logback/logstash-appender.xml b/thinglinks-registry/seata-server/conf/logback/logstash-appender.xml new file mode 100644 index 0000000000000000000000000000000000000000..18b9c25c0d49aabc16614cb5b2e380b4ffffca15 --- /dev/null +++ b/thinglinks-registry/seata-server/conf/logback/logstash-appender.xml @@ -0,0 +1,28 @@ + + + + + + + + ${LOGSTASH_DESTINATION} + + + + + + { + "app_name": "${APPLICATION_NAME:-}" + } + + + + net.logstash.logback.composite.LogstashVersionJsonProvider + + net.logstash.logback.composite.loggingevent.JsonMessageJsonProvider + net.logstash.logback.composite.loggingevent.TagsJsonProvider + net.logstash.logback.composite.loggingevent.LogstashMarkersJsonProvider + net.logstash.logback.composite.loggingevent.ArgumentsJsonProvider + + + diff --git a/thinglinks-registry/seata-server/conf/registry.conf b/thinglinks-registry/seata-server/conf/registry.conf new file mode 100644 index 0000000000000000000000000000000000000000..1ca5fb92c77693c7df56804873a134458d3f8658 --- /dev/null +++ b/thinglinks-registry/seata-server/conf/registry.conf @@ -0,0 +1,96 @@ +registry { + # file 、nacos 、eureka、redis、zk、consul、etcd3、sofa + type = "nacos" + + nacos { + application = "seata-server" + serverAddr = "127.0.0.1:8848" + group = "SEATA_GROUP" + namespace = "" + cluster = "default" + username = "nacos" + password = "nacos" + } + eureka { + serviceUrl = "http://localhost:8761/eureka" + application = "default" + weight = "1" + } + redis { + serverAddr = "localhost:6379" + db = 0 + password = "" + cluster = "default" + timeout = 0 + } + zk { + cluster = "default" + serverAddr = "127.0.0.1:2181" + sessionTimeout = 6000 + connectTimeout = 2000 + username = "" + password = "" + } + consul { + cluster = "default" + serverAddr = "127.0.0.1:8500" + aclToken = "" + } + etcd3 { + cluster = "default" + serverAddr = "http://localhost:2379" + } + sofa { + serverAddr = "127.0.0.1:9603" + application = "default" + region = "DEFAULT_ZONE" + datacenter = "DefaultDataCenter" + cluster = "default" + group = "SEATA_GROUP" + addressWaitTime = "3000" + } + file { + name = "file.conf" + } +} + +config { + # file、nacos 、apollo、zk、consul、etcd3 + type = "nacos" + + nacos { + serverAddr = "127.0.0.1:8848" + namespace = "" + group = "SEATA_GROUP" + username = "nacos" + password = "nacos" + dataId = "seataServer.properties" + } + consul { + serverAddr = "127.0.0.1:8500" + aclToken = "" + } + apollo { + appId = "seata-server" + ## apolloConfigService will cover apolloMeta + apolloMeta = "http://192.168.1.204:8801" + apolloConfigService = "http://192.168.1.204:8080" + namespace = "application" + apolloAccesskeySecret = "" + cluster = "seata" + } + zk { + serverAddr = "127.0.0.1:2181" + sessionTimeout = 6000 + connectTimeout = 2000 + username = "" + password = "" + nodePath = "/seata/seata.properties" + } + etcd3 { + serverAddr = "http://localhost:2379" + } + file { + name = "file.conf" + } +} diff --git a/thinglinks-ui/src/views/system/user/profile/userInfo.vue b/thinglinks-ui/src/views/system/user/profile/userInfo.vue index 854b819e49b6bca80a65b54608c67f8acc9983a7..19d4a12311cbc55bf023f73cceeaa7e791351aa9 100644 --- a/thinglinks-ui/src/views/system/user/profile/userInfo.vue +++ b/thinglinks-ui/src/views/system/user/profile/userInfo.vue @@ -2,7 +2,7 @@ - + @@ -42,7 +42,7 @@ export default { { required: true, message: "邮箱地址不能为空", trigger: "blur" }, { type: "email", - message: "'请输入正确的邮箱地址", + message: "请输入正确的邮箱地址", trigger: ["blur", "change"] } ],