Documentation ¶
Overview ¶
*
- @Author: Gosin
- @Date: 2019/12/12 15:38
Index ¶
- Constants
- func GetChannel() []int
- func GetDevices() []int
- func GetLoginScene() []int
- func VerifyChannel(channel Channel) error
- func VerifyDevice(device Device) error
- type ArgsGetUserInfoByNick
- type ArgsGetUserInfoByPhone
- type ArgsGetWxOpenid
- type ArgsIdentity
- type ArgsLoginOut
- type ArgsMemberList
- type ArgsUpdateMemberStatus
- type ArgsUpdateUserinfoByUid
- type ArgsUpdateUserinfoByUtoken
- type ArgsUserQrcode
- type ArgsWxBind
- type ArgsWxLogin
- type ArgsWxMappLogin
- type Channel
- type CheckLoginParams
- type CheckLoginReply
- type Device
- type FindPwdParams
- type FindPwdReply
- type LoginParams
- type LoginReply
- type MemberListBase
- type RegFast
- type RegParams
- type RegReply
- type ReplyBaseUserinfo
- type ReplyGetUserInfoByPhone
- type ReplyGetWxOpenid
- type ReplyMemberInfo
- type ReplyMemberList
- type ReplyUserAccountInfo
- type ReplyUserAuthInfo
- type ReplyUserInfo
- type ReplyUserQrcode
- type ReplyUserinfo
- type ReplyWxLogin
- type ReplyWxMappLogin
- type Session
- type UserAccount
- type UserAuth
- type UserLogin
- type Userinfo
Constants ¶
View Source
const ( LoginType_captcha = 1 // 验证码登录 LoginType_pwd = 2 // 密码登录 SESSION_EXPIRE int64 = 2592000 // 过期时间暂定30天 CHANNEL_unknown = 0 // 未知 CHANNEL_pc = 1 // pc的Saas系统 CHANNEL_900sui_app = 2 // 900岁app CHANNEL_kangxiangbao_app = 3 // 康享宝app CHANNEL_900sui_wap = 4 // 900岁wap CHANNEL_kadidou_wxapp = 5 // 卡D兜小程序 CHANNEL_kadidou_wxofficial = 6 // 微信公众号 DEVICE_unknown = 0 // 未知 DEVICE_pc = 1 // pc DEVICE_android = 2 // android DEVICE_ios = 3 // ios DEVICE_winphone = 4 // winphone DEVICE_mac = 5 // mac //#登录场景 //普通登录 LOGIN_scene_normal = 0 //主体登录 LOGIN_scene_bus = 1 //分店登录 LOGIN_scene_shop = 2 )
View Source
const ( //性别 SEX_unknow = 0 SEX_male = 1 SEX_female = 2 //实名认证 REAL_NAME_AUTH_no = 0 REAL_NAME_AUTH_yes = 1 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ArgsGetUserInfoByNick ¶
type ArgsGetUserInfoByNick struct {
Nick string
}
ArgsGetUserInfoByNick ArgsGetUserInfoByNick
type ArgsGetUserInfoByPhone ¶
type ArgsGetUserInfoByPhone struct {
Phone string
}
================后台接口================ ArgsGetUserInfoByPhone ArgsGetUserInfoByPhone
type ArgsGetWxOpenid ¶
获取用户微信openid接口入参
type ArgsIdentity ¶
type ArgsIdentity struct { common.Utoken //用户登录信息 RealName string //真实姓名 CardNo string //身份证号 Uid int //rpc内部校验 }
实名认证入参
type ArgsMemberList ¶
type ArgsMemberList struct { common.Paging Nick string // 用户名 Phone string // 手机号 Type string // 用户类型 Status string // 用户状态 CtimeStart int64 // 注册开始时间 CtimeEnd int64 // 注册结束时间 }
会员列表入参
type ArgsUpdateMemberStatus ¶
ArgsUpdateMemberStatus 更新会员状态入参
type ArgsUpdateUserinfoByUid ¶
type ArgsUserQrcode ¶
type ArgsWxBind ¶
type ArgsWxBind struct { OpenHash string // 未绑定会员时的临时验证 LoginParams }
type ArgsWxMappLogin ¶
type ArgsWxMappLogin struct { Appid string //小程序id Code string //小程序临时code Channel //渠道id Device //设备 Ip string //客户端ip Iv string //手机号解密iv 非必传 EncryptedData string //手机号加密数据 非必传 }
微信小程序登录
type CheckLoginReply ¶
type CheckLoginReply struct { UidEncodeStr string //加密后的uid Nick string // 用户昵称 RealNameAuth int // 是否实名认证 }
验证登录返回数据
type FindPwdParams ¶
忘记密码参数
type LoginParams ¶
type LoginParams struct { Phone string LoginScene int // 登录场景 0 =普通登录 1=saas总部(主体) 2=分店登录 LoginType int // 登录方式 1=短信验证码登录(常量 LoginType_captcha) 2=密码登录(常量 LoginType_pwd) Captcha string // 短信验证码 Password string // 密码 Channel Device Ip string // 客户端ip }
登录参数
type MemberListBase ¶
type RegParams ¶
type RegParams struct { Phone string // 手机 Captcha string // 短信验证码 Password string // 密码 Channel Device }
注册所需参数
type ReplyBaseUserinfo ¶
type ReplyBaseUserinfo struct { Uid int // uid Nick string // 用户昵称 AvatarImgId int // 图片id Sex int // 性别 0=未定义 1=女 2=男 }
用户基础信息
type ReplyGetUserInfoByPhone ¶
ReplyGetUserInfoByPhone ReplyGetUserInfoByPhone
type ReplyMemberInfo ¶
type ReplyMemberInfo struct { Uid int Nick string // 用户名 Phone string // 手机号 Email string // 邮箱 Name string // 真实姓名 Type int // 会员/用户类型 Address string // 详细地址 QqNo string // qq帐号 CardNo string // 身份证号 Sex int // 性别 0=未定义 1=女 2=男 IsRealNameAuth int // 实名认证 0=未认证 1=已认证 AccountBalance float64 // 帐户余额 }
会员详情出参
type ReplyUserAccountInfo ¶
ReplyUserAccountInfo ReplyUserAccountInfo
type ReplyUserAuthInfo ¶
type ReplyUserInfo ¶
type ReplyUserQrcode ¶
type ReplyUserQrcode struct {
QrcodeStr string //二维码信息
}
type ReplyUserinfo ¶
type ReplyWxLogin ¶
type ReplyWxLogin struct { OpenHash string // 未绑定会员时的临时验证 OpenId string // 用户openId LoginReply // 登录成功返回数据 }
type ReplyWxMappLogin ¶
type ReplyWxMappLogin struct { OpenId string // 用户openId Token string // 登录token ReplyUserinfo //用户信息 }
微信小程序登录返回
type Session ¶
type Session struct { Uid int // 用户uid LoginTime int64 // 第一次登录时间 Refresh int64 // 刷新时间 ExpireTime int64 // session过期时间 Ip string // 客户端ip Device }
用户登录Session
type UserAccount ¶
type UserAccount interface { // UserAccountInfo 根据uid获取用户帐号信息 GetUserAccountInfo(ctx context.Context, uid *int, reply *ReplyUserAccountInfo) error }
type UserAuth ¶
type UserAuth interface { // GetUserAuthInfoByUid 根据uid获取用户认证信息 GetUserAuthInfoByUid(ctx context.Context, uid *int, reply *ReplyUserAuthInfo) error }
type UserLogin ¶
type UserLogin interface { // 注册 Reg(ctx context.Context, args *RegParams, reply *RegReply) error // 登录 Login(ctx context.Context, args *LoginParams, reply *LoginReply) error // 验证登录 CheckLogin(ctx context.Context, args *CheckLoginParams, reply *CheckLoginReply) error // 找回密码 FindPwd(ctx context.Context, args *FindPwdParams, reply *FindPwdReply) error // 微信登录 WxLogin(ctx context.Context, args *ArgsWxLogin, reply *ReplyWxLogin) error // 微信登录绑定账号 WxBind(ctx context.Context, args *ArgsWxBind, reply *LoginReply) error //快速注册(已注册则返回用户UID) FastReg(ctx context.Context, args *RegFast, reply *RegReply) error //退出登录 LoginOut(ctx context.Context, args *ArgsLoginOut, reply *bool) error //获取用户的微信openid GetWxOpenid(ctx context.Context, args *ArgsGetWxOpenid, reply *ReplyGetWxOpenid) error //微信小程序登录 WxMappLogin(ctx context.Context, args *ArgsWxMappLogin, reply *ReplyWxMappLogin) error }
type Userinfo ¶
type Userinfo interface { // 根据uid获取用户单条详细数据 GetUserinfoByUid(ctx context.Context, uid *int, reply *ReplyUserinfo) error // 根据uids获取用户基础数据 GetBaseUserinfoByUids(ctx context.Context, uids *[]int, reply *[]ReplyBaseUserinfo) error // 修改用户信息 UpdateUserinfoByUid(ctx context.Context, args *ArgsUpdateUserinfoByUid, reply *bool) error //更具登录信息获取用户单条详细数据 GetUserinfoByUtoken(ctx context.Context, utoken *common.Utoken, reply *ReplyUserinfo) error // 修改当前登录用户的信息 UpdateUserinfoByUtoken(ctx context.Context, args *ArgsUpdateUserinfoByUtoken, reply *bool) error // 根据用户手机号获取用户信息 GetUserInfoByPhone(ctx context.Context, args *ArgsGetUserInfoByPhone, reply *ReplyGetUserInfoByPhone) error // 根据nick获取用户信息 GetUserInfoByNick(ctx context.Context, args *ArgsGetUserInfoByNick, reply *[]ReplyBaseUserinfo) error // 会员列表 GetMemberList(ctx context.Context, args *ArgsMemberList, reply *ReplyMemberList) error // 会员详情 GetMemberInfo(ctx context.Context, uid *int, reply *ReplyMemberInfo) error // 更改会员状态 UpdateMemberStatus(ctx context.Context, args *ArgsUpdateMemberStatus, reply *bool) error //根据多个用户id查询用户信息-rpc GetUserInfosByUids(ctx context.Context, uids *[]int, reply *[]ReplyUserInfo) error }
Click to show internal directories.
Click to hide internal directories.