记得上下班打卡 | git大法好,push需谨慎
Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liquidnet-bus-v1
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
董敬伟
liquidnet-bus-v1
Commits
37fd0729
Commit
37fd0729
authored
Sep 27, 2021
by
Administrator
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'pre' into 'master'
Pre See merge request
!58
parents
f861457b
134f0f30
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
95 additions
and
77 deletions
+95
-77
liquidnet-service-kylin.yml
...t-bus-config/liquidnet-config/liquidnet-service-kylin.yml
+1
-0
FeignKylinForChimeClient.java
...net/service/feign/kylin/api/FeignKylinForChimeClient.java
+1
-3
SecuringRequestInterceptor.java
...ervice/feign/kylin/config/SecuringRequestInterceptor.java
+37
-37
PlatformTaskHandler.java
...et/service/executor/main/handler/PlatformTaskHandler.java
+32
-14
SweetCityVoteTaskHandler.java
...rvice/executor/main/handler/SweetCityVoteTaskHandler.java
+9
-4
SweetWechatTaskHandler.java
...service/executor/main/handler/SweetWechatTaskHandler.java
+9
-19
DataUtils.java
...ain/java/com/liquidnet/service/kylin/utils/DataUtils.java
+6
-0
No files found.
liquidnet-bus-config/liquidnet-config/liquidnet-service-kylin.yml
View file @
37fd0729
...
...
@@ -147,6 +147,7 @@ global-auth:
-
${liquidnet.info.context}/performance/calendar
-
${liquidnet.info.context}/performance/calendarPerformances
-
${liquidnet.info.context}/performance/*
-
${liquidnet.info.context}/myPerformance/*
# -----------------------------------------------------------
...
...
liquidnet-bus-feign/liquidnet-api-feign-kylin/src/main/java/com/liquidnet/service/feign/kylin/api/FeignKylinForChimeClient.java
View file @
37fd0729
package
com
.
liquidnet
.
service
.
feign
.
kylin
.
api
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.feign.kylin.config.SecuringRequestInterceptor
;
import
com.liquidnet.service.kylin.dto.vo.mongo.KylinPerformanceVo
;
import
feign.hystrix.FallbackFactory
;
import
org.springframework.cloud.openfeign.FeignClient
;
...
...
@@ -25,8 +24,7 @@ import java.util.List;
@FeignClient
(
name
=
"liquidnet-service-kylin"
,
contextId
=
"FeignKylinForChimeClient"
,
path
=
""
,
url
=
"${liquidnet.service.kylin.url}"
,
fallback
=
FallbackFactory
.
Default
.
class
,
configuration
=
SecuringRequestInterceptor
.
class
)
fallback
=
FallbackFactory
.
Default
.
class
)
public
interface
FeignKylinForChimeClient
{
@GetMapping
(
"myPerformance/performancesList"
)
ResponseDto
<
List
<
KylinPerformanceVo
>>
myPerformancesList
();
...
...
liquidnet-bus-feign/liquidnet-api-feign-kylin/src/main/java/com/liquidnet/service/feign/kylin/config/SecuringRequestInterceptor.java
View file @
37fd0729
package
com
.
liquidnet
.
service
.
feign
.
kylin
.
config
;
import
feign.RequestInterceptor
;
import
feign.RequestTemplate
;
import
org.springframework.stereotype.Component
;
import
org.springframework.web.context.request.RequestContextHolder
;
import
org.springframework.web.context.request.ServletRequestAttributes
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.Enumeration
;
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @Description: 解决feign调用传递header问题
* @class: SecuringRequestInterceptor
* @Package com.liquidnet.service.chime.config
* @Copyright: LightNet @ Copyright (c) 2021
* @date 2021/9/11 19:22
*/
@Component
public
class
SecuringRequestInterceptor
implements
RequestInterceptor
{
@Override
public
void
apply
(
RequestTemplate
requestTemplate
)
{
ServletRequestAttributes
attributes
=
(
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
();
HttpServletRequest
request
=
attributes
.
getRequest
();
Enumeration
<
String
>
headerNames
=
request
.
getHeaderNames
();
if
(
headerNames
!=
null
)
{
while
(
headerNames
.
hasMoreElements
())
{
String
name
=
headerNames
.
nextElement
();
String
values
=
request
.
getHeader
(
name
);
requestTemplate
.
header
(
name
,
values
);
}
}
}
}
\ No newline at end of file
//package com.liquidnet.service.feign.kylin.config;
//
//import feign.RequestInterceptor;
//import feign.RequestTemplate;
//import org.springframework.stereotype.Component;
//import org.springframework.web.context.request.RequestContextHolder;
//import org.springframework.web.context.request.ServletRequestAttributes;
//
//import javax.servlet.http.HttpServletRequest;
//import java.util.Enumeration;
//
///**
// * @author AnJiabin <anjiabin@zhengzai.tv>
// * @version V1.0
// * @Description: 解决feign调用传递header问题
// * @class: SecuringRequestInterceptor
// * @Package com.liquidnet.service.chime.config
// * @Copyright: LightNet @ Copyright (c) 2021
// * @date 2021/9/11 19:22
// */
//@Component
//public class SecuringRequestInterceptor implements RequestInterceptor {
// @Override
// public void apply(RequestTemplate requestTemplate) {
// ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder
// .getRequestAttributes();
// HttpServletRequest request = attributes.getRequest();
// Enumeration<String> headerNames = request.getHeaderNames();
// if (headerNames != null) {
// while (headerNames.hasMoreElements()) {
// String name = headerNames.nextElement();
// String values = request.getHeader(name);
// requestTemplate.header(name, values);
// }
// }
// }
//}
\ No newline at end of file
liquidnet-bus-service/liquidnet-service-executor-all/liquidnet-service-executor-main/src/main/java/com/liquidnet/service/executor/main/handler/PlatformTaskHandler.java
View file @
37fd0729
package
com
.
liquidnet
.
service
.
executor
.
main
.
handler
;
import
com.liquidnet.commons.lang.util.JsonUtils
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.feign.kylin.task.FeignPlatformAlipayBackClient
;
import
com.liquidnet.service.feign.platform.task.FeignPlatformCandyTaskClient
;
...
...
@@ -27,9 +28,14 @@ public class PlatformTaskHandler {
try
{
String
result
=
feignPlatformAlipayBackClient
.
alipayActiveCallback
().
getData
();
log
.
info
(
"alipayActiveCallback:结果:"
+
result
);
return
ReturnT
.
SUCCESS
;
ReturnT
<
String
>
success
=
ReturnT
.
SUCCESS
;
success
.
setContent
(
result
);
return
success
;
}
catch
(
Exception
e
)
{
return
ReturnT
.
FAIL
;
log
.
error
(
"exception of handler:{}"
,
e
.
getMessage
(),
e
);
ReturnT
<
String
>
fail
=
ReturnT
.
FAIL
;
fail
.
setMsg
(
e
.
getLocalizedMessage
());
return
fail
;
}
}
...
...
@@ -38,11 +44,14 @@ public class PlatformTaskHandler {
public
ReturnT
<
String
>
candyCouponMgtIssueCoupons
()
{
try
{
ResponseDto
<
String
>
dto
=
feignPlatformCandyTaskClient
.
mgtIssueCoupons
();
log
.
info
(
"result of handler:{}"
,
dto
.
toJson
());
return
new
ReturnT
<>(
dto
.
toJson
());
String
dtoStr
=
JsonUtils
.
toJson
(
dto
);
log
.
info
(
"result of handler:{}"
,
dtoStr
);
return
new
ReturnT
<>(
dtoStr
);
}
catch
(
Exception
e
)
{
log
.
error
(
"exception of handler:{}"
,
e
.
getMessage
(),
e
);
return
ReturnT
.
FAIL
;
ReturnT
<
String
>
fail
=
ReturnT
.
FAIL
;
fail
.
setMsg
(
e
.
getLocalizedMessage
());
return
fail
;
}
}
...
...
@@ -51,11 +60,14 @@ public class PlatformTaskHandler {
public
ReturnT
<
String
>
candyCouponDueProcessForRedeem
()
{
try
{
ResponseDto
<
String
>
dto
=
feignPlatformCandyTaskClient
.
dueProcessForRedeem
();
log
.
info
(
"result of handler:{}"
,
dto
.
toJson
());
return
new
ReturnT
<>(
dto
.
toJson
());
String
dtoStr
=
JsonUtils
.
toJson
(
dto
);
log
.
info
(
"result of handler:{}"
,
dtoStr
);
return
new
ReturnT
<>(
dtoStr
);
}
catch
(
Exception
e
)
{
log
.
error
(
"exception of handler:{}"
,
e
.
getMessage
(),
e
);
return
ReturnT
.
FAIL
;
ReturnT
<
String
>
fail
=
ReturnT
.
FAIL
;
fail
.
setMsg
(
e
.
getLocalizedMessage
());
return
fail
;
}
}
...
...
@@ -64,11 +76,14 @@ public class PlatformTaskHandler {
public
ReturnT
<
String
>
candyCouponDueProcessForCommon
()
{
try
{
ResponseDto
<
String
>
dto
=
feignPlatformCandyTaskClient
.
dueProcessForCommon
();
log
.
info
(
"result of handler:{}"
,
dto
.
toJson
());
return
new
ReturnT
<>(
dto
.
toJson
());
String
dtoStr
=
JsonUtils
.
toJson
(
dto
);
log
.
info
(
"result of handler:{}"
,
dtoStr
);
return
new
ReturnT
<>(
dtoStr
);
}
catch
(
Exception
e
)
{
log
.
error
(
"exception of handler:{}"
,
e
.
getMessage
(),
e
);
return
ReturnT
.
FAIL
;
ReturnT
<
String
>
fail
=
ReturnT
.
FAIL
;
fail
.
setMsg
(
e
.
getLocalizedMessage
());
return
fail
;
}
}
...
...
@@ -77,11 +92,14 @@ public class PlatformTaskHandler {
public
ReturnT
<
String
>
candyCouponDueProcessForUser
()
{
try
{
ResponseDto
<
String
>
dto
=
feignPlatformCandyTaskClient
.
dueProcessForUser
();
log
.
info
(
"result of handler:{}"
,
dto
.
toJson
());
return
new
ReturnT
<>(
dto
.
toJson
());
String
dtoStr
=
JsonUtils
.
toJson
(
dto
);
log
.
info
(
"result of handler:{}"
,
dtoStr
);
return
new
ReturnT
<>(
dtoStr
);
}
catch
(
Exception
e
)
{
log
.
error
(
"exception of handler:{}"
,
e
.
getMessage
(),
e
);
return
ReturnT
.
FAIL
;
ReturnT
<
String
>
fail
=
ReturnT
.
FAIL
;
fail
.
setMsg
(
e
.
getLocalizedMessage
());
return
fail
;
}
}
}
liquidnet-bus-service/liquidnet-service-executor-all/liquidnet-service-executor-main/src/main/java/com/liquidnet/service/executor/main/handler/SweetCityVoteTaskHandler.java
View file @
37fd0729
...
...
@@ -21,11 +21,16 @@ public class SweetCityVoteTaskHandler {
@XxlJob
(
value
=
"sev-sweet:cityVoteStat"
)
public
ReturnT
<
String
>
cityVoteStatHandler
()
{
try
{
feignSweetTaskActivityClient
.
setStatList
().
getData
();
log
.
info
(
"cityVoteStatHandler:结果:success"
);
return
ReturnT
.
SUCCESS
;
Boolean
data
=
feignSweetTaskActivityClient
.
setStatList
().
getData
();
log
.
info
(
"cityVoteStatHandler:结果:{}"
,
data
);
ReturnT
<
String
>
success
=
ReturnT
.
SUCCESS
;
success
.
setContent
(
String
.
valueOf
(
data
));
return
success
;
}
catch
(
Exception
e
)
{
return
ReturnT
.
FAIL
;
log
.
error
(
"exception of handler:{}"
,
e
.
getMessage
(),
e
);
ReturnT
<
String
>
fail
=
ReturnT
.
FAIL
;
fail
.
setMsg
(
e
.
getLocalizedMessage
());
return
fail
;
}
}
...
...
liquidnet-bus-service/liquidnet-service-executor-all/liquidnet-service-executor-main/src/main/java/com/liquidnet/service/executor/main/handler/SweetWechatTaskHandler.java
View file @
37fd0729
package
com
.
liquidnet
.
service
.
executor
.
main
.
handler
;
import
com.liquidnet.service.feign.sweet.task.FeignSweetTaskActivityClient
;
import
com.liquidnet.service.feign.sweet.task.FeignSweetWechatClient
;
import
com.xxl.job.core.biz.model.ReturnT
;
import
com.xxl.job.core.handler.annotation.XxlJob
;
...
...
@@ -19,29 +18,20 @@ public class SweetWechatTaskHandler {
@Autowired
private
FeignSweetWechatClient
feignSweetWechatClient
;
/*@Autowired
private FeignSweetTaskActivityClient feignSweetTaskActivityClient;*/
@XxlJob
(
value
=
"sev-sweet:sendMsg"
)
public
ReturnT
<
String
>
sendWechatMsgHandler
()
{
try
{
feignSweetWechatClient
.
send
().
getData
();
log
.
info
(
"sendWechatMsgHandler:结果:success"
);
return
ReturnT
.
SUCCESS
;
Object
data
=
feignSweetWechatClient
.
send
().
getData
();
log
.
info
(
"sendWechatMsgHandler:结果:{}"
,
data
);
ReturnT
<
String
>
success
=
ReturnT
.
SUCCESS
;
success
.
setContent
(
String
.
valueOf
(
data
));
return
success
;
}
catch
(
Exception
e
)
{
return
ReturnT
.
FAIL
;
log
.
error
(
"exception of handler:{}"
,
e
.
getMessage
(),
e
);
ReturnT
<
String
>
fail
=
ReturnT
.
FAIL
;
fail
.
setMsg
(
e
.
getLocalizedMessage
());
return
fail
;
}
}
/*@XxlJob(value = "sev-sweet:cityVoteStat")
public ReturnT<String> cityVoteStatHandler() {
try {
feignSweetTaskActivityClient.setStatList().getData();
log.info("cityVoteStatHandler:结果:success");
return ReturnT.SUCCESS;
} catch (Exception e) {
return ReturnT.FAIL;
}
}*/
}
liquidnet-bus-service/liquidnet-service-kylin/liquidnet-service-kylin-impl/src/main/java/com/liquidnet/service/kylin/utils/DataUtils.java
View file @
37fd0729
...
...
@@ -668,8 +668,14 @@ public class DataUtils {
* 获取我的演出列表
*/
public
List
<
KylinPerformanceVo
>
myPerformancesList
(
String
userId
)
{
LocalDateTime
nowTime
=
LocalDateTime
.
now
();
String
nowTimeStr
=
DateUtil
.
Formatter
.
yyyyMMddHHmmss
.
format
(
nowTime
);
Query
queryNew
=
new
Query
();
queryNew
.
addCriteria
(
Criteria
.
where
(
"userId"
).
is
(
userId
));
queryNew
.
addCriteria
(
Criteria
.
where
(
"timeEnd"
).
gte
(
nowTimeStr
));
queryNew
.
addCriteria
(
Criteria
.
where
(
"appStatus"
).
in
(
6
,
8
,
9
,
10
));
queryNew
.
addCriteria
(
Criteria
.
where
(
"isShow"
).
is
(
1
));
List
<
String
>
performanceIdList
=
mongoTemplate
.
findDistinct
(
queryNew
,
"performanceId"
,
"KylinOrderTicketVo"
,
KylinOrderTicketVo
.
class
,
String
.
class
);
log
.
info
(
"myPerformancesList performanceIdList.size:{}"
,
performanceIdList
.
size
());
...
...
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