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

sniper中dao的model和proto自动生成的model如何映射? #13

Closed
flazx opened this issue Oct 7, 2019 · 3 comments
Closed

sniper中dao的model和proto自动生成的model如何映射? #13

flazx opened this issue Oct 7, 2019 · 3 comments

Comments

@flazx
Copy link

flazx commented Oct 7, 2019

在使用过程中,发觉model不太好处理,我准备用的是http://gorm.io。目前方案有两种:

  1. 在dao中创建orm的model,然后和pb生成model做mapping,可以采用自动生成的orm model
  2. 直接采用pb生成model,但需要做protoc的custom tag 。
    请问你们在实践过程中是怎么处理的?
@taoso
Copy link
Member

taoso commented Oct 10, 2019

这个事情我已经作过说明,简单说就是不推荐使用 ORM。我所在的部门在实践中也没有使用 ORM。DAO 层是数据访问层,这里不光是访问 DB,访问缓存、调用其他接口等逻辑都应该放到这一层。这一层我们都是手写的。

@flazx
Copy link
Author

flazx commented Oct 10, 2019

十分感谢回复!

@flazx
Copy link
Author

flazx commented Oct 10, 2019

日后我们使用一下,有问题再咨询您!

@flazx flazx closed this as completed Oct 10, 2019
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

No branches or pull requests

2 participants