|
...
|
...
|
@@ -9,6 +9,7 @@ use App\Http\Controllers\Bside\FileController; |
|
|
|
use App\Http\Controllers\File\ImageController;
|
|
|
|
use App\Http\Logic\Bside\AyrShare\AyrReleaseLogic;
|
|
|
|
use App\Http\Logic\Bside\AyrShare\AyrShareLogic;
|
|
|
|
use App\Http\Requests\Bside\AyrRelease\AyrReleaseRequest;
|
|
|
|
use App\Models\File\Image;
|
|
|
|
use App\Models\File\Image as ImageModel;
|
|
|
|
|
|
...
|
...
|
@@ -43,6 +44,11 @@ class AyrReleaseController extends BaseController |
|
|
|
* @time :2023/5/9 16:00
|
|
|
|
*/
|
|
|
|
public function share_info(AyrShareLogic $ayrShareLogic){
|
|
|
|
$this->request->validate([
|
|
|
|
'share_id'=>['required']
|
|
|
|
],[
|
|
|
|
'share_id.required' => 'SHARE_ID不能为空'
|
|
|
|
]);
|
|
|
|
$info = $ayrShareLogic->ayr_share_info();
|
|
|
|
$this->response('success',Code::SUCCESS,$info);
|
|
|
|
}
|
|
...
|
...
|
@@ -52,7 +58,9 @@ class AyrReleaseController extends BaseController |
|
|
|
* @method :post
|
|
|
|
* @time :2023/5/9 9:36
|
|
|
|
*/
|
|
|
|
public function send_post(AyrReleaseLogic $ayrReleaseLogic,AyrShareLogic $ayrShareLogic,AyrShareHelper $ayrShare){
|
|
|
|
public function send_post(AyrReleaseRequest $ayrReleaseRequest,AyrReleaseLogic $ayrReleaseLogic,
|
|
|
|
AyrShareLogic $ayrShareLogic,AyrShareHelper $ayrShare){
|
|
|
|
$ayrReleaseRequest->validated();
|
|
|
|
//获取发送账号详情
|
|
|
|
$share_info = $ayrShareLogic->ayr_share_info();
|
|
|
|
$data = [
|
|
...
|
...
|
@@ -82,6 +90,13 @@ class AyrReleaseController extends BaseController |
|
|
|
* @time :2023/5/10 14:07
|
|
|
|
*/
|
|
|
|
public function send_media(AyrShareLogic $ayrShareLogic,AyrShareHelper $ayrShare){
|
|
|
|
$this->request->validate([
|
|
|
|
'share_id'=>['required'],
|
|
|
|
'hash'=>['required']
|
|
|
|
],[
|
|
|
|
'share_id.required' => 'SHARE_ID不能为空',
|
|
|
|
'hash.required' => 'HASH不能为空'
|
|
|
|
]);
|
|
|
|
$image_info = $ayrShareLogic->save_img_info($this->param['hash']);
|
|
|
|
if(empty($image_info['ayr_id'])){
|
|
|
|
//获取发送账号详情
|
|
...
|
...
|
@@ -104,15 +119,20 @@ class AyrReleaseController extends BaseController |
|
|
|
* @time :2023/5/10 14:07
|
|
|
|
*/
|
|
|
|
public function send_media_file(AyrShareLogic $ayrShareLogic,AyrShareHelper $ayrShare){
|
|
|
|
$this->request->validate([
|
|
|
|
'share_id'=>['required'],
|
|
|
|
'hash'=>['required']
|
|
|
|
],[
|
|
|
|
'share_id.required' => 'SHARE_ID不能为空',
|
|
|
|
'hash.required' => 'HASH不能为空'
|
|
|
|
]);
|
|
|
|
$image_info = $ayrShareLogic->save_file_info($this->param['hash']);
|
|
|
|
if(empty($image_info['ayr_id'])){
|
|
|
|
//获取发送账号详情
|
|
|
|
$share_info = $ayrShareLogic->ayr_share_info();
|
|
|
|
//获取当前图片数据是否已上传到第三方
|
|
|
|
$arr = (new FileController())->index($this->param['hash']);
|
|
|
|
//向第三方存储图片
|
|
|
|
$param = [
|
|
|
|
'file'=>($arr->original),//base64编码
|
|
|
|
'file'=>$ayrShareLogic->base_img_content($this->param['hash']),//base64编码
|
|
|
|
];
|
|
|
|
$param_data = $ayrShare->post_media_upload($param,$share_info['profile_key']);
|
|
|
|
//更新图片库
|
...
|
...
|
|