repositories

package
v0.0.0-...-da6f084 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2018 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FunctionReposotory

type FunctionReposotory interface {

	/** 基础 repository 提供最基础的增删改查 */
	Repository
}

function repository 接口

func FunRepositoryInstance

func FunRepositoryInstance(db *gorm.DB) FunctionReposotory

实例化 存储对象

type Repository

type Repository interface {

	// 新增
	Insert(m interface{}) error

	// 更新
	Update(m interface{}) error

	// 删除
	Delete(m interface{}) error

	// 根据 id 查询
	FindOne(id string) interface{}

	// 根据条件 查询单条记录
	FindSingle(condition string, params ...interface{}) interface{}

	// 根据条件查询多个结果
	FindMore(condition string, params ...interface{}) interface{}

	/** 分页查询 */
	FindPage(page int, pageSize int, andCons map[string]interface{}, orCons map[string]interface{}) (pageBean *helper.PageBean)
}

基础 repository 接口

type RoleRepository

type RoleRepository interface {

	/** 基础 repository 提供最基础的增删改查 */
	Repository
}

接口

func RoleRepositoryInstance

func RoleRepositoryInstance(db *gorm.DB) RoleRepository

实例化存储对象

type UserRepository

type UserRepository interface {

	/** 基础 repository 提供最基础的增删改查 */
	Repository
}

func UserRepositoryInstance

func UserRepositoryInstance(db *gorm.DB) UserRepository

实例化存储对象

Jump to

Keyboard shortcuts

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