models

package
v0.0.0-...-cc65f9c Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2020 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ActivateUser

func ActivateUser(userID common.ID, activateCode string) error

ActivateUser 激活用户

func ActivateUserWithOutCode

func ActivateUserWithOutCode(userID common.ID) error

ActivateUserWithOutCode 直接激活用户

func CheckUserByMobile

func CheckUserByMobile(mobile string) error

CheckUserByMobile 根据手机号检查用户状态

func CreateAddress

func CreateAddress(userID common.ID, addressDto st.AddressDto) error

CreateAddress 新增地址

func CreateDict

func CreateDict(dictDto *st.DictDto) error

CreateDict 创建字典

func CreateRole

func CreateRole(name string, resource []*st.ResourceDto) (common.ID, error)

CreateRole 创建角色

func CreateUserWithEmail

func CreateUserWithEmail(register *st.RegisterDto) (common.ID, string, error)

CreateUserWithEmail 邮箱密码创建用户

func CreateUserWithMobile

func CreateUserWithMobile(register *st.RegisterDto) (common.ID, error)

CreateUserWithMobile 创建用户

func CreateUserWithName

func CreateUserWithName(register *st.RegisterDto) (common.ID, error)

CreateUserWithName 用户名密码创建用户

func CreateUserWithThird

func CreateUserWithThird(register *st.RegisterDto) (common.ID, error)

CreateUserWithThird 三方注册登录

func DefauleEngine

func DefauleEngine() *xorm.Engine

DefauleEngine .

func DelAddress

func DelAddress(userID common.ID, addressID common.ID) error

DelAddress 删除地址

func DelDict

func DelDict(dictID common.ID) error

DelDict 删除字典

func DeleteRole

func DeleteRole(roleID common.ID) error

DeleteRole .

func GetDictByCate

func GetDictByCate(cate string) ([]*st.DictDto, error)

GetDictByCate .

func GetDictByID

func GetDictByID(dictID common.ID) (*st.DictDto, error)

GetDictByID .

func GetDictByName

func GetDictByName(name ...string) ([]*st.DictDto, error)

GetDictByName .

func GetOneDict

func GetOneDict(cate, tp string) (*st.DictDto, error)

GetOneDict .

func GetResources

func GetResources(query st.ResourceQuery) (int64, []*st.ResourceDto, error)

GetResources 获取资源数据

func GetResourcesByIDs

func GetResourcesByIDs(ids []common.ID) ([]*st.ResourceDto, error)

GetResourcesByIDs 根据编号获取资源数据

func GetRoleResourceByID

func GetRoleResourceByID(roleID common.ID) (int64, []*st.RoleResourceDto, error)

GetRoleResourceByID .

func GetRoles

func GetRoles(query st.RoleQuery) (int64, []*st.RoleDto, error)

GetRoles .

func GetUserByEmail

func GetUserByEmail(email string) (*st.UserDto, error)

GetUserByEmail 根据邮箱获取用户信息

func GetUserByID

func GetUserByID(userID common.ID) (*st.UserDto, error)

GetUserByID 根据用户ID获取用户信息

func GetUserByMobile

func GetUserByMobile(mobile string) (*st.UserDto, error)

GetUserByMobile 根据手机号查询用户信息

func GetUserInfoByID

func GetUserInfoByID(userID common.ID) (*st.UserInfoDto, error)

GetUserInfoByID 根据用户ID获取用户详细信息

func GetUserLoginByID

func GetUserLoginByID(userID common.ID, query st.EmptyQuery) (int64, []*st.UserLoginDto, error)

GetUserLoginByID 根据用户ID获取用户登录历史

func GetUsers

func GetUsers(query st.UserQuery) (int64, []*st.UserDto, error)

GetUsers 获取用户列表

func HasRoleByID

func HasRoleByID(roleID common.ID) (bool, error)

HasRoleByID .

func HasRoleByName

func HasRoleByName(name string) (bool, error)

HasRoleByName .

func HasUserByEmail

func HasUserByEmail(email string) (bool, error)

HasUserByEmail 是否存在有效邮箱

func HasUserByMobile

func HasUserByMobile(mobile string) (bool, error)

HasUserByMobile 是否存在有效手机号

func HasUserByName

func HasUserByName(name string) (bool, error)

HasUserByName 是否存在有效用户名

func HasUserByThird

func HasUserByThird(tp, openID string) (bool, error)

HasUserByThird 是否存在第三方绑定

func Init

func Init(config *config.Config) error

Init .

func Login

func Login(loginDto *st.LoginDto) (*st.UserDto, error)

Login 登录

func LoginByMobile

func LoginByMobile(loginDto *st.LoginDto) (*st.UserDto, error)

LoginByMobile 手机验证码登录

func LoginByOpenID

func LoginByOpenID(loginDto *st.LoginDto) (*st.UserDto, error)

LoginByOpenID 根据用户OpenID获取用户信息

func ResetLoginErrorForUser

func ResetLoginErrorForUser(userID common.ID) error

ResetLoginErrorForUser 重新设置错误次数为0

func UpdataRole

func UpdataRole(roleID common.ID, name string, resource []*st.ResourceDto) error

UpdataRole 更新角色

func UpdateActivateCodeForUser

func UpdateActivateCodeForUser(userID common.ID) (string, error)

UpdateActivateCodeForUser 重新发送激活码

func UpdateAddress

func UpdateAddress(userID common.ID, addressID common.ID, addressDto st.AddressDto) error

UpdateAddress 更新地址

func UpdateAvatarForUser

func UpdateAvatarForUser(userID common.ID, avatar string) error

UpdateAvatarForUser 更新头像

func UpdateDict

func UpdateDict(dictID common.ID, dictDto *st.DictDto) error

UpdateDict 更新字典

func UpdateEmailForUser

func UpdateEmailForUser(userID common.ID, email string) error

UpdateEmailForUser 更新邮箱

func UpdateForbiddenForUser

func UpdateForbiddenForUser(userID common.ID, forbidden consts.Forbidden) error

UpdateForbiddenForUser 更新禁用状态

func UpdateGenderForUser

func UpdateGenderForUser(userID common.ID, gender consts.Gender) error

UpdateGenderForUser 更新性别

func UpdateLoginErrorForUser

func UpdateLoginErrorForUser(userID common.ID) error

UpdateLoginErrorForUser 增加登录错误次数

func UpdateMobileForUser

func UpdateMobileForUser(userID common.ID, mobile string) error

UpdateMobileForUser 更新手机号

func UpdateMy

func UpdateMy(userID common.ID, userInfoDto *st.UserInfoDto) error

UpdateMy 更新信息

func UpdateNicknameForUser

func UpdateNicknameForUser(userID common.ID, nickname string) error

UpdateNicknameForUser 更新昵称

func UpdateOneDict

func UpdateOneDict(dictDto *st.DictDto) error

UpdateOneDict 更新字典

func UpdatePassword1ForUser

func UpdatePassword1ForUser(userID common.ID, password string) error

UpdatePassword1ForUser 直接修改密码

func UpdatePasswordForUser

func UpdatePasswordForUser(userID common.ID, oldPassword, password string) error

UpdatePasswordForUser 修改密码

Types

This section is empty.

Jump to

Keyboard shortcuts

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