-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVersionController.java
More file actions
41 lines (38 loc) · 1.77 KB
/
Copy pathVersionController.java
File metadata and controls
41 lines (38 loc) · 1.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package com.itasocialacademy.oitassist.version.controller;
import com.itasocialacademy.oitassist.version.dao.dto.response.VersionResponse;
import com.itasocialacademy.oitassist.version.service.interfaces.VersionService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequiredArgsConstructor
@RequestMapping("/api/v1/version")
@Tag(name = "Version", description = "Public API for the build version of the running application")
public class VersionController {
private final VersionService versionService;
@GetMapping
@Operation(
summary = "Get application build version",
description = """
Returns the build version of the running application: the commits the backend
and the bundled frontend were built from, and the date the artifact was built.
Values that were not available at build time are returned as null.
Publicly accessible, no authentication required.
""")
@ApiResponse(
responseCode = "200",
description = "Build version retrieved successfully",
content = @Content(
mediaType = MediaType.APPLICATION_JSON_VALUE,
schema = @Schema(implementation = VersionResponse.class)))
public VersionResponse getVersion() {
return versionService.getVersion();
}
}