Woody 1 vecka sedan
förälder
incheckning
134cfeda02

+ 9 - 9
framework-group/src/main/java/com/chelvc/framework/group/GroupClient.java

@@ -17,7 +17,7 @@ import org.springframework.web.bind.annotation.RequestParam;
  * @author Woody
  * @date 2024/12/5
  */
-@FeignClient(value = "${group.store-server}")
+@FeignClient(value = "${group.store-server:group-store-server}")
 public interface GroupClient {
     /**
      * 获取场景分组
@@ -25,8 +25,8 @@ public interface GroupClient {
      * @param scene 场景标识
      * @return 分组标识
      */
-    @GetMapping("/grouping/{scene}")
-    Caps get(@PathVariable("scene") String scene);
+    @GetMapping("/group/{scene}")
+    Caps getGroup(@PathVariable("scene") String scene);
 
     /**
      * 批量获取场景分组
@@ -34,8 +34,8 @@ public interface GroupClient {
      * @param scenes 场景标识集合
      * @return 场景/分组映射表
      */
-    @GetMapping("/grouping")
-    Map<String, Caps> get(@RequestParam("scenes") Collection<String> scenes);
+    @GetMapping("/groups")
+    Map<String, Caps> getGroups(@RequestParam("scenes") Collection<String> scenes);
 
     /**
      * 设置场景分组
@@ -43,14 +43,14 @@ public interface GroupClient {
      * @param scene 场景标识
      * @param group 分组标识
      */
-    @PostMapping("/grouping/{scene}/{group}")
-    void set(@PathVariable("scene") String scene, @PathVariable("group") Caps group);
+    @PostMapping("/group/{scene}/{group}")
+    void setGroup(@PathVariable("scene") String scene, @PathVariable("group") Caps group);
 
     /**
      * 批量设置场景分组
      *
      * @param groups 场景/分组映射表
      */
-    @PostMapping("/grouping")
-    void set(@RequestBody Map<String, Caps> groups);
+    @PostMapping("/groups")
+    void setGroups(@RequestBody Map<String, Caps> groups);
 }

+ 4 - 4
framework-group/src/main/java/com/chelvc/framework/group/RedisGroupStore.java

@@ -76,7 +76,7 @@ public class RedisGroupStore implements GroupStore {
 
         // 如果缓存更新成功则持久化分组信息
         if (Boolean.TRUE.equals(results.get(0))) {
-            this.client.set(scene, group);
+            this.client.setGroup(scene, group);
             return group;
         }
 
@@ -124,7 +124,7 @@ public class RedisGroupStore implements GroupStore {
 
         // 持久化缓存更新成功的场景分组
         if (ObjectUtils.notEmpty(stored)) {
-            this.client.set(stored);
+            this.client.setGroups(stored);
         }
 
         // 重新加载已存在缓存的场景分组
@@ -155,7 +155,7 @@ public class RedisGroupStore implements GroupStore {
         RedisTemplate<String, Object> template = RedisContextHolder.getDefaultTemplate();
         HashOperations<String, String, String> operations = template.opsForHash();
         group = StringUtils.ifEmpty(operations.get(key, scene), Caps::valueOf);
-        if (group == null && (group = this.client.get(scene)) != null) {
+        if (group == null && (group = this.client.getGroup(scene)) != null) {
             RedisHashHolder.set(template, key, scene, group, this.timeout);
         }
         return group;
@@ -200,7 +200,7 @@ public class RedisGroupStore implements GroupStore {
 
         // 重新加载场景分组为null的数据
         if (ObjectUtils.notEmpty(nones)) {
-            Map<String, Caps> reloads = this.client.get(nones);
+            Map<String, Caps> reloads = this.client.getGroups(nones);
             if (ObjectUtils.notEmpty(reloads)) {
                 groups.putAll(reloads);
                 RedisHashHolder.set(template, key, reloads, this.timeout);

+ 1 - 1
framework-kafka/src/main/java/com/chelvc/framework/kafka/fallback/KafkaStoreClient.java

@@ -10,7 +10,7 @@ import org.springframework.web.bind.annotation.RequestBody;
  * @author Woody
  * @date 2024/12/19
  */
-@FeignClient(value = "${spring.kafka.fallback-store-server}")
+@FeignClient(value = "${spring.kafka.fallback-store-server:message-store-server}")
 public interface KafkaStoreClient {
     /**
      * 保存Kafka降级消息