Преглед изворни кода

feat: 添加小程序内容管理

luofeiyun пре 1 месец
родитељ
комит
38b25957e5
19 измењених фајлова са 27 додато и 622 уклоњено
  1. 5 27
      ship-module-miniapplet/src/main/java/com/yc/ship/module/miniapplet/controller/admin/catalogue/CatalogueController.java
  2. 0 34
      ship-module-miniapplet/src/main/java/com/yc/ship/module/miniapplet/controller/admin/catalogue/detail/CatalogueDetailPageReqVO.java
  3. 0 30
      ship-module-miniapplet/src/main/java/com/yc/ship/module/miniapplet/controller/admin/catalogue/detail/CatalogueDetailRespVO.java
  4. 0 22
      ship-module-miniapplet/src/main/java/com/yc/ship/module/miniapplet/controller/admin/catalogue/detail/CatalogueDetailSaveReqVO.java
  5. 0 9
      ship-module-miniapplet/src/main/java/com/yc/ship/module/miniapplet/controller/admin/catalogue/vo/CataloguePageReqVO.java
  6. 0 27
      ship-module-miniapplet/src/main/java/com/yc/ship/module/miniapplet/controller/admin/catalogue/vo/CatalogueRespVO.java
  7. 0 25
      ship-module-miniapplet/src/main/java/com/yc/ship/module/miniapplet/controller/admin/catalogue/vo/CatalogueSaveReqVO.java
  8. 0 4
      ship-module-miniapplet/src/main/java/com/yc/ship/module/miniapplet/controller/admin/catalogue/vo/CatalogueSimpleRespVO.java
  9. 1 38
      ship-module-miniapplet/src/main/java/com/yc/ship/module/miniapplet/controller/admin/content/ContentController.java
  10. 3 21
      ship-module-miniapplet/src/main/java/com/yc/ship/module/miniapplet/controller/app/content/AppContentController.java
  11. 3 28
      ship-module-miniapplet/src/main/java/com/yc/ship/module/miniapplet/dal/dataobject/catalogue/CatalogueDO.java
  12. 0 42
      ship-module-miniapplet/src/main/java/com/yc/ship/module/miniapplet/dal/dataobject/cataloguedetail/CatalogueDetailDO.java
  13. 2 1
      ship-module-miniapplet/src/main/java/com/yc/ship/module/miniapplet/dal/dataobject/content/ContentDO.java
  14. 3 19
      ship-module-miniapplet/src/main/java/com/yc/ship/module/miniapplet/dal/mysql/catalogue/CatalogueMapper.java
  15. 0 35
      ship-module-miniapplet/src/main/java/com/yc/ship/module/miniapplet/dal/mysql/cataloguedetail/CatalogueDetailMapper.java
  16. 2 12
      ship-module-miniapplet/src/main/java/com/yc/ship/module/miniapplet/service/catalogue/CatalogueService.java
  17. 8 102
      ship-module-miniapplet/src/main/java/com/yc/ship/module/miniapplet/service/catalogue/CatalogueServiceImpl.java
  18. 0 65
      ship-module-miniapplet/src/main/java/com/yc/ship/module/miniapplet/service/cataloguedetail/CatalogueDetailService.java
  19. 0 81
      ship-module-miniapplet/src/main/java/com/yc/ship/module/miniapplet/service/cataloguedetail/CatalogueDetailServiceImpl.java

+ 5 - 27
ship-module-miniapplet/src/main/java/com/yc/ship/module/miniapplet/controller/admin/catalogue/CatalogueController.java

@@ -7,7 +7,6 @@ import com.yc.ship.framework.common.util.collection.CollectionUtils;
 import com.yc.ship.framework.common.util.object.BeanUtils;
 import com.yc.ship.framework.excel.core.util.ExcelUtils;
 import com.yc.ship.framework.operatelog.core.annotations.OperateLog;
-import com.yc.ship.module.miniapplet.controller.admin.catalogue.detail.CatalogueDetailRespVO;
 import com.yc.ship.module.miniapplet.controller.admin.catalogue.vo.CataloguePageReqVO;
 import com.yc.ship.module.miniapplet.controller.admin.catalogue.vo.CatalogueRespVO;
 import com.yc.ship.module.miniapplet.controller.admin.catalogue.vo.CatalogueSaveReqVO;
@@ -18,7 +17,6 @@ import com.yc.ship.module.miniapplet.service.catalogue.CatalogueService;
 import io.swagger.v3.oas.annotations.Operation;
 import io.swagger.v3.oas.annotations.Parameter;
 import io.swagger.v3.oas.annotations.tags.Tag;
-import org.apache.commons.lang3.StringUtils;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
@@ -36,7 +34,7 @@ import static com.yc.ship.framework.operatelog.core.enums.OperateTypeEnum.EXPORT
 
 @Tag(name = "管理后台 - 目录类型")
 @RestController
-@RequestMapping("/catalogue")
+@RequestMapping("/applet/catalogue")
 @Validated
 public class CatalogueController {
 
@@ -58,13 +56,6 @@ public class CatalogueController {
         return success(true);
     }
 
-    @PutMapping("/updateDetails")
-    @Operation(summary = "更新产品详情排序")
-    @PreAuthorize("@ss.hasPermission('applet:catalogue:update')")
-    public CommonResult<Boolean> updateCatalogueDetails(@Valid @RequestBody CatalogueSaveReqVO updateReqVO) {
-        catalogueService.updateCatalogueDetails(updateReqVO);
-        return success(true);
-    }
 
     @DeleteMapping("/delete")
     @Operation(summary = "删除")
@@ -80,17 +71,7 @@ public class CatalogueController {
     @Parameter(name = "id", description = "编号", required = true, example = "1024")
     @PreAuthorize("@ss.hasPermission('applet:catalogue:query')")
     public CommonResult<CatalogueRespVO> getCatalogue(@RequestParam("id") Long id, @RequestParam("level") String level) {
-//        CatalogueDO catalogue = catalogueService.getCatalogue(id);
-//        CatalogueRespVO respVO = BeanUtils.toBean(catalogue, CatalogueRespVO.class);
-//        if (respVO.getBusinessType() == 1) {
-//            respVO.setDetailsList(Arrays.asList(catalogue.getDetails().split(",")));
-//        }
         CatalogueRespVO respVO = catalogueService.getCatalogueResp(id);
-        if (StringUtils.equals("1", level)) {
-            // 产品排序,先初始化数据
-            List<CatalogueDetailRespVO> detailRespVOS = catalogueService.initCatalogueDetails(id);
-            respVO.setDetailRespVOS(detailRespVOS);
-        }
         return success(respVO);
     }
 
@@ -102,7 +83,6 @@ public class CatalogueController {
         List<CatalogueDO> catalogueList = catalogueService.getCatalogueList(convertList(pageResult.getList(), CatalogueDO::getParentId));
         Map<Long, CatalogueDO> catalogueMap = CollectionUtils.convertMap(catalogueList, CatalogueDO::getId);
         return success(new PageResult<>(CatalogueConvert.INSTANCE.convertCatalogueList(pageResult.getList(), catalogueMap), pageResult.getTotal()));
-//        return success(BeanUtils.toBean(pageResult, CatalogueRespVO.class));
     }
 
     @GetMapping("/export-excel")
@@ -121,17 +101,15 @@ public class CatalogueController {
 
     @GetMapping({"/getCatalogueTree"})
     @Operation(summary = "获取目录类型树", description = "只包含被启用的目录类型,主要用于前端的下拉选项")
-    public CommonResult<List<Map<String, Object>>> getCatalogueTree(@RequestParam("businessType") Integer businessType, @RequestParam("type") String type) {
-        type = StringUtils.isBlank(type) ? "" : type;
-        businessType = businessType == null ? 0 : businessType;
-        List<Map<String, Object>> list = catalogueService.getCatalogueTree(businessType, type);
+    public CommonResult<List<Map<String, Object>>> getCatalogueTree() {
+        List<Map<String, Object>> list = catalogueService.getCatalogueTree();
         return success(list);
     }
 
     @GetMapping({"/list-all-simple", "/simple-list"})
     @Operation(summary = "获取目录类型精简信息列表", description = "只包含被开启的目录类型,主要用于前端的下拉选项")
-    public CommonResult<List<CatalogueSimpleRespVO>> getSimpleCatalogueList(@RequestParam("businessType") Integer businessType, @RequestParam("status") Integer status) {
-        List<CatalogueDO> list = catalogueService.getCatalogueListByStatus(businessType == null ? 0 : businessType, status == null ? 1 : status);
+    public CommonResult<List<CatalogueSimpleRespVO>> getSimpleCatalogueList(@RequestParam("status") Integer status) {
+        List<CatalogueDO> list = catalogueService.getCatalogueListByStatus(status == null ? 1 : status);
         return success(BeanUtils.toBean(list, CatalogueSimpleRespVO.class));
     }
 

+ 0 - 34
ship-module-miniapplet/src/main/java/com/yc/ship/module/miniapplet/controller/admin/catalogue/detail/CatalogueDetailPageReqVO.java

@@ -1,34 +0,0 @@
-package com.yc.ship.module.miniapplet.controller.admin.catalogue.detail;
-
-import com.yc.ship.framework.common.pojo.PageParam;
-import io.swagger.v3.oas.annotations.media.Schema;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
-import lombok.ToString;
-import org.springframework.format.annotation.DateTimeFormat;
-
-import java.time.LocalDateTime;
-
-import static com.yc.ship.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
-
-
-@Schema(description = "管理后台 - 栏目产品排序分页 Request VO")
-@Data
-@EqualsAndHashCode(callSuper = true)
-@ToString(callSuper = true)
-public class CatalogueDetailPageReqVO extends PageParam {
-
-    @Schema(description = "栏目ID", example = "19032")
-    private Long catalogueId;
-
-    @Schema(description = "小程序产品ID", example = "19032")
-    private Long categoryId;
-
-    @Schema(description = "排序号")
-    private Integer sortNum;
-
-    @Schema(description = "创建时间")
-    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
-    private LocalDateTime[] createTime;
-
-}

+ 0 - 30
ship-module-miniapplet/src/main/java/com/yc/ship/module/miniapplet/controller/admin/catalogue/detail/CatalogueDetailRespVO.java

@@ -1,30 +0,0 @@
-package com.yc.ship.module.miniapplet.controller.admin.catalogue.detail;
-
-import io.swagger.v3.oas.annotations.media.Schema;
-import lombok.Data;
-
-import java.time.LocalDateTime;
-
-@Schema(description = "管理后台 - 栏目产品排序 Response VO")
-@Data
-public class CatalogueDetailRespVO {
-
-    @Schema(description = "栏目产品排序ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "2750")
-    private Long id;
-
-    @Schema(description = "栏目ID", example = "19032")
-    private Long catalogueId;
-
-    @Schema(description = "小程序产品ID", example = "19032")
-    private Long categoryId;
-
-    @Schema(description = "小程序产品名称", example = "19032")
-    private String categoryName;
-
-    @Schema(description = "排序号")
-    private Integer sortNum;
-
-    @Schema(description = "创建时间")
-    private LocalDateTime createTime;
-
-}

+ 0 - 22
ship-module-miniapplet/src/main/java/com/yc/ship/module/miniapplet/controller/admin/catalogue/detail/CatalogueDetailSaveReqVO.java

@@ -1,22 +0,0 @@
-package com.yc.ship.module.miniapplet.controller.admin.catalogue.detail;
-
-import io.swagger.v3.oas.annotations.media.Schema;
-import lombok.Data;
-
-@Schema(description = "管理后台 - 栏目产品排序新增/修改 Request VO")
-@Data
-public class CatalogueDetailSaveReqVO {
-
-    @Schema(description = "栏目产品排序ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "2750")
-    private Long id;
-
-    @Schema(description = "栏目ID", example = "19032")
-    private Long catalogueId;
-
-    @Schema(description = "小程序产品ID", example = "19032")
-    private Long categoryId;
-
-    @Schema(description = "排序号")
-    private Integer sortNum;
-
-}

+ 0 - 9
ship-module-miniapplet/src/main/java/com/yc/ship/module/miniapplet/controller/admin/catalogue/vo/CataloguePageReqVO.java

@@ -24,23 +24,14 @@ public class CataloguePageReqVO extends PageParam {
     @Schema(description = "目录编码")
     private String code;
 
-    @Schema(description = "业务类型 0.目录 1.栏目")
-    private Integer businessType;
-
-    @Schema(description = "目录类型 1.列表 2.内容 3.外部链接", example = "2")
-    private Integer type;
 
     @Schema(description = "父级目录", example = "5315")
     private Long parentId;
 
-    @Schema(description = "目录副标题")
-    private String title;
 
     @Schema(description = "目录Icon图标")
     private String logo;
 
-    @Schema(description = "外部链接", example = "https://www.iocoder.cn")
-    private String url;
 
     @Schema(description = "启用状态 0否 1是")
     private Integer isUse;

+ 0 - 27
ship-module-miniapplet/src/main/java/com/yc/ship/module/miniapplet/controller/admin/catalogue/vo/CatalogueRespVO.java

@@ -4,7 +4,6 @@ import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
 import com.alibaba.excel.annotation.ExcelProperty;
 import com.yc.ship.framework.excel.core.annotations.DictFormat;
 import com.yc.ship.framework.excel.core.convert.DictConvert;
-import com.yc.ship.module.miniapplet.controller.admin.catalogue.detail.CatalogueDetailRespVO;
 import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.Data;
 
@@ -28,14 +27,6 @@ public class CatalogueRespVO {
     @ExcelProperty("目录编码")
     private String code;
 
-    @Schema(description = "业务类型")
-    @ExcelProperty("业务类型")
-    private Integer businessType;
-
-    @Schema(description = "目录类型 1.列表 2.内容 3.外部链接", example = "2")
-    @ExcelProperty(value = "目录类型", converter = DictConvert.class)
-    @DictFormat("catalogue_type") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
-    private Integer type;
 
     @Schema(description = "父级目录", example = "5315")
 //    @ExcelProperty("父级目录")
@@ -45,10 +36,6 @@ public class CatalogueRespVO {
     @ExcelProperty("父级目录名称")
     private String parentName;
 
-    @Schema(description = "目录副标题")
-    @ExcelProperty("目录副标题")
-    private String title;
-
     @Schema(description = "目录Icon图标")
     @ExcelProperty("Icon图标")
     private String logo;
@@ -57,9 +44,6 @@ public class CatalogueRespVO {
     @ExcelProperty("头部图片")
     private String imgUrl;
 
-    @Schema(description = "外部链接", example = "https://www.iocoder.cn")
-    @ExcelProperty("外部链接")
-    private String url;
 
     @Schema(description = "启用状态 0否 1是")
     @ExcelProperty(value = "启用状态", converter = DictConvert.class)
@@ -86,12 +70,6 @@ public class CatalogueRespVO {
     @DictFormat("yes_no")
     private Integer isRecommend;
 
-    @Schema(description = "展示类型 0.产品 1.子产品")
-    private Integer showType;
-
-    @Schema(description = "列表页设置")
-    @ExcelProperty("列表页设置")
-    private List<String> detailsList;
 
     @Schema(description = "备注", example = "随便")
     @ExcelProperty("备注")
@@ -105,10 +83,5 @@ public class CatalogueRespVO {
     @ExcelProperty("创建时间")
     private LocalDateTime createTime;
 
-    @Schema(description = "头部图片地址")
-    private String headerVideo;
-
 
-    @Schema(description = "产品排序", example = "")
-    private List<CatalogueDetailRespVO> detailRespVOS;
 }

+ 0 - 25
ship-module-miniapplet/src/main/java/com/yc/ship/module/miniapplet/controller/admin/catalogue/vo/CatalogueSaveReqVO.java

@@ -1,10 +1,8 @@
 package com.yc.ship.module.miniapplet.controller.admin.catalogue.vo;
 
-import com.yc.ship.module.miniapplet.controller.admin.catalogue.detail.CatalogueDetailSaveReqVO;
 import io.swagger.v3.oas.annotations.media.Schema;
 import lombok.Data;
 
-import java.util.List;
 
 @Schema(description = "管理后台 - 目录类型新增/修改 Request VO")
 @Data
@@ -19,26 +17,16 @@ public class CatalogueSaveReqVO {
     @Schema(description = "目录编码")
     private String code;
 
-    @Schema(description = "业务类型 0.目录 1.栏目 2.分类")
-    private Integer businessType;
-
-    @Schema(description = "目录类型 1.列表 2.内容 3.外部链接", example = "2")
-    private Integer type;
 
     @Schema(description = "父级目录", example = "5315")
     private Long parentId;
 
-    @Schema(description = "目录副标题")
-    private String title;
-
     @Schema(description = "目录Icon图标")
     private String logo;
 
     @Schema(description = "图片地址")
     private String imgUrl;
 
-    @Schema(description = "外部链接", example = "https://www.iocoder.cn")
-    private String url;
 
     @Schema(description = "启用状态 0否 1是")
     private Integer isUse;
@@ -55,22 +43,9 @@ public class CatalogueSaveReqVO {
     @Schema(description = "是否栏目推荐 0否 1是")
     private Integer isRecommend;
 
-    @Schema(description = "展示类型 0.产品 1.子产品")
-    private Integer showType;
-
-    @Schema(description = "列表页设置")
-    private List<String> detailsList;
-
     @Schema(description = "备注", example = "随便")
     private String remark;
 
     @Schema(description = "排序号")
     private Integer sortNum;
-
-    @Schema(description = "头部图片地址")
-    private String headerVideo;
-
-
-    @Schema(description = "产品排序", example = "")
-    private List<CatalogueDetailSaveReqVO> detailRespVOS;
 }

+ 0 - 4
ship-module-miniapplet/src/main/java/com/yc/ship/module/miniapplet/controller/admin/catalogue/vo/CatalogueSimpleRespVO.java

@@ -19,10 +19,6 @@ public class CatalogueSimpleRespVO {
     @Schema(description = "目录编码")
     private String code;
 
-    @Schema(description = "目录类型", example = "2")
-    @DictFormat("catalogue_type") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
-    private Integer type;
-
     @Schema(description = "父级目录", example = "5315")
     private Long parentId;
 

+ 1 - 38
ship-module-miniapplet/src/main/java/com/yc/ship/module/miniapplet/controller/admin/content/ContentController.java

@@ -40,7 +40,7 @@ import static com.yc.ship.module.miniapplet.enums.ErrorCodeConstants.*;
 
 @Tag(name = "管理后台 - 目录内容")
 @RestController
-@RequestMapping("/content")
+@RequestMapping("/applet/content")
 @Validated
 public class ContentController {
 
@@ -54,7 +54,6 @@ public class ContentController {
     @Operation(summary = "创建")
     @PreAuthorize("@ss.hasPermission('applet:content:create')")
     public CommonResult<Long> createContent(@Valid @RequestBody ContentSaveReqVO createReqVO) {
-        verifyCatalogue(null, createReqVO.getCatalogueId());
         return success(contentService.createContent(createReqVO));
     }
 
@@ -62,7 +61,6 @@ public class ContentController {
     @Operation(summary = "更新")
     @PreAuthorize("@ss.hasAnyPermissions('applet:content:update','applet:content:withdraw')")
     public CommonResult<Boolean> updateContent(@Valid @RequestBody ContentSaveReqVO updateReqVO) {
-        verifyCatalogue(updateReqVO.getId(), updateReqVO.getCatalogueId());
         contentService.updateContent(updateReqVO);
         return success(true);
     }
@@ -94,7 +92,6 @@ public class ContentController {
         Map<Long, CatalogueDO> catalogueMap = CollectionUtils.convertMap(catalogueList, CatalogueDO::getId);
         return success(new PageResult<>(CatalogueConvert.INSTANCE.convertContentList(pageResult.getList(), catalogueMap),
                 pageResult.getTotal()));
-//        return success(BeanUtils.toBean(pageResult, ContentRespVO.class));
     }
 
     @GetMapping("/export-excel")
@@ -112,40 +109,6 @@ public class ContentController {
                 respList);
     }
 
-    /**
-     * 验证目录类型
-     *
-     * @param catalogueId 目录类型ID
-     */
-    private void verifyCatalogue(Long id, Long catalogueId) {
-        CatalogueDO catalogueDO = catalogueService.getCatalogue(catalogueId);
-        if (catalogueDO == null) {
-            throw exception(CATALOGUE_NOT_EXISTS);
-        }
-        Integer type = catalogueDO.getType();
-        List<ContentDO> contentDOS = contentService.getContentList(catalogueId, null);
-        if (id != null) {
-            // 过滤出 非当前操作的内容ID
-            contentDOS = contentDOS.stream()
-                    .filter(contentDO -> !id.equals(contentDO.getId()))
-                    .collect(Collectors.toList());
-        }
-        switch (type) {
-            case 1:
-                // 1.列表
-
-                break;
-            case 2:
-                // 2.内容
-                if (!contentDOS.isEmpty()) {
-                    throw exception(CATALOGUE_TYPE_EXCEED);
-                }
-                break;
-            default:
-                // 3.外部链接
-                throw exception(CATALOGUE_TYPE_ERROR);
-        }
-    }
 
     @GetMapping({"/list-all-simple", "/simple-list"})
     @Operation(summary = "获取内容精简信息列表", description = "只包含被开启内容精简信息,主要用于前端的下拉选项")

+ 3 - 21
ship-module-miniapplet/src/main/java/com/yc/ship/module/miniapplet/controller/app/content/AppContentController.java

@@ -1,26 +1,16 @@
 package com.yc.ship.module.miniapplet.controller.app.content;
 
-import cn.hutool.json.JSONArray;
-import cn.hutool.json.JSONObject;
-import cn.hutool.json.JSONUtil;
-import com.baomidou.mybatisplus.core.toolkit.StringUtils;
 import com.yc.ship.framework.common.pojo.CommonResult;
 import com.yc.ship.framework.common.util.object.BeanUtils;
-import com.yc.ship.module.miniapplet.controller.admin.catalogue.detail.CatalogueDetailRespVO;
-import com.yc.ship.module.miniapplet.controller.admin.catalogue.vo.CatalogueRespVO;
 import com.yc.ship.module.miniapplet.controller.app.content.vo.AppCatalogueRespVO;
-import com.yc.ship.module.miniapplet.controller.app.content.vo.AppCategoryRespVO;
 import com.yc.ship.module.miniapplet.controller.app.content.vo.AppContentReqVO;
 import com.yc.ship.module.miniapplet.controller.app.content.vo.AppContentRespVO;
 import com.yc.ship.module.miniapplet.dal.dataobject.catalogue.CatalogueDO;
 import com.yc.ship.module.miniapplet.dal.dataobject.content.ContentDO;
-import com.yc.ship.module.miniapplet.dal.dto.CategoryExtraRespDTO;
 import com.yc.ship.module.miniapplet.service.catalogue.CatalogueService;
 import com.yc.ship.module.miniapplet.service.content.ContentService;
-import io.swagger.v3.oas.annotations.Operation;
 import io.swagger.v3.oas.annotations.tags.Tag;
 import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
@@ -29,9 +19,7 @@ import org.springframework.web.bind.annotation.RestController;
 
 import javax.annotation.Resource;
 import javax.validation.Valid;
-import java.math.BigDecimal;
 import java.util.*;
-import java.util.stream.Collectors;
 
 import static com.yc.ship.framework.common.pojo.CommonResult.success;
 
@@ -42,24 +30,18 @@ import static com.yc.ship.framework.common.pojo.CommonResult.success;
  */
 @Tag(name = "用户 APP - 目录/栏目/产品分组分类")
 @RestController
-@RequestMapping("/app/content")
+@RequestMapping("/applet/content")
 @Validated
 @Slf4j
 public class AppContentController {
-//
-//    @Resource
-//    private ProductApi productApi;
+
 
     @Resource
     private CatalogueService catalogueService;
 
     @Resource
     private ContentService contentService;
-//    @Autowired
-//    private ProductGroupService productGroupService;
-//
-//    @Resource
-//    private ProductService productService;
+
 
     @PostMapping("/catalogueList")
 //    @Operation(summary = "获取目录/栏目/产品分组分类列表")

+ 3 - 28
ship-module-miniapplet/src/main/java/com/yc/ship/module/miniapplet/dal/dataobject/catalogue/CatalogueDO.java

@@ -1,5 +1,6 @@
 package com.yc.ship.module.miniapplet.dal.dataobject.catalogue;
 
+import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.KeySequence;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
@@ -25,7 +26,7 @@ public class CatalogueDO extends TenantBaseDO {
     /**
      * 目录类型主键ID
      */
-    @TableId
+    @TableId(type = IdType.ASSIGN_ID)
     private Long id;
     /**
      * 目录名称
@@ -36,25 +37,11 @@ public class CatalogueDO extends TenantBaseDO {
      */
     private String code;
 
-    /**
-     * 业务类型 0.目录 1.栏目 2.分类
-     */
-    private Integer businessType;
-
-    /**
-     * 目录类型 1.列表 2.内容 3.外部链接
-     * <p>
-     * 枚举 {@link TODO catalogue_type 对应的类}
-     */
-    private Integer type;
     /**
      * 父级目录
      */
     private Long parentId;
-    /**
-     * 目录副标题
-     */
-    private String title;
+
     /**
      * 目录Icon图标
      */
@@ -63,10 +50,6 @@ public class CatalogueDO extends TenantBaseDO {
      * 图片地址
      */
     private String imgUrl;
-    /**
-     * 外部链接
-     */
-    private String url;
     /**
      * 启用状态 0否 1是
      * <p>
@@ -89,14 +72,6 @@ public class CatalogueDO extends TenantBaseDO {
      * 是否栏目推荐 0否 1是
      */
     private Integer isRecommend;
-    /**
-     * 展示类型 0.产品 1.子产品
-     */
-    private Integer showType;
-    /**
-     * 列表页设置
-     */
-    private String details;
     /**
      * 备注
      */

+ 0 - 42
ship-module-miniapplet/src/main/java/com/yc/ship/module/miniapplet/dal/dataobject/cataloguedetail/CatalogueDetailDO.java

@@ -1,42 +0,0 @@
-package com.yc.ship.module.miniapplet.dal.dataobject.cataloguedetail;
-
-import com.baomidou.mybatisplus.annotation.KeySequence;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-import com.yc.ship.framework.tenant.core.db.TenantBaseDO;
-import lombok.*;
-
-/**
- * 栏目产品排序 DO
- *
- * @author 管理员
- */
-@TableName("applet_catalogue_detail")
-@KeySequence("applet_catalogue_detail_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
-@Data
-@EqualsAndHashCode(callSuper = true)
-@ToString(callSuper = true)
-@Builder
-@NoArgsConstructor
-@AllArgsConstructor
-public class CatalogueDetailDO extends TenantBaseDO {
-
-    /**
-     * 栏目产品排序ID
-     */
-    @TableId
-    private Long id;
-    /**
-     * 栏目ID
-     */
-    private Long catalogueId;
-    /**
-     * 小程序产品ID
-     */
-    private Long categoryId;
-    /**
-     * 排序号
-     */
-    private Integer sortNum;
-
-}

+ 2 - 1
ship-module-miniapplet/src/main/java/com/yc/ship/module/miniapplet/dal/dataobject/content/ContentDO.java

@@ -1,5 +1,6 @@
 package com.yc.ship.module.miniapplet.dal.dataobject.content;
 
+import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.KeySequence;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
@@ -27,7 +28,7 @@ public class ContentDO extends TenantBaseDO {
     /**
      * 内容主键ID
      */
-    @TableId
+    @TableId(type = IdType.ASSIGN_ID)
     private Long id;
     /**
      * 内容名称

+ 3 - 19
ship-module-miniapplet/src/main/java/com/yc/ship/module/miniapplet/dal/mysql/catalogue/CatalogueMapper.java

@@ -22,12 +22,8 @@ public interface CatalogueMapper extends BaseMapperX<CatalogueDO> {
         return selectPage(reqVO, new LambdaQueryWrapperX<CatalogueDO>()
                 .likeIfPresent(CatalogueDO::getName, reqVO.getName())
                 .eqIfPresent(CatalogueDO::getCode, reqVO.getCode())
-                .eqIfPresent(CatalogueDO::getBusinessType, reqVO.getBusinessType())
-                .eqIfPresent(CatalogueDO::getType, reqVO.getType())
                 .eqIfPresent(CatalogueDO::getParentId, reqVO.getParentId())
-                .eqIfPresent(CatalogueDO::getTitle, reqVO.getTitle())
                 .eqIfPresent(CatalogueDO::getLogo, reqVO.getLogo())
-                .eqIfPresent(CatalogueDO::getUrl, reqVO.getUrl())
                 .eqIfPresent(CatalogueDO::getIsUse, reqVO.getIsUse())
                 .eqIfPresent(CatalogueDO::getIsComment, reqVO.getIsComment())
                 .eqIfPresent(CatalogueDO::getIsRelease, reqVO.getIsRelease())
@@ -38,26 +34,20 @@ public interface CatalogueMapper extends BaseMapperX<CatalogueDO> {
                 .orderByDesc(CatalogueDO::getId));
     }
 
-    default List<CatalogueDO> getCatalogueByParentId(Long parentId, Integer businessType, String type) {
+    default List<CatalogueDO> getCatalogueByParentId(Long parentId) {
         LambdaQueryWrapperX<CatalogueDO> wrapper = new LambdaQueryWrapperX<>();
         wrapper.eqIfPresent(CatalogueDO::getParentId, parentId);
-        if (StringUtils.equals("c", type)) {
-            wrapper.inIfPresent(CatalogueDO::getType, 1, 2);
-        }
-        wrapper.eqIfPresent(CatalogueDO::getBusinessType, businessType);
+
         wrapper.eqIfPresent(CatalogueDO::getIsUse, 1);
         wrapper.orderByDesc(CatalogueDO::getId);
         return selectList(wrapper);
     }
 
-    default List<CatalogueDO> getCatalogueList(Long id, Long prentId, Integer businessType, Integer type, String code,String name) {
+    default List<CatalogueDO> getCatalogueList(Long id, Long prentId, String code,String name) {
         LambdaQueryWrapperX<CatalogueDO> wrapper = new LambdaQueryWrapperX<>();
         if (id != null) {
             wrapper.eqIfPresent(CatalogueDO::getId, id);
         }
-        if (type != null) {
-            wrapper.eqIfPresent(CatalogueDO::getType, type);
-        }
         if (StringUtils.isNotBlank(code)) {
             wrapper.eqIfPresent(CatalogueDO::getCode, code);
         }
@@ -70,12 +60,6 @@ public interface CatalogueMapper extends BaseMapperX<CatalogueDO> {
             wrapper.eqIfPresent(CatalogueDO::getParentId, 0);
         }
         wrapper.eqIfPresent(CatalogueDO::getIsUse, 1);
-        if (businessType != null) {
-            wrapper.eqIfPresent(CatalogueDO::getBusinessType, businessType);
-//            if (businessType == 1) {
-//                wrapper.orderByDesc(CatalogueDO::getIsRecommend);
-//            }
-        }
         wrapper.orderByAsc(CatalogueDO::getSortNum);
         return selectList(wrapper);
     }

+ 0 - 35
ship-module-miniapplet/src/main/java/com/yc/ship/module/miniapplet/dal/mysql/cataloguedetail/CatalogueDetailMapper.java

@@ -1,35 +0,0 @@
-package com.yc.ship.module.miniapplet.dal.mysql.cataloguedetail;
-
-import com.yc.ship.framework.common.pojo.PageResult;
-import com.yc.ship.framework.mybatis.core.mapper.BaseMapperX;
-import com.yc.ship.framework.mybatis.core.query.LambdaQueryWrapperX;
-import com.yc.ship.module.miniapplet.controller.admin.catalogue.detail.CatalogueDetailPageReqVO;
-import com.yc.ship.module.miniapplet.dal.dataobject.cataloguedetail.CatalogueDetailDO;
-import org.apache.ibatis.annotations.Mapper;
-
-import java.util.List;
-
-/**
- * 栏目产品排序 Mapper
- *
- * @author 管理员
- */
-@Mapper
-public interface CatalogueDetailMapper extends BaseMapperX<CatalogueDetailDO> {
-
-    default PageResult<CatalogueDetailDO> selectPage(CatalogueDetailPageReqVO reqVO) {
-        return selectPage(reqVO, new LambdaQueryWrapperX<CatalogueDetailDO>()
-                .eqIfPresent(CatalogueDetailDO::getCategoryId, reqVO.getCategoryId())
-                .eqIfPresent(CatalogueDetailDO::getSortNum, reqVO.getSortNum())
-                .betweenIfPresent(CatalogueDetailDO::getCreateTime, reqVO.getCreateTime())
-                .orderByDesc(CatalogueDetailDO::getId));
-    }
-
-    default List<CatalogueDetailDO> getCatalogueDetailList(Long catalogueId) {
-        LambdaQueryWrapperX<CatalogueDetailDO> queryWrapperX = new LambdaQueryWrapperX<>();
-        queryWrapperX.eqIfPresent(CatalogueDetailDO::getCatalogueId,catalogueId);
-        queryWrapperX.orderByAsc(CatalogueDetailDO::getSortNum);
-        return selectList(queryWrapperX);
-    }
-
-}

+ 2 - 12
ship-module-miniapplet/src/main/java/com/yc/ship/module/miniapplet/service/catalogue/CatalogueService.java

@@ -1,7 +1,6 @@
 package com.yc.ship.module.miniapplet.service.catalogue;
 
 import com.yc.ship.framework.common.pojo.PageResult;
-import com.yc.ship.module.miniapplet.controller.admin.catalogue.detail.CatalogueDetailRespVO;
 import com.yc.ship.module.miniapplet.controller.admin.catalogue.vo.CataloguePageReqVO;
 import com.yc.ship.module.miniapplet.controller.admin.catalogue.vo.CatalogueRespVO;
 import com.yc.ship.module.miniapplet.controller.admin.catalogue.vo.CatalogueSaveReqVO;
@@ -35,12 +34,6 @@ public interface CatalogueService {
      */
     void updateCatalogue(@Valid CatalogueSaveReqVO updateReqVO);
 
-    /**
-     * 更新目录类型
-     * @param updateReqVO
-     */
-    void updateCatalogueDetails(@Valid CatalogueSaveReqVO updateReqVO);
-
     /**
      * 删除目录类型
      *
@@ -79,13 +72,10 @@ public interface CatalogueService {
      *
      * @return
      */
-    List<Map<String, Object>> getCatalogueTree(Integer businessType,String type);
+    List<Map<String, Object>> getCatalogueTree();
 
-    List<CatalogueDO> getCatalogueListByStatus(Integer businessType,Integer status);
+    List<CatalogueDO> getCatalogueListByStatus(Integer status);
 
     List<CatalogueDO> getCatalogueList(AppContentReqVO reqVO);
 
-    List<CatalogueDetailRespVO> initCatalogueDetails(Long id);
-
-    List<CatalogueDetailRespVO> getCatalogueDetailList(Long id);
 }

+ 8 - 102
ship-module-miniapplet/src/main/java/com/yc/ship/module/miniapplet/service/catalogue/CatalogueServiceImpl.java

@@ -4,17 +4,13 @@ import cn.hutool.core.collection.CollUtil;
 import com.baomidou.mybatisplus.core.toolkit.IdWorker;
 import com.yc.ship.framework.common.pojo.PageResult;
 import com.yc.ship.framework.common.util.object.BeanUtils;
-import com.yc.ship.module.miniapplet.controller.admin.catalogue.detail.CatalogueDetailRespVO;
-import com.yc.ship.module.miniapplet.controller.admin.catalogue.detail.CatalogueDetailSaveReqVO;
 import com.yc.ship.module.miniapplet.controller.admin.catalogue.vo.CataloguePageReqVO;
 import com.yc.ship.module.miniapplet.controller.admin.catalogue.vo.CatalogueRespVO;
 import com.yc.ship.module.miniapplet.controller.admin.catalogue.vo.CatalogueSaveReqVO;
 import com.yc.ship.module.miniapplet.controller.app.content.vo.AppContentReqVO;
 import com.yc.ship.module.miniapplet.dal.dataobject.catalogue.CatalogueDO;
-import com.yc.ship.module.miniapplet.dal.dataobject.cataloguedetail.CatalogueDetailDO;
 import com.yc.ship.module.miniapplet.dal.dataobject.content.ContentDO;
 import com.yc.ship.module.miniapplet.dal.mysql.catalogue.CatalogueMapper;
-import com.yc.ship.module.miniapplet.service.cataloguedetail.CatalogueDetailService;
 import com.yc.ship.module.miniapplet.service.content.ContentService;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.stereotype.Service;
@@ -38,16 +34,10 @@ import static com.yc.ship.module.miniapplet.enums.ErrorCodeConstants.*;
 @Validated
 public class CatalogueServiceImpl implements CatalogueService {
 
-//    @Resource
-//    private ProductApi productApi;
-
     @Resource
     private ContentService contentService;
 
 
-    @Resource
-    private CatalogueDetailService catalogueDetailService;
-
     @Resource
     private CatalogueMapper catalogueMapper;
 
@@ -56,10 +46,8 @@ public class CatalogueServiceImpl implements CatalogueService {
     public Long createCatalogue(CatalogueSaveReqVO createReqVO) {
         // 插入
         CatalogueDO catalogue = BeanUtils.toBean(createReqVO, CatalogueDO.class);
-        catalogue.setDetails(StringUtils.join(createReqVO.getDetailsList(), ","));
         Long id = IdWorker.getId(catalogue);
         catalogue.setId(id);
-        catalogue.setImgUrl(createReqVO.getHeaderVideo());
         catalogueMapper.insert(catalogue);
         // 返回
         return catalogue.getId();
@@ -72,39 +60,12 @@ public class CatalogueServiceImpl implements CatalogueService {
         validateCatalogueExists(updateReqVO.getId());
         // 更新
         CatalogueDO updateObj = BeanUtils.toBean(updateReqVO, CatalogueDO.class);
-        updateObj.setDetails(StringUtils.join(updateReqVO.getDetailsList(), ","));
-        updateObj.setImgUrl(updateReqVO.getHeaderVideo());
         catalogueMapper.updateById(updateObj);
     }
 
-    @Override
-    @Transactional(rollbackFor = Exception.class)
-    public void updateCatalogueDetails(CatalogueSaveReqVO updateReqVO) {
-        for (CatalogueDetailSaveReqVO detail : updateReqVO.getDetailRespVOS()) {
-            catalogueDetailService.updateCatalogueDetail(detail);
-        }
-    }
 
     @Override
     public void deleteCatalogue(Long id) {
-
-        //TODO: 待完善
-        // 校验存在
-        CatalogueDO catalogueDO = validateCatalogueExists(id);
-//        if (catalogueDO.getBusinessType() == 1 || catalogueDO.getBusinessType() == 2) {
-//            List<CategoryRespDTO> categoryRespDTOS = productApi.getCategoryListByCatalogueId(id, catalogueDO.getBusinessType()).getCheckedData();
-//            if (!categoryRespDTOS.isEmpty()) {
-//                String categoryName = categoryRespDTOS.stream().map(CategoryRespDTO::getCateName).collect(Collectors.joining(","));
-//                String businessTypeMsg = catalogueDO.getBusinessType() == 1 ? "栏目" : "分类";
-//                throw exception0(10_002, "当前" + businessTypeMsg + "已被" + categoryName + "产品绑定,不能删除");
-//            }
-//        }
-        if (catalogueDO.getBusinessType() != 2) {
-            List<CatalogueDO> catalogueDOS = catalogueMapper.getCatalogueByParentId(id, catalogueDO.getBusinessType(), "");
-            if (!catalogueDOS.isEmpty()) {
-                throw exception(CATALOGUE_BINDING);
-            }
-        }
         List<ContentDO> contentDOS = contentService.getContentList(id, null);
         if (!contentDOS.isEmpty()) {
             throw exception(CATALOGUE_BINDING_CONTENT);
@@ -147,82 +108,27 @@ public class CatalogueServiceImpl implements CatalogueService {
     }
 
     @Override
-    public List<Map<String, Object>> getCatalogueTree(Integer businessType, String type) {
-        return getCatalogueTree(0L, businessType, type);
+    public List<Map<String, Object>> getCatalogueTree() {
+        return getCatalogueTree(0L);
     }
 
     @Override
-    public List<CatalogueDO> getCatalogueListByStatus(Integer businessType, Integer status) {
-        return catalogueMapper.selectList(CatalogueDO::getBusinessType, businessType, CatalogueDO::getIsUse, status);
+    public List<CatalogueDO> getCatalogueListByStatus(Integer status) {
+        return catalogueMapper.selectList(CatalogueDO::getIsUse, status);
     }
 
     @Override
     public List<CatalogueDO> getCatalogueList(AppContentReqVO reqVO) {
-        return catalogueMapper.getCatalogueList(reqVO.getCatalogueId(), reqVO.getCatalogueParentId(), reqVO.getBusinessType(), reqVO.getType(), reqVO.getCode(), reqVO.getCategoryName());
-    }
-
-    @Override
-    public List<CatalogueDetailRespVO> initCatalogueDetails(Long id) {
-        //TODO: 待完善
-        // 获取 CategoryRespDTO 列表
-//        List<CategoryRespDTO> respDTOS = productApi.getCategoryListByCatalogueId(id, 1).getCheckedData();
-        // 获取 CatalogueDetailDO 列表
-        List<CatalogueDetailRespVO> respVOS = getCatalogueDetailList(id);
-        // 创建一个 Map 来存储 CategoryRespDTO 的 id 和 name 映射
-//        Map<Long, CategoryRespDTO> categoryMap = respDTOS.stream()
-//                .collect(Collectors.toMap(CategoryRespDTO::getId, category -> category));
-        // 创建一个 Set 来存储已存在的 CatalogueDetailDO 的 categoryId
-        Set<Long> existingCategoryIds = respVOS.stream()
-                .map(CatalogueDetailRespVO::getCategoryId)
-                .collect(Collectors.toSet());
-        // 找出需要新增的 CategoryRespDTO
-//        List<CategoryRespDTO> newCategories = respDTOS.stream()
-//                .filter(category -> !existingCategoryIds.contains(category.getId()))
-//                .collect(Collectors.toList());
-        // 新增 CatalogueDetailDO
-        int index = respVOS.size();
-//        for (CategoryRespDTO newCategory : newCategories) {
-//            CatalogueDetailSaveReqVO detailSaveReqVO = new CatalogueDetailSaveReqVO();
-//            detailSaveReqVO.setCatalogueId(id);
-//            detailSaveReqVO.setCategoryId(newCategory.getId());
-//            detailSaveReqVO.setSortNum(index++);
-//            catalogueDetailService.createCatalogueDetail(detailSaveReqVO);
-//        }
-        // 找出需要删除的 CatalogueDetailDO
-//        List<CatalogueDetailRespVO> deletedDetails = respVOS.stream()
-//                .filter(detail -> !categoryMap.containsKey(detail.getCategoryId()))
-//                .collect(Collectors.toList());
-//        // 删除 CatalogueDetailDO
-//        for (CatalogueDetailRespVO deletedDetail : deletedDetails) {
-//            catalogueDetailService.deleteCatalogueDetail(deletedDetail.getId());
-//        }
-//        // 重新获取 CatalogueDetailDO 列表
-//        respVOS = getCatalogueDetailList(id);
-//        // 设置 name 属性到 respVOS
-//        for (CatalogueDetailRespVO respVO : respVOS) {
-//            CategoryRespDTO category = categoryMap.get(respVO.getCategoryId());
-//            if (category != null) {
-//                respVO.setCategoryName(category.getCateName());
-//            }
-//        }
-        return respVOS;
-    }
-
-    @Override
-    public List<CatalogueDetailRespVO> getCatalogueDetailList(Long id) {
-        // 获取 CatalogueDetailDO 列表
-        List<CatalogueDetailDO> detailDOS = catalogueDetailService.getCatalogueDetailList(id);
-        return BeanUtils.toBean(detailDOS, CatalogueDetailRespVO.class);
+        return catalogueMapper.getCatalogueList(reqVO.getCatalogueId(), reqVO.getCatalogueParentId(), reqVO.getCode(), reqVO.getCategoryName());
     }
 
-    private List<Map<String, Object>> getCatalogueTree(Long prentId, Integer businessType, String type) {
-        List<CatalogueDO> catalogueDOS = catalogueMapper.getCatalogueByParentId(prentId, businessType, type);
+    private List<Map<String, Object>> getCatalogueTree(Long prentId) {
+        List<CatalogueDO> catalogueDOS = catalogueMapper.getCatalogueByParentId(prentId);
         return catalogueDOS.stream().map(catalogueDO -> {
             Map<String, Object> data = new HashMap<>(3);
             data.put("value", catalogueDO.getId());
             data.put("label", catalogueDO.getName());
-            data.put("type", catalogueDO.getType());
-            data.put("children", getCatalogueTree(catalogueDO.getId(), businessType, type));
+            data.put("children", getCatalogueTree(catalogueDO.getId()));
             return data;
         }).collect(Collectors.toList());
     }

+ 0 - 65
ship-module-miniapplet/src/main/java/com/yc/ship/module/miniapplet/service/cataloguedetail/CatalogueDetailService.java

@@ -1,65 +0,0 @@
-package com.yc.ship.module.miniapplet.service.cataloguedetail;
-
-
-import com.yc.ship.framework.common.pojo.PageResult;
-import com.yc.ship.module.miniapplet.controller.admin.catalogue.detail.CatalogueDetailPageReqVO;
-import com.yc.ship.module.miniapplet.controller.admin.catalogue.detail.CatalogueDetailSaveReqVO;
-import com.yc.ship.module.miniapplet.dal.dataobject.cataloguedetail.CatalogueDetailDO;
-
-import javax.validation.Valid;
-import java.util.List;
-
-/**
- * 栏目产品排序 Service 接口
- *
- * @author 管理员
- */
-public interface CatalogueDetailService {
-
-    /**
-     * 创建栏目产品排序
-     *
-     * @param createReqVO 创建信息
-     * @return 编号
-     */
-    Long createCatalogueDetail(@Valid CatalogueDetailSaveReqVO createReqVO);
-
-    /**
-     * 更新栏目产品排序
-     *
-     * @param updateReqVO 更新信息
-     */
-    void updateCatalogueDetail(@Valid CatalogueDetailSaveReqVO updateReqVO);
-
-    /**
-     * 删除栏目产品排序
-     *
-     * @param id 编号
-     */
-    void deleteCatalogueDetail(Long id);
-
-    /**
-     * 获得栏目产品排序
-     *
-     * @param id 编号
-     * @return 栏目产品排序
-     */
-    CatalogueDetailDO getCatalogueDetail(Long id);
-
-    /**
-     * 根据栏目ID查小程序产品排序
-     *
-     * @param catalogueId
-     * @return
-     */
-    List<CatalogueDetailDO> getCatalogueDetailList(Long catalogueId);
-
-    /**
-     * 获得栏目产品排序分页
-     *
-     * @param pageReqVO 分页查询
-     * @return 栏目产品排序分页
-     */
-    PageResult<CatalogueDetailDO> getCatalogueDetailPage(CatalogueDetailPageReqVO pageReqVO);
-
-}

+ 0 - 81
ship-module-miniapplet/src/main/java/com/yc/ship/module/miniapplet/service/cataloguedetail/CatalogueDetailServiceImpl.java

@@ -1,81 +0,0 @@
-package com.yc.ship.module.miniapplet.service.cataloguedetail;
-
-import com.baomidou.mybatisplus.core.toolkit.IdWorker;
-import com.yc.ship.framework.common.pojo.PageResult;
-import com.yc.ship.framework.common.util.object.BeanUtils;
-import com.yc.ship.module.miniapplet.controller.admin.catalogue.detail.CatalogueDetailPageReqVO;
-import com.yc.ship.module.miniapplet.controller.admin.catalogue.detail.CatalogueDetailSaveReqVO;
-import com.yc.ship.module.miniapplet.dal.dataobject.cataloguedetail.CatalogueDetailDO;
-import com.yc.ship.module.miniapplet.dal.mysql.cataloguedetail.CatalogueDetailMapper;
-import org.springframework.stereotype.Service;
-import org.springframework.validation.annotation.Validated;
-
-import javax.annotation.Resource;
-import java.util.List;
-
-import static com.yc.ship.framework.common.exception.util.ServiceExceptionUtil.exception;
-import static com.yc.ship.module.miniapplet.enums.ErrorCodeConstants.CATALOGUE_DETAIL_NOT_EXISTS;
-
-
-/**
- * 栏目产品排序 Service 实现类
- *
- * @author 管理员
- */
-@Service
-@Validated
-public class CatalogueDetailServiceImpl implements CatalogueDetailService {
-
-    @Resource
-    private CatalogueDetailMapper catalogueDetailMapper;
-
-    @Override
-    public Long createCatalogueDetail(CatalogueDetailSaveReqVO createReqVO) {
-        // 插入
-        CatalogueDetailDO catalogueDetail = BeanUtils.toBean(createReqVO, CatalogueDetailDO.class);
-        catalogueDetail.setId(IdWorker.getId(catalogueDetail));
-        catalogueDetail.setDeleted(false);
-        catalogueDetailMapper.insert(catalogueDetail);
-        // 返回
-        return catalogueDetail.getId();
-    }
-
-    @Override
-    public void updateCatalogueDetail(CatalogueDetailSaveReqVO updateReqVO) {
-        // 校验存在
-        validateCatalogueDetailExists(updateReqVO.getId());
-        // 更新
-        CatalogueDetailDO updateObj = BeanUtils.toBean(updateReqVO, CatalogueDetailDO.class);
-        catalogueDetailMapper.updateById(updateObj);
-    }
-
-    @Override
-    public void deleteCatalogueDetail(Long id) {
-        // 校验存在
-        validateCatalogueDetailExists(id);
-        // 删除
-        catalogueDetailMapper.deleteById(id);
-    }
-
-    private void validateCatalogueDetailExists(Long id) {
-        if (catalogueDetailMapper.selectById(id) == null) {
-            throw exception(CATALOGUE_DETAIL_NOT_EXISTS);
-        }
-    }
-
-    @Override
-    public CatalogueDetailDO getCatalogueDetail(Long id) {
-        return catalogueDetailMapper.selectById(id);
-    }
-
-    @Override
-    public List<CatalogueDetailDO> getCatalogueDetailList(Long catalogueId) {
-        return catalogueDetailMapper.getCatalogueDetailList(catalogueId);
-    }
-
-    @Override
-    public PageResult<CatalogueDetailDO> getCatalogueDetailPage(CatalogueDetailPageReqVO pageReqVO) {
-        return catalogueDetailMapper.selectPage(pageReqVO);
-    }
-
-}