提交 43d037b5 编写于 作者: N nobodyiam

support appid with dot

上级 5f7f1d3b
......@@ -48,7 +48,7 @@ public class AppController {
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) {
App entity = appService.findOne(appId);
if (entity == null) {
......@@ -57,7 +57,7 @@ public class AppController {
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) {
if (!Objects.equals(appId, app.getAppId())) {
throw new BadRequestException("The App Id of path variable and request body is different");
......@@ -78,7 +78,7 @@ public class AppController {
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) {
App app = appService.findOne(appId);
if (app == null) {
......
......@@ -3,9 +3,4 @@ spring:
active: ${apollo_profile}
logging:
level:
org.springframework.cloud: 'DEBUG'
file: /opt/logs/100003171/apollo-assembly.log
......@@ -91,7 +91,7 @@ public class AppController {
}
@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) {
if (!Objects.equals(appId, appModel.getAppId())) {
throw new BadRequestException("The App Id of path variable and request body is different");
......@@ -136,7 +136,7 @@ public class AppController {
return ResponseEntity.ok().build();
}
@RequestMapping(value = "/{appId}", method = RequestMethod.GET)
@RequestMapping(value = "/{appId:.+}", method = RequestMethod.GET)
public App load(@PathVariable String appId) {
return appService.load(appId);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册