Commit c67c7329 authored by 杨培's avatar 杨培

添加触发任务接口

parent 69f0bd63
...@@ -7,12 +7,16 @@ ...@@ -7,12 +7,16 @@
*/ */
use internalApi\bbs\Credit; use internalApi\bbs\Credit;
use internalApi\bbs\Task;
require __DIR__.'/_init.php'; require __DIR__.'/_init.php';
Credit::setDebug(true); Credit::setDebug(true);
Task::setDebug(true);
//$kk = Credit::updateExp(12, 1, '', 0, '测试加分RuleText', '测试加分Title', '测试加分Memo'); //$kk = Credit::updateExp(12, 1, '', 0, '测试加分RuleText', '测试加分Title', '测试加分Memo');
//$kk = Credit::updateCoin(12, 1, '', 0, '测试加分RuleText', '测试加分Title', '测试加分Memo'); //$kk = Credit::updateCoin(12, 1, '', 0, '测试加分RuleText', '测试加分Title', '测试加分Memo');
//$kk = Credit::updateExp(12, 1, 'watch_video', 15, '测试加分RuleText', '测试加分Title', '看视频'); //$kk = Credit::updateExp(12, 1, 'watch_video', 15, '测试加分RuleText', '测试加分Title', '看视频');
Credit::updateCreditByAction('reply', 12); //Credit::updateCreditByAction('reply', 12);
\ No newline at end of file
Task::trigger('wxh_medal_task:share', 12);
<?php
/**
* Created by PhpStorm.
* User: pader
* Date: 2018/10/25
* Time: 18:39
*/
namespace internalApi\bbs;
use internalApi\base\Client;
class Task extends Client
{
/**
* 触发及检查任务完成状态
*
* @param string $scriptName 任务脚本名称
* @param int $uid
* @param bool $autoApply 未申请的任务是否自动申请
* @return bool
* @throws \internalApi\base\ApiException|\internalApi\base\ClientException
*/
public static function trigger($scriptName, $uid, $autoApply=false)
{
return self::call('task.trigger', [
'scriptname' => $scriptName,
'ucid' => $uid,
'autoApply' => $autoApply
]);
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment