+ * 经营范围表 前端控制器 + *
+ * + * @author DengMin + * @since 2022-07-25 + */ +@RestController +@Api(tags = "经营范围表") +@RequestMapping("/businessScopeDict") +public class BusinessScopeDictController { + + @Autowired + private BusinessScopeDictService businessScopeDictService; + + @PostMapping("addBusinessScope") + @ApiOperation("添加经营范围:businessScopeName/经营范围名称") + @LoginRequired + public ResponseVO addBusinessScope(@RequestBody BusinessScopeDictDO businessScopeDictDO) { + businessScopeDictService.save(businessScopeDictDO); + return ResponseData.generateCreatedResponse(0); + } + + @PostMapping("updateBusinessScope") + @ApiOperation("修改经营范围:id/ID、businessScopeName/经营范围名称") + @LoginRequired + public ResponseVO updateBusinessScope(@RequestBody BusinessScopeDictDO businessScopeDictDO) { + businessScopeDictService.updateById(businessScopeDictDO); + return ResponseData.generateCreatedResponse(0); + } + + @PostMapping("deleteBusinessScope") + @ApiOperation("删除经营范围:id/ID") + @LoginRequired + public ResponseVO deleteBusinessScope(@RequestBody BusinessScopeDictDO businessScopeDictDO) { + businessScopeDictService.removeById(businessScopeDictDO.getId()); + return ResponseData.generateCreatedResponse(0); + } + + @PostMapping("queryBusinessScopePage") + @ApiOperation("分页查询经营范围:businessScopeName/经营范围名称、pageNum/当前页数、pageSize/每页显示条数") + @LoginRequired + public ResponseVO queryBusinessScopePage(@RequestBody BusinessScopeDTO businessScopeDictDO) { + return ResponseData.generateCreatedResponse(0, businessScopeDictService.queryBusinessScopePage(businessScopeDictDO)); + } + +} diff --git a/src/main/java/com/subsidy/controller/ContentVodMappingController.java b/src/main/java/com/subsidy/controller/ContentVodMappingController.java new file mode 100644 index 0000000..756352a --- /dev/null +++ b/src/main/java/com/subsidy/controller/ContentVodMappingController.java @@ -0,0 +1,65 @@ +package com.subsidy.controller; + +import com.subsidy.common.ResponseData; +import com.subsidy.common.ResponseVO; +import com.subsidy.common.interceptor.LoginRequired; +import com.subsidy.dto.content.GetContendVodsDTO; +import com.subsidy.dto.contentVod.AddContentVod; +import com.subsidy.dto.contentVod.ContentVodDTO; +import com.subsidy.dto.vod.ChangeOrdersDTO; +import com.subsidy.service.ContentVodMappingService; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +/** + *+ * 目录视频关系表 前端控制器 + *
+ * + * @author DengMin + * @since 2022-07-19 + */ +@RestController +@Api(tags = "目录视频关系表") +@RequestMapping("/contentVodMapping") +public class ContentVodMappingController { + + @Autowired + private ContentVodMappingService contentVodMappingService; + + @PostMapping("getContendVods") + @ApiOperation("获取课程内容下的视频 {contentId vodName}") + @LoginRequired + public ResponseVO getContendVods(@RequestBody GetContendVodsDTO getContendVodsDTO) { + return ResponseData.generateCreatedResponse(0, contentVodMappingService.getContendVods(getContendVodsDTO)); + } + + @PostMapping("changeContentVodOrders") + @ApiOperation("课程内容视频排序 contentId/内容ID vodIds [] 视频的id") + public ResponseVO changeContentVodOrders(@RequestBody ChangeOrdersDTO changeOrdersDTO ){ + contentVodMappingService.changeContentVodOrders(changeOrdersDTO); + return ResponseData.generateCreatedResponse(0); + } + + @PostMapping("addContentVod") + @ApiOperation("添加课程内容视频:contentId/内容ID、vodIds [] /视频ID") + @LoginRequired + public ResponseVO addContentVod(@RequestBody AddContentVod addContentVod) { + contentVodMappingService.addContentVod(addContentVod); + return ResponseData.generateCreatedResponse(0); + } + + @PostMapping("deleteContentVod") + @ApiOperation("删除课程内容下的视频: contentId/内容ID 、 vodId/视频ID") + @LoginRequired + public ResponseVO deleteContentVod(@RequestBody ContentVodDTO contentVodDTO) { + contentVodMappingService.deleteContentVod(contentVodDTO); + return ResponseData.generateCreatedResponse(0); + } + +} diff --git a/src/main/java/com/subsidy/controller/CourseContentController.java b/src/main/java/com/subsidy/controller/CourseContentController.java index d98275e..2e55786 100644 --- a/src/main/java/com/subsidy/controller/CourseContentController.java +++ b/src/main/java/com/subsidy/controller/CourseContentController.java @@ -1,9 +1,10 @@ package com.subsidy.controller; - import com.subsidy.common.ResponseData; import com.subsidy.common.ResponseVO; import com.subsidy.common.interceptor.LoginRequired; +import com.subsidy.dto.content.GetContendVodsDTO; +import com.subsidy.dto.vod.ChangeOrdersDTO; import com.subsidy.model.CourseContentDO; import com.subsidy.service.CourseContentService; import com.subsidy.util.ConstantUtils; @@ -58,6 +59,4 @@ public class CourseContentController { public ResponseVO updateContent(@RequestBody CourseContentDO courseContentDO){ return ResponseData.generateCreatedResponse(0,courseContentService.updateContent(courseContentDO)); } - - } diff --git a/src/main/java/com/subsidy/controller/VodDictController.java b/src/main/java/com/subsidy/controller/VodDictController.java index 4caff49..e46b725 100644 --- a/src/main/java/com/subsidy/controller/VodDictController.java +++ b/src/main/java/com/subsidy/controller/VodDictController.java @@ -1,10 +1,8 @@ package com.subsidy.controller; - import com.subsidy.common.ResponseData; import com.subsidy.common.ResponseVO; import com.subsidy.common.interceptor.LoginRequired; -import com.subsidy.dto.content.GetContendVodsDTO; import com.subsidy.dto.vod.ChangeOrdersDTO; import com.subsidy.model.VodDictDO; import com.subsidy.service.VodDictService; @@ -39,38 +37,35 @@ public class VodDictController { return ResponseData.generateCreatedResponse(0, vodDictService.signature()); } - @PostMapping("getContendVods") - @ApiOperation("获取目录下的视频 {contentId vodName}") - @LoginRequired - public ResponseVO getContendVods(@RequestBody GetContendVodsDTO getContendVodsDTO) { - return ResponseData.generateCreatedResponse(0, vodDictService.getContendVods(getContendVodsDTO)); - } - @PostMapping("deleteVod") @ApiOperation("删除视频 id ") @LoginRequired public ResponseVO deleteVod(@RequestBody VodDictDO vodDictDO) { - return ResponseData.generateCreatedResponse(0, vodDictService.deleteVod(vodDictDO)); + vodDictService.deleteVod(vodDictDO); + return ResponseData.generateCreatedResponse(0); } @PostMapping("addVod") - @ApiOperation("新增视频 contentId vodName vodLength vodType vodSize vodUrl vodCode") + @ApiOperation("新增视频 labelId vodName vodLength vodType vodSize vodUrl vodCode") @LoginRequired public ResponseVO addVod(@RequestBody VodDictDO vodDictDO) { - return ResponseData.generateCreatedResponse(0, vodDictService.addVod(vodDictDO)); + vodDictService.addVod(vodDictDO); + return ResponseData.generateCreatedResponse(0, ConstantUtils.ADD_SUCCESS); } @PostMapping("updateVod") - @ApiOperation("新增视频 id contentId vodName vodLength vodType vodSize vodUrl vodCode") + @ApiOperation("新增视频 id labelId vodName vodLength vodType vodSize vodUrl vodCode") @LoginRequired public ResponseVO updateVod(@RequestBody VodDictDO vodDictDO) { - return ResponseData.generateCreatedResponse(0, vodDictService.updateVod(vodDictDO)); + vodDictService.updateVod(vodDictDO); + return ResponseData.generateCreatedResponse(0, ConstantUtils.SET_SUCCESS); } @PostMapping("changeOrders") @ApiOperation("排序 vodIds [] 视频的id") public ResponseVO changeOrders(@RequestBody ChangeOrdersDTO changeOrdersDTO ){ - return ResponseData.generateCreatedResponse(0,vodDictService.changeOrders(changeOrdersDTO)); + vodDictService.changeOrders(changeOrdersDTO); + return ResponseData.generateCreatedResponse(0,ConstantUtils.SET_SUCCESS); } } diff --git a/src/main/java/com/subsidy/controller/VodLabelDictController.java b/src/main/java/com/subsidy/controller/VodLabelDictController.java new file mode 100644 index 0000000..7525d6c --- /dev/null +++ b/src/main/java/com/subsidy/controller/VodLabelDictController.java @@ -0,0 +1,70 @@ +package com.subsidy.controller; + +import com.subsidy.common.ResponseData; +import com.subsidy.common.ResponseVO; +import com.subsidy.common.interceptor.LoginRequired; +import com.subsidy.dto.label.VodLabelPageDTO; +import com.subsidy.model.VodLabelDictDO; +import com.subsidy.service.VodLableDictService; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; + +/** + *+ * 视频库类目表 前端控制器 + *
+ * + * @author DengMin + * @since 2022-07-19 + */ +@RestController +@Api(tags = "视频库类目表") +@RequestMapping("/vodLabelDict") +public class VodLabelDictController { + + @Autowired + private VodLableDictService vodLableDictService; + + @PostMapping(value = "addVodLabel") + @ApiOperation("添加视频类目: labelName/类目名称") + @LoginRequired + public ResponseVO addVodLabel(@RequestBody VodLabelDictDO vodLabelDictDO) { + vodLableDictService.save(vodLabelDictDO); + return ResponseData.generateCreatedResponse(0); + } + + @PostMapping(value = "updateVodLabel") + @ApiOperation("添加视频类目: id/类目ID、labelName/类目名称") + @LoginRequired + public ResponseVO updateVodLabel(@RequestBody VodLabelDictDO vodLabelDictDO) { + vodLableDictService.updateById(vodLabelDictDO); + return ResponseData.generateCreatedResponse(0); + } + + @PostMapping(value = "deleteVodLabel") + @ApiOperation("添加视频类目: id/类目ID") + @LoginRequired + public ResponseVO deleteVodLabel(@RequestBody VodLabelDictDO vodLabelDictDO) { + vodLableDictService.removeById(vodLabelDictDO.getId()); + return ResponseData.generateCreatedResponse(0); + } + + @PostMapping(value = "queryVodLabelPage") + @ApiOperation("分页查询视频类目: labelName/名称、pageNum/但前页数、pageSize/每页显示条数") + @LoginRequired + public ResponseVO queryVodLabelPage(@RequestBody VodLabelPageDTO vodLabelPageDTO) { + return ResponseData.generateCreatedResponse(0, vodLableDictService.queryVodLabelPage(vodLabelPageDTO)); + } + + @PostMapping(value = "queryVodLabel") + @ApiOperation("查询全部视频类目") + @LoginRequired + public ResponseVO queryVodLabel() { + return ResponseData.generateCreatedResponse(0, vodLableDictService.list()); + } +} diff --git a/src/main/java/com/subsidy/dto/businessScope/BusinessScopeDTO.java b/src/main/java/com/subsidy/dto/businessScope/BusinessScopeDTO.java new file mode 100644 index 0000000..2e4491e --- /dev/null +++ b/src/main/java/com/subsidy/dto/businessScope/BusinessScopeDTO.java @@ -0,0 +1,13 @@ +package com.subsidy.dto.businessScope; + +import lombok.Data; + +@Data +public class BusinessScopeDTO { + + private String businessScopeName; + + private Integer pageNum; + + private Integer pageSize; +} diff --git a/src/main/java/com/subsidy/dto/contentVod/AddContentVod.java b/src/main/java/com/subsidy/dto/contentVod/AddContentVod.java new file mode 100644 index 0000000..8bee165 --- /dev/null +++ b/src/main/java/com/subsidy/dto/contentVod/AddContentVod.java @@ -0,0 +1,13 @@ +package com.subsidy.dto.contentVod; + +import lombok.Data; + +import java.util.List; + +@Data +public class AddContentVod { + + private List+ * 经营范围表 Mapper 接口 + *
+ * + * @author DengMin + * @since 2022-07-25 + */ + @Repository +public interface BusinessScopeDictMapper extends BaseMapper+ * 目录视频关系表 Mapper 接口 + *
+ * + * @author DengMin + * @since 2022-07-19 + */ + @Repository +public interface ContentVodMappingMapper extends BaseMapper+ * 视频库类目表 Mapper 接口 + *
+ * + * @author DengMin + * @since 2022-07-19 + */ + @Repository +public interface VodLabelDictMapper extends BaseMapper+ * 经营范围表 + *
+ * + * @author DengMin + * @since 2022-07-25 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("business_scope_dict") +public class BusinessScopeDictDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 经营范围名称 + */ + private String businessScopeName; + + +} diff --git a/src/main/java/com/subsidy/model/ContentVodMappingDO.java b/src/main/java/com/subsidy/model/ContentVodMappingDO.java new file mode 100644 index 0000000..98365e0 --- /dev/null +++ b/src/main/java/com/subsidy/model/ContentVodMappingDO.java @@ -0,0 +1,44 @@ +package com.subsidy.model; + +import com.subsidy.util.BaseModel; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *+ * 目录视频关系表 + *
+ * + * @author DengMin + * @since 2022-07-19 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("content_vod_mapping") +public class ContentVodMappingDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 课程目录ID + */ + private Long contentId; + + /** + * 视频ID + */ + private Long vodId; + + /** + * 视频排序 + */ + private Integer orderNo; + + +} diff --git a/src/main/java/com/subsidy/model/VodDictDO.java b/src/main/java/com/subsidy/model/VodDictDO.java index 8f4937c..e65ed9f 100644 --- a/src/main/java/com/subsidy/model/VodDictDO.java +++ b/src/main/java/com/subsidy/model/VodDictDO.java @@ -26,9 +26,9 @@ public class VodDictDO extends BaseModel { private Long id; /** - * 目录id + * 类目id */ - private Long contentId; + private Long labelId; /** * 视频名称 diff --git a/src/main/java/com/subsidy/model/VodLabelDictDO.java b/src/main/java/com/subsidy/model/VodLabelDictDO.java new file mode 100644 index 0000000..192431a --- /dev/null +++ b/src/main/java/com/subsidy/model/VodLabelDictDO.java @@ -0,0 +1,34 @@ +package com.subsidy.model; + +import com.subsidy.util.BaseModel; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + *+ * 视频库类目表 + *
+ * + * @author DengMin + * @since 2022-07-19 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@TableName("vod_label_dict") +public class VodLabelDictDO extends BaseModel { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Long id; + + /** + * 视频类目名称 + */ + private String labelName; + + +} diff --git a/src/main/java/com/subsidy/service/BusinessScopeDictService.java b/src/main/java/com/subsidy/service/BusinessScopeDictService.java new file mode 100644 index 0000000..10b089a --- /dev/null +++ b/src/main/java/com/subsidy/service/BusinessScopeDictService.java @@ -0,0 +1,19 @@ +package com.subsidy.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.subsidy.dto.businessScope.BusinessScopeDTO; +import com.subsidy.model.BusinessScopeDictDO; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *+ * 经营范围表 服务类 + *
+ * + * @author DengMin + * @since 2022-07-25 + */ +public interface BusinessScopeDictService extends IService+ * 目录视频关系表 服务类 + *
+ * + * @author DengMin + * @since 2022-07-19 + */ +public interface ContentVodMappingService extends IService
* 视频表 服务类
@@ -22,13 +17,11 @@ public interface VodDictService extends IService
+ * 视频库类目表 服务类
+ *
+ * 经营范围表 服务实现类
+ *
+ * 目录视频关系表 服务实现类
+ *
+ * 视频库类目表 服务实现类
+ *
@@ -32,19 +43,52 @@ public class WebSocketUtil implements WebSocketHandler {
/**
* 存放建立连接webSocket对象
*/
- private static CopyOnWriteArraySet