RedisController.java 593 B

12345678910111213141516171819202122232425
  1. package com.sf.controller;
  2. import com.sf.service.RedisService;
  3. import org.springframework.beans.factory.annotation.Autowired;
  4. import org.springframework.web.bind.annotation.GetMapping;
  5. import org.springframework.web.bind.annotation.RestController;
  6. @RestController
  7. public class RedisController {
  8. @Autowired
  9. private RedisService redisService;
  10. @GetMapping("/seckill")
  11. public String seckill() {
  12. return "success";
  13. }
  14. // http://localhost:8080/init
  15. @GetMapping("/init")
  16. public String init() {
  17. redisService.init();
  18. return "success";
  19. }
  20. }