package com.jeeplus.finance.invoice.controller;

import com.jeeplus.finance.invoice.domain.InvoiceConfirmStatus;
import com.jeeplus.finance.invoice.service.InvoiceConfirmStatusService;
import io.swagger.annotations.ApiOperation;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping(value = "/invoiceConfirm/confirmStatus")
public class InvoiceConfirmStatusController {

    @Resource
    private InvoiceConfirmStatusService invoiceConfirmStatusService;

    /**
     * 查询当前报销数电发票的确认状态
     */
    @GetMapping("getListByUser")
    @ApiOperation(value = "列表")
    public ResponseEntity getListByUser(InvoiceConfirmStatus dto) {
        List<InvoiceConfirmStatus> listByUser = invoiceConfirmStatusService.getListByUser(dto);
        return ResponseEntity.ok(listByUser);
    }

    /**
     * 新增/修改
     */
    @PostMapping("save")
    @ApiOperation(value = "新增/修改状态")
    public ResponseEntity<String> save(@RequestBody InvoiceConfirmStatus dto) {
        String s = invoiceConfirmStatusService.save(dto);
        return ResponseEntity.ok(s);
    }



}
