Skip to content

Conversation

@datbth
Copy link
Contributor

@datbth datbth commented Dec 9, 2018

Implemented a working version of XFMG APIs which includes fundamental functionalities.

Implemented actions:

Album:

  • List
  • Show
  • Create
  • Edit
  • Delete
  • Watch (Follow)
  • Like

Media:

  • List
  • Show
  • Create
  • Edit
  • Delete
  • Watch
  • Like

Comment:

  • List
  • Add
  • Edit
  • Delete
  • Like

Missing important actions:

Album:

  • Approve
  • Report

Media:

  • Move
  • Edit Image
  • Change Thumbnail
  • Edit tags
  • Approve
  • Report

Comment:

  • Report

Concerns:

  • API response keys do not look like those of other APIs such as /posts, /threads. For example, post_date of posts are mapped to post_create_date in API response data, while comment_date of xfmg comments are mapped to comment_date. I'm not exactly sure what is our mapping convention, and whether XFMG APIs have to follow that convention.
  • Entity visibility is not properly handled in index actions yet. I.e. they are returning unapproved, ignored, deleted, etc. items. But this will be resolved during the process of implementing 'approve' actions
  • Media creation action POST /media uses a file param to create an attachment record directly for the new media, while normally a separate POST /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

@daohoangson daohoangson self-assigned this Dec 9, 2018
Copy link
Contributor

@daohoangson daohoangson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return $attachment;
}

public function doUploadAndRespond($hash, $contentType, $context, $formField = 'file')
Copy link
Contributor

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ỉ?

Copy link
Contributor Author

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

Copy link
Contributor

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)
Copy link
Contributor

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ế.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants