提交 c59528c8 authored 作者: renjiancai's avatar renjiancai

--no commit message

上级 a5dae29d
......@@ -35,22 +35,5 @@
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
<classpathentry kind="src" path="target/generated-sources/annotations">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="ignore_optional_problems" value="true"/>
<attribute name="m2e-apt" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="target/generated-test-sources/test-annotations">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="ignore_optional_problems" value="true"/>
<attribute name="m2e-apt" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>
......@@ -17,6 +17,10 @@ public enum ResourceTypeEnum {
*/
ARTICLE(2, "文章"),
/**
* 文章
*/
AUTHOR(3, "作者"),
/**
/**
* 视频
*/
......
......@@ -16,6 +16,6 @@ public class QueryResourceForPoPForm {
private String title;
@ApiModelProperty("自定义分类code")
private String diyTypeCode;
@ApiModelProperty(value="1图书 2文章",required = true)
@ApiModelProperty(value="1图书 2文章,3专家",required = true)
private Integer resourceType;
}
......@@ -7,10 +7,8 @@ import lombok.Data;
@Data
public class SaveResourceRelationForm {
@ApiModelProperty("当前id")
private Integer id;
@ApiModelProperty("管理资源id")
private String objectId;
private String Id;
@ApiModelProperty("被关联资源id")
private List<String> resourceIds;
@ApiModelProperty("资源类型 1图书 2 文章 ")
......
eclipse.preferences.version=1
encoding//src/main/java=UTF-8
encoding//src/main/resources=UTF-8
encoding//src/test/java=UTF-8
encoding//src/test/resources=UTF-8
encoding/<project>=UTF-8
......@@ -230,7 +230,7 @@ public class ArticleLibraryController {
List<ArticleResource> list = resourceService.selectByExample(example);
if(list==null || list.size()==0) {
ArticleResource e = new ArticleResource();
e.setObjectId(entity.getObjectId());
e.setObjectId(entity.getId());
e.setResourceId(entity.getResourceIds().get(i));
e.setCreateTime(new Date());
e.setResourceType(entity.getResourceType());
......
......@@ -224,7 +224,7 @@ public class AuthorLibraryController {
@ApiOperation(value = "保存相关资源", notes = "保存相关资源")
@PostMapping(value = ResourceRequestPath.RELATION_RESOURCE + ResourceRequestPath.SAVE)
public CallBack<Boolean> saveRelation(@RequestBody SaveResourceRelationForm entity) {
if (entity.getId() == null || entity.getResourceIds() == null || entity.getResourceType() == null
if (entity.getResourceIds() == null || entity.getResourceType() == null
|| entity.getResourceIds().size() == 0) {
throw new ParameterValidateException(ResponseCodeEnum.MISS_EXCEPTION.getCode(), "必须指定id、被关联的resourceId、资源类型");
}
......@@ -236,7 +236,7 @@ public class AuthorLibraryController {
List<AuthorResource> list = resourceService.selectByExample(example);
if(list==null || list.size()==0) {
AuthorResource e = new AuthorResource();
e.setObjectId(entity.getObjectId());
e.setObjectId(entity.getId());
e.setResourceId(entity.getResourceIds().get(i));
e.setCreateTime(new Date());
e.setResourceType(entity.getResourceType());
......
......@@ -285,7 +285,7 @@ public class EbookController {
@ApiOperation(value = "保存相关资源", notes = "保存相关资源")
@PostMapping(value = ResourceRequestPath.RELATION_RESOURCE + ResourceRequestPath.SAVE)
public CallBack<Boolean> saveRelation(@RequestBody SaveResourceRelationForm entity) {
if (entity.getId() == null || entity.getResourceIds() == null || entity.getResourceType() == null
if (entity.getId() != null || entity.getResourceIds() == null || entity.getResourceType() == null
|| entity.getResourceIds().size() == 0) {
throw new ParameterValidateException(ResponseCodeEnum.MISS_EXCEPTION.getCode(), "必须指定id、被关联的resourceId、资源类型");
}
......@@ -297,16 +297,16 @@ public class EbookController {
List<EbookResource> list = resourceService.selectByExample(example);
if(list==null || list.size()==0) {
EbookResource e = new EbookResource();
e.setObjectId(entity.getObjectId());
e.setObjectId(entity.getId());
e.setResourceId(entity.getResourceIds().get(i));
e.setCreateTime(new Date());
e.setResourceType(entity.getResourceType());
Integer maxOrderNum = resourceService.getMaxOrderNum();
e.setSort(maxOrderNum+1);
recordList.add(e);
resourceService.insert(e);
}
}
return CallBack.success(resourceService.insertList(recordList));
return CallBack.success();
}
@ApiOperation(value = "批量删除关联资源", notes = "批量删除")
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论