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

feat: complete notice module #154

Merged
merged 5 commits into from
Jan 14, 2025
Merged

Conversation

SchwarzSail
Copy link
Member

自查 PR 结构

  • PR 标题符合这个格式: <type>(optional scope): <description>

  • 此 PR 标题的描述以用户为导向,足够清晰,其他人可以理解。

  • 我已经对所有 commit 提供了签名(GPG 密钥签名、SSH 密钥签名)

  • 这个 PR 属于强制变更/破坏性更改

如果是,请在 PR 标题中添加 BREAKING CHANGE 前缀,并在 PR 描述中详细说明。

这个 PR 的类型是什么?

这个 PR 做了什么 / 我们为什么需要这个 PR?

  • 在本地进行了数据库和 apifox 的测试,都能正常跑通

(可选)这个 PR 解决了哪个/些 issue?

according to #149

对 Reviewer 预留的一些提醒

Copy link

codecov bot commented Jan 11, 2025

Codecov Report

Attention: Patch coverage is 0.14045% with 1422 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
kitex_gen/common/common.go 0.00% 779 Missing ⚠️
kitex_gen/common/k-common.go 0.00% 443 Missing ⚠️
internal/common/syncer/workqueue.go 0.00% 41 Missing ⚠️
internal/common/syncer/update.go 0.00% 24 Missing ⚠️
internal/common/syncer/init.go 0.00% 23 Missing ⚠️
kitex_gen/common/commonservice/commonservice.go 4.54% 21 Missing ⚠️
api/handler/api/common_service.go 0.00% 17 Missing ⚠️
internal/common/handler.go 0.00% 11 Missing ⚠️
api/rpc/common.go 0.00% 10 Missing ⚠️
internal/common/service/get_notice.go 0.00% 10 Missing ⚠️
... and 9 more
@@           Coverage Diff            @@
##            main    #154      +/-   ##
========================================
- Coverage   3.25%   3.16%   -0.10%     
========================================
  Files        192     200       +8     
  Lines      40016   41205    +1189     
========================================
+ Hits        1303    1304       +1     
- Misses     38646   39834    +1188     
  Partials      67      67              
Flag Coverage Δ
unittest 3.16% <0.14%> (-0.10%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
internal/common/service/service.go 100.00% <100.00%> (ø)
kitex_gen/common/commonservice/server.go 0.00% <ø> (ø)
api/router/api/api.go 0.00% <0.00%> (ø)
pkg/db/db.go 0.00% <0.00%> (ø)
api/router/api/middleware.go 0.00% <0.00%> (ø)
kitex_gen/common/commonservice/client.go 0.00% <0.00%> (ø)
cmd/common/main.go 0.00% <0.00%> (ø)
pkg/db/notice/notice.go 0.00% <0.00%> (ø)
pkg/db/notice/get_notice.go 0.00% <0.00%> (ø)
pkg/db/notice/create_notice.go 0.00% <0.00%> (ø)
... and 11 more

@ozline
Copy link
Member

ozline commented Jan 11, 2025

分配 @jiuxia211 Review

db "github.com/west2-online/fzuhelper-server/pkg/db/model"
)

func BuildNoticeList(notices *[]db.Notice) []*model.NoticeInfo {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

为啥是*[]db.Notice 而不是 []*db.Notice

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

有什么区别吗()

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我之前都是习惯用 []* 的,咱项目也基本都这么用,你这么一问我发现我也不是很清楚原因

Copy link
Contributor

@jiuxia211 jiuxia211 Jan 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

因为本身就是引用类型,自带指向底层数组的指针,我认为像我们项目这样将数据层层传递再包装,不涉及切片的扩容,用*[]需要多解引用一次,肯定是浪费

@jiuxia211 jiuxia211 merged commit 23f7ab9 into west2-online:main Jan 14, 2025
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants