diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/gov/controller/GovProjectCollectionController.java b/pmapi/src/main/java/com/ningdatech/pmapi/gov/controller/GovProjectCollectionController.java index d0c76a8..894c479 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/gov/controller/GovProjectCollectionController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/gov/controller/GovProjectCollectionController.java @@ -8,6 +8,7 @@ import com.ningdatech.pmapi.gov.model.vo.GovBizProjectDetailVO; import com.ningdatech.pmapi.gov.model.vo.GovBizProjectListVO; import com.ningdatech.pmapi.gov.model.vo.GovProjectDictionaryVO; import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq; +import com.ningdatech.pmapi.scheduler.task.SynProjectCollectionTask; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; @@ -16,6 +17,7 @@ import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import javax.validation.Valid; +import java.net.UnknownHostException; import java.util.List; /** @@ -36,6 +38,8 @@ public class GovProjectCollectionController { private final GovProjectCollectionManage collectionManage; + private final SynProjectCollectionTask collectionTask; + @GetMapping("/dictionary") @ApiOperation("字典") public List dictionary(@RequestParam(value = "type", required = false) String type) { @@ -67,4 +71,11 @@ public class GovProjectCollectionController { public String remove(@PathVariable String projId) { return collectionManage.remove(projId); } + + @PostMapping("/push-task") + @ApiOperation("主动调用定时器方法") + @WebLog("主动调用定时器方法") + public void pushTask() throws UnknownHostException { + collectionTask.doTask(); + } }