Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
熊鹏飞
/
xxljob220
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
37e9a001
authored
Jan 30, 2018
by
xuxueli
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Job服务方法调整,为提供API服务做准备
parent
18991c3f
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
82 additions
and
23 deletions
xxl-job-admin/src/main/java/com/xxl/job/admin/controller/IndexController.java
xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobInfoController.java
xxl-job-admin/src/main/java/com/xxl/job/admin/service/XxlJobService.java
xxl-job-admin/src/main/java/com/xxl/job/admin/service/impl/XxlJobServiceImpl.java
xxl-job-admin/src/main/webapp/static/js/index.js
xxl-job-admin/src/main/webapp/static/js/jobinfo.index.1.js
xxl-job-admin/src/main/java/com/xxl/job/admin/controller/IndexController.java
View file @
37e9a001
...
...
@@ -41,11 +41,11 @@ public class IndexController {
return
"index"
;
}
@RequestMapping
(
"/
triggerChartDate
"
)
@RequestMapping
(
"/
chartInfo
"
)
@ResponseBody
public
ReturnT
<
Map
<
String
,
Object
>>
triggerChartDate
(
Date
startDate
,
Date
endDate
)
{
ReturnT
<
Map
<
String
,
Object
>>
triggerChartDate
=
xxlJobService
.
triggerChartDate
(
startDate
,
endDate
);
return
triggerChartDate
;
public
ReturnT
<
Map
<
String
,
Object
>>
chartInfo
(
Date
startDate
,
Date
endDate
)
{
ReturnT
<
Map
<
String
,
Object
>>
chartInfo
=
xxlJobService
.
chartInfo
(
startDate
,
endDate
);
return
chartInfo
;
}
@RequestMapping
(
"/toLogin"
)
...
...
xxl-job-admin/src/main/java/com/xxl/job/admin/controller/JobInfoController.java
View file @
37e9a001
...
...
@@ -64,10 +64,10 @@ public class JobInfoController {
return
xxlJobService
.
add
(
jobInfo
);
}
@RequestMapping
(
"/
reschedul
e"
)
@RequestMapping
(
"/
updat
e"
)
@ResponseBody
public
ReturnT
<
String
>
reschedul
e
(
XxlJobInfo
jobInfo
)
{
return
xxlJobService
.
reschedul
e
(
jobInfo
);
public
ReturnT
<
String
>
updat
e
(
XxlJobInfo
jobInfo
)
{
return
xxlJobService
.
updat
e
(
jobInfo
);
}
@RequestMapping
(
"/remove"
)
...
...
xxl-job-admin/src/main/java/com/xxl/job/admin/service/XxlJobService.java
View file @
37e9a001
...
...
@@ -13,23 +13,82 @@ import java.util.Map;
* @author xuxueli 2016-5-28 15:30:33
*/
public
interface
XxlJobService
{
/**
* page list
*
* @param start
* @param length
* @param jobGroup
* @param jobDesc
* @param executorHandler
* @param filterTime
* @return
*/
public
Map
<
String
,
Object
>
pageList
(
int
start
,
int
length
,
int
jobGroup
,
String
jobDesc
,
String
executorHandler
,
String
filterTime
);
/**
* add job
*
* @param jobInfo
* @return
*/
public
ReturnT
<
String
>
add
(
XxlJobInfo
jobInfo
);
public
ReturnT
<
String
>
reschedule
(
XxlJobInfo
jobInfo
);
/**
* update job
*
* @param jobInfo
* @return
*/
public
ReturnT
<
String
>
update
(
XxlJobInfo
jobInfo
);
/**
* remove job
*
* @param id
* @return
*/
public
ReturnT
<
String
>
remove
(
int
id
);
/**
* pause job
*
* @param id
* @return
*/
public
ReturnT
<
String
>
pause
(
int
id
);
/**
* resume job
*
* @param id
* @return
*/
public
ReturnT
<
String
>
resume
(
int
id
);
/**
* trigger job
*
* @param id
* @return
*/
public
ReturnT
<
String
>
triggerJob
(
int
id
);
/**
* dashboard info
*
* @return
*/
public
Map
<
String
,
Object
>
dashboardInfo
();
public
ReturnT
<
Map
<
String
,
Object
>>
triggerChartDate
(
Date
startDate
,
Date
endDate
);
/**
* chart info
*
* @param startDate
* @param endDate
* @return
*/
public
ReturnT
<
Map
<
String
,
Object
>>
chartInfo
(
Date
startDate
,
Date
endDate
);
}
xxl-job-admin/src/main/java/com/xxl/job/admin/service/impl/XxlJobServiceImpl.java
View file @
37e9a001
...
...
@@ -149,7 +149,7 @@ public class XxlJobServiceImpl implements XxlJobService {
}
@Override
public
ReturnT
<
String
>
reschedul
e
(
XxlJobInfo
jobInfo
)
{
public
ReturnT
<
String
>
updat
e
(
XxlJobInfo
jobInfo
)
{
// valid
if
(!
CronExpression
.
isValidExpression
(
jobInfo
.
getJobCron
()))
{
...
...
@@ -323,12 +323,12 @@ public class XxlJobServiceImpl implements XxlJobService {
private
static
final
String
TRIGGER_CHART_DATA_CACHE
=
"trigger_chart_data_cache"
;
@Override
public
ReturnT
<
Map
<
String
,
Object
>>
triggerChartDate
(
Date
startDate
,
Date
endDate
)
{
public
ReturnT
<
Map
<
String
,
Object
>>
chartInfo
(
Date
startDate
,
Date
endDate
)
{
// get cache
String
cacheKey
=
TRIGGER_CHART_DATA_CACHE
+
"_"
+
startDate
.
getTime
()
+
"_"
+
endDate
.
getTime
();
Map
<
String
,
Object
>
triggerChartDateCache
=
(
Map
<
String
,
Object
>)
LocalCacheUtil
.
get
(
cacheKey
);
if
(
triggerChartDateCache
!=
null
)
{
return
new
ReturnT
<
Map
<
String
,
Object
>>(
triggerChartDateCache
);
Map
<
String
,
Object
>
chartInfo
=
(
Map
<
String
,
Object
>)
LocalCacheUtil
.
get
(
cacheKey
);
if
(
chartInfo
!=
null
)
{
return
new
ReturnT
<
Map
<
String
,
Object
>>(
chartInfo
);
}
// process
...
...
xxl-job-admin/src/main/webapp/static/js/index.js
View file @
37e9a001
...
...
@@ -49,7 +49,7 @@ $(function () {
function
freshChartDate
(
startDate
,
endDate
)
{
$
.
ajax
({
type
:
'POST'
,
url
:
base_url
+
'/
triggerChartDate
'
,
url
:
base_url
+
'/
chartInfo
'
,
data
:
{
'startDate'
:
startDate
.
format
(
'YYYY-MM-DD HH:mm:ss'
),
'endDate'
:
endDate
.
format
(
'YYYY-MM-DD HH:mm:ss'
)
...
...
xxl-job-admin/src/main/webapp/static/js/jobinfo.index.1.js
View file @
37e9a001
...
...
@@ -415,7 +415,7 @@ $(function() {
},
submitHandler
:
function
(
form
)
{
// post
$
.
post
(
base_url
+
"/jobinfo/
reschedul
e"
,
$
(
"#updateModal .form"
).
serialize
(),
function
(
data
,
status
)
{
$
.
post
(
base_url
+
"/jobinfo/
updat
e"
,
$
(
"#updateModal .form"
).
serialize
(),
function
(
data
,
status
)
{
if
(
data
.
code
==
"200"
)
{
$
(
'#updateModal'
).
modal
(
'hide'
);
layer
.
open
({
...
...
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