ReceiptController.java 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. package com.dk.oauth.controller;
  2. import com.dk.common.response.ResponseResultVO;
  3. import com.dk.oauth.entity.Trade;
  4. import com.dk.oauth.model.pojo.Receipt;
  5. import com.dk.oauth.service.IReceiptService;
  6. import io.swagger.annotations.ApiOperation;
  7. import org.springframework.web.bind.annotation.*;
  8. import org.springframework.beans.factory.annotation.Autowired;
  9. import io.swagger.annotations.Api;
  10. @Api(tags = "发票管理API接口")
  11. @RestController
  12. @RequestMapping("/receipt")
  13. public class ReceiptController{
  14. @Autowired
  15. private IReceiptService receiptService;
  16. /**
  17. * @desc : 新建发票
  18. * @author : 王英杰
  19. * @date : 2024/2/1 14:55
  20. */
  21. @ApiOperation(value = "新建发票", notes = "新建发票")
  22. @PostMapping(value = "/insert")
  23. public ResponseResultVO<?> insertReceip(@RequestBody Receipt receipt) {
  24. return receiptService.insertReceip(receipt);
  25. }
  26. /**
  27. * @desc : 通过交易记录 查询 对应的发票数据
  28. * @author : 王英杰
  29. * @date : 2023/1/9 10:41
  30. */
  31. @PostMapping({"/select_by_tradeid/{tradeId}"})
  32. public ResponseResultVO selectByTradeId(@PathVariable String tradeId) {
  33. return receiptService.selectByTradeId(tradeId);
  34. }
  35. }