test health check

This commit is contained in:
heyethereum
2024-06-30 13:08:26 +08:00
parent 268748a07d
commit 1afbcbe410

View File

@@ -8,15 +8,17 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.Map;
@RestController @RestController
@RequestMapping("/v1") @RequestMapping("/v1")
public class UserController { public class UserController {
@Autowired @Autowired
UserService userService; UserService userService;
@GetMapping(value = "/version", produces = MediaType.APPLICATION_JSON_VALUE) @GetMapping(value = "/version", produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<String> version() { public ResponseEntity<Map<String, String>> version() {
System.out.println(userService.getUserByEmail()); //System.out.println(userService.getUserByEmail());
return ResponseEntity.ok("SafeQR v1.0.2"); return ResponseEntity.ok(Map.of("version","SafeQR v1.0.2"));
} }
} }