Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
项目统一框架
amos-boot-biz
Commits
62eeb670
Commit
62eeb670
authored
Dec 26, 2022
by
tangwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加字段长度验证
parent
59c29c85
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
0 deletions
+36
-0
VideoServiceImpl.java
...om/yeejoin/equipmanage/service/impl/VideoServiceImpl.java
+36
-0
No files found.
amos-boot-module/amos-boot-module-biz/amos-boot-module-equip-biz/src/main/java/com/yeejoin/equipmanage/service/impl/VideoServiceImpl.java
View file @
62eeb670
package
com
.
yeejoin
.
equipmanage
.
service
.
impl
;
package
com
.
yeejoin
.
equipmanage
.
service
.
impl
;
import
com.alibaba.excel.annotation.ExcelProperty
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
...
@@ -434,6 +435,41 @@ public class VideoServiceImpl extends ServiceImpl<VideoMapper, Video> implements
...
@@ -434,6 +435,41 @@ public class VideoServiceImpl extends ServiceImpl<VideoMapper, Video> implements
if
(
ValidationUtil
.
isEmpty
(
x
.
getBizOrgName
()))
{
if
(
ValidationUtil
.
isEmpty
(
x
.
getBizOrgName
()))
{
throw
new
RuntimeException
(
"机构/部门名称不能为空,请修改后上传!"
);
throw
new
RuntimeException
(
"机构/部门名称不能为空,请修改后上传!"
);
}
}
//字段长度效验
if
(
ValidationUtil
.
isEmpty
(
x
.
getName
())&&
x
.
getName
().
length
()>
100
)
{
throw
new
RuntimeException
(
"错误行"
+
rowNum
+
":名字过长"
);
}
if
(
ValidationUtil
.
isEmpty
(
x
.
getCode
())&&
x
.
getCode
().
length
()>
100
)
{
throw
new
RuntimeException
(
"错误行"
+
rowNum
+
":编号过长"
);
}
if
(
ValidationUtil
.
isEmpty
(
x
.
getUrl
())&&
x
.
getUrl
().
length
()>
255
)
{
throw
new
RuntimeException
(
"错误行"
+
rowNum
+
":视频地址过长"
);
}
if
(
ValidationUtil
.
isEmpty
(
x
.
getToken
())&&
x
.
getToken
().
length
()>
255
)
{
throw
new
RuntimeException
(
"错误行"
+
rowNum
+
":token过长"
);
}
if
(
ValidationUtil
.
isEmpty
(
x
.
getBizOrgCode
())&&
x
.
getBizOrgCode
().
length
()>
64
)
{
throw
new
RuntimeException
(
"错误行"
+
rowNum
+
":机构编码过长"
);
}
if
(
ValidationUtil
.
isEmpty
(
x
.
getBizOrgName
())&&
x
.
getBizOrgName
().
length
()>
128
)
{
throw
new
RuntimeException
(
"错误行"
+
rowNum
+
":机构名称过长"
);
}
if
(
ValidationUtil
.
isEmpty
(
x
.
getAddress
())&&
x
.
getAddress
().
length
()>
2000
)
{
throw
new
RuntimeException
(
"错误行"
+
rowNum
+
":地址过长"
);
}
if
(
ValidationUtil
.
isEmpty
(
x
.
getRemark
())&&
x
.
getRemark
().
length
()>
255
)
{
throw
new
RuntimeException
(
"错误行"
+
rowNum
+
":备注过长"
);
}
if
(
ValidationUtil
.
isEmpty
(
x
.
getImg
())&&
x
.
getImg
().
length
()>
100
)
{
throw
new
RuntimeException
(
"错误行"
+
rowNum
+
":备注过长"
);
}
// if (!urlPattern.matcher(x.getUrl().trim()).matches()) {
// if (!urlPattern.matcher(x.getUrl().trim()).matches()) {
// throw new RuntimeException("错误行" + rowNum + ":视频地址格式有误,仅支持协议+ip+端口的格式");
// throw new RuntimeException("错误行" + rowNum + ":视频地址格式有误,仅支持协议+ip+端口的格式");
// }
// }
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment