package com.muzhi.dingtalk.test.controller;

import com.muzhi.dingtalk.test.entity.vo.DepartmentDataVo;
import com.muzhi.dingtalk.test.entity.vo.DepartmentQuery;
import com.muzhi.dingtalk.test.service.DepartmentService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
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;

@Api(description = "钉钉部门")
@RestController
@RequestMapping(value = "/departmentservice/department", produces = {"application/json;charset=UTF-8"})
public class DepartmentController {

    @Autowired
    private DepartmentService departmentService;

    //查询钉钉接口中的部门列表信息
    @ApiOperation(value = "查询钉钉接口中的部门列表信息")
    @GetMapping("getDingDepartment")
    public String getDingDepartment(){

        String dingDepartment = departmentService.getDingDepartment();
        return dingDepartment;
    }

    //获取部门列表
    @ApiOperation(value = "获取部门列表")
    @GetMapping("getDepartmentList")
    public DepartmentDataVo getDepartmentList(Integer page, Integer limit, DepartmentQuery departmentQuery){

        DepartmentDataVo departmentList = departmentService.getDepartmentList(page, limit, departmentQuery);
        return departmentList;
    }

    //TODO 获取部门详情列表
    @ApiOperation(value = "获取部门详情列表")
    @GetMapping("getDepartmentXQ")
    public String getDepartmentXQ(){

        return null;
    }
}
