diff --git a/continew-admin-business/src/main/java/top/continew/admin/business/model/entity/Copyright.java b/continew-admin-business/src/main/java/top/continew/admin/business/model/entity/Copyright.java index b3b672a..97ebbd5 100644 --- a/continew-admin-business/src/main/java/top/continew/admin/business/model/entity/Copyright.java +++ b/continew-admin-business/src/main/java/top/continew/admin/business/model/entity/Copyright.java @@ -5,8 +5,6 @@ import lombok.Data; import lombok.EqualsAndHashCode; import top.continew.starter.extension.crud.model.entity.BaseDO; -import java.time.LocalDateTime; - /** * 数字人-文案实体类 * diff --git a/continew-admin-business/src/main/java/top/continew/admin/business/model/req/DigitalHumanReq.java b/continew-admin-business/src/main/java/top/continew/admin/business/model/req/DigitalHumanReq.java index d53148c..3527723 100644 --- a/continew-admin-business/src/main/java/top/continew/admin/business/model/req/DigitalHumanReq.java +++ b/continew-admin-business/src/main/java/top/continew/admin/business/model/req/DigitalHumanReq.java @@ -39,19 +39,18 @@ public class DigitalHumanReq extends BaseReq { */ private String generatedVideoUrl; - -// /** -// * 字幕项列表(冗余存储,用于快速回显) -// */ -// private String subtitle; -// -// /** -// * 字幕样式配置(冗余或快照) -// */ -// private String subtitleStyle; -// -// /** -// * 特效列表(冗余存储) -// */ -// private String effects; + // /** + // * 字幕项列表(冗余存储,用于快速回显) + // */ + // private String subtitle; + // + // /** + // * 字幕样式配置(冗余或快照) + // */ + // private String subtitleStyle; + // + // /** + // * 特效列表(冗余存储) + // */ + // private String effects; } \ No newline at end of file diff --git a/continew-admin-business/src/main/java/top/continew/admin/business/model/resp/DigitalHumanResp.java b/continew-admin-business/src/main/java/top/continew/admin/business/model/resp/DigitalHumanResp.java index c81d6d7..598e892 100644 --- a/continew-admin-business/src/main/java/top/continew/admin/business/model/resp/DigitalHumanResp.java +++ b/continew-admin-business/src/main/java/top/continew/admin/business/model/resp/DigitalHumanResp.java @@ -49,20 +49,20 @@ public class DigitalHumanResp extends BaseResp { */ private String generatedVideoUrl; -// /** -// * 字幕项列表(冗余存储,用于快速回显) -// */ -// private String subtitle; -// -// /** -// * 字幕样式配置(冗余或快照) -// */ -// private String subtitleStyle; -// -// /** -// * 特效列表(冗余存储) -// */ -// private String effects; + // /** + // * 字幕项列表(冗余存储,用于快速回显) + // */ + // private String subtitle; + // + // /** + // * 字幕样式配置(冗余或快照) + // */ + // private String subtitleStyle; + // + // /** + // * 特效列表(冗余存储) + // */ + // private String effects; /** * 创建时间 diff --git a/continew-admin-business/src/main/java/top/continew/admin/business/service/EffectService.java b/continew-admin-business/src/main/java/top/continew/admin/business/service/EffectService.java index 68d948c..a9daba4 100644 --- a/continew-admin-business/src/main/java/top/continew/admin/business/service/EffectService.java +++ b/continew-admin-business/src/main/java/top/continew/admin/business/service/EffectService.java @@ -17,4 +17,6 @@ import top.continew.starter.extension.crud.service.BaseService; public interface EffectService extends BaseService { PageResp pageList(EffectQuery query, EffectPageQuery pageQuery); // 可根据需要添加额外的业务方法 + + void update(EffectReq req, Long id); } \ No newline at end of file diff --git a/continew-admin-business/src/main/java/top/continew/admin/business/service/impl/BillingServiceImpl.java b/continew-admin-business/src/main/java/top/continew/admin/business/service/impl/BillingServiceImpl.java index ddb5827..5793328 100644 --- a/continew-admin-business/src/main/java/top/continew/admin/business/service/impl/BillingServiceImpl.java +++ b/continew-admin-business/src/main/java/top/continew/admin/business/service/impl/BillingServiceImpl.java @@ -532,6 +532,11 @@ public class BillingServiceImpl implements BillingService { private void addTaskRecordHistory(TaskRecordHistoryDO taskRecord, TaskCallbackReq req) { String fileStr = req.getFileUrl(); + // 检查fileUrl是否为空,为空则直接插入记录 + if (StrUtil.isEmpty(fileStr)) { + taskRecordHistoryMapper.insert(taskRecord); + return; + } //先下载文件 List fileUrls = Arrays.asList(fileStr.split(",")); if (!fileUrls.isEmpty()) { diff --git a/continew-admin-business/src/main/java/top/continew/admin/business/service/impl/CopyrightServiceImpl.java b/continew-admin-business/src/main/java/top/continew/admin/business/service/impl/CopyrightServiceImpl.java index c0cbcba..4bf9112 100644 --- a/continew-admin-business/src/main/java/top/continew/admin/business/service/impl/CopyrightServiceImpl.java +++ b/continew-admin-business/src/main/java/top/continew/admin/business/service/impl/CopyrightServiceImpl.java @@ -41,7 +41,6 @@ public class CopyrightServiceImpl extends BaseServiceImpl page = new Page<>(pageQuery.getPage(), pageQuery.getSize()); Page result = copyrightMapper.selectPage(page, wrapper); diff --git a/continew-admin-business/src/main/java/top/continew/admin/business/service/impl/DigitalHumanServiceImpl.java b/continew-admin-business/src/main/java/top/continew/admin/business/service/impl/DigitalHumanServiceImpl.java index 9b3796f..8c1c121 100644 --- a/continew-admin-business/src/main/java/top/continew/admin/business/service/impl/DigitalHumanServiceImpl.java +++ b/continew-admin-business/src/main/java/top/continew/admin/business/service/impl/DigitalHumanServiceImpl.java @@ -1,10 +1,8 @@ package top.continew.admin.business.service.impl; import cn.crane4j.core.util.CollectionUtils; -import cn.dev33.satoken.stp.StpUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import jodd.util.CollectionUtil; import lombok.RequiredArgsConstructor; import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Service; @@ -19,7 +17,6 @@ import top.continew.admin.business.model.req.DigitalHumanReq; import top.continew.admin.business.model.resp.DigitalHumanDetailResp; import top.continew.admin.business.model.resp.DigitalHumanResp; import top.continew.admin.business.service.DigitalHumanService; -import top.continew.admin.common.util.helper.LoginHelper; import top.continew.starter.extension.crud.model.resp.PageResp; import top.continew.starter.extension.crud.service.impl.BaseServiceImpl; @@ -111,14 +108,26 @@ public class DigitalHumanServiceImpl extends BaseServiceImpl subtitleStyles = subtitleStyleMapper.selectList(new LambdaQueryWrapper().eq(SubtitleStyle::getDigitalHumanId, digitalHuman.getId())); - resp.setSubtitleStyle(CollectionUtils.isNotEmpty(subtitleStyles)? subtitleStyles.get(0) : null); - resp.setEffects(effectMapper.selectList(new LambdaQueryWrapper().eq(Effect::getDigitalHumanId, digitalHuman.getId()))); - resp.setSubtitles(subtitleItemMapper.selectList(new LambdaQueryWrapper().eq(SubtitleItem::getDigitalHumanId, digitalHuman.getId()))); + List subtitleStyles = subtitleStyleMapper.selectList(new LambdaQueryWrapper() + .eq(SubtitleStyle::getDigitalHumanId, digitalHuman.getId())); + resp.setSubtitleStyle(CollectionUtils.isNotEmpty(subtitleStyles) ? subtitleStyles.get(0) : null); + resp.setEffects(effectMapper.selectList(new LambdaQueryWrapper() + .eq(Effect::getDigitalHumanId, digitalHuman.getId()))); + resp.setSubtitles(subtitleItemMapper.selectList(new LambdaQueryWrapper() + .eq(SubtitleItem::getDigitalHumanId, digitalHuman.getId()))); return resp; } } \ No newline at end of file diff --git a/continew-admin-business/src/main/java/top/continew/admin/business/service/impl/EffectServiceImpl.java b/continew-admin-business/src/main/java/top/continew/admin/business/service/impl/EffectServiceImpl.java index f42e45e..8469391 100644 --- a/continew-admin-business/src/main/java/top/continew/admin/business/service/impl/EffectServiceImpl.java +++ b/continew-admin-business/src/main/java/top/continew/admin/business/service/impl/EffectServiceImpl.java @@ -6,7 +6,6 @@ import lombok.RequiredArgsConstructor; import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Service; import top.continew.admin.business.mapper.EffectMapper; -import top.continew.admin.business.model.entity.DigitalHuman; import top.continew.admin.business.model.entity.Effect; import top.continew.admin.business.model.query.EffectPageQuery; import top.continew.admin.business.model.query.EffectQuery; @@ -71,4 +70,13 @@ public class EffectServiceImpl extends BaseServiceImpl { + @Log + @Operation(summary = "更新数字人任务", description = "更新数字人任务信息") + @PutMapping("/{id}") + public Boolean updateDigitalHuman(@RequestBody DigitalHumanReq req, @PathVariable Long id) { + baseService.update(req, id); + return true; + } + @Log @Operation(summary = "查询数字人任务", description = "查询数字人任务列表") @ResponseBody diff --git a/continew-admin-webapi/src/main/java/top/continew/admin/controller/business/EffectController.java b/continew-admin-webapi/src/main/java/top/continew/admin/controller/business/EffectController.java index 4c7c860..c9f6a67 100644 --- a/continew-admin-webapi/src/main/java/top/continew/admin/controller/business/EffectController.java +++ b/continew-admin-webapi/src/main/java/top/continew/admin/controller/business/EffectController.java @@ -32,9 +32,17 @@ import java.util.stream.Collectors; @Tag(name = "数字人-特效管理 API") @RestController @RequiredArgsConstructor -@CrudRequestMapping(value = "/business/effect", api = {Api.GET, Api.UPDATE, Api.LIST}) +@CrudRequestMapping(value = "/business/effect", api = {Api.GET, Api.LIST}) public class EffectController extends BaseController { + @Log + @Operation(summary = "更新特效", description = "更新特效信息") + @PutMapping("/{id}") + public Boolean updateEffect(@RequestBody EffectReq req, @PathVariable Long id) { + baseService.update(req, id); + return true; + } + @Log @Operation(summary = "查询特效", description = "查询特效列表") @ResponseBody diff --git a/continew-admin-webapi/src/main/java/top/continew/admin/controller/business/EffectTemplateController.java b/continew-admin-webapi/src/main/java/top/continew/admin/controller/business/EffectTemplateController.java index 5e164e0..0f73905 100644 --- a/continew-admin-webapi/src/main/java/top/continew/admin/controller/business/EffectTemplateController.java +++ b/continew-admin-webapi/src/main/java/top/continew/admin/controller/business/EffectTemplateController.java @@ -32,9 +32,17 @@ import java.util.stream.Collectors; @Tag(name = "数字人-特效模板管理 API") @RestController @RequiredArgsConstructor -@CrudRequestMapping(value = "/business/effectTemplate", api = {Api.GET, Api.UPDATE, Api.LIST}) +@CrudRequestMapping(value = "/business/effectTemplate", api = {Api.GET, Api.LIST}) public class EffectTemplateController extends BaseController { + @Log + @Operation(summary = "更新特效模板", description = "更新特效模板信息") + @PutMapping("/{id}") + public Boolean updateEffectTemplate(@RequestBody EffectTemplateReq req, @PathVariable Long id) { + baseService.update(req, id); + return true; + } + @Log @ResponseBody @Operation(summary = "新增特效模板", description = "新增特效模板") diff --git a/continew-admin-webapi/src/main/java/top/continew/admin/controller/business/SubtitleItemController.java b/continew-admin-webapi/src/main/java/top/continew/admin/controller/business/SubtitleItemController.java index 5e3c500..05ee107 100644 --- a/continew-admin-webapi/src/main/java/top/continew/admin/controller/business/SubtitleItemController.java +++ b/continew-admin-webapi/src/main/java/top/continew/admin/controller/business/SubtitleItemController.java @@ -32,9 +32,17 @@ import java.util.stream.Collectors; @Tag(name = "数字人-字幕项管理 API") @RestController @RequiredArgsConstructor -@CrudRequestMapping(value = "/business/subtitleItem", api = {Api.GET, Api.UPDATE, Api.LIST}) +@CrudRequestMapping(value = "/business/subtitleItem", api = {Api.GET, Api.LIST}) public class SubtitleItemController extends BaseController { + @Log + @Operation(summary = "更新字幕项", description = "更新字幕项信息") + @PutMapping("/{id}") + public Boolean updateSubtitleItem(@RequestBody SubtitleItemReq req, @PathVariable Long id) { + baseService.update(req, id); + return true; + } + @Log @Operation(summary = "查询字幕项", description = "查询字幕项列表") @ResponseBody diff --git a/continew-admin-webapi/src/main/java/top/continew/admin/controller/business/SubtitleStyleController.java b/continew-admin-webapi/src/main/java/top/continew/admin/controller/business/SubtitleStyleController.java new file mode 100644 index 0000000..fcff8c2 --- /dev/null +++ b/continew-admin-webapi/src/main/java/top/continew/admin/controller/business/SubtitleStyleController.java @@ -0,0 +1,84 @@ +package top.continew.admin.controller.business; + +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import lombok.RequiredArgsConstructor; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import top.continew.admin.business.model.query.SubtitleStylePageQuery; +import top.continew.admin.business.model.query.SubtitleStyleQuery; +import top.continew.admin.business.model.req.BatchReq; +import top.continew.admin.business.model.req.SubtitleStyleReq; +import top.continew.admin.business.model.resp.SubtitleStyleDetailResp; +import top.continew.admin.business.model.resp.SubtitleStyleResp; +import top.continew.admin.business.service.SubtitleStyleService; +import top.continew.starter.extension.crud.annotation.CrudRequestMapping; +import top.continew.starter.extension.crud.controller.BaseController; +import top.continew.starter.extension.crud.enums.Api; +import top.continew.starter.extension.crud.model.query.SortQuery; +import top.continew.starter.extension.crud.model.resp.PageResp; +import top.continew.starter.log.core.annotation.Log; + +import java.util.Arrays; +import java.util.List; +import java.util.stream.Collectors; + +/** + * 数字人-字幕样式管理 API + * + * @author 王志维 + * @since 2025/12/29 + */ +@Tag(name = "数字人-字幕样式管理 API") +@RestController +@RequiredArgsConstructor +@CrudRequestMapping(value = "/business/subtitleStyle", api = {Api.GET, Api.LIST}) +public class SubtitleStyleController extends BaseController { + + @Log + @Operation(summary = "更新字幕样式", description = "更新字幕样式信息") + @PutMapping("/{id}") + public Boolean updateSubtitleStyle(@RequestBody SubtitleStyleReq req, @PathVariable Long id) { + baseService.update(req, id); + return true; + } + + @Log + @Operation(summary = "查询字幕样式", description = "查询字幕样式列表") + @ResponseBody + @GetMapping({"/list"}) + public List list(SubtitleStyleQuery query, SortQuery sortQuery) { + return baseService.list(query, sortQuery); + } + + @Log + @ResponseBody + @Operation(summary = "新增字幕样式", description = "新增字幕样式") + @PostMapping() + public Long addSubtitleStyle(@RequestBody SubtitleStyleReq req) { + return baseService.add(req); + } + + @Log + @Operation(summary = "分页查询字幕样式", description = "分页查询字幕样式列表") + @ResponseBody + @GetMapping({"/page"}) + public PageResp page(SubtitleStyleQuery query, SubtitleStylePageQuery pageQuery) { + return baseService.pageList(query, pageQuery); + } + + @Log + @Operation(summary = "批量删除字幕样式", description = "根据字幕样式ID列表批量删除字幕样式") + @PostMapping("/batchDelete") + public void deleteBatch(@Validated @RequestBody BatchReq req) { + baseService.delete(req.getIds()); + } + + @Log + @Operation(summary = "批量删除字幕样式(通过路径参数)", description = "根据路径中的ID列表批量删除字幕样式,ID以逗号分隔") + @DeleteMapping("/{ids}") + public void delete(@PathVariable("ids") String ids) { + List idList = Arrays.stream(ids.split(",")).map(Long::valueOf).collect(Collectors.toList()); + baseService.delete(idList); + } +} \ No newline at end of file