提交 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,29 @@
package repository
import (
"context"
"next-terminal/server/model"
)
var RoleMenuRefRepository = &roleMenuRefRepository{}
type roleMenuRefRepository struct {
baseRepository
}
func (r roleMenuRefRepository) CreateInBatches(ctx context.Context, items []*model.RoleMenuRef) error {
return r.GetDB(ctx).CreateInBatches(items, 100).Error
}
func (r roleMenuRefRepository) FindByRoleId(ctx context.Context, roleId string) (items []model.RoleMenuRef, err error) {
err = r.GetDB(ctx).Where("role_id = ?", roleId).Find(&items).Error
return
}
func (r roleMenuRefRepository) DeleteByRoleId(ctx context.Context, roleId string) error {
return r.GetDB(ctx).Where("role_id = ?", roleId).Delete(&model.RoleMenuRef{}).Error
}
func (r roleMenuRefRepository) DeleteByIdIn(ctx context.Context, array []string) error {
return r.GetDB(ctx).Where("id in ?", array).Delete(&model.RoleMenuRef{}).Error
}