Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf: 优化插入MySQL时脚本参数过长的报错信息,展示具体错误 #3374 #3395

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

wuyzh39
Copy link
Collaborator

@wuyzh39 wuyzh39 commented Jan 21, 2025

web/esb 快速执行脚本时,使用自定义校验器对scriptParam和scriptContent进行长度校验

@wuyzh39 wuyzh39 changed the title Issue 3374 perf: 优化插入MySQL时脚本参数过长的报错信息,展示具体错误 #3374 Jan 21, 2025
Copy link
Collaborator

@jsonwan jsonwan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

几个小问题需要处理下。


@Override
public String toString() {
return value + "(" + maximumLength + ")";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个对于用户来说依然不够友好,建议修改为 255 Bytes/ 64K Bytes / 16M Bytes / 4G Bytes 这种形式,项目中也有现成的转换工具类可用,可以多站在用户角度去思考想要得到怎样的数据。

void testCalcOriginBytesLength() {
for (int i = 0; i < 100; i++) {
String originStr = genRandomString();
assertCal(originStr);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cal -> Calc

private void assertCal(String originStr) {

String encodedStr = Base64Util.encodeContentToStr(originStr);
int calLengthByUtil = Base64Util.calcOriginBytesLength(encodedStr);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cal -> calc

Copy link
Collaborator

@jsonwan jsonwan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2个小问题需处理

@jsonwan
Copy link
Collaborator

jsonwan commented Jan 22, 2025

保存作业模板的场景也需要处理下。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants