TestController.java 875 B

123456789101112131415161718192021222324252627282930
  1. package com.lqkj.cmlcp.module.test.controller;
  2. import com.lqkj.cmlcp.message.Result;
  3. import com.lqkj.cmlcp.module.test.service.CaptchaService;
  4. import org.springframework.beans.factory.annotation.Autowired;
  5. import org.springframework.web.bind.annotation.GetMapping;
  6. import org.springframework.web.bind.annotation.PostMapping;
  7. import org.springframework.web.bind.annotation.RequestMapping;
  8. import org.springframework.web.bind.annotation.RestController;
  9. @RestController
  10. @RequestMapping("/test")
  11. public class TestController {
  12. @Autowired
  13. private CaptchaService captchaService;
  14. @GetMapping("/test1")
  15. public Result test1() {
  16. var captcha = captchaService.findAll();
  17. return Result.ok(captcha);
  18. }
  19. @PostMapping("/test2")
  20. public Result test2() {
  21. var captcha = captchaService.findById();
  22. return Result.ok(captcha);
  23. }
  24. }