package cn.wisenergy.web.admin.controller.app;

import cn.wisenergy.common.utils.exception.Result;
import cn.wisenergy.model.dto.ManagerProjectsDto;
import cn.wisenergy.model.vo.GetManagerProjectsVo;
import cn.wisenergy.service.WorkProjectService;
import cn.wisenergy.web.admin.controller.common.BaseController;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @description:
 * @author: nh
 * @create: 2021-01-20 16:47
 **/
@RestController
@Api(tags = "项目模块")
@RequestMapping(value = "/work/project")
@Slf4j
public class WorkProjectController  extends BaseController {

    @Autowired
    private WorkProjectService workProjectService;

    @ApiOperation(value = "项目/商机基础信息", notes = "项目/商机基础信息", httpMethod = "POST")
    @ApiImplicitParam(name = "gmpv",value = "获取管理的项目/商机",dataType = "GetManagerProjectsVo")
    @PostMapping(value = "/getProject")
    public Result<PageInfo> getProject(@RequestBody GetManagerProjectsVo gmpv) {
        log.info("WorkProjectController[]getProject[]input.param.GetManagerProjectsVo:{}" + gmpv);
        PageInfo<ManagerProjectsDto> managerProjeets = workProjectService.getManagerProjects(gmpv);
        return getResult(managerProjeets);
    }



}
