Selaa lähdekoodia

改为定时器 同步项目归集

master
PoffyZhang 1 vuosi sitten
vanhempi
commit
9cb5483ee2
1 muutettua tiedostoa jossa 11 lisäystä ja 0 poistoa
  1. +11
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/gov/controller/GovProjectCollectionController.java

+ 11
- 0
pmapi/src/main/java/com/ningdatech/pmapi/gov/controller/GovProjectCollectionController.java Näytä tiedosto

@@ -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<GovProjectDictionaryVO> 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();
}
}

Loading…
Peruuta
Tallenna