|
|
@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
|
import com.zh.project0512.annotation.AdminCheckAuthorityAnnotation;
|
|
|
|
import com.zh.project0512.annotation.AdminCheckAuthorityAnnotation;
|
|
|
|
import com.zh.project0512.annotation.AdminTokenValid;
|
|
|
|
import com.zh.project0512.annotation.AdminTokenValid;
|
|
|
|
import com.zh.project0512.model.*;
|
|
|
|
import com.zh.project0512.model.*;
|
|
|
|
|
|
|
|
import com.zh.project0512.model.vo.FileUploadParamVo;
|
|
|
|
import com.zh.project0512.service.IReferenceBrandService;
|
|
|
|
import com.zh.project0512.service.IReferenceBrandService;
|
|
|
|
import com.zh.project0512.service.IReferenceService;
|
|
|
|
import com.zh.project0512.service.IReferenceService;
|
|
|
|
import com.zh.project0512.service.IReferenceTagService;
|
|
|
|
import com.zh.project0512.service.IReferenceTagService;
|
|
|
@ -62,7 +63,7 @@ public class ReferenceController {
|
|
|
|
private Integer groupId;
|
|
|
|
private Integer groupId;
|
|
|
|
@Schema(title = "文件地址列表")
|
|
|
|
@Schema(title = "文件地址列表")
|
|
|
|
@NotEmpty(message = "fileUrl列表不能为空")
|
|
|
|
@NotEmpty(message = "fileUrl列表不能为空")
|
|
|
|
private List<String> fileUrlList;
|
|
|
|
private List<FileUploadParamVo> fileUrlList;
|
|
|
|
@Schema(title = "封面图片地址", description = "视频文件请上传封面图片")
|
|
|
|
@Schema(title = "封面图片地址", description = "视频文件请上传封面图片")
|
|
|
|
private String coverUrl;
|
|
|
|
private String coverUrl;
|
|
|
|
@Schema(title = "时长", description = "视频文件请上传时长")
|
|
|
|
@Schema(title = "时长", description = "视频文件请上传时长")
|
|
|
@ -78,15 +79,23 @@ public class ReferenceController {
|
|
|
|
@AdminTokenValid
|
|
|
|
@AdminTokenValid
|
|
|
|
@AdminCheckAuthorityAnnotation(jurisdictionId = "7")
|
|
|
|
@AdminCheckAuthorityAnnotation(jurisdictionId = "7")
|
|
|
|
public Result add(@Validated @RequestBody AddRParam param) {
|
|
|
|
public Result add(@Validated @RequestBody AddRParam param) {
|
|
|
|
List<String> list = param.getFileUrlList();
|
|
|
|
List<FileUploadParamVo> list = param.getFileUrlList();
|
|
|
|
List<Reference> l = new ArrayList<>();
|
|
|
|
List<Reference> l = new ArrayList<>();
|
|
|
|
// List<TopicActivity> ta = new ArrayList<>();
|
|
|
|
// List<TopicActivity> ta = new ArrayList<>();
|
|
|
|
List<Integer> tagList = param.getTagList();
|
|
|
|
List<Integer> tagList = param.getTagList();
|
|
|
|
List<Integer> brandList = param.getBrandList();
|
|
|
|
List<Integer> brandList = param.getBrandList();
|
|
|
|
for (String e : list) {
|
|
|
|
for (FileUploadParamVo e : list) {
|
|
|
|
if (e.lastIndexOf(".") != -1) {
|
|
|
|
String url = e.getUrl();
|
|
|
|
l.add(new Reference().setTitle(param.getTitle()).setGroupId(param.getGroupId()).setCoverUrl(param.getCoverUrl()).setCreatAt(LocalDateTime.now())
|
|
|
|
if (url != null && url.lastIndexOf(".") != -1) {
|
|
|
|
.setFileUrl(e).setType(FileTypeUtil.getcontentTypeNum(e.substring(e.lastIndexOf(".")))).setDuration(param.getDuration()));
|
|
|
|
l.add(new Reference()
|
|
|
|
|
|
|
|
.setTitle(param.getTitle())
|
|
|
|
|
|
|
|
.setGroupId(param.getGroupId())
|
|
|
|
|
|
|
|
.setCoverUrl(param.getCoverUrl())
|
|
|
|
|
|
|
|
.setCreatAt(LocalDateTime.now())
|
|
|
|
|
|
|
|
.setDuration(e.getDuration())
|
|
|
|
|
|
|
|
.setFileUrl(url)
|
|
|
|
|
|
|
|
.setType(FileTypeUtil.getcontentTypeNum(url.substring(url.lastIndexOf("."))))
|
|
|
|
|
|
|
|
);
|
|
|
|
// ta.add(new TopicActivity().setTitle(param.getTitle()).setCover(param.getCoverUrl()).setCreatAt(LocalDateTime.now())
|
|
|
|
// ta.add(new TopicActivity().setTitle(param.getTitle()).setCover(param.getCoverUrl()).setCreatAt(LocalDateTime.now())
|
|
|
|
// .setContent(e).setType(FileTypeUtil.getcontentTypeNum(e.substring(e.lastIndexOf(".")))));
|
|
|
|
// .setContent(e).setType(FileTypeUtil.getcontentTypeNum(e.substring(e.lastIndexOf(".")))));
|
|
|
|
}
|
|
|
|
}
|
|
|
|