Commit 7b41718c by 张乐 Committed by GitHub

Merge pull request #669 from nobodyiam/appid-with-dot

support appid with dot
parents 5f7f1d3b 43d037b5
...@@ -48,7 +48,7 @@ public class AppController { ...@@ -48,7 +48,7 @@ public class AppController {
return dto; return dto;
} }
@RequestMapping(value = "/apps/{appId}", method = RequestMethod.DELETE) @RequestMapping(value = "/apps/{appId:.+}", method = RequestMethod.DELETE)
public void delete(@PathVariable("appId") String appId, @RequestParam String operator) { public void delete(@PathVariable("appId") String appId, @RequestParam String operator) {
App entity = appService.findOne(appId); App entity = appService.findOne(appId);
if (entity == null) { if (entity == null) {
...@@ -57,7 +57,7 @@ public class AppController { ...@@ -57,7 +57,7 @@ public class AppController {
appService.delete(entity.getId(), operator); appService.delete(entity.getId(), operator);
} }
@RequestMapping(value = "/apps/{appId}", method = RequestMethod.PUT) @RequestMapping(value = "/apps/{appId:.+}", method = RequestMethod.PUT)
public void update(@PathVariable String appId, @RequestBody App app) { public void update(@PathVariable String appId, @RequestBody App app) {
if (!Objects.equals(appId, app.getAppId())) { if (!Objects.equals(appId, app.getAppId())) {
throw new BadRequestException("The App Id of path variable and request body is different"); throw new BadRequestException("The App Id of path variable and request body is different");
...@@ -78,7 +78,7 @@ public class AppController { ...@@ -78,7 +78,7 @@ public class AppController {
return BeanUtils.batchTransform(AppDTO.class, app); return BeanUtils.batchTransform(AppDTO.class, app);
} }
@RequestMapping(value = "/apps/{appId}", method = RequestMethod.GET) @RequestMapping(value = "/apps/{appId:.+}", method = RequestMethod.GET)
public AppDTO get(@PathVariable("appId") String appId) { public AppDTO get(@PathVariable("appId") String appId) {
App app = appService.findOne(appId); App app = appService.findOne(appId);
if (app == null) { if (app == null) {
......
...@@ -3,9 +3,4 @@ spring: ...@@ -3,9 +3,4 @@ spring:
active: ${apollo_profile} active: ${apollo_profile}
logging: logging:
level:
org.springframework.cloud: 'DEBUG'
file: /opt/logs/100003171/apollo-assembly.log file: /opt/logs/100003171/apollo-assembly.log
...@@ -91,7 +91,7 @@ public class AppController { ...@@ -91,7 +91,7 @@ public class AppController {
} }
@PreAuthorize(value = "@permissionValidator.isAppAdmin(#appId)") @PreAuthorize(value = "@permissionValidator.isAppAdmin(#appId)")
@RequestMapping(value = "/{appId}", method = RequestMethod.PUT) @RequestMapping(value = "/{appId:.+}", method = RequestMethod.PUT)
public void update(@PathVariable String appId, @RequestBody AppModel appModel) { public void update(@PathVariable String appId, @RequestBody AppModel appModel) {
if (!Objects.equals(appId, appModel.getAppId())) { if (!Objects.equals(appId, appModel.getAppId())) {
throw new BadRequestException("The App Id of path variable and request body is different"); throw new BadRequestException("The App Id of path variable and request body is different");
...@@ -136,7 +136,7 @@ public class AppController { ...@@ -136,7 +136,7 @@ public class AppController {
return ResponseEntity.ok().build(); return ResponseEntity.ok().build();
} }
@RequestMapping(value = "/{appId}", method = RequestMethod.GET) @RequestMapping(value = "/{appId:.+}", method = RequestMethod.GET)
public App load(@PathVariable String appId) { public App load(@PathVariable String appId) {
return appService.load(appId); return appService.load(appId);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment