//tag规则 release-v188.13.* 商标交易   同步json文件到阿里云
//任务名 tmtransfer
const TaskBase = require("../../task.base");
const system = require("../../../system");
var settings = require("../../../../config/settings");
class TmtransactionTask extends TaskBase {
  constructor() {
    super(TaskBase.getServiceName(TmtransactionTask));
    this.restclient = system.getObject("util.restClient");
    this.centerChannelUrl = settings.centerChannelUrl();
  }
  async beforeTask(params) {
    console.log("前置操作......", this.serviceName);
    //this.isThrough=true; 
    //console.log(this.cacheManager);
  }
  async subDoTask() {
    console.log("--------------");
    console.log("TestTask1.....");
    var obj = {
      "actionType": "Taskalirpcagainpush",
      "actionBody": {
        "limit": 100 //推送数据条数 默认100条
      }
    }
    try {
      var url = this.centerChannelUrl + "api/auth/taskapi/taskAlijsonfile";
      this.restclient.execPost(obj, url);
      return system.getResultSuccess();
    } catch (error) {
      console.log(error);
      return null;
    }
  }
}
module.exports = TmtransactionTask;