package com.ningdatech.pmapi.expert.controller;


import com.ningdatech.basic.model.PageVo;
import com.ningdatech.pmapi.expert.manage.ExpertAdminManage;
import com.ningdatech.pmapi.expert.manage.ExpertManage;
import com.ningdatech.pmapi.expert.model.ExpertAdminExpertManageQuery;
import com.ningdatech.pmapi.expert.model.req.ExpertUserBasicInfoSubmitRequest;
import com.ningdatech.pmapi.expert.model.vo.ExpertAdminExpertManageListVO;
import com.ningdatech.pmapi.expert.model.vo.ExpertFullInfoVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author Liuxinxin
 * @since 2023-02-22
 */
@RestController
@Api(tags = "专家管理相关接口")
@RequestMapping("/api/v1/expert")
@RequiredArgsConstructor
public class ExpertController {

    private final ExpertManage expertManage;
    private final ExpertAdminManage expertAdminManage;

    @PostMapping("/basic-info-submit")
    @ApiOperation("填写基本信息接口(专家报名使用))")
    public void expertBasicInfoSubmit(@Valid @RequestBody ExpertUserBasicInfoSubmitRequest request) {
        expertManage.expertBasicInfoSubmit(request);
    }

    @GetMapping("/detail")
    @ApiOperation("专家获取专家详细信息")
    public ExpertFullInfoVO getExpertFullInfoDetail() {
        return expertManage.getExpertFullInfoDetail(null);
    }

    @PostMapping("/expert-library/list")
    @ApiOperation("专家库列表查询接口")
    public PageVo<ExpertAdminExpertManageListVO> getExpertLibraryList(
            @RequestBody @Valid ExpertAdminExpertManageQuery expertAdminExpertManageQuery) {
        return expertAdminManage.getExpertLibraryList(expertAdminExpertManageQuery);
    }

}
