package com.kym.miniapp.controller;

import com.kym.common.R;
import com.kym.entity.miniapp.params.ApplyInvoiceParams;
import com.kym.service.miniapp.InvoiceService;
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;

/**
 * <p>
 * 发票记录表 前端控制器
 * </p>
 *
 * @author skyline
 * @since 2023-09-15
 */
@RestController
@RequestMapping("/invoice")
public class InvoiceController {

    private final InvoiceService invoiceService;

    public InvoiceController(InvoiceService invoiceService) {
        this.invoiceService = invoiceService;
    }

    /**
     * 申请发票
     *
     * @param params
     * @return
     */
    @PostMapping("/applyInvoice")
    R<?> applyInvoice(@RequestBody ApplyInvoiceParams params) {
        invoiceService.applyInvoice(params);
        return R.success();
    }

}
