package com.ho.filecenter.controller;

import com.ho.common.tools.constant.ContextConstant;
import com.ho.common.tools.exception.DataResult;
import com.ho.filecenter.service.PowerDetailService;
import com.ho.filecenter.vo.DetailVo;
import com.ho.filecenter.vo.PowerDetailVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
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 javax.validation.Valid;

/**
 * @author gyan
 * @desc: 发电量和收益功能
 * @DateTime: 2023/3/16 10:46
 */
@RestController
@RequestMapping(ContextConstant.MEDIA_CONTEXT + "powerDetail")
@Api(tags = "发电量和收益功能-发电量明细")
public class PowerDetailController {
    @Autowired
    PowerDetailService powerDetailService;

    //查（主表id进行查找）
    //查（无入参）
    @PostMapping("/selectDetails")
    @ApiOperation(value = "明细列表")

    public DataResult<PowerDetailVo> selectDetails(@RequestBody @Valid DetailVo vo) {
        DataResult<PowerDetailVo> result = DataResult.success();
        PowerDetailVo powerDetail = powerDetailService.selectDetails(vo);
        result.setData(powerDetail);
        return result;
    }

}
