package com.mx.cneeds.server.datashow.client;

import com.mx.cneeds.common.dto.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @ClassName UserClient
 * @Author zzrdark
 * @Date 2020-03-09 15:21
 * @Description TODO
 **/
@FeignClient(name = "CNEEDS-SERVER-USER")
public interface UserClient {

    /**
     *
     * @param page
     * @param pageSize
     * @param order
     * @param orderField
     * @return
     */
    @PostMapping("/sys/func/list")
    PageDto funcList(@RequestParam Integer page,
                     @RequestParam("limit") Integer pageSize,
                     @RequestParam("sidx") String orderField,
                     @RequestParam("order") String order);

    @PostMapping("/sys/func/listAll")
    List<FuncDto> funcListAll();
    /**
     *
     * @param page
     * @param pageSize
     * @param orderField
     * @param order
     * @return
     */
    @PostMapping("/sys/dept/list")
    PageDto deptList(@RequestParam Integer page,
                     @RequestParam("limit") Integer pageSize,
                     @RequestParam("sidx") String orderField,
                     @RequestParam("order") String order);

    /**
     * 获取部门列表
     * @return
     */
    @PostMapping("/sys/dept/listAll")
    List<DepartmentDto> deptListAll();

    @PostMapping("/sys/dept/save")
    void addDept(@RequestBody DepartmentDto dto);

    @PostMapping("/sys/dept/update")
    void updateDept(@RequestBody DepartmentDto dto);

    @PostMapping("/sys/dept/delete")
    void deleteDept(@RequestBody List<Long> ids);

    @PostMapping("/sys/dept/info")
    DepartmentDto deptInfo(@RequestBody Long deptId);

    /**
     *
     * @param page
     * @param pageSize
     * @param order
     * @param orderField
     * @return
     */
    @PostMapping("/sys/role/list")
    PageDto roleList(@RequestParam Integer page,
                     @RequestParam("limit") Integer pageSize,
                     @RequestParam("sidx") String orderField,
                     @RequestParam("order") String order);

    @PostMapping("/sys/role/info")
    RoleDto infoRole(@RequestParam Long roleId);

    @PostMapping("/sys/role/save")
    void addRole(@RequestBody RoleDto dto);

    @PostMapping("/sys/role/update")
    void updateRole(@RequestBody RoleDto dto);

    @PostMapping("/sys/role/delete")
    void deleteRole(@RequestBody List<Long> ids);


    @PostMapping("/sys/role/listAll")
    List<RoleDto> roleListAll();

    /**
     *
     * @param page
     * @param pageSize
     * @param order
     * @param orderField
     * @return
     */
    @PostMapping("/sys/user/list")
    PageDto userList(@RequestParam Integer page,
                     @RequestParam("limit") Integer pageSize,
                     @RequestParam("sidx") String orderField,
                     @RequestParam("order") String order);


    @PostMapping("/sys/user/userinfo")
    UserDto userInfo(@RequestParam String username);



    @PostMapping("/sys/user/save")
    void addUser(@RequestBody UserDto dto);

    @PostMapping("/sys/user/update")
    void updateUser(@RequestBody UserDto dto);

    @PostMapping("/sys/user/delete")
    void deleteUser(@RequestBody List<Long> ids);
}
