AyrReleaseLogic.php
4.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
<?php
namespace App\Http\Logic\Bside\AyrShare;
use App\Http\Logic\Bside\BaseLogic;
use App\Models\AyrShare\AyrRelease;
use App\Models\File\File;
use App\Models\File\Image;
class AyrReleaseLogic extends BaseLogic
{
public function __construct()
{
parent::__construct();
$this->model = new AyrRelease();
$this->param = $this->requestAll;
}
/**
* @name :(获取详情)release_info
* @author :lyh
* @method :post
* @time :2023/5/9 16:27
*/
public function release_info(){
$info = $this->model->read($this->param);
if($info === false){
$this->fail('error');
}
return $this->success($info);
}
/**
* @name :(发布社交写入数据库)release_add
* @author :lyh
* @method :post
* @time :2023/5/9 9:38
*/
public function release_add(){
$this->param['project_id'] = $this->user['project_id'];
$this->param['operator_id'] = $this->user['id'];
$rs = $this->model->add($this->param);
if($rs === false){
$this->fail('error');
}
return $this->success();
}
/**
* @name :(上传第三方图片参数处理)get_param
* @author :lyh
* @method :post
* @time :2023/5/10 10:27
*/
public function image_file_param($data) {
$arr = [];
foreach ($data as $k => $v){
if($k == 'images'){
$images = explode(',',$v);
$imageModel = new Image();
$list = $imageModel->list(['hash'=>['in',$images]],'id');
foreach ($list as $v1){
$arr[] = $v1['ayr_url'];
}
}else{
$arr[] = url('/b/file_hash/' . $v.rand(10000,99999).'mp4');;
}
}
return $this->success($arr);
}
/**
* @name :(发布到推特)post_twitter
* @author :lyh
* @method :post
* @time :2023/5/9 13:42
*/
public function post_twitter($param){
$param['post'] = '描述';
$param['platforms'] = ['twitter'];
$param['twitterOptions'] = [
'thread'=> true,
'threadNumber'=> true,
'mediaUrls'=>[
//图片地址
],
];
return $this->success($param);
}
/**
* @name :(发布到youtube)post_facebook
* @author :lyh
* @method :post
* @time :2023/5/9 10:05
*/
public function post_facebook(){
$param['post'] = '视频描述';
$param['platforms'] = ['facebook'];
$param['faceBookOptions'] = [
'reels'=> true,
'title'=>'Super title for the Reel'
];
return $this->success($param);
}
/**
* @name :(发布到fbg,)post_youtube
* @author :lyh
* @method :post
* @time :2023/5/9 10:22
* @TODO::只能发布一张图片和一张视频
*/
public function post_gmb(){
$param['post'] = '描述';
$param['platforms'] = ['gmb'];
$param['mediaUrls'] = [];//图片链接
$param['gmbOptions'] = [
//视屏设置
'isPhotoVideo' => true,
'category'=> 'cate',//分类
];
return $this->success($param);
}
/**
* @name :(发布到instagram)post_google
* @author :lyh
* @method :post
* @time :2023/5/9 11:54
*/
public function post_instagram(){
$param['post'] = '视频描述';
$param['platforms'] = ['instagram'];
$param['faceBookOptions'] = [
'reels'=> true,
'title'=>'Super title for the Reel'
];
return $this->success();
}
/**
* @name :(领英)post_linkedin
* @author :lyh
* @method :post
* @time :2023/5/9 11:56
*/
public function post_linkedin(){
return $this->success();
}
/**
* @name :(红迪网)post_reddit
* @author :lyh
* @method :post
* @time :2023/5/9 13:40
*/
public function post_reddit(){
return $this->success();
}
/**
* @name :(抖音)post_tiktok
* @author :lyh
* @method :post
* @time :2023/5/9 13:44
*/
public function post_tiktok(){
}
}