| @@ -15,6 +15,7 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2; | |||||
| @MapperScan(basePackages = {"com.simple.mapper"}) | @MapperScan(basePackages = {"com.simple.mapper"}) | ||||
| @EnableSwagger2 | @EnableSwagger2 | ||||
| @EnableEncryptableProperties | @EnableEncryptableProperties | ||||
| public class UserApplication { | public class UserApplication { | ||||
| public static void main(String[] args) { | public static void main(String[] args) { | ||||
| @@ -121,6 +121,7 @@ public class ShiroConfig { | |||||
| filterChainDefinitionMap.put("/wxMallApply/add","anon"); | filterChainDefinitionMap.put("/wxMallApply/add","anon"); | ||||
| filterChainDefinitionMap.put("/wxMallApply/sendvalidationcode","anon"); | filterChainDefinitionMap.put("/wxMallApply/sendvalidationcode","anon"); | ||||
| filterChainDefinitionMap.put("/captcha.jpg", "anon"); | filterChainDefinitionMap.put("/captcha.jpg", "anon"); | ||||
| filterChainDefinitionMap.put("/version", "anon"); | |||||
| // filterChainDefinitionMap.put("/role/**", "corsFilter,token"); | // filterChainDefinitionMap.put("/role/**", "corsFilter,token"); | ||||
| filterChainDefinitionMap.put("/**", "corsFilter,token,authc"); | filterChainDefinitionMap.put("/**", "corsFilter,token,authc"); | ||||
| // filterChainDefinitionMap.put("/**", "anon"); | // filterChainDefinitionMap.put("/**", "anon"); | ||||
| @@ -21,6 +21,7 @@ import org.apache.shiro.subject.Subject; | |||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.beans.factory.annotation.Value; | |||||
| import org.springframework.util.StringUtils; | import org.springframework.util.StringUtils; | ||||
| import org.springframework.web.bind.annotation.*; | import org.springframework.web.bind.annotation.*; | ||||
| @@ -37,6 +38,8 @@ import java.io.IOException; | |||||
| public class HomeController { | public class HomeController { | ||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | private final Logger logger = LoggerFactory.getLogger(this.getClass()); | ||||
| @Value("${version}") | |||||
| private String version; | |||||
| @Autowired | @Autowired | ||||
| private Producer producer; | private Producer producer; | ||||
| @@ -125,4 +128,10 @@ public class HomeController { | |||||
| SecurityUtils.getSubject().logout(); | SecurityUtils.getSubject().logout(); | ||||
| return data; | return data; | ||||
| } | } | ||||
| @ApiOperation("获取后端版本号") | |||||
| @GetMapping("/version") | |||||
| public ResultData version() { | |||||
| return new ResultData(version); | |||||
| } | |||||
| } | } | ||||
| @@ -51,3 +51,4 @@ jasypt: | |||||
| encryptor: | encryptor: | ||||
| password: oRqdnDbK5pj3eMmB | password: oRqdnDbK5pj3eMmB | ||||
| version: @project.version@ | |||||
| @@ -14,6 +14,7 @@ import io.swagger.annotations.ApiOperation; | |||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.beans.factory.annotation.Value; | |||||
| import org.springframework.web.bind.annotation.GetMapping; | 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.ResponseBody; | import org.springframework.web.bind.annotation.ResponseBody; | ||||
| @@ -32,6 +33,9 @@ import java.util.Map; | |||||
| public class WxMallController extends BaseController { | public class WxMallController extends BaseController { | ||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | private final Logger logger = LoggerFactory.getLogger(this.getClass()); | ||||
| @Value("${version}") | |||||
| private String version; | |||||
| @Autowired | @Autowired | ||||
| private WxMallService wxMallService; | private WxMallService wxMallService; | ||||
| @@ -73,7 +77,12 @@ public class WxMallController extends BaseController { | |||||
| return new ResultData(Result.SUCCESS, "查询成功", mall); | return new ResultData(Result.SUCCESS, "查询成功", mall); | ||||
| } | } | ||||
| @AuthIgnore | |||||
| @ApiOperation("获取后端版本号") | |||||
| @GetMapping("/version") | |||||
| public ResultData version() { | |||||
| return new ResultData(version); | |||||
| } | |||||
| /** | /** | ||||
| * 微信消息服务验证 | * 微信消息服务验证 | ||||
| * @param response | * @param response | ||||
| @@ -43,4 +43,6 @@ pay: | |||||
| jasypt: | jasypt: | ||||
| encryptor: | encryptor: | ||||
| password: oRqdnDbK5pj3eMmB | |||||
| password: oRqdnDbK5pj3eMmB | |||||
| version: @project.version@ | |||||
| @@ -14,6 +14,7 @@ import io.swagger.annotations.ApiOperation; | |||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.beans.factory.annotation.Value; | |||||
| import org.springframework.web.bind.annotation.GetMapping; | 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; | ||||
| @@ -27,6 +28,9 @@ import java.util.Map; | |||||
| public class WxMallController extends BaseController { | public class WxMallController extends BaseController { | ||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | private final Logger logger = LoggerFactory.getLogger(this.getClass()); | ||||
| @Value("${version}") | |||||
| private String version; | |||||
| @Autowired | @Autowired | ||||
| private WxMallService wxMallService; | private WxMallService wxMallService; | ||||
| @@ -68,5 +72,12 @@ public class WxMallController extends BaseController { | |||||
| return new ResultData(Result.SUCCESS, "查询成功", mall); | return new ResultData(Result.SUCCESS, "查询成功", mall); | ||||
| } | } | ||||
| @AuthIgnore | |||||
| @ApiOperation("获取后端版本号") | |||||
| @GetMapping("/version") | |||||
| public ResultData version() { | |||||
| return new ResultData(version); | |||||
| } | |||||
| } | } | ||||
| @@ -43,4 +43,6 @@ pay: | |||||
| jasypt: | jasypt: | ||||
| encryptor: | encryptor: | ||||
| password: oRqdnDbK5pj3eMmB | |||||
| password: oRqdnDbK5pj3eMmB | |||||
| version: @project.version@ | |||||