AuthClientController.java 840 B

12345678910111213141516171819202122232425
  1. package com.yaozhitech.spring5.controller;
  2. import org.springframework.http.ResponseEntity;
  3. import org.springframework.web.bind.annotation.GetMapping;
  4. import org.springframework.web.bind.annotation.RequestMapping;
  5. import org.springframework.web.bind.annotation.RequestParam;
  6. import org.springframework.web.bind.annotation.RestController;
  7. import com.yaozhitech.spring5.service.ClientAuthService;
  8. import lombok.AllArgsConstructor;
  9. @RestController
  10. @RequestMapping("/clientAuth")
  11. @AllArgsConstructor
  12. public class AuthClientController {
  13. private final ClientAuthService authClientService;
  14. @GetMapping("/verify")
  15. public ResponseEntity<Boolean> verify(@RequestParam String service, @RequestParam String allowClient, @RequestParam String secret) {
  16. return ResponseEntity.ok(authClientService.isAllowed(service, allowClient, secret));
  17. }
  18. }