adminModel

package
v0.0.0-...-3208bda Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateAdmin

func CreateAdmin(name, avatar, email, password, salt string) int64

Description: 创建管理员

@param name 管理员名 @param avatar 头像 @param email 邮箱账号 @param password 密码 @param salt 加盐 @param roles 所属角色

@return admin_id

func DeleteAdmin

func DeleteAdmin(id int64) int64

删除

func GetAdminInfoById

func GetAdminInfoById(adminId int64, selectFields []string) (*schema.Admin, error)

Description: 根据id获取管理员信息

func GetAdminInfoByName

func GetAdminInfoByName(name string, selectFields []string) (*schema.Admin, error)

Description: 根据账号获取管理员信息

func GetAdminInfoByWx

func GetAdminInfoByWx(openId, unionId string, selectFields []string) (*schema.Admin, error)

Description: 根据微信 openid unionid 获取管理员信息

func GetAdminList

func GetAdminList(offset, count uint, sort string, filter map[string]interface{}, selectFields []string) ([]*schema.Admin, error)

获取管理员列表 @param offset uint 起始位移 @param count uint 获取行数 @param sort string 字段排序 如"a desc,b asc,..." @param filter map[string]interface{} 字段过滤条件

func IsAdminExist

func IsAdminExist(adminId string) bool

Description: 根据管理员id验证是否已存在

func IsAdminExistByEmail

func IsAdminExistByEmail(email string) bool

Description: 根据邮箱验证管理员账号是否已存在

func IsAdminExistByName

func IsAdminExistByName(name string) bool

Description: 根据管理员昵称验证是否已存在

func UpdateAdminField

func UpdateAdminField(id int64, data map[string]interface{}) (int64, error)

Description: 更新管理员字段 @param adminId 更新的管理员id @param data 更新的数据

@return 返回更新结果

Types

This section is empty.

Jump to

Keyboard shortcuts

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