Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
roo-cloud
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
万敏
roo-cloud
Commits
ed10449a
Commit
ed10449a
authored
Jul 12, 2021
by
chenwj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
对Dapp实体类的Dapp名称长度做限制
parent
e603a319
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
0 deletions
+26
-0
roo-admin/roo-admin-client/src/main/java/com/roo/dto/DappsDTO.java
.../roo-admin-client/src/main/java/com/roo/dto/DappsDTO.java
+11
-0
roo-admin/roo-admin-server/src/test/java/com/roo/service/AllServiceTest.java
...-server/src/test/java/com/roo/service/AllServiceTest.java
+15
-0
No files found.
roo-admin/roo-admin-client/src/main/java/com/roo/dto/DappsDTO.java
View file @
ed10449a
package
com.roo.dto
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.roo.commons.tools.utils.DateUtils
;
import
com.roo.commons.tools.validator.group.DefaultGroup
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
javax.validation.constraints.Max
;
import
javax.validation.constraints.Min
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.Size
;
import
java.io.Serializable
;
import
java.util.Date
;
...
...
@@ -20,6 +27,7 @@ public class DappsDTO implements Serializable {
private
Long
id
;
@ApiModelProperty
(
value
=
"名称"
)
@Size
(
min
=
1
,
max
=
10
,
message
=
"dapps.name.length must be less than or equal to 10 and greater than 0"
)
private
String
name
;
@ApiModelProperty
(
value
=
"图标"
)
private
String
icon
;
...
...
@@ -32,12 +40,15 @@ public class DappsDTO implements Serializable {
@ApiModelProperty
(
value
=
"dapp所属链"
)
private
String
chain
;
@ApiModelProperty
(
value
=
"dapp介绍"
)
@Size
(
max
=
255
,
message
=
"dapps.discription.length must be less than or equal to 255"
)
private
String
discription
;
@ApiModelProperty
(
value
=
"是否显示(show、hide)"
)
private
String
display
;
@ApiModelProperty
(
value
=
"排序(排序,最小靠前)"
)
private
Integer
sort
;
@JsonFormat
(
pattern
=
DateUtils
.
DATE_TIME_PATTERN
)
@ApiModelProperty
(
value
=
"收录时间"
)
private
Date
createTime
;
}
\ No newline at end of file
roo-admin/roo-admin-server/src/test/java/com/roo/service/AllServiceTest.java
View file @
ed10449a
package
com.roo.service
;
import
com.roo.commons.tools.page.PageData
;
import
com.roo.commons.tools.validator.ValidatorUtils
;
import
com.roo.commons.tools.validator.group.AddGroup
;
import
com.roo.commons.tools.validator.group.DefaultGroup
;
import
com.roo.dto.*
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
...
...
@@ -124,4 +127,16 @@ public class AllServiceTest {
PageData
<
TokenDTO
>
page
=
tokenService
.
page
(
params
);
logger
.
info
(
"total:{}"
,
page
.
getTotal
());
}
@Test
public
void
testValidate
(){
DappsDTO
dto
=
new
DappsDTO
();
dto
.
setChain
(
"BSC"
);
dto
.
setDiscription
(
"AAA"
);
dto
.
setDisplay
(
"show"
);
dto
.
setHots
(
1
);
dto
.
setType
(
"DEX"
);
dto
.
setName
(
"qq"
);
ValidatorUtils
.
validateEntity
(
dto
,
AddGroup
.
class
,
DefaultGroup
.
class
);
}
}
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