package com.njcn.csdevice.controller.project;


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.po.CsEngineeringPO;
import com.njcn.csdevice.service.ICsEngineeringUserService;
import com.njcn.web.controller.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 工程用户关系表 前端控制器
 * </p>
 *
 * @author xuyang
 * @since 2023-05-29
 */
@RestController
@RequestMapping("/csEngineeringUser")
@Slf4j
@Api(tags = " 项目管理")
@AllArgsConstructor
public class CsEngineeringUserController extends BaseController {

    private final ICsEngineeringUserService csEngineeringUserService;

    @OperateInfo(info = LogEnum.BUSINESS_COMMON)
    @PostMapping("/getEngineeringByUser")
    @ApiOperation("根据用户获取工程")
    public HttpResult<List<CsEngineeringPO>> getEngineeringByUser(){
        String methodDescribe = getMethodDescribe("getEngineeringByUser");
        List<CsEngineeringPO> list = csEngineeringUserService.getEngineeringByUser();
        return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
    }

}

