文章数据封装接口
This commit is contained in:
parent
4735514efb
commit
12d120b1c8
@ -4,11 +4,21 @@ package com.tenlion.twoduty.controller.api.contentdatabase;
|
||||
import ink.wgink.common.base.DefaultBaseController;
|
||||
import ink.wgink.common.component.SecurityComponent;
|
||||
import ink.wgink.interfaces.consts.ISystemConstant;
|
||||
import io.swagger.annotations.Api;
|
||||
import ink.wgink.module.article.pojo.dtos.content.ContentDTO;
|
||||
import ink.wgink.module.article.service.content.IContentService;
|
||||
import ink.wgink.pojo.ListPage;
|
||||
import ink.wgink.pojo.result.ErrorResult;
|
||||
import ink.wgink.pojo.result.SuccessResultList;
|
||||
import ink.wgink.service.department.service.IDepartmentUserService;
|
||||
import io.swagger.annotations.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 文章数据封装
|
||||
* @author liuyang
|
||||
@ -24,10 +34,37 @@ public class ContentDataBaseController extends DefaultBaseController {
|
||||
|
||||
@Autowired
|
||||
protected SecurityComponent securityComponent;
|
||||
@Autowired
|
||||
private IContentService contentService;
|
||||
@Autowired
|
||||
private IDepartmentUserService departmentUserService;
|
||||
|
||||
private final String CATEGORYID = "9c74d8a7-2686-45fc-a77f-a3ce1ffd8cfe";
|
||||
|
||||
|
||||
|
||||
|
||||
@ApiOperation(value = "组织文章内容分页列表", notes = "组织文章内容分页列表接口")
|
||||
@ApiImplicitParams({
|
||||
@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 = "departmentId", value = "部门ID", paramType = "query", dataType = "String")
|
||||
})
|
||||
@ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
|
||||
@GetMapping("list-page-department")
|
||||
public SuccessResultList<List<ContentDTO>> listPageDepartment(ListPage page){
|
||||
Map<String, Object> params = requestParams();
|
||||
page.setParams(params);
|
||||
String departmentId = params.get("departmentId").toString();
|
||||
List<String> userids = departmentUserService.listUserId(departmentId);
|
||||
SuccessResultList<List<ContentDTO>> listSuccessResultList = contentService.listPageByUserIds(CATEGORYID,userids,page);
|
||||
return listSuccessResultList;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -126,6 +126,9 @@ public class DepartmentBaseController extends DefaultBaseController {
|
||||
}
|
||||
List<String> listUsers = roleUserService.listUserId(roleDTO.getRoleId());
|
||||
List<String> userIds = departmentUserService.listUserId(departmentId, listUsers);
|
||||
if(userIds.size() == 0){
|
||||
return list;
|
||||
}
|
||||
list = userService.listByUserIds(userIds);
|
||||
for (UserDTO userDTO : list) {
|
||||
this.setUserParams(userDTO);
|
||||
@ -141,6 +144,9 @@ public class DepartmentBaseController extends DefaultBaseController {
|
||||
public List<UserDTO> listUser(@PathVariable("departmentId") String departmentId){
|
||||
List<UserDTO> list = new ArrayList<>();
|
||||
List<String> userIds = departmentUserService.listUserId(departmentId);
|
||||
if(userIds.size() == 0){
|
||||
return list;
|
||||
}
|
||||
list = userService.listByUserIds(userIds);
|
||||
for (UserDTO userDTO : list) {
|
||||
this.setUserParams(userDTO);
|
||||
|
Loading…
Reference in New Issue
Block a user