-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Xfmg/init #104
base: xenforo2
Are you sure you want to change the base?
Xfmg/init #104
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Điều chỉnh lại api route / params theo XF1 luôn nha https://repo.tinhte.vn/appforo/ApiGallery/tree/master/library/Appforo/ApiGallery/ControllerApi
return $attachment; | ||
} | ||
|
||
public function doUploadAndRespond($hash, $contentType, $context, $formField = 'file') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tại sao cần implement cái này nhỉ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dạ bên POST /media
lưu file thành attachment nhưng không respond cái attachment nên em tách ra cái function doUpload
riêng
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
À hiểu rồi. Thôi như đã bàn thì cứ để nó upload riêng và save riêng nha.
} | ||
|
||
$params = $this->params() | ||
->define('category_id', 'int', '', -1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mấy cái params cho thêm description đi chế.
Implemented a working version of XFMG APIs which includes fundamental functionalities.
Implemented actions:
Album:
Media:
Comment:
Missing important actions:
Album:
Media:
Comment:
Concerns:
post_date
of posts are mapped topost_create_date
in API response data, whilecomment_date
of xfmg comments are mapped tocomment_date
. I'm not exactly sure what is our mapping convention, and whether XFMG APIs have to follow that convention.POST /media
uses afile
param to create an attachment record directly for the new media, while normally a separatePOST /attachments
call is required. Although this is not similar to other APIs, I implemented this way because a media item always has exactly 1 attachment, and it will be much more convenient to create a media item via API this way