package cn.iocoder.yudao.module.system.controller.admin.biz;

import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore;
import cn.iocoder.yudao.module.system.controller.admin.biz.vo.PriceChangeDetailRespVO;
import cn.iocoder.yudao.module.system.controller.admin.biz.vo.PriceChangeRecordPageReqVO;
import cn.iocoder.yudao.module.system.controller.admin.biz.vo.PriceChangeRecordRespVO;
import cn.iocoder.yudao.module.system.controller.admin.biz.vo.PriceChangeRecordSaveReqVO;
import cn.iocoder.yudao.module.system.dal.dataobject.biz.PriceChangeRecordDO;
import cn.iocoder.yudao.module.system.service.biz.PriceChangeRecordService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;

import java.io.IOException;
import java.util.List;

import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;

/**
 * @Author: jinyd
 * @CreateTime: 2024/8/29  9:41
 * @Description:
 * @Version: 4.0
 */


@Tag(name = "管理后台 - 价格变更详情")
@RestController
@RequestMapping("/elderly/priceChangeRecord")
@Validated
public class PriceChangeRecordController {

    @Resource
    private PriceChangeRecordService priceChangeRecordService;


    @GetMapping("/getPriceDetail")
    @Operation(summary = "获得价格变更详情")
    @Parameter(name = "id", description = "编号", required = true, example = "1024")
    @PreAuthorize("@ss.hasPermission('price-change:detail')")
    @TenantIgnore
    public CommonResult<PriceChangeDetailRespVO> getPriceDetail(@RequestParam("id") Long id) {
        PriceChangeDetailRespVO priceChangeDetail = priceChangeRecordService.getPriceDetail(id);
        return success(priceChangeDetail);
    }


}
