部门列表页

This commit is contained in:
zhenxianyimeng
2019-07-06 11:50:56 +08:00
parent 89d875d0a9
commit aa42de21e9
9 changed files with 179 additions and 2 deletions

View File

@@ -16,8 +16,10 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@@ -42,7 +44,7 @@ public class DeptmentController {
@GetMapping("tree/page")
@ApiOperation(value = "根部门分页的部门树")
public CommonResult<PageResult<DeptmentVO>> treePage(DeptmentPageDTO deptmentPageDTO){
public CommonResult<PageResult<DeptmentVO>> treePage(@Validated DeptmentPageDTO deptmentPageDTO){
PageResult<DeptmentBO> pageResult = deptmentService.getPageRootDeptment(deptmentPageDTO);
PageResult<DeptmentVO> voPageResult = DeptmentConvert.INSTANCE.convert(pageResult);
List<DeptmentBO> list = deptmentService.getAllDeptments();

View File

@@ -1,8 +1,10 @@
package cn.iocoder.mall.admin.api.dto.depetment;
import cn.iocoder.common.framework.vo.PageParam;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
/**
@@ -12,7 +14,9 @@ import lombok.Data;
* @date: 2019-06-21
* @time: 00:22
*/
@ApiModel(value = "部门分页 DTO")
@Data
@Accessors(chain = true)
public class DeptmentPageDTO extends PageParam {
@ApiModelProperty(value = "根部门名字", example = "研发部")
private String name;