123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- <?php
- namespace App\Services\Contracts;
- //社交媒体管理平台接口
- use Illuminate\Http\Request;
- interface SmmPlatformInterface
- {
- /*
- * OAuth 2.0 授权登录
- * 返回
- * ['status'=>true,'data'=>'https://example.com/fb-callback.php']
- * or
- * ['status'=>false,'data'=>'授权失败']
- */
- public function login();
- /*
- * OAuth 2.0 授权回调
- * 授权成功后,得到access_token,refresh_token等信息, 保存到数据库中
- * 授权成功后,
- * 返回 [
- * 'status'=>true,
- * 'data' => ['access_token' => 'xxxxx','user_name' => 'yyyyy',]
- * ]
- * or
- * 返回 [
- * 'status'=>false,
- * 'data' => '回调失败'
- * ]
- */
- public function loginCallback(Request $request);
- /*
- * 发布图片帖子
- * $message 帖子内容
- * $imagePath 图片路径, 如:/path/to/image.jpg
- * $accountIds 帖子发布账号ID列表,smm_user_account表中的id字段, 如:[1,2,3]
- * 返回发布结果:
- * [
- * 'status' => true,
- * 'data' => [
- * 'page_post_id' => 123, //帖子ID
- * 'image_video_url' => 'https://example.com/image.jpg', //帖子图片URL
- * ]
- * ]
- * or
- * [
- * 'status' => false,
- * 'data' => '发布失败'
- * ]
- */
- public function postImage($message,$imagePath,$accountIds);
- /*
- * 发布视频帖子
- * $message 帖子内容
- * $videoPath 视频路径, 如:/path/to/video.mp4
- * $accountIds 帖子发布账号ID列表,smm_user_account表中的id字段, 如:[1,2,3]
- * 返回发布结果:
- * [
- * 'page_post_id' => 123, //帖子ID
- * 'image_video_url' => 'https://example.com/video.mp4', //帖子图片URL
- * ]
- */
- public function postVideo($message,$videoPath,$accountIds);
- /*
- * 获取帖评论列表
- * $postId 帖子ID
- * 返回评论列表:
- * [
- * 'status' => true,
- * 'data' => [
- * [
- * ]
- * or
- * [
- * 'status' => false,
- * 'data' => '获取评论失败'
- * ]
- */
- public function getComments($postId);
- /*
- * 回复帖子评论
- * $commentId 评论ID
- */
- public function replyToComment($commentId);
- /*
- * 删除帖子评论
- */
- public function deleteComment($commentId);
- }
|