Pārlūkot izejas kodu

Merge remote-tracking branch 'origin/master'

zwhui 2 gadi atpakaļ
vecāks
revīzija
2770682683
30 mainītis faili ar 673 papildinājumiem un 106 dzēšanām
  1. 8 1
      netflix-common/src/main/java/com/cyksj/common/constant/Constant.java
  2. 13 0
      netflix-dao/src/main/java/com/cyksj/mapper/LumaUserMapper.java
  3. 6 0
      netflix-dao/src/main/java/com/cyksj/model/entity/GoodsDonSku.java
  4. 53 0
      netflix-dao/src/main/java/com/cyksj/model/entity/LumaUser.java
  5. 2 0
      netflix-dao/src/main/java/com/cyksj/model/manage/request/ReqGoodsSkuInsert.java
  6. 2 0
      netflix-dao/src/main/java/com/cyksj/model/views/GoodsDonSkuFrontView.java
  7. 37 0
      netflix-dao/src/main/java/com/cyksj/model/views/LumaUserView.java
  8. 18 0
      netflix-dao/src/main/java/com/cyksj/model/views/RenewalView.java
  9. 15 0
      netflix-dao/src/main/java/com/cyksj/model/views/YhShopGoodsSkuFrontView.java
  10. 4 2
      netflix-service/src/main/java/com/cyksj/redis/RedisService.java
  11. 4 1
      netflix-service/src/main/java/com/cyksj/service/groups/impl/GroupFunServiceImpl.java
  12. 13 0
      netflix-service/src/main/java/com/cyksj/service/luma/LumaService.java
  13. 159 0
      netflix-service/src/main/java/com/cyksj/service/luma/impl/LumaServiceImpl.java
  14. 1 1
      netflix-service/src/main/java/com/cyksj/service/mail/CuiQiuMailService.java
  15. 15 0
      netflix-service/src/main/java/com/cyksj/service/mail/YhMailService.java
  16. 8 3
      netflix-service/src/main/java/com/cyksj/service/mail/impl/CuiQiuMailServiceImpl.java
  17. 126 0
      netflix-service/src/main/java/com/cyksj/service/mail/impl/YhEmailServiceImpl.java
  18. 2 0
      netflix-service/src/main/java/com/cyksj/service/mange/CmsAccountService.java
  19. 32 0
      netflix-service/src/main/java/com/cyksj/service/mange/account/CmsAccountServiceImpl.java
  20. 19 0
      netflix-service/src/main/java/com/cyksj/service/mange/impl/CmsOrderDonServiceImpl.java
  21. 14 0
      netflix-service/src/main/java/com/cyksj/service/mange/impl/MirrorUserCleatServiceImpl.java
  22. 19 2
      netflix-service/src/main/java/com/cyksj/service/order/impl/OrderDonServiceImpl.java
  23. 39 92
      netflix-service/src/main/java/com/cyksj/service/relation/impl/GroupRelationFrontServiceImpl.java
  24. 6 3
      netflix-service/src/main/java/com/cyksj/service/relation/impl/GroupsRelationNetflixServiceImpl.java
  25. 10 0
      netflix-web/src/main/java/com/cyksj/web/controller/manage/account/CmsAccountController.java
  26. 22 0
      netflix-web/src/main/java/com/cyksj/web/controller/mirror/MirrorController.java
  27. 21 0
      netflix-web/src/main/java/com/cyksj/web/controller/payment/OrderController.java
  28. 0 0
      netflix-web/src/main/resources/application-dev.yml
  29. 0 0
      netflix-web/src/main/resources/application-prd.yml
  30. 5 1
      netflix-web/src/main/resources/application-pre.yml

+ 8 - 1
netflix-common/src/main/java/com/cyksj/common/constant/Constant.java

@@ -311,6 +311,11 @@ public interface Constant {
 
 	String CLAUDE_MIRROR_ONLY_ACCOUNT = "claudecar123";
 
+	/**
+	 * luma
+	 */
+	String LUMA_MIRROR_ONLY_ACCOUNT = "luma123";
+
 	/**
 	 * 免登录渠道
 	 */
@@ -344,7 +349,7 @@ public interface Constant {
 	/**
 	 * 电影域名
 	 */
-	String ZHAOJU_MOVIES = "https://zhaoju666.com";
+	String ZHAOJU_MOVIES = "http://43.154.169.245:8090";
 
 	//英文
 	String EN_US = "en_US";
@@ -376,4 +381,6 @@ public interface Constant {
 	 * 特殊普通渠道用户
 	 */
 	Long SPECIAL_DISTRIBUTE_USER_ID = 469739l;
+
+	Long LUMA_GOODS_ID = 87l;
 }

+ 13 - 0
netflix-dao/src/main/java/com/cyksj/mapper/LumaUserMapper.java

@@ -0,0 +1,13 @@
+package com.cyksj.mapper;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.cyksj.model.entity.LumaUser;
+
+/**
+ * 项目名: yhlxj2
+ * 文件名: LumaUserMapper
+ * 创建者: JavaZou
+ * 创建时间:2024/8/2 18:22
+ */
+public interface LumaUserMapper extends BaseMapper<LumaUser> {
+}

+ 6 - 0
netflix-dao/src/main/java/com/cyksj/model/entity/GoodsDonSku.java

@@ -189,6 +189,12 @@ public class GoodsDonSku extends BaseEntity {
     @TableField(updateStrategy = FieldStrategy.IGNORED)
     private Integer mjRelaxNum;
 
+    /**
+     * luma次数
+     */
+    @TableField(updateStrategy = FieldStrategy.IGNORED)
+    private Integer lumaNum;
+
     /**
      * 特定价格
      */

+ 53 - 0
netflix-dao/src/main/java/com/cyksj/model/entity/LumaUser.java

@@ -0,0 +1,53 @@
+package com.cyksj.model.entity;
+
+/**
+ * @author zwhui
+ * @date 2024/4/16 17:01
+ */
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.ejlchina.searcher.bean.DbIgnore;
+import lombok.Data;
+
+import java.util.Date;
+
+@Data
+public class LumaUser extends BaseEntity{
+
+    /**
+     * 名称
+     */
+    private String name;
+
+    /**
+     * 头像
+     */
+    private String img;
+
+    /**
+     * 用户凭证
+     */
+    private String userToken;
+
+    /**
+     * 过期时间
+     */
+    private Date expireTime;
+
+    /**
+     * 车票id
+     */
+    private Long relationId;
+
+    /**
+     * 可用次数
+     */
+    private Integer num;
+
+    /**
+     * 车票类型 2试用
+     */
+    @DbIgnore
+    @TableField(exist = false)
+    private Integer aqType;
+}

+ 2 - 0
netflix-dao/src/main/java/com/cyksj/model/manage/request/ReqGoodsSkuInsert.java

@@ -162,6 +162,8 @@ public class ReqGoodsSkuInsert {
          */
         private Integer mjRelaxNum;
 
+        private Integer lumaNum;
+
         /**
          * 备注
          */

+ 2 - 0
netflix-dao/src/main/java/com/cyksj/model/views/GoodsDonSkuFrontView.java

@@ -155,5 +155,7 @@ public class GoodsDonSkuFrontView {
 
 	private Boolean isMirror;
 
+	private Integer lumaNum;
+
 	private String remark;
 }

+ 37 - 0
netflix-dao/src/main/java/com/cyksj/model/views/LumaUserView.java

@@ -0,0 +1,37 @@
+package com.cyksj.model.views;
+
+import com.ejlchina.searcher.bean.DbField;
+import com.ejlchina.searcher.bean.SearchBean;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * @author zwhui
+ * @date 2024/4/28 17:43
+ */
+@Data
+@SearchBean(tables = "luma_user lu left join groups_relation gr on lu.relation_id = gr.id ")
+public class LumaUserView {
+
+
+    @DbField("lu.id")
+    private Long id;
+
+    @DbField("lu.relation_id")
+    private Long relationId;
+
+    @DbField("gr.user_id")
+    private Long userId;
+
+    @DbField("lu.num")
+    private Integer lumaNum;
+
+    @DbField("lu.expire_time")
+    private Date expireTime;
+
+
+
+
+
+}

+ 18 - 0
netflix-dao/src/main/java/com/cyksj/model/views/RenewalView.java

@@ -210,12 +210,24 @@ public class RenewalView {
     @DbField("sku.gpt_limit_num")
     private Integer gptLimitNum;
 
+    /**
+     * luma 次数
+     */
+    @DbField("sku.luma_num")
+    private Integer lumaNUm;
+
     /**
      * mj 套餐包最低单价
      */
     @DbIgnore
     private BigDecimal mjPackagePrice;
 
+    /**
+     * luma 套餐包最低单价
+     */
+    @DbIgnore
+    private BigDecimal lumaPackagePrice;
+
     /**
      * 用户 mj fast次数
      */
@@ -240,6 +252,12 @@ public class RenewalView {
     @DbIgnore
     private Long gptUserLimitTime;
 
+    /**
+     * luma 用户次数
+     */
+    @DbIgnore
+    private Integer lumaUserNum;
+
     @DbIgnore
     private Long use;
 

+ 15 - 0
netflix-dao/src/main/java/com/cyksj/model/views/YhShopGoodsSkuFrontView.java

@@ -143,6 +143,21 @@ public class YhShopGoodsSkuFrontView {
 	@DbField("sku.is_mirror")
 	private Boolean isMirror;
 
+	/**
+	 * mj fast次数
+	 */
+	@DbField("sku.mj_fast_num")
+	private Integer mjFastNum;
+
+	/**
+	 * mj relax次数
+	 */
+	@DbField("sku.mj_relax_num")
+	private Integer mjRelaxNum;
+
+	@DbField("sku.luma_num")
+	private Integer lumaNum;
+
 	@DbField("sku.remark")
 	private Boolean remark;
 }

+ 4 - 2
netflix-service/src/main/java/com/cyksj/redis/RedisService.java

@@ -3,12 +3,10 @@ package com.cyksj.redis;
 import com.cyksj.common.util.StringUtil;
 import lombok.AllArgsConstructor;
 import lombok.Getter;
-import org.springframework.beans.factory.annotation.Value;
 import org.springframework.data.redis.core.RedisTemplate;
 import org.springframework.data.redis.core.ZSetOperations;
 import org.springframework.stereotype.Service;
 
-import javax.annotation.PostConstruct;
 import javax.annotation.Resource;
 import java.util.Arrays;
 import java.util.List;
@@ -843,7 +841,11 @@ public class RedisService {
         NETFLIX_SET_LIMIT_TIME("netflix_set_limit_time", "奈飞设置限制", 30l),
         MIDJOURNEY_CAR_TASK("midjourney:car:task","midjourney car 任务数", 48 * 60 * 60L),
         SYS_CONFIG_CACHE_KEY("sys_config_cache_key:", "系统配置缓存key", 60 * 60 * 23L),
+        NF_UPGRAD_USER_LIMIT_KEY("nf_upgrad_user_limit_key:%s:%s:%s", "奈飞同步装置key", 60 * 60L),
 
+        LUMA_USER("luma_user:", "luma_user", 60 * 60 * 2L),
+        LUMA_NUM_LIMIT("luma_num_limit:", "luma次数", 60 * 60 * 48L),
+        NF_SET_TIME_LIMIT("nf_set_time_limit:", "设置pin码", 60l),
         ;
 
         private String name;

+ 4 - 1
netflix-service/src/main/java/com/cyksj/service/groups/impl/GroupFunServiceImpl.java

@@ -100,7 +100,7 @@ public class GroupFunServiceImpl implements GroupsFuncService {
 		Boolean isMirror = sku.getIsMirror();
 		Boolean isCar = sku.getIsCar();
 		String account = null;
-		if ((goodsId == 18 && isCar) || (goodsId == 26 && isMirror) || goodsId == 75 && isCar) {
+		if ((goodsId == 87 && isMirror) || (goodsId == 18 && isCar) || (goodsId == 26 && isMirror) || goodsId == 75 && isCar) {
 			if (goodsId == 18) {
 				account = Constant.GPT_CAR_ONLY_ACCOUNT;
 			}
@@ -110,6 +110,9 @@ public class GroupFunServiceImpl implements GroupsFuncService {
 			if (goodsId == 75) {
 				account = Constant.CLAUDE_MIRROR_ONLY_ACCOUNT;
 			}
+			if (goodsId == 87) {
+				account = Constant.LUMA_MIRROR_ONLY_ACCOUNT;
+			}
 			AccountView accountView = beanSearcher.searchFirst(AccountView.class, MapUtils.builder()
 					.field(AccountView::getGoodsId, goodsId)
 					.field(AccountView::getAccount, account).

+ 13 - 0
netflix-service/src/main/java/com/cyksj/service/luma/LumaService.java

@@ -0,0 +1,13 @@
+package com.cyksj.service.luma;
+
+import com.cyksj.model.entity.LumaUser;
+
+/**
+ * 项目名: yhlxj2
+ * 文件名: LumaService
+ * 创建者: JavaZou
+ * 创建时间:2024/8/5 11:54
+ */
+public interface LumaService {
+	LumaUser getLumaUser(Long userId, Long relationId);
+}

+ 159 - 0
netflix-service/src/main/java/com/cyksj/service/luma/impl/LumaServiceImpl.java

@@ -0,0 +1,159 @@
+package com.cyksj.service.luma.impl;
+
+import cn.hutool.core.lang.UUID;
+import cn.hutool.http.HttpUtil;
+import cn.hutool.json.JSONObject;
+import cn.hutool.json.JSONUtil;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.cyksj.common.constant.Constant;
+import com.cyksj.common.exception.BusinessRuntimeException;
+import com.cyksj.common.util.StringUtil;
+import com.cyksj.mapper.*;
+import com.cyksj.model.entity.*;
+import com.cyksj.redis.RedisService;
+import com.cyksj.service.luma.LumaService;
+import com.cyksj.service.user.UserBindRelationService;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.dao.DuplicateKeyException;
+import org.springframework.stereotype.Service;
+
+import javax.imageio.stream.FileImageOutputStream;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 项目名: yhlxj2
+ * 文件名: LumaServiceImpl
+ * 创建者: JavaZou
+ * 创建时间:2024/8/5 11:55
+ */
+@Service
+@RequiredArgsConstructor
+@Slf4j
+public class LumaServiceImpl implements LumaService {
+	private final GoodsDonMapper goodsDonMapper;
+
+	private final GoodsDonSkuMapper skuMapper;
+
+	private final UserBindRelationService userBindRelationService;
+
+	private final GroupsRelationMapper groupsRelationMapper;
+
+	private final GroupsMapper groupsMapper;
+
+	private final LumaUserMapper lumaUserMapper;
+
+	private final UserMapper userMapper;
+
+	private final RedisService redisService;
+
+	@Override
+	public LumaUser getLumaUser(Long userId, Long relationId) {
+		GroupsRelation groupsRelation = getGroupsRelation(userId, relationId);
+		GroupsTrips groupsTrips = getGroupsTrips(groupsRelation);
+		GoodsDonSku goodsDonSku = skuMapper.selectById(groupsTrips.getSkuId());
+
+		if (goodsDonSku != null && goodsDonSku.getGoodsId() == Constant.LUMA_GOODS_ID) {
+			return getLumaUser(userId, relationId, groupsRelation, goodsDonSku);
+		} else {
+			throw BusinessRuntimeException.getInstance("服务器出了点问题");
+		}
+	}
+
+	private GroupsRelation getGroupsRelation(Long userId, Long relationId) {
+		List<Long> userIdList = userBindRelationService.getRelationUserIdList(userId, null);
+		GroupsRelation groupsRelation = groupsRelationMapper.selectOne(Wrappers.lambdaQuery(GroupsRelation.class).in(GroupsRelation::getUserId, userIdList).eq(GroupsRelation::getId, relationId));
+		if (groupsRelation == null) {
+			throw BusinessRuntimeException.getInstance("车票不存在");
+		}
+		return groupsRelation;
+	}
+
+	/**
+	 * 获取车队信息
+	 *
+	 * @param groupsRelation
+	 * @return
+	 */
+	private GroupsTrips getGroupsTrips(GroupsRelation groupsRelation) {
+		GroupsTrips groupsTrips = groupsMapper.selectById(groupsRelation.getGroupsId());
+		if (groupsTrips == null) {
+			throw BusinessRuntimeException.getInstance("车队异常");
+		}
+		return groupsTrips;
+	}
+
+	private LumaUser getLumaUser(Long userId, Long relationId, GroupsRelation groupsRelation, GoodsDonSku goodsDonSku) {
+		LumaUser lumaUser = lumaUserMapper.selectOne(Wrappers.lambdaQuery(LumaUser.class).eq(LumaUser::getRelationId, relationId));
+		User user = userMapper.selectById(userId);
+		if (lumaUser == null) {
+			lumaUser = createLumaUser(groupsRelation, user, goodsDonSku);
+		} else {
+			updateLumaUser(groupsRelation, user, lumaUser);
+		}
+		return lumaUser;
+	}
+
+	private void updateLumaUser(GroupsRelation groupsRelation, User user, LumaUser lumaUser) {
+		lumaUser.setName(user.getNickname());
+		lumaUser.setImg(getWxImg(user.getHeadimgurl(), user));
+		lumaUser.setExpireTime(groupsRelation.getExpiryTime());
+		lumaUserMapper.updateById(lumaUser);
+		lumaUser.setAqType(groupsRelation.getAqType());
+		redisService.set(RedisService.key.LUMA_USER.getName() + lumaUser.getUserToken(), lumaUser, RedisService.key.LUMA_USER.getTimeout());
+	}
+
+	private LumaUser createLumaUser(GroupsRelation groupsRelation, User user, GoodsDonSku goodsDonSku) {
+		LumaUser lumaUser = new LumaUser();
+		lumaUser.setExpireTime(groupsRelation.getExpiryTime());
+		lumaUser.setName(user.getNickname());
+		lumaUser.setImg(getWxImg(user.getHeadimgurl(), user));
+		lumaUser.setRelationId(groupsRelation.getId());
+		lumaUser.setUserToken(UUID.randomUUID().toString());
+		if (groupsRelation.getAqType() == 2) {
+			lumaUser.setNum(goodsDonSku.getLumaNum());
+		} else {
+			lumaUser.setNum(goodsDonSku.getLumaNum());
+		}
+		lumaUser.setAqType(groupsRelation.getAqType());
+		try {
+			lumaUserMapper.insert(lumaUser);
+		} catch (DuplicateKeyException e) {
+		}
+		redisService.set(RedisService.key.LUMA_NUM_LIMIT.getName() + lumaUser.getId(), lumaUser.getNum(), RedisService.key.LUMA_NUM_LIMIT.getTimeout());
+		return lumaUser;
+	}
+
+	/**
+	 * 更换wx头像至oss
+	 */
+	private String getWxImg(String headimgurl, User user) {
+		if (headimgurl.contains("thirdwx.qlogo.cn")) {
+			try {
+				return uploadPic(headimgurl, "wxheadimg-" + user.getId());
+			} catch (Exception ex) {
+				log.error("上传微信头像错误!msg:{}", StringUtil.getErrorText(ex));
+				return "./avatars.png";
+			}
+		} else {
+			return user.getHeadimgurl();
+		}
+	}
+
+	private static String uploadPic(String url, String prefix) throws IOException {
+		byte[] body = HttpUtil.downloadBytes(url);
+		Path tempFile = Files.createTempFile(prefix, ".jpeg");
+		try (FileImageOutputStream imageOutput = new FileImageOutputStream(tempFile.toFile())) {
+			imageOutput.write(body, 0, body.length);
+		}
+		Map<String, Object> paramMap = new HashMap<>();
+		paramMap.put("file", tempFile.toFile());
+		JSONObject result = JSONUtil.parseObj(HttpUtil.post("https://files.liuliangbang.vip/pic/ups", paramMap));
+		return result.getJSONObject("value").getJSONArray("saved").getJSONObject(0).getJSONObject("info").getStr("cdnUrl");
+	}
+}

+ 1 - 1
netflix-service/src/main/java/com/cyksj/service/mail/CuiQiuMailService.java

@@ -11,7 +11,7 @@ public interface CuiQiuMailService {
 	/**
 	 * 获取最新邮箱 返回验证码
 	 */
-	String getVerifyCode(String email, Long goodsId, Integer type, Boolean sync, Integer linkType) throws Exception;
+	String getVerifyCode(String email, Long goodsId, Integer type, Integer linkType) throws Exception;
 
 	boolean isCuiQiuEmail(String account);
 }

+ 15 - 0
netflix-service/src/main/java/com/cyksj/service/mail/YhMailService.java

@@ -0,0 +1,15 @@
+package com.cyksj.service.mail;
+
+/**
+ * 项目名: yhlxj2
+ * 文件名: YhMailService
+ * 创建者: JavaZou
+ * 创建时间:2024/8/19 15:39
+ */
+public interface YhMailService {
+
+	/**
+	 * 获取最新邮箱 返回验证码
+	 */
+	String getVerifyCode(String email, Long goodsId, Integer type, Integer linkType) throws Exception;
+}

+ 8 - 3
netflix-service/src/main/java/com/cyksj/service/mail/impl/CuiQiuMailServiceImpl.java

@@ -61,8 +61,13 @@ public class CuiQiuMailServiceImpl implements CuiQiuMailService {
 		CuiQiuEmailConfigs = CuiQiuEmailConfigMapper.selectList(null);
 	}
 
+	/**
+	 *
+	 * @param type 1:奈飞安全码
+	 * @param linkType 链接 1:同步验证链接
+	 */
 	@Override
-	public String getVerifyCode(String email, Long goodsId, Integer type, Boolean sync, Integer linkType) throws Exception {
+	public String getVerifyCode(String email, Long goodsId, Integer type, Integer linkType) throws Exception {
 		//获取近二十封邮件
 		String url = "https://domain-open-api.cuiqiu.com/v1/message/list";
 
@@ -114,7 +119,7 @@ public class CuiQiuMailServiceImpl implements CuiQiuMailService {
 			for (CuiQiuEmailDto CuiQiuEmailDto : list) {
 				Long messageId = CuiQiuEmailDto.getId();
 				try {
-					String code = getVerifyCodeByEmail(messageId, goodsId, type, sync, linkType, mailId);
+					String code = getVerifyCodeByEmail(messageId, goodsId, type, linkType, mailId);
 					if (StrUtil.isNotBlank(code)) {
 						return code;
 					}
@@ -135,7 +140,7 @@ public class CuiQiuMailServiceImpl implements CuiQiuMailService {
 		return false;
 	}
 
-	public String getVerifyCodeByEmail(Long messageId, Long goodsId, Integer type, Boolean sync, Integer linkType, String mailId) throws Exception {
+	public String getVerifyCodeByEmail(Long messageId, Long goodsId, Integer type, Integer linkType, String mailId) throws Exception {
 		String url = "https://domain-open-api.cuiqiu.com/v1/message/detail";
 		Map<String, Object> params = new HashMap<>();
 		params.put("token", CUI_QIU_TOKEN);

+ 126 - 0
netflix-service/src/main/java/com/cyksj/service/mail/impl/YhEmailServiceImpl.java

@@ -0,0 +1,126 @@
+package com.cyksj.service.mail.impl;
+
+import cn.hutool.core.lang.Validator;
+import cn.hutool.core.util.StrUtil;
+import cn.hutool.http.HttpRequest;
+import cn.hutool.http.HttpStatus;
+import cn.hutool.http.HttpUtil;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.cyksj.common.exception.BusinessRuntimeException;
+import com.cyksj.common.util.StringUtil;
+import com.cyksj.common.util.TicketCodeCommonUtil;
+import com.cyksj.mapper.sys.SysEmailMapper;
+import com.cyksj.model.entity.SysEmail;
+import com.cyksj.service.mail.YhMailService;
+import com.cyksj.service.relation.GroupsRelationNetflixService;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.stereotype.Service;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * 项目名: yhlxj2
+ * 文件名: YhEmailServiceImpl
+ * 创建者: JavaZou
+ * 创建时间:2024/8/19 15:40
+ */
+@Service
+@RequiredArgsConstructor
+@Slf4j
+public class YhEmailServiceImpl implements YhMailService {
+	private final GroupsRelationNetflixService groupsRelationNetflixService;
+
+	private final SysEmailMapper sysEmailMapper;
+
+	@Override
+	public String getVerifyCode(String account, Long goodsId, Integer type, Integer linkType) throws Exception {
+		//获取邮箱密码
+		SysEmail sysEmail = sysEmailMapper.selectOne(Wrappers.lambdaQuery(SysEmail.class)
+				.eq(SysEmail::getEmail, account)
+				.last("limit 1"));
+		if (sysEmail == null) {
+			log.info("获取账号:{}验证码异常,未配置对应系统邮箱", account);
+			throw BusinessRuntimeException.getInstance("获取账号验证码异常,请联系客服...");
+		}
+		String url = "http://yinhelx.com/api/controller.php";
+		Map<String, Object> params = new HashMap<>();
+
+		params.put("imap_key", "imap_56568niua@@");
+		params.put("fun", "imap_read");
+		params.put("imap_ip", "yinhelx.com");
+		params.put("port", "143");
+		params.put("username", account);
+		params.put("password", sysEmail.getPassword());
+		params.put("mbox_id", "0");
+		params.put("delete", "0");
+
+		HttpRequest post = HttpUtil.createPost(url);
+		post.form(params);
+		cn.hutool.http.HttpResponse execute = post.execute();
+		if (execute.getStatus() != HttpStatus.HTTP_OK) {
+			throw BusinessRuntimeException.getInstance("获取验证码异常,请联系客服...");
+		}
+		String code = getDifferentGoodsCode(goodsId, execute.body(), type, linkType);
+		return code;
+	}
+
+	public String getDifferentGoodsCode(Long goodsId, String body, Integer type, Integer linkType) {
+		String code = null;
+		//奈飞
+		if (goodsId == 1) {
+			if (type != null && type == 1) {
+				if (body.contains("輸入此代碼登入") || body.contains("输入此代码登录") || body.contains("Enter this code to sign in")) {
+					code = StrUtil.subBetween(body, "輸入此代碼登入", "請在裝置上輸入上");
+					if (StrUtil.isEmpty(code)) {
+						code = StrUtil.subAfter(body, "输入此代码登录", true);
+					}
+					if (StrUtil.isEmpty(code)) {
+						code = StrUtil.subAfter(body, "Enter this code to sign in", true);
+					}
+				}
+				if (StrUtil.isEmpty(code)) {
+					throw BusinessRuntimeException.getInstance("查询失败,请检查是否发送了登陆码..");
+				}
+			} else {
+				String urlPref;
+				//更新装置
+				if (linkType == 1) {
+					urlPref = "https://www.netflix.com/account/update-primary-location";
+					code = StrUtil.subBetween(body, "[" + urlPref, "]");
+				} else {
+					//验证链接
+					urlPref = "https://www.netflix.com/account/travel/verify";
+					code = StrUtil.subBetween(body, "[" + urlPref, "]");
+				}
+				if (StrUtil.isEmpty(code)) {
+					throw BusinessRuntimeException.getInstance("获取认证链接失败,请重新获取");
+				}
+				String url = urlPref + code;
+				//非点击装置同步更新按钮 直接返回链接
+				if (linkType == 2) return url;
+				//失败返回验证链接
+				if (!groupsRelationNetflixService.confirmUpdate(url)) {
+					return url;
+				}
+				return StrUtil.EMPTY;
+			}
+		}
+		//除奈飞
+		if (StrUtil.isEmpty(code)) {
+			code = TicketCodeCommonUtil.getTicketCodeStr(body, goodsId);
+		}
+		int length = 4;
+		if (goodsId == 33l) {
+			length = 6;
+		}
+		code = StringUtil.getVerifyCodePattern(code, length);
+		if (!Validator.isNumber(code)) {
+			log.error("获取账号验证码失败:{}", StrUtil.subSufByLength(code, 512));
+			throw BusinessRuntimeException.getInstance("获取验证码失败,请重新获取..");
+		}
+		return code.trim();
+	}
+
+}

+ 2 - 0
netflix-service/src/main/java/com/cyksj/service/mange/CmsAccountService.java

@@ -53,4 +53,6 @@ public interface CmsAccountService extends IService<Account> {
 	void readFileAndImportEmail(MultipartFile file) throws Exception;
 
 	void batchImportBlockedAccount(Long goodsId, List<Object> accountBlockedList);
+
+	String nfUpgradeDevice(Long accountId) throws Exception;
 }

+ 32 - 0
netflix-service/src/main/java/com/cyksj/service/mange/account/CmsAccountServiceImpl.java

@@ -26,6 +26,8 @@ import com.cyksj.model.manage.views.AccountView;
 import com.cyksj.model.views.CmsUserVO;
 import com.cyksj.model.views.ExpiredAccountDataView;
 import com.cyksj.redis.RedisService;
+import com.cyksj.service.mail.CuiQiuMailService;
+import com.cyksj.service.mail.YhMailService;
 import com.cyksj.service.mange.AccountCommonService;
 import com.cyksj.service.mange.CmsAccountService;
 import com.cyksj.service.mange.CmsGroupService;
@@ -77,6 +79,10 @@ public class CmsAccountServiceImpl extends ServiceImpl<AccountMapper, Account> i
 
 	private final AccountBlockedReplaceRecordMapper accountBlockedReplaceRecordMapper;
 
+	private final CuiQiuMailService cuiQiuMailService;
+
+	private final YhMailService yhMailService;
+
 	@Override
 	public IPage<ExpiredAccountDataView> getExpiredAccountView(Boolean isCorpWx, String customerService, Long goodsId, Long skuId, String account, Boolean renewStatus, Boolean handleStatus, String cnAccount, String usAccount, Integer userId, String startTime, String endTime, String now, Long offset, Long limit) {
 		return accountMapper.getExpiredAccountView(isCorpWx, customerService, goodsId, skuId, account, renewStatus, handleStatus, cnAccount, usAccount, userId, startTime, endTime, now, new Page<>(offset, limit));
@@ -443,4 +449,30 @@ public class CmsAccountServiceImpl extends ServiceImpl<AccountMapper, Account> i
 			accountBlockedReplaceRecordMapper.batchInsert(list);
 		}
 	}
+
+	@Override
+	public String nfUpgradeDevice(Long accountId) throws Exception {
+		Account at = accountMapper.selectById(accountId);
+		if (at == null || at.getGoodsId() != 1l) {
+			throw BusinessRuntimeException.getInstance("只支持奈飞账号");
+		}
+		String account = at.getAccount();
+		String password = at.getPassword();
+		if (StrUtil.hasEmpty(account, password)) {
+			throw BusinessRuntimeException.getInstance("账户异常");
+		}
+		if (cuiQiuMailService.isCuiQiuEmail(account)) {
+			return cuiQiuMailService.getVerifyCode(account, at.getGoodsId(), null, 1);
+		}
+		String code = null;
+		try {
+			code = yhMailService.getVerifyCode(account, at.getGoodsId(), null, 1);
+		} catch (Exception e) {
+			if (e.getMessage() != null && e.getMessage().contains("认证链接")) {
+				throw BusinessRuntimeException.getInstance("请联系用户确认是否发送邮件");
+			}
+			throw BusinessRuntimeException.getInstance(e.getMessage());
+		}
+		return code;
+	}
 }

+ 19 - 0
netflix-service/src/main/java/com/cyksj/service/mange/impl/CmsOrderDonServiceImpl.java

@@ -199,6 +199,8 @@ public class CmsOrderDonServiceImpl extends ServiceImpl<OrderDonMapper,OrderDon>
 
     private final OrderDonRenewRecordMapper orderDonRenewRecordMapper;
 
+    private final LumaUserMapper lumaUserMapper;
+
     private static final GlobalThreadPoolTaskExecutor TASK_POOL = GlobalThreadPoolTaskExecutor.getInstance();
 
     @Override
@@ -509,6 +511,23 @@ public class CmsOrderDonServiceImpl extends ServiceImpl<OrderDonMapper,OrderDon>
                 }
             }
         }
+
+        //扣除luma套餐次数
+        if (upgradePackage.getGoodsId() == Constant.LUMA_GOODS_ID) {
+            LumaUser lumaUser = lumaUserMapper.selectOne(Wrappers.lambdaQuery(LumaUser.class).eq(LumaUser::getRelationId, orderDon.getRelationId()));
+            if (lumaUser != null) {
+                int update = lumaUserMapper.update(null, Wrappers.lambdaUpdate(LumaUser.class)
+                        .set(LumaUser::getNum, lumaUser.getNum() < upgradePackage.getNum() ? 0 : lumaUser.getNum() - upgradePackage.getNum())
+                        .eq(LumaUser::getId, lumaUser.getId()));
+                if (update == 0) {
+                    log.info("lumaUser 套餐包增值失败 id:{},orderId:{}", lumaUser.getId(), orderDon.getId());
+                }
+                Long decr = redisService.decr(RedisService.key.LUMA_NUM_LIMIT.getName() + lumaUser.getId(), upgradePackage.getNum().longValue());
+                if (decr < 0) {
+                    redisService.set(RedisService.key.LUMA_NUM_LIMIT.getName() + lumaUser.getId(), 0L);
+                }
+            }
+        }
     }
 
     /**

+ 14 - 0
netflix-service/src/main/java/com/cyksj/service/mange/impl/MirrorUserCleatServiceImpl.java

@@ -2,6 +2,7 @@ package com.cyksj.service.mange.impl;
 
 import cn.hutool.core.date.DateUtil;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.cyksj.common.constant.Constant;
 import com.cyksj.mapper.*;
 import com.cyksj.model.entity.*;
 import com.cyksj.redis.RedisService;
@@ -45,6 +46,8 @@ public class MirrorUserCleatServiceImpl implements MirrorUserCleatService {
 
 	private final ClaudeUserMapper claudeUserMapper;
 
+	private final LumaUserMapper lumaUserMapper;
+
 	@Override
 	public void delMirrorUser(Long goodsId, Long relationId) {
 		//gpt镜像
@@ -75,6 +78,17 @@ public class MirrorUserCleatServiceImpl implements MirrorUserCleatService {
 						.eq(ClaudeUser::getRelationId, relationId));
 			}
 		}
+
+		//luma
+		if (goodsId != null && goodsId == Constant.LUMA_GOODS_ID) {
+			LumaUser user = lumaUserMapper.selectOne(Wrappers.lambdaQuery(LumaUser.class)
+					.eq(LumaUser::getRelationId, relationId).last("limit 1"));
+			if (user != null) {
+				lumaUserMapper.delete(Wrappers.lambdaQuery(LumaUser.class)
+						.eq(LumaUser::getRelationId, relationId));
+				redisService.del(RedisService.key.LUMA_NUM_LIMIT.getName() + user.getId());
+			}
+		}
 	}
 
 	@Override

+ 19 - 2
netflix-service/src/main/java/com/cyksj/service/order/impl/OrderDonServiceImpl.java

@@ -72,7 +72,6 @@ import com.cyksj.model.views.*;
 import com.cyksj.redis.RedisService;
 import com.cyksj.service.corp.WxCorpOps;
 import com.cyksj.service.coupon.CouponFontService;
-import com.cyksj.service.distribute.DistributeExtraRebateService;
 import com.cyksj.service.distribute.UserBusinessFrontService;
 import com.cyksj.service.distribute.equipment.EquipmentDistributeService;
 import com.cyksj.service.exchange.ExchangeCodeService;
@@ -308,7 +307,7 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
 
 	private final ChatgptUserMapper chatgptUserMapper;
 
-	private final DistributeExtraRebateService distributeExtraRebateService;
+	private final LumaUserMapper lumaUserMapper;
 
 	private final UserTrialTicketJumpPayRecordMapper userTrialTicketJumpPayRecordMapper;
 
@@ -3601,6 +3600,24 @@ public class OrderDonServiceImpl extends ServiceImpl<OrderDonMapper, OrderDon> i
 				}
 			}
 		}
+
+		//luma
+		if (upgradePackage.getGoodsId() == Constant.LUMA_GOODS_ID) {
+			LumaUser lumaUser = lumaUserMapper.selectOne(Wrappers.lambdaQuery(LumaUser.class).eq(LumaUser::getRelationId, orderDon.getRelationId()));
+			if (lumaUser != null) {
+				int update = lumaUserMapper.update(null, Wrappers.lambdaUpdate(LumaUser.class)
+						.set(LumaUser::getNum, lumaUser.getNum() + upgradePackage.getNum()).eq(LumaUser::getId, lumaUser.getId()));
+				if (update == 0) {
+					log.info("lumaUser 套餐包增值失败 id:{},orderId:{}", lumaUser.getId(), orderDon.getId());
+				}
+				Object num = redisService.get(RedisService.key.LUMA_NUM_LIMIT.getName() + lumaUser.getId());
+				if (num == null) {
+					redisService.set(RedisService.key.LUMA_NUM_LIMIT.getName() + lumaUser.getId(), lumaUser.getNum() + upgradePackage.getNum().longValue(), RedisService.key.LUMA_NUM_LIMIT.getTimeout());
+				} else {
+					redisService.incr(RedisService.key.LUMA_NUM_LIMIT.getName() + lumaUser.getId(), upgradePackage.getNum().longValue());
+				}
+			}
+		}
 	}
 
 

+ 39 - 92
netflix-service/src/main/java/com/cyksj/service/relation/impl/GroupRelationFrontServiceImpl.java

@@ -8,9 +8,6 @@ import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.lang.Assert;
 import cn.hutool.core.lang.Validator;
 import cn.hutool.core.util.StrUtil;
-import cn.hutool.http.HttpRequest;
-import cn.hutool.http.HttpStatus;
-import cn.hutool.http.HttpUtil;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.cyksj.common.constant.Constant;
@@ -18,7 +15,6 @@ import com.cyksj.common.exception.BusinessRuntimeException;
 import com.cyksj.common.task.GlobalThreadPoolTaskExecutor;
 import com.cyksj.common.util.Jsons;
 import com.cyksj.common.util.StringUtil;
-import com.cyksj.common.util.TicketCodeCommonUtil;
 import com.cyksj.enums.GatewayApiCode;
 import com.cyksj.mapper.*;
 import com.cyksj.mapper.manage.distribute.DistributeGeneralSkuRateMapper;
@@ -36,8 +32,10 @@ import com.cyksj.service.chatgpt.ChatGptAccountService;
 import com.cyksj.service.chatgpt.ChatGptAuthService;
 import com.cyksj.service.claude.ClaudeService;
 import com.cyksj.service.groups.GroupsFuncService;
+import com.cyksj.service.luma.LumaService;
 import com.cyksj.service.mail.CuiQiuMailService;
 import com.cyksj.service.mail.MailService;
+import com.cyksj.service.mail.YhMailService;
 import com.cyksj.service.mange.coupon.CouponCommonService;
 import com.cyksj.service.midjourney.MidjourneyAccountService;
 import com.cyksj.service.relation.GroupRelationFrontService;
@@ -58,7 +56,10 @@ import org.springframework.transaction.annotation.Transactional;
 import javax.servlet.http.HttpServletRequest;
 import java.math.BigDecimal;
 import java.math.RoundingMode;
-import java.util.*;
+import java.util.Date;
+import java.util.List;
+import java.util.Objects;
+import java.util.Optional;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicInteger;
@@ -127,7 +128,7 @@ public class GroupRelationFrontServiceImpl implements GroupRelationFrontService
 
 	private final UpgradePackageMapper upgradePackageMapper;
 
-	private final GoodsDonQaRelateMapper goodsDonQaRelateMapper;
+	private final LumaService lumaService;
 
 	private final GroupsRelationNetflixService groupsRelationNetflixService;
 
@@ -145,6 +146,8 @@ public class GroupRelationFrontServiceImpl implements GroupRelationFrontService
 
 	private final ClaudeService claudeService;
 
+	private final YhMailService yhMailService;
+
 	@Override
 	public SearchResult<RenewalView> getMyTicket(long userId, Boolean isLoginPopularize, String customId, String account) {
 		User u = userMapper.selectById(userId);
@@ -317,6 +320,17 @@ public class GroupRelationFrontServiceImpl implements GroupRelationFrontService
 				} catch (Exception e) {
 				}
 			}
+			if (ticket.getGoodsId() == Constant.LUMA_GOODS_ID && ticket.getExpiryTime() != null) {
+				try {
+					List<UpgradePackage> upgradePackages = upgradePackageMapper.selectList(Wrappers.lambdaQuery(UpgradePackage.class).apply("JSON_CONTAINS(sku_ids,'\"" + ticket.getSkuId() + "\"')").eq(UpgradePackage::getStatus, Boolean.TRUE).eq(UpgradePackage::getDeleted, Boolean.TRUE));
+					if (CollectionUtil.isNotEmpty(upgradePackages)){
+						upgradePackages.stream().map(e -> e.getPrice().divide(BigDecimal.valueOf(e.getNum()), 2, RoundingMode.HALF_UP)).min(BigDecimal::compareTo).ifPresent(ticket::setLumaPackagePrice);
+					}
+					LumaUser lumaUser = lumaService.getLumaUser(userId, ticket.getRelationId());
+					ticket.setLumaUserNum(lumaUser.getNum());
+				} catch (Exception e) {
+				}
+			}
 			List<GroupsRelationUserView> relationUserViews = groupsRelationMapper.getUserRelationUserViews(ticket.getGroupId(), ticket.getRelationId(), ticket.getUserId(), List.of(GroupsRelation.Status.validity, GroupsRelation.Status.outside));
 			ticket.setRelationViews(relationUserViews);
 			if (ticket.getExpiryTime() != null) {
@@ -558,35 +572,26 @@ public class GroupRelationFrontServiceImpl implements GroupRelationFrontService
 			throw BusinessRuntimeException.getInstance("您的车票账号密码异常,请联系客服...");
 		}
 		if (cuiQiuMailService.isCuiQiuEmail(renewalView.getAccount())) {
-			return cuiQiuMailService.getVerifyCode(renewalView.getAccount(), renewalView.getGoodsId(), type, sync, loginReq.getLinkType());
+			return cuiQiuMailService.getVerifyCode(renewalView.getAccount(), renewalView.getGoodsId(), type, loginReq.getLinkType());
 		}
-		//获取邮箱密码
-		SysEmail sysEmail = sysEmailMapper.selectOne(Wrappers.lambdaQuery(SysEmail.class)
-				.eq(SysEmail::getEmail, account)
-				.last("limit 1"));
-		if (sysEmail == null) {
-			log.info("获取账号:{}验证码异常,未配置对应系统邮箱", account);
-			throw BusinessRuntimeException.getInstance("获取账号验证码异常,请联系客服...");
-		}
-		String url = "http://yinhelx.com/api/controller.php";
-		Map<String, Object> params = new HashMap<>();
-
-		params.put("imap_key", "imap_56568niua@@");
-		params.put("fun", "imap_read");
-		params.put("imap_ip", "yinhelx.com");
-		params.put("port", "143");
-		params.put("username", account);
-		params.put("password", sysEmail.getPassword());
-		params.put("mbox_id", "0");
-		params.put("delete", "0");
-
-		HttpRequest post = HttpUtil.createPost(url);
-		post.form(params);
-		cn.hutool.http.HttpResponse execute = post.execute();
-		if (execute.getStatus() != HttpStatus.HTTP_OK) {
-			throw BusinessRuntimeException.getInstance("获取验证码异常,请联系客服...");
-		}
-		String code = getDifferentGoodsCode(renewalView.getGoodsId(), execute.body(), type, sync, loginReq.getLinkType());
+		if (renewalView.getGoodsId() == 1l) {
+			Integer linkType = loginReq.getLinkType();
+			if (type == null && linkType == null) {
+				throw BusinessRuntimeException.getInstance("系统异常");
+			}
+			String key = RedisService.key.NF_UPGRAD_USER_LIMIT_KEY.getNameFormat(DateUtil.hour(DateTime.now(), true), linkType, renewalView.getUserId());
+			if (!redisService.hasKey(key)) {
+				redisService.set(key, 1l, RedisService.key.NF_UPGRAD_USER_LIMIT_KEY.getTimeout());
+			} else {
+				Integer value = (Integer) redisService.get(key);
+				if (value >= 5) {
+					throw BusinessRuntimeException.getInstance("获取失败,请联系客服");
+				}
+				redisService.incr(key, 1L);
+			}
+		}
+		//银河域名邮件
+		String code = yhMailService.getVerifyCode(account, renewalView.getGoodsId(), type, loginReq.getLinkType());
 		GroupsRelationLoginCodeRecord record = new GroupsRelationLoginCodeRecord();
 		record.setUserId(userId);
 		record.setRelationId(relationId);
@@ -787,64 +792,6 @@ public class GroupRelationFrontServiceImpl implements GroupRelationFrontService
 		return expiryTickets;
 	}
 
-	public String getDifferentGoodsCode(Long goodsId, String body, Integer type, Boolean sync, Integer linkType) {
-		String code = null;
-		//奈飞
-		if (goodsId == 1) {
-			if (type != null && type == 1) {
-				if (body.contains("輸入此代碼登入") || body.contains("输入此代码登录") || body.contains("Enter this code to sign in")) {
-					code = StrUtil.subBetween(body, "輸入此代碼登入", "請在裝置上輸入上");
-					if (StrUtil.isEmpty(code)) {
-						code = StrUtil.subAfter(body, "输入此代码登录", true);
-					}
-					if (StrUtil.isEmpty(code)) {
-						code = StrUtil.subAfter(body, "Enter this code to sign in", true);
-					}
-				}
-				if (StrUtil.isEmpty(code)) {
-					throw BusinessRuntimeException.getInstance("查询失败,请检查是否发送了登陆码..");
-				}
-			} else {
-				String urlPref;
-				//更新装置
-				if (linkType == 1) {
-					urlPref = "https://www.netflix.com/account/update-primary-location";
-					code = StrUtil.subBetween(body, "[" + urlPref, "]");
-				} else {
-					//验证链接
-					urlPref = "https://www.netflix.com/account/travel/verify";
-					code = StrUtil.subBetween(body, "[" + urlPref, "]");
-				}
-				if (StrUtil.isEmpty(code)) {
-					throw BusinessRuntimeException.getInstance("获取认证链接失败,请重新获取");
-				}
-				String url = urlPref + code;
-				//非点击装置同步更新按钮 直接返回链接
-				if (linkType == 2) return url;
-				//失败返回验证链接
-				if (!groupsRelationNetflixService.confirmUpdate(url)) {
-					return url;
-				}
-				return StrUtil.EMPTY;
-			}
-		}
-		//除奈飞
-		if (StrUtil.isEmpty(code)) {
-			code = TicketCodeCommonUtil.getTicketCodeStr(body, goodsId);
-		}
-		int length = 4;
-		if (goodsId == 33l) {
-			length = 6;
-		}
-		code = StringUtil.getVerifyCodePattern(code, length);
-		if (!Validator.isNumber(code)) {
-			log.error("获取账号验证码失败:{}", StrUtil.subSufByLength(code, 512));
-			throw BusinessRuntimeException.getInstance("获取验证码失败,请重新获取..");
-		}
-		return code.trim();
-	}
-
-
 	@Override
 	public void getCollegeStudentUserGptTicket(Long userId) {
 		Retryer<Boolean> build = RetryerBuilder.<Boolean>newBuilder()

+ 6 - 3
netflix-service/src/main/java/com/cyksj/service/relation/impl/GroupsRelationNetflixServiceImpl.java

@@ -67,7 +67,7 @@ public class GroupsRelationNetflixServiceImpl implements GroupsRelationNetflixSe
 			params.putOpt("pin_code", code);
 		}
 		//设置座位
-		String url = Constant.ZHAOJU_MOVIES + "/netflix_set/netflix_seat";
+		String url = Constant.ZHAOJU_MOVIES + "/netflix_seat";
 		log.info("设置账号:{} 奈飞用户:{}座位信息", account, seatName);
 		try {
 			HttpResponse<String> res =
@@ -106,6 +106,9 @@ public class GroupsRelationNetflixServiceImpl implements GroupsRelationNetflixSe
 			throw BusinessRuntimeException.getInstance("系统错误");
 		}
 		User user = userMapper.selectById(relation.getUserId());
+		if (!redisService.setNx(RedisService.key.NF_SET_TIME_LIMIT.getName() + relationId, relationId, RedisService.key.NF_SET_TIME_LIMIT.getTimeout())) {
+			throw BusinessRuntimeException.getInstance("一分钟内可执行一次");
+		}
 		return setNetflixSeatNum(relation.getNum(), user.getNickname(), account.getAccount(), account.getPassword(), relation.getExpiryTime(), code);
 	}
 
@@ -114,7 +117,7 @@ public class GroupsRelationNetflixServiceImpl implements GroupsRelationNetflixSe
 		JSONObject params = new JSONObject();
 		params.putOpt("transId", taskId);
 		//查询任务状态
-		String url = Constant.ZHAOJU_MOVIES + "/netflix_set/netflix_task_status";
+		String url = Constant.ZHAOJU_MOVIES + "/netflix_task_status";
 		HttpResponse<String> res =
 				J11HttpC.custom()
 						.ofPost()
@@ -138,7 +141,7 @@ public class GroupsRelationNetflixServiceImpl implements GroupsRelationNetflixSe
 		JSONObject params = new JSONObject();
 		params.putOpt("url", nfUrl);
 		//确认更新点击
-		String url = Constant.ZHAOJU_MOVIES + "/netflix_set/netflix_primary_action";
+		String url = Constant.ZHAOJU_MOVIES + "/netflix_primary_action";
 		try {
 			cn.hutool.http.HttpResponse execute = HttpUtil
 					.createPost(url)

+ 10 - 0
netflix-web/src/main/java/com/cyksj/web/controller/manage/account/CmsAccountController.java

@@ -1295,4 +1295,14 @@ public class CmsAccountController {
 				.field(AccountDisableView::getIsDisable, 1).build());
 		return GatewayResponse.SUCCESS.newBuilder().toResult(search);
 	}
+
+
+	/**
+	 * 奈飞同步用户更新装置
+	 */
+	@PostMapping("/nf/upgrade/device/{accountId}")
+	public Result<String> nfUpgradeDevice(@PathVariable Long accountId) throws Exception {
+		String url = accountService.nfUpgradeDevice(accountId);
+		return GatewayResponse.SUCCESS.newBuilder().toResult(url);
+	}
 }

+ 22 - 0
netflix-web/src/main/java/com/cyksj/web/controller/mirror/MirrorController.java

@@ -18,6 +18,7 @@ import com.cyksj.model.response.ConversationLimitResponse;
 import com.cyksj.model.views.*;
 import com.cyksj.service.chatgpt.ChatGptAccountService;
 import com.cyksj.service.claude.ClaudeService;
+import com.cyksj.service.luma.LumaService;
 import com.cyksj.service.midjourney.MidjourneyAccountService;
 import com.cyksj.web.util.StpUserUtil;
 import com.ejlchina.searcher.BeanSearcher;
@@ -74,12 +75,20 @@ public class MirrorController {
     @Value("${midjourney.drawUrl}")
     private String midjourneyDrawUrl;
 
+    @Value("${luma.url}")
+    private String lumaHost;
+
+    @Value("${luma.videoUrl}")
+    private String lumaVideoUrl;
+
     private final RenewUpgradePackageMapper renewUpgradePackageMapper;
 
     private final GroupsRelationMapper relationMapper;
 
     private final GroupsMapper groupsMapper;
 
+    private final LumaService lumaService;
+
 
     /**
      * GPT车票跳转登录
@@ -583,4 +592,17 @@ public class MirrorController {
             });
         }
     }
+
+
+    /**
+     * luma车票跳转登录
+     *
+     * @param relationId 车票id
+     */
+    @GetMapping("/luma/{relationId}")
+    public Result<String> lumaRedirect(@PathVariable Long relationId) {
+        Long userId = StpUserUtil.getLoginIdAsLong();
+        LumaUser lumaUser = lumaService.getLumaUser(userId, relationId);
+        return GatewayResponse.SUCCESS.newBuilder().toResult(lumaHost + (EnvCommonService.active_pre.equals(envCommonService.getEnv()) ? "/8083":"/8085") +"/api/applets/luma/lumaMirrorWithToken/" + lumaUser.getUserToken());
+    }
 }

+ 21 - 0
netflix-web/src/main/java/com/cyksj/web/controller/payment/OrderController.java

@@ -33,8 +33,10 @@ import com.cyksj.model.request.AlipayOrderDonReq;
 import com.cyksj.model.request.OrderPayRequest;
 import com.cyksj.model.response.AliPayTradeStatus;
 import com.cyksj.model.views.GoodsDonSkuView;
+import com.cyksj.model.views.LumaUserView;
 import com.cyksj.model.views.MidjourneyUserView;
 import com.cyksj.model.views.OrderCommentView;
+import com.cyksj.service.luma.LumaService;
 import com.cyksj.service.midjourney.MidjourneyAccountService;
 import com.cyksj.service.order.OrderDonService;
 import com.cyksj.service.paypal.PayPalService;
@@ -129,6 +131,9 @@ public class OrderController {
     @Autowired
     private OrderDonRenewRecordMapper orderDonRenewRecordMapper;
 
+    @Autowired
+    private LumaService lumaService;
+
     /**
      * 支付
      * @author chan
@@ -862,4 +867,20 @@ public class OrderController {
                 .build());
         return GatewayResponse.SUCCESS.newBuilder().toResult(search);
     }
+
+    /**
+     * luma查询订单用户账号剩余次数
+     */
+    @GetMapping("/get/luma/user")
+    public Result<LumaUserView> getLumaUser(Long relationId) {
+        long userId = StpUserUtil.getLoginIdAsLong();
+        LumaUserView search = beanSearcher.searchFirst(LumaUserView.class, MapUtils.flatBuilder(request.getParameterMap())
+                .field(LumaUserView::getUserId, userId).field(LumaUserView::getRelationId, relationId).build());
+        if (search == null) {
+            LumaUser lumaUser = lumaService.getLumaUser(userId, relationId);
+            search = new LumaUserView();
+            BeanUtils.copyProperties(lumaUser, search);
+        }
+        return GatewayResponse.SUCCESS.newBuilder().toResult(search);
+    }
 }

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
netflix-web/src/main/resources/application-dev.yml


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 0 - 0
netflix-web/src/main/resources/application-prd.yml


+ 5 - 1
netflix-web/src/main/resources/application-pre.yml

@@ -197,4 +197,8 @@ smsVerify:
 
 midjourney:
   url: https://mj1.galaxydvd.com
-  drawUrl: https://nf.video/drawTest/web/
+  drawUrl: https://nf.video/drawTest/web/
+
+luma:
+  url: https://luma.galaxydvd.com
+  videoUrl: https://luma.galaxydvd.com/videoTest/web

Daži faili netika attēloti, jo izmaiņu fails ir pārāk liels