|
|
|
@ -193,27 +193,27 @@ public class ReferenceController {
|
|
|
|
|
|
|
|
|
|
@Data
|
|
|
|
|
static class ListRParam {
|
|
|
|
|
|
|
|
|
|
@Schema(title = "名称")
|
|
|
|
|
private String title;
|
|
|
|
|
@Schema(title = "文件地址")
|
|
|
|
|
private String fileUrl;
|
|
|
|
|
@Schema(title = "封面图片地址")
|
|
|
|
|
private String coverUrl;
|
|
|
|
|
private int pageNum;
|
|
|
|
|
private int pageSize;
|
|
|
|
|
@Schema(title = "素材分组id")
|
|
|
|
|
private Integer groupId;
|
|
|
|
|
@Schema(title = "月份区间")
|
|
|
|
|
private Integer month;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Operation(summary = "素材列表")
|
|
|
|
|
@PostMapping("/list")
|
|
|
|
|
public Result list(@RequestBody(required = false) JSONObject obj) {
|
|
|
|
|
Wrapper<Reference> queryWrapper = new QueryWrapper<>();
|
|
|
|
|
IPage iPage = referenceService.selectPage(MybatisPlusUtil.SetPage(obj), queryWrapper);
|
|
|
|
|
List<Reference> referenceList = iPage.getRecords();
|
|
|
|
|
for (int i = referenceList.size() - 1; i >= 0; i--) {
|
|
|
|
|
Reference reference = (Reference) referenceList.get(i);
|
|
|
|
|
int id = reference.getId();
|
|
|
|
|
reference.setTagList(referenceTagService.selByReferenceId(id));
|
|
|
|
|
reference.setBrandList(referenceBrandService.selByReferenceId(id));
|
|
|
|
|
public Result list(@Validated @RequestBody ListRParam param) {
|
|
|
|
|
QueryWrapper<Reference> queryWrapper = new QueryWrapper<>();
|
|
|
|
|
JSONObject obj = new JSONObject();
|
|
|
|
|
obj.put("pageNum",param.getPageNum());
|
|
|
|
|
obj.put("pageSize",param.getPageSize());
|
|
|
|
|
Integer groupId = param.groupId;
|
|
|
|
|
if(groupId != null){
|
|
|
|
|
queryWrapper.eq("groupId",groupId);
|
|
|
|
|
}
|
|
|
|
|
queryWrapper.orderByDesc("creatAt");
|
|
|
|
|
IPage iPage = referenceService.selectPage(MybatisPlusUtil.SetPage(obj), queryWrapper);
|
|
|
|
|
return Result.success(iPage);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|