Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
datax-cloud
Overview
Overview
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
黄营
datax-cloud
Commits
b07012f4
Commit
b07012f4
authored
Jul 28, 2020
by
yuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
项目初始化
parent
592d0294
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
105 additions
and
24 deletions
+105
-24
StartedUpRunner.java
...rvice/data/market/api/mapping/config/StartedUpRunner.java
+18
-0
RequestHandler.java
...rvice/data/market/api/mapping/handler/RequestHandler.java
+4
-1
RequestInterceptor.java
...e/data/market/api/mapping/handler/RequestInterceptor.java
+35
-17
ApiMappingEngine.java
...ata/market/api/mapping/service/impl/ApiMappingEngine.java
+2
-3
DataApiServiceFeign.java
...ax/service/data/market/api/feign/DataApiServiceFeign.java
+5
-0
DataApiServiceFeignFallbackImpl.java
...t/api/feign/fallback/DataApiServiceFeignFallbackImpl.java
+8
-0
StartedUpRunner.java
.../cn/datax/service/data/market/config/StartedUpRunner.java
+1
-0
InnerController.java
...datax/service/data/market/controller/InnerController.java
+14
-0
DataApiServiceImpl.java
.../service/data/market/service/impl/DataApiServiceImpl.java
+8
-0
DataThemeList.vue
datax-ui/src/views/factory/datatheme/DataThemeList.vue
+10
-3
No files found.
datax-modules/data-market-service-parent/data-market-service-api-mapping/src/main/java/cn/datax/service/data/market/api/mapping/config/StartedUpRunner.java
View file @
b07012f4
package
cn
.
datax
.
service
.
data
.
market
.
api
.
mapping
.
config
;
package
cn
.
datax
.
service
.
data
.
market
.
api
.
mapping
.
config
;
import
cn.datax.service.data.market.api.entity.DataApiEntity
;
import
cn.datax.service.data.market.api.feign.DataApiServiceFeign
;
import
cn.datax.service.data.market.api.mapping.handler.MappingHandlerMapping
;
import
cn.hutool.core.collection.CollUtil
;
import
lombok.RequiredArgsConstructor
;
import
lombok.RequiredArgsConstructor
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.ApplicationArguments
;
import
org.springframework.boot.ApplicationArguments
;
import
org.springframework.boot.ApplicationRunner
;
import
org.springframework.boot.ApplicationRunner
;
import
org.springframework.context.ConfigurableApplicationContext
;
import
org.springframework.context.ConfigurableApplicationContext
;
...
@@ -9,6 +14,7 @@ import org.springframework.stereotype.Component;
...
@@ -9,6 +14,7 @@ import org.springframework.stereotype.Component;
import
java.time.LocalDateTime
;
import
java.time.LocalDateTime
;
import
java.time.format.DateTimeFormatter
;
import
java.time.format.DateTimeFormatter
;
import
java.util.List
;
@Component
@Component
@RequiredArgsConstructor
@RequiredArgsConstructor
...
@@ -17,6 +23,12 @@ public class StartedUpRunner implements ApplicationRunner {
...
@@ -17,6 +23,12 @@ public class StartedUpRunner implements ApplicationRunner {
private
final
ConfigurableApplicationContext
context
;
private
final
ConfigurableApplicationContext
context
;
private
final
Environment
environment
;
private
final
Environment
environment
;
@Autowired
private
DataApiServiceFeign
dataApiServiceFeign
;
@Autowired
private
MappingHandlerMapping
mappingHandlerMapping
;
@Override
@Override
public
void
run
(
ApplicationArguments
args
)
{
public
void
run
(
ApplicationArguments
args
)
{
if
(
context
.
isActive
())
{
if
(
context
.
isActive
())
{
...
@@ -26,6 +38,12 @@ public class StartedUpRunner implements ApplicationRunner {
...
@@ -26,6 +38,12 @@ public class StartedUpRunner implements ApplicationRunner {
"端口号:"
+
environment
.
getProperty
(
"server.port"
)
+
"\n"
+
"端口号:"
+
environment
.
getProperty
(
"server.port"
)
+
"\n"
+
"-----------------------------------------"
;
"-----------------------------------------"
;
System
.
out
.
println
(
banner
);
System
.
out
.
println
(
banner
);
// 项目启动时,初始化已发布的接口
List
<
DataApiEntity
>
releaseDataApiList
=
dataApiServiceFeign
.
getReleaseDataApiList
();
if
(
CollUtil
.
isNotEmpty
(
releaseDataApiList
))
{
releaseDataApiList
.
stream
().
forEach
(
api
->
mappingHandlerMapping
.
registerMapping
(
api
));
}
}
}
}
}
}
}
datax-modules/data-market-service-parent/data-market-service-api-mapping/src/main/java/cn/datax/service/data/market/api/mapping/handler/RequestHandler.java
View file @
b07012f4
...
@@ -91,7 +91,10 @@ public class RequestHandler {
...
@@ -91,7 +91,10 @@ public class RequestHandler {
return
R
.
error
(
e
.
getMessage
());
return
R
.
error
(
e
.
getMessage
());
}
finally
{
}
finally
{
ApiLogDto
apiLogDto
=
ThreadUtil
.
getInstance
().
get
();
ApiLogDto
apiLogDto
=
ThreadUtil
.
getInstance
().
get
();
apiLogService
.
saveApiLog
(
apiLogDto
);
log
.
info
(
"ApiLogDto信息={}"
,
apiLogDto
);
if
(
apiLogDto
!=
null
)
{
apiLogService
.
saveApiLog
(
apiLogDto
);
}
ThreadUtil
.
getInstance
().
remove
();
ThreadUtil
.
getInstance
().
remove
();
}
}
}
}
...
...
datax-modules/data-market-service-parent/data-market-service-api-mapping/src/main/java/cn/datax/service/data/market/api/mapping/handler/RequestInterceptor.java
View file @
b07012f4
...
@@ -45,15 +45,31 @@ public class RequestInterceptor {
...
@@ -45,15 +45,31 @@ public class RequestInterceptor {
log
.
info
(
"getRequestURI的值:"
+
uri
);
log
.
info
(
"getRequestURI的值:"
+
uri
);
String
ipAddr
=
IPUtil
.
getIpAddr
(
request
);
String
ipAddr
=
IPUtil
.
getIpAddr
(
request
);
log
.
info
(
"ipAddr的值:"
+
ipAddr
);
log
.
info
(
"ipAddr的值:"
+
ipAddr
);
// 记录日志
ApiLogDto
log
=
new
ApiLogDto
();
log
.
setCallerIp
(
ipAddr
);
log
.
setCallerUrl
(
uri
);
log
.
setCallerParams
(
new
ObjectMapper
().
writeValueAsString
(
params
));
log
.
setCallerDate
(
LocalDateTime
.
now
());
log
.
setStatus
(
DataConstant
.
EnableState
.
ENABLE
.
getKey
());
ThreadUtil
.
getInstance
().
set
(
log
);
// 密钥校验
// 密钥校验
String
apiKey
=
request
.
getHeader
(
"api_key"
);
String
apiKey
=
request
.
getHeader
(
"api_key"
);
String
secretKey
=
request
.
getHeader
(
"secret_key"
);
String
secretKey
=
request
.
getHeader
(
"secret_key"
);
if
(
StrUtil
.
isBlank
(
apiKey
)
||
StrUtil
.
isBlank
(
secretKey
))
{
if
(
StrUtil
.
isBlank
(
apiKey
)
||
StrUtil
.
isBlank
(
secretKey
))
{
ThreadUtil
.
getInstance
().
get
().
setStatus
(
DataConstant
.
EnableState
.
DISABLE
.
getKey
());
ThreadUtil
.
getInstance
().
get
().
setMsg
(
"api_key或secret_key空"
);
return
R
.
error
(
"api_key或secret_key空"
);
return
R
.
error
(
"api_key或secret_key空"
);
}
}
MD5Util
mt
=
MD5Util
.
getInstance
();
MD5Util
mt
=
MD5Util
.
getInstance
();
String
apiId
=
mt
.
decode
(
apiKey
);
String
apiId
=
mt
.
decode
(
apiKey
);
String
userId
=
mt
.
decode
(
secretKey
);
String
userId
=
mt
.
decode
(
secretKey
);
ThreadUtil
.
getInstance
().
get
().
setApiId
(
apiId
);
ThreadUtil
.
getInstance
().
get
().
setCallerId
(
userId
);
// 黑名单校验
// 黑名单校验
String
deny
=
api
.
getDeny
();
String
deny
=
api
.
getDeny
();
if
(
StrUtil
.
isNotBlank
(
deny
))
{
if
(
StrUtil
.
isNotBlank
(
deny
))
{
...
@@ -61,6 +77,8 @@ public class RequestInterceptor {
...
@@ -61,6 +77,8 @@ public class RequestInterceptor {
if
(
CollUtil
.
isNotEmpty
(
denyList
))
{
if
(
CollUtil
.
isNotEmpty
(
denyList
))
{
for
(
String
ip
:
denyList
)
{
for
(
String
ip
:
denyList
)
{
if
(
ip
.
equals
(
ipAddr
)){
if
(
ip
.
equals
(
ipAddr
)){
ThreadUtil
.
getInstance
().
get
().
setStatus
(
DataConstant
.
EnableState
.
DISABLE
.
getKey
());
ThreadUtil
.
getInstance
().
get
().
setMsg
(
"此IP已被加入API调用黑名单"
);
return
R
.
error
(
"此IP已被加入API调用黑名单"
);
return
R
.
error
(
"此IP已被加入API调用黑名单"
);
}
}
}
}
...
@@ -68,15 +86,24 @@ public class RequestInterceptor {
...
@@ -68,15 +86,24 @@ public class RequestInterceptor {
}
}
// 参数校验
// 参数校验
if
(
MapUtil
.
isNotEmpty
(
params
))
{
if
(
MapUtil
.
isNotEmpty
(
params
))
{
api
.
getReqParams
().
stream
().
forEach
(
param
->
{
try
{
if
(
params
.
containsKey
(
param
.
getParamName
()))
{
api
.
getReqParams
().
stream
().
forEach
(
param
->
{
// 参数类型是否正确
if
(
params
.
containsKey
(
param
.
getParamName
()))
{
ParamType
.
parse
(
ParamType
.
getParamType
(
param
.
getParamType
()),
params
.
get
(
param
.
getParamName
()));
// 参数类型是否正确
}
ParamType
.
parse
(
ParamType
.
getParamType
(
param
.
getParamType
()),
params
.
get
(
param
.
getParamName
()));
});
}
});
}
catch
(
Exception
e
)
{
ThreadUtil
.
getInstance
().
get
().
setStatus
(
DataConstant
.
EnableState
.
DISABLE
.
getKey
());
ThreadUtil
.
getInstance
().
get
().
setMsg
(
e
.
getMessage
());
return
R
.
error
(
e
.
getMessage
());
}
}
}
// 限流校验
// 限流校验
String
apiName
=
api
.
getApiName
();
String
apiName
=
api
.
getApiName
();
ThreadUtil
.
getInstance
().
get
().
setApiName
(
apiName
);
String
rateLimit
=
api
.
getRateLimit
();
String
rateLimit
=
api
.
getRateLimit
();
rateLimit
=
Optional
.
ofNullable
(
rateLimit
).
orElse
(
DataConstant
.
TrueOrFalse
.
TRUE
.
getKey
());
rateLimit
=
Optional
.
ofNullable
(
rateLimit
).
orElse
(
DataConstant
.
TrueOrFalse
.
TRUE
.
getKey
());
if
(
DataConstant
.
TrueOrFalse
.
TRUE
.
getKey
().
equals
(
rateLimit
))
{
if
(
DataConstant
.
TrueOrFalse
.
TRUE
.
getKey
().
equals
(
rateLimit
))
{
...
@@ -97,20 +124,11 @@ public class RequestInterceptor {
...
@@ -97,20 +124,11 @@ public class RequestInterceptor {
redisTemplate
.
opsForValue
().
set
(
key
,
maxTimes
+
1
,
seconds
,
TimeUnit
.
SECONDS
);
redisTemplate
.
opsForValue
().
set
(
key
,
maxTimes
+
1
,
seconds
,
TimeUnit
.
SECONDS
);
}
else
{
}
else
{
// 请求过于频繁
// 请求过于频繁
ThreadUtil
.
getInstance
().
get
().
setStatus
(
DataConstant
.
EnableState
.
DISABLE
.
getKey
());
ThreadUtil
.
getInstance
().
get
().
setMsg
(
"API调用过于频繁"
);
return
R
.
error
(
"API调用过于频繁"
);
return
R
.
error
(
"API调用过于频繁"
);
}
}
}
}
// 记录日志
ApiLogDto
log
=
new
ApiLogDto
();
log
.
setApiId
(
apiId
);
log
.
setApiName
(
apiName
);
log
.
setCallerId
(
userId
);
log
.
setCallerIp
(
ipAddr
);
log
.
setCallerUrl
(
uri
);
log
.
setCallerParams
(
new
ObjectMapper
().
writeValueAsString
(
params
));
log
.
setCallerDate
(
LocalDateTime
.
now
());
log
.
setStatus
(
DataConstant
.
EnableState
.
ENABLE
.
getKey
());
ThreadUtil
.
getInstance
().
set
(
log
);
return
null
;
return
null
;
}
}
...
...
datax-modules/data-market-service-parent/data-market-service-api-mapping/src/main/java/cn/datax/service/data/market/api/mapping/service/impl/ApiMappingEngine.java
View file @
b07012f4
...
@@ -25,7 +25,6 @@ import org.springframework.stereotype.Service;
...
@@ -25,7 +25,6 @@ import org.springframework.stereotype.Service;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.Optional
;
@Slf4j
@Slf4j
@Service
@Service
...
@@ -50,8 +49,8 @@ public class ApiMappingEngine {
...
@@ -50,8 +49,8 @@ public class ApiMappingEngine {
dbSchema
.
getUsername
(),
dbSchema
.
getPassword
(),
dbSchema
.
getPort
(),
dbSchema
.
getDbName
(),
dbSchema
.
getSid
());
dbSchema
.
getUsername
(),
dbSchema
.
getPassword
(),
dbSchema
.
getPort
(),
dbSchema
.
getDbName
(),
dbSchema
.
getSid
());
DbQuery
dbQuery
=
dataSourceFactory
.
createDbQuery
(
dbQueryProperty
);
DbQuery
dbQuery
=
dataSourceFactory
.
createDbQuery
(
dbQueryProperty
);
// 参数
// 参数
Integer
pageNum
=
Optional
.
ofNullable
(
params
).
map
(
map
->
Integer
.
parseInt
(
String
.
valueOf
(
map
.
get
(
"pageNum"
)))).
orElse
(
1
);
Integer
pageNum
=
(
Integer
)
params
.
getOrDefault
(
"pageNum"
,
1
);
Integer
pageSize
=
Optional
.
ofNullable
(
params
).
map
(
map
->
Integer
.
parseInt
(
String
.
valueOf
(
map
.
get
(
"pageSize"
)))).
orElse
(
20
);
Integer
pageSize
=
(
Integer
)
params
.
getOrDefault
(
"pageSize"
,
20
);
PageUtil
pageUtil
=
new
PageUtil
(
pageNum
,
pageSize
);
PageUtil
pageUtil
=
new
PageUtil
(
pageNum
,
pageSize
);
Integer
offset
=
pageUtil
.
getOffset
();
Integer
offset
=
pageUtil
.
getOffset
();
SqlBuilderUtil
.
SqlFilterResult
sqlFilterResult
;
SqlBuilderUtil
.
SqlFilterResult
sqlFilterResult
;
...
...
datax-modules/data-market-service-parent/data-market-service-api/src/main/java/cn/datax/service/data/market/api/feign/DataApiServiceFeign.java
View file @
b07012f4
...
@@ -6,9 +6,14 @@ import org.springframework.cloud.openfeign.FeignClient;
...
@@ -6,9 +6,14 @@ import org.springframework.cloud.openfeign.FeignClient;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
java.util.List
;
@FeignClient
(
contextId
=
"dataApiServiceFeign"
,
value
=
"datax-service-data-market"
,
fallbackFactory
=
DataApiServiceFeignFallbackFactory
.
class
)
@FeignClient
(
contextId
=
"dataApiServiceFeign"
,
value
=
"datax-service-data-market"
,
fallbackFactory
=
DataApiServiceFeignFallbackFactory
.
class
)
public
interface
DataApiServiceFeign
{
public
interface
DataApiServiceFeign
{
@GetMapping
(
"/inner/apis/{id}"
)
@GetMapping
(
"/inner/apis/{id}"
)
DataApiEntity
getDataApiById
(
@PathVariable
(
"id"
)
String
id
);
DataApiEntity
getDataApiById
(
@PathVariable
(
"id"
)
String
id
);
@GetMapping
(
"/inner/apis/release/list"
)
List
<
DataApiEntity
>
getReleaseDataApiList
();
}
}
datax-modules/data-market-service-parent/data-market-service-api/src/main/java/cn/datax/service/data/market/api/feign/fallback/DataApiServiceFeignFallbackImpl.java
View file @
b07012f4
...
@@ -6,6 +6,8 @@ import lombok.Setter;
...
@@ -6,6 +6,8 @@ import lombok.Setter;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
java.util.List
;
@Slf4j
@Slf4j
@Component
@Component
public
class
DataApiServiceFeignFallbackImpl
implements
DataApiServiceFeign
{
public
class
DataApiServiceFeignFallbackImpl
implements
DataApiServiceFeign
{
...
@@ -18,4 +20,10 @@ public class DataApiServiceFeignFallbackImpl implements DataApiServiceFeign {
...
@@ -18,4 +20,10 @@ public class DataApiServiceFeignFallbackImpl implements DataApiServiceFeign {
log
.
error
(
"feign 调用{}出错"
,
id
,
cause
);
log
.
error
(
"feign 调用{}出错"
,
id
,
cause
);
return
null
;
return
null
;
}
}
@Override
public
List
<
DataApiEntity
>
getReleaseDataApiList
()
{
log
.
error
(
"feign 调用出错"
,
cause
);
return
null
;
}
}
}
datax-modules/data-market-service-parent/data-market-service/src/main/java/cn/datax/service/data/market/config/StartedUpRunner.java
View file @
b07012f4
package
cn
.
datax
.
service
.
data
.
market
.
config
;
package
cn
.
datax
.
service
.
data
.
market
.
config
;
import
lombok.RequiredArgsConstructor
;
import
lombok.RequiredArgsConstructor
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.ApplicationArguments
;
import
org.springframework.boot.ApplicationArguments
;
import
org.springframework.boot.ApplicationRunner
;
import
org.springframework.boot.ApplicationRunner
;
import
org.springframework.context.ConfigurableApplicationContext
;
import
org.springframework.context.ConfigurableApplicationContext
;
...
...
datax-modules/data-market-service-parent/data-market-service/src/main/java/cn/datax/service/data/market/controller/InnerController.java
View file @
b07012f4
package
cn
.
datax
.
service
.
data
.
market
.
controller
;
package
cn
.
datax
.
service
.
data
.
market
.
controller
;
import
cn.datax.common.base.BaseController
;
import
cn.datax.common.base.BaseController
;
import
cn.datax.common.core.DataConstant
;
import
cn.datax.common.security.annotation.DataInner
;
import
cn.datax.common.security.annotation.DataInner
;
import
cn.datax.service.data.market.api.entity.ApiMaskEntity
;
import
cn.datax.service.data.market.api.entity.ApiMaskEntity
;
import
cn.datax.service.data.market.api.entity.DataApiEntity
;
import
cn.datax.service.data.market.api.entity.DataApiEntity
;
import
cn.datax.service.data.market.service.ApiMaskService
;
import
cn.datax.service.data.market.service.ApiMaskService
;
import
cn.datax.service.data.market.service.DataApiService
;
import
cn.datax.service.data.market.service.DataApiService
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.List
;
@RestController
@RestController
@RequestMapping
(
"/inner"
)
@RequestMapping
(
"/inner"
)
public
class
InnerController
extends
BaseController
{
public
class
InnerController
extends
BaseController
{
...
@@ -29,6 +33,16 @@ public class InnerController extends BaseController {
...
@@ -29,6 +33,16 @@ public class InnerController extends BaseController {
return
dataApiEntity
;
return
dataApiEntity
;
}
}
@DataInner
@GetMapping
(
"/apis/release/list"
)
public
List
<
DataApiEntity
>
getReleaseDataApiList
()
{
QueryWrapper
<
DataApiEntity
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"status"
,
DataConstant
.
ApiState
.
RELEASE
.
getKey
());
List
<
DataApiEntity
>
dataApiEntityList
=
dataApiService
.
list
(
queryWrapper
);
return
dataApiEntityList
;
}
@DataInner
@GetMapping
(
"/apiMasks/api/{id}"
)
@GetMapping
(
"/apiMasks/api/{id}"
)
public
ApiMaskEntity
getApiMaskByApiId
(
@PathVariable
(
"id"
)
String
id
)
{
public
ApiMaskEntity
getApiMaskByApiId
(
@PathVariable
(
"id"
)
String
id
)
{
ApiMaskEntity
apiMaskEntity
=
apiMaskService
.
getApiMaskByApiId
(
id
);
ApiMaskEntity
apiMaskEntity
=
apiMaskService
.
getApiMaskByApiId
(
id
);
...
...
datax-modules/data-market-service-parent/data-market-service/src/main/java/cn/datax/service/data/market/service/impl/DataApiServiceImpl.java
View file @
b07012f4
...
@@ -225,10 +225,18 @@ public class DataApiServiceImpl extends BaseServiceImpl<DataApiDao, DataApiEntit
...
@@ -225,10 +225,18 @@ public class DataApiServiceImpl extends BaseServiceImpl<DataApiDao, DataApiEntit
@Override
@Override
public
void
releaseDataApi
(
String
id
)
{
public
void
releaseDataApi
(
String
id
)
{
rabbitTemplate
.
convertAndSend
(
RabbitMqConstant
.
FANOUT_EXCHANGE_API_RELEASE_NAME
,
""
,
id
);
rabbitTemplate
.
convertAndSend
(
RabbitMqConstant
.
FANOUT_EXCHANGE_API_RELEASE_NAME
,
""
,
id
);
DataApiEntity
dataApiEntity
=
new
DataApiEntity
();
dataApiEntity
.
setId
(
id
);
dataApiEntity
.
setStatus
(
DataConstant
.
ApiState
.
RELEASE
.
getKey
());
dataApiDao
.
updateById
(
dataApiEntity
);
}
}
@Override
@Override
public
void
cancelDataApi
(
String
id
)
{
public
void
cancelDataApi
(
String
id
)
{
rabbitTemplate
.
convertAndSend
(
RabbitMqConstant
.
FANOUT_EXCHANGE_API_CANCEL_NAME
,
""
,
id
);
rabbitTemplate
.
convertAndSend
(
RabbitMqConstant
.
FANOUT_EXCHANGE_API_CANCEL_NAME
,
""
,
id
);
DataApiEntity
dataApiEntity
=
new
DataApiEntity
();
dataApiEntity
.
setId
(
id
);
dataApiEntity
.
setStatus
(
DataConstant
.
ApiState
.
CANCEL
.
getKey
());
dataApiDao
.
updateById
(
dataApiEntity
);
}
}
}
}
datax-ui/src/views/factory/datatheme/DataThemeList.vue
View file @
b07012f4
...
@@ -202,6 +202,8 @@ export default {
...
@@ -202,6 +202,8 @@ export default {
// 默认选择中表格头
// 默认选择中表格头
checkedTableColumns
:
[],
checkedTableColumns
:
[],
tableSize
:
'medium'
,
tableSize
:
'medium'
,
// 状态数据字典
statusOptions
:
[],
// 主题表格数据
// 主题表格数据
dataThemeList
:
[],
dataThemeList
:
[],
// 总数据条数
// 总数据条数
...
@@ -215,6 +217,11 @@ export default {
...
@@ -215,6 +217,11 @@ export default {
}
}
},
},
created
()
{
created
()
{
this
.
getDicts
(
'sys_common_status'
).
then
(
response
=>
{
if
(
response
.
success
)
{
this
.
statusOptions
=
response
.
data
}
})
this
.
getList
()
this
.
getList
()
},
},
mounted
()
{
mounted
()
{
...
@@ -331,11 +338,11 @@ export default {
...
@@ -331,11 +338,11 @@ export default {
this
.
getList
()
this
.
getList
()
},
},
statusFormatter
(
row
,
column
,
cellValue
,
index
)
{
statusFormatter
(
row
,
column
,
cellValue
,
index
)
{
let
dict
Text
=
row
.
status_dictText
let
dict
Label
=
this
.
selectDictLabel
(
this
.
statusOptions
,
cellValue
)
if
(
cellValue
===
'1'
)
{
if
(
cellValue
===
'1'
)
{
return
<
el
-
tag
type
=
"success"
>
{
dict
Text
}
<
/el-tag
>
return
<
el
-
tag
type
=
"success"
>
{
dict
Label
}
<
/el-tag
>
}
else
{
}
else
{
return
<
el
-
tag
type
=
"warning"
>
{
dict
Text
}
<
/el-tag
>
return
<
el
-
tag
type
=
"warning"
>
{
dict
Label
}
<
/el-tag
>
}
}
}
}
}
}
...
...
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