package com.njcn.csdevice.controller.project;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.njcn.common.pojo.annotation.OperateInfo;
import com.njcn.common.pojo.enums.common.LogEnum;
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.common.utils.HttpResultUtil;
import com.njcn.csdevice.pojo.param.AppProjectAddParm;
import com.njcn.csdevice.pojo.param.AppProjectAuditParm;
import com.njcn.csdevice.pojo.param.AppProjectQueryParm;
import com.njcn.csdevice.pojo.po.AppProjectPO;
import com.njcn.csdevice.pojo.vo.AppProjectVO;
import com.njcn.csdevice.service.RoleEngineerDevService;
import com.njcn.csdevice.service.impl.RoleEngineerDevServiceImpl;
import com.njcn.web.controller.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * Description:
 * 接口文档访问地址：http://serverIP:port/swagger-ui.html
 * Date: 2023/3/27  10:54【需求编号】
 *
 * @author clam
 * @version V1.0.0
 */
@Slf4j
@RestController
@RequestMapping("/roleEngineerDev")
@Api(tags = " 角色工程设备")
@AllArgsConstructor
public class  RoleEngineerDevController extends BaseController {


    private final RoleEngineerDevService roleEngineerDevService;

    @OperateInfo(info = LogEnum.BUSINESS_COMMON)
    @PostMapping("/getRoleengineer")
    @ApiOperation("角色工程查询")
    public HttpResult<List<String>> getRoleengineer(){
        String methodDescribe = getMethodDescribe("getRoleengineer");

        List<String> roleengineer = roleEngineerDevService.getRoleengineer();
        return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, roleengineer, methodDescribe);
    }

    @OperateInfo(info = LogEnum.BUSINESS_COMMON)
    @PostMapping("/getRoleproject")
    @ApiOperation("角色项目查询")
    public HttpResult<List<String>> getRoleProject(){
        String methodDescribe = getMethodDescribe("getRoleProject");

        List<String> roleProject = roleEngineerDevService.getRoleProject();
        return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, roleProject, methodDescribe);
    }

    @OperateInfo(info = LogEnum.BUSINESS_COMMON)
    @PostMapping("/getDevice")
    @ApiOperation("角色设备查询")
    public HttpResult<List<String>> getDevice(){
        String methodDescribe = getMethodDescribe("getDevice");
        List<String> device = roleEngineerDevService.getDevice();
        return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, device, methodDescribe);
    }


}
