wikeyun

package
v1.0.160 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CodeSuccess = "0000"
)
View Source
const (
	LogTable = "wikeyun"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client added in v1.0.47

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

Client 实例

func NewClient added in v1.0.47

func NewClient(config *ClientConfig) (*Client, error)

NewClient 创建实例化

func (*Client) ConfigApp added in v1.0.52

func (c *Client) ConfigApp(storeId, appKey int64, appSecret string) *Client

ConfigApp 配置

func (*Client) ConfigZapClientFun added in v1.0.141

func (c *Client) ConfigZapClientFun(apiZapLogFun golog.ApiZapLogFun)

ConfigZapClientFun 日志配置

func (*Client) GetAppKey added in v1.0.52

func (c *Client) GetAppKey() int64

func (*Client) GetAppSecret added in v1.0.52

func (c *Client) GetAppSecret() string

func (*Client) GetClientIp added in v1.0.52

func (c *Client) GetClientIp() string

func (*Client) GetStoreId added in v1.0.52

func (c *Client) GetStoreId() int64

func (*Client) Post added in v1.0.109

func (c *Client) Post(ctx context.Context, _method string, notMustParams ...gorequest.Params) ([]byte, error)

func (*Client) PowerCardInfo added in v1.0.47

func (c *Client) PowerCardInfo(ctx context.Context, notMustParams ...gorequest.Params) (body []byte, err error)

PowerCardInfo 电费充值卡详情 https://open.wikeyun.cn/#/apiDocument/9/document/333

func (*Client) RestOilCardAdd added in v1.0.47

func (c *Client) RestOilCardAdd(ctx context.Context, notMustParams ...gorequest.Params) (body []byte, err error)

RestOilCardAdd 添加充值卡

func (*Client) RestOilCardDel added in v1.0.47

func (c *Client) RestOilCardDel(ctx context.Context, notMustParams ...gorequest.Params) (body []byte, err error)

RestOilCardDel 油卡删除

func (*Client) RestOilCardEdit added in v1.0.47

func (c *Client) RestOilCardEdit(ctx context.Context, notMustParams ...gorequest.Params) (body []byte, err error)

RestOilCardEdit 编辑充值卡

func (*Client) RestOilCardInfo added in v1.0.47

func (c *Client) RestOilCardInfo(ctx context.Context, notMustParams ...gorequest.Params) (body []byte, err error)

RestOilCardInfo 油卡详情

func (*Client) RestOilOrderPush added in v1.0.47

func (c *Client) RestOilOrderPush(ctx context.Context, notMustParams ...gorequest.Params) (body []byte, err error)

RestOilOrderPush 充值下单

func (*Client) RestOilOrderQuery added in v1.0.47

func (c *Client) RestOilOrderQuery(ctx context.Context, notMustParams ...gorequest.Params) (body []byte, err error)

RestOilOrderQuery 订单查询

func (*Client) RestPowerAddCard added in v1.0.47

func (c *Client) RestPowerAddCard(ctx context.Context, notMustParams ...gorequest.Params) *RestPowerAddCardResult

RestPowerAddCard 添加电费充值卡 https://open.wikeyun.cn/#/apiDocument/9/document/326

func (*Client) RestPowerCancel added in v1.0.47

func (c *Client) RestPowerCancel(ctx context.Context, orderNumber string) *RestPowerCancelResult

RestPowerCancel 电费订单取消 https://open.wikeyun.cn/#/apiDocument/9/document/323

func (*Client) RestPowerDelCard added in v1.0.47

func (c *Client) RestPowerDelCard(ctx context.Context, cardId string) *RestPowerDelCardResult

RestPowerDelCard 删除电费充值卡 https://open.wikeyun.cn/#/apiDocument/9/document/330

func (*Client) RestPowerEditCard added in v1.0.47

func (c *Client) RestPowerEditCard(ctx context.Context, notMustParams ...gorequest.Params) (body []byte, err error)

RestPowerEditCard 编辑电费充值卡 https://open.wikeyun.cn/#/apiDocument/9/document/329

func (*Client) RestPowerPushOrder added in v1.0.47

func (c *Client) RestPowerPushOrder(ctx context.Context, notMustParams ...gorequest.Params) *RestPowerPushOrderResult

RestPowerPushOrder 电费充值API https://open.wikeyun.cn/#/apiDocument/9/document/311

func (*Client) RestPowerPushOrderNotifyGin added in v1.0.52

func (c *Client) RestPowerPushOrderNotifyGin(ctx context.Context, ginCtx *gin.Context) (ResponseRestPowerPushOrderNotifyGin, error)

RestPowerPushOrderNotifyGin 电费充值API - 回调通知 https://open.wikeyun.cn/#/document/1/article/303

func (*Client) RestPowerQuery added in v1.0.47

func (c *Client) RestPowerQuery(ctx context.Context, orderNumber string) (*RestPowerQueryResult, error)

RestPowerQuery 电费订单查询 https://open.wikeyun.cn/#/apiDocument/9/document/313

func (*Client) RestRechargeCancel added in v1.0.47

func (c *Client) RestRechargeCancel(ctx context.Context, orderNumber string) *RestRechargeCancelResult

RestRechargeCancel 话费订单取消 https://open.wikeyun.cn/#/apiDocument/9/document/300

func (*Client) RestRechargeMobileInfo added in v1.0.47

func (c *Client) RestRechargeMobileInfo(ctx context.Context, orderNumber string) *RestRechargeMobileInfoResult

RestRechargeMobileInfo 查询手机归属地信息以及是否携号转网 https://open.wikeyun.cn/#/apiDocument/9/document/374

func (*Client) RestRechargePushOrder added in v1.0.47

func (c *Client) RestRechargePushOrder(ctx context.Context, notMustParams ...gorequest.Params) *RestRechargePushOrderResult

RestRechargePushOrder 话费充值推送 https://open.wikeyun.cn/#/apiDocument/9/document/298

func (*Client) RestRechargePushOrderNotifyGin added in v1.0.52

func (c *Client) RestRechargePushOrderNotifyGin(ctx context.Context, ginCtx *gin.Context) (ResponseRestRechargePushOrderNotifyGin, error)

RestRechargePushOrderNotifyGin 话费充值推送 - 回调通知 https://open.wikeyun.cn/#/document/1/article/302

func (*Client) RestRechargeQuery added in v1.0.47

func (c *Client) RestRechargeQuery(ctx context.Context, orderNumber string) (*RestRechargeQueryResult, error)

RestRechargeQuery 话费订单查询 https://open.wikeyun.cn/#/apiDocument/9/document/299

func (*Client) RestRechargeVerify added in v1.0.51

func (c *Client) RestRechargeVerify(ctx context.Context, mobile string, amount int64, rechargeType int) *RestRechargeVerifyResult

RestRechargeVerify 话费充值验证 https://open.wikeyun.cn/#/apiDocument/9/document/405

func (*Client) RestUserQuery added in v1.0.47

func (c *Client) RestUserQuery(ctx context.Context) *RestUserQueryResult

RestUserQuery 用户信息 https://open.wikeyun.cn/#/apiDocument/10/document/336

type ClientConfig added in v1.0.52

type ClientConfig struct {
	StoreId   int64  // 店铺ID
	AppKey    int64  // key
	AppSecret string // secret
	CurrentIp string // 当前ip
}

ClientConfig 实例配置

type ResponseRestPowerPushOrderNotifyGin added in v1.0.52

type ResponseRestPowerPushOrderNotifyGin struct {
	Status        int     `form:"status" json:"status" xml:"status" uri:"status" binding:"omitempty"`                                // 状态 订单状态 0 待支付 1 已付 充值中 2充值成功 3充值失败 需要退款 4退款成功 5已超时 6待充值 7 已匹配 8 已存单 9 已取消 10返销 11部分到账
	ArrivedAmount string  `form:"arrived_amount" json:"arrived_amount" xml:"arrived_amount" uri:"arrived_amount" binding:"required"` // 到账金额
	OrderNo       string  `form:"order_no" json:"order_no" xml:"order_no" uri:"order_no" binding:"required"`                         // 第三方单号
	OrderNumber   string  `form:"order_number" json:"order_number" xml:"order_number" uri:"order_number" binding:"required"`         // 微客云平台单号
	Amount        string  `form:"amount" json:"amount" xml:"amount" uri:"amount" binding:"required"`                                 // 充值金额,如50,100,200可选
	Fanli         float64 `form:"fanli" json:"fanli" xml:"fanli" uri:"fanli" binding:"required"`                                     // 返利金额
	CostPrice     float64 `form:"cost_price" json:"cost_price" xml:"cost_price" uri:"cost_price" binding:"required"`                 // 成本价格
	Sign          string  `form:"sign" json:"sign" xml:"sign" uri:"sign" binding:"omitempty"`                                        // 加密内容
	FailReason    string  `form:"failReason" json:"failReason" xml:"failReason" uri:"failReason" binding:"omitempty"`                // 失败原因,有些渠道没有返回,不是很准确,但电费失败大部分原因都是户号不对或者地区不对或者缴费金额小于欠费金额
}

type ResponseRestRechargePushOrderNotifyGin added in v1.0.52

type ResponseRestRechargePushOrderNotifyGin struct {
	Status      int     `form:"status" json:"status" xml:"status" uri:"status" binding:"omitempty"`                        // 状态 订单状态 0 待支付 1 已付 充值中 2充值成功 3充值失败 需要退款 4退款成功 5已超时 6待充值 7 已匹配 8 已存单 9 已取消 10返销 11部分到账
	Mobile      string  `form:"mobile" json:"mobile" xml:"mobile" uri:"mobile" binding:"required"`                         // 充值手机号
	OrderNo     string  `form:"order_no" json:"order_no" xml:"order_no" uri:"order_no" binding:"required"`                 // 第三方单号
	OrderNumber string  `form:"order_number" json:"order_number" xml:"order_number" uri:"order_number" binding:"required"` // 微客云平台单号
	Amount      string  `form:"amount" json:"amount" xml:"amount" uri:"amount" binding:"required"`                         // 充值金额,如50,100,200可选
	Fanli       float64 `form:"fanli" json:"fanli" xml:"fanli" uri:"fanli" binding:"required"`                             // 返利金额
	CostPrice   float64 `form:"cost_price" json:"cost_price" xml:"cost_price" uri:"cost_price" binding:"required"`         // 成本价格
	Sign        string  `form:"sign" json:"sign" xml:"sign" uri:"sign" binding:"omitempty"`                                // 加密内容
}

type RestPowerAddCardResponse added in v1.0.44

type RestPowerAddCardResponse struct {
	Code string `json:"code"`
	Msg  string `json:"msg"`
	Time string `json:"time"`
	Data struct {
		CardNum    string `json:"card_num"`
		StoreId    string `json:"store_id"`
		CreateTime int    `json:"create_time"`
		Type       int    `json:"type"` // 缴费单位
		CmsUid     int    `json:"cms_uid"`
		Province   string `json:"province"` // 缴费省份
		City       string `json:"city"`     // 缴费城市
		Id         string `json:"id"`       // 缴费卡编号
	} `json:"data"`
}

type RestPowerAddCardResult added in v1.0.44

type RestPowerAddCardResult struct {
	Result RestPowerAddCardResponse // 结果
	Body   []byte                   // 内容
	Http   gorequest.Response       // 请求
	Err    error                    // 错误
}

type RestPowerCancelResponse added in v1.0.47

type RestPowerCancelResponse struct {
	Code string `json:"code"`
	Msg  string `json:"msg"`
	Data string `json:"data"`
}

type RestPowerCancelResult added in v1.0.47

type RestPowerCancelResult struct {
	Result RestPowerCancelResponse // 结果
	Body   []byte                  // 内容
	Http   gorequest.Response      // 请求
	Err    error                   // 错误
}

type RestPowerDelCardResponse added in v1.0.47

type RestPowerDelCardResponse struct {
	Data string `json:"data"`
	Code string `json:"code"`
	Msg  string `json:"msg"`
	Time string `json:"time"`
}

type RestPowerDelCardResult added in v1.0.47

type RestPowerDelCardResult struct {
	Result RestPowerDelCardResponse // 结果
	Body   []byte                   // 内容
	Http   gorequest.Response       // 请求
	Err    error                    // 错误
}

type RestPowerPushOrderResponse added in v1.0.44

type RestPowerPushOrderResponse struct {
	Code string `json:"code"`
	Msg  string `json:"msg"`
	Time string `json:"time"`
	Data struct {
		OrderNumber string `json:"order_number"`
	} `json:"data"`
}

type RestPowerPushOrderResult added in v1.0.44

type RestPowerPushOrderResult struct {
	Result RestPowerPushOrderResponse // 结果
	Body   []byte                     // 内容
	Http   gorequest.Response         // 请求
	Err    error                      // 错误
}

type RestPowerQueryResponse added in v1.0.44

type RestPowerQueryResponse struct {
	Code string `json:"code"`
	Msg  string `json:"msg"`
	Time string `json:"time"`
	Data struct {
		Id             uint   `json:"id,omitempty"`
		Fanli          string `json:"fanli"`            // 平台返利金额
		Amount         int64  `json:"amount"`           // 充值金额
		CostPrice      string `json:"cost_price"`       // 成本价格
		Status         int    `json:"status"`           // 订单状态 0 待支付 1 已付 充值中 2充值成功 3充值失败 需要退款 4退款成功 5已超时 6待充值 7 已匹配 8已存单 9 已取消 10返销 11部分到账 12取消中
		OrderNumber    string `json:"order_number"`     // 平台单号
		OrderNo        string `json:"order_no"`         // 第三方单号
		OrgOrderNumber string `json:"org_order_number"` // 组织订单号
		CardId         string `json:"card_id"`          // 充值卡ID
		ArrivedAmount  int64  `json:"arrived_amount"`   // 到账金额
		Reason         string `json:"reason,omitempty"` // 失败原因
	} `json:"data"`
}

func (RestPowerQueryResponse) GetStatusDesc added in v1.0.85

func (resp RestPowerQueryResponse) GetStatusDesc(status int) string

type RestPowerQueryResult added in v1.0.44

type RestPowerQueryResult struct {
	Result RestPowerQueryResponse // 结果
	Body   []byte                 // 内容
	Http   gorequest.Response     // 请求
}

type RestRechargeCancelResponse added in v1.0.47

type RestRechargeCancelResponse struct {
	Code string `json:"code"`
	Msg  string `json:"msg"`
	Data string `json:"data"`
}

type RestRechargeCancelResult added in v1.0.47

type RestRechargeCancelResult struct {
	Result RestRechargeCancelResponse // 结果
	Body   []byte                     // 内容
	Http   gorequest.Response         // 请求
	Err    error                      // 错误
}

type RestRechargeMobileInfoResponse added in v1.0.47

type RestRechargeMobileInfoResponse struct {
	Code string `json:"code"`
	Msg  string `json:"msg"`
	Time string `json:"time"`
	Data struct {
		Status string `json:"status"`
		Oisp   string `json:"oisp"`
		Nisp   string `json:"nisp"`
		Number string `json:"number"`
		Extend struct {
			AreaNum       string `json:"area_num"`
			Isp           string `json:"isp"`
			Prov          string `json:"prov"`
			City          string `json:"city"`
			PostCode      string `json:"post_code"`
			AreaCode      string `json:"area_code"`
			CardProvCode  string `json:"card_prov_code"`
			CardCityCode  string `json:"card_city_code"`
			Lng           string `json:"lng"`
			Lat           string `json:"lat"`
			CityCode      string `json:"city_code"`
			CityShortCode string `json:"city_short_code"`
		} `json:"extend"`
	} `json:"data"`
}

type RestRechargeMobileInfoResult added in v1.0.47

type RestRechargeMobileInfoResult struct {
	Result RestRechargeMobileInfoResponse // 结果
	Body   []byte                         // 内容
	Http   gorequest.Response             // 请求
	Err    error                          // 错误
}

type RestRechargePushOrderResponse added in v1.0.44

type RestRechargePushOrderResponse struct {
	Code string `json:"code"`
	Msg  string `json:"msg"`
	Data struct {
		OrderNumber string `json:"order_number"`
	} `json:"data"`
}

type RestRechargePushOrderResult added in v1.0.44

type RestRechargePushOrderResult struct {
	Result RestRechargePushOrderResponse // 结果
	Body   []byte                        // 内容
	Http   gorequest.Response            // 请求
	Err    error                         // 错误
}

type RestRechargeQueryResponse added in v1.0.44

type RestRechargeQueryResponse struct {
	Code string `json:"code"`
	Data struct {
		Id             int    `json:"id,omitempty"`
		Fanli          string `json:"fanli"`            // 平台返利金额
		Amount         int64  `json:"amount"`           // 充值金额
		CostPrice      string `json:"cost_price"`       // 充值成本价格
		Status         int    `json:"status"`           // 订单状态 0 待支付 1 已付 充值中 2充值成功 3充值失败 需要退款 4退款成功 5已超时 6待充值 7 已匹配 8已存单 9 已取消 10返销 11部分到账 12取消中
		OrderNumber    string `json:"order_number"`     // 平台订单号
		OrderNo        string `json:"order_no"`         // 第三方单号
		OrgOrderNumber string `json:"org_order_number"` // 组织订单号
		StoreId        int    `json:"store_id"`         // 店铺ID
		Mobile         string `json:"mobile"`           // 充值手机号
		ArrivedAmount  string `json:"arrived_amount"`   // 到账金额
		Reason         string `json:"reason,omitempty"` // 失败原因
	} `json:"data"`
	Msg  string `json:"msg"`
	Time string `json:"time"`
}

func (RestRechargeQueryResponse) GetStatusDesc added in v1.0.85

func (resp RestRechargeQueryResponse) GetStatusDesc(status int) string

type RestRechargeQueryResult added in v1.0.44

type RestRechargeQueryResult struct {
	Result RestRechargeQueryResponse // 结果
	Body   []byte                    // 内容
	Http   gorequest.Response        // 请求
}

type RestRechargeVerifyResponse added in v1.0.51

type RestRechargeVerifyResponse struct {
	Code string `json:"code"` // 0000代表正常,其他代表不可下单。
	Msg  string `json:"msg"`
	Time string `json:"time"`
}

type RestRechargeVerifyResult added in v1.0.51

type RestRechargeVerifyResult struct {
	Result RestRechargeVerifyResponse // 结果
	Body   []byte                     // 内容
	Http   gorequest.Response         // 请求
	Err    error                      // 错误
}

type RestUserQueryResponse added in v1.0.44

type RestUserQueryResponse struct {
	Code string `json:"code"`
	Msg  string `json:"msg"`
	Data struct {
		Id     string `json:"id"`
		Avatar string `json:"avatar"`
		Money  string `json:"money"`
		Mobile string `json:"mobile"`
	} `json:"data"`
}

type RestUserQueryResult added in v1.0.44

type RestUserQueryResult struct {
	Result RestUserQueryResponse // 结果
	Body   []byte                // 内容
	Http   gorequest.Response    // 请求
	Err    error                 // 错误
}

Jump to

Keyboard shortcuts

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