|
@@ -9,6 +9,7 @@ use App\Http\Controllers\Bside\FileController; |
|
@@ -9,6 +9,7 @@ use App\Http\Controllers\Bside\FileController; |
|
9
|
use App\Http\Controllers\File\ImageController;
|
9
|
use App\Http\Controllers\File\ImageController;
|
|
10
|
use App\Http\Logic\Bside\AyrShare\AyrReleaseLogic;
|
10
|
use App\Http\Logic\Bside\AyrShare\AyrReleaseLogic;
|
|
11
|
use App\Http\Logic\Bside\AyrShare\AyrShareLogic;
|
11
|
use App\Http\Logic\Bside\AyrShare\AyrShareLogic;
|
|
|
|
12
|
+use App\Http\Requests\Bside\AyrRelease\AyrReleaseRequest;
|
|
12
|
use App\Models\File\Image;
|
13
|
use App\Models\File\Image;
|
|
13
|
use App\Models\File\Image as ImageModel;
|
14
|
use App\Models\File\Image as ImageModel;
|
|
14
|
|
15
|
|
|
@@ -43,6 +44,11 @@ class AyrReleaseController extends BaseController |
|
@@ -43,6 +44,11 @@ class AyrReleaseController extends BaseController |
|
43
|
* @time :2023/5/9 16:00
|
44
|
* @time :2023/5/9 16:00
|
|
44
|
*/
|
45
|
*/
|
|
45
|
public function share_info(AyrShareLogic $ayrShareLogic){
|
46
|
public function share_info(AyrShareLogic $ayrShareLogic){
|
|
|
|
47
|
+ $this->request->validate([
|
|
|
|
48
|
+ 'share_id'=>['required']
|
|
|
|
49
|
+ ],[
|
|
|
|
50
|
+ 'share_id.required' => 'SHARE_ID不能为空'
|
|
|
|
51
|
+ ]);
|
|
46
|
$info = $ayrShareLogic->ayr_share_info();
|
52
|
$info = $ayrShareLogic->ayr_share_info();
|
|
47
|
$this->response('success',Code::SUCCESS,$info);
|
53
|
$this->response('success',Code::SUCCESS,$info);
|
|
48
|
}
|
54
|
}
|
|
@@ -52,7 +58,9 @@ class AyrReleaseController extends BaseController |
|
@@ -52,7 +58,9 @@ class AyrReleaseController extends BaseController |
|
52
|
* @method :post
|
58
|
* @method :post
|
|
53
|
* @time :2023/5/9 9:36
|
59
|
* @time :2023/5/9 9:36
|
|
54
|
*/
|
60
|
*/
|
|
55
|
- public function send_post(AyrReleaseLogic $ayrReleaseLogic,AyrShareLogic $ayrShareLogic,AyrShareHelper $ayrShare){
|
61
|
+ public function send_post(AyrReleaseRequest $ayrReleaseRequest,AyrReleaseLogic $ayrReleaseLogic,
|
|
|
|
62
|
+ AyrShareLogic $ayrShareLogic,AyrShareHelper $ayrShare){
|
|
|
|
63
|
+ $ayrReleaseRequest->validated();
|
|
56
|
//获取发送账号详情
|
64
|
//获取发送账号详情
|
|
57
|
$share_info = $ayrShareLogic->ayr_share_info();
|
65
|
$share_info = $ayrShareLogic->ayr_share_info();
|
|
58
|
$data = [
|
66
|
$data = [
|
|
@@ -82,6 +90,13 @@ class AyrReleaseController extends BaseController |
|
@@ -82,6 +90,13 @@ class AyrReleaseController extends BaseController |
|
82
|
* @time :2023/5/10 14:07
|
90
|
* @time :2023/5/10 14:07
|
|
83
|
*/
|
91
|
*/
|
|
84
|
public function send_media(AyrShareLogic $ayrShareLogic,AyrShareHelper $ayrShare){
|
92
|
public function send_media(AyrShareLogic $ayrShareLogic,AyrShareHelper $ayrShare){
|
|
|
|
93
|
+ $this->request->validate([
|
|
|
|
94
|
+ 'share_id'=>['required'],
|
|
|
|
95
|
+ 'hash'=>['required']
|
|
|
|
96
|
+ ],[
|
|
|
|
97
|
+ 'share_id.required' => 'SHARE_ID不能为空',
|
|
|
|
98
|
+ 'hash.required' => 'HASH不能为空'
|
|
|
|
99
|
+ ]);
|
|
85
|
$image_info = $ayrShareLogic->save_img_info($this->param['hash']);
|
100
|
$image_info = $ayrShareLogic->save_img_info($this->param['hash']);
|
|
86
|
if(empty($image_info['ayr_id'])){
|
101
|
if(empty($image_info['ayr_id'])){
|
|
87
|
//获取发送账号详情
|
102
|
//获取发送账号详情
|
|
@@ -104,15 +119,20 @@ class AyrReleaseController extends BaseController |
|
@@ -104,15 +119,20 @@ class AyrReleaseController extends BaseController |
|
104
|
* @time :2023/5/10 14:07
|
119
|
* @time :2023/5/10 14:07
|
|
105
|
*/
|
120
|
*/
|
|
106
|
public function send_media_file(AyrShareLogic $ayrShareLogic,AyrShareHelper $ayrShare){
|
121
|
public function send_media_file(AyrShareLogic $ayrShareLogic,AyrShareHelper $ayrShare){
|
|
|
|
122
|
+ $this->request->validate([
|
|
|
|
123
|
+ 'share_id'=>['required'],
|
|
|
|
124
|
+ 'hash'=>['required']
|
|
|
|
125
|
+ ],[
|
|
|
|
126
|
+ 'share_id.required' => 'SHARE_ID不能为空',
|
|
|
|
127
|
+ 'hash.required' => 'HASH不能为空'
|
|
|
|
128
|
+ ]);
|
|
107
|
$image_info = $ayrShareLogic->save_file_info($this->param['hash']);
|
129
|
$image_info = $ayrShareLogic->save_file_info($this->param['hash']);
|
|
108
|
if(empty($image_info['ayr_id'])){
|
130
|
if(empty($image_info['ayr_id'])){
|
|
109
|
//获取发送账号详情
|
131
|
//获取发送账号详情
|
|
110
|
$share_info = $ayrShareLogic->ayr_share_info();
|
132
|
$share_info = $ayrShareLogic->ayr_share_info();
|
|
111
|
- //获取当前图片数据是否已上传到第三方
|
|
|
|
112
|
- $arr = (new FileController())->index($this->param['hash']);
|
|
|
|
113
|
//向第三方存储图片
|
133
|
//向第三方存储图片
|
|
114
|
$param = [
|
134
|
$param = [
|
|
115
|
- 'file'=>($arr->original),//base64编码
|
135
|
+ 'file'=>$ayrShareLogic->base_img_content($this->param['hash']),//base64编码
|
|
116
|
];
|
136
|
];
|
|
117
|
$param_data = $ayrShare->post_media_upload($param,$share_info['profile_key']);
|
137
|
$param_data = $ayrShare->post_media_upload($param,$share_info['profile_key']);
|
|
118
|
//更新图片库
|
138
|
//更新图片库
|