repositories

package
v1.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 7, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdminLogRepository

type AdminLogRepository struct {
	BaseRepository
}

AdminLogRepository 管理员日志表仓储层

func AdminLog

func AdminLog(tx ...*gorm.DB) *AdminLogRepository

AdminLog 实例化管理员日志表仓储层 @param *gorm.DB tx 事务 @return AdminRepository 返回管理员日志表仓储层

type AdminRepository

type AdminRepository struct {
	BaseRepository
}

AdminRepository 管理员表仓储层

func Admin

func Admin(tx ...*gorm.DB) *AdminRepository

Admin 实例化管理员表仓储层 @param *gorm.DB tx 事务 @return AdminRepository 返回管理员表仓储层

func (AdminRepository) GetAdminInfo

func (base AdminRepository) GetAdminInfo(attributes interface{}) (admin *models.Admin)

GetAdminInfo 获取管理员信息 @param interface{} attributes 管理员id或者管理员user @return admin 返回当前管理员的信息

type AdminRoleRepository

type AdminRoleRepository struct {
	BaseRepository
}

AdminRoleRepository 管理员角色中间表仓储层

func AdminRole

func AdminRole(tx ...*gorm.DB) *AdminRoleRepository

AdminRole 实例化管理员角色中间表仓储层 @param *gorm.DB tx 事务 @return AdminRoleRepository 返回管理员角色中间表仓储层

func (AdminRoleRepository) DeleteByAdminId

func (base AdminRoleRepository) DeleteByAdminId(id uint) error

DeleteByAdminId 根据管理员ID删除角色 @param uint id 管理员ID @return error 返回一个错误信息

func (AdminRoleRepository) GetRoles

func (base AdminRoleRepository) GetRoles(adminId uint, fields []string) (data []map[string]interface{}, err error)

GetRoles 获取管理员管理角色 @param uint adminId 管理员ID @param []string fields 查询指定字段 @return data 返回角色数据

type BaseRepository

type BaseRepository struct {
	Model interface{}
	Db    *gorm.DB
}

BaseRepository 公共仓储层

func (*BaseRepository) Create

func (base *BaseRepository) Create(data []map[string]interface{}) error

Create 批量新增 @param []map[string]interface{} data 待添加切片数据 @return err 错误信息

func (*BaseRepository) Delete

func (base *BaseRepository) Delete(ids []uint) error

Delete 删除 @param []uint ids 主键ID @return error 错误信息

func (*BaseRepository) Find

func (base *BaseRepository) Find(condition map[string]interface{}, fields ...[]string) (info map[string]interface{}, err error)

Find 根据查询条件获取详情 @param map[string]interface{} condition 查询条件 @param []string fields 查询指定字段 @return data err 详情数据,错误信息

func (*BaseRepository) GetAllData

func (base *BaseRepository) GetAllData(fields []string) (data []map[string]interface{}, err error)

GetAllData 获取全部数据 @param []string fields 查询指定字段 @return list err 返回列表,错误信息

func (*BaseRepository) Insert

func (base *BaseRepository) Insert(data map[string]interface{}) (toMap map[string]interface{}, err error)

Insert 新增 @param map[string]interface{} data 待添加数据 @return toMap err 新增的数据,错误信息

func (*BaseRepository) IsExist

func (base *BaseRepository) IsExist(condition map[string]interface{}) bool

IsExist 查询数据是否存在 @param map[string]interface{} condition 查询条件 @return bool 返回一个bool值

func (*BaseRepository) List

func (base *BaseRepository) List(query string, fields []string, order string, pageInfo ...map[string]interface{}) (data map[string]interface{}, err error)

List 获取列表数据 @param string query 查询条件 @param []string fields 查询指定字段 @param string order 排序条件 @param map[string]interface{} pageInfo 列表分页和关键词数据 @return list total pageNum err 返回列表,总条数,总页码数,错误信息

func (*BaseRepository) Update

func (base *BaseRepository) Update(ids []uint, data map[string]interface{}) error

Update 更新 @param []uint ids 查询条件 @param map[string]interface{} attributes 待更新数据 @return error 错误信息

type DictionaryDetailRepository

type DictionaryDetailRepository struct {
	BaseRepository
}

DictionaryDetailRepository 数据字典表仓储层

func DictionaryDetail

func DictionaryDetail(tx ...*gorm.DB) *DictionaryDetailRepository

DictionaryDetail 数据字典表仓储层 @param *gorm.DB tx 事务 @return DictionaryDetailRepository 返回数据字典表仓储层

func (DictionaryDetailRepository) FindByCode

func (base DictionaryDetailRepository) FindByCode(condition map[string]interface{}, fields ...[]string) (data []map[string]interface{}, err error)

FindByCode 根据数据字典KEY返回明细值 @param map[string]interface{} condition 查询条件 @param []string fields 查询指定字段 @return data err 切片数据,错误信息

type DictionaryRepository

type DictionaryRepository struct {
	BaseRepository
}

DictionaryRepository 数据字典表仓储层

func Dictionary

func Dictionary(tx ...*gorm.DB) *DictionaryRepository

Dictionary 数据字典表仓储层 @param *gorm.DB tx 事务 @return DictionaryRepository 返回数据字典表仓储层

func (DictionaryRepository) DeleteByDictionaryId

func (base DictionaryRepository) DeleteByDictionaryId(id []uint) error

DeleteByDictionaryId 根据数据字典ID删除明细值 @param []uint id 数据字典ID @return error 返回一个错误信息

type FileChunkRepository

type FileChunkRepository struct {
	BaseRepository
}

FileChunkRepository 文件分片表仓储层

func FileChunk

func FileChunk(tx ...*gorm.DB) *FileChunkRepository

FileChunk 实例化文件分片表仓储层 @param *gorm.DB tx 事务 @return AdminRepository 返回文件分片表仓储层

func (FileChunkRepository) FindChunk

func (base FileChunkRepository) FindChunk(fileId uint) ([]map[string]interface{}, error)

FindChunk 查询文件分片 @param uint fileId 文件ID @return []map[string]interface{} 文件分片列表

type FileRepository

type FileRepository struct {
	BaseRepository
}

FileRepository 文件表仓储层

func File

func File(tx ...*gorm.DB) *FileRepository

File 实例化文件表仓储层 @param *gorm.DB tx 事务 @return AdminRepository 返回文件表仓储层

type MenuRepository struct {
	BaseRepository
}

MenuRepository 菜单仓储层

func Menu(tx ...*gorm.DB) *MenuRepository

Menu 实例化菜单仓储层 @param *gorm.DB tx 事务 @return MenuRepository 返回菜单仓储层

func (base MenuRepository) DeleteByMenuId(ids []uint) error

DeleteByMenuId 根据父菜单ID删除子菜单 @param []uint ids 管理员ID @return error 返回一个错误信息

type PageInfo

type PageInfo struct {
	Page     int64  `json:"page"`     // 页码
	PageSize int64  `json:"pageSize"` // 每页大小
	Keywords string `json:"keywords"` // 关键字
}

PageInfo 分页结构体

type RoleRepository

type RoleRepository struct {
	BaseRepository
}

RoleRepository 角色仓储层

func Role

func Role(tx ...*gorm.DB) *RoleRepository

Role 实例化角色仓储层 @param *gorm.DB tx 事务 @return RoleRepository 返回角色仓储层

func (RoleRepository) FindRoles

func (base RoleRepository) FindRoles(roles []string) (data []map[string]interface{}, err error)

FindRoles 查询角色信息 @param []string roles @return data err 返回一个角色切片,错误信息

func (RoleRepository) KeyIsExist

func (base RoleRepository) KeyIsExist(role string) (bool bool, err error)

KeyIsExist 判断角色Key是否存在 @param string key 角色ket @return bool err 返回一个bool值和一个错误信息

type SystemRepository

type SystemRepository struct {
	BaseRepository
}

SystemRepository 系统设置表仓储层

func System

func System(tx ...*gorm.DB) *SystemRepository

System 实例化系统设置表仓储层 @param *gorm.DB tx 事务 @return AdminRepository 返回系统设置表仓储层

type UserRepository

type UserRepository struct {
	BaseRepository
}

UserRepository 用户表仓储层

func User

func User(tx ...*gorm.DB) *UserRepository

User 实例化用户表仓储层 @param *gorm.DB tx 事务 @return UserRepository 返回用户表仓储层

func (UserRepository) GetUserInfo

func (base UserRepository) GetUserInfo(attributes interface{}) (user models.Users)

GetUserInfo 获取用户信息 @param interface{} attributes 用户id或者用户user @return user 返回当前user用户的信息

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL