| xqd
@@ -48,7 +48,7 @@ class AttachmentController extends Controller
|
|
|
* @apiPermission none
|
|
|
* @apiVersion 0.1.0
|
|
|
* @apiParam {string} tag 附件标签 avatar video dream
|
|
|
- * @apiParam {File} file 附件(可以多个,使用file.xxx,可返回多个)[默认大小2M, 类型图片]
|
|
|
+ * @apiParam {File} file 附件(可以多个,使用file.xxx,可返回多个)[默认大小【10M】, 类型图片png jpg gif,视频类型mp4]
|
|
|
* @apiSuccessExample {json} Success-Response:
|
|
|
* HTTP/1.1 200 OK
|
|
|
* {
|
| xqd
@@ -56,8 +56,7 @@ class AttachmentController extends Controller
|
|
|
* "code": 0,
|
|
|
* "message": "",
|
|
|
* "data": [
|
|
|
- * "file_123": "http://localhost/web/attachment/f72e7dad80f597ed6621a009e82243ad",
|
|
|
- * "file_456": "http://localhost/web/attachment/215a5f8307a015ecc35c80cb04d8590f"
|
|
|
+ * "file": "http://localhost/web/attachment/f72e7dad80f597ed6621a009e82243ad",
|
|
|
* ]
|
|
|
* }
|
|
|
* @apiErrorExample {json} Error-Response:
|
| xqd
@@ -100,10 +99,11 @@ class AttachmentController extends Controller
|
|
|
return $this->error(ErrorCode::CLIENT_WRONG_PARAMS, '', $validator->messages());
|
|
|
}
|
|
|
|
|
|
- $result = $this->uploadAttachment($request, $request->get('file'), $request->get('tag'), 4 * 1024 * 1024, [
|
|
|
+ $result = $this->uploadAttachment($request, $request->get('file'), $request->get('tag'), 10 * 1024 * 1024, [
|
|
|
'image/jpeg',
|
|
|
'image/png',
|
|
|
'image/gif',
|
|
|
+ 'video/mp4',
|
|
|
]);
|
|
|
if (is_array($result)) {
|
|
|
return $this->api($result);
|