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

[主線] [PTT] 實作發表文章 #83

Closed
wagaru opened this issue May 4, 2021 · 1 comment
Closed

[主線] [PTT] 實作發表文章 #83

wagaru opened this issue May 4, 2021 · 1 comment
Assignees
Labels
help wanted Extra attention is needed important

Comments

@wagaru
Copy link

wagaru commented May 4, 2021

實作細節 / Details of Implement

  • bbs.go 新增 WriteArticleConnector interface,此 interface 要實作以下二個函式
    • NewArticleRecord(args map[string]interface{}) (ArticleRecord, error)
    • AddArticleRecordFileRecord(name string, article ArticleRecord) error
  • 在 pttbbs 套件新增 pttbbs_write_article_connector.go
    • NewArticleRecord(args map[string]interface{}) (ArticleRecord, error)
      • 產生並建立 fileName,對應到 setbpathstampfile,命名規則可參考 stampfile 的 底層函式 ,並要確保檔名唯一性
      • 寫入文章內容,要一併寫入作者、看板、標題、時間。參考 syspost.c
      • 回傳 FileHeader struct,需設定 fileName、date、title、owner
    • AddArticleRecordFileRecord(name string, article ArticleRecord) error
      • 將 FileHeader 寫入 name 指定的路徑,注意要加上 file lock,參考append_record

待確認:setbtotal 要在哪邊呼叫

期程 / Schedule

  • 討論時間: [e.g. 一週, 到 5/12]
  • 實作時間: [e.g. 一週, 到 5/19]
  • 確認時間: [e.g. 一週, 到 5/26]

相關文件 / Documents
pttbbs 函式註解

@wagaru wagaru added help wanted Extra attention is needed important labels May 4, 2021
@nickyanggg
Copy link
Contributor

我可以試試這個~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed important
Projects
None yet
Development

No branches or pull requests

3 participants