Ptt-official-app / Ptt-backend

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

修正使用者取得推文(未完成)跟錯誤訊息回傳 #227

Closed y2468101216 closed 3 years ago

y2468101216 commented 3 years ago

👏 解決掉的 issue / Resolved Issues

⛏ 變更內容 / Details of Changes

將 go-bbs 跟 ptt-backend 連結起來

codecov-commenter commented 3 years ago

Codecov Report

Merging #227 (96c2424) into development (7e301b4) will decrease coverage by 0.61%. The diff coverage is 0.00%.

Impacted file tree graph

@@               Coverage Diff               @@
##           development     #227      +/-   ##
===============================================
- Coverage        48.29%   47.67%   -0.62%     
===============================================
  Files               28       28              
  Lines             1404     1422      +18     
===============================================
  Hits               678      678              
- Misses             629      647      +18     
  Partials            97       97              
Impacted Files Coverage Δ
internal/delivery/http/route_users.go 44.07% <0.00%> (-5.10%) :arrow_down:
internal/repository/repository.go 0.00% <ø> (ø)
internal/repository/user.go 2.27% <0.00%> (+0.42%) :arrow_up:
internal/usecase/usecase.go 100.00% <ø> (ø)
internal/usecase/user.go 51.72% <ø> (ø)

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 7e301b4...96c2424. Read the comment docs.

y2468101216 commented 3 years ago

螢幕擷取畫面 2021-06-16 161514

PichuChen commented 3 years ago

LGTM

nickyanggg commented 3 years ago

這應該是修正 GET {{url}}/v1/users/{{user_id}}/comments

y2468101216 commented 3 years ago

我看了一下我是把文章修好了,但是推文沒修好,我正在研究

y2468101216 commented 3 years ago

看起來應該是不知道那次文章被修好了,推文部份我嘗試很久修不好,應該是要修 go-bbs 那邊實做的問題

nickyanggg commented 3 years ago

看起來應該是不知道那次文章被修好了,推文部份我嘗試很久修不好,應該是要修 go-bbs 那邊實做的問題

看起來是 route_users.go 中的 getUserComments 最後回傳要修改。因為 dataItems 的 type 為 []bbs.UserCommentRecord,所以需要的回傳資訊可能要用 bbs.UserCommentRecord 所提供的 method 來取得。

responseMap := map[string]interface{}{
    "data": map[string]interface{}{
        "items": dataItems,
    },
}