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

项目内 User 相关类命名冲突问题 #185

Open
colorful3 opened this issue Mar 4, 2021 · 1 comment
Open

项目内 User 相关类命名冲突问题 #185

colorful3 opened this issue Mar 4, 2021 · 1 comment
Assignees
Labels
处理中:construction: Issue 已确认,正在写代码……

Comments

@colorful3
Copy link
Member

colorful3 commented Mar 4, 2021

我们内置的管理员用户表为 lin_user,对应的模型层命名为 UserDO、服务层命名为UserService、控制器层命名为UserController
当我们开发一个独立的 CMS 项目,是没有什么命名冲突问题的。
但对于一个小型项目,我们想使用 LinCMS 快速开发 C 端用户接口,如果 C 端用户表名称为 user ,那么对应的模型层、服务层等等就不能使用UserDOUserService这些来命名,可否考虑把lin内置的类命名加一个前缀做区分?(例如LinUserDOLinUserService)。这样C端用户相关的类,就不用考虑命名冲突问题了。也不会因为系统中user相关的命名太多,对后续的维护者造成困惑。

@colorful3 colorful3 self-assigned this Mar 5, 2021
@colorful3 colorful3 added the 处理中:construction: Issue 已确认,正在写代码…… label Mar 9, 2021
@pedrogao
Copy link
Collaborator

CMS 真正面对的用户,确实是目前项目中内置的 User,如果将其改名为 LinUser,未免不太合理,因为 CMS 一般而言就一类用户,如果需要将 H5 端的用户也加入到项目中来,那么新加的用户类,是否可以尝试自加前缀,比如H5User
对于 CMS 来说,它的用户应该是管理员,这类用户目前已经内置,但是对于其它类型的用户,本不应该在此项目中,为了方便区分和维护,自己尝试加上其它前缀,岂不更好~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
处理中:construction: Issue 已确认,正在写代码……
Projects
None yet
Development

No branches or pull requests

2 participants