Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gk
Project
Project
Details
Activity
Releases
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
micro_app
gk
Commits
33d0f5d6
Commit
33d0f5d6
authored
Jul 02, 2026
by
Administrator
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
助手页面接口增加缓存
parent
d37316ac
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
155 additions
and
120 deletions
+155
-120
SecurityInterceptor.java
...dlbridge/jadp/common/interceptor/SecurityInterceptor.java
+2
-1
CmptService.java
...a/com/dlbridge/jadp/plugins/cmpt/service/CmptService.java
+108
-75
MicroApiController.java
...om/dlbridge/jadp/plugins/cmpt/web/MicroApiController.java
+37
-44
application-production.properties
src/main/resources/application-production.properties
+8
-0
No files found.
src/main/java/com/dlbridge/jadp/common/interceptor/SecurityInterceptor.java
View file @
33d0f5d6
...
@@ -128,7 +128,8 @@ public class SecurityInterceptor implements HandlerInterceptor {
...
@@ -128,7 +128,8 @@ public class SecurityInterceptor implements HandlerInterceptor {
||
uri
.
startsWith
(
"/ueditor/"
)
||
uri
.
startsWith
(
"/ueditor/"
)
||
uri
.
startsWith
(
"/static/"
)
||
uri
.
startsWith
(
"/static/"
)
||
uri
.
startsWith
(
"/api-common/"
)
||
uri
.
startsWith
(
"/api-common/"
)
||
uri
.
startsWith
(
"/api/cmpt/getCmpt/"
)
||
uri
.
startsWith
(
"/api/cmpt/"
)
||
uri
.
startsWith
(
"/api/func/"
)
||
uri
.
equals
(
"/auth"
)
||
uri
.
equals
(
"/auth_no"
);
||
uri
.
equals
(
"/auth"
)
||
uri
.
equals
(
"/auth_no"
);
}
}
...
...
src/main/java/com/dlbridge/jadp/plugins/cmpt/service/CmptService.java
View file @
33d0f5d6
This diff is collapsed.
Click to expand it.
src/main/java/com/dlbridge/jadp/plugins/cmpt/web/MicroApiController.java
View file @
33d0f5d6
...
@@ -144,7 +144,7 @@ public class MicroApiController {
...
@@ -144,7 +144,7 @@ public class MicroApiController {
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"成功"
),
@ApiResponse
(
code
=
-
1
,
message
=
"失败"
),
@ApiResponse
(
code
=
200
,
message
=
"成功"
,
response
=
Result
.
class
)})
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"成功"
),
@ApiResponse
(
code
=
-
1
,
message
=
"失败"
),
@ApiResponse
(
code
=
200
,
message
=
"成功"
,
response
=
Result
.
class
)})
@ApiOperation
(
value
=
"绑定赛事"
,
notes
=
"用户与赛事绑定功能"
,
tags
=
"赛事页面"
)
@ApiOperation
(
value
=
"绑定赛事"
,
notes
=
"用户与赛事绑定功能"
,
tags
=
"赛事页面"
)
public
Result
<
EnrollInfo
>
bind
(
@RequestParam
(
"phone"
)
String
phone
,
@RequestParam
(
"cmptId"
)
Integer
cmptId
,
@RequestParam
(
name
=
"userMapId"
,
defaultValue
=
"-1"
,
required
=
false
)
Integer
userMapId
,
HttpServletRequest
request
)
{
public
Result
<
EnrollInfo
>
bind
(
@RequestParam
(
"phone"
)
String
phone
,
@RequestParam
(
"cmptId"
)
Integer
cmptId
,
@RequestParam
(
name
=
"userMapId"
,
defaultValue
=
"-1"
,
required
=
false
)
Integer
userMapId
,
HttpServletRequest
request
)
{
int
userId
=
org
.
apache
.
commons
.
lang3
.
math
.
NumberUtils
.
toInt
(
request
.
getParameter
(
"userId"
),
-
1
);
int
userId
=
NumberUtils
.
toInt
(
request
.
getParameter
(
"userId"
),
-
1
);
if
(
userId
==
-
1
)
{
if
(
userId
==
-
1
)
{
return
Result
.
fail
()
return
Result
.
fail
()
.
setMsg
(
"入参错误"
);
.
setMsg
(
"入参错误"
);
...
@@ -431,21 +431,26 @@ public class MicroApiController {
...
@@ -431,21 +431,26 @@ public class MicroApiController {
@GetMapping
(
value
=
"/customer/{cmptId}"
)
@GetMapping
(
value
=
"/customer/{cmptId}"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"成功"
),
@ApiResponse
(
code
=
-
1
,
message
=
"失败"
,
response
=
ObjectUtils
.
Null
.
class
),
@ApiResponse
(
code
=
200
,
message
=
"成功"
,
response
=
Result
.
class
,
responseContainer
=
"List"
)})
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"成功"
),
@ApiResponse
(
code
=
-
1
,
message
=
"失败"
,
response
=
ObjectUtils
.
Null
.
class
),
@ApiResponse
(
code
=
200
,
message
=
"成功"
,
response
=
Result
.
class
,
responseContainer
=
"List"
)})
@SuppressWarnings
(
"unchecked"
)
public
Result
getCustomer
(
@PathVariable
(
"cmptId"
)
Integer
cmptId
)
{
public
Result
getCustomer
(
@PathVariable
(
"cmptId"
)
Integer
cmptId
)
{
// 新增耗时计算
Map
<
String
,
String
>
result
=
cacheTemplate
.
get
(
long
startTime
=
System
.
currentTimeMillis
();
"cmpt:customer"
,
String
.
valueOf
(
cmptId
),
Map
.
class
,
2L
,
TimeUnit
.
MINUTES
,
5L
,
TimeUnit
.
MINUTES
,
()
->
{
Customer
customer
=
customerService
.
getCusomerServiceInfo
(
cmptId
);
Customer
customer
=
customerService
.
getCusomerServiceInfo
(
cmptId
);
FuncSetting
setting
=
funcSettingService
.
getSettingByCmptId
(
cmptId
);
FuncSetting
setting
=
funcSettingService
.
getSettingByCmptId
(
cmptId
);
Map
<
String
,
String
>
result
=
new
HashMap
<>();
Map
<
String
,
String
>
map
=
new
HashMap
<>();
if
(
setting
==
null
||
setting
.
getCustomer
()
==
null
||
setting
.
getCustomer
()
!=
1
)
{
if
(
setting
==
null
||
setting
.
getCustomer
()
==
null
||
setting
.
getCustomer
()
!=
1
)
{
result
.
put
(
"mobile"
,
""
);
map
.
put
(
"mobile"
,
""
);
}
else
{
}
else
{
result
.
put
(
"mobile"
,
customer
==
null
?
""
:
customer
.
getMobile
());
map
.
put
(
"mobile"
,
customer
==
null
?
""
:
customer
.
getMobile
());
}
return
map
;
}
}
// 新增耗时计算
);
long
endTime
=
System
.
currentTimeMillis
();
long
duration
=
endTime
-
startTime
;
// log.info("获取合作信息耗时:" + duration + "毫秒");
return
Result
.
success
()
return
Result
.
success
()
.
setContent
(
result
);
.
setContent
(
result
);
}
}
...
@@ -505,36 +510,24 @@ public class MicroApiController {
...
@@ -505,36 +510,24 @@ public class MicroApiController {
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"成功"
),
@ApiResponse
(
code
=
-
1
,
message
=
"失败"
,
response
=
ObjectUtils
.
Null
.
class
),
@ApiResponse
(
code
=
200
,
message
=
"成功"
,
response
=
Result
.
class
,
responseContainer
=
"List"
)})
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"成功"
),
@ApiResponse
(
code
=
-
1
,
message
=
"失败"
,
response
=
ObjectUtils
.
Null
.
class
),
@ApiResponse
(
code
=
200
,
message
=
"成功"
,
response
=
Result
.
class
,
responseContainer
=
"List"
)})
@ApiImplicitParam
(
name
=
"enrollId"
,
value
=
"赛事用户标识"
,
required
=
false
,
paramType
=
"query"
)
@ApiImplicitParam
(
name
=
"enrollId"
,
value
=
"赛事用户标识"
,
required
=
false
,
paramType
=
"query"
)
@ApiOperation
(
value
=
"赛事功能模块列表"
,
notes
=
"赛事功能模块列表"
,
tags
=
"赛事页面"
)
@ApiOperation
(
value
=
"赛事功能模块列表"
,
notes
=
"赛事功能模块列表"
,
tags
=
"赛事页面"
)
@SuppressWarnings
(
"unchecked"
)
public
Result
<
List
<
Func
>>
func
(
@PathVariable
(
"cmptId"
)
int
cmpId
,
HttpServletRequest
request
)
{
public
Result
<
List
<
Func
>>
func
(
@PathVariable
(
"cmptId"
)
int
cmpId
,
HttpServletRequest
request
)
{
// String enrollId = request.getParameter("enrollId");
List
<
Func
>
list
=
cacheTemplate
.
get
(
List
<
Func
>
list
=
cmptSetting
.
queryFuncs
(
cmpId
);
"cmpt:func"
,
// list=list
String
.
valueOf
(
cmpId
),
// .stream()
List
.
class
,
// .filter(v -> {
2L
,
TimeUnit
.
MINUTES
,
// if (v.getNeedTime() == null || v.getNeedTime() != 1) {
5L
,
TimeUnit
.
MINUTES
,
// return true; // 不需要时间校验的直接保留
()
->
{
// }
List
<
Func
>
result
=
cmptSetting
.
queryFuncs
(
cmpId
);
// Date now = new Date();
result
.
forEach
(
v
->
{
// // 检查开始时间条件(如果有)
if
(
v
.
getOpenType
().
equals
(
0
))
{
// boolean startValid = v.getStartTime() == null || !now.before(v.getStartTime());
// // 检查结束时间条件(如果有)
// boolean endValid = v.getDeadTime() == null || now.before(v.getDeadTime());
//
// // 必须同时满足开始和结束时间条件
// return startValid && endValid;
// })
// .collect(Collectors.toList());
list
.
forEach
(
v
->
{
if
(
v
.
getOpenType
()
.
equals
(
0
))
{
v
.
setUrl
(
serverURL
+
"gk/cmpt/cmptSetting/page/"
+
v
.
getId
());
v
.
setUrl
(
serverURL
+
"gk/cmpt/cmptSetting/page/"
+
v
.
getId
());
}
}
});
});
/* if (StringUtils.isBlank(enrollId)) {
return
result
;
list = cmptSetting.queryAllFuncs(cmpId); // 查询 可对外的
}
} else { // 绑定后
);
list = cmptSetting.queryFuncs(cmpId); // 仅公开
}*/
return
Result
.
success
()
return
Result
.
success
()
.
setContent
(
list
);
.
setContent
(
list
);
}
}
...
...
src/main/resources/application-production.properties
View file @
33d0f5d6
...
@@ -3,6 +3,14 @@ spring.datasource.password=8N8F0cWb7rg88FWW
...
@@ -3,6 +3,14 @@ spring.datasource.password=8N8F0cWb7rg88FWW
spring.datasource.username
=
geexek_mysql
spring.datasource.username
=
geexek_mysql
spring.datasource.driver-class-name
=
com.mysql.jdbc.Driver
spring.datasource.driver-class-name
=
com.mysql.jdbc.Driver
spring.datasource.url
=
jdbc:mysql://rm-bp1xezgtx890ssl6r.mysql.rds.aliyuncs.com:3306/gksite?autoReconnect=true&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true
spring.datasource.url
=
jdbc:mysql://rm-bp1xezgtx890ssl6r.mysql.rds.aliyuncs.com:3306/gksite?autoReconnect=true&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true
# Druid 连接池配置
spring.datasource.druid.max-active
=
150
spring.datasource.druid.min-idle
=
10
spring.datasource.druid.max-wait
=
3000
spring.datasource.druid.validation-query
=
SELECT 1
spring.datasource.druid.test-while-idle
=
true
spring.datasource.druid.time-between-eviction-runs-millis
=
60000
spring.datasource.druid.min-evictable-idle-time-millis
=
300000
mybatis.typeAliasesPackage
=
com.dlbridge.jadp.plugins
mybatis.typeAliasesPackage
=
com.dlbridge.jadp.plugins
mybatis.mapperLocations
=
classpath:com/dlbridge/jadp/**/**.xml
mybatis.mapperLocations
=
classpath:com/dlbridge/jadp/**/**.xml
...
...
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