package com.yh.saas.plugin.yiliangyiyun.controller;


import com.yh.saas.plugin.yiliangyiyun.entity.StorageFeeRecordCharge;
import com.yh.saas.plugin.yiliangyiyun.service.IStorageFeeRecordChargeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;
import java.util.List;

/**
 * <p>
 * 记录代储费收费信息 前端控制器
 * </p>
 *
 * @author Gdc
 * @since 2022-01-18
 */
@RestController
@RequestMapping("/storageFeeRecordCharge")
public class StorageFeeRecordChargeController {
    @Autowired
    private IStorageFeeRecordChargeService storageFeeRecordChargeService;

    /**
     * 收费
     */
    @PostMapping("/api/addCharge")
    public String addCharge(@RequestBody @Valid StorageFeeRecordCharge storageFeeRecordCharge) {
        return storageFeeRecordChargeService.addCharge(storageFeeRecordCharge);
    }
    /**
     * 收费记录
     */
    @GetMapping("/feeRecord")
    public List<StorageFeeRecordCharge> feeRecord(@RequestParam String contractId){
        return storageFeeRecordChargeService.feeRecord(contractId);
    }
}

