zoujiajian преди 1 година
родител
ревизия
7475eb7b3b

+ 7 - 1
netflix-dao/src/main/java/com/cyksj/model/dto/UserWhoami.java

@@ -54,8 +54,14 @@ public class UserWhoami implements Serializable {
     private Boolean isPay;
 
     /**
-     * 是否渠道配置了优惠码
+     * claude code是否渠道配置了优惠码
      */
     @DbIgnore
     private Boolean ccCode;
+
+    /**
+     * claude code是否弹窗
+     */
+    @DbIgnore
+    private Boolean tc;
 }

+ 1 - 0
netflix-service/src/main/java/com/cyksj/redis/RedisService.java

@@ -860,6 +860,7 @@ public class RedisService {
         GPT_RECHARGE_KEY("gpt_recharge_key:", "gpt代充", 60),
         GPT_RECHARGE_RECOVER_KEY("gpt_recharge_recover_key:", "gpt代充恢复key", 60 * 5l),
         CLAUDE_CODE_TY_DAY_CARD_KEY("claude_code_ty_day_card_key:", "claude_code体验天卡key", 30L),
+        CLAUDE_CODE_TY_DAY_TC_KEY("claude_code_ty_day_tc_key:", "claude code体验弹窗key", 24 * 60 * 60L),
         ;
 
         private String name;

+ 5 - 0
netflix-service/src/main/java/com/cyksj/service/user/impl/UserServiceImpl.java

@@ -308,6 +308,11 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
 		if (ccCode != null) {
 			Number number = beanSearcher.searchCount(GroupsRelationView.class, MapUtils.builder().field(GroupsRelationView::getUserId, userId).field(GroupsRelationView::getAqType, 2).field(GroupsRelationView::getGoodsId, Constant.CLAUDE_CODE_GOODS_ID).build());
 			userWhoami.setCcCode(number.intValue() > 0);
+			if (redisService.setNx(RedisService.key.CLAUDE_CODE_TY_DAY_TC_KEY.getName() + userId, userId, RedisService.key.CLAUDE_CODE_TY_DAY_TC_KEY.getTimeout())) {
+				userWhoami.setTc(Boolean.TRUE);
+			} else {
+				userWhoami.setTc(Boolean.FALSE);
+			}
 		}
 		return userWhoami;
 	}