提交 v1.3.0 beta

This commit is contained in:
dushixiang
2022-10-23 20:05:13 +08:00
parent 4ff4d37442
commit 112435199a
329 changed files with 18340 additions and 58458 deletions

View File

@ -0,0 +1,30 @@
package repository
import (
"context"
"next-terminal/server/model"
)
var UserRoleRefRepository = new(userRoleRefRepository)
type userRoleRefRepository struct {
baseRepository
}
func (r userRoleRefRepository) Create(c context.Context, m *model.UserRoleRef) error {
return r.GetDB(c).Create(m).Error
}
func (r userRoleRefRepository) DeleteByUserId(c context.Context, userId string) error {
return r.GetDB(c).Where("user_id = ?", userId).Delete(model.UserRoleRef{}).Error
}
func (r userRoleRefRepository) FindByUserId(c context.Context, userId string) (items []model.UserRoleRef, err error) {
err = r.GetDB(c).Where("user_id = ?", userId).Find(&items).Error
return
}
func (r userRoleRefRepository) DeleteByRoleId(c context.Context, roleId string) error {
return r.GetDB(c).Where("role_id = ?", roleId).Delete(model.UserRoleRef{}).Error
}