Commit 4406394e authored by 夏彬's avatar 夏彬

添加escontent新的replace接口 以及更新接口

parent bfafa997
......@@ -11,13 +11,17 @@ use internalApi\ucenter\ElasContent;
require __DIR__ . '/_init.php';
ElasContent::setDebug();
$id = 1;
$title = '131212312312231313';
$content = '13123';
$pic = '12321';
$url = '12312';
$from = 'bbs';
$createAt = 1762734;
$extra = ['a'=>2222];
//ElasContent::replace($id,$title,$content,$pic,$url,$from,$createAt,$extra);
ElasContent::delete(1,'bbs');
\ No newline at end of file
//ElasContent::newreplace(5, "测试标题1", "内容", ['//imgs1', 'imgs2'], 'http://www.baidu.com', 'bbs', 10, [
// '洗衣机',
//
//], 8, 9, 1551601307, 38, 1551601307, [
// 'a' => 1,
// 'b' => 2
//]);
//ElasContent::update(5,'bbs',[
// 'title'=>'夏彬 修改',
// 'tags'=>[
// 'aas','夏彬','夏彬','1'
// ]
//]);
ElasContent::delete(5,'bbs');
......@@ -31,6 +31,42 @@ class ElasContent extends Client
}
/**
* @param integer $id 数据id 学院的courseId bbs的thread id
* @param string $title 标题
* @param string $contentData 纯文本内容 过滤掉富文本部分
* @param array $imgs 图片列表
* @param string $url 地址
* @param string $from 来源 bbs xue
* @param integer $hot 热度
* @param array $tags 标签数组
* @param integer $like_num 点赞数
* @param integer $comment_num 评论数
* @param integer $order_time 排序时间
* @param integer $uid 用户中心uid
* @param integer $createdAt
* @param array $extra
* @return mixed
* @throws \internalApi\base\ApiException
* @throws \internalApi\base\ClientException
*/
public static function newreplace($id, $title, $contentData, $imgs,$url,$from,$hot,$tags,$like_num,$comment_num,$order_time,$uid, $createdAt, $extra){
return self::call('elasContent.newreplace',compact('id', 'title', 'contentData', 'imgs', 'url', 'from','hot','tags','like_num','comment_num','order_time','uid', 'createdAt', 'extra'));
}
/**
* @param integer $id 数据id
* @param string $from 来源 bbs xue
* @param array $data 修改的数据
* @return mixed
* @throws \internalApi\base\ApiException
* @throws \internalApi\base\ClientException
*/
public static function update($id,$from,$data){
return self::call('elasContent.update',compact('id', 'from', 'data'));
}
/**
* delete
* @param $id
......@@ -44,4 +80,4 @@ class ElasContent extends Client
}
\ 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