Browse Source

隐藏紫鸟接口及SDK

tsurumure 3 months ago
parent
commit
6be9438642
20 changed files with 1363 additions and 1363 deletions
  1. 7 7
      pom.xml
  2. 44 44
      src/main/java/com/backendsys/controller/Ai/AiznController.java
  3. 64 64
      src/main/java/com/backendsys/controller/Ai/AiznGoodController.java
  4. 33 33
      src/main/java/com/backendsys/controller/Ai/AiznImageIncantaionController.java
  5. 41 41
      src/main/java/com/backendsys/controller/Ai/AiznImageTaskController.java
  6. 117 117
      src/main/java/com/backendsys/controller/Ai/AiznModelController.java
  7. 18 18
      src/main/java/com/backendsys/mapper/Ai/Aizn/AiznImageIncantationMapper.java
  8. 37 37
      src/main/java/com/backendsys/mapper/Ai/Aizn/AiznImageIncantationMapper.xml
  9. 18 18
      src/main/java/com/backendsys/mapper/Ai/Aizn/AiznImageTaskMapper.java
  10. 81 81
      src/main/java/com/backendsys/mapper/Ai/Aizn/AiznImageTaskMapper.xml
  11. 19 19
      src/main/java/com/backendsys/service/Ai/Aizn/AiznGoodService.java
  12. 175 175
      src/main/java/com/backendsys/service/Ai/Aizn/AiznGoodServiceImpl.java
  13. 14 14
      src/main/java/com/backendsys/service/Ai/Aizn/AiznImageIncantationService.java
  14. 55 55
      src/main/java/com/backendsys/service/Ai/Aizn/AiznImageIncantationServiceImpl.java
  15. 17 17
      src/main/java/com/backendsys/service/Ai/Aizn/AiznImageTaskService.java
  16. 193 193
      src/main/java/com/backendsys/service/Ai/Aizn/AiznImageTaskServiceImpl.java
  17. 27 27
      src/main/java/com/backendsys/service/Ai/Aizn/AiznModelService.java
  18. 325 325
      src/main/java/com/backendsys/service/Ai/Aizn/AiznModelServiceImpl.java
  19. 11 11
      src/main/java/com/backendsys/service/Ai/Aizn/AiznService.java
  20. 67 67
      src/main/java/com/backendsys/service/Ai/Aizn/AiznServiceImpl.java

+ 7 - 7
pom.xml

@@ -317,13 +317,13 @@
         <!--    <artifactId>ziniao-sdk-java</artifactId>-->
         <!--    <version>5.1.0</version>-->
         <!--</dependency>-->
-        <dependency>
-            <groupId>com.ziniao</groupId>
-            <artifactId>ziniao-sdk-java</artifactId>
-            <version>5.1.0</version>
-            <scope>system</scope>
-            <systemPath>${project.basedir}/configuration/.m2/repository/ziniao-sdk-java-5.1.0.jar</systemPath>
-        </dependency>
+<!--        <dependency>-->
+<!--            <groupId>com.ziniao</groupId>-->
+<!--            <artifactId>ziniao-sdk-java</artifactId>-->
+<!--            <version>5.1.0</version>-->
+<!--            <scope>system</scope>-->
+<!--            <systemPath>${project.basedir}/configuration/.m2/repository/ziniao-sdk-java-5.1.0.jar</systemPath>-->
+<!--        </dependency>-->
 
         <!-- 火山AI SDK 测试-->
 <!--        <dependency>-->

+ 44 - 44
src/main/java/com/backendsys/controller/Ai/AiznController.java

@@ -1,44 +1,44 @@
-package com.backendsys.controller.Ai;
-
-import com.backendsys.exception.CustException;
-import com.fzzixun.openapi.sdk.client.OpenClient;
-import com.fzzixun.openapi.sdk.request.AppTokenRequest;
-import com.fzzixun.openapi.sdk.response.AppTokenResponse;
-import com.fzzixun.openapi.sdk.response.CommonResponse;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-@RestController
-public class AiznController {
-
-    private String url = "https://sbappstoreapi.ziniao.com";
-    private String appId = "202404191230940156308090880";
-    private String privateKeyIsv = "MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQCijRL8x8RIUCLUpiaS1OLZeXMGKhsGmL1+rF841Lzq4ZK27wyw3vtqI0wo76GK0MwZVl97Ku1g5MxYRtib4DIAaGjxU/XYFLh0i9Amcg+StoxjM9K9/w+xSLh4oqvpoWRszM7EcTgZrw4g86n2Nf3sFT3TMSsDOqbSNDYPgaiU01FDbtu9vOpDOt4D5/bmHqKhXIbPbDpIs8b7yq3kfXQjHcvZl02mAQPxqcyoIC6Sftjiccp/+ShgWs+uR3YhiLMn6rv2p4SvfdT+n+TY3/Gu2Ec4h6YkGd1pi1ZZ/cab0x2xgp4+zDCdgHzyNI6lv3C/MhSNlCDFPw2VYeDYE8hHAgMBAAECggEBAJY/sfpHKE3zDI7kWSlFb722/bQH/V0Wl6lb6NReB5VQFc3TnjZqlZdgswfvn7DxGIafCLiPUEVMlvlN2vARxgYMfFv80HP/ixPnG+o9admhtJgJkdUeysGCx0hyjFbyYCIVGVYIlONgpL2enE5BT8kFRVVN0EU21HXd3s5seYe9Zt6pTNHf387CDiHUJrpe3y01d30BWz/PhC9OE8LgVRS6YF9t4VB42ndkjmwqENY1fs4vg1KU7+EPPjtysovl5XXAGzCfsW0cjkirZdZFhb5mTDuWvs9ck7BKJkdjnTRGn2/mGZPikZWOUDUMinQTojVZ96QXSWlq9AC1WuaNu9kCgYEA0H7TXcgNInY35G3VK4a4uvZQ1UmcPQ9ATzli55GZXHHuznwTVyDhj3h/JZKjmdZfkFmsNw/qdCQCug8o9t/IccXY/T5rVSPsy4YwoX78CAH9tw0wZF6iVILitLxAtFmnM7TDR6OXo6hdisDu/TLVmq7sfgPxfC1QQnl/jGwUmwMCgYEAx5ZlI5ows3MojrXj1RyG8RRETFHvNcBEOZ7jhEaCIijka8m3tAsKbBvk1dRF1B6vNYS8DXN/DzjaVWXYFljyHvnsyeT46VFh+FZRur8I07rTKA/GSjOq2efyxkh6myk8B3DEN6RpxW3vBZngG4tbPHXSj1LVH/tmM8SU0mZsmG0CgYEAyZkoNXD/Skg26RhOW8TrkFQleuavPNcnXrNlb/X37Ux5FY0hgkjX8UsY3jK5IEIJq2EZxTANinlbbZ7FBFkDzwb4Nn6JeAzBpVW+ZhmMBw4tzjbhiNt8aO0Z2pqAkiJyKuvpOrbzJBrjQAwnygnCQsxK/dpAQMrr5Srn6taC4hMCgYEAkRSi6lFP63HfXnWbarN059N6nhvFDcZ4EYaNDf8O43PkLvIPpkGMTu+r1T+bjsjLRdT5ubFmABOsqf0BKaV4QsobtNrLkRaGZ7WfbWcmLHqWuX1V/2Q1Yna3xCi1bwp3R1VSXLwX4tq5r9Gd1YfkRzvCVkq4/6mILkNMhvDLKbUCgYAvR7EJmTW12rs39e/nK4DdlbKoALAsPE5QobBfdG50dTV/lKCLit1n8vm0PNtO9IE7Pz5ecxF2cdsPhncbMG6O7edkBqx1DT1RMwYA1EYFkqET0iOmZhXbrYQtlc5d2Yrm6lYQxZMN3DFv/C4SM48rb3x4o9djBbINADpScZgpbw==";
-
-    /**
-     * 获得签名
-     */
-    @GetMapping("/api/ai/zn/getSign")
-    public String getSign() {
-        return "OK";
-    }
-
-    /**
-     * [Method] 8.3.1.3 获取应用token
-     * https://open.ziniao.com/docSupport?docId=84#8.3.1.3%E8%8E%B7%E5%8F%96%E5%BA%94%E7%94%A8token27
-     */
-    private String getAppToken() {
-        OpenClient client = new OpenClient(url, appId, privateKeyIsv);
-        // 创建请求对象
-        AppTokenRequest request = new AppTokenRequest();
-        // 发送请求
-        CommonResponse response = client.execute(request);
-        if (response.isSuccess()) {
-            AppTokenResponse appTokenResponse = response.getDataObj(AppTokenResponse.class);
-            return appTokenResponse.getAppAuthToken();
-        } else {
-            throw new CustException(response.getErrorMsg());
-        }
-    }
-
-}
+//package com.backendsys.controller.Ai;
+//
+//import com.backendsys.exception.CustException;
+//import com.fzzixun.openapi.sdk.client.OpenClient;
+//import com.fzzixun.openapi.sdk.request.AppTokenRequest;
+//import com.fzzixun.openapi.sdk.response.AppTokenResponse;
+//import com.fzzixun.openapi.sdk.response.CommonResponse;
+//import org.springframework.web.bind.annotation.GetMapping;
+//import org.springframework.web.bind.annotation.RestController;
+//
+//@RestController
+//public class AiznController {
+//
+//    private String url = "https://sbappstoreapi.ziniao.com";
+//    private String appId = "202404191230940156308090880";
+//    private String privateKeyIsv = "MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQCijRL8x8RIUCLUpiaS1OLZeXMGKhsGmL1+rF841Lzq4ZK27wyw3vtqI0wo76GK0MwZVl97Ku1g5MxYRtib4DIAaGjxU/XYFLh0i9Amcg+StoxjM9K9/w+xSLh4oqvpoWRszM7EcTgZrw4g86n2Nf3sFT3TMSsDOqbSNDYPgaiU01FDbtu9vOpDOt4D5/bmHqKhXIbPbDpIs8b7yq3kfXQjHcvZl02mAQPxqcyoIC6Sftjiccp/+ShgWs+uR3YhiLMn6rv2p4SvfdT+n+TY3/Gu2Ec4h6YkGd1pi1ZZ/cab0x2xgp4+zDCdgHzyNI6lv3C/MhSNlCDFPw2VYeDYE8hHAgMBAAECggEBAJY/sfpHKE3zDI7kWSlFb722/bQH/V0Wl6lb6NReB5VQFc3TnjZqlZdgswfvn7DxGIafCLiPUEVMlvlN2vARxgYMfFv80HP/ixPnG+o9admhtJgJkdUeysGCx0hyjFbyYCIVGVYIlONgpL2enE5BT8kFRVVN0EU21HXd3s5seYe9Zt6pTNHf387CDiHUJrpe3y01d30BWz/PhC9OE8LgVRS6YF9t4VB42ndkjmwqENY1fs4vg1KU7+EPPjtysovl5XXAGzCfsW0cjkirZdZFhb5mTDuWvs9ck7BKJkdjnTRGn2/mGZPikZWOUDUMinQTojVZ96QXSWlq9AC1WuaNu9kCgYEA0H7TXcgNInY35G3VK4a4uvZQ1UmcPQ9ATzli55GZXHHuznwTVyDhj3h/JZKjmdZfkFmsNw/qdCQCug8o9t/IccXY/T5rVSPsy4YwoX78CAH9tw0wZF6iVILitLxAtFmnM7TDR6OXo6hdisDu/TLVmq7sfgPxfC1QQnl/jGwUmwMCgYEAx5ZlI5ows3MojrXj1RyG8RRETFHvNcBEOZ7jhEaCIijka8m3tAsKbBvk1dRF1B6vNYS8DXN/DzjaVWXYFljyHvnsyeT46VFh+FZRur8I07rTKA/GSjOq2efyxkh6myk8B3DEN6RpxW3vBZngG4tbPHXSj1LVH/tmM8SU0mZsmG0CgYEAyZkoNXD/Skg26RhOW8TrkFQleuavPNcnXrNlb/X37Ux5FY0hgkjX8UsY3jK5IEIJq2EZxTANinlbbZ7FBFkDzwb4Nn6JeAzBpVW+ZhmMBw4tzjbhiNt8aO0Z2pqAkiJyKuvpOrbzJBrjQAwnygnCQsxK/dpAQMrr5Srn6taC4hMCgYEAkRSi6lFP63HfXnWbarN059N6nhvFDcZ4EYaNDf8O43PkLvIPpkGMTu+r1T+bjsjLRdT5ubFmABOsqf0BKaV4QsobtNrLkRaGZ7WfbWcmLHqWuX1V/2Q1Yna3xCi1bwp3R1VSXLwX4tq5r9Gd1YfkRzvCVkq4/6mILkNMhvDLKbUCgYAvR7EJmTW12rs39e/nK4DdlbKoALAsPE5QobBfdG50dTV/lKCLit1n8vm0PNtO9IE7Pz5ecxF2cdsPhncbMG6O7edkBqx1DT1RMwYA1EYFkqET0iOmZhXbrYQtlc5d2Yrm6lYQxZMN3DFv/C4SM48rb3x4o9djBbINADpScZgpbw==";
+//
+//    /**
+//     * 获得签名
+//     */
+//    @GetMapping("/api/ai/zn/getSign")
+//    public String getSign() {
+//        return "OK";
+//    }
+//
+//    /**
+//     * [Method] 8.3.1.3 获取应用token
+//     * https://open.ziniao.com/docSupport?docId=84#8.3.1.3%E8%8E%B7%E5%8F%96%E5%BA%94%E7%94%A8token27
+//     */
+//    private String getAppToken() {
+//        OpenClient client = new OpenClient(url, appId, privateKeyIsv);
+//        // 创建请求对象
+//        AppTokenRequest request = new AppTokenRequest();
+//        // 发送请求
+//        CommonResponse response = client.execute(request);
+//        if (response.isSuccess()) {
+//            AppTokenResponse appTokenResponse = response.getDataObj(AppTokenResponse.class);
+//            return appTokenResponse.getAppAuthToken();
+//        } else {
+//            throw new CustException(response.getErrorMsg());
+//        }
+//    }
+//
+//}

+ 64 - 64
src/main/java/com/backendsys/controller/Ai/AiznGoodController.java

@@ -1,64 +1,64 @@
-package com.backendsys.controller.Ai;
-
-import com.backendsys.entity.Ai.Aizn.AiznGood.AiznGoodCompoundTask.AiznGoodCompoundTaskDTO;
-import com.backendsys.entity.Ai.Aizn.AiznGood.AiznGoodReplaceTask.AiznGoodReplaceTaskDTO;
-import com.backendsys.service.Ai.Aizn.AiznGoodService;
-import com.backendsys.service.Ai.Aizn.AiznImageTaskService;
-import com.backendsys.utils.response.Result;
-import jakarta.validation.constraints.NotEmpty;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RestController;
-
-import java.io.IOException;
-
-@RestController
-public class AiznGoodController {
-
-    @Autowired
-    private AiznImageTaskService aiznImageTaskService;
-
-    @Autowired
-    private AiznGoodService aiznGoodService;
-
-    /**
-     * [紫鸟] AI模特 - 商品合成 (发起任务)
-     */
-    @PreAuthorize("@sr.hasPermission('32')")
-    @PostMapping("/api/ai/zn/makeGoodCompoundTask")
-    public Result makeGoodCompoundTask(@Validated @RequestBody AiznGoodCompoundTaskDTO aiznGoodCompoundTaskDTO) {
-        return Result.success(aiznGoodService.makeGoodCompoundTask(aiznGoodCompoundTaskDTO));
-    }
-
-    /**
-     * [紫鸟] AI模特 - 商品合成 (查询任务)
-     */
-    @PreAuthorize("@sr.hasPermission('32')")
-    @GetMapping("/api/ai/zn/getProgressOfGoodCompoundTask")
-    public Result getProgressOfGoodCompoundTask(@NotEmpty(message = "任务ID 不能为空") String id) throws IOException {
-        return Result.success(aiznImageTaskService.getProgressOfTask(id, 11));
-    }
-
-    /**
-     * [紫鸟] AI模特 - 商品替换(发起任务)
-     */
-    @PreAuthorize("@sr.hasPermission('32')")
-    @PostMapping("/api/ai/zn/makeGoodReplaceTask")
-    public Result makeGoodReplaceTask(@Validated @RequestBody AiznGoodReplaceTaskDTO aiznGoodReplaceTaskDTO) {
-        return Result.success(aiznGoodService.makeGoodReplaceTask(aiznGoodReplaceTaskDTO));
-    }
-
-    /**
-     * [紫鸟] AI模特 - 商品合成 (查询任务)
-     */
-    @PreAuthorize("@sr.hasPermission('32')")
-    @GetMapping("/api/ai/zn/getProgressOfGoodReplaceTask")
-    public Result getProgressOfGoodReplaceTask(@NotEmpty(message = "任务ID 不能为空") String id) throws IOException {
-        return Result.success(aiznImageTaskService.getProgressOfTask(id, 12));
-    }
-
-}
+//package com.backendsys.controller.Ai;
+//
+//import com.backendsys.entity.Ai.Aizn.AiznGood.AiznGoodCompoundTask.AiznGoodCompoundTaskDTO;
+//import com.backendsys.entity.Ai.Aizn.AiznGood.AiznGoodReplaceTask.AiznGoodReplaceTaskDTO;
+//import com.backendsys.service.Ai.Aizn.AiznGoodService;
+//import com.backendsys.service.Ai.Aizn.AiznImageTaskService;
+//import com.backendsys.utils.response.Result;
+//import jakarta.validation.constraints.NotEmpty;
+//import org.springframework.beans.factory.annotation.Autowired;
+//import org.springframework.security.access.prepost.PreAuthorize;
+//import org.springframework.validation.annotation.Validated;
+//import org.springframework.web.bind.annotation.GetMapping;
+//import org.springframework.web.bind.annotation.PostMapping;
+//import org.springframework.web.bind.annotation.RequestBody;
+//import org.springframework.web.bind.annotation.RestController;
+//
+//import java.io.IOException;
+//
+//@RestController
+//public class AiznGoodController {
+//
+//    @Autowired
+//    private AiznImageTaskService aiznImageTaskService;
+//
+//    @Autowired
+//    private AiznGoodService aiznGoodService;
+//
+//    /**
+//     * [紫鸟] AI模特 - 商品合成 (发起任务)
+//     */
+//    @PreAuthorize("@sr.hasPermission('32')")
+//    @PostMapping("/api/ai/zn/makeGoodCompoundTask")
+//    public Result makeGoodCompoundTask(@Validated @RequestBody AiznGoodCompoundTaskDTO aiznGoodCompoundTaskDTO) {
+//        return Result.success(aiznGoodService.makeGoodCompoundTask(aiznGoodCompoundTaskDTO));
+//    }
+//
+//    /**
+//     * [紫鸟] AI模特 - 商品合成 (查询任务)
+//     */
+//    @PreAuthorize("@sr.hasPermission('32')")
+//    @GetMapping("/api/ai/zn/getProgressOfGoodCompoundTask")
+//    public Result getProgressOfGoodCompoundTask(@NotEmpty(message = "任务ID 不能为空") String id) throws IOException {
+//        return Result.success(aiznImageTaskService.getProgressOfTask(id, 11));
+//    }
+//
+//    /**
+//     * [紫鸟] AI模特 - 商品替换(发起任务)
+//     */
+//    @PreAuthorize("@sr.hasPermission('32')")
+//    @PostMapping("/api/ai/zn/makeGoodReplaceTask")
+//    public Result makeGoodReplaceTask(@Validated @RequestBody AiznGoodReplaceTaskDTO aiznGoodReplaceTaskDTO) {
+//        return Result.success(aiznGoodService.makeGoodReplaceTask(aiznGoodReplaceTaskDTO));
+//    }
+//
+//    /**
+//     * [紫鸟] AI模特 - 商品合成 (查询任务)
+//     */
+//    @PreAuthorize("@sr.hasPermission('32')")
+//    @GetMapping("/api/ai/zn/getProgressOfGoodReplaceTask")
+//    public Result getProgressOfGoodReplaceTask(@NotEmpty(message = "任务ID 不能为空") String id) throws IOException {
+//        return Result.success(aiznImageTaskService.getProgressOfTask(id, 12));
+//    }
+//
+//}

+ 33 - 33
src/main/java/com/backendsys/controller/Ai/AiznImageIncantaionController.java

@@ -1,33 +1,33 @@
-package com.backendsys.controller.Ai;
-
-import com.backendsys.entity.Ai.Aizn.AiznImageIncantationDTO;
-import com.backendsys.service.Ai.Aizn.AiznImageIncantationService;
-import com.backendsys.utils.response.Result;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-@RestController
-public class AiznImageIncantaionController {
-
-    @Autowired
-    private AiznImageIncantationService aiznImageIncantationService;
-
-    /**
-     * 获得咒语列表
-     */
-    @GetMapping("/api/ai/zn/getImageIncantation")
-    public Result getImageIncantation(@Validated AiznImageIncantationDTO aiznImageIncantationDTO) {
-        return Result.success(aiznImageIncantationService.getImageIncantationList(aiznImageIncantationDTO));
-    }
-
-    /**
-     * 获得示例列表
-     */
-    @GetMapping("/api/ai/zn/getImageIncantationDescription")
-    public Result getImageIncantationDescription() {
-        return Result.success(aiznImageIncantationService.getImageIncantationDescriptionList());
-    }
-
-}
+//package com.backendsys.controller.Ai;
+//
+//import com.backendsys.entity.Ai.Aizn.AiznImageIncantationDTO;
+//import com.backendsys.service.Ai.Aizn.AiznImageIncantationService;
+//import com.backendsys.utils.response.Result;
+//import org.springframework.beans.factory.annotation.Autowired;
+//import org.springframework.validation.annotation.Validated;
+//import org.springframework.web.bind.annotation.GetMapping;
+//import org.springframework.web.bind.annotation.RestController;
+//
+//@RestController
+//public class AiznImageIncantaionController {
+//
+//    @Autowired
+//    private AiznImageIncantationService aiznImageIncantationService;
+//
+//    /**
+//     * 获得咒语列表
+//     */
+//    @GetMapping("/api/ai/zn/getImageIncantation")
+//    public Result getImageIncantation(@Validated AiznImageIncantationDTO aiznImageIncantationDTO) {
+//        return Result.success(aiznImageIncantationService.getImageIncantationList(aiznImageIncantationDTO));
+//    }
+//
+//    /**
+//     * 获得示例列表
+//     */
+//    @GetMapping("/api/ai/zn/getImageIncantationDescription")
+//    public Result getImageIncantationDescription() {
+//        return Result.success(aiznImageIncantationService.getImageIncantationDescriptionList());
+//    }
+//
+//}

+ 41 - 41
src/main/java/com/backendsys/controller/Ai/AiznImageTaskController.java

@@ -1,41 +1,41 @@
-package com.backendsys.controller.Ai;
-
-import com.backendsys.aspect.HttpRequestAspect;
-import com.backendsys.entity.Ai.Aizn.AiznImageTaskVO;
-import com.backendsys.entity.PageDTO;
-import com.backendsys.service.Ai.Aizn.AiznImageTaskService;
-import com.backendsys.utils.response.Result;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RestController;
-
-@Validated
-@RestController
-public class AiznImageTaskController {
-
-    @Autowired
-    private HttpRequestAspect httpRequestAspect;
-
-    @Autowired
-    private AiznImageTaskService aiznImageTaskService;
-
-    /**
-     * 我的图片任务列表
-     */
-    @GetMapping("/api/ai/zn/getMyImageTaskList")
-    public Result getMyImageTaskList(@Validated PageDTO pageDTO, @Validated AiznImageTaskVO aiznImageTaskVO) {
-        aiznImageTaskVO.setUser_id(httpRequestAspect.getUserId());
-        return Result.success(aiznImageTaskService.getImageTaskList(pageDTO.getPage_num(), pageDTO.getPage_size(), aiznImageTaskVO));
-    }
-
-    /**
-     * 我的图片任务详情
-     */
-    @GetMapping("/api/ai/zn/getMyImageTaskDetail")
-    public Result getMyImageTaskList(@Validated(AiznImageTaskVO.Detail.class) AiznImageTaskVO aiznImageTaskVO) {
-        aiznImageTaskVO.setUser_id(httpRequestAspect.getUserId());
-        return Result.success(aiznImageTaskService.getImageTaskDetail(aiznImageTaskVO));
-    }
-
-}
+//package com.backendsys.controller.Ai;
+//
+//import com.backendsys.aspect.HttpRequestAspect;
+//import com.backendsys.entity.Ai.Aizn.AiznImageTaskVO;
+//import com.backendsys.entity.PageDTO;
+//import com.backendsys.service.Ai.Aizn.AiznImageTaskService;
+//import com.backendsys.utils.response.Result;
+//import org.springframework.beans.factory.annotation.Autowired;
+//import org.springframework.validation.annotation.Validated;
+//import org.springframework.web.bind.annotation.GetMapping;
+//import org.springframework.web.bind.annotation.RestController;
+//
+//@Validated
+//@RestController
+//public class AiznImageTaskController {
+//
+//    @Autowired
+//    private HttpRequestAspect httpRequestAspect;
+//
+//    @Autowired
+//    private AiznImageTaskService aiznImageTaskService;
+//
+//    /**
+//     * 我的图片任务列表
+//     */
+//    @GetMapping("/api/ai/zn/getMyImageTaskList")
+//    public Result getMyImageTaskList(@Validated PageDTO pageDTO, @Validated AiznImageTaskVO aiznImageTaskVO) {
+//        aiznImageTaskVO.setUser_id(httpRequestAspect.getUserId());
+//        return Result.success(aiznImageTaskService.getImageTaskList(pageDTO.getPage_num(), pageDTO.getPage_size(), aiznImageTaskVO));
+//    }
+//
+//    /**
+//     * 我的图片任务详情
+//     */
+//    @GetMapping("/api/ai/zn/getMyImageTaskDetail")
+//    public Result getMyImageTaskList(@Validated(AiznImageTaskVO.Detail.class) AiznImageTaskVO aiznImageTaskVO) {
+//        aiznImageTaskVO.setUser_id(httpRequestAspect.getUserId());
+//        return Result.success(aiznImageTaskService.getImageTaskDetail(aiznImageTaskVO));
+//    }
+//
+//}

+ 117 - 117
src/main/java/com/backendsys/controller/Ai/AiznModelController.java

@@ -1,117 +1,117 @@
-package com.backendsys.controller.Ai;
-
-import com.backendsys.entity.Ai.Aizn.AiznImageStyleDTO;
-import com.backendsys.entity.Ai.Aizn.AiznIntelligentClipTaskDTO;
-import com.backendsys.entity.Ai.Aizn.AiznInteractClipTask.AiznInteractClipTaskDTO;
-import com.backendsys.entity.Ai.Aizn.AiznModel.AiznModelTaskDTO;
-import com.backendsys.entity.System.SysResourcePointsDTO;
-import com.backendsys.exception.CustException;
-import com.backendsys.mapper.System.SysResourcePointsMapper;
-import com.backendsys.service.Ai.Aizn.AiznImageTaskService;
-import com.backendsys.service.Ai.Aizn.AiznModelService;
-import com.backendsys.service.SDKService.SDKTencent.SDKTencentCOSService;
-import com.backendsys.utils.response.Result;
-import jakarta.validation.constraints.NotEmpty;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.*;
-
-import java.io.IOException;
-
-@Validated
-@RestController
-public class AiznModelController {
-
-    @Autowired
-    private SysResourcePointsMapper sysResourcePointsMapper;
-
-    @Autowired
-    private AiznModelService aiznModelService;
-
-    @Autowired
-    private AiznImageTaskService aiznImageTaskService;
-
-    @Autowired
-    private SDKTencentCOSService sdkTencentCOSService;
-
-    /**
-     * [紫鸟] AI模特 - 获得风格/场景配置数据
-     */
-    @PreAuthorize("@sr.hasPermission('35')")
-    @GetMapping("/api/ai/zn/getImageStyle")
-    public Result getImageStyle(AiznImageStyleDTO aiznImageStyleDTO) {
-        return Result.success(aiznModelService.getImageStyle(aiznImageStyleDTO));
-    }
-
-    /**
-     * [紫鸟] AI模特 - 获得积分单价 (AI模特)
-     */
-    @PreAuthorize("@sr.hasPermission('35')")
-    @GetMapping("/api/ai/zn/getResourceOfZnModel")
-    public Result getImageStyle() {
-        SysResourcePointsDTO sysResourcePointsDTO = new SysResourcePointsDTO();
-        sysResourcePointsDTO.setResource_type("ZnModel");
-        return Result.success(sysResourcePointsMapper.queryResourcePointsList(sysResourcePointsDTO));
-    }
-
-
-    /**
-     * [紫鸟] AI模特 - 智能抠图 (发起任务)
-     */
-    @PreAuthorize("@sr.hasPermission('35')")
-    @PostMapping("/api/ai/zn/makeIntelligentClipTask")
-    public Result makeIntelligentClipTask(@Validated @RequestBody AiznIntelligentClipTaskDTO aiznIntelligentClipTaskDTO) {
-        return Result.success(aiznModelService.makeIntelligentClipTask(aiznIntelligentClipTaskDTO));
-    }
-
-    /**
-     * [紫鸟] AI模特 - 智能抠图 (查询任务)
-     */
-    @PreAuthorize("@sr.hasPermission('35')")
-    @GetMapping("/api/ai/zn/getProgressOfIntelligentClipTask")
-    public Result getProgressOfIntelligentClipTask(@NotEmpty(message = "任务ID 不能为空") String id) throws IOException {
-        return Result.success(aiznImageTaskService.getProgressOfTask(id, 3));
-    }
-
-    /**
-     * [紫鸟] AI模特 - 交互抠图 (直接返回结果)
-     */
-    @PreAuthorize("@sr.hasPermission('35')")
-    @PostMapping("/api/ai/zn/makeInteractClipTask")
-    public Result makeInteractClipTask(@Validated @RequestBody AiznInteractClipTaskDTO aiznInteractClipTaskDTO) {
-        return Result.success(aiznModelService.makeInteractClipTask(aiznInteractClipTaskDTO));
-    }
-
-
-
-    /**
-     * [紫鸟] AI换模特 (发起任务)
-     */
-    @PreAuthorize("@sr.hasPermission('35')")
-    @PostMapping("/api/ai/zn/makeModelTask")
-    public Result makeModelTask(@Validated @RequestBody AiznModelTaskDTO aiznModelTaskDTO) {
-        return Result.success(aiznModelService.makeModelTask(aiznModelTaskDTO));
-    }
-
-    /**
-     * [紫鸟] AI换模特 (查询任务)
-     */
-    @PreAuthorize("@sr.hasPermission('35')")
-    @GetMapping("/api/ai/zn/getProgressOfModelTask")
-    public Result getProgressOfModelTask(
-            @RequestParam(value = "id", required = false) String id,
-            @RequestParam(value = "ids", required = false) String ids
-    ) throws IOException {
-        if (ids != null) {
-            if (id != null) throw new CustException("id 与 ids 不能同时存在");
-            return Result.success(aiznImageTaskService.getProgressOfTaskArray(ids, 9));
-        } else {
-            if (id == null) throw new CustException("id 与 ids 至少一项不能为空");
-            return Result.success(aiznImageTaskService.getProgressOfTask(id, 9));
-        }
-    }
-
-
-
-}
+//package com.backendsys.controller.Ai;
+//
+//import com.backendsys.entity.Ai.Aizn.AiznImageStyleDTO;
+//import com.backendsys.entity.Ai.Aizn.AiznIntelligentClipTaskDTO;
+//import com.backendsys.entity.Ai.Aizn.AiznInteractClipTask.AiznInteractClipTaskDTO;
+//import com.backendsys.entity.Ai.Aizn.AiznModel.AiznModelTaskDTO;
+//import com.backendsys.entity.System.SysResourcePointsDTO;
+//import com.backendsys.exception.CustException;
+//import com.backendsys.mapper.System.SysResourcePointsMapper;
+//import com.backendsys.service.Ai.Aizn.AiznImageTaskService;
+//import com.backendsys.service.Ai.Aizn.AiznModelService;
+//import com.backendsys.service.SDKService.SDKTencent.SDKTencentCOSService;
+//import com.backendsys.utils.response.Result;
+//import jakarta.validation.constraints.NotEmpty;
+//import org.springframework.beans.factory.annotation.Autowired;
+//import org.springframework.security.access.prepost.PreAuthorize;
+//import org.springframework.validation.annotation.Validated;
+//import org.springframework.web.bind.annotation.*;
+//
+//import java.io.IOException;
+//
+//@Validated
+//@RestController
+//public class AiznModelController {
+//
+//    @Autowired
+//    private SysResourcePointsMapper sysResourcePointsMapper;
+//
+//    @Autowired
+//    private AiznModelService aiznModelService;
+//
+//    @Autowired
+//    private AiznImageTaskService aiznImageTaskService;
+//
+//    @Autowired
+//    private SDKTencentCOSService sdkTencentCOSService;
+//
+//    /**
+//     * [紫鸟] AI模特 - 获得风格/场景配置数据
+//     */
+//    @PreAuthorize("@sr.hasPermission('35')")
+//    @GetMapping("/api/ai/zn/getImageStyle")
+//    public Result getImageStyle(AiznImageStyleDTO aiznImageStyleDTO) {
+//        return Result.success(aiznModelService.getImageStyle(aiznImageStyleDTO));
+//    }
+//
+//    /**
+//     * [紫鸟] AI模特 - 获得积分单价 (AI模特)
+//     */
+//    @PreAuthorize("@sr.hasPermission('35')")
+//    @GetMapping("/api/ai/zn/getResourceOfZnModel")
+//    public Result getImageStyle() {
+//        SysResourcePointsDTO sysResourcePointsDTO = new SysResourcePointsDTO();
+//        sysResourcePointsDTO.setResource_type("ZnModel");
+//        return Result.success(sysResourcePointsMapper.queryResourcePointsList(sysResourcePointsDTO));
+//    }
+//
+//
+//    /**
+//     * [紫鸟] AI模特 - 智能抠图 (发起任务)
+//     */
+//    @PreAuthorize("@sr.hasPermission('35')")
+//    @PostMapping("/api/ai/zn/makeIntelligentClipTask")
+//    public Result makeIntelligentClipTask(@Validated @RequestBody AiznIntelligentClipTaskDTO aiznIntelligentClipTaskDTO) {
+//        return Result.success(aiznModelService.makeIntelligentClipTask(aiznIntelligentClipTaskDTO));
+//    }
+//
+//    /**
+//     * [紫鸟] AI模特 - 智能抠图 (查询任务)
+//     */
+//    @PreAuthorize("@sr.hasPermission('35')")
+//    @GetMapping("/api/ai/zn/getProgressOfIntelligentClipTask")
+//    public Result getProgressOfIntelligentClipTask(@NotEmpty(message = "任务ID 不能为空") String id) throws IOException {
+//        return Result.success(aiznImageTaskService.getProgressOfTask(id, 3));
+//    }
+//
+//    /**
+//     * [紫鸟] AI模特 - 交互抠图 (直接返回结果)
+//     */
+//    @PreAuthorize("@sr.hasPermission('35')")
+//    @PostMapping("/api/ai/zn/makeInteractClipTask")
+//    public Result makeInteractClipTask(@Validated @RequestBody AiznInteractClipTaskDTO aiznInteractClipTaskDTO) {
+//        return Result.success(aiznModelService.makeInteractClipTask(aiznInteractClipTaskDTO));
+//    }
+//
+//
+//
+//    /**
+//     * [紫鸟] AI换模特 (发起任务)
+//     */
+//    @PreAuthorize("@sr.hasPermission('35')")
+//    @PostMapping("/api/ai/zn/makeModelTask")
+//    public Result makeModelTask(@Validated @RequestBody AiznModelTaskDTO aiznModelTaskDTO) {
+//        return Result.success(aiznModelService.makeModelTask(aiznModelTaskDTO));
+//    }
+//
+//    /**
+//     * [紫鸟] AI换模特 (查询任务)
+//     */
+//    @PreAuthorize("@sr.hasPermission('35')")
+//    @GetMapping("/api/ai/zn/getProgressOfModelTask")
+//    public Result getProgressOfModelTask(
+//            @RequestParam(value = "id", required = false) String id,
+//            @RequestParam(value = "ids", required = false) String ids
+//    ) throws IOException {
+//        if (ids != null) {
+//            if (id != null) throw new CustException("id 与 ids 不能同时存在");
+//            return Result.success(aiznImageTaskService.getProgressOfTaskArray(ids, 9));
+//        } else {
+//            if (id == null) throw new CustException("id 与 ids 至少一项不能为空");
+//            return Result.success(aiznImageTaskService.getProgressOfTask(id, 9));
+//        }
+//    }
+//
+//
+//
+//}

+ 18 - 18
src/main/java/com/backendsys/mapper/Ai/Aizn/AiznImageIncantationMapper.java

@@ -1,18 +1,18 @@
-package com.backendsys.mapper.Ai.Aizn;
-
-import com.backendsys.entity.Ai.Aizn.AiznImageIncantationDTO;
-import org.apache.ibatis.annotations.Mapper;
-
-import java.util.List;
-import java.util.Map;
-
-@Mapper
-public interface AiznImageIncantationMapper {
-
-    // 咒语
-    List<Map<String, Object>> queryAiznImageIncantation(AiznImageIncantationDTO aiznImageIncantationDTO);
-
-    // 示例
-    List<Map<String, Object>> queryAiznImageIncantationDescription();
-
-}
+//package com.backendsys.mapper.Ai.Aizn;
+//
+//import com.backendsys.entity.Ai.Aizn.AiznImageIncantationDTO;
+//import org.apache.ibatis.annotations.Mapper;
+//
+//import java.util.List;
+//import java.util.Map;
+//
+//@Mapper
+//public interface AiznImageIncantationMapper {
+//
+//    // 咒语
+//    List<Map<String, Object>> queryAiznImageIncantation(AiznImageIncantationDTO aiznImageIncantationDTO);
+//
+//    // 示例
+//    List<Map<String, Object>> queryAiznImageIncantationDescription();
+//
+//}

+ 37 - 37
src/main/java/com/backendsys/mapper/Ai/Aizn/AiznImageIncantationMapper.xml

@@ -1,41 +1,41 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
-<mapper namespace="com.backendsys.mapper.Ai.Aizn.AiznImageIncantationMapper">
+<!--<?xml version="1.0" encoding="utf-8" ?>-->
+<!--<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >-->
+<!--<mapper namespace="com.backendsys.mapper.Ai.Aizn.AiznImageIncantationMapper">-->
 
-    <!-- 咒语 -->
-    <sql id="includeAiznImageIncantationList">
-        id,
-        category_id,
-        category_name,
-        name
-    </sql>
-    <resultMap id="resultMapAiznImageIncantationList" type="java.util.LinkedHashMap">
-        <id property="id" column="id" jdbcType="BIGINT" />
-        <result property="category_id" column="category_id" javaType="java.lang.Integer"/>
-        <result property="category_name" column="category_name" />
-        <result property="name" column="name" />
-    </resultMap>
-    <select id="queryAiznImageIncantation" resultMap="resultMapAiznImageIncantationList">
-        SELECT <include refid="includeAiznImageIncantationList" />
-        FROM ai_zn_image_incantation
-        <where>
-            <if test="category_id != null and category_id != ''">
-                AND category_id = #{category_id}
-            </if>
-            <if test="name != null and name != ''">
-                AND name = #{name}
-            </if>
-        </where>
-    </select>
+<!--    &lt;!&ndash; 咒语 &ndash;&gt;-->
+<!--    <sql id="includeAiznImageIncantationList">-->
+<!--        id,-->
+<!--        category_id,-->
+<!--        category_name,-->
+<!--        name-->
+<!--    </sql>-->
+<!--    <resultMap id="resultMapAiznImageIncantationList" type="java.util.LinkedHashMap">-->
+<!--        <id property="id" column="id" jdbcType="BIGINT" />-->
+<!--        <result property="category_id" column="category_id" javaType="java.lang.Integer"/>-->
+<!--        <result property="category_name" column="category_name" />-->
+<!--        <result property="name" column="name" />-->
+<!--    </resultMap>-->
+<!--    <select id="queryAiznImageIncantation" resultMap="resultMapAiznImageIncantationList">-->
+<!--        SELECT <include refid="includeAiznImageIncantationList" />-->
+<!--        FROM ai_zn_image_incantation-->
+<!--        <where>-->
+<!--            <if test="category_id != null and category_id != ''">-->
+<!--                AND category_id = #{category_id}-->
+<!--            </if>-->
+<!--            <if test="name != null and name != ''">-->
+<!--                AND name = #{name}-->
+<!--            </if>-->
+<!--        </where>-->
+<!--    </select>-->
 
-    <!-- 示例 -->
-    <resultMap id="resultMapAiznImageIncantationDescription" type="java.util.LinkedHashMap">
-        <id property="id" column="id" jdbcType="BIGINT" />
-        <result property="scene_description" column="scene_description" />
-    </resultMap>
-    <select id="queryAiznImageIncantationDescription" resultMap="resultMapAiznImageIncantationDescription">
-        SELECT id, scene_description FROM ai_zn_image_incantation_description
-    </select>
+<!--    &lt;!&ndash; 示例 &ndash;&gt;-->
+<!--    <resultMap id="resultMapAiznImageIncantationDescription" type="java.util.LinkedHashMap">-->
+<!--        <id property="id" column="id" jdbcType="BIGINT" />-->
+<!--        <result property="scene_description" column="scene_description" />-->
+<!--    </resultMap>-->
+<!--    <select id="queryAiznImageIncantationDescription" resultMap="resultMapAiznImageIncantationDescription">-->
+<!--        SELECT id, scene_description FROM ai_zn_image_incantation_description-->
+<!--    </select>-->
 
 
-</mapper>
+<!--</mapper>-->

+ 18 - 18
src/main/java/com/backendsys/mapper/Ai/Aizn/AiznImageTaskMapper.java

@@ -1,18 +1,18 @@
-package com.backendsys.mapper.Ai.Aizn;
-
-import com.backendsys.entity.Ai.Aizn.AiznImageTaskVO;
-import org.apache.ibatis.annotations.Mapper;
-
-import java.util.List;
-import java.util.Map;
-
-@Mapper
-public interface AiznImageTaskMapper {
-
-    List<Map<String, Object>> queryAiznImageTask(AiznImageTaskVO aiznImageTaskVO);
-    Map<String, Object> queryAiznImageTaskDetail(AiznImageTaskVO aiznImageTaskVO);
-
-    long insertAiznImageTask(AiznImageTaskVO aiznImageTaskVO);
-    long updateAiznImageTask(AiznImageTaskVO aiznImageTaskVO);
-
-}
+//package com.backendsys.mapper.Ai.Aizn;
+//
+//import com.backendsys.entity.Ai.Aizn.AiznImageTaskVO;
+//import org.apache.ibatis.annotations.Mapper;
+//
+//import java.util.List;
+//import java.util.Map;
+//
+//@Mapper
+//public interface AiznImageTaskMapper {
+//
+//    List<Map<String, Object>> queryAiznImageTask(AiznImageTaskVO aiznImageTaskVO);
+//    Map<String, Object> queryAiznImageTaskDetail(AiznImageTaskVO aiznImageTaskVO);
+//
+//    long insertAiznImageTask(AiznImageTaskVO aiznImageTaskVO);
+//    long updateAiznImageTask(AiznImageTaskVO aiznImageTaskVO);
+//
+//}

+ 81 - 81
src/main/java/com/backendsys/mapper/Ai/Aizn/AiznImageTaskMapper.xml

@@ -1,87 +1,87 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
-<mapper namespace="com.backendsys.mapper.Ai.Aizn.AiznImageTaskMapper">
+<!--<?xml version="1.0" encoding="utf-8" ?>-->
+<!--<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >-->
+<!--<mapper namespace="com.backendsys.mapper.Ai.Aizn.AiznImageTaskMapper">-->
 
-    <sql id="includeAiznImageTask">
-        id,
-        user_id,
-        COALESCE(task_type, '') task_type,
-        task_id,
-        image_url,
-        COALESCE(result_image_url, '') result_image_url,
-        task_submit_json,
-        COALESCE(task_result_json, '') task_result_json,
-        status,
-        create_time,
-        update_time
-    </sql>
-    <resultMap id="resultMapAiznImageTask" type="java.util.LinkedHashMap">
-        <id property="id" column="id" jdbcType="BIGINT" />
-        <result property="user_id" column="user_id" javaType="java.lang.Long"/>
-        <result property="task_type" column="task_type" />
-        <result property="task_id" column="task_id" />
-        <result property="image_url" column="image_url" />
-        <result property="result_image_url" column="result_image_url" />
-        <result property="task_submit_json" column="task_submit_json" />
-        <result property="task_result_json" column="task_result_json" />
-        <result property="status" column="status" />
-        <result property="create_time" column="create_time" />
-        <result property="update_time" column="update_time" />
-    </resultMap>
+<!--    <sql id="includeAiznImageTask">-->
+<!--        id,-->
+<!--        user_id,-->
+<!--        COALESCE(task_type, '') task_type,-->
+<!--        task_id,-->
+<!--        image_url,-->
+<!--        COALESCE(result_image_url, '') result_image_url,-->
+<!--        task_submit_json,-->
+<!--        COALESCE(task_result_json, '') task_result_json,-->
+<!--        status,-->
+<!--        create_time,-->
+<!--        update_time-->
+<!--    </sql>-->
+<!--    <resultMap id="resultMapAiznImageTask" type="java.util.LinkedHashMap">-->
+<!--        <id property="id" column="id" jdbcType="BIGINT" />-->
+<!--        <result property="user_id" column="user_id" javaType="java.lang.Long"/>-->
+<!--        <result property="task_type" column="task_type" />-->
+<!--        <result property="task_id" column="task_id" />-->
+<!--        <result property="image_url" column="image_url" />-->
+<!--        <result property="result_image_url" column="result_image_url" />-->
+<!--        <result property="task_submit_json" column="task_submit_json" />-->
+<!--        <result property="task_result_json" column="task_result_json" />-->
+<!--        <result property="status" column="status" />-->
+<!--        <result property="create_time" column="create_time" />-->
+<!--        <result property="update_time" column="update_time" />-->
+<!--    </resultMap>-->
 
-    <select id="queryAiznImageTask" resultMap="resultMapAiznImageTask">
-        SELECT <include refid="includeAiznImageTask" />
-        FROM ai_zn_image_task
-        <where>
-            <if test="task_type != null and task_type != ''">
-                AND task_type = #{task_type}
-            </if>
-            <if test="task_id != null and task_id != ''">
-                AND task_id = #{task_id}
-            </if>
-            <if test="status != null and status != ''">
-                AND status = #{status}
-            </if>
-            <if test="user_id != null and user_id != ''">
-                AND user_id = #{user_id}
-            </if>
-            <if test="create_time_begin != null and create_time_begin != '' and create_time_end != null and create_time_end != ''">
-                AND create_time BETWEEN #{create_time_begin} AND #{create_time_end}
-            </if>
-        </where>
-        ORDER BY create_time DESC
-    </select>
+<!--    <select id="queryAiznImageTask" resultMap="resultMapAiznImageTask">-->
+<!--        SELECT <include refid="includeAiznImageTask" />-->
+<!--        FROM ai_zn_image_task-->
+<!--        <where>-->
+<!--            <if test="task_type != null and task_type != ''">-->
+<!--                AND task_type = #{task_type}-->
+<!--            </if>-->
+<!--            <if test="task_id != null and task_id != ''">-->
+<!--                AND task_id = #{task_id}-->
+<!--            </if>-->
+<!--            <if test="status != null and status != ''">-->
+<!--                AND status = #{status}-->
+<!--            </if>-->
+<!--            <if test="user_id != null and user_id != ''">-->
+<!--                AND user_id = #{user_id}-->
+<!--            </if>-->
+<!--            <if test="create_time_begin != null and create_time_begin != '' and create_time_end != null and create_time_end != ''">-->
+<!--                AND create_time BETWEEN #{create_time_begin} AND #{create_time_end}-->
+<!--            </if>-->
+<!--        </where>-->
+<!--        ORDER BY create_time DESC-->
+<!--    </select>-->
 
-    <select id="queryAiznImageTaskDetail" resultMap="resultMapAiznImageTask">
-        SELECT <include refid="includeAiznImageTask" />
-        FROM ai_zn_image_task
-        <where>
-            task_id = #{task_id}
-            <if test="user_id != null and user_id != ''">
-                AND user_id = #{user_id}
-            </if>
-        </where>
-    </select>
+<!--    <select id="queryAiznImageTaskDetail" resultMap="resultMapAiznImageTask">-->
+<!--        SELECT <include refid="includeAiznImageTask" />-->
+<!--        FROM ai_zn_image_task-->
+<!--        <where>-->
+<!--            task_id = #{task_id}-->
+<!--            <if test="user_id != null and user_id != ''">-->
+<!--                AND user_id = #{user_id}-->
+<!--            </if>-->
+<!--        </where>-->
+<!--    </select>-->
 
-    <insert id="insertAiznImageTask" parameterType="com.backendsys.entity.Ai.Aizn.AiznImageTaskVO"
-        useGeneratedKeys="true" keyProperty="task_id">
-        INSERT INTO ai_zn_image_task (
-             user_id, task_id, image_url, task_submit_json
-            <if test="task_type != null and task_type != ''">, task_type</if>
-        )
-        VALUES (
-            #{user_id}, #{task_id}, #{image_url}, #{task_submit_json}
-            <if test="task_type != null and task_type != ''">, #{task_type}</if>
-        )
-    </insert>
+<!--    <insert id="insertAiznImageTask" parameterType="com.backendsys.entity.Ai.Aizn.AiznImageTaskVO"-->
+<!--        useGeneratedKeys="true" keyProperty="task_id">-->
+<!--        INSERT INTO ai_zn_image_task (-->
+<!--             user_id, task_id, image_url, task_submit_json-->
+<!--            <if test="task_type != null and task_type != ''">, task_type</if>-->
+<!--        )-->
+<!--        VALUES (-->
+<!--            #{user_id}, #{task_id}, #{image_url}, #{task_submit_json}-->
+<!--            <if test="task_type != null and task_type != ''">, #{task_type}</if>-->
+<!--        )-->
+<!--    </insert>-->
 
-    <update id="updateAiznImageTask" parameterType="com.backendsys.entity.Ai.Aizn.AiznImageTaskVO"
-        useGeneratedKeys="true" keyProperty="task_id">
-        UPDATE ai_zn_image_task
-        SET status = #{status}
-            <if test="result_image_url != null and result_image_url != ''">, result_image_url = #{result_image_url}</if>
-            <if test="task_result_json != null and task_result_json != ''">, task_result_json = #{task_result_json}</if>
-        WHERE task_id = #{task_id}
-    </update>
+<!--    <update id="updateAiznImageTask" parameterType="com.backendsys.entity.Ai.Aizn.AiznImageTaskVO"-->
+<!--        useGeneratedKeys="true" keyProperty="task_id">-->
+<!--        UPDATE ai_zn_image_task-->
+<!--        SET status = #{status}-->
+<!--            <if test="result_image_url != null and result_image_url != ''">, result_image_url = #{result_image_url}</if>-->
+<!--            <if test="task_result_json != null and task_result_json != ''">, task_result_json = #{task_result_json}</if>-->
+<!--        WHERE task_id = #{task_id}-->
+<!--    </update>-->
 
-</mapper>
+<!--</mapper>-->

+ 19 - 19
src/main/java/com/backendsys/service/Ai/Aizn/AiznGoodService.java

@@ -1,19 +1,19 @@
-package com.backendsys.service.Ai.Aizn;
-
-import com.backendsys.entity.Ai.Aizn.AiznGood.AiznGoodCompoundTask.AiznGoodCompoundTaskDTO;
-import com.backendsys.entity.Ai.Aizn.AiznGood.AiznGoodReplaceTask.AiznGoodReplaceTaskDTO;
-
-import java.util.Map;
-
-/**
- * AI商品合成 / 商品替换
- */
-public interface AiznGoodService {
-
-    // [紫鸟] 商品合成 (发起任务)
-    Map<String, Object> makeGoodCompoundTask(AiznGoodCompoundTaskDTO aiznGoodCompoundTaskDTO);
-
-    // [紫鸟] 商品替换 (发起任务)
-    Map<String, Object> makeGoodReplaceTask(AiznGoodReplaceTaskDTO aiznGoodReplaceTaskDTO);
-
-}
+//package com.backendsys.service.Ai.Aizn;
+//
+//import com.backendsys.entity.Ai.Aizn.AiznGood.AiznGoodCompoundTask.AiznGoodCompoundTaskDTO;
+//import com.backendsys.entity.Ai.Aizn.AiznGood.AiznGoodReplaceTask.AiznGoodReplaceTaskDTO;
+//
+//import java.util.Map;
+//
+///**
+// * AI商品合成 / 商品替换
+// */
+//public interface AiznGoodService {
+//
+//    // [紫鸟] 商品合成 (发起任务)
+//    Map<String, Object> makeGoodCompoundTask(AiznGoodCompoundTaskDTO aiznGoodCompoundTaskDTO);
+//
+//    // [紫鸟] 商品替换 (发起任务)
+//    Map<String, Object> makeGoodReplaceTask(AiznGoodReplaceTaskDTO aiznGoodReplaceTaskDTO);
+//
+//}

+ 175 - 175
src/main/java/com/backendsys/service/Ai/Aizn/AiznGoodServiceImpl.java

@@ -1,175 +1,175 @@
-package com.backendsys.service.Ai.Aizn;
-
-import cn.hutool.core.convert.Convert;
-import cn.hutool.json.JSONObject;
-import cn.hutool.json.JSONUtil;
-import com.backendsys.aspect.HttpRequestAspect;
-import com.backendsys.entity.Ai.Aizn.AiznGood.AiznGoodCompoundTask.AiznGoodCompoundTaskDTO;
-import com.backendsys.entity.Ai.Aizn.AiznGood.AiznGoodReplaceTask.AiznGoodReplaceTaskDTO;
-import com.backendsys.entity.Ai.Aizn.AiznImageTaskVO;
-import com.backendsys.exception.CustException;
-import com.backendsys.mapper.Ai.Aizn.AiznImageTaskMapper;
-import com.backendsys.service.System.SysResourceService;
-import com.backendsys.utils.MapUtil;
-import com.fzzixun.openapi.sdk.client.OpenClient;
-import com.fzzixun.openapi.sdk.common.RequestMethod;
-import com.fzzixun.openapi.sdk.request.CommonRequest;
-import com.fzzixun.openapi.sdk.response.CommonResponse;
-import org.redisson.api.RLock;
-import org.redisson.api.RedissonClient;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.Lazy;
-import org.springframework.stereotype.Service;
-
-import java.util.LinkedHashMap;
-import java.util.Map;
-import java.util.concurrent.TimeUnit;
-
-@Service
-public class AiznGoodServiceImpl implements AiznGoodService {
-
-    @Lazy
-    @Autowired
-    RedissonClient redissonClient;
-
-    @Autowired
-    private HttpRequestAspect httpRequestAspect;
-
-    @Autowired
-    private AiznService aiznService;
-
-    @Autowired
-    private AiznImageTaskMapper aiznImageTaskMapper;
-
-    @Autowired
-    private SysResourceService sysResourceService;
-
-    /**
-     * [紫鸟] 商品合成 (发起任务)
-     */
-    @Override
-    public Map<String, Object> makeGoodCompoundTask(AiznGoodCompoundTaskDTO aiznGoodCompoundTaskDTO) {
-        RLock lock = redissonClient.getLock("makeGoodCompoundTask");
-        try { lock.tryLock(3, TimeUnit.SECONDS);
-
-            // -- 业务参数 -------------------------------------------------------------------
-            JSONObject object = new JSONObject();
-            object.set("imageUrl", aiznGoodCompoundTaskDTO.getImage_url());
-//            object.set("style", aiznGoodCompoundTaskDTO.getStyle());
-//            object.set("subType", aiznGoodCompoundTaskDTO.getSub_type());
-            object.set("ratio", aiznGoodCompoundTaskDTO.getRatio());
-            object.set("outputNum", aiznGoodCompoundTaskDTO.getOutput_num());
-
-            Map<String, Object> extendFields = new LinkedHashMap<>();
-            extendFields.put("imageSegUrl", aiznGoodCompoundTaskDTO.getExtend_fields().getImage_seg_url());
-            extendFields.put("keepSegStruct", aiznGoodCompoundTaskDTO.getExtend_fields().getKeep_seg_struct());
-            extendFields.put("segChangeWeight", aiznGoodCompoundTaskDTO.getExtend_fields().getSeg_change_weight());
-            extendFields.put("originalImages", aiznGoodCompoundTaskDTO.getExtend_fields().getOriginal_images());
-
-            object.set("extendFields", extendFields);
-
-            System.out.println("Params:");
-            System.out.println(object.toString());
-
-            // -- 实现方法 -------------------------------------------------------------------
-            OpenClient client = aiznService.getOpenClient();
-            CommonRequest request = new CommonRequest("/linkfox-ai/image/v1/make/create/11", RequestMethod.POST_JSON);
-            request.setBizContent(object.toString());
-
-            // -- 返回结果 -------------------------------------------------------------------
-            CommonResponse response = client.executeAppToken(request, aiznService.getAppToken());
-            JSONObject resp = aiznService.checkResponse(response);
-            if ((Integer) resp.get("code") == 200) {
-
-                // -- 成功 ------------------------------------------------------------------
-//                Map<String, Object> respData = (Map<String, Object>) resp.get("data");
-                Map<String, Object> respData = Convert.toMap(String.class, Object.class, resp.get("data"));
-                System.out.println(respData);
-
-                // -- 将制作结果插入到数据表 -----------------------------------------------------
-                AiznImageTaskVO vo = new AiznImageTaskVO();
-                vo.setTask_id((String) respData.get("id"));
-                vo.setUser_id(httpRequestAspect.getUserId());
-                vo.setTask_type("GOOD_COMPOUND");
-                vo.setImage_url((String) respData.get("imageUrl"));
-                vo.setTask_submit_json(JSONUtil.toJsonStr(respData));
-                aiznImageTaskMapper.insertAiznImageTask(vo);
-                // --------------------------------------------------------------------------
-
-                // -- 扣除对应的本地积分 (ZnGood, GoodCompound, 商品合成) ------------------------
-                sysResourceService.consumptionPoint("ZnGood", "GoodCompound", null);
-
-                return MapUtil.convertToUnderscoreCase(respData);
-
-            } else {
-                System.out.println(resp);
-                throw new CustException((String) resp.get("msg"));
-            }
-
-        } catch (InterruptedException e) { throw new RuntimeException(e);
-        } finally { lock.unlock(); }
-    }
-
-    /**
-     * [紫鸟] 商品替换 (发起任务)
-     */
-    @Override
-    public Map<String, Object> makeGoodReplaceTask(AiznGoodReplaceTaskDTO aiznGoodReplaceTaskDTO) {
-        RLock lock = redissonClient.getLock("makeGoodCompoundTask");
-        try { lock.tryLock(3, TimeUnit.SECONDS);
-
-            // -- 业务参数 -------------------------------------------------------------------
-            JSONObject object = new JSONObject();
-            object.set("imageUrl", aiznGoodReplaceTaskDTO.getImage_url());
-            object.set("outputNum", aiznGoodReplaceTaskDTO.getOutput_num());
-
-            Map<String, Object> extendFields = new LinkedHashMap<>();
-            extendFields.put("denoiseStrength", aiznGoodReplaceTaskDTO.getExtend_fields().getDenoise_strength());
-            extendFields.put("sourceImageUrl", aiznGoodReplaceTaskDTO.getExtend_fields().getSource_image_url());
-            extendFields.put("targetImageUrl", aiznGoodReplaceTaskDTO.getExtend_fields().getTarget_image_url());
-
-            object.set("extendFields", extendFields);
-
-            System.out.println("Params:");
-            System.out.println(object.toString());
-
-            // -- 实现方法 -------------------------------------------------------------------
-            OpenClient client = aiznService.getOpenClient();
-            CommonRequest request = new CommonRequest("/linkfox-ai/image/v1/make/create/12", RequestMethod.POST_JSON);
-            request.setBizContent(object.toString());
-
-            // -- 返回结果 -------------------------------------------------------------------
-            CommonResponse response = client.executeAppToken(request, aiznService.getAppToken());
-            JSONObject resp = aiznService.checkResponse(response);
-            if ((Integer) resp.get("code") == 200) {
-
-                // -- 成功 ------------------------------------------------------------------
-//                Map<String, Object> respData = (Map<String, Object>) resp.get("data");
-                Map<String, Object> respData = Convert.toMap(String.class, Object.class, resp.get("data"));
-                System.out.println(respData);
-
-                // -- 将制作结果插入到数据表 -----------------------------------------------------
-                AiznImageTaskVO vo = new AiznImageTaskVO();
-                vo.setTask_id((String) respData.get("id"));
-                vo.setUser_id(httpRequestAspect.getUserId());
-                vo.setTask_type("GOOD_REPLACE");
-                vo.setImage_url((String) respData.get("imageUrl"));
-                vo.setTask_submit_json(JSONUtil.toJsonStr(respData));
-                aiznImageTaskMapper.insertAiznImageTask(vo);
-                // --------------------------------------------------------------------------
-
-                // -- 扣除对应的本地积分 (ZnGood, GoodCompound, 商品合成) ------------------------
-                sysResourceService.consumptionPoint("ZnGood", "GoodReplace", null);
-
-                return MapUtil.convertToUnderscoreCase(respData);
-
-            } else {
-                System.out.println(resp);
-                throw new CustException((String) resp.get("msg"));
-            }
-
-        } catch (InterruptedException e) { throw new RuntimeException(e);
-        } finally { lock.unlock(); }
-    }
-
-}
+//package com.backendsys.service.Ai.Aizn;
+//
+//import cn.hutool.core.convert.Convert;
+//import cn.hutool.json.JSONObject;
+//import cn.hutool.json.JSONUtil;
+//import com.backendsys.aspect.HttpRequestAspect;
+//import com.backendsys.entity.Ai.Aizn.AiznGood.AiznGoodCompoundTask.AiznGoodCompoundTaskDTO;
+//import com.backendsys.entity.Ai.Aizn.AiznGood.AiznGoodReplaceTask.AiznGoodReplaceTaskDTO;
+//import com.backendsys.entity.Ai.Aizn.AiznImageTaskVO;
+//import com.backendsys.exception.CustException;
+//import com.backendsys.mapper.Ai.Aizn.AiznImageTaskMapper;
+//import com.backendsys.service.System.SysResourceService;
+//import com.backendsys.utils.MapUtil;
+//import com.fzzixun.openapi.sdk.client.OpenClient;
+//import com.fzzixun.openapi.sdk.common.RequestMethod;
+//import com.fzzixun.openapi.sdk.request.CommonRequest;
+//import com.fzzixun.openapi.sdk.response.CommonResponse;
+//import org.redisson.api.RLock;
+//import org.redisson.api.RedissonClient;
+//import org.springframework.beans.factory.annotation.Autowired;
+//import org.springframework.context.annotation.Lazy;
+//import org.springframework.stereotype.Service;
+//
+//import java.util.LinkedHashMap;
+//import java.util.Map;
+//import java.util.concurrent.TimeUnit;
+//
+//@Service
+//public class AiznGoodServiceImpl implements AiznGoodService {
+//
+//    @Lazy
+//    @Autowired
+//    RedissonClient redissonClient;
+//
+//    @Autowired
+//    private HttpRequestAspect httpRequestAspect;
+//
+//    @Autowired
+//    private AiznService aiznService;
+//
+//    @Autowired
+//    private AiznImageTaskMapper aiznImageTaskMapper;
+//
+//    @Autowired
+//    private SysResourceService sysResourceService;
+//
+//    /**
+//     * [紫鸟] 商品合成 (发起任务)
+//     */
+//    @Override
+//    public Map<String, Object> makeGoodCompoundTask(AiznGoodCompoundTaskDTO aiznGoodCompoundTaskDTO) {
+//        RLock lock = redissonClient.getLock("makeGoodCompoundTask");
+//        try { lock.tryLock(3, TimeUnit.SECONDS);
+//
+//            // -- 业务参数 -------------------------------------------------------------------
+//            JSONObject object = new JSONObject();
+//            object.set("imageUrl", aiznGoodCompoundTaskDTO.getImage_url());
+////            object.set("style", aiznGoodCompoundTaskDTO.getStyle());
+////            object.set("subType", aiznGoodCompoundTaskDTO.getSub_type());
+//            object.set("ratio", aiznGoodCompoundTaskDTO.getRatio());
+//            object.set("outputNum", aiznGoodCompoundTaskDTO.getOutput_num());
+//
+//            Map<String, Object> extendFields = new LinkedHashMap<>();
+//            extendFields.put("imageSegUrl", aiznGoodCompoundTaskDTO.getExtend_fields().getImage_seg_url());
+//            extendFields.put("keepSegStruct", aiznGoodCompoundTaskDTO.getExtend_fields().getKeep_seg_struct());
+//            extendFields.put("segChangeWeight", aiznGoodCompoundTaskDTO.getExtend_fields().getSeg_change_weight());
+//            extendFields.put("originalImages", aiznGoodCompoundTaskDTO.getExtend_fields().getOriginal_images());
+//
+//            object.set("extendFields", extendFields);
+//
+//            System.out.println("Params:");
+//            System.out.println(object.toString());
+//
+//            // -- 实现方法 -------------------------------------------------------------------
+//            OpenClient client = aiznService.getOpenClient();
+//            CommonRequest request = new CommonRequest("/linkfox-ai/image/v1/make/create/11", RequestMethod.POST_JSON);
+//            request.setBizContent(object.toString());
+//
+//            // -- 返回结果 -------------------------------------------------------------------
+//            CommonResponse response = client.executeAppToken(request, aiznService.getAppToken());
+//            JSONObject resp = aiznService.checkResponse(response);
+//            if ((Integer) resp.get("code") == 200) {
+//
+//                // -- 成功 ------------------------------------------------------------------
+////                Map<String, Object> respData = (Map<String, Object>) resp.get("data");
+//                Map<String, Object> respData = Convert.toMap(String.class, Object.class, resp.get("data"));
+//                System.out.println(respData);
+//
+//                // -- 将制作结果插入到数据表 -----------------------------------------------------
+//                AiznImageTaskVO vo = new AiznImageTaskVO();
+//                vo.setTask_id((String) respData.get("id"));
+//                vo.setUser_id(httpRequestAspect.getUserId());
+//                vo.setTask_type("GOOD_COMPOUND");
+//                vo.setImage_url((String) respData.get("imageUrl"));
+//                vo.setTask_submit_json(JSONUtil.toJsonStr(respData));
+//                aiznImageTaskMapper.insertAiznImageTask(vo);
+//                // --------------------------------------------------------------------------
+//
+//                // -- 扣除对应的本地积分 (ZnGood, GoodCompound, 商品合成) ------------------------
+//                sysResourceService.consumptionPoint("ZnGood", "GoodCompound", null);
+//
+//                return MapUtil.convertToUnderscoreCase(respData);
+//
+//            } else {
+//                System.out.println(resp);
+//                throw new CustException((String) resp.get("msg"));
+//            }
+//
+//        } catch (InterruptedException e) { throw new RuntimeException(e);
+//        } finally { lock.unlock(); }
+//    }
+//
+//    /**
+//     * [紫鸟] 商品替换 (发起任务)
+//     */
+//    @Override
+//    public Map<String, Object> makeGoodReplaceTask(AiznGoodReplaceTaskDTO aiznGoodReplaceTaskDTO) {
+//        RLock lock = redissonClient.getLock("makeGoodCompoundTask");
+//        try { lock.tryLock(3, TimeUnit.SECONDS);
+//
+//            // -- 业务参数 -------------------------------------------------------------------
+//            JSONObject object = new JSONObject();
+//            object.set("imageUrl", aiznGoodReplaceTaskDTO.getImage_url());
+//            object.set("outputNum", aiznGoodReplaceTaskDTO.getOutput_num());
+//
+//            Map<String, Object> extendFields = new LinkedHashMap<>();
+//            extendFields.put("denoiseStrength", aiznGoodReplaceTaskDTO.getExtend_fields().getDenoise_strength());
+//            extendFields.put("sourceImageUrl", aiznGoodReplaceTaskDTO.getExtend_fields().getSource_image_url());
+//            extendFields.put("targetImageUrl", aiznGoodReplaceTaskDTO.getExtend_fields().getTarget_image_url());
+//
+//            object.set("extendFields", extendFields);
+//
+//            System.out.println("Params:");
+//            System.out.println(object.toString());
+//
+//            // -- 实现方法 -------------------------------------------------------------------
+//            OpenClient client = aiznService.getOpenClient();
+//            CommonRequest request = new CommonRequest("/linkfox-ai/image/v1/make/create/12", RequestMethod.POST_JSON);
+//            request.setBizContent(object.toString());
+//
+//            // -- 返回结果 -------------------------------------------------------------------
+//            CommonResponse response = client.executeAppToken(request, aiznService.getAppToken());
+//            JSONObject resp = aiznService.checkResponse(response);
+//            if ((Integer) resp.get("code") == 200) {
+//
+//                // -- 成功 ------------------------------------------------------------------
+////                Map<String, Object> respData = (Map<String, Object>) resp.get("data");
+//                Map<String, Object> respData = Convert.toMap(String.class, Object.class, resp.get("data"));
+//                System.out.println(respData);
+//
+//                // -- 将制作结果插入到数据表 -----------------------------------------------------
+//                AiznImageTaskVO vo = new AiznImageTaskVO();
+//                vo.setTask_id((String) respData.get("id"));
+//                vo.setUser_id(httpRequestAspect.getUserId());
+//                vo.setTask_type("GOOD_REPLACE");
+//                vo.setImage_url((String) respData.get("imageUrl"));
+//                vo.setTask_submit_json(JSONUtil.toJsonStr(respData));
+//                aiznImageTaskMapper.insertAiznImageTask(vo);
+//                // --------------------------------------------------------------------------
+//
+//                // -- 扣除对应的本地积分 (ZnGood, GoodCompound, 商品合成) ------------------------
+//                sysResourceService.consumptionPoint("ZnGood", "GoodReplace", null);
+//
+//                return MapUtil.convertToUnderscoreCase(respData);
+//
+//            } else {
+//                System.out.println(resp);
+//                throw new CustException((String) resp.get("msg"));
+//            }
+//
+//        } catch (InterruptedException e) { throw new RuntimeException(e);
+//        } finally { lock.unlock(); }
+//    }
+//
+//}

+ 14 - 14
src/main/java/com/backendsys/service/Ai/Aizn/AiznImageIncantationService.java

@@ -1,14 +1,14 @@
-package com.backendsys.service.Ai.Aizn;
-
-import com.backendsys.entity.Ai.Aizn.AiznImageIncantationDTO;
-
-import java.util.List;
-import java.util.Map;
-
-public interface AiznImageIncantationService {
-
-    List<Map<String, Object>> getImageIncantationList(AiznImageIncantationDTO aiznImageIncantationDTO);
-
-    List<Map<String, Object>> getImageIncantationDescriptionList();
-
-}
+//package com.backendsys.service.Ai.Aizn;
+//
+//import com.backendsys.entity.Ai.Aizn.AiznImageIncantationDTO;
+//
+//import java.util.List;
+//import java.util.Map;
+//
+//public interface AiznImageIncantationService {
+//
+//    List<Map<String, Object>> getImageIncantationList(AiznImageIncantationDTO aiznImageIncantationDTO);
+//
+//    List<Map<String, Object>> getImageIncantationDescriptionList();
+//
+//}

+ 55 - 55
src/main/java/com/backendsys/service/Ai/Aizn/AiznImageIncantationServiceImpl.java

@@ -1,55 +1,55 @@
-package com.backendsys.service.Ai.Aizn;
-
-import cn.hutool.core.convert.Convert;
-import com.backendsys.entity.Ai.Aizn.AiznImageIncantationDTO;
-import com.backendsys.mapper.Ai.Aizn.AiznImageIncantationMapper;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import java.util.*;
-
-@Service
-public class AiznImageIncantationServiceImpl implements AiznImageIncantationService {
-
-    @Autowired
-    private AiznImageIncantationMapper aiznImageIncantationMapper;
-
-    @Override
-    public List<Map<String, Object>> getImageIncantationList(AiznImageIncantationDTO aiznImageIncantationDTO) {
-
-        List<Map<String, Object>> resp = aiznImageIncantationMapper.queryAiznImageIncantation(aiznImageIncantationDTO);
-
-        Map<Integer, Map<String, Object>> groupedData = new LinkedHashMap<>();
-
-        for (Map<String, Object> item : resp) {
-            int categoryId = Convert.toInt(item.get("category_id"));
-            String categoryName = Convert.toStr(item.get("category_name"));
-            String name = Convert.toStr(item.get("name"));
-
-            if (!groupedData.containsKey(categoryId)) {
-                Map<String, Object> categoryData = new LinkedHashMap<>();
-                categoryData.put("category_id", categoryId);
-                categoryData.put("category_name", categoryName);
-                categoryData.put("list", new ArrayList<>());
-                groupedData.put(categoryId, categoryData);
-            }
-
-            List<Map<String, Object>> list = (List<Map<String, Object>>) groupedData.get(categoryId).get("list");
-            Map<String, Object> data = new LinkedHashMap<>();
-            data.put("name", name);
-            list.add(data);
-        }
-
-        // 打印转换后的数据
-        List<Map<String, Object>> result = new ArrayList<>(groupedData.values());
-
-        return result;
-    }
-
-
-    @Override
-    public List<Map<String, Object>> getImageIncantationDescriptionList() {
-        return aiznImageIncantationMapper.queryAiznImageIncantationDescription();
-    }
-
-}
+//package com.backendsys.service.Ai.Aizn;
+//
+//import cn.hutool.core.convert.Convert;
+//import com.backendsys.entity.Ai.Aizn.AiznImageIncantationDTO;
+//import com.backendsys.mapper.Ai.Aizn.AiznImageIncantationMapper;
+//import org.springframework.beans.factory.annotation.Autowired;
+//import org.springframework.stereotype.Service;
+//
+//import java.util.*;
+//
+//@Service
+//public class AiznImageIncantationServiceImpl implements AiznImageIncantationService {
+//
+//    @Autowired
+//    private AiznImageIncantationMapper aiznImageIncantationMapper;
+//
+//    @Override
+//    public List<Map<String, Object>> getImageIncantationList(AiznImageIncantationDTO aiznImageIncantationDTO) {
+//
+//        List<Map<String, Object>> resp = aiznImageIncantationMapper.queryAiznImageIncantation(aiznImageIncantationDTO);
+//
+//        Map<Integer, Map<String, Object>> groupedData = new LinkedHashMap<>();
+//
+//        for (Map<String, Object> item : resp) {
+//            int categoryId = Convert.toInt(item.get("category_id"));
+//            String categoryName = Convert.toStr(item.get("category_name"));
+//            String name = Convert.toStr(item.get("name"));
+//
+//            if (!groupedData.containsKey(categoryId)) {
+//                Map<String, Object> categoryData = new LinkedHashMap<>();
+//                categoryData.put("category_id", categoryId);
+//                categoryData.put("category_name", categoryName);
+//                categoryData.put("list", new ArrayList<>());
+//                groupedData.put(categoryId, categoryData);
+//            }
+//
+//            List<Map<String, Object>> list = (List<Map<String, Object>>) groupedData.get(categoryId).get("list");
+//            Map<String, Object> data = new LinkedHashMap<>();
+//            data.put("name", name);
+//            list.add(data);
+//        }
+//
+//        // 打印转换后的数据
+//        List<Map<String, Object>> result = new ArrayList<>(groupedData.values());
+//
+//        return result;
+//    }
+//
+//
+//    @Override
+//    public List<Map<String, Object>> getImageIncantationDescriptionList() {
+//        return aiznImageIncantationMapper.queryAiznImageIncantationDescription();
+//    }
+//
+//}

+ 17 - 17
src/main/java/com/backendsys/service/Ai/Aizn/AiznImageTaskService.java

@@ -1,17 +1,17 @@
-package com.backendsys.service.Ai.Aizn;
-
-import com.backendsys.entity.Ai.Aizn.AiznImageTaskVO;
-
-import java.io.IOException;
-import java.util.List;
-import java.util.Map;
-
-public interface AiznImageTaskService {
-    // [紫鸟] 查询任务进度 (通用) (progress_type: 3-智能抠图, 9-AI换模特, 11-商品合成, 12-商品合成 )
-    Map<String, Object> getProgressOfTask(String id, Integer progress_type) throws IOException;
-    List<Map<String, Object>> getProgressOfTaskArray(String ids, Integer progress_type) throws IOException;
-    // 获得任务列表
-    Map<String, Object> getImageTaskList(Integer pageNum, Integer pageSize, AiznImageTaskVO aiznImageTaskVO);
-    // 获得任务详情
-    Map<String, Object> getImageTaskDetail(AiznImageTaskVO aiznImageTaskVO);
-}
+//package com.backendsys.service.Ai.Aizn;
+//
+//import com.backendsys.entity.Ai.Aizn.AiznImageTaskVO;
+//
+//import java.io.IOException;
+//import java.util.List;
+//import java.util.Map;
+//
+//public interface AiznImageTaskService {
+//    // [紫鸟] 查询任务进度 (通用) (progress_type: 3-智能抠图, 9-AI换模特, 11-商品合成, 12-商品合成 )
+//    Map<String, Object> getProgressOfTask(String id, Integer progress_type) throws IOException;
+//    List<Map<String, Object>> getProgressOfTaskArray(String ids, Integer progress_type) throws IOException;
+//    // 获得任务列表
+//    Map<String, Object> getImageTaskList(Integer pageNum, Integer pageSize, AiznImageTaskVO aiznImageTaskVO);
+//    // 获得任务详情
+//    Map<String, Object> getImageTaskDetail(AiznImageTaskVO aiznImageTaskVO);
+//}

+ 193 - 193
src/main/java/com/backendsys/service/Ai/Aizn/AiznImageTaskServiceImpl.java

@@ -1,193 +1,193 @@
-package com.backendsys.service.Ai.Aizn;
-
-import cn.hutool.core.convert.Convert;
-import cn.hutool.core.util.StrUtil;
-import cn.hutool.json.JSONObject;
-import cn.hutool.json.JSONUtil;
-import com.backendsys.entity.Ai.Aizn.AiznImageTaskVO;
-import com.backendsys.entity.Tencent.TencentCos.UploadOriginDTO;
-import com.backendsys.entity.Tencent.TencentCos.UploadOriginResp;
-import com.backendsys.exception.CustException;
-import com.backendsys.mapper.Ai.Aizn.AiznImageTaskMapper;
-import com.backendsys.service.SDKService.SDKTencent.SDKTencentCOSService;
-import com.backendsys.utils.MapUtil;
-import com.backendsys.utils.response.PageInfoResult;
-import com.fzzixun.openapi.sdk.client.OpenClient;
-import com.fzzixun.openapi.sdk.common.RequestMethod;
-import com.fzzixun.openapi.sdk.request.CommonRequest;
-import com.fzzixun.openapi.sdk.response.CommonResponse;
-import com.github.pagehelper.PageHelper;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import java.io.IOException;
-import java.util.*;
-
-@Service
-public class AiznImageTaskServiceImpl implements AiznImageTaskService {
-
-    @Autowired
-    private AiznService aiznService;
-
-    @Autowired
-    private SDKTencentCOSService sdkTencentCOSService;
-
-    @Autowired
-    private AiznImageTaskMapper aiznImageTaskMapper;
-
-
-    /**
-     * [紫鸟] 查询进度 (查询任务 -> 储存桶)
-     * - 判断任务是否存在
-     *   - 是:
-     *     - 如果 status = 3,则返回数据库数据
-     *     - 如果 status != 3,读取远程数据并更新数据库,并将结果图片上传储存桶
-     */
-    @Override
-    public Map<String, Object> getProgressOfTask(String id, Integer progress_type) throws IOException {
-
-        // -- 查询详情 -----------------------------------------------------------------------
-        AiznImageTaskVO aiznImageTaskVO = new AiznImageTaskVO();
-        aiznImageTaskVO.setTask_id(id);
-        Map<String, Object> detail = aiznImageTaskMapper.queryAiznImageTaskDetail(aiznImageTaskVO);
-        if (detail == null) throw new CustException("任务ID不存在");
-
-        // -- 如果已有结果 (status = 3),则不必再查询/上传储存桶,仅返回原始数据 {task_result_json} --
-        if ((Integer) detail.get("status") != 3) {
-
-            // -- 业务参数 -------------------------------------------------------------------
-            JSONObject object = new JSONObject();
-            object.set("id", id);
-
-            // -- 实现方法 -------------------------------------------------------------------
-            OpenClient client = aiznService.getOpenClient();
-            CommonRequest request = new CommonRequest("/linkfox-ai/image/v1/make/info/" + progress_type, RequestMethod.POST_JSON);
-            request.setBizContent(object.toString());
-
-            // -- 返回结果 -------------------------------------------------------------------
-            CommonResponse response = client.executeAppToken(request, aiznService.getAppToken());
-            JSONObject resp = aiznService.checkResponse(response);
-            if ((Integer) resp.get("code") == 200) {
-
-                // -- 成功 ------------------------------------------------------------------
-//                Map<String, Object> respData = (Map<String, Object>) resp.get("data");
-                Map<String, Object> respData = Convert.toMap(String.class, Object.class, resp.get("data"));
-                Map<String, Object> respDataToCase = MapUtil.convertToUnderscoreCase(respData);
-                System.out.println(respData);
-
-                // -- 将任务结果更新到数据表 -----------------------------------------------------
-                AiznImageTaskVO vo = new AiznImageTaskVO();
-                vo.setTask_id((String) respData.get("id"));
-
-                Integer status = (Integer) respData.get("status");
-                vo.setStatus(status);
-
-                // -- 如果 status = 3 (SUCCESS) ---------------------------------------------
-                if (status == 3) {
-                    // 获取任务结果
-                    List<Map<String, Object>> resultList = (List<Map<String, Object>>) respData.get("resultList");
-                    List<Map<String, Object>> resultListToCase = (List<Map<String, Object>>) respDataToCase.get("result_list");
-
-                    // 转存 (result_image_url 字段保存转存后的链接,多张以逗号间隔)
-                    List<String> resultImages = new ArrayList<>();
-
-                    for (int i = 0; i < resultList.size(); i++) {
-                        Map<String, Object> result = resultList.get(i);
-                        String resultUrl = (String) result.get("url");
-                        // -- 将获得的结果图片,异步上传到对象储存桶 -----------------------------------
-                        UploadOriginDTO uploadOriginDTO = new UploadOriginDTO();
-                        uploadOriginDTO.setDir("temp");
-                        uploadOriginDTO.setUrl(resultUrl);
-                        UploadOriginResp uploadOriginResp = sdkTencentCOSService.uploadOrigin(uploadOriginDTO);
-
-                        // 将上传后的远程地址附加到返回值中
-                        resultListToCase.get(i).put("url_remote", uploadOriginResp.getUrl());
-                        resultListToCase.get(i).put("url_remote_thumb", uploadOriginResp.getUrl_thumb());
-
-                        resultImages.add(uploadOriginResp.getUrl());
-                    }
-
-                    respDataToCase.put("result_list", resultListToCase);
-
-                    System.out.println("resultImages:");
-                    System.out.println(resultImages);
-
-                    vo.setResult_image_url(String.join(",", resultImages));
-                    vo.setTask_result_json(JSONUtil.toJsonStr(respDataToCase));
-
-                }
-                aiznImageTaskMapper.updateAiznImageTask(vo);
-                // --------------------------------------------------------------------------
-
-                // 从远程接口返回查询任务详情
-                return respDataToCase;
-
-            } else {
-                System.out.println(resp);
-                throw new CustException((String) resp.get("msg"));
-            }
-
-        } else {
-            // 从数据库返回查询任务详情
-            return JSONUtil.parseObj(detail.get("task_result_json"));
-        }
-    }
-
-    @Override
-    public List<Map<String, Object>> getProgressOfTaskArray(String ids, Integer progress_type) throws IOException {
-        List<String> idsArray = StrUtil.split(ids, ',');
-
-        if (idsArray.size() == 0 || idsArray.size() > 10) {
-            throw new CustException("批量查询范围是: 1~10 条");
-        }
-
-        String[] integerIdsArray = Convert.toStrArray(idsArray);
-        List<Map<String, Object>> respGroup = new ArrayList<>();
-        for (String id : integerIdsArray) {
-            Map<String, Object> resp = getProgressOfTask(StrUtil.trim(id), progress_type);
-            respGroup.add(resp);
-        }
-        return respGroup;
-    }
-
-
-    /**
-     * 列表
-     */
-    @Override
-    public Map<String, Object> getImageTaskList(Integer pageNum, Integer pageSize, AiznImageTaskVO aiznImageTaskVO) {
-
-        // 分页查询
-        if (pageNum != null && pageSize != null) {
-            PageHelper.startPage(pageNum, pageSize);
-            PageHelper.getLocalPage().setPageSizeZero(true);
-        }
-
-        // 分页输出 (自定义)
-        List<Map<String, Object>> list = aiznImageTaskMapper.queryAiznImageTask(aiznImageTaskVO);
-
-        // 类型转换 数组 (result_image_url)
-        for (Map<String, Object> item : list) {
-            String imgUrls = (String) item.get("result_image_url");
-            item.put("result_image_url", StrUtil.isEmpty(imgUrls) ? new String[0] : StrUtil.splitToArray((String) imgUrls, ','));
-        }
-
-        PageInfoResult pageInfoResult = new PageInfoResult(list);
-        return pageInfoResult.toMap();
-    }
-
-    /**
-     * 详情
-     */
-    @Override
-    public Map<String, Object> getImageTaskDetail(AiznImageTaskVO aiznImageTaskVO) {
-        Map<String, Object> resp = aiznImageTaskMapper.queryAiznImageTaskDetail(aiznImageTaskVO);
-        if (resp == null) throw new CustException("任务ID不存在");
-
-        // result_image_url 转 数组类型
-        String imgUrls = (String) resp.get("result_image_url");
-        resp.put("result_image_url", StrUtil.isEmpty(imgUrls) ? new String[0] : StrUtil.splitToArray((String) imgUrls, ','));
-
-        return resp;
-    }
-}
+//package com.backendsys.service.Ai.Aizn;
+//
+//import cn.hutool.core.convert.Convert;
+//import cn.hutool.core.util.StrUtil;
+//import cn.hutool.json.JSONObject;
+//import cn.hutool.json.JSONUtil;
+//import com.backendsys.entity.Ai.Aizn.AiznImageTaskVO;
+//import com.backendsys.entity.Tencent.TencentCos.UploadOriginDTO;
+//import com.backendsys.entity.Tencent.TencentCos.UploadOriginResp;
+//import com.backendsys.exception.CustException;
+//import com.backendsys.mapper.Ai.Aizn.AiznImageTaskMapper;
+//import com.backendsys.service.SDKService.SDKTencent.SDKTencentCOSService;
+//import com.backendsys.utils.MapUtil;
+//import com.backendsys.utils.response.PageInfoResult;
+//import com.fzzixun.openapi.sdk.client.OpenClient;
+//import com.fzzixun.openapi.sdk.common.RequestMethod;
+//import com.fzzixun.openapi.sdk.request.CommonRequest;
+//import com.fzzixun.openapi.sdk.response.CommonResponse;
+//import com.github.pagehelper.PageHelper;
+//import org.springframework.beans.factory.annotation.Autowired;
+//import org.springframework.stereotype.Service;
+//
+//import java.io.IOException;
+//import java.util.*;
+//
+//@Service
+//public class AiznImageTaskServiceImpl implements AiznImageTaskService {
+//
+//    @Autowired
+//    private AiznService aiznService;
+//
+//    @Autowired
+//    private SDKTencentCOSService sdkTencentCOSService;
+//
+//    @Autowired
+//    private AiznImageTaskMapper aiznImageTaskMapper;
+//
+//
+//    /**
+//     * [紫鸟] 查询进度 (查询任务 -> 储存桶)
+//     * - 判断任务是否存在
+//     *   - 是:
+//     *     - 如果 status = 3,则返回数据库数据
+//     *     - 如果 status != 3,读取远程数据并更新数据库,并将结果图片上传储存桶
+//     */
+//    @Override
+//    public Map<String, Object> getProgressOfTask(String id, Integer progress_type) throws IOException {
+//
+//        // -- 查询详情 -----------------------------------------------------------------------
+//        AiznImageTaskVO aiznImageTaskVO = new AiznImageTaskVO();
+//        aiznImageTaskVO.setTask_id(id);
+//        Map<String, Object> detail = aiznImageTaskMapper.queryAiznImageTaskDetail(aiznImageTaskVO);
+//        if (detail == null) throw new CustException("任务ID不存在");
+//
+//        // -- 如果已有结果 (status = 3),则不必再查询/上传储存桶,仅返回原始数据 {task_result_json} --
+//        if ((Integer) detail.get("status") != 3) {
+//
+//            // -- 业务参数 -------------------------------------------------------------------
+//            JSONObject object = new JSONObject();
+//            object.set("id", id);
+//
+//            // -- 实现方法 -------------------------------------------------------------------
+//            OpenClient client = aiznService.getOpenClient();
+//            CommonRequest request = new CommonRequest("/linkfox-ai/image/v1/make/info/" + progress_type, RequestMethod.POST_JSON);
+//            request.setBizContent(object.toString());
+//
+//            // -- 返回结果 -------------------------------------------------------------------
+//            CommonResponse response = client.executeAppToken(request, aiznService.getAppToken());
+//            JSONObject resp = aiznService.checkResponse(response);
+//            if ((Integer) resp.get("code") == 200) {
+//
+//                // -- 成功 ------------------------------------------------------------------
+////                Map<String, Object> respData = (Map<String, Object>) resp.get("data");
+//                Map<String, Object> respData = Convert.toMap(String.class, Object.class, resp.get("data"));
+//                Map<String, Object> respDataToCase = MapUtil.convertToUnderscoreCase(respData);
+//                System.out.println(respData);
+//
+//                // -- 将任务结果更新到数据表 -----------------------------------------------------
+//                AiznImageTaskVO vo = new AiznImageTaskVO();
+//                vo.setTask_id((String) respData.get("id"));
+//
+//                Integer status = (Integer) respData.get("status");
+//                vo.setStatus(status);
+//
+//                // -- 如果 status = 3 (SUCCESS) ---------------------------------------------
+//                if (status == 3) {
+//                    // 获取任务结果
+//                    List<Map<String, Object>> resultList = (List<Map<String, Object>>) respData.get("resultList");
+//                    List<Map<String, Object>> resultListToCase = (List<Map<String, Object>>) respDataToCase.get("result_list");
+//
+//                    // 转存 (result_image_url 字段保存转存后的链接,多张以逗号间隔)
+//                    List<String> resultImages = new ArrayList<>();
+//
+//                    for (int i = 0; i < resultList.size(); i++) {
+//                        Map<String, Object> result = resultList.get(i);
+//                        String resultUrl = (String) result.get("url");
+//                        // -- 将获得的结果图片,异步上传到对象储存桶 -----------------------------------
+//                        UploadOriginDTO uploadOriginDTO = new UploadOriginDTO();
+//                        uploadOriginDTO.setDir("temp");
+//                        uploadOriginDTO.setUrl(resultUrl);
+//                        UploadOriginResp uploadOriginResp = sdkTencentCOSService.uploadOrigin(uploadOriginDTO);
+//
+//                        // 将上传后的远程地址附加到返回值中
+//                        resultListToCase.get(i).put("url_remote", uploadOriginResp.getUrl());
+//                        resultListToCase.get(i).put("url_remote_thumb", uploadOriginResp.getUrl_thumb());
+//
+//                        resultImages.add(uploadOriginResp.getUrl());
+//                    }
+//
+//                    respDataToCase.put("result_list", resultListToCase);
+//
+//                    System.out.println("resultImages:");
+//                    System.out.println(resultImages);
+//
+//                    vo.setResult_image_url(String.join(",", resultImages));
+//                    vo.setTask_result_json(JSONUtil.toJsonStr(respDataToCase));
+//
+//                }
+//                aiznImageTaskMapper.updateAiznImageTask(vo);
+//                // --------------------------------------------------------------------------
+//
+//                // 从远程接口返回查询任务详情
+//                return respDataToCase;
+//
+//            } else {
+//                System.out.println(resp);
+//                throw new CustException((String) resp.get("msg"));
+//            }
+//
+//        } else {
+//            // 从数据库返回查询任务详情
+//            return JSONUtil.parseObj(detail.get("task_result_json"));
+//        }
+//    }
+//
+//    @Override
+//    public List<Map<String, Object>> getProgressOfTaskArray(String ids, Integer progress_type) throws IOException {
+//        List<String> idsArray = StrUtil.split(ids, ',');
+//
+//        if (idsArray.size() == 0 || idsArray.size() > 10) {
+//            throw new CustException("批量查询范围是: 1~10 条");
+//        }
+//
+//        String[] integerIdsArray = Convert.toStrArray(idsArray);
+//        List<Map<String, Object>> respGroup = new ArrayList<>();
+//        for (String id : integerIdsArray) {
+//            Map<String, Object> resp = getProgressOfTask(StrUtil.trim(id), progress_type);
+//            respGroup.add(resp);
+//        }
+//        return respGroup;
+//    }
+//
+//
+//    /**
+//     * 列表
+//     */
+//    @Override
+//    public Map<String, Object> getImageTaskList(Integer pageNum, Integer pageSize, AiznImageTaskVO aiznImageTaskVO) {
+//
+//        // 分页查询
+//        if (pageNum != null && pageSize != null) {
+//            PageHelper.startPage(pageNum, pageSize);
+//            PageHelper.getLocalPage().setPageSizeZero(true);
+//        }
+//
+//        // 分页输出 (自定义)
+//        List<Map<String, Object>> list = aiznImageTaskMapper.queryAiznImageTask(aiznImageTaskVO);
+//
+//        // 类型转换 数组 (result_image_url)
+//        for (Map<String, Object> item : list) {
+//            String imgUrls = (String) item.get("result_image_url");
+//            item.put("result_image_url", StrUtil.isEmpty(imgUrls) ? new String[0] : StrUtil.splitToArray((String) imgUrls, ','));
+//        }
+//
+//        PageInfoResult pageInfoResult = new PageInfoResult(list);
+//        return pageInfoResult.toMap();
+//    }
+//
+//    /**
+//     * 详情
+//     */
+//    @Override
+//    public Map<String, Object> getImageTaskDetail(AiznImageTaskVO aiznImageTaskVO) {
+//        Map<String, Object> resp = aiznImageTaskMapper.queryAiznImageTaskDetail(aiznImageTaskVO);
+//        if (resp == null) throw new CustException("任务ID不存在");
+//
+//        // result_image_url 转 数组类型
+//        String imgUrls = (String) resp.get("result_image_url");
+//        resp.put("result_image_url", StrUtil.isEmpty(imgUrls) ? new String[0] : StrUtil.splitToArray((String) imgUrls, ','));
+//
+//        return resp;
+//    }
+//}

+ 27 - 27
src/main/java/com/backendsys/service/Ai/Aizn/AiznModelService.java

@@ -1,27 +1,27 @@
-package com.backendsys.service.Ai.Aizn;
-
-import com.backendsys.entity.Ai.Aizn.AiznImageStyleDTO;
-import com.backendsys.entity.Ai.Aizn.AiznIntelligentClipTaskDTO;
-import com.backendsys.entity.Ai.Aizn.AiznInteractClipTask.AiznInteractClipTaskDTO;
-import com.backendsys.entity.Ai.Aizn.AiznModel.AiznModelTaskDTO;
-
-import java.util.Map;
-
-/**
- * AI换模特
- */
-public interface AiznModelService {
-
-    // [紫鸟] 获取风格/场景配置数据
-    Map<String, Object> getImageStyle(AiznImageStyleDTO aiznImageStyleDTO);
-
-    // [紫鸟] 智能抠图 (发起任务)
-    Map<String, Object> makeIntelligentClipTask(AiznIntelligentClipTaskDTO aiznIntelligentClipTaskDTO);
-
-    // [紫鸟] 交互抠图 (直接返回结果)
-    Map<String, Object> makeInteractClipTask(AiznInteractClipTaskDTO aiznInteractClipTaskDTO);
-
-    // [紫鸟] AI换模特 (发起任务)
-    Map<String, Object> makeModelTask(AiznModelTaskDTO aiznModelTaskDTO);
-
-}
+//package com.backendsys.service.Ai.Aizn;
+//
+//import com.backendsys.entity.Ai.Aizn.AiznImageStyleDTO;
+//import com.backendsys.entity.Ai.Aizn.AiznIntelligentClipTaskDTO;
+//import com.backendsys.entity.Ai.Aizn.AiznInteractClipTask.AiznInteractClipTaskDTO;
+//import com.backendsys.entity.Ai.Aizn.AiznModel.AiznModelTaskDTO;
+//
+//import java.util.Map;
+//
+///**
+// * AI换模特
+// */
+//public interface AiznModelService {
+//
+//    // [紫鸟] 获取风格/场景配置数据
+//    Map<String, Object> getImageStyle(AiznImageStyleDTO aiznImageStyleDTO);
+//
+//    // [紫鸟] 智能抠图 (发起任务)
+//    Map<String, Object> makeIntelligentClipTask(AiznIntelligentClipTaskDTO aiznIntelligentClipTaskDTO);
+//
+//    // [紫鸟] 交互抠图 (直接返回结果)
+//    Map<String, Object> makeInteractClipTask(AiznInteractClipTaskDTO aiznInteractClipTaskDTO);
+//
+//    // [紫鸟] AI换模特 (发起任务)
+//    Map<String, Object> makeModelTask(AiznModelTaskDTO aiznModelTaskDTO);
+//
+//}

+ 325 - 325
src/main/java/com/backendsys/service/Ai/Aizn/AiznModelServiceImpl.java

@@ -1,326 +1,326 @@
-package com.backendsys.service.Ai.Aizn;
-
-import cn.hutool.core.util.StrUtil;
-import cn.hutool.json.JSONObject;
-import cn.hutool.json.JSONUtil;
-import com.backendsys.aspect.HttpRequestAspect;
-import com.backendsys.exception.CustException;
-import com.backendsys.modules.common.config.redis.utils.RedisUtil;
-import com.backendsys.entity.Ai.Aizn.AiznImageStyleDTO;
-import com.backendsys.entity.Ai.Aizn.AiznIntelligentClipTaskDTO;
-import com.backendsys.entity.Ai.Aizn.AiznImageTaskVO;
-import com.backendsys.entity.Ai.Aizn.AiznInteractClipTask.AiznInteractClipTaskDTO;
-import com.backendsys.entity.Ai.Aizn.AiznModel.AiznModelTaskDTO;
-import com.backendsys.mapper.Ai.Aizn.AiznImageTaskMapper;
-import com.backendsys.service.SDKService.SDKTencent.SDKTencentCOSService;
-import com.backendsys.service.System.SysResourceService;
-import com.backendsys.utils.ListUtil;
-import com.backendsys.utils.MapUtil;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fzzixun.openapi.sdk.client.OpenClient;
-import com.fzzixun.openapi.sdk.common.RequestMethod;
-import com.fzzixun.openapi.sdk.request.CommonRequest;
-import com.fzzixun.openapi.sdk.response.CommonResponse;
-import org.redisson.api.RLock;
-import org.redisson.api.RedissonClient;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.Lazy;
-import org.springframework.stereotype.Service;
-
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.TimeUnit;
-import java.util.stream.Collectors;
-
-@Service
-public class AiznModelServiceImpl implements AiznModelService {
-
-    @Lazy
-    @Autowired
-    RedissonClient redissonClient;
-
-    @Autowired
-    private HttpRequestAspect httpRequestAspect;
-
-    @Autowired
-    private AiznService aiznService;
-    @Autowired
-    private AiznImageTaskMapper aiznImageTaskMapper;
-
-    @Autowired
-    private SysResourceService sysResourceService;
-
-    @Autowired
-    private SDKTencentCOSService sdkTencentCOSService;
-
-    @Autowired
-    private RedisUtil redisUtil;
-
-    /**
-     * [紫鸟] 获取风格/场景配置数据 (https://open.ziniao.com/manage/apiTest/809)
-     */
-    @Override
-    public Map<String, Object> getImageStyle(AiznImageStyleDTO aiznImageStyleDTO) {
-
-        Integer type = aiznImageStyleDTO.getType();
-
-        // -- 业务参数 -------------------------------------------------------------------
-        JSONObject object = new JSONObject();
-        object.set("showType", aiznImageStyleDTO.getShow_type());       // 展示类型 0.默认
-        object.set("type", type);                                       // 类型 1.AI绘图
-
-        String redisKey = "getImageStyle-" + type;
-        String redisCacheObject = redisUtil.getCacheObject(redisKey);
-        if (StrUtil.isNotEmpty(redisCacheObject)) {
-            // [缓存存在] 读取缓存
-            Map<String, Object> result = new LinkedHashMap<>();
-            try {
-                System.out.println("[缓存存在] 读取缓存");
-                ObjectMapper mapper = new ObjectMapper();
-                List<Map<String, Object>> respData = mapper.readValue(redisCacheObject, List.class);
-                result.put("type", type);
-                result.put("total", respData.size());
-                result.put("list", ListUtil.convertToUnderscoreCase(respData)); // 将返回结果:首字母大写命名 转换为 下划线命名
-            } catch (Exception e) {
-                e.printStackTrace();
-            }
-            return result;
-
-        } else {
-
-            // -- 实现方法 -------------------------------------------------------------------
-            OpenClient client = aiznService.getOpenClient();
-            CommonRequest request = new CommonRequest("/linkfox-ai/image/v1/make/style", RequestMethod.POST_JSON);
-            request.setBizContent(object.toString());
-
-            // -- 返回结果 -------------------------------------------------------------------
-            CommonResponse response = client.executeAppToken(request, aiznService.getAppToken());
-            JSONObject resp = aiznService.checkResponse(response);
-            if ((Integer) resp.get("code") == 200) {
-
-                // -- 成功 ------------------------------------------------------------------
-                List<Map<String, Object>> respData = (List<Map<String, Object>>) resp.get("data");
-                Map<String, Object> result = new LinkedHashMap<>();
-                result.put("type", type);
-                result.put("total", respData.size());
-                result.put("list", ListUtil.convertToUnderscoreCase(respData)); // 将返回结果:首字母大写命名 转换为 下划线命名
-
-                // [缓存不存在] 加入缓存
-                try {
-                    System.out.println("[缓存不存在] 加入缓存 (30秒过期)");
-                    ObjectMapper mapper = new ObjectMapper();
-                    String respDataStr = mapper.writeValueAsString(respData);
-                    System.out.println(respDataStr);
-                    redisUtil.setCacheObject(redisKey, respDataStr, 30, TimeUnit.SECONDS);
-                } catch (Exception e) {
-                    e.printStackTrace();
-                }
-
-                return result;
-                // --------------------------------------------------------------------------
-
-            } else {
-                System.out.println(resp);
-                Integer code = resp.get("code") != null ? (Integer) resp.get("code") : 6001;
-                throw new CustException("功能暂不可用,请联系管理员", code, resp);
-            }
-
-        }
-    }
-
-
-
-    /**
-     * [紫鸟] 智能抠图 (发起任务) (创建任务记录) (扣积分)
-     * (智能抠图:https://open.ziniao.com/manage/apiTest/810)
-     */
-    @Override
-    public Map<String, Object> makeIntelligentClipTask(AiznIntelligentClipTaskDTO aiznIntelligentClipTaskDTO) {
-
-        RLock lock = redissonClient.getLock("makeModelTask");
-        try { lock.tryLock(3, TimeUnit.SECONDS);
-
-            // -- 业务参数 -------------------------------------------------------------------
-            JSONObject object = new JSONObject();
-            object.set("imageUrl", aiznIntelligentClipTaskDTO.getImage_url());      // 图片
-            object.set("subType", aiznIntelligentClipTaskDTO.getSub_type());        // 子类型,1:通用,2:人像,3:商品 9:服饰
-            object.set("outputNum", 1);                                             // 输出张数,固定 1
-
-            // -- 实现方法 -------------------------------------------------------------------
-            OpenClient client = aiznService.getOpenClient();
-            CommonRequest request = new CommonRequest("/linkfox-ai/image/v1/make/create/3", RequestMethod.POST_JSON);
-            request.setBizContent(object.toString());
-
-            // -- 返回结果 -------------------------------------------------------------------
-            CommonResponse response = client.executeAppToken(request, aiznService.getAppToken());
-            JSONObject resp = aiznService.checkResponse(response);
-            if ((Integer) resp.get("code") == 200) {
-
-                // -- 成功 ------------------------------------------------------------------
-                Map<String, Object> respData = (Map<String, Object>) resp.get("data");
-                System.out.println(respData);
-
-                // -- 将制作结果插入到数据表 -----------------------------------------------------
-                AiznImageTaskVO vo = new AiznImageTaskVO();
-                vo.setTask_id((String) respData.get("id"));
-                vo.setUser_id(httpRequestAspect.getUserId());
-                vo.setTask_type("INTELLIGENT_CLIP");
-                vo.setImage_url((String) respData.get("imageUrl"));
-                vo.setTask_submit_json(JSONUtil.toJsonStr(respData));
-                aiznImageTaskMapper.insertAiznImageTask(vo);
-                // --------------------------------------------------------------------------
-
-                // -- 扣除对应的本地积分 (ZnModel, IntelligentClip, 智能抠图) --------------------
-                sysResourceService.consumptionPoint("ZnModel", "IntelligentClip", null);
-
-                return MapUtil.convertToUnderscoreCase(respData);
-                // --------------------------------------------------------------------------
-
-            } else {
-                System.out.println(resp);
-                Integer code = resp.get("code") != null ? (Integer) resp.get("code") : 6001;
-                throw new CustException("功能暂不可用,请联系管理员", code, resp);
-            }
-
-        } catch (InterruptedException e) { throw new RuntimeException(e);
-        } finally { lock.unlock(); }
-    }
-
-    /**
-     * [紫鸟] 交互抠图 (直接返回结果)
-     * (交互抠图:https://open.ziniao.com/manage/apiTest/838)
-     */
-    @Override
-    public Map<String, Object> makeInteractClipTask(AiznInteractClipTaskDTO aiznInteractClipTaskDTO) {
-
-        RLock lock = redissonClient.getLock("makeInteractClipTask");
-        try { lock.tryLock(3, TimeUnit.SECONDS);
-
-            // -- 业务参数 -------------------------------------------------------------------
-            JSONObject object = new JSONObject();
-            object.set("imageUrl", aiznInteractClipTaskDTO.getImage_url());         // 原图
-
-            // [参数命名转换] 下划线 转 小驼峰
-            List<Map<String, Object>> pointList = aiznInteractClipTaskDTO.getPoint_list().stream().map(point -> {
-                Map<String, Object> map = new LinkedHashMap<>();
-                map.put("x", point.getX());
-                map.put("y", point.getY());
-                map.put("isSelect", point.getIs_select());
-                return map;
-            }).collect(Collectors.toList());
-            // 点位操作列表
-            object.set("pointList", pointList);
-
-            object.set("scoreUrl", aiznInteractClipTaskDTO.getScore_url());         // 概率图
-            object.set("featureUrl", aiznInteractClipTaskDTO.getFeature_url());     // 全局分割图
-
-            // -- 实现方法 -------------------------------------------------------------------
-            OpenClient client = aiznService.getOpenClient();
-            CommonRequest request = new CommonRequest("/linkfox-ai/image/v1/make/process/interactCutout", RequestMethod.POST_JSON);
-            request.setBizContent(object.toString());
-
-            // -- 返回结果 -------------------------------------------------------------------
-            CommonResponse response = client.executeAppToken(request, aiznService.getAppToken());
-            JSONObject resp = aiznService.checkResponse(response);
-            if ((Integer) resp.get("code") == 200) {
-
-                // -- 成功 ------------------------------------------------------------------
-                Map<String, Object> respData = (Map<String, Object>) resp.get("data");
-                System.out.println(respData);
-
-                return MapUtil.convertToUnderscoreCase(respData);
-                // --------------------------------------------------------------------------
-
-            } else {
-                System.out.println(resp);
-                Integer code = resp.get("code") != null ? (Integer) resp.get("code") : 6001;
-                throw new CustException("功能暂不可用,请联系管理员", code, resp);
-            }
-
-        } catch (InterruptedException e) { throw new RuntimeException(e);
-        } finally { lock.unlock(); }
-    }
-
-
-
-    /**
-     * [紫鸟] AI换模特 (发起任务) (创建任务记录) (扣积分)
-     */
-    @Override
-    public Map<String, Object> makeModelTask(AiznModelTaskDTO aiznModelTaskDTO) {
-
-        RLock lock = redissonClient.getLock("makeModelTask");
-        try { lock.tryLock(3, TimeUnit.SECONDS);
-
-//            // 自定义描述时 scene 字段不能跟 style 字段共存,
-//            if (aiznModelTaskDTO.getStyle() != null && aiznModelTaskDTO.getExtend_fields().getScene() != null) {
-//                throw new CustException("自定义描述时,style 与 extend_fields.scene 不能共存");
+//package com.backendsys.service.Ai.Aizn;
+//
+//import cn.hutool.core.util.StrUtil;
+//import cn.hutool.json.JSONObject;
+//import cn.hutool.json.JSONUtil;
+//import com.backendsys.aspect.HttpRequestAspect;
+//import com.backendsys.exception.CustException;
+//import com.backendsys.modules.common.config.redis.utils.RedisUtil;
+//import com.backendsys.entity.Ai.Aizn.AiznImageStyleDTO;
+//import com.backendsys.entity.Ai.Aizn.AiznIntelligentClipTaskDTO;
+//import com.backendsys.entity.Ai.Aizn.AiznImageTaskVO;
+//import com.backendsys.entity.Ai.Aizn.AiznInteractClipTask.AiznInteractClipTaskDTO;
+//import com.backendsys.entity.Ai.Aizn.AiznModel.AiznModelTaskDTO;
+//import com.backendsys.mapper.Ai.Aizn.AiznImageTaskMapper;
+//import com.backendsys.service.SDKService.SDKTencent.SDKTencentCOSService;
+//import com.backendsys.service.System.SysResourceService;
+//import com.backendsys.utils.ListUtil;
+//import com.backendsys.utils.MapUtil;
+//import com.fasterxml.jackson.databind.ObjectMapper;
+//import com.fzzixun.openapi.sdk.client.OpenClient;
+//import com.fzzixun.openapi.sdk.common.RequestMethod;
+//import com.fzzixun.openapi.sdk.request.CommonRequest;
+//import com.fzzixun.openapi.sdk.response.CommonResponse;
+//import org.redisson.api.RLock;
+//import org.redisson.api.RedissonClient;
+//import org.springframework.beans.factory.annotation.Autowired;
+//import org.springframework.context.annotation.Lazy;
+//import org.springframework.stereotype.Service;
+//
+//import java.util.LinkedHashMap;
+//import java.util.List;
+//import java.util.Map;
+//import java.util.concurrent.TimeUnit;
+//import java.util.stream.Collectors;
+//
+//@Service
+//public class AiznModelServiceImpl implements AiznModelService {
+//
+//    @Lazy
+//    @Autowired
+//    RedissonClient redissonClient;
+//
+//    @Autowired
+//    private HttpRequestAspect httpRequestAspect;
+//
+//    @Autowired
+//    private AiznService aiznService;
+//    @Autowired
+//    private AiznImageTaskMapper aiznImageTaskMapper;
+//
+//    @Autowired
+//    private SysResourceService sysResourceService;
+//
+//    @Autowired
+//    private SDKTencentCOSService sdkTencentCOSService;
+//
+//    @Autowired
+//    private RedisUtil redisUtil;
+//
+//    /**
+//     * [紫鸟] 获取风格/场景配置数据 (https://open.ziniao.com/manage/apiTest/809)
+//     */
+//    @Override
+//    public Map<String, Object> getImageStyle(AiznImageStyleDTO aiznImageStyleDTO) {
+//
+//        Integer type = aiznImageStyleDTO.getType();
+//
+//        // -- 业务参数 -------------------------------------------------------------------
+//        JSONObject object = new JSONObject();
+//        object.set("showType", aiznImageStyleDTO.getShow_type());       // 展示类型 0.默认
+//        object.set("type", type);                                       // 类型 1.AI绘图
+//
+//        String redisKey = "getImageStyle-" + type;
+//        String redisCacheObject = redisUtil.getCacheObject(redisKey);
+//        if (StrUtil.isNotEmpty(redisCacheObject)) {
+//            // [缓存存在] 读取缓存
+//            Map<String, Object> result = new LinkedHashMap<>();
+//            try {
+//                System.out.println("[缓存存在] 读取缓存");
+//                ObjectMapper mapper = new ObjectMapper();
+//                List<Map<String, Object>> respData = mapper.readValue(redisCacheObject, List.class);
+//                result.put("type", type);
+//                result.put("total", respData.size());
+//                result.put("list", ListUtil.convertToUnderscoreCase(respData)); // 将返回结果:首字母大写命名 转换为 下划线命名
+//            } catch (Exception e) {
+//                e.printStackTrace();
 //            }
-
-            // -- 业务参数 -------------------------------------------------------------------
-            JSONObject object = new JSONObject();
-            object.set("imageUrl", aiznModelTaskDTO.getImage_url());         // 原图
-            object.set("style", aiznModelTaskDTO.getStyle());                // 模特类型 与自定义模特头部图必填其一 预设值 调用风格接口 type = 6
-            object.set("outputNum", aiznModelTaskDTO.getOutput_num());      // 数量 (1~4)
-
-            Map<String, Object> extendFields = new LinkedHashMap<>();
-            extendFields.put("imageSegUrl", aiznModelTaskDTO.getExtend_fields().getImage_seg_url());
-            extendFields.put("imageSegSubType", aiznModelTaskDTO.getExtend_fields().getImage_seg_subtype());
-            extendFields.put("scene", aiznModelTaskDTO.getExtend_fields().getScene());
-            extendFields.put("modelPrompt", aiznModelTaskDTO.getExtend_fields().getModel_prompt());
-
-            Map<String, Object> customModel = new LinkedHashMap<>();
-
-            if (aiznModelTaskDTO.getExtend_fields().getCustom_model() != null) {
-                customModel.put("modelHeadImageUrl", aiznModelTaskDTO.getExtend_fields().getCustom_model().getModel_head_image_url());
-            }
-            extendFields.put("customModel", customModel);
-
-            object.set("extendFields", extendFields);
-
-            System.out.println("Params:");
-            System.out.println(object.toString());
-
-            // -- 实现方法 -------------------------------------------------------------------
-            OpenClient client = aiznService.getOpenClient();
-            CommonRequest request = new CommonRequest("/linkfox-ai/image/v1/make/create/9", RequestMethod.POST_JSON);
-
-            request.setBizContent(object.toString());
-
-            // -- 返回结果 -------------------------------------------------------------------
-            CommonResponse response = client.executeAppToken(request, aiznService.getAppToken());
-            JSONObject resp = aiznService.checkResponse(response);
-            if ((Integer) resp.get("code") == 200) {
-
-                // -- 成功 ------------------------------------------------------------------
-                Map<String, Object> respData = (Map<String, Object>) resp.get("data");
-                System.out.println(respData);
-
-                // -- 将制作结果插入到数据表 -----------------------------------------------------
-                AiznImageTaskVO vo = new AiznImageTaskVO();
-                vo.setTask_id((String) respData.get("id"));
-                vo.setUser_id(httpRequestAspect.getUserId());
-                vo.setTask_type("MODEL");
-                vo.setImage_url((String) respData.get("imageUrl"));
-                vo.setTask_submit_json(JSONUtil.toJsonStr(respData));
-                aiznImageTaskMapper.insertAiznImageTask(vo);
-
-                // -- 消耗积分 (查询对应积分,查询我的积分,更新我的积分,新增积分记录) --------------------------------
-                sysResourceService.consumptionPoint("ZnModel", "MakeModel", aiznModelTaskDTO.getOutput_num());
-                // -----------------------------------------------------------------------------------------
-
-                return MapUtil.convertToUnderscoreCase(respData);
-                // --------------------------------------------------------------------------
-
-            } else {
-                System.out.println(resp);
-                Integer code = resp.get("code") != null ? (Integer) resp.get("code") : 6001;
-                throw new CustException("功能暂不可用,请联系管理员", code, resp);
-            }
-
-        } catch (InterruptedException e) { throw new RuntimeException(e);
-        } finally { lock.unlock(); }
-    }
-
-}
+//            return result;
+//
+//        } else {
+//
+//            // -- 实现方法 -------------------------------------------------------------------
+//            OpenClient client = aiznService.getOpenClient();
+//            CommonRequest request = new CommonRequest("/linkfox-ai/image/v1/make/style", RequestMethod.POST_JSON);
+//            request.setBizContent(object.toString());
+//
+//            // -- 返回结果 -------------------------------------------------------------------
+//            CommonResponse response = client.executeAppToken(request, aiznService.getAppToken());
+//            JSONObject resp = aiznService.checkResponse(response);
+//            if ((Integer) resp.get("code") == 200) {
+//
+//                // -- 成功 ------------------------------------------------------------------
+//                List<Map<String, Object>> respData = (List<Map<String, Object>>) resp.get("data");
+//                Map<String, Object> result = new LinkedHashMap<>();
+//                result.put("type", type);
+//                result.put("total", respData.size());
+//                result.put("list", ListUtil.convertToUnderscoreCase(respData)); // 将返回结果:首字母大写命名 转换为 下划线命名
+//
+//                // [缓存不存在] 加入缓存
+//                try {
+//                    System.out.println("[缓存不存在] 加入缓存 (30秒过期)");
+//                    ObjectMapper mapper = new ObjectMapper();
+//                    String respDataStr = mapper.writeValueAsString(respData);
+//                    System.out.println(respDataStr);
+//                    redisUtil.setCacheObject(redisKey, respDataStr, 30, TimeUnit.SECONDS);
+//                } catch (Exception e) {
+//                    e.printStackTrace();
+//                }
+//
+//                return result;
+//                // --------------------------------------------------------------------------
+//
+//            } else {
+//                System.out.println(resp);
+//                Integer code = resp.get("code") != null ? (Integer) resp.get("code") : 6001;
+//                throw new CustException("功能暂不可用,请联系管理员", code, resp);
+//            }
+//
+//        }
+//    }
+//
+//
+//
+//    /**
+//     * [紫鸟] 智能抠图 (发起任务) (创建任务记录) (扣积分)
+//     * (智能抠图:https://open.ziniao.com/manage/apiTest/810)
+//     */
+//    @Override
+//    public Map<String, Object> makeIntelligentClipTask(AiznIntelligentClipTaskDTO aiznIntelligentClipTaskDTO) {
+//
+//        RLock lock = redissonClient.getLock("makeModelTask");
+//        try { lock.tryLock(3, TimeUnit.SECONDS);
+//
+//            // -- 业务参数 -------------------------------------------------------------------
+//            JSONObject object = new JSONObject();
+//            object.set("imageUrl", aiznIntelligentClipTaskDTO.getImage_url());      // 图片
+//            object.set("subType", aiznIntelligentClipTaskDTO.getSub_type());        // 子类型,1:通用,2:人像,3:商品 9:服饰
+//            object.set("outputNum", 1);                                             // 输出张数,固定 1
+//
+//            // -- 实现方法 -------------------------------------------------------------------
+//            OpenClient client = aiznService.getOpenClient();
+//            CommonRequest request = new CommonRequest("/linkfox-ai/image/v1/make/create/3", RequestMethod.POST_JSON);
+//            request.setBizContent(object.toString());
+//
+//            // -- 返回结果 -------------------------------------------------------------------
+//            CommonResponse response = client.executeAppToken(request, aiznService.getAppToken());
+//            JSONObject resp = aiznService.checkResponse(response);
+//            if ((Integer) resp.get("code") == 200) {
+//
+//                // -- 成功 ------------------------------------------------------------------
+//                Map<String, Object> respData = (Map<String, Object>) resp.get("data");
+//                System.out.println(respData);
+//
+//                // -- 将制作结果插入到数据表 -----------------------------------------------------
+//                AiznImageTaskVO vo = new AiznImageTaskVO();
+//                vo.setTask_id((String) respData.get("id"));
+//                vo.setUser_id(httpRequestAspect.getUserId());
+//                vo.setTask_type("INTELLIGENT_CLIP");
+//                vo.setImage_url((String) respData.get("imageUrl"));
+//                vo.setTask_submit_json(JSONUtil.toJsonStr(respData));
+//                aiznImageTaskMapper.insertAiznImageTask(vo);
+//                // --------------------------------------------------------------------------
+//
+//                // -- 扣除对应的本地积分 (ZnModel, IntelligentClip, 智能抠图) --------------------
+//                sysResourceService.consumptionPoint("ZnModel", "IntelligentClip", null);
+//
+//                return MapUtil.convertToUnderscoreCase(respData);
+//                // --------------------------------------------------------------------------
+//
+//            } else {
+//                System.out.println(resp);
+//                Integer code = resp.get("code") != null ? (Integer) resp.get("code") : 6001;
+//                throw new CustException("功能暂不可用,请联系管理员", code, resp);
+//            }
+//
+//        } catch (InterruptedException e) { throw new RuntimeException(e);
+//        } finally { lock.unlock(); }
+//    }
+//
+//    /**
+//     * [紫鸟] 交互抠图 (直接返回结果)
+//     * (交互抠图:https://open.ziniao.com/manage/apiTest/838)
+//     */
+//    @Override
+//    public Map<String, Object> makeInteractClipTask(AiznInteractClipTaskDTO aiznInteractClipTaskDTO) {
+//
+//        RLock lock = redissonClient.getLock("makeInteractClipTask");
+//        try { lock.tryLock(3, TimeUnit.SECONDS);
+//
+//            // -- 业务参数 -------------------------------------------------------------------
+//            JSONObject object = new JSONObject();
+//            object.set("imageUrl", aiznInteractClipTaskDTO.getImage_url());         // 原图
+//
+//            // [参数命名转换] 下划线 转 小驼峰
+//            List<Map<String, Object>> pointList = aiznInteractClipTaskDTO.getPoint_list().stream().map(point -> {
+//                Map<String, Object> map = new LinkedHashMap<>();
+//                map.put("x", point.getX());
+//                map.put("y", point.getY());
+//                map.put("isSelect", point.getIs_select());
+//                return map;
+//            }).collect(Collectors.toList());
+//            // 点位操作列表
+//            object.set("pointList", pointList);
+//
+//            object.set("scoreUrl", aiznInteractClipTaskDTO.getScore_url());         // 概率图
+//            object.set("featureUrl", aiznInteractClipTaskDTO.getFeature_url());     // 全局分割图
+//
+//            // -- 实现方法 -------------------------------------------------------------------
+//            OpenClient client = aiznService.getOpenClient();
+//            CommonRequest request = new CommonRequest("/linkfox-ai/image/v1/make/process/interactCutout", RequestMethod.POST_JSON);
+//            request.setBizContent(object.toString());
+//
+//            // -- 返回结果 -------------------------------------------------------------------
+//            CommonResponse response = client.executeAppToken(request, aiznService.getAppToken());
+//            JSONObject resp = aiznService.checkResponse(response);
+//            if ((Integer) resp.get("code") == 200) {
+//
+//                // -- 成功 ------------------------------------------------------------------
+//                Map<String, Object> respData = (Map<String, Object>) resp.get("data");
+//                System.out.println(respData);
+//
+//                return MapUtil.convertToUnderscoreCase(respData);
+//                // --------------------------------------------------------------------------
+//
+//            } else {
+//                System.out.println(resp);
+//                Integer code = resp.get("code") != null ? (Integer) resp.get("code") : 6001;
+//                throw new CustException("功能暂不可用,请联系管理员", code, resp);
+//            }
+//
+//        } catch (InterruptedException e) { throw new RuntimeException(e);
+//        } finally { lock.unlock(); }
+//    }
+//
+//
+//
+//    /**
+//     * [紫鸟] AI换模特 (发起任务) (创建任务记录) (扣积分)
+//     */
+//    @Override
+//    public Map<String, Object> makeModelTask(AiznModelTaskDTO aiznModelTaskDTO) {
+//
+//        RLock lock = redissonClient.getLock("makeModelTask");
+//        try { lock.tryLock(3, TimeUnit.SECONDS);
+//
+////            // 自定义描述时 scene 字段不能跟 style 字段共存,
+////            if (aiznModelTaskDTO.getStyle() != null && aiznModelTaskDTO.getExtend_fields().getScene() != null) {
+////                throw new CustException("自定义描述时,style 与 extend_fields.scene 不能共存");
+////            }
+//
+//            // -- 业务参数 -------------------------------------------------------------------
+//            JSONObject object = new JSONObject();
+//            object.set("imageUrl", aiznModelTaskDTO.getImage_url());         // 原图
+//            object.set("style", aiznModelTaskDTO.getStyle());                // 模特类型 与自定义模特头部图必填其一 预设值 调用风格接口 type = 6
+//            object.set("outputNum", aiznModelTaskDTO.getOutput_num());      // 数量 (1~4)
+//
+//            Map<String, Object> extendFields = new LinkedHashMap<>();
+//            extendFields.put("imageSegUrl", aiznModelTaskDTO.getExtend_fields().getImage_seg_url());
+//            extendFields.put("imageSegSubType", aiznModelTaskDTO.getExtend_fields().getImage_seg_subtype());
+//            extendFields.put("scene", aiznModelTaskDTO.getExtend_fields().getScene());
+//            extendFields.put("modelPrompt", aiznModelTaskDTO.getExtend_fields().getModel_prompt());
+//
+//            Map<String, Object> customModel = new LinkedHashMap<>();
+//
+//            if (aiznModelTaskDTO.getExtend_fields().getCustom_model() != null) {
+//                customModel.put("modelHeadImageUrl", aiznModelTaskDTO.getExtend_fields().getCustom_model().getModel_head_image_url());
+//            }
+//            extendFields.put("customModel", customModel);
+//
+//            object.set("extendFields", extendFields);
+//
+//            System.out.println("Params:");
+//            System.out.println(object.toString());
+//
+//            // -- 实现方法 -------------------------------------------------------------------
+//            OpenClient client = aiznService.getOpenClient();
+//            CommonRequest request = new CommonRequest("/linkfox-ai/image/v1/make/create/9", RequestMethod.POST_JSON);
+//
+//            request.setBizContent(object.toString());
+//
+//            // -- 返回结果 -------------------------------------------------------------------
+//            CommonResponse response = client.executeAppToken(request, aiznService.getAppToken());
+//            JSONObject resp = aiznService.checkResponse(response);
+//            if ((Integer) resp.get("code") == 200) {
+//
+//                // -- 成功 ------------------------------------------------------------------
+//                Map<String, Object> respData = (Map<String, Object>) resp.get("data");
+//                System.out.println(respData);
+//
+//                // -- 将制作结果插入到数据表 -----------------------------------------------------
+//                AiznImageTaskVO vo = new AiznImageTaskVO();
+//                vo.setTask_id((String) respData.get("id"));
+//                vo.setUser_id(httpRequestAspect.getUserId());
+//                vo.setTask_type("MODEL");
+//                vo.setImage_url((String) respData.get("imageUrl"));
+//                vo.setTask_submit_json(JSONUtil.toJsonStr(respData));
+//                aiznImageTaskMapper.insertAiznImageTask(vo);
+//
+//                // -- 消耗积分 (查询对应积分,查询我的积分,更新我的积分,新增积分记录) --------------------------------
+//                sysResourceService.consumptionPoint("ZnModel", "MakeModel", aiznModelTaskDTO.getOutput_num());
+//                // -----------------------------------------------------------------------------------------
+//
+//                return MapUtil.convertToUnderscoreCase(respData);
+//                // --------------------------------------------------------------------------
+//
+//            } else {
+//                System.out.println(resp);
+//                Integer code = resp.get("code") != null ? (Integer) resp.get("code") : 6001;
+//                throw new CustException("功能暂不可用,请联系管理员", code, resp);
+//            }
+//
+//        } catch (InterruptedException e) { throw new RuntimeException(e);
+//        } finally { lock.unlock(); }
+//    }
+//
+//}

+ 11 - 11
src/main/java/com/backendsys/service/Ai/Aizn/AiznService.java

@@ -1,11 +1,11 @@
-package com.backendsys.service.Ai.Aizn;
-
-import cn.hutool.json.JSONObject;
-import com.fzzixun.openapi.sdk.client.OpenClient;
-import com.fzzixun.openapi.sdk.response.CommonResponse;
-
-public interface AiznService {
-    String getAppToken();
-    OpenClient getOpenClient();
-    JSONObject checkResponse(CommonResponse response);
-}
+//package com.backendsys.service.Ai.Aizn;
+//
+//import cn.hutool.json.JSONObject;
+//import com.fzzixun.openapi.sdk.client.OpenClient;
+//import com.fzzixun.openapi.sdk.response.CommonResponse;
+//
+//public interface AiznService {
+//    String getAppToken();
+//    OpenClient getOpenClient();
+//    JSONObject checkResponse(CommonResponse response);
+//}

+ 67 - 67
src/main/java/com/backendsys/service/Ai/Aizn/AiznServiceImpl.java

@@ -1,67 +1,67 @@
-package com.backendsys.service.Ai.Aizn;
-
-import cn.hutool.json.JSONObject;
-import cn.hutool.json.JSONUtil;
-import com.backendsys.exception.CustException;
-import com.fzzixun.openapi.sdk.client.OpenClient;
-import com.fzzixun.openapi.sdk.request.AppTokenRequest;
-import com.fzzixun.openapi.sdk.response.AppTokenResponse;
-import com.fzzixun.openapi.sdk.response.CommonResponse;
-import org.springframework.stereotype.Service;
-
-@Service
-public class AiznServiceImpl implements AiznService{
-
-    private String url = "https://sbappstoreapi.ziniao.com";
-    private String appId = "202404231232292775081406464";
-    private String privateKeyIsv = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCNl8AKGVm9WnO67gEeLXeHKE2MBp16h0BKmHWrhdurM8uu1fIfRgR4K6AguE97mGqfCYBSad8cfP1dbrA529cZPXXFegl7tSBMxciK7i3kPTqPRS3sUbLQZHHdceoxWXDGA6oa3xxl3I6MuqMIO8vzYrdkY+A5h7sKY59tiYl3uq/mhJnq+FylkiQt3BLy7ATXVWFqMybAt6Pznawlaj2pbCVdSbM7hIKD8StgorAd9a7AnnstiJH7NmtppGS720qXeLHmgkse1hHf8gIel3nbi9iB7XAdC2iM8it425BuWaDb1y0SYZ7EZmhu8f45bsCxUJdd9QEC1dDR90pW0rJFAgMBAAECggEAUEB3VwIBTAJtX8CwH4OToKZmNXw2W5E3DlCVOQ9YbxOfWUvnvHP56oaHbqQoYJwFqng/I/bfvwzUqdUnytNgeezMyI2fvF7vnLPpM11F43wUqcmC+tNfbx/PLbz4CNpxwbmn+y0DsnQs03ShHPSPZzZHTX4SQ2k7yOqoHPR8VsA5g8fIXcYJeVggSG3zJWMB8a7o4r3UvDVfeOVkMj/IOdmwBRRBPiG+JAWNKuGJH6iiSuFN+hVKs7zwdSkLWgQgBNdo9Uss9cm1NGH/4nxYhuM2T+ZyLgq9DCo0TlHb+QvBaex22vGU/IYZobRxWjo2CudxO03rOh4fLzTgWziAbQKBgQD0c7vbg8hVKsuWSkMh/mfEGPIkLgVdVCbObCpMFdNvtevU6x1dS2tXokZ19xbx7xrS7vZgNqfJ9WVGo0OwcFZ4Y6alYCxnVqmtRzEgFyvfd3kHn5Rib7V11vi+viiKbmSIMmPNH9/xMmmp5HCNp57OP//RNtpiYDQ9jI7tpdltCwKBgQCUSBf3Gxrj2IWpoAqT9dT3+yXSS7OONWGpQrDn071o4kPhRjGq9fFYG5v3LcY9zJd70yz382cV4WOIiqDZxBGfYbe5JD31lX/eKZepGviZAsvF1Cp9urMgR+NahGrgfOHNfnr/r2dmTqORnTBnfQI1N7Ig0xAgY5akgy3vez7P7wKBgQCs9KnIwa/fWl0bI8Xl6ls+qqvAH3OaOe0PBgbTOGoV0vBeAFARb0gug9k4o69vU851ya82GdWTlfWnCeLdlk4H9fG1dptULkP1HrbKTrqy7JQMacMR9pm8G3J5eo+yijLFDmoAevn2bMXH96IPB7bblPqJ6zaOfiTYG3gQ+tQgSwKBgHbhwg0Edy+bRbZ0MGbl3iQe//i1ZrSqCa2JYYnMEfyIA4IWI/X8Ds3j/MxUr66WXBETguccB1bciE9NTZ6p+rL8xi6yZtaBUK4OTKBwlkUen77w1kxNJhXIbPgCWCm5FdQKBpT9zPmSLMOu8cLWz7FZAQAeF7zP+1PUNDzfY8GTAoGAQG79mbMSMpxpneuksIPPK0/w+LRAd1bsExXbIWqdO45rGITTpspv42mTICnX1vqbMPDJezPNyYJHhtR5n9rZziOepr3cG2oLvWdUftMatH058tP1VKEi5VH338ND59rgbJGru/nWnjFZ/GnBIpXaGT+itQoNvwZ8jd+of6oM/F8=";
-
-    /**
-     * 紫鸟浏览器 -> 紫鸟开放平台
-     * https://open.ziniao.com/manage
-     *
-     * 应用管理 -> 创建企业自建应用 ->
-     *      [应用] -> 权限管理 -> 接口权限申请 -> (权限名称:	AI图片) 开通权限
-     *      [应用] -> 应用首页 -> 配置IP白名单
-     */
-
-    /**
-     * [Method] 8.3.1.3 获取应用token
-     * https://open.ziniao.com/docSupport?docId=84#8.3.1.3%E8%8E%B7%E5%8F%96%E5%BA%94%E7%94%A8token27
-     */
-    public String getAppToken() {
-        OpenClient client = new OpenClient(url, appId, privateKeyIsv);
-        // 创建请求对象
-        AppTokenRequest request = new AppTokenRequest();
-        // 发送请求
-        CommonResponse response = client.execute(request);
-        if (response.isSuccess()) {
-            AppTokenResponse appTokenResponse = response.getDataObj(AppTokenResponse.class);
-            return appTokenResponse.getAppAuthToken();
-        } else {
-            throw new CustException(response.getErrorMsg());
-        }
-    }
-
-    public OpenClient getOpenClient() {
-        return new OpenClient(url, appId, privateKeyIsv);
-    }
-
-    /**
-     * 返回值 结构体
-     */
-    public JSONObject checkResponse(CommonResponse response) {
-        if (response.isSuccess()) {
-            // 返回结果
-            String data = response.getData();
-            JSONObject resp = JSONUtil.parseObj(data);
-            return resp;
-            //
-        } else {
-            System.out.println(response.getBody());
-            System.out.println(response.getErrorMsg());
-            throw new CustException(response.getErrorMsg());
-        }
-    }
-
-}
+//package com.backendsys.service.Ai.Aizn;
+//
+//import cn.hutool.json.JSONObject;
+//import cn.hutool.json.JSONUtil;
+//import com.backendsys.exception.CustException;
+//import com.fzzixun.openapi.sdk.client.OpenClient;
+//import com.fzzixun.openapi.sdk.request.AppTokenRequest;
+//import com.fzzixun.openapi.sdk.response.AppTokenResponse;
+//import com.fzzixun.openapi.sdk.response.CommonResponse;
+//import org.springframework.stereotype.Service;
+//
+//@Service
+//public class AiznServiceImpl implements AiznService{
+//
+//    private String url = "https://sbappstoreapi.ziniao.com";
+//    private String appId = "202404231232292775081406464";
+//    private String privateKeyIsv = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCNl8AKGVm9WnO67gEeLXeHKE2MBp16h0BKmHWrhdurM8uu1fIfRgR4K6AguE97mGqfCYBSad8cfP1dbrA529cZPXXFegl7tSBMxciK7i3kPTqPRS3sUbLQZHHdceoxWXDGA6oa3xxl3I6MuqMIO8vzYrdkY+A5h7sKY59tiYl3uq/mhJnq+FylkiQt3BLy7ATXVWFqMybAt6Pznawlaj2pbCVdSbM7hIKD8StgorAd9a7AnnstiJH7NmtppGS720qXeLHmgkse1hHf8gIel3nbi9iB7XAdC2iM8it425BuWaDb1y0SYZ7EZmhu8f45bsCxUJdd9QEC1dDR90pW0rJFAgMBAAECggEAUEB3VwIBTAJtX8CwH4OToKZmNXw2W5E3DlCVOQ9YbxOfWUvnvHP56oaHbqQoYJwFqng/I/bfvwzUqdUnytNgeezMyI2fvF7vnLPpM11F43wUqcmC+tNfbx/PLbz4CNpxwbmn+y0DsnQs03ShHPSPZzZHTX4SQ2k7yOqoHPR8VsA5g8fIXcYJeVggSG3zJWMB8a7o4r3UvDVfeOVkMj/IOdmwBRRBPiG+JAWNKuGJH6iiSuFN+hVKs7zwdSkLWgQgBNdo9Uss9cm1NGH/4nxYhuM2T+ZyLgq9DCo0TlHb+QvBaex22vGU/IYZobRxWjo2CudxO03rOh4fLzTgWziAbQKBgQD0c7vbg8hVKsuWSkMh/mfEGPIkLgVdVCbObCpMFdNvtevU6x1dS2tXokZ19xbx7xrS7vZgNqfJ9WVGo0OwcFZ4Y6alYCxnVqmtRzEgFyvfd3kHn5Rib7V11vi+viiKbmSIMmPNH9/xMmmp5HCNp57OP//RNtpiYDQ9jI7tpdltCwKBgQCUSBf3Gxrj2IWpoAqT9dT3+yXSS7OONWGpQrDn071o4kPhRjGq9fFYG5v3LcY9zJd70yz382cV4WOIiqDZxBGfYbe5JD31lX/eKZepGviZAsvF1Cp9urMgR+NahGrgfOHNfnr/r2dmTqORnTBnfQI1N7Ig0xAgY5akgy3vez7P7wKBgQCs9KnIwa/fWl0bI8Xl6ls+qqvAH3OaOe0PBgbTOGoV0vBeAFARb0gug9k4o69vU851ya82GdWTlfWnCeLdlk4H9fG1dptULkP1HrbKTrqy7JQMacMR9pm8G3J5eo+yijLFDmoAevn2bMXH96IPB7bblPqJ6zaOfiTYG3gQ+tQgSwKBgHbhwg0Edy+bRbZ0MGbl3iQe//i1ZrSqCa2JYYnMEfyIA4IWI/X8Ds3j/MxUr66WXBETguccB1bciE9NTZ6p+rL8xi6yZtaBUK4OTKBwlkUen77w1kxNJhXIbPgCWCm5FdQKBpT9zPmSLMOu8cLWz7FZAQAeF7zP+1PUNDzfY8GTAoGAQG79mbMSMpxpneuksIPPK0/w+LRAd1bsExXbIWqdO45rGITTpspv42mTICnX1vqbMPDJezPNyYJHhtR5n9rZziOepr3cG2oLvWdUftMatH058tP1VKEi5VH338ND59rgbJGru/nWnjFZ/GnBIpXaGT+itQoNvwZ8jd+of6oM/F8=";
+//
+//    /**
+//     * 紫鸟浏览器 -> 紫鸟开放平台
+//     * https://open.ziniao.com/manage
+//     *
+//     * 应用管理 -> 创建企业自建应用 ->
+//     *      [应用] -> 权限管理 -> 接口权限申请 -> (权限名称:	AI图片) 开通权限
+//     *      [应用] -> 应用首页 -> 配置IP白名单
+//     */
+//
+//    /**
+//     * [Method] 8.3.1.3 获取应用token
+//     * https://open.ziniao.com/docSupport?docId=84#8.3.1.3%E8%8E%B7%E5%8F%96%E5%BA%94%E7%94%A8token27
+//     */
+//    public String getAppToken() {
+//        OpenClient client = new OpenClient(url, appId, privateKeyIsv);
+//        // 创建请求对象
+//        AppTokenRequest request = new AppTokenRequest();
+//        // 发送请求
+//        CommonResponse response = client.execute(request);
+//        if (response.isSuccess()) {
+//            AppTokenResponse appTokenResponse = response.getDataObj(AppTokenResponse.class);
+//            return appTokenResponse.getAppAuthToken();
+//        } else {
+//            throw new CustException(response.getErrorMsg());
+//        }
+//    }
+//
+//    public OpenClient getOpenClient() {
+//        return new OpenClient(url, appId, privateKeyIsv);
+//    }
+//
+//    /**
+//     * 返回值 结构体
+//     */
+//    public JSONObject checkResponse(CommonResponse response) {
+//        if (response.isSuccess()) {
+//            // 返回结果
+//            String data = response.getData();
+//            JSONObject resp = JSONUtil.parseObj(data);
+//            return resp;
+//            //
+//        } else {
+//            System.out.println(response.getBody());
+//            System.out.println(response.getErrorMsg());
+//            throw new CustException(response.getErrorMsg());
+//        }
+//    }
+//
+//}