diff --git a/src/main/java/cn/com/tenlion/controller/app/apis/usercolumndata/UserColumnDataAppController.java b/src/main/java/cn/com/tenlion/controller/app/apis/usercolumndata/UserColumnDataAppController.java index 2986c07..78616fa 100644 --- a/src/main/java/cn/com/tenlion/controller/app/apis/usercolumndata/UserColumnDataAppController.java +++ b/src/main/java/cn/com/tenlion/controller/app/apis/usercolumndata/UserColumnDataAppController.java @@ -108,6 +108,55 @@ public class UserColumnDataAppController extends DefaultBaseController { + @ApiOperation(value = "根据用户ID获取栏目数据列表", notes = "根据用户ID获取栏目数据列表接口(默认每个栏目返回最新1条数据)") + @ApiImplicitParams({ + @ApiImplicitParam(name = "token", value = "token", paramType = "header"), + @ApiImplicitParam(name = "userId", value = "用户ID", paramType = "path"), + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("list-my-creator-id/{userId}") + public List listMyCreatorId(@RequestHeader("token") String token,@PathVariable("userId") String userId) throws ReflectUtil.ReflectException { + if(StringUtils.isBlank(userId)){ + throw new ParamsException("参数异常"); + } + return userColumnDataService.listMyCreator(userId); + } + + + @ApiOperation(value = "根据用户ID获取栏目数据分页列表", notes = "根据用户ID获取栏目数据分页列表接口") + @ApiImplicitParams({ + @ApiImplicitParam(name = "token", value = "token", paramType = "header"), + @ApiImplicitParam(name = "page", value = "当前页码", paramType = "query", dataType = "int", defaultValue = "1"), + @ApiImplicitParam(name = "rows", value = "显示数量", paramType = "query", dataType = "int", defaultValue = "20"), + @ApiImplicitParam(name = "keywords", value = "关键字", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "startTime", value = "开始时间", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "endTime", value = "结束时间", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "columnId", value = "栏目ID", paramType = "query", dataType = "String"), + @ApiImplicitParam(name = "userId", value = "用户ID", paramType = "query", dataType = "String") + }) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("list-page-by-userId") + public SuccessResultList> listPageByUserId(@RequestHeader("token") String token, ListPage page) { + Map params = requestParams(); + String columnId = params.get("columnId").toString(); + String userId = params.get("userId").toString(); + if(StringUtils.isBlank(columnId)){ + throw new ParamsException("参数异常-1"); + } + if(StringUtils.isBlank(userId)){ + throw new ParamsException("参数异常-2"); + } + params.put("creator",userId); + page.setParams(params); + return userColumnDataService.listPage(page); + } + + + + + + + @ApiOperation(value = "栏目数据分页列表", notes = "栏目数据分页列表接口") @ApiImplicitParams({ @ApiImplicitParam(name = "token", value = "token", paramType = "header"),