时长信息转到video主体 增加多线程获取时间方法
This commit is contained in:
10
pom.xml
10
pom.xml
@@ -487,16 +487,6 @@
|
|||||||
<enabled>true</enabled>
|
<enabled>true</enabled>
|
||||||
</releases>
|
</releases>
|
||||||
</repository>
|
</repository>
|
||||||
<repository>
|
|
||||||
<id>central</id>
|
|
||||||
<url>https://maven.aliyun.com/repository/central</url>
|
|
||||||
<releases>
|
|
||||||
<enabled>true</enabled>
|
|
||||||
</releases>
|
|
||||||
<snapshots>
|
|
||||||
<enabled>true</enabled>
|
|
||||||
</snapshots>
|
|
||||||
</repository>
|
|
||||||
<repository>
|
<repository>
|
||||||
<id>com.e-iceblue</id>
|
<id>com.e-iceblue</id>
|
||||||
<url>https://repo.e-iceblue.cn/repository/maven-public/</url>
|
<url>https://repo.e-iceblue.cn/repository/maven-public/</url>
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ import com.aliyun.vod20170321.models.GetVideoPlayAuthResponse;
|
|||||||
import com.peanut.common.utils.SpdbUtil;
|
import com.peanut.common.utils.SpdbUtil;
|
||||||
import com.peanut.modules.common.dao.CourseCatalogueChapterVideoDao;
|
import com.peanut.modules.common.dao.CourseCatalogueChapterVideoDao;
|
||||||
import com.peanut.modules.common.entity.CourseCatalogueChapterVideoEntity;
|
import com.peanut.modules.common.entity.CourseCatalogueChapterVideoEntity;
|
||||||
import com.peanut.modules.common.entity.UserCourseVideoPositionEntity;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.scheduling.annotation.Async;
|
import org.springframework.scheduling.annotation.Async;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|||||||
@@ -40,4 +40,16 @@ public class ShopProductController {
|
|||||||
return R.ok().put("result", res);
|
return R.ok().put("result", res);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@RequestMapping("/getProductDetail")
|
||||||
|
public R getProductDetail(@RequestBody Map<String,Integer> map){
|
||||||
|
Map<String, Object> detail = shopProductService.getProductDetail(map.get("productId"));
|
||||||
|
return R.ok().put("detail",detail);
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping("/editProductDetail")
|
||||||
|
public R editProductDetail(@RequestBody ShopProduct shopProduct){
|
||||||
|
shopProductService.updateById(shopProduct);
|
||||||
|
return R.ok();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,5 +3,9 @@ package com.peanut.modules.master.service;
|
|||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.peanut.modules.common.entity.ShopProduct;
|
import com.peanut.modules.common.entity.ShopProduct;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
public interface ShopProductService extends IService<ShopProduct> {
|
public interface ShopProductService extends IService<ShopProduct> {
|
||||||
|
|
||||||
|
Map<String,Object> getProductDetail(Integer productId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,7 +7,18 @@ import com.peanut.modules.master.service.ShopProductService;
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Service("masterShopProductService")
|
@Service("masterShopProductService")
|
||||||
public class ShopProductServiceImpl extends ServiceImpl<ShopProductDao, ShopProduct> implements ShopProductService {
|
public class ShopProductServiceImpl extends ServiceImpl<ShopProductDao, ShopProduct> implements ShopProductService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, Object> getProductDetail(Integer productId) {
|
||||||
|
ShopProduct detail = this.getById(productId);
|
||||||
|
HashMap<String, Object> flag = new HashMap<>();
|
||||||
|
flag.put("detail",detail);
|
||||||
|
return flag;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,8 +17,8 @@ import com.peanut.modules.master.service.CourseCatalogueChapterVideoService;
|
|||||||
import com.peanut.modules.sociology.service.CourseCatalogueChapterService;
|
import com.peanut.modules.sociology.service.CourseCatalogueChapterService;
|
||||||
import com.peanut.modules.sociology.service.CourseService;
|
import com.peanut.modules.sociology.service.CourseService;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.bytedeco.javacv.FFmpegFrameGrabber;
|
//import org.bytedeco.javacv.FFmpegFrameGrabber;
|
||||||
import org.bytedeco.javacv.FrameGrabber;
|
//import org.bytedeco.javacv.FrameGrabber;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@RestController("sociologyProduct")
|
@RestController("sociologyProduct")
|
||||||
@@ -33,4 +34,11 @@ public class ShopProductController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@RequestMapping("/getProductDetail")
|
||||||
|
public R getProductDetail(@RequestBody Map<String,Integer> map){
|
||||||
|
Map<String, Object> detail = shopProductService.getProductDetail(map.get("productId"));
|
||||||
|
return R.ok().put("data",detail);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,10 +6,13 @@ import com.peanut.modules.common.entity.ShopProduct;
|
|||||||
import com.peanut.modules.common.to.ParamTo;
|
import com.peanut.modules.common.to.ParamTo;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
public interface ShopProductService extends IService<ShopProduct> {
|
public interface ShopProductService extends IService<ShopProduct> {
|
||||||
|
|
||||||
Page getMarketProductList(ParamTo param);
|
Page getMarketProductList(ParamTo param);
|
||||||
|
|
||||||
List<ShopProduct> getProductListForCourse(Integer CatalogueId);
|
List<ShopProduct> getProductListForCourse(Integer CatalogueId);
|
||||||
|
|
||||||
|
Map<String,Object> getProductDetail(Integer productId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,24 +3,30 @@ package com.peanut.modules.sociology.service.impl;
|
|||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||||
|
import com.peanut.modules.common.dao.BookDao;
|
||||||
|
import com.peanut.modules.common.dao.ShopProductBookDao;
|
||||||
import com.peanut.modules.common.dao.ShopProductCourseDao;
|
import com.peanut.modules.common.dao.ShopProductCourseDao;
|
||||||
import com.peanut.modules.common.dao.ShopProductDao;
|
import com.peanut.modules.common.dao.ShopProductDao;
|
||||||
import com.peanut.modules.common.entity.ShopProduct;
|
import com.peanut.modules.common.entity.*;
|
||||||
import com.peanut.modules.common.entity.ShopProductCourseEntity;
|
|
||||||
import com.peanut.modules.common.entity.ShopProductToSociologyMarket;
|
|
||||||
import com.peanut.modules.common.to.ParamTo;
|
import com.peanut.modules.common.to.ParamTo;
|
||||||
import com.peanut.modules.sociology.service.ShopProductService;
|
import com.peanut.modules.sociology.service.ShopProductService;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Service("sociologyShopProduct")
|
@Service("sociologyShopProduct")
|
||||||
public class ShopProductServiceImpl extends ServiceImpl<ShopProductDao, ShopProduct> implements ShopProductService {
|
public class ShopProductServiceImpl extends ServiceImpl<ShopProductDao, ShopProduct> implements ShopProductService {
|
||||||
@Autowired
|
@Autowired
|
||||||
private ShopProductCourseDao shopProductCourseDao;
|
private ShopProductCourseDao shopProductCourseDao;
|
||||||
|
@Autowired
|
||||||
|
private ShopProductBookDao shopProductBookDao;
|
||||||
|
@Autowired
|
||||||
|
private BookDao bookDao;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Page getMarketProductList(ParamTo param) {
|
public Page getMarketProductList(ParamTo param) {
|
||||||
@@ -32,7 +38,6 @@ public class ShopProductServiceImpl extends ServiceImpl<ShopProductDao, ShopProd
|
|||||||
return shopProductPage;
|
return shopProductPage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<ShopProduct> getProductListForCourse(Integer catalogueId) {
|
public List<ShopProduct> getProductListForCourse(Integer catalogueId) {
|
||||||
MPJLambdaWrapper<ShopProductCourseEntity> wrapper = new MPJLambdaWrapper<>();
|
MPJLambdaWrapper<ShopProductCourseEntity> wrapper = new MPJLambdaWrapper<>();
|
||||||
@@ -43,4 +48,27 @@ public class ShopProductServiceImpl extends ServiceImpl<ShopProductDao, ShopProd
|
|||||||
List<ShopProduct> shopProducts = shopProductCourseDao.selectJoinList(ShopProduct.class, wrapper);
|
List<ShopProduct> shopProducts = shopProductCourseDao.selectJoinList(ShopProduct.class, wrapper);
|
||||||
return shopProducts;
|
return shopProducts;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, Object> getProductDetail(Integer productId) {
|
||||||
|
ShopProduct product = this.getById(productId);
|
||||||
|
HashMap<String, Object> flag = new HashMap<>();
|
||||||
|
flag.put("detail",product);//基础信息
|
||||||
|
//查询包含的书
|
||||||
|
MPJLambdaWrapper<ShopProductBookEntity> shopProductBookEntityMPJLambdaWrapper = new MPJLambdaWrapper<>();
|
||||||
|
shopProductBookEntityMPJLambdaWrapper.selectAll(BookEntity.class);
|
||||||
|
shopProductBookEntityMPJLambdaWrapper.leftJoin(BookEntity.class,BookEntity::getId,ShopProductBookEntity::getBookId);
|
||||||
|
shopProductBookEntityMPJLambdaWrapper.eq(ShopProductBookEntity::getProductId,productId);
|
||||||
|
List<BookEntity> bookEntities = shopProductBookDao.selectJoinList(BookEntity.class, shopProductBookEntityMPJLambdaWrapper);
|
||||||
|
flag.put("books",bookEntities);
|
||||||
|
//查询包含的课
|
||||||
|
MPJLambdaWrapper<ShopProductCourseEntity> shopProductCourseEntityMPJLambdaWrapper = new MPJLambdaWrapper<>();
|
||||||
|
shopProductCourseEntityMPJLambdaWrapper.selectAll(CourseEntity.class);
|
||||||
|
shopProductCourseEntityMPJLambdaWrapper.leftJoin(CourseEntity.class,CourseEntity::getId,ShopProductCourseEntity::getCourseId);
|
||||||
|
shopProductCourseEntityMPJLambdaWrapper.eq(ShopProductCourseEntity::getProductId,productId);
|
||||||
|
List<CourseEntity> courseEntities = shopProductCourseDao.selectJoinList(CourseEntity.class, shopProductCourseEntityMPJLambdaWrapper);
|
||||||
|
flag.put("courses",courseEntities);
|
||||||
|
|
||||||
|
return flag;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user