Commit 93db1527 authored by liqin's avatar liqin 💬

bug fixed

parent 7f3e7a0f
package cn.wisenergy.chnmuseum.party.common.dfs; package cn.wisenergy.chnmuseum.party.common.dfs;
import cn.wisenergy.chnmuseum.party.common.mvc.InterfaceException; import cn.wisenergy.chnmuseum.party.common.mvc.InterfaceException;
import cn.wisenergy.chnmuseum.party.common.util.*; import cn.wisenergy.chnmuseum.party.common.util.CopyStreamUtils;
import cn.wisenergy.chnmuseum.party.common.util.FileTypeUtil;
import cn.wisenergy.chnmuseum.party.common.util.FileUtil;
import com.github.tobato.fastdfs.domain.fdfs.FileInfo; import com.github.tobato.fastdfs.domain.fdfs.FileInfo;
import com.github.tobato.fastdfs.domain.fdfs.MetaData; import com.github.tobato.fastdfs.domain.fdfs.MetaData;
import com.github.tobato.fastdfs.domain.fdfs.StorePath; import com.github.tobato.fastdfs.domain.fdfs.StorePath;
...@@ -23,9 +25,7 @@ import java.io.ByteArrayInputStream; ...@@ -23,9 +25,7 @@ import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream; import java.io.ByteArrayOutputStream;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.time.LocalDateTime;
import java.util.HashMap; import java.util.HashMap;
import java.util.HashSet;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
...@@ -53,23 +53,13 @@ public class FastDFSUtils { ...@@ -53,23 +53,13 @@ public class FastDFSUtils {
FastDFSUtils.imageConfig = thumbImageConfig; FastDFSUtils.imageConfig = thumbImageConfig;
} }
public static String uploadFile(InputStream inputStream, long size, String fileName) {
final Set<MetaData> metaDataSet = new HashSet<>();
metaDataSet.add(new MetaData("fileName", fileName));
metaDataSet.add(new MetaData("fileSize", size + ""));
metaDataSet.add(new MetaData("fileExtName", FilenameUtils.getExtension(fileName)));
metaDataSet.add(new MetaData("updateTime", TimeUtils.format(LocalDateTime.now(), TimeUtils.FORMAT_ONE)));
final StorePath storePath = storageClient.uploadFile(inputStream, size, FilenameUtils.getExtension(fileName), metaDataSet);
return dfsFileAccessBasePath + "/" + storePath.getFullPath();
}
public static Map<String, Object> uploadUeImage(InputStream inputStream, long fileSize, String fileName) { public static Map<String, Object> uploadUeImage(InputStream inputStream, long fileSize, String fileName) {
boolean isImage = FileTypeUtil.isImageByExtension(fileName); boolean isImage = FileTypeUtil.isImageByExtension(fileName);
if (isImage) { if (isImage) {
String mimeType = FileUtil.getMimeType(fileName); String mimeType = FileUtil.getMimeType(fileName);
final String storePath = FastDFSUtils.uploadFile(inputStream, fileSize, fileName); final String storePath = FastDFSUtils.uploadFile(inputStream, fileSize, fileName, null);
Map<String, Object> uploadResult = new HashMap<>(); Map<String, Object> uploadResult = new HashMap<>();
uploadResult.put("url", dfsFileAccessBasePath + "/" + storePath); uploadResult.put("url", storePath);
uploadResult.put("status", true); uploadResult.put("status", true);
uploadResult.put("message", "文件上传成功!"); uploadResult.put("message", "文件上传成功!");
uploadResult.put("title", fileName); uploadResult.put("title", fileName);
...@@ -80,16 +70,16 @@ public class FastDFSUtils { ...@@ -80,16 +70,16 @@ public class FastDFSUtils {
throw new InterfaceException("400", "文件不是图片类型"); throw new InterfaceException("400", "文件不是图片类型");
} }
public static String uploadVideo(InputStream inputStream, long size, String fileName) { public static String uploadFile(InputStream inputStream, long size, String fileName, Set<MetaData> metaDataSet) {
final StorePath storePath = storageClient.uploadFile(inputStream, size, FilenameUtils.getExtension(fileName), metaDataSet);
return dfsFileAccessBasePath + "/" + storePath.getFullPath();
}
public static String uploadVideo(InputStream inputStream, long size, String fileName, Set<MetaData> metaDataSet) {
Map<String, Object> map = CopyStreamUtils.copyInputStream(inputStream); Map<String, Object> map = CopyStreamUtils.copyInputStream(inputStream);
String md5 = (String) map.get("md5"); String md5 = (String) map.get("md5");
InputStream is = (InputStream) map.get("inputStream");
final Set<MetaData> metaDataSet = new HashSet<>();
metaDataSet.add(new MetaData("fileName", fileName));
metaDataSet.add(new MetaData("fileSize", size + ""));
metaDataSet.add(new MetaData("updateTime", TimeUtils.format(LocalDateTime.now(), TimeUtils.FORMAT_ONE)));
metaDataSet.add(new MetaData("MD5", md5)); metaDataSet.add(new MetaData("MD5", md5));
InputStream is = (InputStream) map.get("inputStream");
final StorePath storePath = storageClient.uploadFile(is, size, FilenameUtils.getExtension(fileName), metaDataSet); final StorePath storePath = storageClient.uploadFile(is, size, FilenameUtils.getExtension(fileName), metaDataSet);
return dfsFileAccessBasePath + "/" + storePath.getFullPath(); return dfsFileAccessBasePath + "/" + storePath.getFullPath();
} }
...@@ -97,12 +87,11 @@ public class FastDFSUtils { ...@@ -97,12 +87,11 @@ public class FastDFSUtils {
/** /**
* 使用 FastDFS 提供的客户端 storageClient 来进行文件上传,最后将上传结果返回。 * 使用 FastDFS 提供的客户端 storageClient 来进行文件上传,最后将上传结果返回。
* 根据 groupName 和文件名获取文件信息。 * 根据 groupName 和文件名获取文件信息。
*
* @param groupName
* @param path
* @return
*/ */
public static FileInfo getFileInfo(String groupName, String path) { public static FileInfo getFileInfo(String fileUrl) {
fileUrl = fileUrl.replace(dfsFileAccessBasePath + "/", "");
String groupName = fileUrl.substring(0, fileUrl.indexOf("/"));
String path = fileUrl.substring(fileUrl.indexOf("/") + 1);
return storageClient.queryFileInfo(groupName, path); return storageClient.queryFileInfo(groupName, path);
} }
......
...@@ -5,7 +5,7 @@ package cn.wisenergy.chnmuseum.party.common.enums; ...@@ -5,7 +5,7 @@ package cn.wisenergy.chnmuseum.party.common.enums;
*/ */
public enum AuditTypeEnum { public enum AuditTypeEnum {
ASSET(1, "视频内容"), VIDEO_CONTENT(1, "视频内容"),
EXHIBITION_BOARD(2, "展板内容"), EXHIBITION_BOARD(2, "展板内容"),
LEARNING_CONTENT(3, "学习内容"), LEARNING_CONTENT(3, "学习内容"),
ACCOUNT(4, "账户"); ACCOUNT(4, "账户");
...@@ -13,12 +13,12 @@ public enum AuditTypeEnum { ...@@ -13,12 +13,12 @@ public enum AuditTypeEnum {
// 错误编码 // 错误编码
private Integer code; private Integer code;
// 信息 // 信息
private String operation; private String type;
// 相应编码有参构造函数 // 相应编码有参构造函数
AuditTypeEnum(Integer code, String operation) { AuditTypeEnum(Integer code, String type) {
this.code = code; this.code = code;
this.operation = operation; this.type = type;
} }
public Integer getCode() { public Integer getCode() {
...@@ -29,12 +29,11 @@ public enum AuditTypeEnum { ...@@ -29,12 +29,11 @@ public enum AuditTypeEnum {
this.code = code; this.code = code;
} }
public String getOperation() { public String getType() {
return operation; return type;
} }
public void setOperation(String operation) { public void setType(String type) {
this.operation = operation; this.type = type;
} }
} }
package cn.wisenergy.chnmuseum.party.common.enums;
public enum FileCatEnum {
VIDEO_CONTENT("VIDEO_CONTENT", "视频内容"),
EXHIBITION_BOARD_AUDIO("EXHIBITION_BOARD_AUDIO", "展板音频"),
EXHIBITION_BOARD_VIDEO("EXHIBITION_BOARD_VIDEO", "展板视频"),
EXHIBITION_BOARD_DATUM("EXHIBITION_BOARD_DATUM", "展板参考资料"),
LEARNING_CONTENT("LEARNING_CONTENT", "学习内容"),
LEARNING_PROJECT("LEARNING_PROJECT", "学习项目");
private String cat;
private String name;
FileCatEnum(String cat, String name) {
this.cat = cat;
this.name = name;
}
public String getCat() {
return cat;
}
public void setCat(String cat) {
this.cat = cat;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
...@@ -2,10 +2,10 @@ package cn.wisenergy.chnmuseum.party.common.enums; ...@@ -2,10 +2,10 @@ package cn.wisenergy.chnmuseum.party.common.enums;
public enum FileTypeEnum { public enum FileTypeEnum {
DATUM("Datum", "资料"), DOCUMENT("DOCUMENT", "文档"),
IMAGE("Image", "图片"), IMAGE("IMAGE", "图片"),
AUDIO("Audio", "音频"), AUDIO("AUDIO", "音频"),
VIDEO("Video", "视频"); VIDEO("VIDEO", "视频");
// 错误编码 // 错误编码
private String type; private String type;
......
...@@ -3,9 +3,9 @@ package cn.wisenergy.chnmuseum.party.common.mybatis; ...@@ -3,9 +3,9 @@ package cn.wisenergy.chnmuseum.party.common.mybatis;
public class MysqlGenerator { public class MysqlGenerator {
private static final String[] tableNames = new String[]{ private static final String[] tableNames = new String[]{
"t_audit" "asset", "video_content", "video_content_cat"
}; };
// private static final String projectPath = "D:\\develop\\Project\\chnmuseum-party"; // private static final String projectPath = "D:\\develop\\Project\\chnmuseum-party";
private static final String projectPath = "/opt/ss"; private static final String projectPath = "/opt/ss";
public static void main(String[] args) { public static void main(String[] args) {
......
...@@ -11,7 +11,7 @@ import java.util.List; ...@@ -11,7 +11,7 @@ import java.util.List;
import java.util.Map; import java.util.Map;
public class ImportExcelUtil { public class ImportExcelUtil {
// abc.xls
public static boolean isXls(String fileName) { public static boolean isXls(String fileName) {
// (?i)忽略大小写 // (?i)忽略大小写
if (fileName.matches("^.+\\.(?i)(xls)$")) { if (fileName.matches("^.+\\.(?i)(xls)$")) {
......
...@@ -45,11 +45,11 @@ public abstract class BasePageOrderParam extends BasePageParam { ...@@ -45,11 +45,11 @@ public abstract class BasePageOrderParam extends BasePageParam {
@ApiModelProperty("版权方类型") @ApiModelProperty("版权方类型")
private String ownerType; private String ownerType;
@ApiModelProperty("视频分类ID") @ApiModelProperty("视频内容分类ID")
private String assetTypeId; private String videoContentCatId;
@ApiModelProperty("视频版权方ID") @ApiModelProperty("视频内容版权方ID")
private String assetCopyrightOwnerId; private String videoContentCopyrightOwnerId;
@ApiModelProperty("展板版权方ID") @ApiModelProperty("展板版权方ID")
private String boardCopyrightOwnerId; private String boardCopyrightOwnerId;
......
package cn.wisenergy.chnmuseum.party.common.vo; package cn.wisenergy.chnmuseum.party.common.vo;
import cn.wisenergy.chnmuseum.party.model.Asset;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
...@@ -17,6 +18,7 @@ import java.util.List; ...@@ -17,6 +18,7 @@ import java.util.List;
@Accessors(chain = true) @Accessors(chain = true)
@ApiModel(value = "批量操作响应参数", description = "批量操作响应参数") @ApiModel(value = "批量操作响应参数", description = "批量操作响应参数")
public class BatchUploadResVO { public class BatchUploadResVO {
private static final long serialVersionUID = 51873394122822866L; private static final long serialVersionUID = 51873394122822866L;
@ApiModelProperty("成功数量") @ApiModelProperty("成功数量")
...@@ -31,8 +33,8 @@ public class BatchUploadResVO { ...@@ -31,8 +33,8 @@ public class BatchUploadResVO {
@ApiModelProperty("处理结果集合") @ApiModelProperty("处理结果集合")
private List<HandleResult> handleList; private List<HandleResult> handleList;
@ApiModelProperty("成功上传的URL集合") @ApiModelProperty("成功上传的文件集合")
private List<String> urlList; private List<Asset> fileList;
@Data @Data
public static class HandleResult { public static class HandleResult {
......
package cn.wisenergy.chnmuseum.party.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import cn.wisenergy.chnmuseum.party.model.VideoContentCat;
/**
* <pre>
* 视频内容分类 Mapper 接口
* </pre>
*
* @author Danny Lee
* @since 2021-04-01
*/
public interface VideoContentCatMapper extends BaseMapper<VideoContentCat> {
}
package cn.wisenergy.chnmuseum.party.mapper; package cn.wisenergy.chnmuseum.party.mapper;
import cn.wisenergy.chnmuseum.party.model.AssetType;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import cn.wisenergy.chnmuseum.party.model.VideoContent;
/** /**
* <p> * <pre>
* 视频分类 Mapper 接口 * 视频内容 Mapper 接口
* </p> * </pre>
* *
* @author Danny Lee * @author Danny Lee
* @since 2021-03-16 * @since 2021-04-01
*/ */
public interface AssetTypeMapper extends BaseMapper<AssetType> { public interface VideoContentMapper extends BaseMapper<VideoContent> {
} }
package cn.wisenergy.chnmuseum.party.model; package cn.wisenergy.chnmuseum.party.model;
import cn.wisenergy.chnmuseum.party.common.validator.groups.Add; import com.baomidou.mybatisplus.annotation.IdType;
import cn.wisenergy.chnmuseum.party.common.validator.groups.Update; import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.*; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.*; import lombok.*;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable; import java.io.Serializable;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.List;
/** /**
* <p> * <p>
* 视频 * 文件资产
* </p> * </p>
* *
* @author Danny Lee * @author Danny Lee
* @since 2021-03-16 * @since 2021-04-01
*/ */
@Data @Data
@Builder @Builder
...@@ -29,64 +27,59 @@ import java.util.List; ...@@ -29,64 +27,59 @@ import java.util.List;
@Accessors(chain = true) @Accessors(chain = true)
@EqualsAndHashCode(callSuper = false) @EqualsAndHashCode(callSuper = false)
@TableName("asset") @TableName("asset")
@ApiModel(value = "视频", description = "视频") @ApiModel(value = "文件资产", description = "文件资产")
public class Asset implements Serializable { public class Asset implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ApiModelProperty("视频ID") @ApiModelProperty("文件资产ID")
@TableId(value = "id", type = IdType.ASSIGN_ID) @TableId(value = "id", type = IdType.ASSIGN_ID)
@NotNull(message = "视频ID不能为空", groups = {Update.class})
private String id; private String id;
@ApiModelProperty("视频名称") @ApiModelProperty("所属项ID")
@TableField("name") @TableField("ref_item_id")
@NotBlank(message = "视频名称不能为空", groups = {Add.class, Update.class}) private String refItemId;
private String name;
@ApiModelProperty("视频缩略图") @ApiModelProperty("文件名")
@TableField("thumbnail") @TableField("file_name")
@NotBlank(message = "视频缩略图不能为空", groups = {Add.class, Update.class}) private String fileName;
private String thumbnail;
@ApiModelProperty("视频类别ID") @ApiModelProperty("扩展名")
@TableField("asset_type_id") @TableField("file_ext_name")
private String assetTypeId; private String fileExtName;
@ApiModelProperty("视频版权方ID") @ApiModelProperty("多媒体类型")
@TableField("asset_copyright_owner_id") @TableField("file_type")
private String assetCopyrightOwnerId; private String fileType;
@ApiModelProperty("文件大小(B)")
@TableField("file_size")
private Long fileSize;
@ApiModelProperty("文件分类")
@TableField("file_cat")
private String fileCat;
@ApiModelProperty("下载链接") @ApiModelProperty("下载链接")
@TableField("video_url") @TableField("file_url")
private String videoUrl; private String fileUrl;
@ApiModelProperty("视频缩略图")
@TableField("thumbnail")
private String thumbnail;
@ApiModelProperty("审核状态") @ApiModelProperty("语言")
@TableField("audit_status") @TableField("language")
private String auditStatus; private String language;
@ApiModelProperty("是否上架") @ApiModelProperty("MD5")
@TableField("is_published") @TableField("md5")
private Boolean published; private String md5;
@ApiModelProperty("创建日期") @ApiModelProperty("创建日期")
@TableField(value = "create_time", fill = FieldFill.INSERT)
private LocalDateTime createTime; private LocalDateTime createTime;
@ApiModelProperty("修改日期") @ApiModelProperty("修改日期")
@TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
private LocalDateTime updateTime; private LocalDateTime updateTime;
@ApiModelProperty("视频分类")
@TableField(exist = false)
private String assetTypeName;
@ApiModelProperty("视频版权方名称")
@TableField(exist = false)
private String assetCopyrightOwnerName;
@ApiModelProperty("视频URL列表")
@TableField(exist = false)
private List<String> videoUrlList;
} }
...@@ -29,7 +29,7 @@ import java.util.List; ...@@ -29,7 +29,7 @@ import java.util.List;
@Accessors(chain = true) @Accessors(chain = true)
@EqualsAndHashCode(callSuper = false) @EqualsAndHashCode(callSuper = false)
@TableName("exhibition_board") @TableName("exhibition_board")
@ApiModel(value = "展板", description = "展板") @ApiModel(value = "展板内容", description = "展板内容")
public class ExhibitionBoard implements Serializable { public class ExhibitionBoard implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
...@@ -67,31 +67,25 @@ public class ExhibitionBoard implements Serializable { ...@@ -67,31 +67,25 @@ public class ExhibitionBoard implements Serializable {
@NotBlank(message = "简介不能为空", groups = {Add.class, Update.class}) @NotBlank(message = "简介不能为空", groups = {Add.class, Update.class})
private String remarks; private String remarks;
@ApiModelProperty("视频版权方ID") @ApiModelProperty("视频内容版权方ID")
@TableField("asset_copyright_owner_id") @TableField("video_content_copyright_owner_id")
private String assetCopyrightOwnerId; @NotBlank(message = "视频内容版权方ID不能为空", groups = {Add.class, Update.class})
private String videoContentCopyrightOwnerId;
@ApiModelProperty("视频类别ID") @ApiModelProperty("视频类别ID")
@TableField("asset_type_id") @TableField("video_content_cat_id")
private String assetTypeId; @NotBlank(message = "视频类别ID不能为空", groups = {Add.class, Update.class})
private String videoContentCatId;
@ApiModelProperty("视频ID") @ApiModelProperty("视频内容ID")
@TableField("asset_id") @TableField("video_content_id")
@NotBlank(message = "视频ID不能为空", groups = {Add.class, Update.class}) @NotBlank(message = "视频内容ID不能为空", groups = {Add.class, Update.class})
private String assetId; private String videoContentId;
@ApiModelProperty("导览音频URL")
@TableField("guide_audio_url")
private String guideAudioUrl;
@ApiModelProperty("参考资料文件夹") @ApiModelProperty("参考资料文件夹")
@TableField("ref_material_dir") @TableField("ref_material_dir")
private String refMaterialDir; private String refMaterialDir;
@ApiModelProperty("参考资料URL")
@TableField("ref_material_url")
private String refMaterialUrl;
@ApiModelProperty("审核状态") @ApiModelProperty("审核状态")
@TableField("audit_status") @TableField("audit_status")
private String auditStatus; private String auditStatus;
...@@ -108,40 +102,48 @@ public class ExhibitionBoard implements Serializable { ...@@ -108,40 +102,48 @@ public class ExhibitionBoard implements Serializable {
@TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE) @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
private LocalDateTime updateTime; private LocalDateTime updateTime;
@ApiModelProperty("展板版权方名称") @ApiModelProperty("展板音频文件ID列表(添加或更新使用)")
@TableField(exist = false) @TableField(exist = false)
private String boardCopyrightOwnerName; private List<String> audioIdList;
@ApiModelProperty("参考资料文件ID列表(添加或更新使用)")
@TableField(exist = false)
private List<String> datumIdList;
@ApiModelProperty("所属学习内容ID")
@TableField(exist = false)
private String learningContentId;
@ApiModelProperty("视频版权方名称") @ApiModelProperty("展板版权方名称")
@TableField(exist = false) @TableField(exist = false)
private String assetCopyrightOwnerName; private String boardCopyrightOwnerName;
@ApiModelProperty("展板分类名称") @ApiModelProperty("展板分类名称")
@TableField(exist = false) @TableField(exist = false)
private String exhibitionBoardCatName; private String exhibitionBoardCatName;
@ApiModelProperty("关联视频名称") @ApiModelProperty("视频资料-视频内容版权方名称")
@TableField(exist = false) @TableField(exist = false)
private String assetName; private String videoContentCopyrightOwnerName;
@ApiModelProperty("展板视频URL") @ApiModelProperty("视频资料-视频内容分类名称")
@TableField(exist = false) @TableField(exist = false)
private String videoUrl; private String videoContentCatName;
@ApiModelProperty("展板视频URL列表") @ApiModelProperty("视频资料-视频内容名称")
@TableField(exist = false) @TableField(exist = false)
private List<String> videoUrlList; private String videoContentName;
@ApiModelProperty("展板音频URL列表") @ApiModelProperty("展板视频")
@TableField(exist = false) @TableField(exist = false)
private List<String> audioUrlList; private List<Asset> videoList;
@ApiModelProperty("参考资料URL列表") @ApiModelProperty("展板视频")
@TableField(exist = false) @TableField(exist = false)
private List<String> materialUrlList; private List<Asset> audioList;
@ApiModelProperty("所属学习内容ID") @ApiModelProperty("参考资料列表")
@TableField(exist = false) @TableField(exist = false)
private String learningContentId; private List<Asset> datumList;
} }
package cn.wisenergy.chnmuseum.party.model;
import cn.wisenergy.chnmuseum.party.common.validator.groups.Add;
import cn.wisenergy.chnmuseum.party.common.validator.groups.Update;
import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;
/**
* <p>
* 视频
* </p>
*
* @author Danny Lee
* @since 2021-03-16
*/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@TableName("video_content")
@ApiModel(value = "视频内容", description = "视频内容")
public class VideoContent implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty("视频内容ID")
@TableId(value = "id", type = IdType.ASSIGN_ID)
@NotNull(message = "视频内容ID不能为空", groups = {Update.class})
private String id;
@ApiModelProperty("视频内容名称")
@TableField("name")
@NotBlank(message = "视频内容名称不能为空", groups = {Add.class, Update.class})
private String name;
@ApiModelProperty("视频内容版权方ID")
@TableField("video_content_copyright_owner_id")
private String videoContentCopyrightOwnerId;
@ApiModelProperty("视频内容分类ID")
@TableField("video_content_cat_id")
private String videoContentCatId;
@ApiModelProperty("视频内容缩略图")
@TableField("thumbnail")
@NotBlank(message = "视频内容缩略图不能为空", groups = {Add.class})
private String thumbnail;
@ApiModelProperty("审核状态")
@TableField("audit_status")
private String auditStatus;
@ApiModelProperty("是否上架")
@TableField("is_published")
private Boolean published;
@ApiModelProperty("是否已删除")
@TableField("is_deleted")
private Boolean deleted;
@ApiModelProperty("创建日期")
@TableField(value = "create_time", fill = FieldFill.INSERT)
private LocalDateTime createTime;
@ApiModelProperty("修改日期")
@TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
private LocalDateTime updateTime;
@ApiModelProperty("视频内容分类名称")
@TableField(exist = false)
private String videoContentCatName;
@ApiModelProperty("视频内容版权方名称")
@TableField(exist = false)
private String videoContentCopyrightOwnerName;
@ApiModelProperty("视频ID列表(添加/更新使用)")
@TableField(exist = false)
private List<String> videoIdList;
@ApiModelProperty("视频文件信息列表")
@TableField(exist = false)
private List<Asset> videoFileList;
}
...@@ -15,7 +15,7 @@ import java.time.LocalDateTime; ...@@ -15,7 +15,7 @@ import java.time.LocalDateTime;
/** /**
* <p> * <p>
* 视频分类 * 视频内容分类
* </p> * </p>
* *
* @author Danny Lee * @author Danny Lee
...@@ -27,20 +27,20 @@ import java.time.LocalDateTime; ...@@ -27,20 +27,20 @@ import java.time.LocalDateTime;
@NoArgsConstructor @NoArgsConstructor
@Accessors(chain = true) @Accessors(chain = true)
@EqualsAndHashCode(callSuper = false) @EqualsAndHashCode(callSuper = false)
@TableName("asset_type") @TableName("video_content_cat")
@ApiModel(value = "视频分类", description = "视频分类") @ApiModel(value = "视频内容分类", description = "视频内容分类")
public class AssetType implements Serializable { public class VideoContentCat implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ApiModelProperty("视频分类ID") @ApiModelProperty("视频内容分类ID")
@TableId(value = "id", type = IdType.ASSIGN_ID) @TableId(value = "id", type = IdType.ASSIGN_ID)
@NotNull(message = "视频分类IDID不能为空", groups = {Update.class}) @NotNull(message = "视频内容分类不能为空", groups = {Update.class})
private String id; private String id;
@ApiModelProperty("视频分类名称") @ApiModelProperty("视频内容分类名称")
@TableField("name") @TableField("name")
@NotBlank(message = "视频分类名称不能为空", groups = {Add.class, Update.class}) @NotBlank(message = "视频内容分类名称不能为空", groups = {Add.class, Update.class})
private String name; private String name;
@ApiModelProperty("备注") @ApiModelProperty("备注")
...@@ -59,7 +59,7 @@ public class AssetType implements Serializable { ...@@ -59,7 +59,7 @@ public class AssetType implements Serializable {
@TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE) @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
private LocalDateTime updateTime; private LocalDateTime updateTime;
@ApiModelProperty("版权方") @ApiModelProperty("版权方名称")
@TableField(exist = false) @TableField(exist = false)
private String copyrightOwnerName; private String copyrightOwnerName;
......
...@@ -23,6 +23,6 @@ public interface LearningContentBoardService extends IService<LearningContentBoa ...@@ -23,6 +23,6 @@ public interface LearningContentBoardService extends IService<LearningContentBoa
IPage<ExhibitionBoard> getBoardPageByLearningContentId(Page<ExhibitionBoard> page, String learningContentId, String nameOrCode); IPage<ExhibitionBoard> getBoardPageByLearningContentId(Page<ExhibitionBoard> page, String learningContentId, String nameOrCode);
IPage<Asset> getAssetPageByOrganCode(Page<ExhibitionBoard> page, String organCode); IPage<Asset> getAssetPageByOrganCode(Page<Asset> page, String organCode);
} }
package cn.wisenergy.chnmuseum.party.service;
import cn.wisenergy.chnmuseum.party.model.VideoContentCat;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
* 视频内容分类 服务接口
* </p>
*
* @author Danny Lee
* @since 2021-04-01
*/
public interface VideoContentCatService extends IService<VideoContentCat> {
}
package cn.wisenergy.chnmuseum.party.service; package cn.wisenergy.chnmuseum.party.service;
import cn.wisenergy.chnmuseum.party.model.AssetType; import cn.wisenergy.chnmuseum.party.model.VideoContent;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
/** /**
* <p> * <p>
* 视频分类 服务类 * 视频内容 服务接口
* </p> * </p>
* *
* @author Danny Lee * @author Danny Lee
* @since 2021-03-16 * @since 2021-04-01
*/ */
public interface AssetTypeService extends IService<AssetType> { public interface VideoContentService extends IService<VideoContent> {
} }
package cn.wisenergy.chnmuseum.party.service.impl; package cn.wisenergy.chnmuseum.party.service.impl;
import cn.wisenergy.chnmuseum.party.model.Asset;
import cn.wisenergy.chnmuseum.party.mapper.AssetMapper; import cn.wisenergy.chnmuseum.party.mapper.AssetMapper;
import cn.wisenergy.chnmuseum.party.model.Asset;
import cn.wisenergy.chnmuseum.party.service.AssetService; import cn.wisenergy.chnmuseum.party.service.AssetService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
......
...@@ -38,7 +38,7 @@ public class LearningContentBoardServiceImpl extends ServiceImpl<LearningContent ...@@ -38,7 +38,7 @@ public class LearningContentBoardServiceImpl extends ServiceImpl<LearningContent
} }
@Override @Override
public IPage<Asset> getAssetPageByOrganCode(Page<ExhibitionBoard> page, String organCode) { public IPage<Asset> getAssetPageByOrganCode(Page<Asset> page, String organCode) {
return learningContentBoardMapper.selectAssetPageByOrganCode(page, organCode); return learningContentBoardMapper.selectAssetPageByOrganCode(page, organCode);
} }
......
package cn.wisenergy.chnmuseum.party.service.impl; package cn.wisenergy.chnmuseum.party.service.impl;
import cn.wisenergy.chnmuseum.party.model.AssetType; import cn.wisenergy.chnmuseum.party.mapper.VideoContentCatMapper;
import cn.wisenergy.chnmuseum.party.mapper.AssetTypeMapper; import cn.wisenergy.chnmuseum.party.model.VideoContentCat;
import cn.wisenergy.chnmuseum.party.service.AssetTypeService; import cn.wisenergy.chnmuseum.party.service.VideoContentCatService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
/** /**
* <p> * <pre>
* 视频分类 服务实现类 * 视频内容分类 服务实现类
* </p> * </pre>
* *
* @author Danny Lee * @author Danny Lee
* @since 2021-03-16 * @since 2021-04-01
*/ */
@Slf4j
@Service @Service
public class AssetTypeServiceImpl extends ServiceImpl<AssetTypeMapper, AssetType> implements AssetTypeService { public class VideoContentCatServiceImpl extends ServiceImpl<VideoContentCatMapper, VideoContentCat> implements VideoContentCatService {
} }
package cn.wisenergy.chnmuseum.party.service.impl;
import cn.wisenergy.chnmuseum.party.model.VideoContent;
import cn.wisenergy.chnmuseum.party.mapper.VideoContentMapper;
import cn.wisenergy.chnmuseum.party.service.VideoContentService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.beans.factory.annotation.Autowired;
/**
* <pre>
* 视频内容 服务实现类
* </pre>
*
* @author Danny Lee
* @since 2021-04-01
*/
@Slf4j
@Service
public class VideoContentServiceImpl extends ServiceImpl<VideoContentMapper, VideoContent> implements VideoContentService {
@Autowired
private VideoContentMapper videoContentMapper;
}
...@@ -2,21 +2,18 @@ package cn.wisenergy.chnmuseum.party.web.controller; ...@@ -2,21 +2,18 @@ package cn.wisenergy.chnmuseum.party.web.controller;
import cn.wisenergy.chnmuseum.party.auth.SHA256PasswordEncryptionService; import cn.wisenergy.chnmuseum.party.auth.SHA256PasswordEncryptionService;
import cn.wisenergy.chnmuseum.party.auth.util.JwtTokenUtil; import cn.wisenergy.chnmuseum.party.auth.util.JwtTokenUtil;
import cn.wisenergy.chnmuseum.party.common.enums.FileCatEnum;
import cn.wisenergy.chnmuseum.party.common.enums.FileTypeEnum;
import cn.wisenergy.chnmuseum.party.common.enums.LanguageEnum; import cn.wisenergy.chnmuseum.party.common.enums.LanguageEnum;
import cn.wisenergy.chnmuseum.party.common.mvc.InterfaceException; import cn.wisenergy.chnmuseum.party.common.mvc.InterfaceException;
import cn.wisenergy.chnmuseum.party.common.util.TimeUtils; import cn.wisenergy.chnmuseum.party.common.util.TimeUtils;
import cn.wisenergy.chnmuseum.party.common.validator.groups.Add; import cn.wisenergy.chnmuseum.party.common.validator.groups.Add;
import cn.wisenergy.chnmuseum.party.common.vo.AudioVo;
import cn.wisenergy.chnmuseum.party.common.vo.DatumVo;
import cn.wisenergy.chnmuseum.party.common.vo.GenericPageParam; import cn.wisenergy.chnmuseum.party.common.vo.GenericPageParam;
import cn.wisenergy.chnmuseum.party.common.vo.VideoVo;
import cn.wisenergy.chnmuseum.party.model.*; import cn.wisenergy.chnmuseum.party.model.*;
import cn.wisenergy.chnmuseum.party.service.*; import cn.wisenergy.chnmuseum.party.service.*;
import cn.wisenergy.chnmuseum.party.service.impl.*; import cn.wisenergy.chnmuseum.party.service.impl.*;
import cn.wisenergy.chnmuseum.party.web.controller.base.BaseController; import cn.wisenergy.chnmuseum.party.web.controller.base.BaseController;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import com.alibaba.fastjson.parser.Feature;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
...@@ -77,6 +74,9 @@ public class ChinaMobileRestApiController extends BaseController { ...@@ -77,6 +74,9 @@ public class ChinaMobileRestApiController extends BaseController {
@Resource @Resource
private AssetServiceImpl assetService; private AssetServiceImpl assetService;
@Resource
private VideoContentService videoContentService;
@Resource @Resource
private TBoxOperationServiceImpl boxOperationService; private TBoxOperationServiceImpl boxOperationService;
...@@ -116,12 +116,6 @@ public class ChinaMobileRestApiController extends BaseController { ...@@ -116,12 +116,6 @@ public class ChinaMobileRestApiController extends BaseController {
//用户登录是否被锁定 一小时 redisKey 前缀 //用户登录是否被锁定 一小时 redisKey 前缀
private static final String SHIRO_IS_LOCK = "shiro_is_lock_"; private static final String SHIRO_IS_LOCK = "shiro_is_lock_";
/**
* 机顶盒激活状态查询
*
* @param
* @return
*/
@ApiOperation(value = "获取机顶盒密钥", notes = "获取机顶盒密钥") @ApiOperation(value = "获取机顶盒密钥", notes = "获取机顶盒密钥")
@GetMapping("/equitment/key") @GetMapping("/equitment/key")
@RequiresPermissions("equitment:key") @RequiresPermissions("equitment:key")
...@@ -147,12 +141,6 @@ public class ChinaMobileRestApiController extends BaseController { ...@@ -147,12 +141,6 @@ public class ChinaMobileRestApiController extends BaseController {
return getFailResult(); return getFailResult();
} }
/**
* 机顶盒激活状态查询
*
* @param
* @return
*/
@ApiOperation(value = "机顶盒激活状态查询", notes = "机顶盒激活状态查询") @ApiOperation(value = "机顶盒激活状态查询", notes = "机顶盒激活状态查询")
@GetMapping("/equitment/activity") @GetMapping("/equitment/activity")
@RequiresPermissions("/equitment/activity/") @RequiresPermissions("/equitment/activity/")
...@@ -174,14 +162,6 @@ public class ChinaMobileRestApiController extends BaseController { ...@@ -174,14 +162,6 @@ public class ChinaMobileRestApiController extends BaseController {
return getFailResult(); return getFailResult();
} }
/**
* 管理员ajax登录请求 后端用户登录
*
* @param username
* @param password
* @return
*/
@RequestMapping(value = "/user/webLogin", method = RequestMethod.POST) @RequestMapping(value = "/user/webLogin", method = RequestMethod.POST)
public ResponseEntity<JSONObject> login(@RequestParam(value = "username") String username, public ResponseEntity<JSONObject> login(@RequestParam(value = "username") String username,
@RequestParam(value = "password") String password, @RequestParam(value = "password") String password,
...@@ -373,22 +353,18 @@ public class ChinaMobileRestApiController extends BaseController { ...@@ -373,22 +353,18 @@ public class ChinaMobileRestApiController extends BaseController {
public Map<String, Object> getExhibitionBoardPageList(@RequestParam(value = "learningContentId") String learningContentId) { public Map<String, Object> getExhibitionBoardPageList(@RequestParam(value = "learningContentId") String learningContentId) {
final IPage<ExhibitionBoard> page = this.learningContentBoardService.getBoardPageByLearningContentId(getPage(), learningContentId, null); final IPage<ExhibitionBoard> page = this.learningContentBoardService.getBoardPageByLearningContentId(getPage(), learningContentId, null);
for (ExhibitionBoard exhibitionBoard : page.getRecords()) { for (ExhibitionBoard exhibitionBoard : page.getRecords()) {
if (exhibitionBoard.getAssetCopyrightOwnerId() != null) { exhibitionBoard.setLearningContentId(learningContentId);
String name = this.copyrightOwnerService.getById(exhibitionBoard.getAssetCopyrightOwnerId()).getName(); if (exhibitionBoard.getVideoContentCopyrightOwnerId() != null) {
String name = this.copyrightOwnerService.getById(exhibitionBoard.getVideoContentCopyrightOwnerId()).getName();
exhibitionBoard.setBoardCopyrightOwnerName(name); exhibitionBoard.setBoardCopyrightOwnerName(name);
} }
if (exhibitionBoard.getExhibitionBoardCatId() != null) { if (exhibitionBoard.getExhibitionBoardCatId() != null) {
String name = this.exhibitionBoardCatService.getById(exhibitionBoard.getExhibitionBoardCatId()).getName(); String name = this.exhibitionBoardCatService.getById(exhibitionBoard.getExhibitionBoardCatId()).getName();
exhibitionBoard.setExhibitionBoardCatName(name); exhibitionBoard.setExhibitionBoardCatName(name);
} }
final String assetId = exhibitionBoard.getAssetId(); LambdaQueryWrapper<Asset> assetQueryWrapper = Wrappers.<Asset>lambdaQuery().eq(Asset::getRefItemId, exhibitionBoard.getVideoContentId()).eq(Asset::getFileType, FileTypeEnum.VIDEO.name());
final Asset asset = this.assetService.getById(assetId); List<Asset> videoList = this.assetService.list(assetQueryWrapper);
final String videoUrl = asset.getVideoUrl(); exhibitionBoard.setVideoList(videoList);
final List<VideoVo> videoVoList = JSONObject.parseObject(videoUrl, new TypeReference<List<VideoVo>>() {
}, Feature.OrderedField);
exhibitionBoard.setVideoUrlList(videoVoList.stream().map(VideoVo::getFileUrl).collect(Collectors.toList()));
exhibitionBoard.setVideoUrl(videoUrl);
exhibitionBoard.setLearningContentId(learningContentId);
} }
return getResult(page); return getResult(page);
} }
...@@ -409,29 +385,32 @@ public class ChinaMobileRestApiController extends BaseController { ...@@ -409,29 +385,32 @@ public class ChinaMobileRestApiController extends BaseController {
if (boardCopyrightOwnerId != null) { if (boardCopyrightOwnerId != null) {
exhibitionBoard.setBoardCopyrightOwnerName(this.copyrightOwnerService.getById(boardCopyrightOwnerId).getName()); exhibitionBoard.setBoardCopyrightOwnerName(this.copyrightOwnerService.getById(boardCopyrightOwnerId).getName());
} }
if (exhibitionBoard.getVideoContentCopyrightOwnerId() != null) {
String name = this.copyrightOwnerService.getById(exhibitionBoard.getVideoContentCopyrightOwnerId()).getName();
exhibitionBoard.setVideoContentCopyrightOwnerName(name);
}
final String guideAudioUrl = exhibitionBoard.getGuideAudioUrl(); LambdaQueryWrapper<Asset> assetQueryWrapper = Wrappers.<Asset>lambdaQuery().eq(Asset::getRefItemId, exhibitionBoard.getId());
final List<AudioVo> audioVoList = JSONObject.parseObject(guideAudioUrl, new TypeReference<List<AudioVo>>() { assetQueryWrapper.eq(Asset::getFileCat, FileCatEnum.EXHIBITION_BOARD_AUDIO.name());
}, Feature.OrderedField); final List<Asset> audioList = this.assetService.list(assetQueryWrapper);
exhibitionBoard.setAudioUrlList(audioVoList.stream().map(AudioVo::getFileUrl).collect(Collectors.toList())); exhibitionBoard.setAudioList(audioList);
final String refMaterialUrl = exhibitionBoard.getRefMaterialUrl(); assetQueryWrapper.clear();
final List<AudioVo> refMaterialVoList = JSONObject.parseObject(refMaterialUrl, new TypeReference<List<AudioVo>>() { assetQueryWrapper = Wrappers.<Asset>lambdaQuery().eq(Asset::getRefItemId, exhibitionBoard.getId());
}, Feature.OrderedField); assetQueryWrapper.eq(Asset::getFileCat, FileCatEnum.EXHIBITION_BOARD_DATUM.name());
exhibitionBoard.setMaterialUrlList(refMaterialVoList.stream().map(AudioVo::getFileUrl).collect(Collectors.toList())); final List<Asset> datumList = this.assetService.list(assetQueryWrapper);
exhibitionBoard.setDatumList(datumList);
String assetId = exhibitionBoard.getAssetId();
if (assetId != null) { final String videoContentId = exhibitionBoard.getVideoContentId();
final Asset asset = this.assetService.getById(assetId); if (videoContentId != null) {
exhibitionBoard.setAssetName(this.assetService.getById(assetId).getName()); final VideoContent videoContent = this.videoContentService.getById(videoContentId);
final String assetCopyrightOwnerId = asset.getAssetCopyrightOwnerId(); exhibitionBoard.setVideoContentName(videoContent.getName());
final String assetCopyrightOwnerName = this.copyrightOwnerService.getById(assetCopyrightOwnerId).getName();
exhibitionBoard.setAssetCopyrightOwnerName(assetCopyrightOwnerName); assetQueryWrapper.clear();
assetQueryWrapper = Wrappers.<Asset>lambdaQuery().eq(Asset::getRefItemId, videoContentId);
final String videoUrl = asset.getVideoUrl(); assetQueryWrapper.eq(Asset::getFileCat, FileCatEnum.VIDEO_CONTENT.name());
final List<VideoVo> videoVoList = JSONObject.parseObject(videoUrl, new TypeReference<List<VideoVo>>() { final List<Asset> videoList = this.assetService.list(assetQueryWrapper);
}, Feature.OrderedField); exhibitionBoard.setVideoList(videoList);
exhibitionBoard.setVideoUrlList(videoVoList.stream().map(VideoVo::getFileUrl).collect(Collectors.toList()));
} }
return getResult(exhibitionBoard); return getResult(exhibitionBoard);
} }
...@@ -547,11 +526,10 @@ public class ChinaMobileRestApiController extends BaseController { ...@@ -547,11 +526,10 @@ public class ChinaMobileRestApiController extends BaseController {
@ApiOperation(value = "展板参考资料查询", notes = "展板参考资料查询") @ApiOperation(value = "展板参考资料查询", notes = "展板参考资料查询")
public Map<String, Object> getBoardRefMaterial(@PathVariable(value = "boardId") String boardId) { public Map<String, Object> getBoardRefMaterial(@PathVariable(value = "boardId") String boardId) {
final ExhibitionBoard exhibitionBoard = this.exhibitionBoardService.getById(boardId); final ExhibitionBoard exhibitionBoard = this.exhibitionBoardService.getById(boardId);
final LambdaQueryWrapper<Asset> assetQueryWrapper = Wrappers.<Asset>lambdaQuery().eq(Asset::getRefItemId, exhibitionBoard.getId());
final String refMaterialUrl = exhibitionBoard.getRefMaterialUrl(); assetQueryWrapper.eq(Asset::getFileCat, FileCatEnum.EXHIBITION_BOARD_DATUM.name());
final List<DatumVo> datumVoList = JSONObject.parseObject(refMaterialUrl, new TypeReference<List<DatumVo>>() { final List<Asset> datumList = this.assetService.list(assetQueryWrapper);
}, Feature.OrderedField); return getResult(datumList);
return getResult(datumVoList);
} }
@ApiImplicitParams(value = { @ApiImplicitParams(value = {
......
...@@ -5,7 +5,7 @@ import cn.wisenergy.chnmuseum.party.common.util.TimeUtils; ...@@ -5,7 +5,7 @@ import cn.wisenergy.chnmuseum.party.common.util.TimeUtils;
import cn.wisenergy.chnmuseum.party.common.validator.groups.Add; import cn.wisenergy.chnmuseum.party.common.validator.groups.Add;
import cn.wisenergy.chnmuseum.party.common.validator.groups.Update; import cn.wisenergy.chnmuseum.party.common.validator.groups.Update;
import cn.wisenergy.chnmuseum.party.common.vo.GenericPageParam; import cn.wisenergy.chnmuseum.party.common.vo.GenericPageParam;
import cn.wisenergy.chnmuseum.party.model.AssetType; import cn.wisenergy.chnmuseum.party.model.VideoContentCat;
import cn.wisenergy.chnmuseum.party.model.CopyrightOwner; import cn.wisenergy.chnmuseum.party.model.CopyrightOwner;
import cn.wisenergy.chnmuseum.party.model.CopyrightOwnerAssetType; import cn.wisenergy.chnmuseum.party.model.CopyrightOwnerAssetType;
import cn.wisenergy.chnmuseum.party.model.ExhibitionBoard; import cn.wisenergy.chnmuseum.party.model.ExhibitionBoard;
...@@ -182,8 +182,8 @@ public class CopyrightOwnerController extends BaseController { ...@@ -182,8 +182,8 @@ public class CopyrightOwnerController extends BaseController {
List<CopyrightOwnerAssetType> CopyrightOwnerAssetTypeList = this.copyrightOwnerAssetTypeService.list(Wrappers.<CopyrightOwnerAssetType>lambdaQuery().eq(CopyrightOwnerAssetType::getCopyrightOwnerId, copyrightOwner.getId())); List<CopyrightOwnerAssetType> CopyrightOwnerAssetTypeList = this.copyrightOwnerAssetTypeService.list(Wrappers.<CopyrightOwnerAssetType>lambdaQuery().eq(CopyrightOwnerAssetType::getCopyrightOwnerId, copyrightOwner.getId()));
if (!CopyrightOwnerAssetTypeList.isEmpty()) { if (!CopyrightOwnerAssetTypeList.isEmpty()) {
Set<String> idList = CopyrightOwnerAssetTypeList.stream().map(CopyrightOwnerAssetType::getAssetTypeId).collect(Collectors.toSet()); Set<String> idList = CopyrightOwnerAssetTypeList.stream().map(CopyrightOwnerAssetType::getAssetTypeId).collect(Collectors.toSet());
List<AssetType> assetTypeList = this.assetTypeService.listByIds(idList); List<VideoContentCat> videoContentCatList = this.assetTypeService.listByIds(idList);
String assetTypeNameList = assetTypeList.stream().map(AssetType::getName).collect(Collectors.joining("、")); String assetTypeNameList = videoContentCatList.stream().map(VideoContentCat::getName).collect(Collectors.joining("、"));
copyrightOwner.setAssetTypeNames(assetTypeNameList); copyrightOwner.setAssetTypeNames(assetTypeNameList);
} }
} else if (CopyrightOwnerTypeEnum.EXHIBITION_BOARD.name().equals(genericPageParam.getOwnerType())) { } else if (CopyrightOwnerTypeEnum.EXHIBITION_BOARD.name().equals(genericPageParam.getOwnerType())) {
...@@ -191,8 +191,8 @@ public class CopyrightOwnerController extends BaseController { ...@@ -191,8 +191,8 @@ public class CopyrightOwnerController extends BaseController {
List<ExhibitionBoard> exhibitionBoardList = this.exhibitionBoardService.list(lambdaQueryWrapper); List<ExhibitionBoard> exhibitionBoardList = this.exhibitionBoardService.list(lambdaQueryWrapper);
if (!exhibitionBoardList.isEmpty()) { if (!exhibitionBoardList.isEmpty()) {
Set<String> assetTypeIdList = exhibitionBoardList.stream().map(ExhibitionBoard::getAssetTypeId).collect(Collectors.toSet()); Set<String> assetTypeIdList = exhibitionBoardList.stream().map(ExhibitionBoard::getAssetTypeId).collect(Collectors.toSet());
List<AssetType> assetTypeList = this.assetTypeService.listByIds(assetTypeIdList); List<VideoContentCat> videoContentCatList = this.assetTypeService.listByIds(assetTypeIdList);
String assetTypeNames = assetTypeList.stream().map(AssetType::getName).collect(Collectors.joining("、")); String assetTypeNames = videoContentCatList.stream().map(VideoContentCat::getName).collect(Collectors.joining("、"));
copyrightOwner.setAssetTypeNames(assetTypeNames); copyrightOwner.setAssetTypeNames(assetTypeNames);
} }
} }
...@@ -215,9 +215,9 @@ public class CopyrightOwnerController extends BaseController { ...@@ -215,9 +215,9 @@ public class CopyrightOwnerController extends BaseController {
if (!copyrightOwnerAssetTypeList.isEmpty()) { if (!copyrightOwnerAssetTypeList.isEmpty()) {
List<String> assetTypeIdArrayList = copyrightOwnerAssetTypeList.stream().map(CopyrightOwnerAssetType::getAssetTypeId).distinct().collect(Collectors.toList()); List<String> assetTypeIdArrayList = copyrightOwnerAssetTypeList.stream().map(CopyrightOwnerAssetType::getAssetTypeId).distinct().collect(Collectors.toList());
copyrightOwner.setAssetTypeIdList(assetTypeIdArrayList); copyrightOwner.setAssetTypeIdList(assetTypeIdArrayList);
final List<AssetType> assetTypeList = this.assetTypeService.listByIds(assetTypeIdArrayList); final List<VideoContentCat> videoContentCatList = this.assetTypeService.listByIds(assetTypeIdArrayList);
if (!assetTypeList.isEmpty()) { if (!videoContentCatList.isEmpty()) {
final List<String> assetTypeNameList = assetTypeList.stream().map(AssetType::getName).collect(Collectors.toList()); final List<String> assetTypeNameList = videoContentCatList.stream().map(VideoContentCat::getName).collect(Collectors.toList());
copyrightOwner.setAssetTypeNameList(assetTypeNameList); copyrightOwner.setAssetTypeNameList(assetTypeNameList);
} }
} }
......
...@@ -3,17 +3,13 @@ package cn.wisenergy.chnmuseum.party.web.controller; ...@@ -3,17 +3,13 @@ package cn.wisenergy.chnmuseum.party.web.controller;
import cn.wisenergy.chnmuseum.party.common.enums.AuditOperationEnum; import cn.wisenergy.chnmuseum.party.common.enums.AuditOperationEnum;
import cn.wisenergy.chnmuseum.party.common.enums.AuditStatusEnum; import cn.wisenergy.chnmuseum.party.common.enums.AuditStatusEnum;
import cn.wisenergy.chnmuseum.party.common.enums.AuditTypeEnum; import cn.wisenergy.chnmuseum.party.common.enums.AuditTypeEnum;
import cn.wisenergy.chnmuseum.party.common.enums.FileCatEnum;
import cn.wisenergy.chnmuseum.party.common.validator.groups.Add; import cn.wisenergy.chnmuseum.party.common.validator.groups.Add;
import cn.wisenergy.chnmuseum.party.common.validator.groups.Update; import cn.wisenergy.chnmuseum.party.common.validator.groups.Update;
import cn.wisenergy.chnmuseum.party.common.vo.AudioVo;
import cn.wisenergy.chnmuseum.party.common.vo.GenericPageParam; import cn.wisenergy.chnmuseum.party.common.vo.GenericPageParam;
import cn.wisenergy.chnmuseum.party.common.vo.VideoVo;
import cn.wisenergy.chnmuseum.party.model.*; import cn.wisenergy.chnmuseum.party.model.*;
import cn.wisenergy.chnmuseum.party.service.*; import cn.wisenergy.chnmuseum.party.service.*;
import cn.wisenergy.chnmuseum.party.web.controller.base.BaseController; import cn.wisenergy.chnmuseum.party.web.controller.base.BaseController;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import com.alibaba.fastjson.parser.Feature;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
...@@ -51,7 +47,9 @@ public class LearningContentController extends BaseController { ...@@ -51,7 +47,9 @@ public class LearningContentController extends BaseController {
@Resource @Resource
private ExhibitionBoardCatService exhibitionBoardCatService; private ExhibitionBoardCatService exhibitionBoardCatService;
@Resource @Resource
private AssetTypeService assetTypeService; private VideoContentCatService videoContentCatService;
@Resource
private VideoContentService videoContentService;
@Resource @Resource
private CopyrightOwnerService copyrightOwnerService; private CopyrightOwnerService copyrightOwnerService;
@Resource @Resource
...@@ -334,30 +332,32 @@ public class LearningContentController extends BaseController { ...@@ -334,30 +332,32 @@ public class LearningContentController extends BaseController {
if (boardCopyrightOwnerId != null) { if (boardCopyrightOwnerId != null) {
exhibitionBoard.setBoardCopyrightOwnerName(this.copyrightOwnerService.getById(boardCopyrightOwnerId).getName()); exhibitionBoard.setBoardCopyrightOwnerName(this.copyrightOwnerService.getById(boardCopyrightOwnerId).getName());
} }
if (exhibitionBoard.getVideoContentCopyrightOwnerId() != null) {
String name = this.copyrightOwnerService.getById(exhibitionBoard.getVideoContentCopyrightOwnerId()).getName();
exhibitionBoard.setVideoContentCopyrightOwnerName(name);
}
final String guideAudioUrl = exhibitionBoard.getGuideAudioUrl(); LambdaQueryWrapper<Asset> assetQueryWrapper = Wrappers.<Asset>lambdaQuery().eq(Asset::getRefItemId, exhibitionBoard.getId());
final List<AudioVo> audioVoList = JSONObject.parseObject(guideAudioUrl, new TypeReference<List<AudioVo>>() { assetQueryWrapper.eq(Asset::getFileCat, FileCatEnum.EXHIBITION_BOARD_AUDIO.name());
}, Feature.OrderedField); final List<Asset> audioList = this.assetService.list(assetQueryWrapper);
exhibitionBoard.setAudioUrlList(audioVoList.stream().map(AudioVo::getFileUrl).collect(Collectors.toList())); exhibitionBoard.setAudioList(audioList);
final String refMaterialUrl = exhibitionBoard.getRefMaterialUrl(); assetQueryWrapper.clear();
final List<AudioVo> refMaterialVoList = JSONObject.parseObject(refMaterialUrl, new TypeReference<List<AudioVo>>() { assetQueryWrapper = Wrappers.<Asset>lambdaQuery().eq(Asset::getRefItemId, exhibitionBoard.getId());
}, Feature.OrderedField); assetQueryWrapper.eq(Asset::getFileCat, FileCatEnum.EXHIBITION_BOARD_DATUM.name());
exhibitionBoard.setMaterialUrlList(refMaterialVoList.stream().map(AudioVo::getFileUrl).collect(Collectors.toList())); final List<Asset> datumList = this.assetService.list(assetQueryWrapper);
exhibitionBoard.setDatumList(datumList);
String assetId = exhibitionBoard.getAssetId();
if (assetId != null) { String videoContentId = exhibitionBoard.getVideoContentId();
final Asset asset = this.assetService.getById(assetId); if (videoContentId != null) {
exhibitionBoard.setAssetName(this.assetService.getById(assetId).getName()); final VideoContent videoContent = this.videoContentService.getById(videoContentId);
final String assetCopyrightOwnerId = asset.getAssetCopyrightOwnerId(); exhibitionBoard.setVideoContentName(videoContent.getName());
final String assetCopyrightOwnerName = this.copyrightOwnerService.getById(assetCopyrightOwnerId).getName();
exhibitionBoard.setAssetCopyrightOwnerName(assetCopyrightOwnerName); assetQueryWrapper.clear();
assetQueryWrapper = Wrappers.<Asset>lambdaQuery().eq(Asset::getRefItemId, videoContentId);
final String videoUrl = asset.getVideoUrl(); assetQueryWrapper.eq(Asset::getFileCat, FileCatEnum.VIDEO_CONTENT.name());
final List<VideoVo> videoVoList = JSONObject.parseObject(videoUrl, new TypeReference<List<VideoVo>>() { final List<Asset> videoList = this.assetService.list(assetQueryWrapper);
}, Feature.OrderedField); exhibitionBoard.setVideoList(videoList);
exhibitionBoard.setVideoUrl(videoUrl);
exhibitionBoard.setVideoUrlList(videoVoList.stream().map(VideoVo::getFileUrl).collect(Collectors.toList()));
} }
} }
learningContent.setExhibitionBoardList(exhibitionBoardList); learningContent.setExhibitionBoardList(exhibitionBoardList);
......
...@@ -2,12 +2,12 @@ package cn.wisenergy.chnmuseum.party.web.controller; ...@@ -2,12 +2,12 @@ package cn.wisenergy.chnmuseum.party.web.controller;
import cn.wisenergy.chnmuseum.party.common.validator.groups.Add; import cn.wisenergy.chnmuseum.party.common.validator.groups.Add;
import cn.wisenergy.chnmuseum.party.common.vo.GenericPageParam; import cn.wisenergy.chnmuseum.party.common.vo.GenericPageParam;
import cn.wisenergy.chnmuseum.party.model.Asset;
import cn.wisenergy.chnmuseum.party.model.AssetType;
import cn.wisenergy.chnmuseum.party.model.CopyrightOwner; import cn.wisenergy.chnmuseum.party.model.CopyrightOwner;
import cn.wisenergy.chnmuseum.party.service.AssetService; import cn.wisenergy.chnmuseum.party.model.VideoContent;
import cn.wisenergy.chnmuseum.party.service.AssetTypeService; import cn.wisenergy.chnmuseum.party.model.VideoContentCat;
import cn.wisenergy.chnmuseum.party.service.CopyrightOwnerService; import cn.wisenergy.chnmuseum.party.service.CopyrightOwnerService;
import cn.wisenergy.chnmuseum.party.service.VideoContentCatService;
import cn.wisenergy.chnmuseum.party.service.VideoContentService;
import cn.wisenergy.chnmuseum.party.web.controller.base.BaseController; import cn.wisenergy.chnmuseum.party.web.controller.base.BaseController;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
...@@ -30,7 +30,7 @@ import java.util.stream.Collectors; ...@@ -30,7 +30,7 @@ import java.util.stream.Collectors;
/** /**
* <pre> * <pre>
* 视频分类 前端控制器 * 视频内容分类 前端控制器
* </pre> * </pre>
* *
* @author Danny Lee * @author Danny Lee
...@@ -38,25 +38,25 @@ import java.util.stream.Collectors; ...@@ -38,25 +38,25 @@ import java.util.stream.Collectors;
*/ */
@Slf4j @Slf4j
@RestController @RestController
@RequestMapping("/assetType") @RequestMapping("/videoContentCat")
@Api(tags = {"视频分类接口"}) @Api(tags = {"视频内容分类接口"})
public class AssetTypeController extends BaseController { public class VideoContentCatController extends BaseController {
@Resource @Resource
private AssetTypeService assetTypeService; private VideoContentCatService videoContentCatService;
@Resource @Resource
private AssetService assetService; private VideoContentService videoContentService;
@Resource @Resource
private CopyrightOwnerService copyrightOwnerService; private CopyrightOwnerService copyrightOwnerService;
@PostMapping(value = "/save") @PostMapping(value = "/save")
@RequiresPermissions("asset:type:save") @RequiresPermissions("video:content:cat:save")
@ApiOperation(value = "添加视频分类", notes = "添加视频分类") @ApiOperation(value = "添加视频内容分类", notes = "添加视频内容分类")
public Map<String, Object> saveAssetType(@Validated(value = {Add.class}) AssetType assetType) { public Map<String, Object> saveVideoContentCat(@Validated(value = {Add.class}) VideoContentCat videoContentCat) {
// 保存业务节点信息 // 保存业务节点信息
boolean result = assetTypeService.save(assetType); boolean result = videoContentCatService.save(videoContentCat);
// 返回操作结果 // 返回操作结果
if (result) { if (result) {
return getSuccessResult(); return getSuccessResult();
...@@ -67,31 +67,21 @@ public class AssetTypeController extends BaseController { ...@@ -67,31 +67,21 @@ public class AssetTypeController extends BaseController {
} }
@PutMapping(value = "/update") @PutMapping(value = "/update")
@ApiOperation(value = "修改视频分类信息", notes = "修改视频分类信息") @ApiOperation(value = "修改视频内容分类信息", notes = "修改视频内容分类信息")
public Map<String, Object> updateAssetType(@Validated AssetType assetType) { public Map<String, Object> updateVideoContentCat(@Validated VideoContentCat videoContentCat) {
boolean flag = assetTypeService.updateById(assetType); boolean flag = videoContentCatService.updateById(videoContentCat);
if (flag) { if (flag) {
return getSuccessResult(); return getSuccessResult();
} }
return getFailResult(); return getFailResult();
} }
@DeleteMapping(value = "/delete/{id}")
@RequiresPermissions("asset:type:delete")
@ApiOperation(value = "根据ID删除视频分类", notes = "根据ID删除视频分类")
@ApiImplicitParams(value = {
@ApiImplicitParam(name = "id", value = "标识ID", paramType = "path", dataType = "String")
})
public Map<String, Object> deleteAssetType(@PathVariable("id") String id) {
return getSuccessResult();
}
@GetMapping("/getList") @GetMapping("/getList")
@RequiresPermissions("asset:type:list") @RequiresPermissions("video:content:cat:list")
@ApiOperation(value = "获取视频分类全部列表(无分页)", notes = "获取视频分类全部列表(无分页)") @ApiOperation(value = "获取视频内容分类全部列表(无分页)", notes = "获取视频内容分类全部列表(无分页)")
public Map<String, Object> getAssetTypeList() { public Map<String, Object> getVideoContentCatList() {
List<AssetType> assetTypeList = assetTypeService.list(); List<VideoContentCat> videoContentCatList = videoContentCatService.list();
return getResult(assetTypeList); return getResult(videoContentCatList);
} }
@ApiImplicitParams(value = { @ApiImplicitParams(value = {
...@@ -102,51 +92,51 @@ public class AssetTypeController extends BaseController { ...@@ -102,51 +92,51 @@ public class AssetTypeController extends BaseController {
@ApiImplicitParam(name = "endDate", value = "创建时间-结束", paramType = "query", dataType = "String") @ApiImplicitParam(name = "endDate", value = "创建时间-结束", paramType = "query", dataType = "String")
}) })
@PostMapping("/getPageList") @PostMapping("/getPageList")
@RequiresPermissions("asset:type:page") @RequiresPermissions("video:content:cat:page")
@ApiOperation(value = "获取视频分类分页列表", notes = "获取视频分类分页列表") @ApiOperation(value = "获取视频内容分类分页列表", notes = "获取视频内容分类分页列表")
public Map<String, Object> getAssetTypePageList(GenericPageParam genericPageParam) { public Map<String, Object> getVideoContentCatPageList(GenericPageParam genericPageParam) {
LambdaQueryWrapper<AssetType> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<VideoContentCat> queryWrapper = new LambdaQueryWrapper<>();
// 对名称或编码模糊查询 // 对名称或编码模糊查询
if (StringUtils.isNotBlank(genericPageParam.getNameOrCode())) { if (StringUtils.isNotBlank(genericPageParam.getNameOrCode())) {
queryWrapper.like(AssetType::getName, genericPageParam.getNameOrCode()); queryWrapper.like(VideoContentCat::getName, genericPageParam.getNameOrCode());
} }
// 根据创建时间区间检索 // 根据创建时间区间检索
if (genericPageParam.getStartDate() != null && genericPageParam.getEndDate() != null) { if (genericPageParam.getStartDate() != null && genericPageParam.getEndDate() != null) {
queryWrapper.ge(AssetType::getCreateTime, genericPageParam.getStartDate().atTime(0, 0, 0)) queryWrapper.ge(VideoContentCat::getCreateTime, genericPageParam.getStartDate().atTime(0, 0, 0))
.le(AssetType::getCreateTime, genericPageParam.getEndDate().atTime(23, 59, 59)); .le(VideoContentCat::getCreateTime, genericPageParam.getEndDate().atTime(23, 59, 59));
} }
// 设置排序规则 // 设置排序规则
queryWrapper.orderByDesc(AssetType::getCreateTime); queryWrapper.orderByDesc(VideoContentCat::getCreateTime);
// 设置查询内容 // 设置查询内容
queryWrapper.select( queryWrapper.select(
AssetType::getId, VideoContentCat::getId,
AssetType::getName, VideoContentCat::getName,
AssetType::getCreateTime, VideoContentCat::getCreateTime,
AssetType::getUpdateTime); VideoContentCat::getUpdateTime);
Page<AssetType> page = this.assetTypeService.page(getPage(), queryWrapper); Page<VideoContentCat> page = this.videoContentCatService.page(getPage(), queryWrapper);
for (AssetType assetType : page.getRecords()) { for (VideoContentCat videoContentCat : page.getRecords()) {
LambdaQueryWrapper<Asset> lambdaQueryWrapper = Wrappers.<Asset>lambdaQuery().eq(Asset::getAssetTypeId, assetType.getId()); LambdaQueryWrapper<VideoContent> lambdaQueryWrapper = Wrappers.<VideoContent>lambdaQuery().eq(VideoContent::getVideoContentCatId, videoContentCat.getId());
lambdaQueryWrapper = lambdaQueryWrapper.select(Asset::getId).select(Asset::getAssetCopyrightOwnerId); lambdaQueryWrapper = lambdaQueryWrapper.select(VideoContent::getId).select(VideoContent::getVideoContentCopyrightOwnerId);
List<Asset> assetList = this.assetService.list(lambdaQueryWrapper); List<VideoContent> videoContentList = this.videoContentService.list(lambdaQueryWrapper);
if (!assetList.isEmpty()) { if (!videoContentList.isEmpty()) {
final Set<String> assetCopyrightOwnerIdList = assetList.stream().map(Asset::getAssetCopyrightOwnerId).collect(Collectors.toSet()); final Set<String> assetCopyrightOwnerIdList = videoContentList.stream().map(VideoContent::getVideoContentCopyrightOwnerId).collect(Collectors.toSet());
List<CopyrightOwner> copyrightOwnerList = this.copyrightOwnerService.listByIds(assetCopyrightOwnerIdList); List<CopyrightOwner> copyrightOwnerList = this.copyrightOwnerService.listByIds(assetCopyrightOwnerIdList);
String copyrightOwnerName = copyrightOwnerList.stream().map(CopyrightOwner::getName).collect(Collectors.joining("、")); String copyrightOwnerName = copyrightOwnerList.stream().map(CopyrightOwner::getName).collect(Collectors.joining("、"));
assetType.setCopyrightOwnerName(copyrightOwnerName); videoContentCat.setCopyrightOwnerName(copyrightOwnerName);
} }
} }
return getResult(page); return getResult(page);
} }
@ApiOperation(value = "获取视频分类详情", notes = "获取视频分类详情") @ApiOperation(value = "获取视频内容分类详情", notes = "获取视频内容分类详情")
@ApiImplicitParams({ @ApiImplicitParams({
@ApiImplicitParam(name = "id", value = "标识ID", dataType = "String", paramType = "path") @ApiImplicitParam(name = "id", value = "标识ID", dataType = "String", paramType = "path")
}) })
@GetMapping("/get/{id}") @GetMapping("/get/{id}")
@RequiresPermissions("asset:type:get:id") @RequiresPermissions("video:content:cat:get:id")
public Map<String, Object> getById(@PathVariable("id") String id) { public Map<String, Object> getById(@PathVariable("id") String id) {
AssetType assetType = assetTypeService.getById(id); VideoContentCat videoContentCat = videoContentCatService.getById(id);
return getResult(assetType); return getResult(videoContentCat);
} }
} }
......
...@@ -3,23 +3,26 @@ ...@@ -3,23 +3,26 @@
<mapper namespace="cn.wisenergy.chnmuseum.party.mapper.AssetMapper"> <mapper namespace="cn.wisenergy.chnmuseum.party.mapper.AssetMapper">
<!-- 通用查询映射结果 --> <!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.wisenergy.chnmuseum.party.model.Asset"> <resultMap id="BaseResultMap" type="cn.wisenergy.chnmuseum.party.model.VideoContent">
<id column="id" property="id" /> <id column="id" property="id"/>
<result column="name" property="name" /> <result column="ref_item_id" property="refItemId"/>
<result column="thumbnail" property="thumbnail" /> <result column="file_name" property="fileName"/>
<result column="asset_type_id" property="assetTypeId" /> <result column="file_ext_name" property="fileExtName"/>
<result column="asset_copyright_owner_id" property="assetCopyrightOwnerId" /> <result column="file_type" property="fileType"/>
<result column="video_url" property="videoUrl" /> <result column="file_size" property="fileSize"/>
<result column="audit_status" property="auditStatus" /> <result column="file_cat" property="fileCat"/>
<result column="is_published" property="isPublished" /> <result column="file_url" property="fileUrl"/>
<result column="is_deleted" property="isDeleted" /> <result column="thumbnail" property="thumbnail"/>
<result column="create_time" property="createTime" /> <result column="language" property="language"/>
<result column="update_time" property="updateTime" /> <result column="md5" property="md5"/>
</resultMap> <result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
</resultMap>
<!-- 通用查询结果列 --> <!-- 通用查询结果列 -->
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, name, thumbnail, asset_type_id, asset_copyright_owner_id, video_url, audit_status, is_published, is_deleted, create_time, update_time id, ref_item_id, file_name, file_ext_name, file_type, file_size, file_cat, file_url, thumbnail, language, md5,
create_time, update_time
</sql> </sql>
</mapper> </mapper>
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
a.*,b.`name`,c.user_name AS userName a.*,b.`name`,c.user_name AS userName
FROM FROM
t_audit a t_audit a
LEFT JOIN asset b ON a.ref_item_id = b.id LEFT JOIN videoContent b ON a.ref_item_id = b.id
LEFT JOIN t_user c ON a.user_id = c.id LEFT JOIN t_user c ON a.user_id = c.id
${ew.customSqlSegment} ${ew.customSqlSegment}
</select> </select>
......
...@@ -8,13 +8,13 @@ ...@@ -8,13 +8,13 @@
<result column="board_id" property="boardId" /> <result column="board_id" property="boardId" />
<result column="real_name" property="realName" /> <result column="real_name" property="realName" />
<result column="comment" property="comment" /> <result column="comment" property="comment" />
<result column="asset" property="asset" /> <result column="videoContent" property="videoContent" />
<result column="create_time" property="createTime" /> <result column="create_time" property="createTime" />
</resultMap> </resultMap>
<!-- 通用查询结果列 --> <!-- 通用查询结果列 -->
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, board_id, real_name, comment, asset, create_time id, board_id, real_name, comment, videoContent, create_time
</sql> </sql>
</mapper> </mapper>
...@@ -4,29 +4,29 @@ ...@@ -4,29 +4,29 @@
<!-- 通用查询映射结果 --> <!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.wisenergy.chnmuseum.party.model.ExhibitionBoard"> <resultMap id="BaseResultMap" type="cn.wisenergy.chnmuseum.party.model.ExhibitionBoard">
<id column="id" property="id" /> <id column="id" property="id"/>
<result column="name" property="name" /> <result column="name" property="name"/>
<result column="board_copyright_owner_id" property="boardCopyrightOwnerId" /> <result column="board_copyright_owner_id" property="boardCopyrightOwnerId"/>
<result column="exhibition_board_cat_id" property="exhibitionBoardCatId" /> <result column="exhibition_board_cat_id" property="exhibitionBoardCatId"/>
<result column="cover" property="cover" /> <result column="cover" property="cover"/>
<result column="qrcode_url" property="qrcodeUrl" /> <result column="qrcode_url" property="qrcodeUrl"/>
<result column="remarks" property="remarks" /> <result column="remarks" property="remarks"/>
<result column="asset_copyright_owner_id" property="assetCopyrightOwnerId" /> <result column="video_content_copyright_owner_id" property="videoContentCopyrightOwnerId"/>
<result column="asset_type_id" property="assetTypeId" /> <result column="video_content_cat_id" property="videoContentCatId"/>
<result column="asset_id" property="assetId" /> <result column="video_content_id" property="videoContentId"/>
<result column="guide_audio_url" property="guideAudioUrl" /> <result column="ref_material_dir" property="refMaterialDir"/>
<result column="ref_material_dir" property="refMaterialDir" /> <result column="audit_status" property="auditStatus"/>
<result column="ref_material_url" property="refMaterialUrl" /> <result column="is_published" property="isPublished"/>
<result column="audit_status" property="auditStatus" /> <result column="is_deleted" property="isDeleted"/>
<result column="is_published" property="isPublished" /> <result column="create_time" property="createTime"/>
<result column="is_deleted" property="isDeleted" /> <result column="update_time" property="updateTime"/>
<result column="create_time" property="createTime" /> </resultMap>
<result column="update_time" property="updateTime" />
</resultMap>
<!-- 通用查询结果列 --> <!-- 通用查询结果列 -->
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, name, board_copyright_owner_id, exhibition_board_cat_id, cover, qrcode_url, remarks, asset_copyright_owner_id, asset_type_id, asset_id, guide_audio_url, ref_material_dir, ref_material_url, audit_status, is_published, is_deleted, create_time, update_time id, name, board_copyright_owner_id, exhibition_board_cat_id, cover, qrcode_url, remarks,
video_content_copyright_owner_id, video_content_cat_id, video_content_id, ref_material_dir,
audit_status, is_published, is_deleted, create_time, update_time
</sql> </sql>
</mapper> </mapper>
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.wisenergy.chnmuseum.party.mapper.AssetTypeMapper"> <mapper namespace="cn.wisenergy.chnmuseum.party.mapper.VideoContentCatMapper">
<!-- 通用查询映射结果 --> <!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.wisenergy.chnmuseum.party.model.AssetType"> <resultMap id="BaseResultMap" type="cn.wisenergy.chnmuseum.party.model.VideoContentCat">
<id column="id" property="id" /> <id column="id" property="id"/>
<result column="name" property="name" /> <result column="name" property="name"/>
<result column="remarks" property="remarks" /> <result column="remarks" property="remarks"/>
<result column="copyright_owner_id" property="copyrightOwnerId" /> <result column="copyright_owner_id" property="copyrightOwnerId"/>
<result column="create_time" property="createTime" /> <result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime" /> <result column="update_time" property="updateTime"/>
</resultMap> </resultMap>
<!-- 通用查询结果列 --> <!-- 通用查询结果列 -->
<sql id="Base_Column_List"> <sql id="Base_Column_List">
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.wisenergy.chnmuseum.party.mapper.VideoContentMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="cn.wisenergy.chnmuseum.party.model.VideoContent">
<id column="id" property="id"/>
<result column="name" property="name"/>
<result column="video_content_copyright_owner_id" property="videoContentCopyrightOwnerId"/>
<result column="video_content_cat_id" property="videoContentCatId"/>
<result column="thumbnail" property="thumbnail"/>
<result column="audit_status" property="auditStatus"/>
<result column="is_published" property="published"/>
<result column="is_deleted" property="deleted"/>
<result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime"/>
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
id, name, video_content_copyright_owner_id, video_content_cat_id, thumbnail, audit_status, is_published, is_deleted, create_time, update_time
</sql>
</mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment