package com.njcn.csdevice.controller.equipment;

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.CsEquipmentTransferAddParm;
import com.njcn.csdevice.service.CsEquipmentTransferPOService;
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;


/**
* (cs_equipment_transfer)表控制层
*
* @author xxxxx
*/
@Slf4j
@RestController
@RequestMapping("/EquipmentTransfer")
@Api(tags = " 设备转移、恢复")
@AllArgsConstructor
@Deprecated
public class CsEquipmentTransferPOController extends BaseController {

    private final CsEquipmentTransferPOService csEquipmentTransferPOService;
    @OperateInfo(info = LogEnum.BUSINESS_COMMON)
    @PostMapping("/addEquipmentTransfer")
    @ApiOperation("新增设备转移申请")
    @ApiImplicitParam(name = "csEquipmentTransferAddParm", value = "新增项目参数", required = true)
    public HttpResult<Boolean> add(@RequestBody @Validated CsEquipmentTransferAddParm csEquipmentTransferAddParm){
        String methodDescribe = getMethodDescribe("add");

        Boolean flag = csEquipmentTransferPOService.add (csEquipmentTransferAddParm);
        return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, flag, methodDescribe);
    }
    @OperateInfo(info = LogEnum.BUSINESS_COMMON)
    @PostMapping("/passEquipmentTransfer")
    @ApiOperation("设备转移申请通过")
    @ApiImplicitParam(name = "ids", value = "设备转移申请id", required = true)
    public HttpResult<Boolean> pass(@RequestParam("ids") List<String> ids){
        String methodDescribe = getMethodDescribe("pass");

        Boolean flag = csEquipmentTransferPOService.pass (ids);
        return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, flag, methodDescribe);
    }

}
