package com.njcn.device.pms.controller.ledgerManger;


import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
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.device.pms.pojo.po.PmsMidLedger;
import com.njcn.device.pms.service.ledgerManger.IPmsMidLedgerService;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
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;
import com.njcn.web.controller.BaseController;

import java.util.List;

/**
 * <p>
 * 变电站-母线数据中间表 前端控制器
 * </p>
 *
 * @author hongawen
 * @since 2024-05-14
 */
@RestController
@RequestMapping("pms/pmsMidLedger")
@RequiredArgsConstructor
public class PmsMidLedgerController extends BaseController {

    private final IPmsMidLedgerService iPmsMidLedgerService;


    /**
     * 获取中台电站母线信息
     * @author cdf
     * @date 2024/5/14
     */
    @OperateInfo(info = LogEnum.BUSINESS_COMMON)
    @PostMapping("/getPmsMidLedgerList")
    @ApiOperation("获取中台电站母线信息")
    @ApiImplicitParam(name = "ids",value = "母线电站编号",required = true)
    public HttpResult<List<PmsMidLedger>> getPmsMidLedgerList(@RequestBody List<String> ids){
        String methodDescribe = getMethodDescribe("getPmsMidLedgerList");
        List<PmsMidLedger> result = iPmsMidLedgerService.list(new LambdaQueryWrapper<PmsMidLedger>().in(PmsMidLedger::getId,ids));
        return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
    }

}

