Przeglądaj źródła

fix 值班客服下标

zoujiajian 2 lat temu
rodzic
commit
a3f1af19ac

+ 5 - 0
netflix-common/src/main/java/com/cyksj/dto/RedisKey.java

@@ -62,4 +62,9 @@ public class RedisKey {
      * Telegram 电报机器人推送
      */
     public static String TELEGRAM_BOT_MSG ="telegram:bot:msg";
+
+    /**
+     * 客服下标
+     */
+    public static String SERVICE_INDEX_KEY ="service_index_key";
 }

+ 14 - 0
netflix-web/src/main/java/com/cyksj/web/controller/sys/SysConfigController.java

@@ -11,6 +11,7 @@ import com.cyksj.common.annotation.Log;
 import com.cyksj.common.constant.Constant;
 import com.cyksj.common.exception.BusinessRuntimeException;
 import com.cyksj.common.util.Jsons;
+import com.cyksj.dto.RedisKey;
 import com.cyksj.dto.Result;
 import com.cyksj.enums.BusinessType;
 import com.cyksj.enums.GatewayResponse;
@@ -218,4 +219,17 @@ public class SysConfigController {
 		cpsUserAdRecordMapper.delete(null);
 		return GatewayResponse.SUCCESS.newBuilder().toResult();
 	}
+
+	/**
+	 * 获取客服下标
+	 */
+	@GetMapping("/get/service/index")
+	public Result<Long> getCorpFollowIndex() {
+		String key = RedisKey.SERVICE_INDEX_KEY;
+		Long index = redisService.incr(key, 1l);
+		if (index == 10) {
+			redisService.set(key, 0);
+		}
+		return GatewayResponse.SUCCESS.newBuilder().toResult(index - 1);
+	}
 }