Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jz-dmp-service
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
姚本章
jz-dmp-service
Commits
98c3bbb0
Commit
98c3bbb0
authored
Jan 22, 2021
by
mcb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
no message
parent
060cb2ef
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
73 additions
and
13 deletions
+73
-13
DmpApiServiceMangeController.java
.../controller/dataService/DmpApiServiceMangeController.java
+22
-2
DmpApiServiceMangeService.java
...com/jz/dmp/modules/service/DmpApiServiceMangeService.java
+11
-2
DmpApiServiceMangeServiceImpl.java
...p/modules/service/impl/DmpApiServiceMangeServiceImpl.java
+34
-0
application-test.yml
src/main/resources/application-test.yml
+6
-9
No files found.
src/main/java/com/jz/dmp/modules/controller/dataService/DmpApiServiceMangeController.java
View file @
98c3bbb0
...
@@ -150,12 +150,12 @@ public class DmpApiServiceMangeController {
...
@@ -150,12 +150,12 @@ public class DmpApiServiceMangeController {
}
}
/**
/**
* API计量--API列表
* API计量--API
调用
列表
*
*
* @author Bellamy
* @author Bellamy
* @since 2021-01-19
* @since 2021-01-19
*/
*/
@ApiOperation
(
value
=
"API计量--API
列表"
,
notes
=
"API计量--API
列表"
)
@ApiOperation
(
value
=
"API计量--API
调用列表"
,
notes
=
"API计量--API调用
列表"
)
@PostMapping
(
value
=
"/apiCountListPage"
)
@PostMapping
(
value
=
"/apiCountListPage"
)
public
JsonResult
apiCountListPage
(
@RequestBody
@Validated
ApiInterfaceInfoListReq
req
,
HttpServletRequest
httpRequest
)
{
public
JsonResult
apiCountListPage
(
@RequestBody
@Validated
ApiInterfaceInfoListReq
req
,
HttpServletRequest
httpRequest
)
{
JsonResult
jsonResult
=
new
JsonResult
();
JsonResult
jsonResult
=
new
JsonResult
();
...
@@ -169,6 +169,26 @@ public class DmpApiServiceMangeController {
...
@@ -169,6 +169,26 @@ public class DmpApiServiceMangeController {
return
jsonResult
;
return
jsonResult
;
}
}
/**
* API计量--API未调用列表
*
* @author Bellamy
* @since 2021-01-22
*/
@ApiOperation
(
value
=
"API计量--API未调用列表"
,
notes
=
"API计量--API未调用列表"
)
@PostMapping
(
value
=
"/notCalledList"
)
public
JsonResult
apiNotCalledListPage
(
@RequestBody
@Validated
ApiInterfaceInfoListReq
req
,
HttpServletRequest
httpRequest
)
{
JsonResult
jsonResult
=
new
JsonResult
();
try
{
jsonResult
=
dmpApiServiceMangeService
.
queryApiNotCalledListPage
(
req
);
}
catch
(
Exception
e
)
{
jsonResult
.
setMessage
(
e
.
getMessage
());
jsonResult
.
setCode
(
ResultCode
.
INTERNAL_SERVER_ERROR
);
e
.
printStackTrace
();
}
return
jsonResult
;
}
/**
/**
* 获取数据源库——下拉框
* 获取数据源库——下拉框
*
*
...
...
src/main/java/com/jz/dmp/modules/service/DmpApiServiceMangeService.java
View file @
98c3bbb0
package
com
.
jz
.
dmp
.
modules
.
service
;
package
com
.
jz
.
dmp
.
modules
.
service
;
import
com.jz.common.constant.JsonResult
;
import
com.jz.common.constant.JsonResult
;
import
com.jz.dmp.modules.controller.dataService.bean.ApiInterfaceInfoListReq
;
import
com.jz.dmp.modules.controller.dataService.bean.ApiInterfaceReq
;
import
com.jz.dmp.modules.controller.dataService.bean.ApiInterfaceReq
;
import
com.jz.dmp.modules.controller.dataService.bean.MakeBigDataApiReq
;
import
com.jz.dmp.modules.controller.dataService.bean.MakeBigDataApiReq
;
import
com.jz.dmp.modules.model.DvRuleT
;
import
com.jz.dmp.modules.model.DvRuleT
;
...
@@ -61,7 +62,7 @@ public interface DmpApiServiceMangeService {
...
@@ -61,7 +62,7 @@ public interface DmpApiServiceMangeService {
* @return
* @return
* @author Bellamy
* @author Bellamy
*/
*/
JsonResult
querygSourceDbList
(
Integer
projectId
,
String
dbName
)
throws
Exception
;
JsonResult
querygSourceDbList
(
Integer
projectId
,
String
dbName
)
throws
Exception
;
/**
/**
* 配置数据源——下拉框
* 配置数据源——下拉框
...
@@ -70,5 +71,13 @@ public interface DmpApiServiceMangeService {
...
@@ -70,5 +71,13 @@ public interface DmpApiServiceMangeService {
* @author Bellamy
* @author Bellamy
* @since 2021-01-21
* @since 2021-01-21
*/
*/
JsonResult
getSourceSetting
()
throws
Exception
;
JsonResult
getSourceSetting
()
throws
Exception
;
/**
* API计量--API未调用列表
*
* @author Bellamy
* @since 2021-01-22
*/
JsonResult
queryApiNotCalledListPage
(
ApiInterfaceInfoListReq
req
)
throws
Exception
;
}
}
\ No newline at end of file
src/main/java/com/jz/dmp/modules/service/impl/DmpApiServiceMangeServiceImpl.java
View file @
98c3bbb0
...
@@ -7,6 +7,7 @@ import com.jz.common.utils.DateUtils;
...
@@ -7,6 +7,7 @@ import com.jz.common.utils.DateUtils;
import
com.jz.common.utils.web.HttpClientUtils
;
import
com.jz.common.utils.web.HttpClientUtils
;
import
com.jz.common.utils.web.SessionUtils
;
import
com.jz.common.utils.web.SessionUtils
;
import
com.jz.dmp.modules.controller.DataIntegration.bean.SourceDbNameListDto
;
import
com.jz.dmp.modules.controller.DataIntegration.bean.SourceDbNameListDto
;
import
com.jz.dmp.modules.controller.dataService.bean.ApiInterfaceInfoListReq
;
import
com.jz.dmp.modules.controller.dataService.bean.ApiInterfaceReq
;
import
com.jz.dmp.modules.controller.dataService.bean.ApiInterfaceReq
;
import
com.jz.dmp.modules.controller.dataService.bean.MakeBigDataApiReq
;
import
com.jz.dmp.modules.controller.dataService.bean.MakeBigDataApiReq
;
import
com.jz.dmp.modules.dao.DvRuleTDao
;
import
com.jz.dmp.modules.dao.DvRuleTDao
;
...
@@ -48,6 +49,9 @@ public class DmpApiServiceMangeServiceImpl implements DmpApiServiceMangeService
...
@@ -48,6 +49,9 @@ public class DmpApiServiceMangeServiceImpl implements DmpApiServiceMangeService
//API计量调用次数和执行时长url
//API计量调用次数和执行时长url
private
static
final
String
countAPiCallStat
=
"/api/logging/countAPiCallStat"
;
private
static
final
String
countAPiCallStat
=
"/api/logging/countAPiCallStat"
;
//API计量--API未调用列表url
private
static
final
String
notCalledList
=
"/api/interface/listUnCallApiInterface"
;
@Value
(
"${spring.gateway-url}"
)
@Value
(
"${spring.gateway-url}"
)
private
String
gatewayUrl
;
private
String
gatewayUrl
;
...
@@ -264,4 +268,34 @@ public class DmpApiServiceMangeServiceImpl implements DmpApiServiceMangeService
...
@@ -264,4 +268,34 @@ public class DmpApiServiceMangeServiceImpl implements DmpApiServiceMangeService
List
<
String
>
list
=
Arrays
.
asList
(
arr
);
List
<
String
>
list
=
Arrays
.
asList
(
arr
);
return
JsonResult
.
ok
(
list
);
return
JsonResult
.
ok
(
list
);
}
}
/**
* API计量--API未调用列表
*
* @author Bellamy
* @since 2021-01-22
*/
@Override
public
JsonResult
queryApiNotCalledListPage
(
ApiInterfaceInfoListReq
req
)
throws
Exception
{
JsonResult
result
=
new
JsonResult
();
String
url
=
gatewayUrl
+
notCalledList
;
String
resultData
=
HttpClientUtils
.
post
(
url
,
JSONObject
.
toJSONString
(
req
));
if
(
StringUtils
.
isEmpty
(
resultData
))
{
throw
new
RuntimeException
(
"查询失败!"
);
}
logger
.
info
(
"#################响应结果数据{}"
+
resultData
);
Map
jsonObject
=
JSONObject
.
parseObject
(
resultData
);
if
(
jsonObject
.
containsKey
(
"code"
))
{
if
(
"200"
.
equals
(
jsonObject
.
get
(
"code"
).
toString
()))
{
return
JsonResult
.
ok
(
jsonObject
.
get
(
"data"
));
}
}
if
(
jsonObject
.
containsKey
(
"message"
))
{
logger
.
info
(
jsonObject
.
get
(
"message"
).
toString
());
result
.
setMessage
(
jsonObject
.
get
(
"message"
).
toString
());
result
.
setCode
(
ResultCode
.
INTERNAL_SERVER_ERROR
);
}
return
result
;
}
}
}
\ No newline at end of file
src/main/resources/application-test.yml
View file @
98c3bbb0
# 测试环境配置
# 测试环境配置
server
:
server
:
port
:
718
1
port
:
718
2
#contextPath: /resource
#contextPath: /resource
management
:
management
:
port
:
5400
1
port
:
5400
2
health
:
health
:
mail
:
mail
:
enabled
:
false
enabled
:
false
...
@@ -36,6 +36,10 @@ spring:
...
@@ -36,6 +36,10 @@ spring:
caffeine
:
caffeine
:
spec
:
maximumSize=1000,expireAfterWrite=30s
spec
:
maximumSize=1000,expireAfterWrite=30s
public-key
:
rajZdV0xpCox+2vEHFLsKq2o2XVdMaQq
public-key
:
rajZdV0xpCox+2vEHFLsKq2o2XVdMaQq
#gatewayIP
gateway-url
:
http://localhost:8088
#API配置--大数据查询,数据源支持类型条件
api-bigData-setting
:
Hive,MySQL,Oracle
redis
:
redis
:
#database: 0
#database: 0
#host: 119.23.13.83
#host: 119.23.13.83
...
@@ -93,13 +97,6 @@ dmp:
...
@@ -93,13 +97,6 @@ dmp:
open
:
false
open
:
false
name
:
name
:
#mybatis的配置
#mybatis:
# #配置mapper.xml文件所在路径
# mapper-locations: classpath:mapper.*/*.xml
# #配置映射类所在的包名
# type-aliases-package: com.jz.dmp.modules.model
#日志打印
#日志打印
logging
:
logging
:
level
:
level
:
...
...
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