Skip to content
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

class: Topic 各種唔同提議 #3

Open
09milk opened this issue May 7, 2018 · 3 comments
Open

class: Topic 各種唔同提議 #3

09milk opened this issue May 7, 2018 · 3 comments
Labels
enhancement New feature or request

Comments

@09milk
Copy link

09milk commented May 7, 2018

export default class Topic {
constructor({
id,
forum,
category,
title,
createdDate,
authorId,
authorName,
lastReplyDate,
totalReplies,
like,
dislike,
totalPage,
} = {}) {

  • authorId: 會唔會係冇用嘅資料? 大部份topic list都只係display個author名就夠

  • category: 如果係user轉台先攞topic list, category會唔會次次攞都一樣?

  • id: 係就咁一個integer, 定係一個hash(forum, url)

  • authorGender: hkg/lihkg 手機version都有出topic果時出埋author係巴定絲

  • url: 我提議記錄埋topic指向嘅url, 因為user click入去果時應該會用到個url
    hkg - https://m.hkgolden.com/view.aspx?message=6887195&type=YY (YY係category, 係optional)
    lihkg - https://lihkg.com/thread/XXXXXX/page/1
    應該只係記低XXXXXX果part就夠

@ghost
Copy link

ghost commented May 7, 2018

authorId: Depends on where we will have a user info/detail display function. Keep for future updates.

category: Yes if got from list topics API. Useful as the API consumer no need to save the request parameter by themselves. Otherwise this information will be lost after the request. Also useful when getting by topic id. Keep.

id: whatever the backed API (lihkg or hkg) returns to identify this topic.

authorGender: Will add!

url: Already included all information in order to construct the url (id + category), no need to duplicate.

@09milk
Copy link
Author

09milk commented May 7, 2018

咁嘅話id就唔係unique (hkg/lihkg可以撞id), 對我地自己做記錄會唔會唔方便(回帶之類嘅function)

@ghost
Copy link

ghost commented May 7, 2018

  1. 暫時冇打算儲佢地啲文係自己DB, 可能有法律問題

  2. 所以仲有forum呢個key, forum + id就唔會撞(forum=[HKG, LIHKG])

  3. 應改名做topicId之類避免誤會

hk-ng added a commit that referenced this issue Jun 2, 2018
ghost pushed a commit that referenced this issue Jun 4, 2018
@edmondyip edmondyip added the enhancement New feature or request label Jun 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants