package com.ruoyi.hezhi.api.kaoshi;

import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.hezhi.service.*;
import com.ruoyi.system.service.ISysDictDataService;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

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

/**
 * @Author: LCL
 * @Date: 2024/10/08
 * @Description:通用API
 */
@Api("List")
@RestController
@RequestMapping("/api/list")
public class ApiListController {

    @Resource
    private ITbBannerService bannerService;
    @Resource
    private ITbNewsService newsService;
    @Resource
    private ITbTrendsService tbTrendsService;
    @Resource
    private ITbCaseTypeService caseTypeService;
    @Resource
    private ITbCaseService caseService;
    @Resource
    private ITbNoticeService noticeService;
    @Resource
    private ITbTeacherService teacherService;
    @Resource
    private ISysDictDataService dictDataService;
    @Resource
    private ITbCareerClassService tbCareerClassService;
    @Resource
    private ITbExamNoticeService examNoticeService;
    @Resource
    private ITbCooperatePartnerService cooperatePartnerService;
    @Resource
    private ITbAuthorizeHonorService authorizeHonorService;
    @Resource
    private ITbMajorClassService majorClassService;
    @Resource
    private ITbRegionService regionService;
    @Resource
    private ITbLiveBroadcastService liveBroadcastService;
    @Resource
    private ITbConfigService configService;
    @Resource
    private ITbStudyCenterService studyCenterService;
    @Resource
    private ITbEvaluateAgencyService evaluateAgencyService;
    @Resource
    private ITbContinuingEducationClassService continuingEducationClassService;
    @Resource
    private ITbConferenceNoticeService conferenceNoticeService;
    @Resource
    private ITbConferencePeopleService conferencePeopleService;
    @Resource
    private ITbConferenceRegistrationService conferenceRegistrationService;
    @Resource
    private ITbExamService examService;
    @Resource
    private ITbMemberJoinService memberJoinService;


    /**
     * 评价机构列表
     *
     * @param params   searchValue 搜索词
     *                 evaluateAgencyClassId 评价机构分类ID（0或不传查全部）
     * @return success
     */
    @GetMapping("/getEvaluateAgencyList")
    public AjaxResult getEvaluateAgencyList(@RequestParam Map<String, Object> params) {
        try {
            return AjaxResult.success().put("data", evaluateAgencyService.getEvaluateAgencyList(params));
        } catch (Exception e) {
            e.printStackTrace();
            return AjaxResult.error("评价机构列表异常");
        }
    }

    /**
     * 职业分类列表
     *
     * @param params careerId 1-职业技能，2-职业教育
     * @return success
     */
    @GetMapping("/getCareerClassMapList")
    public AjaxResult getCareerClassMapList(@RequestParam Map<String, Object> params) {
        try {
            params.put("careerId", 1);
            params.put("level", 2);
            return AjaxResult.success().put("data", tbCareerClassService.selectTbCareerClassMapList(params));
        } catch (Exception e) {
            e.printStackTrace();
            return AjaxResult.error("职业分类列表异常");
        }
    }

    /**
     * 学习中心列表
     *
     * @param params   searchValue 搜索词
     *                 studyCenterClassId 学习中心分类ID（0或不传查全部）
     * @return success
     */
    @GetMapping("/getStudyCenterList")
    public AjaxResult getStudyCenterList(@RequestParam Map<String, Object> params) {
        try {
            return AjaxResult.success().put("data", studyCenterService.getStudyCenterList(params));
        } catch (Exception e) {
            e.printStackTrace();
            return AjaxResult.error("学习中心列表异常");
        }
    }


}
