package com.hzya.frame.dingtalk.service;

import com.dingtalk.api.request.OapiV2UserListRequest;
import com.dingtalk.api.response.OapiV2DepartmentGetResponse;
import com.dingtalk.api.response.OapiV2DepartmentListsubResponse;
import com.dingtalk.api.response.OapiV2UserGetResponse;
import com.dingtalk.api.response.OapiV2UserListResponse;

import java.util.List;

/**
 * @Description 钉钉service
 * @Author xiangerlin
 * @Date 2024/8/27 16:17
 **/
public interface IDingTalkService {

    /**
     * 根据userid获取用户详情
     * @param userId 钉钉userid
     * @param appKey
     * @param appSecret
     * @return
     */
    OapiV2UserGetResponse.UserGetResponse getUserById(String userId, String appKey, String appSecret);

    /**
     * 根据userid获取用户详情
     * @param userId
     * @return
     */
    OapiV2UserGetResponse.UserGetResponse getUserById(String userId);

    /**
     * 获取部门用户列表
     * @param req 请求参数
     * @param appKey
     * @param appSecret
     * @return
     */
    OapiV2UserListResponse.PageResult getUserListByDeptId(OapiV2UserListRequest req, String appKey, String appSecret);
    /**
     * 根据部门id获取部门详情
     * @param deptId 钉钉部门id
     * @param appKey
     * @param appSecret
     * @return
     */
    OapiV2DepartmentGetResponse.DeptGetResponse getDeptById(Long deptId, String appKey, String appSecret);

    /**
     * 根据部门id获取部门详情
     * @param deptId
     * @return
     */
    OapiV2DepartmentGetResponse.DeptGetResponse getDeptById(Long deptId);

    /**
     * 获取部门列表，此接口只会返回下一级部门信息
     * @param deptId 部门id，如果不传则查询一级部门
     * @param appKey
     * @param appSecret
     * @return
     */
    List<OapiV2DepartmentListsubResponse.DeptBaseResponse> getDeptList(Long deptId, String appKey, String appSecret);
}
