Sfoglia il codice sorgente

Merge branch 'master' into pre

zoujiajian 2 anni fa
parent
commit
ca780734bb

+ 5 - 5
netflix-service/src/main/java/com/cyksj/service/midjourney/impl/MidJourneyAccountServiceImpl.java

@@ -129,7 +129,7 @@ public class MidJourneyAccountServiceImpl extends ServiceImpl<MidjourneyAccountM
 
     private void addAcount(MidjourneyAccount midjourneyAccount) throws Exception {
         Map<String, Object> accountParam = createAccountParam(midjourneyAccount);
-        String body = HttpRequest.post(HOST + "/mj/account/create").body(Jsons.toJson(accountParam)).execute().body();
+        String body = HttpRequest.post(HOST + "/mj/account/create").header("mj-api-secret", "5a9a3e9b-5a5e-4b6b-9a5a-9a5a5a5a5a5a").body(Jsons.toJson(accountParam)).execute().body();
         log.info("addAccount body:{}", body);
         JSONObject jsonObject = JSONUtil.parseObj(body);
         if (jsonObject.getInt("code") != 1) {
@@ -184,7 +184,7 @@ public class MidJourneyAccountServiceImpl extends ServiceImpl<MidjourneyAccountM
     }
 
     private void delAcount(Long id) {
-        String body = HttpRequest.delete(HOST + "/mj/account/"+id+"/delete").execute().body();
+        String body = HttpRequest.delete(HOST + "/mj/account/"+id+"/delete").header("mj-api-secret", "5a9a3e9b-5a5e-4b6b-9a5a-9a5a5a5a5a5a").execute().body();
         log.info("delAcount body:{}", body);
         JSONObject jsonObject = JSONUtil.parseObj(body);
         if (jsonObject.getInt("code") != 1) {
@@ -193,7 +193,7 @@ public class MidJourneyAccountServiceImpl extends ServiceImpl<MidjourneyAccountM
     }
 
     private Long getAccount(Long id) throws Exception {
-        String body = HttpRequest.post(HOST + "/mj/account/query").body(Jsons.toJson(MapUtil.of("remark", id))).execute().body();
+        String body = HttpRequest.post(HOST + "/mj/account/query").header("mj-api-secret", "5a9a3e9b-5a5e-4b6b-9a5a-9a5a5a5a5a5a").body(Jsons.toJson(MapUtil.of("remark", id))).execute().body();
         log.info("getAccount body:{}", body);
         JSONObject jsonObject = JSONUtil.parseObj(body);
         return JSONUtil.parseObj(JSONUtil.parseArray(jsonObject.getStr("content")).get(0)).get("id", Long.class);
@@ -202,7 +202,7 @@ public class MidJourneyAccountServiceImpl extends ServiceImpl<MidjourneyAccountM
     private void updAccount(MidjourneyAccount midjourneyAccount){
         Map<String, Object> accountParam = createAccountParam(midjourneyAccount);
         String body = HttpRequest.put(HOST + "/mj/account/"+midjourneyAccount.getInstanceId()+"/update-reconnect")
-                .body(JSONUtil.toJsonStr(accountParam)).execute().body();
+                .header("mj-api-secret", "5a9a3e9b-5a5e-4b6b-9a5a-9a5a5a5a5a5a").body(JSONUtil.toJsonStr(accountParam)).execute().body();
         log.info("updAccount body:{}", body);
         JSONObject jsonObject = JSONUtil.parseObj(body);
         if (jsonObject.getInt("code") != 1) {
@@ -211,7 +211,7 @@ public class MidJourneyAccountServiceImpl extends ServiceImpl<MidjourneyAccountM
     }
 
     private String syncInfo(Long id){
-        String body = HttpRequest.post(HOST + "/mj/account/"+id+"/sync-info").execute().body();
+        String body = HttpRequest.post(HOST + "/mj/account/"+id+"/sync-info").header("mj-api-secret", "5a9a3e9b-5a5e-4b6b-9a5a-9a5a5a5a5a5a").execute().body();
         log.info("syncInfo body:{}", body);
         JSONObject jsonObject = JSONUtil.parseObj(body);
         if (jsonObject.getInt("code") != 1) {

+ 10 - 2
netflix-service/src/main/java/com/cyksj/service/order/impl/OrderCommonServiceImpl.java

@@ -95,7 +95,11 @@ public class OrderCommonServiceImpl implements OrderCommonService {
 						if (sku.getDays() != null && sku.getDays() > 0) {
 							refundExpiryTime = DateUtil.offsetDay(expiryTime, -sku.getDays() * num);
 						} else {
-							refundExpiryTime = DateUtil.offsetMonth(expiryTime, -sku.getMonths() * num);
+							if (sku.getGoodsId() == 1 && sku.getMonths() == 1) {
+								refundExpiryTime = DateUtil.offsetDay(expiryTime, -30);
+							} else {
+								refundExpiryTime = DateUtil.offsetMonth(expiryTime, -sku.getMonths() * num);
+							}
 						}
 						if (now.isBefore(refundExpiryTime)) {
 							isFlag = false;
@@ -121,7 +125,11 @@ public class OrderCommonServiceImpl implements OrderCommonService {
 						if (sku.getDays() != null && sku.getDays() > 0) {
 							expiryTime = DateUtil.offsetDay(expiryTime, -sku.getDays() * num);
 						} else {
-							expiryTime = DateUtil.offsetMonth(expiryTime, -sku.getMonths() * num);
+							if (sku.getGoodsId() == 1 && sku.getMonths() == 1) {
+								expiryTime = DateUtil.offsetDay(expiryTime, -30);
+							} else{
+								expiryTime = DateUtil.offsetMonth(expiryTime, -sku.getMonths() * num);
+							}
 						}
 						relation.setExpiryTime(expiryTime);
 						groupsRelationMapper.updateById(relation);

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

@@ -344,7 +344,7 @@ public class MirrorController {
     public Result<String> midjourneyMirror(@PathVariable Long relationId) {
         Long userId = StpUserUtil.getLoginIdAsLong();
         MidjourneyUser midjourneyUser = midjourneyAccountService.getMidjourneyUserToken(userId, relationId);
-        return GatewayResponse.SUCCESS.newBuilder().toResult(midjourneyHost + (EnvCommonService.active.equals(envCommonService.getEnv()) ? "/8081":"/8082") +"/api/applets/mirror/midjourneyMirrorWithToken/" + midjourneyUser.getUserToken());
+        return GatewayResponse.SUCCESS.newBuilder().toResult(midjourneyHost + (EnvCommonService.active.equals(envCommonService.getEnv()) ? "/8081":"/8082") +"/api/applets/midjourney/midjourneyMirrorWithToken/" + midjourneyUser.getUserToken());
     }
 
     @GetMapping("/midjourneyMirrorWithToken/{userToken}")