记得上下班打卡 | 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
02de99f9
Commit
02de99f9
authored
Dec 08, 2021
by
jiangxiulong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
定时任务
parent
899822a7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
4 deletions
+32
-4
SweetConstant.java
...a/com/liquidnet/service/sweet/constant/SweetConstant.java
+0
-1
FeignSweetTaskClient.java
...uidnet/service/feign/sweet/task/FeignSweetTaskClient.java
+6
-3
SweetTaskHandler.java
...idnet/service/executor/main/handler/SweetTaskHandler.java
+26
-0
No files found.
liquidnet-bus-api/liquidnet-service-sweet-api/src/main/java/com/liquidnet/service/sweet/constant/SweetConstant.java
View file @
02de99f9
...
...
@@ -32,7 +32,6 @@ public class SweetConstant {
public
static
final
String
REDIS_KEY_SWEET_INTEGRAL_ACTIVITY_PRIZE_NUM
=
"sweet:integralActivity:prizeNum:activityId:"
;
public
static
final
String
REDIS_KEY_SWEET_INTEGRAL_ACTIVITY_PRIZE_ID
=
":prizeId:"
;
public
static
final
String
REDIS_KEY_SWEET_INTEGRAL_ACTIVITY_DRAW_ALL_LIST
=
"sweet:integralActivity:Draw:activityId:"
;
public
static
final
String
REDIS_KEY_SWEET_INTEGRAL_ACTIVITY_DRAW_USER
=
"sweet:integralActivity:Draw:activityId:"
;
public
static
final
String
REDIS_KEY_SWEET_INTEGRAL_ACTIVITY_DRAW_IN_USER
=
"sweet:integralActivity:DrawIn:activityId:"
;
public
static
final
String
REDIS_KEY_SWEET_INTEGRAL_ACTIVITY_DRAW_USER_KEY
=
":userId:"
;
public
static
final
String
REDIS_KEY_SWEET_INTEGRAL_ACTIVITY_DRAW_INFO
=
"sweet:integralActivity:DrawInfo:drawId:"
;
...
...
liquidnet-bus-feign/liquidnet-api-feign-sweet/src/main/java/com/liquidnet/service/feign/sweet/task/FeignSweetTaskClient.java
View file @
02de99f9
...
...
@@ -4,17 +4,20 @@ import com.liquidnet.service.base.ResponseDto;
import
feign.hystrix.FallbackFactory
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.stereotype.Component
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
@Component
@FeignClient
(
name
=
"liquidnet-service-sweet"
,
contextId
=
"FeignSweetTaskClient"
,
path
=
""
,
contextId
=
"FeignSweetTaskClient"
,
path
=
"
sweet
"
,
url
=
"${liquidnet.service.sweet.url}"
,
// url = "",
fallback
=
FallbackFactory
.
Default
.
class
)
public
interface
FeignSweetTaskClient
{
@PostMapping
(
"sweet
/sweet
Data/drawLuck/add"
)
@PostMapping
(
"sweetData/drawLuck/add"
)
ResponseDto
<
Boolean
>
drawLuckAdd
();
@GetMapping
(
"integralActivity/setDrawAllList"
)
ResponseDto
<
Boolean
>
setDrawAllList
(
@RequestParam
(
"integralActivityId"
)
String
integralActivityId
);
}
liquidnet-bus-service/liquidnet-service-executor-all/liquidnet-service-executor-main/src/main/java/com/liquidnet/service/executor/main/handler/SweetTaskHandler.java
View file @
02de99f9
...
...
@@ -2,6 +2,7 @@ package com.liquidnet.service.executor.main.handler;
import
com.liquidnet.service.feign.sweet.task.FeignSweetTaskClient
;
import
com.xxl.job.core.biz.model.ReturnT
;
import
com.xxl.job.core.context.XxlJobHelper
;
import
com.xxl.job.core.handler.annotation.XxlJob
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
...
...
@@ -33,4 +34,29 @@ public class SweetTaskHandler {
return
ReturnT
.
FAIL
;
}
}
@XxlJob
(
value
=
"sev-sweet:setDrawAllList"
)
public
ReturnT
<
String
>
setDrawAllListHandler
()
{
try
{
String
jobParam
=
XxlJobHelper
.
getJobParam
();
//执行参数
log
.
info
(
"jobParam = "
+
jobParam
);
String
[]
paramArray
=
jobParam
.
split
(
","
);
ReturnT
<
String
>
success
=
ReturnT
.
SUCCESS
;
for
(
String
id
:
paramArray
)
{
log
.
info
(
"id = "
+
id
);
Boolean
data
=
feignSweetTaskClient
.
setDrawAllList
(
id
).
getData
();
log
.
info
(
"setDrawAllListHandler:结果:{}"
,
data
);
success
.
setMsg
(
String
.
valueOf
(
data
));
}
return
success
;
}
catch
(
Exception
e
)
{
log
.
error
(
"exception of handler:{}"
,
e
.
getMessage
(),
e
);
ReturnT
<
String
>
fail
=
ReturnT
.
FAIL
;
fail
.
setMsg
(
e
.
getLocalizedMessage
());
return
fail
;
}
}
}
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