金币系统后端
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.

49 lines
1.7 KiB

  1. package com.example.demo.controller;
  2. import com.example.demo.domain.dou.*;
  3. import com.example.demo.domain.vo.Page;
  4. import com.example.demo.domain.vo.Result;
  5. import com.example.demo.sevice.DouService;
  6. import lombok.RequiredArgsConstructor;
  7. import lombok.extern.slf4j.Slf4j;
  8. import org.springframework.util.ObjectUtils;
  9. import org.springframework.web.bind.annotation.CrossOrigin;
  10. import org.springframework.web.bind.annotation.RequestBody;
  11. import org.springframework.web.bind.annotation.RequestMapping;
  12. import org.springframework.web.bind.annotation.RestController;
  13. @RestController
  14. @RequestMapping("/dou")
  15. @RequiredArgsConstructor
  16. @Slf4j
  17. @CrossOrigin
  18. public class DouController {
  19. private final DouService douService;
  20. @RequestMapping("/search")
  21. public Result search(@RequestBody Searchinfo jwcode){
  22. return Result.success(douService.searchinfo(jwcode));
  23. }
  24. @RequestMapping("/add")
  25. public Result add(@RequestBody Records records){
  26. return Result.success(douService.add(records));
  27. }
  28. @RequestMapping("/getYve")
  29. public Result getYve(@RequestBody Page page){
  30. if (ObjectUtils.isEmpty(page.getPageNum())) {
  31. return Result.success(douService.getYve(page.getYve()));
  32. } else {
  33. return Result.success(douService.searchForPage(page.getPageNum(), page.getPageSize(), page.getYve()));
  34. }
  35. }
  36. @RequestMapping("/getYveTotal")
  37. public Result getYveTotal(@RequestBody YveTotal yveTotal){
  38. System.out.println(douService.getYveTotal(yveTotal));
  39. return Result.success(douService.getYveTotal(yveTotal));
  40. }
  41. @RequestMapping("/getIp")
  42. public Result getIp(){
  43. return Result.success(douService.getIp());
  44. }
  45. }