Skip to content

多文件: 菜单parentId由string改成uint #1702

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

Merged

Conversation

crazyrunsnail
Copy link
Contributor

@crazyrunsnail crazyrunsnail commented Apr 11, 2024

解决 #1700

将ParentId 声明由 string 改成是 uint
理由:

  1. 数据库的类似是bigint但代码中是string, 数据库可能运行但不能走索引(如果有)
  2. 在代码中map使用uint做key更省内存和更快,可参考 https://stackoverflow.com/questions/72237864/string-vs-integer-as-map-key-for-memory-utilization-in-golang

缺点:

  1. 不能向前兼容
  2. 涉及修改文件多

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.

2 participants