//tag规则 release-v188.1.* 阿里接入定时任务
//工期紧张，阿里先开始接入，后续接入重用了阿里的流程
//实现作用是同gongg步需求给服务商
//调用center_channel   /api/auth/taskapi/taskAliIcapi
const TaskBase = require("../../task.base");
const system = require("../../../system");
var settings = require("../../../../config/settings");
class AliicapiTask extends TaskBase {
  constructor() {
    super(TaskBase.getServiceName(AliicapiTask));
    this.restclient = system.getObject("util.restClient");
  }
  /**
  * 每隔10分钟检查一次
  * @param {*} taskName 
  */
  formatedTaskName (taskName) {
    console.log("formatedTaskName", taskName)
    return taskName + "|i|5"
  }
  async subDoTask () {
    console.log("--------------");
    console.log("TestTask1.....");
    var obj = {
      "actionType": "taskpolicyneed2fq",
      "actionBody": {
        "limit": 100 //推送数据条数 默认100条
      }
    }
    try {
      var url = settings.centerChannelUrl() + "api/auth/taskapi/taskAliIcapi";
      this.restclient.execPost(obj, url);
      return system.getResultSuccess();
    } catch (error) {
      console.log(error);
      return null;
    }
  }
}
module.exports = AliicapiTask;


// var a=new AliicapiTask();
// a.subDoTask();