package com.bonus.system.controller;

import com.bonus.common.core.web.domain.AjaxResult;
import com.bonus.system.api.domain.SysDept;
import com.bonus.system.domain.SysParamsDto;
import com.bonus.system.service.ISelectService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @className:SelectController
 * @author:cwchen
 * @date:2024-07-15-10:24
 * @version:1.0
 * @description:公共下拉选-controller
 */
@RestController
@RequestMapping("/select/")
@Slf4j
public class SelectController {

    @Resource(name = "ISelectService")
    private ISelectService service;

    /**
     * 获取班组下拉选
     *
     * @param dto
     * @return AjaxResult
     * @author cwchen
     * @date 2024/7/15 10:35
     */
    @GetMapping("/getTeamList")
    public AjaxResult getTeamList(SysParamsDto dto) {
        return service.getTeamList(dto);
    }

    /**
     * 工程下拉选
     *
     * @param dto
     * @return AjaxResult
     * @author cwchen
     * @date 2024/7/17 15:58
     */
    @GetMapping("/getProList")
    public AjaxResult getProList(SysParamsDto dto) {
        return service.getProList(dto);
    }

    /**
     * 班组下拉选-获取所属工程
     * @param dto
     * @return AjaxResult
     * @author cwchen
     * @date 2024/8/5 17:48
     */
    @GetMapping("getTeamLists")
    public AjaxResult getTeamLists(SysParamsDto dto) {
        return service.getTeamLists(dto);
    }

    /**
     * 根据工程获取杆塔下拉选
     * @param dto
     * @return AjaxResult
     * @author cwchen
     * @date 2024/8/5 17:54
     */
    @GetMapping("/getPowerLists")
    public AjaxResult getPowerLists(SysParamsDto dto) {
        return service.getPowerLists(dto);
    }

    /**
     * 根据班组id获取班组所属人员
     * @param dto
     * @return AjaxResult
     * @author cwchen
     * @date 2024/8/7 18:24
     */
    @GetMapping("/getTeamPeople")
    public AjaxResult getTeamPeople(SysParamsDto dto) {
        return service.getTeamPeople(dto);
    }
}
