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
278ee1cd
Commit
278ee1cd
authored
Dec 22, 2025
by
suhuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(jyjc):调试接口
1.增加调试接口生产时禁用功能
parent
f2a802e7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
7 deletions
+29
-7
InspectAppMockServiceImpl.java
...dule/jyjc/biz/service/impl/InspectAppMockServiceImpl.java
+29
-7
No files found.
amos-boot-system-tzs/amos-boot-module-jyjc/amos-boot-module-jyjc-biz/src/main/java/com/yeejoin/amos/boot/module/jyjc/biz/service/impl/InspectAppMockServiceImpl.java
View file @
278ee1cd
...
@@ -23,20 +23,19 @@ import com.yeejoin.amos.boot.module.ymt.api.enums.FlowStatusEnum;
...
@@ -23,20 +23,19 @@ import com.yeejoin.amos.boot.module.ymt.api.enums.FlowStatusEnum;
import
com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgProjectContraptionMapper
;
import
com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgProjectContraptionMapper
;
import
com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgUseInfoMapper
;
import
com.yeejoin.amos.boot.module.ymt.api.mapper.IdxBizJgUseInfoMapper
;
import
lombok.RequiredArgsConstructor
;
import
lombok.RequiredArgsConstructor
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.foundation.context.RequestContext
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
import
org.typroject.tyboot.core.foundation.utils.Bean
;
import
java.util.ArrayList
;
import
java.util.*
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
@Service
@Service
@RequiredArgsConstructor
@RequiredArgsConstructor
@Slf4j
public
class
InspectAppMockServiceImpl
{
public
class
InspectAppMockServiceImpl
{
private
final
SnowflakeIdUtil
sequence
;
private
final
SnowflakeIdUtil
sequence
;
...
@@ -47,8 +46,7 @@ public class InspectAppMockServiceImpl {
...
@@ -47,8 +46,7 @@ public class InspectAppMockServiceImpl {
private
final
JyjcInspectionResultServiceImpl
inspectionResultService
;
private
final
JyjcInspectionResultServiceImpl
inspectionResultService
;
@Autowired
private
final
JyjcInspectionResultParamServiceImpl
jyjcInspectionResultParamServiceImpl
;
private
JyjcInspectionResultParamServiceImpl
jyjcInspectionResultParamServiceImpl
;
private
final
JyjcInspectionApplicationServiceImpl
jyjcInspectionApplicationService
;
private
final
JyjcInspectionApplicationServiceImpl
jyjcInspectionApplicationService
;
...
@@ -56,9 +54,33 @@ public class InspectAppMockServiceImpl {
...
@@ -56,9 +54,33 @@ public class InspectAppMockServiceImpl {
private
final
IdxBizJgProjectContraptionMapper
idxBizJgProjectContraptionMapper
;
private
final
IdxBizJgProjectContraptionMapper
idxBizJgProjectContraptionMapper
;
/**
* 当前环境
*/
@Value
(
"${spring.profiles.active:dev}"
)
private
String
currentEnv
;
/**
* 禁止调试的环境,多个逗号分割开
*/
@Value
(
"${disabled.test.api.env:prod,cluster}"
)
private
String
disabledEnvs
;
private
List
<
String
>
getDisabledEnvList
()
{
return
Arrays
.
stream
(
disabledEnvs
.
split
(
","
))
.
map
(
String:
:
trim
)
// 去除空格
.
filter
(
env
->
!
env
.
isEmpty
())
.
collect
(
Collectors
.
toList
());
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
Boolean
testAppAndPassApp
(
InspectMockAppData
appData
)
{
public
Boolean
testAppAndPassApp
(
InspectMockAppData
appData
)
{
// 生产环境时禁止调试,生产环境可以调试
if
(
getDisabledEnvList
().
contains
(
currentEnv
))
{
log
.
warn
(
"非法调试尝试! 环境: {}, 调用参数: {}"
,
currentEnv
,
appData
);
return
false
;
}
if
(
appData
.
getSize
()
>
10
)
{
if
(
appData
.
getSize
()
>
10
)
{
appData
.
setSize
(
1
);
appData
.
setSize
(
1
);
}
}
...
...
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