Documentation ¶
Index ¶
- func CreateMemberReg(regType int, appNo, appChannel string, appVersion int, refId int64, ...) (model Member, err error)
- func GetMemberAvatar(id int64, avatar string)
- func UpdateMemberLoginCount(appNo, appChannel string, appVersion int)
- func UpdateMemberLoginStatus(member Member) (code int, msg, token string)
- type ApiPreparer
- type AppVersionApiController
- type Base2ApiController
- type BaseApiController
- type ChangePwdApiController
- type ForgetPwdApiController
- type InformationApiController
- type LoginAlipayApiController
- type LoginAliyunAuthApiController
- type LoginApiController
- type LoginAppleApiController
- type LoginHuaweiApiController
- type LoginQqApiController
- type LoginWxApiController
- type MemberApiController
- type MemberSuggestApiController
- type NormalQuestionApiController
- type RefreshLoginApiController
- type RegApiController
- type SendSmsApiController
- type SysConfigApiController
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateMemberReg ¶
func UpdateMemberLoginCount ¶
func UpdateMemberLoginStatus ¶
Types ¶
type ApiPreparer ¶
type ApiPreparer interface {
ApiPreparer()
}
type AppVersionApiController ¶
type AppVersionApiController struct {
Base2ApiController
}
func (*AppVersionApiController) Get ¶
func (c *AppVersionApiController) Get()
api app版本比对 param: os=android&ver=1 body: return:{"code":1,"msg":"成功","data":{"ver":1,"name":"v1.0","desc":"1.版本描述","url":"http://baidu.com","force":1}} desc:
func (*AppVersionApiController) Post ¶
func (c *AppVersionApiController) Post()
api app版本比对, 适配XUI-XUpdate param: app=a&os=android&ver=1 body: return:
{ "Code": 0, //0代表请求成功,非0代表失败 "Msg": "", //请求出错的信息 "UpdateStatus": 1, //0代表不更新,1代表有版本更新,不需要强制升级,2代表有版本更新,需要强制升级 "VersionCode": 3, "VersionName": "1.0.2", "ModifyContent": "1、优化api接口。\r\n2、添加使用demo演示。\r\n3、新增自定义更新服务API接口。\r\n4、优化更新提示界面。", "DownloadUrl": "https://raw.githubusercontent.com/xuexiangjys/XUpdate/master/apk/xupdate_demo_1.0.2.apk", "ApkSize": 2048 "ApkMd5": "..." //md5值没有的话,就无法保证apk是否完整,每次都会重新下载。框架默认使用的是md5加密。 "IsIgnorable": 1, }
desc:
func (*AppVersionApiController) PostAuto ¶
func (c *AppVersionApiController) PostAuto()
type Base2ApiController ¶
type Base2ApiController struct { controllers.BaseMainController IsLogon bool LoginMemberId int64 AppChannel string AppNo string AppVersionCode int DeviceId string }
api不需要登录的父接口 param: mid=1 (可不传) desc: 如果mid参数不为空,则记录为已登录状态
func (*Base2ApiController) Prepare ¶
func (c *Base2ApiController) Prepare()
type BaseApiController ¶
type BaseApiController struct { controllers.BaseMainController LoginMemberId int64 AppChannel string AppNo string AppVersionCode int DeviceId string }
api需要登录的接口父接口 param: mid=1&token=0887a57c630a5a97ee8ded7141754724 desc: 继承该接口的将验证登录状态
func (*BaseApiController) Prepare ¶
func (c *BaseApiController) Prepare()
type ChangePwdApiController ¶
type ChangePwdApiController struct {
BaseApiController
}
func (*ChangePwdApiController) Post ¶
func (c *ChangePwdApiController) Post()
api修改密码 param: body: {"newPwd":"32md5小写","oldPwd":"32md5小写"} return:{"code":1,"msg":"成功"} desc: 密码修改成功后,不需要重新登录
type ForgetPwdApiController ¶
type ForgetPwdApiController struct {
Base2ApiController
}
func (*ForgetPwdApiController) Post ¶
func (c *ForgetPwdApiController) Post()
api验证短信 param: body: {"mobile":"13112345678","authCode":3256} return:{"code":1,"msg":"成功","data":{"id":1,"token":"11111111111111111111","phone":"13111111111","nickname":"昵称","autoLogin":true}} desc: 验证短信验证码是否正确
type InformationApiController ¶
type InformationApiController struct {
Base2ApiController
}
func (*InformationApiController) Get ¶
func (c *InformationApiController) Get()
api 系统消息获取 param: body: return:{"code":1,"msg":"成功","data":[{"infoId":1,"title":"系统通知","info":"系统通知消息内容","needFeedback":1}]} desc:
func (*InformationApiController) Post ¶
func (c *InformationApiController) Post()
api 系统消息更新已读状态 param: body: {"infoId":1} return: {"code":1,"msg":"更新成功","data":"ok"} desc:
type LoginAlipayApiController ¶
type LoginAlipayApiController struct {
Base2ApiController
}
func (*LoginAlipayApiController) Get ¶
func (c *LoginAlipayApiController) Get()
api Alipay登录,获取authInfo param: body: return:{"code":1,"msg":"成功","data":"authInfo"}
func (*LoginAlipayApiController) Post ¶
func (c *LoginAlipayApiController) Post()
api Alipay登录,获取用户基本信息 param: body:{"code":"111122"} return:{"code":1,"msg":"成功","data":{"id":1,"token":"11111111111111111111","nickname":"支付宝用户1","autoLogin":true,"accessToken":"ddfesfsf"}}
type LoginAliyunAuthApiController ¶
type LoginAliyunAuthApiController struct {
Base2ApiController
}
func (*LoginAliyunAuthApiController) Post ¶
func (c *LoginAliyunAuthApiController) Post()
api Aliyun认证登录,注册 param: body: return:{"code":1,"msg":"成功","data":"authInfo"}
type LoginApiController ¶
type LoginApiController struct {
Base2ApiController
}
func (*LoginApiController) Logout ¶
func (c *LoginApiController) Logout()
func (*LoginApiController) Post ¶
func (c *LoginApiController) Post()
api登录 param: body:{"username":"aaaaa","password":"32md5小写"} return:{"code":1,"msg":"成功","data":{"id":1,"token":"11111111111111111111","phone":"13111111111","nickname":"昵称","autoLogin":true}}
type LoginAppleApiController ¶
type LoginAppleApiController struct {
Base2ApiController
}
func (*LoginAppleApiController) Post ¶
func (c *LoginAppleApiController) Post()
api Apple登录 param: body:{"openid":"12121212"} return:{"code":1,"msg":"成功","data":{"id":1,"token":"11111111111111111111","nickname":"用户1","autoLogin":true,"accessToken":"ddfesfsf"}}
type LoginHuaweiApiController ¶
type LoginHuaweiApiController struct {
Base2ApiController
}
func (*LoginHuaweiApiController) Post ¶
func (c *LoginHuaweiApiController) Post()
api huawei登录 param: body:{"code":"111122"} return:{"code":1,"msg":"成功","data":{"id":1,"token":"11111111111111111111","nickname":"微信用户1","autoLogin":true,"accessToken":"ddfesfsf"}}
type LoginQqApiController ¶
type LoginQqApiController struct {
Base2ApiController
}
func (*LoginQqApiController) Post ¶
func (c *LoginQqApiController) Post()
api QQ登录 param: body:{"accessToken":"access_token", "",} return:{"code":1,"msg":"成功","data":{"id":1,"token":"11111111111111111111","nickname":"微信用户1","autoLogin":true,"accessToken":"ddfesfsf"}}
type LoginWxApiController ¶
type LoginWxApiController struct {
Base2ApiController
}
func (*LoginWxApiController) Post ¶
func (c *LoginWxApiController) Post()
api WX登录 param: body:{"code":"111122"} return:{"code":1,"msg":"成功","data":{"id":1,"token":"11111111111111111111","nickname":"微信用户1","autoLogin":true,"accessToken":"ddfesfsf"}}
func (*LoginWxApiController) PostUserInfo ¶
func (c *LoginWxApiController) PostUserInfo()
api 小程序提交用户信息,小程序通过用户主动点击按钮授权的方式,获取用户信息 param: body: return:
type MemberApiController ¶
type MemberApiController struct {
BaseApiController
}
func (*MemberApiController) BindPhone ¶
func (c *MemberApiController) BindPhone()
api已通过其他方式登录的(如微信),通过此接口绑定手机号 param: body:{"authCode":2356,"username":"13111111111","password":"32md5小写"} return:{"code":1,"msg":"成功","data":"ok"} desc:
func (*MemberApiController) CancelAccount ¶
func (c *MemberApiController) CancelAccount()
api注销账号 param: body: return:{"code":1,"msg":"成功","data":"ok"} desc:
func (*MemberApiController) GetVip ¶
func (c *MemberApiController) GetVip()
api 获取vip状态 param: body: return:{"code":1,"msg":"成功","data":} desc:
func (*MemberApiController) ModifyName ¶
func (c *MemberApiController) ModifyName()
api 修改昵称 param: body: return:{"code":1,"msg":"成功","data":"ok"} desc:
func (*MemberApiController) UnBindPhone ¶
func (c *MemberApiController) UnBindPhone()
api已通过其他方式登录的(如微信)且绑定过手机号,通过此接口解除手机号 param: body:{"authCode":2356,"username":"13111111111","password":"32md5小写"} return:{"code":1,"msg":"成功","data":"ok"} desc:
func (*MemberApiController) UploadAvatar ¶
func (c *MemberApiController) UploadAvatar()
api 修改头像 param: body: return:{"code":1,"msg":"成功","data":"/upload/avatar/m1adddd.jpg"} desc:
type MemberSuggestApiController ¶
type MemberSuggestApiController struct {
BaseApiController
}
func (*MemberSuggestApiController) Get ¶
func (c *MemberSuggestApiController) Get()
api查询用户建议 param: body: return:{"code":1,"msg":"成功",[{"creatTime":"2020-01-02 15:04:05","suggest":"建议","status":1,"feedback":"很好!"}]} desc:
func (*MemberSuggestApiController) GetNewFeedback ¶
func (c *MemberSuggestApiController) GetNewFeedback()
api 查询用户反馈是否已回复未读 param: body: return:{"code":1,"msg":"成功", "data": 1} desc: data > 0 则存在
func (*MemberSuggestApiController) Post ¶
func (c *MemberSuggestApiController) Post()
api提交用户建议 param: body: {"suggest":"用户建议内容"} return:{"code":1,"msg":"成功"} desc:
type NormalQuestionApiController ¶
type NormalQuestionApiController struct {
Base2ApiController
}
func (*NormalQuestionApiController) Get ¶
func (c *NormalQuestionApiController) Get()
api 常见问题获取 param: body: return:{"code":1,"msg":"成功","data":[{"seq":1,"question":"问题1","answer":"回答1"}]} desc:
type RefreshLoginApiController ¶
type RefreshLoginApiController struct {
BaseApiController
}
func (*RefreshLoginApiController) Post ¶
func (c *RefreshLoginApiController) Post()
type RegApiController ¶
type RegApiController struct {
Base2ApiController
}
func (*RegApiController) Post ¶
func (c *RegApiController) Post()
api注册 param: body:{"inviteCode":3506,"authCode":2356,"username":"aaaaa","password":"32md5小写"} return:{"code":1,"msg":"成功","data":{"id":1,"token":"11111111111111111111","phone":"13111111111","nickname":"昵称","autoLogin":true}} desc:注册成功,记录登录状态
func (*RegApiController) PostTourist ¶
func (c *RegApiController) PostTourist()
type SendSmsApiController ¶
type SendSmsApiController struct {
Base2ApiController
}
func (*SendSmsApiController) Post ¶
func (c *SendSmsApiController) Post()
发送短信验证码,api使用 1分钟有效 请求:post 参数:mobile=手机号 mode=1 mode=1验证手机号不存在则返回异常;mode=2不验证手机号是否存在;mode=3验证手机号已存在则返回异常
type SysConfigApiController ¶
type SysConfigApiController struct {
Base2ApiController
}
func (*SysConfigApiController) Get ¶
func (c *SysConfigApiController) Get()
api 系统配置信息获取 param: c=tel,qq body: return:{"code":1,"msg":"ok","data":{"tel":"13111111111","qq":"2321353"}} desc: 参数可以输入多个,用逗号隔开