用户栏目新增app接口

This commit is contained in:
ly19960718 2021-06-03 14:04:23 +08:00
parent f32982721c
commit 82db8852dd

View File

@ -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<UserColumnDataListDTO> 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<List<UserColumnDataDTO>> listPageByUserId(@RequestHeader("token") String token, ListPage page) {
Map<String, Object> 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"),