Ptt-official-app / Ptt-backend

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

修正錯誤 C6-1-1 #291

Closed karta0807913 closed 3 years ago

karta0807913 commented 3 years ago

👏 解決掉的 issue / Resolved Issues

⛏ 變更內容 / Details of Changes

需要討論的部份

修改後的結果

$ TZ='Asia/Taipei' go run . &
$ curl -s http://localhost:8081/v1/boards/test/articles -H "Authorization: bearer $ACCESS_TOKEN" -d 'action=add_article' --data-urlencode 'title=[測試] test0904' --data-urlencode 'article=12345你好 hihi'

回傳

{
  "data": {
    "parsed": {
      "author_id": "SYSOP",
      "author_name": "SYSOP",
      "board_name": "test",
      "is_header_modied": false,
      "post_time": "09/18",
      "sender_info": {},
      "signature": {},
      "text": {
        "text": "12345你好 hihi"
      },
      "title": "[測試] test0904"
    },
    "raw": "5L2c6ICFOiBTWVNPUCAo56WeKSDnnIvmnb86IHRlc3QK5qiZ6aGMOiBb5ris6KmmXSB0ZXN0MDkwNArmmYLplpM6IFNhdCBTZXAgMTggMTg6Mzc6NTQgMjAyMQoKCjEyMzQ15L2g5aW9IGhpaGkKCi0tCuKAuyDnmbzkv6Hnq5k6IOaWsOaJuei4oui4oihwdHQyLmNjKSwg5L6G6IeqOiAzNi4yMzAuMjE0LjIyNArigLsg5paH56ug57ay5Z2AOiBodHRwOi8vd3d3LnB0dC5jYy9iYnMvdGVzdC9NLjE2MzE5NjE0NzQuQS4yMjEuaHRtbAo="
  }
}

並使用 iconv 確認檔案內容

$ iconv -f BIG5 -t UTF-8 M.1631961474.A.221

輸出

作者: SYSOP (神) 看板: test
標題: [測試] test0904
時間: Sat Sep 18 18:37:54 2021

12345你好 hihi

--
※ 發信站: 新批踢踢(ptt2.cc), 來自: 36.230.214.224
※ 文章網址: http://www.ptt.cc/bbs/test/M.1631961474.A.221.html
codecov-commenter commented 3 years ago

Codecov Report

Merging #291 (7ccff38) into development (3e17e31) will decrease coverage by 0.73%. The diff coverage is 4.00%.

Impacted file tree graph

@@               Coverage Diff               @@
##           development     #291      +/-   ##
===============================================
- Coverage        44.04%   43.30%   -0.74%     
===============================================
  Files               29       29              
  Lines             1712     1741      +29     
===============================================
  Hits               754      754              
- Misses             848      877      +29     
  Partials           110      110              
Impacted Files Coverage Δ
internal/config/config.go 77.27% <ø> (ø)
internal/repository/article.go 0.00% <0.00%> (ø)
internal/delivery/http/route_create_article.go 48.38% <100.00%> (ø)
internal/delivery/http/route_append_comment.go 71.62% <0.00%> (-7.49%) :arrow_down:

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 3e17e31...7ccff38. Read the comment docs.

y2468101216 commented 3 years ago

LGTM