Ptt-official-app / Ptt-backend

PTT APP 的後端
BSD 3-Clause "New" or "Revised" License
208 stars 67 forks source link

實作發文 repo #199

Closed DeanXu2357 closed 3 years ago

DeanXu2357 commented 3 years ago

👏 解決掉的 issue / Resolved Issues

📝 相關的 issue / Related Issues

⛏ 變更內容 / Details of Changes

codecov-commenter commented 3 years ago

Codecov Report

Merging #199 (5f8d583) into development (0613269) will decrease coverage by 1.02%. The diff coverage is 73.78%.

Impacted file tree graph

@@               Coverage Diff               @@
##           development     #199      +/-   ##
===============================================
- Coverage        45.91%   44.89%   -1.03%     
===============================================
  Files               25       25              
  Lines             1309     1321      +12     
===============================================
- Hits               601      593       -8     
- Misses             622      641      +19     
- Partials            86       87       +1     
Impacted Files Coverage Δ
internal/repository/article.go 0.00% <0.00%> (ø)
internal/repository/board.go 0.00% <0.00%> (ø)
internal/repository/repository.go 0.00% <ø> (ø)
internal/usecase/article.go 40.74% <0.00%> (-11.65%) :arrow_down:
internal/usecase/token.go 0.00% <0.00%> (ø)
internal/delivery/http/route_boards_articles.go 50.81% <37.50%> (-0.75%) :arrow_down:
internal/delivery/http/route_boards.go 56.00% <60.00%> (-0.58%) :arrow_down:
internal/delivery/http/route_append_comment.go 74.07% <100.00%> (-0.48%) :arrow_down:
internal/delivery/http/route_boards_treasures.go 57.14% <100.00%> (-1.48%) :arrow_down:
internal/delivery/http/route_create_article.go 67.44% <100.00%> (-0.74%) :arrow_down:
... and 6 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 0613269...5f8d583. Read the comment docs.

PichuChen commented 3 years ago

這個 PR 不應該關閉 #68

PichuChen commented 3 years ago

checkPermission 是否要新增 context 應該要在其他 ISSUE 做討論

DeanXu2357 commented 3 years ago

checkPermission 是否要新增 context 應該要在其他 ISSUE 做討論

OK,這個我之後還原他

這邊會忽然加這個,只是因為在做判斷的時候 repo 需要 ctx 參數,看其他的 usecase 好像都是一路從 handler 拿下來的,只有這邊的 context 是在 usecase 中生成。看這樣斷掉好像很怪,以為是忘了加。

PichuChen commented 3 years ago

你好像加錯位置了...

TODO 是要加在 repository 的 CreateArticle 裡面的,這樣才知道要從這邊去串接資料庫(go-bbs) 實際上的發文函式,否則不加的話應該沒辦法順利把文章寫進資料庫裡?