package net.tccn.qtask;

import net.tccn.base.BaseService;
import net.tccn.base.Kv;
import org.redkale.net.http.RestMapping;
import org.redkale.net.http.RestParam;
import org.redkale.net.http.RestService;
import org.redkale.service.RetResult;

/**
 * @author: liangxianyou at 2018/11/13 18:14.
 */
@RestService(name = "qtask", automapping = true, comment = "qtask查询服务")
public class QtaskService extends BaseService {

    // 调用示例: http://qtask_service_addr_xxxxxx/qtask/call?name=abxx&plattoken=3421432&para={h:1}
    @RestMapping(name = "call", auth = false)
    public RetResult<Object> call(String name, Kv<String, String> para, @RestParam(name = "plattoken") String plattoken) {
        if (para == null) {
            para = Kv.of();
        }
        return RetResult.success(TaskKit.taskRun(name, plattoken, para));
    }

}
