提交 75942c96 authored 作者: liupengfei's avatar liupengfei

--no commit message

上级 72dcb8d0
......@@ -76,7 +76,7 @@ public class Book {
private String copyrightTerm;
@ApiModelProperty("书刊类型 0外版书 1本版书")
private Integer type;
@ApiModelProperty("销售状态 0 不可售 1 可售")
@ApiModelProperty("销售状态 0 不可售 1 VIP会员免费 2 购买单品")
private Integer status;
@ApiModelProperty("编者,主编等")
......
......@@ -9,6 +9,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.github.pagehelper.PageHelper;
import com.zrqx.core.enums.ResponseCodeEnum;
import com.zrqx.core.enums.resource.diytype.DiyTypeStatusEnum;
import com.zrqx.core.exception.BaseException;
import com.zrqx.core.util.bean.Copy;
......@@ -103,4 +104,19 @@ public class FgDiyTypeController {
return CallBack.success(voList);
}
@ApiOperation(value = "根据数据类型(一级分类名)查询自定义分类tree", notes = "查询列表")
@GetMapping(value = "/name/tree")
public CallBack<List<FgDiyTypeVo>> tree(String name) {
if(StringUtils.isBlank(name)){
throw new BaseException(ResponseCodeEnum.MISS_EXCEPTION.getCode(), "参数不能为空!");
}
Example example = new Example(DiyType.class);;
example.createCriteria().andEqualTo("status", DiyTypeStatusEnum.STATUS_1.getCode());
PageHelper.orderBy("sort");
List<DiyType> list = service.selectByExample(example);
// 获取一级分类
List<FgDiyTypeVo> voList = Copy.copyList(list , FgDiyTypeVo.class, obj -> name.equals(obj.getTypeName()) && obj.getParentId().intValue() == 0);
tree(list,voList);
return CallBack.success(voList);
}
}
......@@ -208,12 +208,12 @@ public class FgAuthorLibraryServiceImpl extends BaseServiceImpl<AuthorLibrary, S
aboutListVO.setSynopsis(StringUtils.isBlank(ebook.getSynopsis()) ? "" : ebook.getSynopsis().replaceAll("\\<.*?>", ""));
list.add(aboutListVO);
}
if(resource.getResourceType() == AllResourceTypeEnum.ARTICLE.getCode()){
/*if(resource.getResourceType() == AllResourceTypeEnum.ARTICLE.getCode()){
ArticleLibrary articleLibrary = articleMapper.selectByPrimaryKey(resource.getResourceId());
BeanUtils.copyProperties(articleLibrary, aboutListVO);
aboutListVO.setText(articleLibrary.getText() == null ? "" : articleLibrary.getText().replaceAll("\\<.*?>", ""));
list.add(aboutListVO);
}
}*/
}
List<AboutListVO> result = list.stream().limit(pageParam.getPageNum() * pageParam.getPageSize()).collect(Collectors.toList());
result = result.stream().skip((pageParam.getPageNum() -1 )* pageParam.getPageSize()).collect(Collectors.toList());
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论