|
|
@@ -3,7 +3,7 @@ package cn.reghao.tnb.content.app.vod.service.impl;
|
|
|
import cn.reghao.jutil.jdk.db.Page;
|
|
|
import cn.reghao.jutil.jdk.db.PageList;
|
|
|
import cn.reghao.tnb.content.api.dto.VideoRegion;
|
|
|
-import cn.reghao.tnb.content.app.vod.db.mapper.VideoCategoryMapper;
|
|
|
+import cn.reghao.tnb.content.app.vod.db.mapper.PostCategoryMapper;
|
|
|
import cn.reghao.tnb.content.app.vod.db.mapper.VideoCategoryPostMapper;
|
|
|
import cn.reghao.tnb.content.app.vod.model.dto.CategoryAdd;
|
|
|
import cn.reghao.tnb.content.app.vod.model.po.PostCategory;
|
|
|
@@ -24,13 +24,13 @@ import java.util.stream.Collectors;
|
|
|
*/
|
|
|
@Service
|
|
|
public class CategoryServiceImpl implements CategoryService {
|
|
|
- private final VideoCategoryMapper videoCategoryMapper;
|
|
|
+ private final PostCategoryMapper postCategoryMapper;
|
|
|
private final RedisStringObject redisStringObject;
|
|
|
private final VideoCategoryPostMapper videoCategoryPostMapper;
|
|
|
|
|
|
- public CategoryServiceImpl(VideoCategoryMapper videoCategoryMapper, RedisStringObject redisStringObject,
|
|
|
+ public CategoryServiceImpl(PostCategoryMapper postCategoryMapper, RedisStringObject redisStringObject,
|
|
|
VideoCategoryPostMapper videoCategoryPostMapper) {
|
|
|
- this.videoCategoryMapper = videoCategoryMapper;
|
|
|
+ this.postCategoryMapper = postCategoryMapper;
|
|
|
this.redisStringObject = redisStringObject;
|
|
|
this.videoCategoryPostMapper = videoCategoryPostMapper;
|
|
|
}
|
|
|
@@ -74,21 +74,21 @@ public class CategoryServiceImpl implements CategoryService {
|
|
|
int pageNumber = 1;
|
|
|
int pageSize = 1000;
|
|
|
Page page = new Page(pageNumber, pageSize);
|
|
|
- List<PostCategory> list = videoCategoryMapper.findVideoCategoryByPage(page, categoryQuery);
|
|
|
+ List<PostCategory> list = postCategoryMapper.findVideoCategoryByPage(page, categoryQuery);
|
|
|
if (list.isEmpty()) {
|
|
|
initVideoCategory();
|
|
|
}
|
|
|
|
|
|
- return videoCategoryMapper.findVideoCategoryByPage(page, categoryQuery);
|
|
|
+ return postCategoryMapper.findVideoCategoryByPage(page, categoryQuery);
|
|
|
}
|
|
|
|
|
|
private void initVideoCategory() {
|
|
|
PostCategory postCategory1 = new PostCategory(0, "大杂烩");
|
|
|
- videoCategoryMapper.save(postCategory1);
|
|
|
+ postCategoryMapper.save(postCategory1);
|
|
|
|
|
|
int pid = postCategory1.getId();
|
|
|
PostCategory postCategory2 = new PostCategory(pid, "杂");
|
|
|
- videoCategoryMapper.save(postCategory2);
|
|
|
+ postCategoryMapper.save(postCategory2);
|
|
|
}
|
|
|
|
|
|
private void setVideoCategory(List<PostCategory> list) {
|
|
|
@@ -115,7 +115,7 @@ public class CategoryServiceImpl implements CategoryService {
|
|
|
public void addVideoCategory(CategoryAdd categoryAdd) {
|
|
|
PostCategory postCategory1 = new PostCategory(categoryAdd);
|
|
|
List<PostCategory> list = List.of(postCategory1);
|
|
|
- videoCategoryMapper.saveAll(list);
|
|
|
+ postCategoryMapper.saveAll(list);
|
|
|
}
|
|
|
|
|
|
@Override
|