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


import com.baomidou.mybatisplus.plugins.Page;
import com.yh.saas.plugin.yiliangyiyun.entity.ShortFillingInfo;
import com.yh.saas.plugin.yiliangyiyun.service.IShortFillingInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 记录短途加油信息 前端控制器
 * </p>
 *
 * @author Gdc
 * @since 2022-07-07
 */
@RestController
@RequestMapping("/shortFillingInfo")
public class ShortFillingInfoController {
    @Autowired
    private IShortFillingInfoService shortFillingInfoService;
    /**
     * 添加短途加油信息
     *
     * @param shortFillingInfo
     * @return
     */
    @PostMapping("/api/addShortFilling")
    public String addFilling(@RequestBody ShortFillingInfo shortFillingInfo) {
        return shortFillingInfoService.addShortFilling(shortFillingInfo);
    }
    /**
     * 短途记录查询
     *
     * @param shortFillingInfo
     * @return
     */
    @GetMapping("/selectShortFilling")
    public Page<ShortFillingInfo> selectShortFilling(ShortFillingInfo shortFillingInfo) {
        return shortFillingInfoService.selectShortFilling(shortFillingInfo);
    }
    /**
     * 查看短途加油信息
     *
     * @param id
     * @return
     */
    @GetMapping("/getShortFilling")
    public ShortFillingInfo getShortFilling(@RequestParam String id) {
        return shortFillingInfoService.getShortFilling(id);
    }
    /**
     * 短途请款
     * @param shortFillingInfo
     * @return
     */
    @PostMapping("/api/shortRequestFunds")
    public String shortRequestFunds(@RequestBody ShortFillingInfo shortFillingInfo){
        return shortFillingInfoService.shortRequestFunds(shortFillingInfo);
    }
}

