package cn.iocoder.yudao.module.infra.controller.admin.db;

import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.module.infra.controller.admin.db.vo.DataSourceConfigRespVO;
import cn.iocoder.yudao.module.infra.controller.admin.db.vo.DataSourceConfigSaveReqVO;
import cn.iocoder.yudao.module.infra.dal.dataobject.db.DataSourceConfigDO;
import cn.iocoder.yudao.module.infra.dal.dataobject.db.ProBasicPowerstationDO;
import cn.iocoder.yudao.module.infra.service.db.DataSourceConfigService;
import cn.iocoder.yudao.module.infra.service.db.ProBasicPowerstationService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import jakarta.validation.Valid;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import java.util.List;

import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;

@Tag(name = "管理后台 - 场站列表")
@RestController
@RequestMapping("/terminal")
@Validated
public class ProBasicPowerstationController {

    @Resource
    private ProBasicPowerstationService proBasicPowerstationService;


    @GetMapping("/getYardStationData")
    @Operation(summary = "获得场站列表")
    public CommonResult<List<ProBasicPowerstationDO>> getYardStationData() {
        List<ProBasicPowerstationDO> list = proBasicPowerstationService.getYardStationData();
        return success(BeanUtils.toBean(list, ProBasicPowerstationDO.class));
    }
}
