Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
MCMS
Commits
244e2a00
Commit
244e2a00
authored
Jun 26, 2023
by
chenym
Browse files
浦发POC test
parent
1f20e1dc
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/net/mingsoft/cms/action/CategoryAction.java
View file @
244e2a00
...
...
@@ -23,8 +23,10 @@
package
net.mingsoft.cms.action
;
import
cn.hutool.core.util.StrUtil
;
import
com.alibaba.fastjson.JSONObject
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.hazelcast.internal.json.JsonObject
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
...
...
@@ -47,6 +49,8 @@ import org.springframework.web.bind.annotation.*;
import
springfox.documentation.annotations.ApiIgnore
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
/**
* 分类管理控制层
...
...
@@ -373,4 +377,157 @@ public class CategoryAction extends BaseAction {
return
ResultData
.
build
().
success
();
}
public
String
maptest
(
Map
<
String
,
Integer
>
map
){
Integer
value
=
map
.
get
(
"a1"
);
switch
(
value
){
case
1
:
System
.
out
.
println
(
"11111"
);
case
2
:
System
.
out
.
println
(
"22222"
);
case
3
:
System
.
out
.
println
(
"333333"
);
case
4
:
System
.
out
.
println
(
"444444"
);
default
:
System
.
out
.
println
(
"00000"
);
}
Integer
b1
=
map
.
get
(
"key"
);
if
(
b1
==
100
){
System
.
out
.
println
(
"great"
);
}
else
if
(
b1
>
80
){
System
.
out
.
println
(
"80 score"
);
}
else
if
(
b1
>=
70
){
System
.
out
.
println
(
"70 score"
);
}
else
if
(
b1
>=
60
){
System
.
out
.
println
(
"60 score"
);
}
else
{
System
.
out
.
println
(
"---------"
);
}
return
map
.
toString
();
}
public
String
jsontest
(
JSONObject
map
){
Integer
value
=
map
.
getInteger
(
"a1"
);
switch
(
value
){
case
1
:
System
.
out
.
println
(
"11111"
);
case
2
:
System
.
out
.
println
(
"22222"
);
case
3
:
System
.
out
.
println
(
"333333"
);
case
4
:
System
.
out
.
println
(
"444444"
);
default
:
System
.
out
.
println
(
"00000"
);
}
Integer
b1
=
map
.
getInteger
(
"key"
);
if
(
b1
==
100
){
System
.
out
.
println
(
"great"
);
}
else
if
(
b1
>
80
){
System
.
out
.
println
(
"80 score"
);
}
else
if
(
b1
>=
70
){
System
.
out
.
println
(
"70 score"
);
}
else
if
(
b1
>=
60
){
System
.
out
.
println
(
"60 score"
);
}
else
{
System
.
out
.
println
(
"---------"
);
}
return
map
.
toString
();
}
public
String
objecttest
(
CategoryEntity
map
){
Integer
value
=
map
.
getCategorySort
();
switch
(
value
){
case
1
:
System
.
out
.
println
(
"11111"
);
case
2
:
System
.
out
.
println
(
"22222"
);
case
3
:
System
.
out
.
println
(
"333333"
);
case
4
:
System
.
out
.
println
(
"444444"
);
default
:
System
.
out
.
println
(
"00000"
);
}
Integer
b1
=
map
.
getDictId
();
if
(
b1
==
100
){
System
.
out
.
println
(
"great"
);
}
else
if
(
b1
>
80
){
System
.
out
.
println
(
"80 score"
);
}
else
if
(
b1
>=
70
){
System
.
out
.
println
(
"70 score"
);
}
else
if
(
b1
>=
60
){
System
.
out
.
println
(
"60 score"
);
}
else
{
System
.
out
.
println
(
"---------"
);
}
return
map
.
toString
();
}
public
static
void
testFlowChart
(
String
valueOfTestLength
,
Integer
num
,
String
flowChartValue
)
{
System
.
out
.
println
(
"start"
);
if
(
valueOfTestLength
.
equals
(
"测试增加长度"
)
&&
num
==
1
&&
(
flowChartValue
.
equals
(
"12345678"
)
||
flowChartValue
.
equals
(
"aaabbbccc"
)))
{
System
.
out
.
println
(
"111"
);
}
System
.
out
.
println
(
"end"
);
}
public
static
void
testSwitch1
(
String
valueStr
,
Integer
num
)
{
System
.
out
.
println
(
"start"
);
switch
(
num
)
{
case
1
:
System
.
out
.
println
(
"switch 1"
);
case
2
:
System
.
out
.
println
(
"switch 2"
);
break
;
case
3
:
case
4
:
System
.
out
.
println
(
"switch 3"
);
switch
(
valueStr
)
{
case
"a"
:
System
.
out
.
println
(
"switch 1"
);
break
;
case
"b"
:
System
.
out
.
println
(
"switch 2"
);
break
;
}
default
:
System
.
out
.
println
(
"switch default"
);
}
System
.
out
.
println
(
"ok"
);
}
public
static
void
testTernary1
(
String
valueStr
,
Integer
num
)
{
System
.
out
.
println
(
"start"
);
int
numTest
=
num
==
1
?
10
:
20
;
System
.
out
.
println
(
"22222"
);
String
test1
=
valueStr
.
equals
(
"aaa"
)
?
valueStr
+
"---"
+
valueStr
:
valueStr
+
"==="
+
valueStr
;
System
.
out
.
println
(
"33333"
);
int
value1
=
num
>
10
?
num
>
100
?
200
:
50
:
5
;
System
.
out
.
println
(
"44444"
);
int
value2
=
num
>
10
?
50
:
num
<
5
?
4
:
6
;
System
.
out
.
println
(
"55555"
);
// int value3 = num > 10 ? num > 100 ? 200 : 50 : num < 5 ? 4 : 6;
System
.
out
.
println
(
"ok"
);
}
public
void
testsplit
(
String
currentUrl
,
Set
<
String
>
urls
){
Boolean
isTrue
=
false
;
for
(
String
url:
urls
){
if
(!
StringUtil
.
isBlank
(
url
)){
String
paths
[]
=
url
.
split
(
"/"
);
if
(
currentUrl
.
contains
(
"/"
+
paths
[
1
])){
isTrue
=
true
;
break
;
}
}
}
}
}
Write
Preview
Supports
Markdown
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