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

彻底的【代码重构】和【SQL数据库结构重构】 #20

Closed
thuhole opened this issue Jun 21, 2020 · 8 comments
Closed

彻底的【代码重构】和【SQL数据库结构重构】 #20

thuhole opened this issue Jun 21, 2020 · 8 comments
Labels
enhancement New feature or request help wanted Extra attention is needed 长期计划
Milestone

Comments

@thuhole
Copy link
Collaborator

thuhole commented Jun 21, 2020

由于第一次发布的版本为敏捷开发方式,SQL数据表有许多地方设计欠妥,代码更是丑陋不堪,仅仅是勉强满足了用户需求。

待树洞管理完善后,计划于2020年7月底之前彻底重构代码和数据库,选择某一天的树洞低峰时段(凌晨5点)进行彻底的系统升级。

此帖用于落实重构细节,欢迎所有人来讨论!

@thuhole thuhole added the enhancement New feature or request label Jun 21, 2020
@thuhole thuhole added this to the Version 2 milestone Jun 21, 2020
@thuhole
Copy link
Collaborator Author

thuhole commented Jun 21, 2020

预计MySQL db大致分为以下几个Table:

  • verification_codes
  • user_info
  • admin_info
  • posts
  • comments
  • reports
  • attentions
  • banned_users

具体的Column有待设计。

@thuhole thuhole added the help wanted Extra attention is needed label Jun 21, 2020
@thuhole thuhole pinned this issue Jun 21, 2020
@yzs981130
Copy link
Contributor

golang code部分,目前的unit test的结构是有问题的,建议变成

- src
  - utils
    - utils.go
    - utils_test.go
  - config
    - config.go
    - config_test.go
...

不需要test的模块不加test即可,最终可参考类似 https://github.com/kubernetes-sigs/kube-batch/tree/master/pkg/scheduler
类似这种 https://github.com/yzs981130/thuhole-go-backend/tree/fix-email_validation/src 才可在相应目录下做go test,这里只会做utils_test.go里的test

@thuhole
Copy link
Collaborator Author

thuhole commented Jun 22, 2020

功能列表:

  • 发送验证码
  • 登录
  • 验证token
  • 发送树洞
    • 文字
    • 图片
  • 发送评论
  • 获取第p页全部树洞
  • 获取#pid树洞
  • 获取关注的全部树洞
  • 关注和取消关注树洞
  • 搜索树洞
  • 举报树洞

可能添加的功能:

  • 热榜
  • 主题分类
  • 禁言消息提示
  • 消息推送(可能困难)

@thuhole
Copy link
Collaborator Author

thuhole commented Jun 22, 2020

golang code部分,目前的unit test的结构是有问题的,建议变成

- src
  - utils
    - utils.go
    - utils_test.go
  - config
    - config.go
    - config_test.go
...

不需要test的模块不加test即可,最终可参考类似 https://github.com/kubernetes-sigs/kube-batch/tree/master/pkg/scheduler
类似这种 https://github.com/yzs981130/thuhole-go-backend/tree/fix-email_validation/src 才可在相应目录下做go test,这里只会做utils_test.go里的test

采纳。

@yzs981130
Copy link
Contributor

golang code部分,目前的unit test的结构是有问题的,建议变成

- src
  - utils
    - utils.go
    - utils_test.go
  - config
    - config.go
    - config_test.go
...

不需要test的模块不加test即可,最终可参考类似 https://github.com/kubernetes-sigs/kube-batch/tree/master/pkg/scheduler
类似这种 https://github.com/yzs981130/thuhole-go-backend/tree/fix-email_validation/src 才可在相应目录下做go test,这里只会做utils_test.go里的test

采纳。

我可以今晚或者明天在现在的master基础上做一下各个模块分离的代码重构,不知道attention表重构是否已经完成?可以商量一个方便的时间,我提一个模块代码结构分离+test+CI的pr,希望pr前后master尽量freeze即可

@thuhole
Copy link
Collaborator Author

thuhole commented Jun 25, 2020

@yzs981130 attention表已经重构完了。
非常感谢您!!!!要不邮件联系?

@thuhole
Copy link
Collaborator Author

thuhole commented Jun 25, 2020

@yzs981130 今晚吧?

@yzs981130
Copy link
Contributor

@yzs981130 attention表已经重构完了。
非常感谢您!!!!要不邮件联系?

邮件联系没问题。 单开了issue #38

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed 长期计划
Projects
None yet
Development

No branches or pull requests

2 participants