提交 96512a5c authored 作者: renjiancai's avatar renjiancai

--no commit message

上级 fe9fd007
......@@ -14,6 +14,8 @@ public class ResourceRequestPath extends BaseRequestPath {
public static final String ARTICLE_LIBRARY = "/article-library";
/** 图片库*/
public static final String IMAGE_LIBRARY = "/image-library";
/** 素材库*/
public static final String RESOURCE_LIBRARY = "/resource-library";
/** 视频库*/
public static final String VIDEO_LIBRARY = "/video-library";
/** 音频库*/
......
package com.zrqx.core.form.resource.bg.resourcelibrary;
import java.util.Date;
import java.util.List;
import javax.persistence.Transient;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel(value="SaveUpdateImageLibraryForm",description="新增和修改图片库")
public class SaveUpdateImageLibraryForm {
@ApiModelProperty("图片id,新增时不需要填写")
private String id;
@ApiModelProperty(value = "标题")
private String title;
@ApiModelProperty("图组")
private String text;
@ApiModelProperty("类型")
private String type;
@ApiModelProperty("定时发布时间")
private Date timingTime;
@ApiModelProperty("发布状态:0未发布,1已发布,2定时发布")
private Integer publishStatus;
@ApiModelProperty("审核状态:0发布中,1发布成功,2发布失败 ,3已删除,4部分发布失败,6未发布")
private Integer examineStatus;
@ApiModelProperty("资源类型 1图文章 2图集 3视频")
private Integer resourceType;
@ApiModelProperty("是否删除 0:未删除 1:已删除")
private Integer isDelete=0;
@ApiModelProperty("发布时间")
private Date publishTime;
@ApiModelProperty("上传时间")
private Date uploadTime;
@ApiModelProperty("审核时间")
private Date examineTime;
@ApiModelProperty("反馈原因")
private String reason;
@ApiModelProperty("封面")
private String cover;
@ApiModelProperty("内容唯一id")
private String article_id;
@ApiModelProperty("封面类型,1表示单图,3表示三图")
private Integer cover_type;
@Transient
private List<String> original_author;
@ApiModelProperty(value = "修改时间")
private Date updateTime;
}
package com.zrqx.core.form.resource.bg.resourcelibrary;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.Date;
import lombok.Data;
@Data
@ApiModel(value="SaveUpdateResourceLibraryForm",description="修改名称")
public class SaveUpdateResourceLibraryForm {
@ApiModelProperty("id,新增时不需要填写")
private String id;
@ApiModelProperty(value = "标题")
private String title;
@ApiModelProperty(value = "修改时间")
private Date updateTime;
}
......@@ -38,4 +38,7 @@ public class ResourceLibrary {
private String timeLength;
@ApiModelProperty("文件大小")
private String size;
@ApiModelProperty("修改时间")
private Date updateTime;
}
package com.zrqx.resource.bg.controller.content;
import java.io.IOException;
import java.text.ParseException;
import java.util.Date;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
......@@ -14,6 +18,10 @@ import com.zrqx.core.constant.resource.ResourceRequestPath;
import com.zrqx.core.enums.ResponseCodeEnum;
import com.zrqx.core.exception.BaseException;
import com.zrqx.core.form.resource.bg.BatchImportForm;
import com.zrqx.core.form.resource.bg.articlelibrary.SaveUpdateArticleLibraryForm;
import com.zrqx.core.form.resource.bg.resourcelibrary.SaveImageLibraryForm;
import com.zrqx.core.form.resource.bg.resourcelibrary.SaveUpdateResourceLibraryForm;
import com.zrqx.core.model.resource.ResourceLibrary;
import com.zrqx.core.util.page.PageInfo;
import com.zrqx.core.util.page.PageParam;
import com.zrqx.core.util.response.CallBack;
......@@ -24,11 +32,23 @@ import com.zrqx.resource.bg.service.resourcelibrary.ResourceLibraryService;
* 内容管理Controller
*/
@RestController
@RequestMapping(ResourceRequestPath.BG + ResourceRequestPath.ARTICLE_LIBRARY)
@RequestMapping(ResourceRequestPath.BG + ResourceRequestPath.RESOURCE_LIBRARY)
@Api(description = "内容管理——图组库")
public class ResourceLibraryController {
@Autowired
private ResourceLibraryService resourceLibraryService;
@ApiOperation(value = "新增", notes = "新增一个")
@PostMapping(value = ResourceRequestPath.SAVE)
public CallBack<Boolean> save(@RequestBody SaveUpdateResourceLibraryForm form) {
if(form.getId() == null){
throw new BaseException("请选择要修改的资源!");
}
ResourceLibrary library = resourceLibraryService.selectByPrimaryKey(form.getId());
library.setUpdateTime(new Date());
library.setTitle(form.getTitle());
resourceLibraryService.updateByPrimaryKey(library);
return CallBack.success();
}
/**
* 查询图片素材
* @param pageParam
......@@ -38,8 +58,8 @@ public class ResourceLibraryController {
*/
@ApiOperation(value = "分页查询", notes = "分页查询")
@GetMapping(value = ResourceRequestPath.PAGE)
public CallBack<PageInfo<ResourceLibraryListVO>> page(PageParam pageParam) {
return CallBack.success(resourceLibraryService.page(pageParam));
public CallBack<PageInfo<ResourceLibraryListVO>> page(Integer resourceType,PageParam pageParam) {
return CallBack.success(resourceLibraryService.page(resourceType,pageParam));
}
@ApiOperation(value = "批量新增" , notes ="批量新增")
......
......@@ -12,9 +12,12 @@ import com.zrqx.core.vo.resource.resourcelibrary.ResourceLibraryListVO;
*/
public interface ResourceLibraryMapper extends BaseMapper<ResourceLibrary> {
@Select("<script>"
+ "SELECT * from resource_library a where 1=1 and a.isDelete=0"
+ "SELECT * from resource_library a where 1=1 and a.isDelete=0"
+ "<if>"
+ " and a.resourceType=#{resourceType}"
+ "</if>"
+ "</script>")
List<ResourceLibraryListVO> query();
List<ResourceLibraryListVO> query(Integer resourceType);
}
......@@ -60,10 +60,10 @@ public class ResourceLibrarySerivceImpl extends BaseServiceImpl<ResourceLibrary,
* @date: 2019年7月12日 上午10:04:16
*/
@Override
public PageInfo<ResourceLibraryListVO> page(PageParam pageParam) {
public PageInfo<ResourceLibraryListVO> page(Integer resourceType,PageParam pageParam) {
pageParam.setOrderBy("uploadTime desc");
startPage(pageParam);
List<ResourceLibraryListVO> list = resourceMapper.query();
List<ResourceLibraryListVO> list = resourceMapper.query(resourceType);
return new PageInfo<ResourceLibraryListVO>(list);
}
@Override
......@@ -80,9 +80,12 @@ public class ResourceLibrarySerivceImpl extends BaseServiceImpl<ResourceLibrary,
obj.setTitle(name);
obj.setPath(form.getToken().get(i));
obj.setUploadTime(new Date());
obj.setResourceType(1);
obj.setResourceType(form.getResourceType());
obj.setIsDelete(0);
obj.setResourceType(5);
if(form.getResourceType().equals(2)){
obj.setSize(form.getSize().get(i));
obj.setTimeLength(form.getTimeLength().get(i));
}
resourceMapper.insert(obj);
list.add(obj);
}
......
......@@ -30,7 +30,7 @@ public interface ResourceLibraryService extends BaseService<ResourceLibrary,Inte
* @author rjc
* @date: 2019年7月12日 上午10:04:49
*/
PageInfo<ResourceLibraryListVO> page(PageParam pageParam);
PageInfo<ResourceLibraryListVO> page(Integer resourceType,PageParam pageParam);
boolean batchInsert(BatchImportForm form);
}
package com.zrqx.resource.bg.service.user;
import com.zrqx.core.form.resource.bg.resourcelibrary.SaveUpdateImageLibraryForm;
import com.zrqx.core.model.sysuser.user.UserAccountRelation;
import com.zrqx.core.service.BaseService;
/**
......@@ -11,6 +10,5 @@ public interface UserAccountRelationService extends BaseService<UserAccountRelat
Integer accountCount(Integer status);
public boolean saveOrUpdate(SaveUpdateImageLibraryForm form);
}
\ No newline at end of file
......@@ -5,7 +5,6 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zrqx.core.form.resource.bg.resourcelibrary.SaveUpdateImageLibraryForm;
import com.zrqx.core.mapper.BaseMapper;
import com.zrqx.core.model.sysuser.user.UserAccountRelation;
import com.zrqx.core.service.BaseServiceImpl;
......@@ -29,10 +28,4 @@ public class UserAccountRelationServiceImpl extends BaseServiceImpl<UserAccountR
// TODO Auto-generated method stub
return accountRelationMapper.accountCount(status);
}
@Override
public boolean saveOrUpdate(SaveUpdateImageLibraryForm form) {
return true;
}
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论