|
|
|
@ -1,22 +1,26 @@
|
|
|
|
|
package com.xxl.job.admin.controller;
|
|
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
|
|
|
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
|
|
import org.springframework.web.bind.annotation.PathVariable;
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
|
|
|
|
|
|
|
import com.xxl.job.admin.controller.annotation.PermissionLimit;
|
|
|
|
|
import com.xxl.job.admin.core.conf.XxlJobAdminConfig;
|
|
|
|
|
import com.xxl.job.admin.core.model.XxlJobInfo;
|
|
|
|
|
import com.xxl.job.admin.service.XxlJobService;
|
|
|
|
|
import com.xxl.job.core.biz.AdminBiz;
|
|
|
|
|
import com.xxl.job.core.biz.model.HandleCallbackParam;
|
|
|
|
|
import com.xxl.job.core.biz.model.RegistryParam;
|
|
|
|
|
import com.xxl.job.core.biz.model.ReturnT;
|
|
|
|
|
import com.xxl.job.core.util.GsonTool;
|
|
|
|
|
import com.xxl.job.core.util.XxlJobRemotingUtil;
|
|
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
|
|
import org.springframework.web.bind.annotation.PathVariable;
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Created by xuxueli on 17/5/10.
|
|
|
|
@ -28,6 +32,9 @@ public class JobApiController {
|
|
|
|
|
@Resource
|
|
|
|
|
private AdminBiz adminBiz;
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
private XxlJobService xxlJobService;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* api
|
|
|
|
|
*
|
|
|
|
@ -63,6 +70,12 @@ public class JobApiController {
|
|
|
|
|
} else if ("registryRemove".equals(uri)) {
|
|
|
|
|
RegistryParam registryParam = GsonTool.fromJson(data, RegistryParam.class);
|
|
|
|
|
return adminBiz.registryRemove(registryParam);
|
|
|
|
|
} else if ("jobInfoAdd".equals(uri)) {
|
|
|
|
|
XxlJobInfo jobInfo = GsonTool.fromJson(data, XxlJobInfo.class);
|
|
|
|
|
return xxlJobService.add(jobInfo);
|
|
|
|
|
} else if ("jobInfoRemove".equals(uri)) {
|
|
|
|
|
XxlJobInfo jobInfo = GsonTool.fromJson(data, XxlJobInfo.class);
|
|
|
|
|
return xxlJobService.remove(jobInfo.getId());
|
|
|
|
|
} else {
|
|
|
|
|
return new ReturnT<String>(ReturnT.FAIL_CODE, "invalid request, uri-mapping("+ uri +") not found.");
|
|
|
|
|
}
|
|
|
|
|