SystemInfoController.java

  1. package edu.ucsb.cs156.happiercows.controllers;

  2. import edu.ucsb.cs156.happiercows.models.SystemInfo;
  3. import edu.ucsb.cs156.happiercows.services.SystemInfoService;
  4. import io.swagger.v3.oas.annotations.tags.Tag;
  5. import io.swagger.v3.oas.annotations.Operation;

  6. import org.springframework.beans.factory.annotation.Autowired;
  7. import org.springframework.security.access.prepost.PreAuthorize;
  8. import org.springframework.web.bind.annotation.GetMapping;
  9. import org.springframework.web.bind.annotation.RequestMapping;
  10. import org.springframework.web.bind.annotation.RestController;

  11. @Tag(name = "System Information")
  12. @RequestMapping("/api/systemInfo")
  13. @RestController
  14. public class SystemInfoController extends ApiController {

  15.     @Autowired
  16.     private SystemInfoService systemInfoService;

  17.     @Operation(summary = "Get global information about the application")
  18.     @GetMapping("")
  19.     public SystemInfo getSystemInfo() {
  20.         return systemInfoService.getSystemInfo();
  21.     }

  22. }