Add version handling
This commit is contained in:
@@ -1,16 +1,22 @@
|
||||
// package com.rossa.api.controllers;
|
||||
package com.rossa.api.controllers;
|
||||
|
||||
// import org.springframework.stereotype.Controller;
|
||||
// import org.springframework.web.bind.annotation.RequestMapping;
|
||||
// import org.springframework.web.bind.annotation.RequestMethod;
|
||||
// import org.springframework.web.servlet.ModelAndView;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
|
||||
// @Controller
|
||||
// public class AppContoller {
|
||||
// @RequestMapping(value = "/public/index", method = RequestMethod.GET)
|
||||
// public ModelAndView index() {
|
||||
// ModelAndView retVal = new ModelAndView();
|
||||
// retVal.setViewName("indexPage");
|
||||
// return retVal;
|
||||
// }
|
||||
// }
|
||||
@RestController
|
||||
@PreAuthorize("isAuthenticated()")
|
||||
public class AppContoller {
|
||||
|
||||
@Value("${rossatech.api.version}")
|
||||
private String apiVersion;
|
||||
|
||||
@RequestMapping(value = "/version", method = RequestMethod.GET, produces = MediaType.TEXT_PLAIN_VALUE)
|
||||
public String getApiVersion() {
|
||||
return apiVersion;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -18,4 +18,7 @@ spring.jackson.serialization.fail-on-empty-beans=false
|
||||
|
||||
# spring.security.user.name=pezi
|
||||
# spring.security.user.password=Password123!
|
||||
security.basic.enabled=false
|
||||
security.basic.enabled=false
|
||||
|
||||
#api version
|
||||
rossatech.api.version=0.2
|
||||
Reference in New Issue
Block a user