package jnpf.attendance;



import jnpf.attendance.dto.AttendanceUserGroupVo;
import jnpf.attendance.dto.AttendanceUserListGroupVO;
import jnpf.attendance.fallback.AttendanceGroupApiFallback;
import jnpf.base.ActionResult;
import jnpf.entity.AttendanceGroup;
import jnpf.model.attendance.vo.AttendanceGroupVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @Title:  考情组api
 * @Author: peng.hao
 * @create: 2024/4/23:16:09
 */
@FeignClient(name = "jnpf-ftb",fallbackFactory = AttendanceGroupApiFallback.class,path = "/group")
public interface AttendanceGroupApi {
    /**
     * 获取考勤组名称
     * @param groupId 考勤组Id
     *
     */
    @GetMapping("/queryTheNameOfTheAttendanceGroup")
    AttendanceGroup queryTheNameOfTheAttendanceGroup(@RequestParam(value = "groupId") String groupId);
    @GetMapping("/attendanceUserGroup")
    List<AttendanceUserGroupVo> getAttendanceUserGroup(@RequestParam("userIds")  List<String> userIds);

    @GetMapping("/getGroupListByOrgId")
    List<AttendanceGroup> getGroupListByOrgId(@RequestParam("organizeId") String organizeId);

    /**
     * 批量获取用户绑定的考勤组 ,包含全名称 xxx/xxx/xxx
     * @param userIds 用户ids
     *
     */
    @PostMapping("/list/user_bound")
    ActionResult<List<AttendanceUserListGroupVO>> getAttendanceUserListGroupVO(@RequestBody List<String> userIds);

    /**
     * 详情---获取一个考勤组
     * @param organizeName 组织名称
     * @param groupName 考勤组名称
     * @return 一个考勤组
     */
    @GetMapping("/info/organize_group/name")
    ActionResult<AttendanceGroupVo> getAttendanceGroupByName(@RequestParam("organizeName") String organizeName, @RequestParam("groupName") String groupName);


    @GetMapping("/checkScheduling")
    boolean checkScheduling();
}
