api

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2022 License: GPL-2.0 Imports: 26 Imported by: 0

Documentation

Overview

HTTP API v1.0 ----------------------- 约定参数名称:

	api       : 接口名称
 api_key  : 接口用户
 sign      : 签名
 sign_type : 签名类型
 app       : 应用编码

-----------------------

Index

Constants

This section is empty.

Variables

View Source
var (
	RequireVersion = "1.0.0"
	ApiUser        = "go2o"
	ApiSecret      = "123456"
)

Functions

func NewAccountApi

func NewAccountApi() *accountApi

func NewGoodsApi

func NewGoodsApi() *goodsApi

func NewPassportApi

func NewPassportApi() api.Handler

func NewRegisterApi

func NewRegisterApi() api.Handler

func NewResApi

func NewResApi() api.Handler

func NewServe

func NewServe(store storage.Interface, debug bool, requireVer string,
	apiUser string, apiSecret string) http.Handler

服务

func NewService

func NewService(factory api.ContextFactory, debug bool, rl *util.RequestLimit) *api.ServeMux

服务

func NewShopApi

func NewShopApi() *shopApi

Types

type AppApi

type AppApi struct {
}

func NewAppApi

func NewAppApi() *AppApi

func (AppApi) Process

func (a AppApi) Process(fn string, ctx api.Context) *api.Response

type ArticleApi

type ArticleApi struct {
}

func (ArticleApi) Process

func (a ArticleApi) Process(fn string, ctx api.Context) *api.Response

type MemberApi

type MemberApi struct {
	// contains filtered or unexported fields
}

func (MemberApi) Process

func (m MemberApi) Process(fn string, ctx api.Context) *api.Response

func (MemberApi) SResult

func (u MemberApi) SResult(err error) *proto.Result

type PassportApi

type PassportApi struct {
	// contains filtered or unexported fields
}

func (PassportApi) GetCodeVerifyResult

func (p PassportApi) GetCodeVerifyResult(token string) (int64, bool)

获取校验结果

func (PassportApi) ModifyPassword

func (h PassportApi) ModifyPassword(ctx api.Context) interface{}

*

  • @api {post} /passport/modify_pwd 修改密码
  • @apiName modify_pwd
  • @apiGroup passport
  • @apiParam {String} account 账号
  • @apiParam {Int} cred_type 账号类型,1:用户名 3:邮件 4:手机号
  • @apiParam {String} token 令牌
  • @apiParam {String} pwd md5编码后的密码
  • @apiParam {String} old_pwd md5编码后的旧密码
  • @apiSuccessExample Success-Response
  • {}
  • @apiSuccessExample Error-Response
  • {"code":1,"message":"api not defined"} *

func (PassportApi) Process

func (m PassportApi) Process(fn string, ctx api.Context) *api.Response

func (PassportApi) SResult

func (u PassportApi) SResult(err error) *proto.Result

func (PassportApi) TradePassword

func (h PassportApi) TradePassword(ctx api.Context) interface{}

*

  • @api {post} /passport/trade_pwd 修改交易密码
  • @apiName trade_pwd
  • @apiGroup passport
  • @apiParam {String} account 账号
  • @apiParam {Int} cred_type 账号类型,1:用户名 3:邮件 4:手机号
  • @apiParam {String} token 令牌
  • @apiParam {String} pwd md5编码后的密码
  • @apiParam {String} old_pwd md5编码后的旧密码,如果没有设置交易密码,则为空
  • @apiSuccessExample Success-Response
  • {}
  • @apiSuccessExample Error-Response
  • {"code":1,"message":"api not defined"} *

type RegisterApi

type RegisterApi struct {
	// contains filtered or unexported fields
}

注册接口API

func (RegisterApi) Process

func (m RegisterApi) Process(fn string, ctx api.Context) *api.Response

func (RegisterApi) SResult

func (u RegisterApi) SResult(err error) *proto.Result

type SettingsApi

type SettingsApi struct {
}

func NewSettingsApi

func NewSettingsApi() *SettingsApi

func (SettingsApi) Process

func (a SettingsApi) Process(fn string, ctx api.Context) *api.Response

Jump to

Keyboard shortcuts

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