You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
1.0 KiB

  1. package com.example.demo.controller.cash;
  2. import com.example.demo.domain.vo.cash.CashCollection;
  3. import com.example.demo.domain.vo.coin.Result;
  4. import com.example.demo.service.cash.CashCollectionService;
  5. import lombok.RequiredArgsConstructor;
  6. import lombok.extern.slf4j.Slf4j;
  7. import org.springframework.beans.factory.annotation.Autowired;
  8. import org.springframework.web.bind.annotation.*;
  9. /**
  10. * @program: gold-java
  11. * @ClassName CashCollectionController
  12. * @description:
  13. * @author: Ethan
  14. * @create: 202509-26 10:22
  15. * @Version 1.0
  16. **/
  17. @RestController
  18. @RequestMapping("/cashCollection")
  19. @RequiredArgsConstructor
  20. @Slf4j
  21. @CrossOrigin
  22. public class CashCollectionController {
  23. @Autowired
  24. private CashCollectionService cashCollectionService;
  25. @PostMapping("/add")
  26. public Result add(@RequestBody CashCollection cashCollection) {
  27. try {
  28. return cashCollectionService.add(cashCollection);
  29. } catch (Exception e) {
  30. return Result.error("请检查数据的格式");
  31. }
  32. }
  33. }