1 Star 0 Fork 0

庞飞/multiapp

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
UserRepository.go 637 Bytes
一键复制 编辑 原始数据 按行查看 历史
庞飞 提交于 2023-10-08 10:22 +08:00 . 调整
package repositories
import (
"gitee.com/pangxianfei/multiapp/sysmodel"
"gorm.io/gorm"
)
var UserRepository = new(userRepository)
type userRepository struct {
}
func (r *userRepository) Take(db *gorm.DB, where ...interface{}) *sysmodel.PlatformAdmin {
ret := &sysmodel.PlatformAdmin{}
if err := db.Debug().Take(ret, where...).Error; err != nil {
return nil
}
return ret
}
func (r *userRepository) GetByMobile(db *gorm.DB, mobile string) *sysmodel.PlatformAdmin {
return r.Take(db, "mobile = ?", mobile)
}
func (r *userRepository) GetById(db *gorm.DB, id int64) *sysmodel.PlatformAdmin {
return r.Take(db, "id = ?", id)
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/pangxianfei/multiapp.git
git@gitee.com:pangxianfei/multiapp.git
pangxianfei
multiapp
multiapp
v1.2.3

搜索帮助