Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
smart_gov_platform
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
赵啸非
smart_gov_platform
Commits
c592cbd0
Commit
c592cbd0
authored
Jul 18, 2023
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加材料列表根据材料名称去重
parent
f02dab53
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
138 additions
and
1 deletion
+138
-1
portal-manager/src/main/java/com/mortals/xhx/common/code/LimitStrategyEnum.java
...n/java/com/mortals/xhx/common/code/LimitStrategyEnum.java
+68
-0
portal-manager/src/main/java/com/mortals/xhx/module/product/web/ProductInterfaceController.java
...ls/xhx/module/product/web/ProductInterfaceController.java
+2
-1
smart-gateway/src/main/java/com/mortals/xhx/common/code/LimitStrategyEnum.java
...n/java/com/mortals/xhx/common/code/LimitStrategyEnum.java
+68
-0
No files found.
portal-manager/src/main/java/com/mortals/xhx/common/code/LimitStrategyEnum.java
0 → 100644
View file @
c592cbd0
package
com.mortals.xhx.common.code
;
import
java.util.LinkedHashMap
;
import
java.util.Map
;
public
enum
LimitStrategyEnum
{
不限流
(
0
,
"不限流"
),
一万次日
(
1
,
"10000次/日"
),
一千次日
(
2
,
"1000次/日"
),
一百次日
(
3
,
"100次/日"
),
一千次小时
(
4
,
"1000次/小时"
),
一百次小时
(
5
,
"100次/小时"
),
一百次分钟
(
6
,
"100次/分钟"
),
十次分钟
(
7
,
"10次/分钟"
),
一次分钟
(
8
,
"1次/分钟"
);
private
Integer
value
;
private
String
desc
;
LimitStrategyEnum
(
Integer
value
,
String
desc
)
{
this
.
value
=
value
;
this
.
desc
=
desc
;
}
public
Integer
getValue
()
{
return
this
.
value
;
}
public
String
getDesc
()
{
return
this
.
desc
;
}
public
static
LimitStrategyEnum
getByValue
(
Integer
value
)
{
for
(
LimitStrategyEnum
statusEnum
:
LimitStrategyEnum
.
values
())
{
if
(
statusEnum
.
getValue
()
==
value
)
{
return
statusEnum
;
}
}
return
null
;
}
/**
* 获取Map集合
*
* @param eItem 不包含项
* @return
*/
public
static
Map
<
String
,
String
>
getEnumMap
(
Integer
...
eItem
)
{
Map
<
String
,
String
>
resultMap
=
new
LinkedHashMap
<>();
for
(
LimitStrategyEnum
item
:
LimitStrategyEnum
.
values
())
{
try
{
boolean
hasE
=
false
;
for
(
Integer
e
:
eItem
)
{
if
(
item
.
getValue
()
==
e
)
{
hasE
=
true
;
break
;
}
}
if
(!
hasE
)
{
resultMap
.
put
(
item
.
getValue
()
+
""
,
item
.
getDesc
());
}
}
catch
(
Exception
ex
)
{
}
}
return
resultMap
;
}
}
\ No newline at end of file
portal-manager/src/main/java/com/mortals/xhx/module/product/web/ProductInterfaceController.java
View file @
c592cbd0
...
@@ -2,6 +2,7 @@ package com.mortals.xhx.module.product.web;
...
@@ -2,6 +2,7 @@ package com.mortals.xhx.module.product.web;
import
com.mortals.framework.model.Context
;
import
com.mortals.framework.model.Context
;
import
com.mortals.framework.web.BaseCRUDJsonBodyMappingController
;
import
com.mortals.framework.web.BaseCRUDJsonBodyMappingController
;
import
com.mortals.xhx.common.code.LimitStrategyEnum
;
import
com.mortals.xhx.module.param.service.ParamService
;
import
com.mortals.xhx.module.param.service.ParamService
;
import
com.mortals.xhx.module.product.model.ProductInterfaceEntity
;
import
com.mortals.xhx.module.product.model.ProductInterfaceEntity
;
import
com.mortals.xhx.module.product.service.ProductInterfaceService
;
import
com.mortals.xhx.module.product.service.ProductInterfaceService
;
...
@@ -32,7 +33,7 @@ public class ProductInterfaceController extends BaseCRUDJsonBodyMappingControlle
...
@@ -32,7 +33,7 @@ public class ProductInterfaceController extends BaseCRUDJsonBodyMappingControlle
protected
void
init
(
Map
<
String
,
Object
>
model
,
Context
context
)
{
protected
void
init
(
Map
<
String
,
Object
>
model
,
Context
context
)
{
this
.
addDict
(
model
,
"requestType"
,
paramService
.
getParamBySecondOrganize
(
"ProductInterface"
,
"requestType"
));
this
.
addDict
(
model
,
"requestType"
,
paramService
.
getParamBySecondOrganize
(
"ProductInterface"
,
"requestType"
));
this
.
addDict
(
model
,
"requestProtocol"
,
paramService
.
getParamBySecondOrganize
(
"ProductInterface"
,
"requestProtocol"
));
this
.
addDict
(
model
,
"requestProtocol"
,
paramService
.
getParamBySecondOrganize
(
"ProductInterface"
,
"requestProtocol"
));
this
.
addDict
(
model
,
"limitStrategy"
,
paramService
.
getParamBySecondOrganize
(
"ProductInterface"
,
"limitStrategy"
));
this
.
addDict
(
model
,
"limitStrategy"
,
LimitStrategyEnum
.
getEnumMap
(
));
this
.
addDict
(
model
,
"contentType"
,
paramService
.
getParamBySecondOrganize
(
"ProductInterface"
,
"contentType"
));
this
.
addDict
(
model
,
"contentType"
,
paramService
.
getParamBySecondOrganize
(
"ProductInterface"
,
"contentType"
));
this
.
addDict
(
model
,
"network"
,
paramService
.
getParamBySecondOrganize
(
"ProductInterface"
,
"network"
));
this
.
addDict
(
model
,
"network"
,
paramService
.
getParamBySecondOrganize
(
"ProductInterface"
,
"network"
));
this
.
addDict
(
model
,
"interfaceTag"
,
paramService
.
getParamBySecondOrganize
(
"ProductInterface"
,
"interfaceTag"
));
this
.
addDict
(
model
,
"interfaceTag"
,
paramService
.
getParamBySecondOrganize
(
"ProductInterface"
,
"interfaceTag"
));
...
...
smart-gateway/src/main/java/com/mortals/xhx/common/code/LimitStrategyEnum.java
0 → 100644
View file @
c592cbd0
package
com.mortals.xhx.common.code
;
import
java.util.LinkedHashMap
;
import
java.util.Map
;
public
enum
LimitStrategyEnum
{
不限流
(
0
,
"不限流"
),
一万次日
(
1
,
"10000次/日"
),
一千次日
(
2
,
"1000次/日"
),
一百次日
(
3
,
"100次/日"
),
一千次小时
(
4
,
"1000次/小时"
),
一百次小时
(
5
,
"100次/小时"
),
一百次分钟
(
6
,
"100次/分钟"
),
十次分钟
(
7
,
"10次/分钟"
),
一次分钟
(
8
,
"1次/分钟"
);
private
Integer
value
;
private
String
desc
;
LimitStrategyEnum
(
Integer
value
,
String
desc
)
{
this
.
value
=
value
;
this
.
desc
=
desc
;
}
public
Integer
getValue
()
{
return
this
.
value
;
}
public
String
getDesc
()
{
return
this
.
desc
;
}
public
static
LimitStrategyEnum
getByValue
(
Integer
value
)
{
for
(
LimitStrategyEnum
statusEnum
:
LimitStrategyEnum
.
values
())
{
if
(
statusEnum
.
getValue
()
==
value
)
{
return
statusEnum
;
}
}
return
null
;
}
/**
* 获取Map集合
*
* @param eItem 不包含项
* @return
*/
public
static
Map
<
String
,
String
>
getEnumMap
(
Integer
...
eItem
)
{
Map
<
String
,
String
>
resultMap
=
new
LinkedHashMap
<>();
for
(
LimitStrategyEnum
item
:
LimitStrategyEnum
.
values
())
{
try
{
boolean
hasE
=
false
;
for
(
Integer
e
:
eItem
)
{
if
(
item
.
getValue
()
==
e
)
{
hasE
=
true
;
break
;
}
}
if
(!
hasE
)
{
resultMap
.
put
(
item
.
getValue
()
+
""
,
item
.
getDesc
());
}
}
catch
(
Exception
ex
)
{
}
}
return
resultMap
;
}
}
\ No newline at end of file
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