Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
album-project
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hqzhdj
album-project
Commits
1ead3342
Commit
1ead3342
authored
Sep 03, 2024
by
lilingye
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
init
parent
cea3434e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
40 deletions
+41
-40
cloud-album-service/pom.xml
+5
-5
cloud-album-service/src/main/java/com/yizhi/album/application/util/BuildJob.java
+36
-35
No files found.
cloud-album-service/pom.xml
View file @
1ead3342
...
@@ -37,11 +37,11 @@
...
@@ -37,11 +37,11 @@
<artifactId>
cloud-point-api
</artifactId>
<artifactId>
cloud-point-api
</artifactId>
<version>
1.0-SNAPSHOT
</version>
<version>
1.0-SNAPSHOT
</version>
</dependency>
</dependency>
<dependency
>
<!-- <dependency>--
>
<groupId>
com.yizhi
</groupId
>
<!-- <groupId>com.yizhi</groupId>--
>
<artifactId>
cloud-job-api
</artifactId
>
<!-- <artifactId>cloud-job-api</artifactId>--
>
<version>
1.0-SNAPSHOT
</version
>
<!-- <version>1.0-SNAPSHOT</version>--
>
</dependency
>
<!-- </dependency>--
>
<dependency>
<dependency>
<groupId>
com.yizhi
</groupId>
<groupId>
com.yizhi
</groupId>
<artifactId>
cloud-site-api
</artifactId>
<artifactId>
cloud-site-api
</artifactId>
...
...
cloud-album-service/src/main/java/com/yizhi/album/application/util/BuildJob.java
View file @
1ead3342
...
@@ -2,7 +2,7 @@ package com.yizhi.album.application.util;
...
@@ -2,7 +2,7 @@ package com.yizhi.album.application.util;
import
com.yizhi.application.job.remote.JobClient
;
import
com.yizhi.application.job.remote.JobClient
;
import
com.yizhi.application.job.remote.vo.VmyJobVO
;
//
import com.yizhi.application.job.remote.vo.VmyJobVO;
import
com.yizhi.message.application.constans.Constans
;
import
com.yizhi.message.application.constans.Constans
;
import
com.yizhi.util.application.date.DateUtil
;
import
com.yizhi.util.application.date.DateUtil
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
...
@@ -28,43 +28,43 @@ public class BuildJob {
...
@@ -28,43 +28,43 @@ public class BuildJob {
* TODO XXLJOB对应路径
* TODO XXLJOB对应路径
*/
*/
public
void
buildJob
(
String
jobName
,
Date
sendTime
)
throws
Exception
{
public
void
buildJob
(
String
jobName
,
Date
sendTime
)
throws
Exception
{
VmyJobVO
job
=
new
VmyJobVO
();
//
VmyJobVO job = new VmyJobVO();
job
.
setGroup
(
"album"
);
//
job.setGroup("album");
job
.
setJobName
(
jobName
);
//
job.setJobName(jobName);
job
.
setJobClassName
(
"com.xxl.job.executor.service.job.AlbumUnLockJob"
);
//
job.setJobClassName("com.xxl.job.executor.service.job.AlbumUnLockJob");
logger
.
info
(
"********************************专辑课程定时解锁的发送时间={},时间戳={}"
,
//
logger.info("********************************专辑课程定时解锁的发送时间={},时间戳={}",
sendTime
,
sendTime
.
getTime
());
//
sendTime, sendTime.getTime());
//
logger
.
info
(
"**************************************当前系统时间={}"
,
(
new
Date
()).
getTime
());
//
logger.info("**************************************当前系统时间={}", (new Date()).getTime());
String
cron
=
DateUtil
.
getCron
(
sendTime
);
//
String cron = DateUtil.getCron(sendTime);
logger
.
info
(
"**************************************cron={}"
,
cron
);
//
logger.info("**************************************cron={}", cron);
String
[]
cronArr
=
cron
.
split
(
" "
);
//
String[] cronArr = cron.split(" ");
job
.
setSecond
(
cronArr
[
0
]);
//
job.setSecond(cronArr[0]);
job
.
setMinute
(
cronArr
[
1
]);
//
job.setMinute(cronArr[1]);
job
.
setHour
(
cronArr
[
2
]);
//
job.setHour(cronArr[2]);
job
.
setDay
(
cronArr
[
3
]);
//
job.setDay(cronArr[3]);
job
.
setMonth
(
cronArr
[
4
]);
//
job.setMonth(cronArr[4]);
job
.
setWeek
(
cronArr
[
5
]);
//
job.setWeek(cronArr[5]);
job
.
setYear
(
cronArr
[
6
]);
//
job.setYear(cronArr[6]);
jobClient
.
insert
(
job
);
//
jobClient.insert(job);
}
}
public
void
buildJobDefault
(
String
jobName
)
throws
Exception
{
public
void
buildJobDefault
(
String
jobName
)
throws
Exception
{
VmyJobVO
job
=
new
VmyJobVO
();
//
VmyJobVO job = new VmyJobVO();
job
.
setGroup
(
Constans
.
JOBGROUP
);
//
job.setGroup(Constans.JOBGROUP);
job
.
setJobName
(
jobName
);
//
job.setJobName(jobName);
job
.
setJobClassName
(
"com.xxl.job.executor.service.job.AlbumUnLockJob"
);
//
job.setJobClassName("com.xxl.job.executor.service.job.AlbumUnLockJob");
//
logger
.
info
(
"**************************************当前系统时间={}"
,
(
new
Date
()).
getTime
());
//
logger.info("**************************************当前系统时间={}", (new Date()).getTime());
//
job
.
setSecond
(
"0"
);
//
job.setSecond("0");
job
.
setMinute
(
"0/5"
);
//
job.setMinute("0/5");
job
.
setHour
(
"*"
);
//
job.setHour("*");
job
.
setDay
(
"*"
);
//
job.setDay("*");
job
.
setMonth
(
"*"
);
//
job.setMonth("*");
job
.
setWeek
(
"?"
);
//
job.setWeek("?");
job
.
setYear
(
"*"
);
//
job.setYear("*");
jobClient
.
insert
(
job
);
//
jobClient.insert(job);
}
}
}
}
\ No newline at end of file
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