apiservice

package
v0.0.0-...-af31a00 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2017 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var UserList map[string]*models.User

Functions

func AddFriendByAccount

func AddFriendByAccount(userId, targetAccount string) uint32

通过手机号或者红包号添加好友

func AddFriendById

func AddFriendById(fromId, targetId string) uint32

通过用户id添加好友(适用于手机通讯录)

func AddToBlackList

func AddToBlackList(userIdB, targetId string)

加入到黑名单中

func AgreeFriend

func AgreeFriend(userIdB, userIdA string) uint32

用户B同意A的加好友请求

func AlipayNotify

func AlipayNotify(req *http.Request) bool

支付宝异步回调处理

func AuditRedpacket

func AuditRedpacket(c *gin.Context) error

func BackPayCommon

func BackPayCommon(request *http.Request, userId string) uint32

func BindAccount

func BindAccount(userId, account string) uint32

设置红包账号

func BindPhoneNum

func BindPhoneNum(userId, phoneNum, password string) uint32

绑定手机号(第一次绑定手机号并设置密码)

func BindQQAccount

func BindQQAccount(userId, openId, openKey string) uint32

绑定QQ账号

func BindWeiboAccount

func BindWeiboAccount(userId, token string) uint32

绑定微博账号

func BindWeixinAccount

func BindWeixinAccount(userId, openId, token string) uint32

/////////////////////////////////////////////////////// 绑定第三方账号 绑定微信账号

func CreateRedpacket

func CreateRedpacket(c *gin.Context) (string, error)

创建红包

func CreateScanning

func CreateScanning(c *gin.Context) uint32

func DataRecharge

func DataRecharge(userId, phone, pkgid string) (*models.DataRechargeResp, uint32)

充值流量

func DataRechargeNotify

func DataRechargeNotify(state, orderid, ordertime, sign, errMsg string) error

充值流量回调

func DataRechargeQuery

func DataRechargeQuery(phone string) (*models.DataRechargeQueryResp, error)

查询号码支持的流量套餐

func EditEnterpriseCertInfo

func EditEnterpriseCertInfo(c *gin.Context) uint32

func FilterRedpacket

func FilterRedpacket(userId string) *models.UserExpireList

过滤红包

func FindRcToken

func FindRcToken(userId, flag string) (string, error)

从数据库中查询融云token,有就不需要去融云serve获取token flag = true表示重新去融云服务器获取token

func FinishRedpacket

func FinishRedpacket(userId, redpacketId, deviceid string) uint32

完成红包任务

func FinishShare

func FinishShare(userId, redpacketId, deviceid string) uint32

红包任务进行中

func GenerateNewToken

func GenerateNewToken(tokenStr string) (uint32, *models.TokenInfo, *models.TokenInfo)

刷新token,用旧的refresh token获取新的access token 和新的refresh token

func GetAlipayParams

func GetAlipayParams() *models.AlipayParams

func GetEnterpriseCertInfo

func GetEnterpriseCertInfo(userId string) (*models.S2C_EnterpriseCertInfo, uint32)

func GetFriendInfo

func GetFriendInfo(userId, targetId string, updateTime int64) (*models.S2C_UserData, error)

用户获取好友列表

func GetFriendList

func GetFriendList(userId string) (*models.FriendList, error)

用户获取好友列表

func GetRankListByType

func GetRankListByType(userId, tpStr, page string) *models.S2C_RankList

func GetRedpacketList

func GetRedpacketList(index string, req *http.Request) *models.S2C_RedpacketList

获取红包列表

func GetRedpacketStatistics

func GetRedpacketStatistics(userId, redpktId string) *models.S2C_RedpktStatistics

获取红包的统计数据

func GetRedpketRecieveInfo

func GetRedpketRecieveInfo(userId string) *models.S2C_RedpketRecieveInfo

获取收到的红包信息,发出的红包个数和排名等

func GetRedpketRecieveList

func GetRedpketRecieveList(userId, date string) *models.S2C_ReceivedList

收到的红包列表

func GetRedpketSendInfo

func GetRedpketSendInfo(userId, year string) *models.S2C_RedpketSendInfo

获取发出的红包信息,个数和总金额

func GetRedpketSendList

func GetRedpketSendList(userId, year string) *models.S2C_RedpktSendList

获取发出的红包列表

func GetRedpktRecordList

func GetRedpktRecordList(redpktId, cursor string) *models.S2C_RedpktRecord

红包领取记录

func GetScanListByTag1

func GetScanListByTag1(index, tag string) *models.ScanningList

func GetScanningRedpkt

func GetScanningRedpkt(redpktId, userId string) uint32

func GetSystemNoticeList

func GetSystemNoticeList(userId string) *models.S2C_SysNoticeList

func GetTobeReleasedRedpktList

func GetTobeReleasedRedpktList(userId string) *models.S2C_ToBeReleasedList

获取待发布红包列表

func GetUnionpayTradeNo

func GetUnionpayTradeNo(orderId string) (string, error)

发送银联订单推送请求

func GetUserInfo

func GetUserInfo(userId string, updateTime int64) (*models.S2C_UserData, error)

拉取用户信息

func GetWechatPayParams

func GetWechatPayParams() *models.WechatPayParams

获取微信支付参数

func GiveupRedpacket

func GiveupRedpacket(userId, redpacketId string)

放弃红包

func GrabRedpacket

func GrabRedpacket(userId, redpacketId, deviceid string) uint32

抢红包

func Login

func Login(account, password string) (uint32, *models.TokenInfo, *models.TokenInfo)

/////////////////////////////////////////////////////// public方法 用户登录,验证通过返回token

func LoginByQQ

func LoginByQQ(openId, openKey string) (err error, access, refresh *models.TokenInfo)

func LoginByWeibo

func LoginByWeibo(token string) (err error, access, refresh *models.TokenInfo)

func LoginByWeixin

func LoginByWeixin(openId, token string) (err error, access, refresh *models.TokenInfo)

/////////////////////////////////////////////////////// 第三方登陆

func Logout

func Logout(req *http.Request, userId string) error

退出

func MakeOutTradeNo

func MakeOutTradeNo(userId string) (string, error)

生成订单号

func MakeQiniuPrivateUploadToken

func MakeQiniuPrivateUploadToken(key string) string

生成私有上传凭证,有效期1小时

func MakeQiniuPrivateUrl

func MakeQiniuPrivateUrl(key string) string

生成私有的下载url

func MakeQiniuUploadToken

func MakeQiniuUploadToken(key string) string

生成上传凭证,有效期1小时

func ManualCharge

func ManualCharge(c *gin.Context) error

func PayPhoneBalance

func PayPhoneBalance() (float64, error)

查询余额

func PayRedpacketBy3rdParty

func PayRedpacketBy3rdParty(redpktId string, fee int) bool

第三方支付

func PayRedpacketByBalance

func PayRedpacketByBalance(userId, redpacketId string) bool

红包余额支付

func PhoneRecharge

func PhoneRecharge(userId, phone, price string) (*models.PhoneRechargeResp, uint32)

充值话费

func PhoneRechargeNotify

func PhoneRechargeNotify(state, orderid, ordertime, sign, errMsg string) error

充值话费回调

func PhoneRechargeQuery

func PhoneRechargeQuery(phone, price string) (*models.PhoneRechargeQueryResp, error)

根据手机号和充值额度查询商品信息

func QueryUnionpayStatus

func QueryUnionpayStatus(orderId string) error

查询交易状态 orderid即为红包id

func RefuseFriend

func RefuseFriend(userIdB, userIdA string)

B拒绝A的加好友请求

func Register

func Register(phonenum, password string) (uint32, *models.TokenInfo, *models.TokenInfo)

注册账号,密码加盐 hashpass = hash(hash(password)+salt)

func RemoveFriend

func RemoveFriend(userId, friendId string)

删除好友

func ResetPassword

func ResetPassword(userId, password, flag, code string) (uint32, *models.TokenInfo, *models.TokenInfo)

重置密码

func ResetPhoneNum

func ResetPhoneNum(userId, phoneNum, password, code string) uint32

更换手机号码

func SubmitEnterpriseCertMaterial

func SubmitEnterpriseCertMaterial(c *gin.Context) uint32

func TestQiniuUpload

func TestQiniuUpload(tokenStr string)

七牛上传测试

func UnbindOauthAccount

func UnbindOauthAccount(userId, plat string) uint32

/////////////////////////////////////////////////////// 解绑第三方登陆

func UnionBackpay

func UnionBackpay() error

请求提现

func UnionBackpayNotify

func UnionBackpayNotify(request *http.Request) error

银联取现异步通知

func UnionpayNotify

func UnionpayNotify(request *http.Request) error

银联异步通知

func UpdatePersonalInfo

func UpdatePersonalInfo(userId, key string, value interface{}) error

更新个人资料(个性签名、地理位置、性别)

func VerifyAppRedpacket

func VerifyAppRedpacket(redpktId, status string)

审核游戏或app红包

func VerifyPassword

func VerifyPassword(userId, password string) uint32

重置密码

func WechatBackPay

func WechatBackPay(userId string, request *http.Request) uint32

微信提现

func WechatpayNoify

func WechatpayNoify(request *http.Request) error

微信支付异步回调处理

Types

This section is empty.

Jump to

Keyboard shortcuts

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