UserRole

package
v5.1.34 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuditApply

func AuditApply(args *ArgsAuditApply) (errCode string, err error)

AuditApply 审核申请

func CheckRoleByUserID

func CheckRoleByUserID(roleMark string, userID int64) (roleID int64, b bool)

CheckRoleByUserID 通过角色类型检查用户是否绑定关系

func DeleteApply

func DeleteApply(args *ArgsDeleteApply) (err error)

DeleteApply 删除申请

func DeleteRole

func DeleteRole(args *ArgsDeleteRole) (err error)

DeleteRole 删除角色

func DeleteType

func DeleteType(args *ArgsDeleteType) (err error)

DeleteType 删除配置

func GetRoleIDByUserID

func GetRoleIDByUserID(args *ArgsGetRoleIDByUserID) (roleID int64, err error)

GetRoleIDByUserID 通过用户获取角色ID

func PayToRole

func PayToRole(args *ArgsPayToRole) (err error)

PayToRole 平台或商户给与角色资金

func UpdateType

func UpdateType(args *ArgsUpdateType) (err error)

UpdateType 修改配置

Types

type ArgsAuditApply

type ArgsAuditApply struct {
	//ID
	ID int64 `db:"id" json:"id" check:"id"`
	//是否审核通过
	IsAudit bool `db:"is_audit" json:"isAudit" check:"bool"`
	//拒绝原因
	AuditBanDes string `db:"audit_ban_des" json:"auditBanDes" check:"des" min:"1" max:"600" empty:"true"`
}

ArgsAuditApply 审核申请参数

type ArgsCreateApply

type ArgsCreateApply struct {
	//申请描述
	AuditDes string `db:"audit_des" json:"auditDes" check:"des" min:"1" max:"600" empty:"true"`
	//角色类型
	RoleType int64 `db:"role_type" json:"roleType" check:"id"`
	//用户ID
	UserID int64 `db:"user_id" json:"userID" check:"id"`
	//姓名
	Name string `db:"name" json:"name" check:"name"`
	//所属国家 国家代码
	// eg: china => 86
	Country int `db:"country" json:"country" check:"country"`
	//城市编码
	City string `db:"city" json:"city" check:"cityCode"`
	//性别
	// 0 男 1 女 2 未知
	Gender int `db:"gender" json:"gender" check:"gender"`
	//联系电话
	Phone string `db:"phone" json:"phone" check:"phone"`
	//个人照片
	CoverFileID int64 `db:"cover_file_id" json:"coverFileID" check:"id" empty:"true"`
	//证件列
	CertFiles pq.Int64Array `db:"cert_files" json:"certFiles" check:"ids" empty:"true"`
	//扩展参数
	Params CoreSQLConfig.FieldsConfigsType `db:"params" json:"params" check:"params" empty:"true"`
}

ArgsCreateApply 创建新的申请参数

type ArgsCreateType

type ArgsCreateType struct {
	//标识码
	Mark string `db:"mark" json:"mark" check:"mark"`
	//配置名称
	Name string `db:"name" json:"name" check:"name"`
	//分配的用户组
	GroupIDs pq.Int64Array `db:"group_ids" json:"groupIDs" check:"ids" empty:"true"`
	//扩展参数
	Params CoreSQLConfig.FieldsConfigsType `db:"params" json:"params" check:"params" empty:"true"`
}

ArgsCreateType 创建新的配置参数

type ArgsDeleteApply

type ArgsDeleteApply struct {
	//ID
	ID int64 `db:"id" json:"id" check:"id"`
	//用户ID
	UserID int64 `db:"user_id" json:"userID" check:"id" empty:"true"`
}

ArgsDeleteApply 删除申请参数

type ArgsDeleteRole

type ArgsDeleteRole struct {
	//ID
	ID int64 `db:"id" json:"id" check:"id"`
}

ArgsDeleteRole 删除角色参数

type ArgsDeleteType

type ArgsDeleteType struct {
	//ID
	ID int64 `db:"id" json:"id" check:"id"`
}

ArgsDeleteType 删除配置参数

type ArgsGetApplyID

type ArgsGetApplyID struct {
	//ID
	ID int64 `db:"id" json:"id" check:"id"`
	//用户ID
	UserID int64 `db:"user_id" json:"userID" check:"id" empty:"true"`
}

ArgsGetApplyID 查看申请详情ID参数

type ArgsGetApplyList

type ArgsGetApplyList struct {
	//分页
	Pages CoreSQLPages.ArgsDataList `json:"pages"`
	//角色类型
	RoleType int64 `db:"role_type" json:"roleType" check:"id" empty:"true"`
	//用户ID
	// 允许为0,则该信息不属于任何用户,或不和任何用户关联
	UserID int64 `db:"user_id" json:"userID" check:"id" empty:"true"`
	//是否审核
	NeedIsAudit bool `json:"needIsAudit" check:"bool"`
	IsAudit     bool `json:"isAudit" check:"bool"`
	//是否被删除
	IsRemove bool `db:"is_remove" json:"isRemove" check:"bool" empty:"true"`
	//搜索
	Search string `json:"search" check:"search" empty:"true"`
}

ArgsGetApplyList 获取申请列表参数

type ArgsGetPayLogList

type ArgsGetPayLogList struct {
	//分页
	Pages CoreSQLPages.ArgsDataList `json:"pages"`
	//角色ID
	RoleID int64 `db:"role_id" json:"roleID" check:"id" empty:"true"`
	//系统来源
	SystemFrom string `db:"system_from" json:"systemFrom" check:"mark" empty:"true"`
	//系统ID
	FromID int64 `db:"from_id" json:"fromID" check:"id" empty:"true"`
	//搜索
	Search string `json:"search" check:"search" empty:"true"`
}

ArgsGetPayLogList 获取日志列表参数

type ArgsGetRoleID

type ArgsGetRoleID struct {
	//ID
	ID int64 `db:"id" json:"id" check:"id"`
}

ArgsGetRoleID 获取指定角色参数

type ArgsGetRoleIDByUserID

type ArgsGetRoleIDByUserID struct {
	//角色类型
	RoleType int64 `db:"role_type" json:"roleType" check:"id"`
	//用户ID
	// 允许为0,则该信息不属于任何用户,或不和任何用户关联
	UserID int64 `db:"user_id" json:"userID" check:"id"`
}

ArgsGetRoleIDByUserID 通过用户获取角色ID参数

type ArgsGetRoleList

type ArgsGetRoleList struct {
	//分页
	Pages CoreSQLPages.ArgsDataList `json:"pages"`
	//角色类型
	RoleType int64 `db:"role_type" json:"roleType" check:"id" empty:"true"`
	//用户ID
	// 允许为0,则该信息不属于任何用户,或不和任何用户关联
	UserID int64 `db:"user_id" json:"userID" check:"id" empty:"true"`
	//是否被删除
	IsRemove bool `db:"is_remove" json:"isRemove" check:"bool" empty:"true"`
	//搜索
	Search string `json:"search" check:"search" empty:"true"`
}

ArgsGetRoleList 获取角色列表参数

type ArgsGetRoleUserID

type ArgsGetRoleUserID struct {
	//角色类型
	RoleType int64 `db:"role_type" json:"roleType" check:"id"`
	//用户ID
	// 允许为0,则该信息不属于任何用户,或不和任何用户关联
	UserID int64 `db:"user_id" json:"userID" check:"id"`
}

ArgsGetRoleUserID 获取指定角色参数

type ArgsGetTypeID

type ArgsGetTypeID struct {
	//ID
	ID int64 `db:"id" json:"id" check:"id"`
}

ArgsGetTypeID 获取指定配置ID参数

type ArgsGetTypeList

type ArgsGetTypeList struct {
	//分页
	Pages CoreSQLPages.ArgsDataList `json:"pages"`
	//是否被删除
	IsRemove bool `db:"is_remove" json:"isRemove" check:"bool" empty:"true"`
	//搜索
	Search string `json:"search" check:"search" empty:"true"`
}

ArgsGetTypeList 获取角色配置列表参数

type ArgsGetTypeMark

type ArgsGetTypeMark struct {
	//标识码
	Mark string `db:"mark" json:"mark" check:"mark"`
}

ArgsGetTypeMark 获取指定配置Mark参数

type ArgsPayToRole

type ArgsPayToRole struct {
	//角色ID
	RoleID int64 `db:"role_id" json:"roleID" check:"id"`
	//关联组织
	OrgID int64 `db:"org_id" json:"orgID" check:"id" empty:"true"`
	//储蓄配置
	DepositMark string `db:"deposit_mark" json:"depositMark" check:"mark"`
	//货币
	// eg: 86
	Currency int `db:"currency" json:"currency" check:"currency"`
	//支付金额
	Price int64 `db:"price" json:"price" check:"price"`
	//系统来源
	SystemFrom string `db:"system_from" json:"systemFrom" check:"mark"`
	//系统ID
	FromID int64 `db:"from_id" json:"fromID" check:"mark" empty:"true"`
	//描述
	Des string `db:"des" json:"des" check:"des" min:"1" max:"300" empty:"true"`
}

ArgsPayToRole 平台或商户给与角色资金参数

type ArgsSetRole

type ArgsSetRole struct {
	//角色类型
	RoleType int64 `db:"role_type" json:"roleType" check:"id"`
	//申请ID
	ApplyID int64 `db:"apply_id" json:"applyID" check:"id"`
	//用户ID
	// 允许为0,则该信息不属于任何用户,或不和任何用户关联
	UserID int64 `db:"user_id" json:"userID" check:"id"`
	//姓名
	Name string `db:"name" json:"name" check:"name"`
	//所属国家 国家代码
	// eg: china => 86
	Country int `db:"country" json:"country" check:"country"`
	//城市编码
	City string `db:"city" json:"city" check:"cityCode"`
	//性别
	// 0 男 1 女 2 未知
	Gender int `db:"gender" json:"gender" check:"gender"`
	//联系电话
	Phone string `db:"phone" json:"phone" check:"phone"`
	//个人照片
	CoverFileID int64 `db:"cover_file_id" json:"coverFileID" check:"id" empty:"true"`
	//证件列
	CertFiles pq.Int64Array `db:"cert_files" json:"certFiles" check:"ids" empty:"true"`
	//扩展参数
	Params CoreSQLConfig.FieldsConfigsType `db:"params" json:"params" check:"params" empty:"true"`
}

ArgsSetRole 设置用户为指定角色参数

type ArgsUpdateType

type ArgsUpdateType struct {
	//ID
	ID int64 `db:"id" json:"id" check:"id"`
	//标识码
	Mark string `db:"mark" json:"mark" check:"mark"`
	//配置名称
	Name string `db:"name" json:"name" check:"name"`
	//分配的用户组
	GroupIDs pq.Int64Array `db:"group_ids" json:"groupIDs" check:"ids" empty:"true"`
	//扩展参数
	Params CoreSQLConfig.FieldsConfigsType `db:"params" json:"params" check:"params" empty:"true"`
}

ArgsUpdateType 修改配置参数

type FieldsApply

type FieldsApply struct {
	//ID
	ID int64 `db:"id" json:"id"`
	//创建时间
	CreateAt time.Time `db:"create_at" json:"createAt"`
	//更新时间
	UpdateAt time.Time `db:"update_at" json:"updateAt"`
	//删除时间
	DeleteAt time.Time `db:"delete_at" json:"deleteAt"`
	//审核时间
	AuditAt time.Time `db:"audit_at" json:"auditAt"`
	//申请描述
	AuditDes string `db:"audit_des" json:"auditDes" check:"des" min:"1" max:"600" empty:"true"`
	//拒绝原因
	AuditBanDes string `db:"audit_ban_des" json:"auditBanDes" check:"des" min:"1" max:"600" empty:"true"`
	//角色类型
	RoleType int64 `db:"role_type" json:"roleType" check:"id"`
	//用户ID
	UserID int64 `db:"user_id" json:"userID" check:"id"`
	//姓名
	Name string `db:"name" json:"name" check:"name"`
	//所属国家 国家代码
	// eg: china => 86
	Country int `db:"country" json:"country" check:"country"`
	//城市编码
	City string `db:"city" json:"city" check:"cityCode"`
	//性别
	// 0 男 1 女 2 未知
	Gender int `db:"gender" json:"gender" check:"gender"`
	//联系电话
	Phone string `db:"phone" json:"phone" check:"phone"`
	//个人照片
	CoverFileID int64 `db:"cover_file_id" json:"coverFileID" check:"id" empty:"true"`
	//证件列
	CertFiles pq.Int64Array `db:"cert_files" json:"certFiles" check:"ids" empty:"true"`
	//扩展参数
	Params CoreSQLConfig.FieldsConfigsType `db:"params" json:"params" check:"params" empty:"true"`
}

FieldsApply 申请角色

func CreateApply

func CreateApply(args *ArgsCreateApply) (data FieldsApply, err error)

CreateApply 创建新的申请

func GetApplyID

func GetApplyID(args *ArgsGetApplyID) (data FieldsApply, err error)

GetApplyID 查看申请详情ID

func GetApplyList

func GetApplyList(args *ArgsGetApplyList) (dataList []FieldsApply, dataCount int64, err error)

GetApplyList 获取申请列表

type FieldsPayLog

type FieldsPayLog struct {
	//ID
	ID int64 `db:"id" json:"id"`
	//创建时间
	CreateAt time.Time `db:"create_at" json:"createAt"`
	//角色ID
	RoleID int64 `db:"role_id" json:"roleID"`
	//储蓄配置
	DepositMark string `db:"deposit_mark" json:"depositMark"`
	//货币
	// eg: 86
	Currency int `db:"currency" json:"currency" check:"currency"`
	//支付金额
	Price int64 `db:"price" json:"price"`
	//系统来源
	SystemFrom string `db:"system_from" json:"systemFrom"`
	//系统ID
	FromID int64 `db:"from_id" json:"fromID"`
	//支付ID
	// 可能不存在,当平台向用户发起支付时,会直接给调账账户资金,而不是产生交易记录
	PayID int64 `db:"pay_id" json:"payID"`
	//描述
	Des string `db:"des" json:"des" check:"des" min:"1" max:"300" empty:"true"`
}

FieldsPayLog 付款记录 给角色人员付款储蓄的交易记录

func GetPayLogList

func GetPayLogList(args *ArgsGetPayLogList) (dataList []FieldsPayLog, dataCount int64, err error)

GetPayLogList 获取日志列表

type FieldsRole

type FieldsRole struct {
	//ID
	ID int64 `db:"id" json:"id"`
	//创建时间
	CreateAt time.Time `db:"create_at" json:"createAt"`
	//更新时间
	UpdateAt time.Time `db:"update_at" json:"updateAt"`
	//删除时间
	DeleteAt time.Time `db:"delete_at" json:"deleteAt"`
	//角色类型
	RoleType int64 `db:"role_type" json:"roleType" check:"id"`
	//申请ID
	ApplyID int64 `db:"apply_id" json:"applyID" check:"id"`
	//用户ID
	// 允许为0,则该信息不属于任何用户,或不和任何用户关联
	UserID int64 `db:"user_id" json:"userID" check:"id"`
	//姓名
	Name string `db:"name" json:"name" check:"name"`
	//所属国家 国家代码
	// eg: china => 86
	Country int `db:"country" json:"country" check:"country"`
	//城市编码
	City string `db:"city" json:"city" check:"cityCode"`
	//性别
	// 0 男 1 女 2 未知
	Gender int `db:"gender" json:"gender" check:"gender"`
	//联系电话
	Phone string `db:"phone" json:"phone" check:"phone"`
	//个人照片
	CoverFileID int64 `db:"cover_file_id" json:"coverFileID" check:"id" empty:"true"`
	//证件列
	CertFiles pq.Int64Array `db:"cert_files" json:"certFiles" check:"ids" empty:"true"`
	//扩展参数
	Params CoreSQLConfig.FieldsConfigsType `db:"params" json:"params" check:"params" empty:"true"`
}

FieldsRole 角色信息

func GetRoleID

func GetRoleID(args *ArgsGetRoleID) (data FieldsRole, err error)

GetRoleID 获取指定角色

func GetRoleList

func GetRoleList(args *ArgsGetRoleList) (dataList []FieldsRole, dataCount int64, err error)

GetRoleList 获取角色列表

func GetRoleUserID

func GetRoleUserID(args *ArgsGetRoleUserID) (data FieldsRole, err error)

GetRoleUserID 获取指定角色

func SetRole

func SetRole(args *ArgsSetRole) (data FieldsRole, err error)

SetRole 设置用户为指定角色

type FieldsType

type FieldsType struct {
	//ID
	ID int64 `db:"id" json:"id"`
	//创建时间
	CreateAt time.Time `db:"create_at" json:"createAt"`
	//更新时间
	UpdateAt time.Time `db:"update_at" json:"updateAt"`
	//删除时间
	DeleteAt time.Time `db:"delete_at" json:"deleteAt"`
	//标识码
	Mark string `db:"mark" json:"mark" check:"mark"`
	//配置名称
	Name string `db:"name" json:"name" check:"name"`
	//分配的用户组
	GroupIDs pq.Int64Array `db:"group_ids" json:"groupIDs" check:"ids" empty:"true"`
	//扩展参数
	Params CoreSQLConfig.FieldsConfigsType `db:"params" json:"params" check:"params" empty:"true"`
}

FieldsType 角色配置

func CreateType

func CreateType(args *ArgsCreateType) (data FieldsType, err error)

CreateType 创建新的配置

func GetTypeID

func GetTypeID(args *ArgsGetTypeID) (data FieldsType, err error)

GetTypeID 获取指定配置ID

func GetTypeList

func GetTypeList(args *ArgsGetTypeList) (dataList []FieldsType, dataCount int64, err error)

GetTypeList 获取角色配置列表

func GetTypeMark

func GetTypeMark(args *ArgsGetTypeMark) (data FieldsType, err error)

GetTypeMark 获取指定配置Mark

func GetTypeMarkNoErr

func GetTypeMarkNoErr(mark string) (data FieldsType)

Jump to

Keyboard shortcuts

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