From 122df73639ffce2aa7b06baf9b941257c54640d7 Mon Sep 17 00:00:00 2001 From: chengasd <735712836@qq.com> Date: Fri, 2 Jul 2021 11:40:38 +0800 Subject: [PATCH 1/4] feature: modify item comment valid size(#3799) --- .../apollo/openapi/v1/controller/ItemController.java | 8 ++++---- apollo-portal/src/main/resources/static/i18n/en.json | 2 +- apollo-portal/src/main/resources/static/i18n/zh-CN.json | 2 +- apollo-portal/src/main/resources/static/scripts/valdr.js | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/apollo-portal/src/main/java/com/ctrip/framework/apollo/openapi/v1/controller/ItemController.java b/apollo-portal/src/main/java/com/ctrip/framework/apollo/openapi/v1/controller/ItemController.java index 7962b297c5c..bb63932cb04 100644 --- a/apollo-portal/src/main/java/com/ctrip/framework/apollo/openapi/v1/controller/ItemController.java +++ b/apollo-portal/src/main/java/com/ctrip/framework/apollo/openapi/v1/controller/ItemController.java @@ -76,8 +76,8 @@ public OpenItemDTO createItem(@PathVariable String appId, @PathVariable String e throw new BadRequestException("User " + item.getDataChangeCreatedBy() + " doesn't exist!"); } - if(!StringUtils.isEmpty(item.getComment()) && item.getComment().length() > 64){ - throw new BadRequestException("Comment length should not exceed 64 characters"); + if(!StringUtils.isEmpty(item.getComment()) && item.getComment().length() > 1024){ + throw new BadRequestException("Comment length should not exceed 1024 characters"); } ItemDTO toCreate = OpenApiBeanUtils.transformToItemDTO(item); @@ -113,8 +113,8 @@ public void updateItem(@PathVariable String appId, @PathVariable String env, throw new BadRequestException("user(dataChangeLastModifiedBy) not exists"); } - if(!StringUtils.isEmpty(item.getComment()) && item.getComment().length() > 64){ - throw new BadRequestException("Comment length should not exceed 64 characters"); + if(!StringUtils.isEmpty(item.getComment()) && item.getComment().length() > 1024){ + throw new BadRequestException("Comment length should not exceed 1024 characters"); } try { diff --git a/apollo-portal/src/main/resources/static/i18n/en.json b/apollo-portal/src/main/resources/static/i18n/en.json index fa04ea39e45..1ca211f582b 100644 --- a/apollo-portal/src/main/resources/static/i18n/en.json +++ b/apollo-portal/src/main/resources/static/i18n/en.json @@ -724,7 +724,7 @@ "Valdr.AppNamespace.Comment.Size": "Comment length should not exceed 64 characters", "Valdr.Item.Key.Size": "Key cannot be longer than 128 characters", "Valdr.Item.Key.Required": "Key can't be empty", - "Valdr.Item.Comment.Size": "Comment length should not exceed 64 characters", + "Valdr.Item.Comment.Size": "Comment length should not exceed 1024 characters", "Valdr.Release.ReleaseName.Size": "Release Name cannot be longer than 64 characters", "Valdr.Release.ReleaseName.Required": "Release Name cannot be empty", "Valdr.Release.Comment.Size": "Comment length should not exceed 64 characters", diff --git a/apollo-portal/src/main/resources/static/i18n/zh-CN.json b/apollo-portal/src/main/resources/static/i18n/zh-CN.json index f2f6036bf65..09a6284e183 100644 --- a/apollo-portal/src/main/resources/static/i18n/zh-CN.json +++ b/apollo-portal/src/main/resources/static/i18n/zh-CN.json @@ -724,7 +724,7 @@ "Valdr.AppNamespace.Comment.Size": "备注长度不能多于64个字符", "Valdr.Item.Key.Size": "Key长度不能多于128个字符", "Valdr.Item.Key.Required": "Key不能为空", - "Valdr.Item.Comment.Size": "备注长度不能多于64个字符", + "Valdr.Item.Comment.Size": "备注长度不能多于1024个字符", "Valdr.Release.ReleaseName.Size": "Release Name长度不能多于64个字符", "Valdr.Release.ReleaseName.Required": "Release Name不能为空", "Valdr.Release.Comment.Size": "备注长度不能多于64个字符", diff --git a/apollo-portal/src/main/resources/static/scripts/valdr.js b/apollo-portal/src/main/resources/static/scripts/valdr.js index 1c9d3358e0b..531f0753b87 100644 --- a/apollo-portal/src/main/resources/static/scripts/valdr.js +++ b/apollo-portal/src/main/resources/static/scripts/valdr.js @@ -94,7 +94,7 @@ application_module.config(function (valdrProvider) { }, 'comment': { 'size': { - 'max': 64, + 'max': 1024, 'message': 'Valdr.Item.Comment.Size' } } From 7b53c8710fa8c0fe1378849c52418b4083a6456c Mon Sep 17 00:00:00 2001 From: chengasd <735712836@qq.com> Date: Fri, 2 Jul 2021 15:07:06 +0800 Subject: [PATCH 2/4] feature: modify item comment valid size(#3799) --- CHANGES.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES.md b/CHANGES.md index c8a875b9ebe..b2887b6e9a8 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -52,6 +52,7 @@ Apollo 1.9.0 * [feat(open-api): get authorized apps](https://github.com/ctripcorp/apollo/pull/3647) * [feature: shared session for multi apollo portal](https://github.com/ctripcorp/apollo/pull/3786) * [feature: add email for select user on apollo portal](https://github.com/ctripcorp/apollo/pull/3797) +* [feature: modify item comment valid size](https://github.com/ctripcorp/apollo/pull/3803) ------------------ All issues and pull requests are [here](https://github.com/ctripcorp/apollo/milestone/6?closed=1) From 1857f24b24944fd6f586c85cdaf409b4b81f2add Mon Sep 17 00:00:00 2001 From: chengasd <735712836@qq.com> Date: Sat, 3 Jul 2021 18:18:29 +0800 Subject: [PATCH 3/4] feature: modify item comment valid size(#3799) --- .../apollo/openapi/v1/controller/ItemController.java | 8 ++++---- apollo-portal/src/main/resources/static/i18n/en.json | 2 +- apollo-portal/src/main/resources/static/i18n/zh-CN.json | 2 +- apollo-portal/src/main/resources/static/scripts/valdr.js | 2 +- docs/zh/usage/apollo-open-api-platform.md | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/apollo-portal/src/main/java/com/ctrip/framework/apollo/openapi/v1/controller/ItemController.java b/apollo-portal/src/main/java/com/ctrip/framework/apollo/openapi/v1/controller/ItemController.java index bb63932cb04..b2ead890db4 100644 --- a/apollo-portal/src/main/java/com/ctrip/framework/apollo/openapi/v1/controller/ItemController.java +++ b/apollo-portal/src/main/java/com/ctrip/framework/apollo/openapi/v1/controller/ItemController.java @@ -76,8 +76,8 @@ public OpenItemDTO createItem(@PathVariable String appId, @PathVariable String e throw new BadRequestException("User " + item.getDataChangeCreatedBy() + " doesn't exist!"); } - if(!StringUtils.isEmpty(item.getComment()) && item.getComment().length() > 1024){ - throw new BadRequestException("Comment length should not exceed 1024 characters"); + if(!StringUtils.isEmpty(item.getComment()) && item.getComment().length() > 256){ + throw new BadRequestException("Comment length should not exceed 256 characters"); } ItemDTO toCreate = OpenApiBeanUtils.transformToItemDTO(item); @@ -113,8 +113,8 @@ public void updateItem(@PathVariable String appId, @PathVariable String env, throw new BadRequestException("user(dataChangeLastModifiedBy) not exists"); } - if(!StringUtils.isEmpty(item.getComment()) && item.getComment().length() > 1024){ - throw new BadRequestException("Comment length should not exceed 1024 characters"); + if(!StringUtils.isEmpty(item.getComment()) && item.getComment().length() > 256){ + throw new BadRequestException("Comment length should not exceed 256 characters"); } try { diff --git a/apollo-portal/src/main/resources/static/i18n/en.json b/apollo-portal/src/main/resources/static/i18n/en.json index 1ca211f582b..36be14c398b 100644 --- a/apollo-portal/src/main/resources/static/i18n/en.json +++ b/apollo-portal/src/main/resources/static/i18n/en.json @@ -724,7 +724,7 @@ "Valdr.AppNamespace.Comment.Size": "Comment length should not exceed 64 characters", "Valdr.Item.Key.Size": "Key cannot be longer than 128 characters", "Valdr.Item.Key.Required": "Key can't be empty", - "Valdr.Item.Comment.Size": "Comment length should not exceed 1024 characters", + "Valdr.Item.Comment.Size": "Comment length should not exceed 256 characters", "Valdr.Release.ReleaseName.Size": "Release Name cannot be longer than 64 characters", "Valdr.Release.ReleaseName.Required": "Release Name cannot be empty", "Valdr.Release.Comment.Size": "Comment length should not exceed 64 characters", diff --git a/apollo-portal/src/main/resources/static/i18n/zh-CN.json b/apollo-portal/src/main/resources/static/i18n/zh-CN.json index 09a6284e183..e9097cd8501 100644 --- a/apollo-portal/src/main/resources/static/i18n/zh-CN.json +++ b/apollo-portal/src/main/resources/static/i18n/zh-CN.json @@ -724,7 +724,7 @@ "Valdr.AppNamespace.Comment.Size": "备注长度不能多于64个字符", "Valdr.Item.Key.Size": "Key长度不能多于128个字符", "Valdr.Item.Key.Required": "Key不能为空", - "Valdr.Item.Comment.Size": "备注长度不能多于1024个字符", + "Valdr.Item.Comment.Size": "备注长度不能多于256个字符", "Valdr.Release.ReleaseName.Size": "Release Name长度不能多于64个字符", "Valdr.Release.ReleaseName.Required": "Release Name不能为空", "Valdr.Release.Comment.Size": "备注长度不能多于64个字符", diff --git a/apollo-portal/src/main/resources/static/scripts/valdr.js b/apollo-portal/src/main/resources/static/scripts/valdr.js index 531f0753b87..d2ebe32a2ae 100644 --- a/apollo-portal/src/main/resources/static/scripts/valdr.js +++ b/apollo-portal/src/main/resources/static/scripts/valdr.js @@ -94,7 +94,7 @@ application_module.config(function (valdrProvider) { }, 'comment': { 'size': { - 'max': 1024, + 'max': 256, 'message': 'Valdr.Item.Comment.Size' } } diff --git a/docs/zh/usage/apollo-open-api-platform.md b/docs/zh/usage/apollo-open-api-platform.md index 8e1165efe88..14733554c8f 100644 --- a/docs/zh/usage/apollo-open-api-platform.md +++ b/docs/zh/usage/apollo-open-api-platform.md @@ -379,7 +379,7 @@ Apollo在生产环境(PRO)有限制规则:每次发布只能有一个人 ---- | --- | --- | --- key | true | String | 配置的key,长度不能超过128个字符。非properties格式,key固定为`content` value | true | String | 配置的value,长度不能超过20000个字符,非properties格式,value为文件全部内容 -comment | false | String | 配置的备注,长度不能超过1024个字符 +comment | false | String | 配置的备注,长度不能超过256个字符 dataChangeCreatedBy | true | String | item的创建人,格式为域账号,也就是sso系统的User ID * **Request body sample** : @@ -424,7 +424,7 @@ createIfNotExists | false | Boolean | 当配置不存在时是否自动创建 ---- | --- | --- | --- key | true | String | 配置的key,需和url中的key值一致。非properties格式,key固定为`content` value | true | String | 配置的value,长度不能超过20000个字符,非properties格式,value为文件全部内容 -comment | false | String | 配置的备注,长度不能超过1024个字符 +comment | false | String | 配置的备注,长度不能超过256个字符 dataChangeLastModifiedBy | true | String | item的修改人,格式为域账号,也就是sso系统的User ID dataChangeCreatedBy | false | String | 当createIfNotExists为true时必选。item的创建人,格式为域账号,也就是sso系统的User ID From 03c59fb1496061f9c321d019d9d54b6d9ef94f9c Mon Sep 17 00:00:00 2001 From: chengasd <735712836@qq.com> Date: Sat, 3 Jul 2021 18:38:52 +0800 Subject: [PATCH 4/4] feature: modify item comment valid size(#3799) --- apollo-portal/src/main/resources/static/i18n/en.json | 2 +- apollo-portal/src/main/resources/static/i18n/zh-CN.json | 2 +- apollo-portal/src/main/resources/static/scripts/valdr.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apollo-portal/src/main/resources/static/i18n/en.json b/apollo-portal/src/main/resources/static/i18n/en.json index 36be14c398b..ed77dd1b5a6 100644 --- a/apollo-portal/src/main/resources/static/i18n/en.json +++ b/apollo-portal/src/main/resources/static/i18n/en.json @@ -727,7 +727,7 @@ "Valdr.Item.Comment.Size": "Comment length should not exceed 256 characters", "Valdr.Release.ReleaseName.Size": "Release Name cannot be longer than 64 characters", "Valdr.Release.ReleaseName.Required": "Release Name cannot be empty", - "Valdr.Release.Comment.Size": "Comment length should not exceed 64 characters", + "Valdr.Release.Comment.Size": "Comment length should not exceed 256 characters", "ApolloConfirmDialog.DefaultConfirmBtnName": "OK", "ApolloConfirmDialog.SearchPlaceHolder": "Search items (App Id, App Name)", "RulesModal.ChooseInstances": "Select from the list of instances", diff --git a/apollo-portal/src/main/resources/static/i18n/zh-CN.json b/apollo-portal/src/main/resources/static/i18n/zh-CN.json index e9097cd8501..cde65526268 100644 --- a/apollo-portal/src/main/resources/static/i18n/zh-CN.json +++ b/apollo-portal/src/main/resources/static/i18n/zh-CN.json @@ -727,7 +727,7 @@ "Valdr.Item.Comment.Size": "备注长度不能多于256个字符", "Valdr.Release.ReleaseName.Size": "Release Name长度不能多于64个字符", "Valdr.Release.ReleaseName.Required": "Release Name不能为空", - "Valdr.Release.Comment.Size": "备注长度不能多于64个字符", + "Valdr.Release.Comment.Size": "备注长度不能多于256个字符", "ApolloConfirmDialog.DefaultConfirmBtnName": "确认", "ApolloConfirmDialog.SearchPlaceHolder": "搜索项目(AppId、项目名)", "RulesModal.ChooseInstances": "从实例列表中选择", diff --git a/apollo-portal/src/main/resources/static/scripts/valdr.js b/apollo-portal/src/main/resources/static/scripts/valdr.js index d2ebe32a2ae..0540ebbdf38 100644 --- a/apollo-portal/src/main/resources/static/scripts/valdr.js +++ b/apollo-portal/src/main/resources/static/scripts/valdr.js @@ -111,7 +111,7 @@ application_module.config(function (valdrProvider) { }, 'comment': { 'size': { - 'max': 64, + 'max': 256, 'message': 'Valdr.Release.Comment.Size' } }