Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var AdminRepository = newAdminRepository()
View Source
var ArticleRepository = newArticleRepository()
View Source
var CommentArchiveRepository = newCommentArchiveRepository()
View Source
var CommentRepository = newCommentRepository()
View Source
var LoginHistoryRepository = newLoginHistoryRepository()
View Source
var PaymentHistoryRepository = newPaymentHistoryRepository()
View Source
var RoleRepository = newRoleRepository()
View Source
var ScoreHistoryRepository = newScoreHistoryRepository()
Functions ¶
func NewUserTokenRepository ¶
func NewUserTokenRepository() *userTokenRepository
Types ¶
type UserRepository ¶
type UserRepository interface { Select(query Query) (user models.User, found bool) SelectMany(query Query, limit int) (results []models.User) InsertOrUpdate(db *gorm.DB, user *models.User) (err error) Delete(query Query, limit int) (deleted bool) FindByUserName(db *gorm.DB, username string) *models.User FindOne(db *gorm.DB, id int64) (user *models.User) }
UserRepository处理用户实体/模型的基本操作。 它是一个可测试的接口,即内存用户存储库或 连接到sql数据库。
func NewUserRepository ¶
func NewUserRepository() UserRepository
NewUserRepository返回一个新的基于mysql的存储库, 我们示例中唯一的存储库类型。
Click to show internal directories.
Click to hide internal directories.