From 88ce1919506e0ae367697967afab6896aa1d4d45 Mon Sep 17 00:00:00 2001 From: xupei Date: Fri, 14 Nov 2025 14:51:30 +0800 Subject: [PATCH] =?UTF-8?q?TASK:1.=E8=AE=A2=E9=98=85=E6=88=90=E5=8A=9F?= =?UTF-8?q?=E5=92=8C=E7=BB=AD=E7=AD=BE=E6=88=90=E5=8A=9F=EF=BC=8C=E9=80=9A?= =?UTF-8?q?=E7=9F=A5=E5=95=86=E5=AE=B6=E7=9A=84=E9=82=AE=E4=BB=B6=E4=B8=AD?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=82=AE=E4=BB=B6=E5=92=8C=E5=9B=BD=E5=AE=B6?= =?UTF-8?q?=202.=E5=9C=A8getModuleContent=E7=9A=84=E5=9B=9E=E5=8F=82?= =?UTF-8?q?=E4=B8=AD=E6=B7=BB=E5=8A=A0motion=E7=9B=B8=E5=85=B3=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=203.=E4=BF=AE=E6=94=B9Affiliate=E8=B4=A6=E5=8F=B7?= =?UTF-8?q?=E7=8A=B6=E6=80=81=E4=B8=8E=E4=BF=AE=E6=94=B9=E4=BD=A3=E9=87=91?= =?UTF-8?q?=E6=AF=94=E4=BE=8B=E6=8E=A5=E5=8F=A3=E5=90=88=E5=B9=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ai/da/controller/AffiliateController.java | 27 +++++++------- .../controller/SavedCollectionController.java | 8 +++- .../primary/entity/ToProductElement.java | 5 ++- .../model/dto/SubscriptionEmailParamsDTO.java | 6 +++ .../ai/da/model/vo/PoseTransformationVO.java | 4 ++ .../com/ai/da/service/AffiliateService.java | 4 +- .../java/com/ai/da/service/StripeService.java | 2 + .../ai/da/service/UserLikeGroupService.java | 2 +- .../da/service/impl/AffiliateServiceImpl.java | 37 ++++++++----------- .../da/service/impl/GenerateServiceImpl.java | 7 +++- .../ai/da/service/impl/StripeServiceImpl.java | 2 + .../impl/UserLikeGroupServiceImpl.java | 6 ++- 12 files changed, 64 insertions(+), 46 deletions(-) diff --git a/src/main/java/com/ai/da/controller/AffiliateController.java b/src/main/java/com/ai/da/controller/AffiliateController.java index 0e7701b2..0c839d2f 100644 --- a/src/main/java/com/ai/da/controller/AffiliateController.java +++ b/src/main/java/com/ai/da/controller/AffiliateController.java @@ -14,6 +14,7 @@ import com.ai.da.service.ReferralService; import com.baomidou.mybatisplus.core.metadata.IPage; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; +import io.swagger.annotations.ApiParam; import lombok.extern.slf4j.Slf4j; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -55,22 +56,27 @@ public class AffiliateController { @ApiOperation(value = "获取个人佣金图表数据") @GetMapping("/getPersonalMonthlyIncome") - public Response getPersonalMonthlyIncome(@RequestParam("year")int year) { + public Response getPersonalMonthlyIncome(@RequestParam("year") int year) { return Response.success(affiliateService.getPersonalMonthlyIncome(year)); } @ApiOperation(value = "审批affiliate申请") @GetMapping("/approval") public Response applicationApproval(@RequestParam("id") Long id, - @RequestParam("isApproved")Boolean isApproved, + @RequestParam("isApproved") Boolean isApproved, @RequestParam(value = "commission", required = false) Float commission) { return Response.success(affiliateService.applicationApproval(id, isApproved, commission)); } - @ApiOperation(value = "更新佣金比例") - @GetMapping("/updateCommission") - public Response updateCommissionPercentage(@RequestParam("id") Long id, @RequestParam("commission") Float commission) { - affiliateService.updateCommissionPercentage(id, commission); + @ApiOperation(value = "编辑affiliate") + @GetMapping("/editAffiliate") + public Response editAffiliate(@RequestParam("id") Long id, + @ApiParam(value = "佣金比例", example = "25") + @RequestParam(value = "commission", required = false) Float commission, + @ApiParam(value = "操作类型", example = "Active", + allowableValues = "Active,Inactive,Delete") + @RequestParam(value = "operationType", required = false) String operationType) { + affiliateService.editAffiliate(id, commission, operationType); return Response.success("success"); } @@ -122,15 +128,8 @@ public class AffiliateController { @ApiOperation(value = "获取所有affiliate用户名") @GetMapping("/getAllAffiliateUsername") - public Response>> getAllAffiliateUsername() { + public Response>> getAllAffiliateUsername() { return Response.success(affiliateService.getAllAffiliateUsername()); } - @ApiOperation(value = "修改affiliate状态,Active | Inactive | Delete") - @GetMapping("/modifyAffiliateStatus") - public Response modifyAffiliateStatus(@RequestParam Long affiliateId, @RequestParam String operationType) { - affiliateService.modifyAffiliateStatus(affiliateId, operationType); - return Response.success(); - } - } diff --git a/src/main/java/com/ai/da/controller/SavedCollectionController.java b/src/main/java/com/ai/da/controller/SavedCollectionController.java index 4bc6a939..ab26f09d 100644 --- a/src/main/java/com/ai/da/controller/SavedCollectionController.java +++ b/src/main/java/com/ai/da/controller/SavedCollectionController.java @@ -197,8 +197,12 @@ public class SavedCollectionController { @ApiOperation(value = "toProductImageElementUpload") @PostMapping("/toProductImageElementUpload") - public Response toProductImageElementUpload(@RequestParam("file") MultipartFile file, @RequestParam(value = "projectId", required = false) Long projectId) { - return Response.success(userLikeGroupService.toProductImageElementUpload(file, projectId)); + public Response toProductImageElementUpload(@RequestParam("file") MultipartFile file, + @RequestParam(value = "projectId", required = false) Long projectId, + @ApiParam(value = "首尾帧", example = "first", + allowableValues = "first,last") + @RequestParam(value = "type", required = false) String type) { + return Response.success(userLikeGroupService.toProductImageElementUpload(file, projectId, type)); } @ApiOperation(value = "toProductImageElementDelete") diff --git a/src/main/java/com/ai/da/mapper/primary/entity/ToProductElement.java b/src/main/java/com/ai/da/mapper/primary/entity/ToProductElement.java index 1c48b589..6efe5545 100644 --- a/src/main/java/com/ai/da/mapper/primary/entity/ToProductElement.java +++ b/src/main/java/com/ai/da/mapper/primary/entity/ToProductElement.java @@ -19,12 +19,15 @@ public class ToProductElement implements Serializable { @ApiModelProperty(value = "userLikeGroupId") private Long userLikeGroupId; + @ApiModelProperty(value = "项目id") private Long projectId; @ApiModelProperty(value = "url") private String url; -// private String type; + @ApiModelProperty(value = "首尾帧 first | last") + private String frameType; + @ApiModelProperty(value = "createTime") private LocalDateTime createTime; } diff --git a/src/main/java/com/ai/da/model/dto/SubscriptionEmailParamsDTO.java b/src/main/java/com/ai/da/model/dto/SubscriptionEmailParamsDTO.java index 0e8ef223..b6064d5f 100644 --- a/src/main/java/com/ai/da/model/dto/SubscriptionEmailParamsDTO.java +++ b/src/main/java/com/ai/da/model/dto/SubscriptionEmailParamsDTO.java @@ -7,6 +7,12 @@ public class SubscriptionEmailParamsDTO { // 用户名 private String username; + // 用户邮箱 + private String email; + + // 国家 + private String country; + // t_payment_info id(每次支付对于用户来说是一笔新订单) private String orderId; diff --git a/src/main/java/com/ai/da/model/vo/PoseTransformationVO.java b/src/main/java/com/ai/da/model/vo/PoseTransformationVO.java index d5a28a77..0bd59348 100644 --- a/src/main/java/com/ai/da/model/vo/PoseTransformationVO.java +++ b/src/main/java/com/ai/da/model/vo/PoseTransformationVO.java @@ -15,6 +15,8 @@ public class PoseTransformationVO implements AllCollectionVO{ private String productImage; + private String lastFrameProductImage; + private String gifUrl; private String videoUrl; @@ -38,6 +40,8 @@ public class PoseTransformationVO implements AllCollectionVO{ private int poseId; + private String prompt; + public PoseTransformationVO(Long id, String taskId, String gifUrl, String videoUrl, String firstFrameUrl, byte isLiked, String status) { this.id = id; this.taskId = taskId; diff --git a/src/main/java/com/ai/da/service/AffiliateService.java b/src/main/java/com/ai/da/service/AffiliateService.java index 739d7364..ae816078 100644 --- a/src/main/java/com/ai/da/service/AffiliateService.java +++ b/src/main/java/com/ai/da/service/AffiliateService.java @@ -24,7 +24,7 @@ public interface AffiliateService extends IService { Boolean applicationApproval(Long id, Boolean isApproved, Float commission); - void updateCommissionPercentage(Long id, Float commission); + void editAffiliate(Long id, Float commission, String operationType); void updateAffiliateInfoWithPayment(); @@ -41,6 +41,4 @@ public interface AffiliateService extends IService { void calcCouponsCommission(); List> getAllAffiliateUsername(); - - void modifyAffiliateStatus(Long affiliateId, String operationType); } diff --git a/src/main/java/com/ai/da/service/StripeService.java b/src/main/java/com/ai/da/service/StripeService.java index 4ab7b2b9..673bc530 100644 --- a/src/main/java/com/ai/da/service/StripeService.java +++ b/src/main/java/com/ai/da/service/StripeService.java @@ -35,6 +35,8 @@ public interface StripeService { Map getPaymentMethod(String paymentMethodId); + boolean sendEmail(String subscriptionId, String type, String orderNo); + /*void updateSubscription(String subscriptionId); void resume(String subscriptionId);*/ diff --git a/src/main/java/com/ai/da/service/UserLikeGroupService.java b/src/main/java/com/ai/da/service/UserLikeGroupService.java index 55eb1f39..9db9f0fa 100644 --- a/src/main/java/com/ai/da/service/UserLikeGroupService.java +++ b/src/main/java/com/ai/da/service/UserLikeGroupService.java @@ -50,7 +50,7 @@ public interface UserLikeGroupService extends IService { void toProduct(String taskId); - ToProductElementVO toProductImageElementUpload(MultipartFile file, Long projectId); + ToProductElementVO toProductImageElementUpload(MultipartFile file, Long projectId, String type); CollectionSort productImageLike(ProductImageLikeDTO productImageLikeDTO); diff --git a/src/main/java/com/ai/da/service/impl/AffiliateServiceImpl.java b/src/main/java/com/ai/da/service/impl/AffiliateServiceImpl.java index ff2bb316..f54a488f 100644 --- a/src/main/java/com/ai/da/service/impl/AffiliateServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/AffiliateServiceImpl.java @@ -200,7 +200,7 @@ public class AffiliateServiceImpl extends ServiceImpl 激活 | Inactive -> 关闭 | Delete -> 删除 + if (!StringUtil.isNullOrEmpty(operationType)) { + if (operationType.equals("Delete")) { + baseMapper.deleteById(id); + return; + } else if (operationType.equals("Active") || operationType.equals("Inactive")) { + affiliate.setStatus(operationType); + } else { + throw new BusinessException("unknown.operationType"); + } + } + affiliate.setUpdateTime(LocalDateTime.now()); + baseMapper.updateById(affiliate); } // 定时计算佣金 @@ -554,23 +566,4 @@ public class AffiliateServiceImpl extends ServiceImpl 激活 | Inactive -> 关闭 | Delete -> 删除 - @Override - public void modifyAffiliateStatus(Long affiliateId, String operationType) { - Affiliate affiliate = baseMapper.selectById(affiliateId); - if (Objects.isNull(affiliate)) { - throw new BusinessException("unknow.affiliate"); - } - - if (operationType.equals("Delete")) { - affiliate.setIsDeleted(1); - } else if (operationType.equals("Active") || operationType.equals("Inactive")) { - affiliate.setStatus(operationType); - } else { - throw new BusinessException("unknown.operationType"); - } - - updateById(affiliate); - } - } diff --git a/src/main/java/com/ai/da/service/impl/GenerateServiceImpl.java b/src/main/java/com/ai/da/service/impl/GenerateServiceImpl.java index 86a379f6..93c7cbc1 100644 --- a/src/main/java/com/ai/da/service/impl/GenerateServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/GenerateServiceImpl.java @@ -2673,11 +2673,16 @@ public class GenerateServiceImpl extends ServiceImpl i vo = CopyUtil.copyObject(dbItem, PoseTransformationVO.class); vo.setTaskId(taskId); - // 设置产品图片URL + // 设置产品图片URL(首帧) if (dbItem.getProductImage() != null) { vo.setProductImage(minioUtil.getPreSignedUrl( dbItem.getProductImage(), CommonConstant.MINIO_IMAGE_EXPIRE_TIME)); } + // 设置产品图片URL(尾帧) + if (dbItem.getLastFrameProductImage() != null) { + vo.setLastFrameProductImage(minioUtil.getPreSignedUrl( + dbItem.getLastFrameProductImage(), CommonConstant.MINIO_IMAGE_EXPIRE_TIME)); + } // 如果视频URL为空,直接返回 if (StringUtil.isNullOrEmpty(dbItem.getVideoUrl())) { diff --git a/src/main/java/com/ai/da/service/impl/StripeServiceImpl.java b/src/main/java/com/ai/da/service/impl/StripeServiceImpl.java index a4c133ff..a580b0ed 100644 --- a/src/main/java/com/ai/da/service/impl/StripeServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/StripeServiceImpl.java @@ -1085,6 +1085,8 @@ public class StripeServiceImpl implements StripeService { SubscriptionEmailParamsDTO emailParamsDTO = new SubscriptionEmailParamsDTO(); emailParamsDTO.setUsername(userName); + emailParamsDTO.setEmail(account.getUserEmail()); + emailParamsDTO.setCountry(paymentInfo.getCountry()); emailParamsDTO.setOrderId(paymentInfo.getId().toString()); emailParamsDTO.setOrderRef("\"" + orderListLink + paymentInfo.getId().toString() + "\""); emailParamsDTO.setCreateDate(String.valueOf(paymentInfo.getCreateTime()).replace("T", " ")); diff --git a/src/main/java/com/ai/da/service/impl/UserLikeGroupServiceImpl.java b/src/main/java/com/ai/da/service/impl/UserLikeGroupServiceImpl.java index 1f0fdc37..9506e816 100644 --- a/src/main/java/com/ai/da/service/impl/UserLikeGroupServiceImpl.java +++ b/src/main/java/com/ai/da/service/impl/UserLikeGroupServiceImpl.java @@ -739,7 +739,7 @@ public class UserLikeGroupServiceImpl extends ServiceImpl