wikeyun

package
v1.0.210 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2023 License: MIT Imports: 13 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) ConfigSLogClientFun added in v1.0.162

func (c *Client) ConfigSLogClientFun(apiSLogFun golog.ApiSLogFun)

ConfigSLogClientFun 日志配置

func (*Client) DefaultHttp added in v1.0.177

func (c *Client) DefaultHttp()

DefaultHttp 默认请求

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) RestPowerAddCard added in v1.0.47

func (c *Client) RestPowerAddCard(ctx context.Context, cardNum string, province string, city string, Type int64, notMustParams ...gorequest.Params) (*RestPowerAddCardResult, error)

RestPowerAddCard 添加电费充值卡 card_num = 用户电费户号 province = 省份,带省 city = 城市,带市 type = 0国家电网 1南方电网 remark = 备注 user_ext = 南网必填,请输入用户信息,身份证后六位 / 营业执照后六位 / 银行卡后六位 ,三者选任意一个即可 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, notMustParams ...gorequest.Params) (*RestPowerCancelResult, error)

RestPowerCancel 电费订单取消 order_number = 取消的单号,多个用英文逗号隔开 https://open.wikeyun.cn/#/apiDocument/9/document/323

func (*Client) RestPowerCardInfo added in v1.0.206

func (c *Client) RestPowerCardInfo(ctx context.Context, cardID int64, notMustParams ...gorequest.Params) (*RestPowerCardInfoResult, error)

RestPowerCardInfo 电费充值卡详情 card_id = 充值卡ID https://open.wikeyun.cn/#/apiDocument/9/document/333

func (*Client) RestPowerDelCard added in v1.0.47

func (c *Client) RestPowerDelCard(ctx context.Context, cardID int64, notMustParams ...gorequest.Params) (*RestPowerDelCardResult, error)

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

func (*Client) RestPowerEditCard added in v1.0.47

func (c *Client) RestPowerEditCard(ctx context.Context, cardID int64, cardNum string, province string, city string, Type int64, notMustParams ...gorequest.Params) (*RestPowerEditCardResult, error)

RestPowerEditCard 编辑电费充值卡 card_id = 充值卡ID card_num = 卡号 province = 省份 city = 城市 type = 0国家电网 1南方电网 remark = 备注 user_ext = 南网必填,请输入用户信息,身份证后六位 / 营业执照后六位 / 银行卡后六位 ,三者选任意一个即可 https://open.wikeyun.cn/#/apiDocument/9/document/329

func (*Client) RestPowerPushOrder added in v1.0.47

func (c *Client) RestPowerPushOrder(ctx context.Context, cardID int64, orderNo string, amount int64, rechargeType int64, notMustParams ...gorequest.Params) (*RestPowerPushOrderResult, error)

RestPowerPushOrder 电费充值API cardId = 充值卡ID,通过创建充值卡接口获取 order_no = 第三方单号 amount = 充值金额,支持100,200,300,400,500,600,800,1000 recharge_type = 类型 1快充 0慢充 notify_url = 回调通知地址,用于订单状态通知 change = 是否开启更换渠道补单,1开启0关闭 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, notMustParams ...gorequest.Params) (*RestPowerQueryResult, error)

RestPowerQuery 电费订单查询 order_number = 平台单号,平台商户单号二选一 order_no = 商户单号 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, notMustParams ...gorequest.Params) (*RestRechargeCancelResult, error)

RestRechargeCancel 话费订单取消 order_number = 取消的单号,多个用英文逗号隔开 https://open.wikeyun.cn/#/apiDocument/9/document/300

func (*Client) RestRechargeMobileInfo added in v1.0.47

func (c *Client) RestRechargeMobileInfo(ctx context.Context, mobile string, notMustParams ...gorequest.Params) (*RestRechargeMobileInfoResult, error)

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

func (*Client) RestRechargePushOrder added in v1.0.47

func (c *Client) RestRechargePushOrder(ctx context.Context, mobile string, orderNo string, money int64, rechargeType int64, notifyUrl string, notMustParams ...gorequest.Params) (*RestRechargePushOrderResult, error)

RestRechargePushOrder 话费充值推送 mobile = 充值手机号,虚拟号,协号转网不支持充值 order_no = 第三方单号 money = 充值金额,目前有50,100,200三种,具体联系客服咨询 recharge_type = 类型 1快充 0慢充 notify_url = 回调通知地址,用于订单状态通知 change = 失败更换渠道充值 0 否 1是 不传系统根据设置判断 source = 是否强制渠道,因为每个渠道价格不同,不同用户提交的业务不同,默认不强制,具体渠道价格联系客服 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, notMustParams ...gorequest.Params) (*RestRechargeQueryResult, error)

RestRechargeQuery 话费订单查询 order_number = 平台单号,平台商户单号二选一 order_no = 商户单号 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 int64, notMustParams ...gorequest.Params) (*RestRechargeVerifyResult, error)

RestRechargeVerify 话费充值验证 mobile = 需要充值的手机号 amount = 需要充值的金额 recharge_type = 充值类型 https://open.wikeyun.cn/#/apiDocument/9/document/405

func (*Client) RestUserQuery added in v1.0.47

func (c *Client) RestUserQuery(ctx context.Context, notMustParams ...gorequest.Params) (*RestUserQueryResult, error)

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

func (*Client) SetHttp added in v1.0.177

func (c *Client) SetHttp(app *gorequest.App)

SetHttp 配置请求

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"`    // 店铺ID
		CreateTime int    `json:"create_time"` // 创建时间
		Type       int    `json:"type"`        // 0国家电网 1南方电网
		CmsUid     int    `json:"cms_uid"`
		Province   string `json:"province"` // 省份,带省。
		City       string `json:"city"`     // 城市,带市
		Id         string `json:"id"`       // 充值卡ID,用于电费推单
		Remark     string `json:"remark"`   // 备注
	} `json:"data"`
}

type RestPowerAddCardResult added in v1.0.44

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

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      // 请求
}

type RestPowerCardInfoResponse added in v1.0.206

type RestPowerCardInfoResponse struct {
	Code string `json:"code"`
	Msg  string `json:"msg"`
	Time string `json:"time"`
	Data struct {
		Id       string `json:"id"`       // 充值卡ID,用于电费推单
		CardNum  string `json:"card_num"` // 用户电费户号
		Province string `json:"province"` // 省份,带省。
		City     string `json:"city"`     // 城市,带市
		StoreId  string `json:"store_id"` // 店铺ID
		Type     int    `json:"type"`     // 0国家电网 1南方电网
		Remark   string `json:"remark"`
	} `json:"data"`
}

type RestPowerCardInfoResult added in v1.0.206

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

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       // 请求
}

type RestPowerEditCardResponse added in v1.0.182

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

type RestPowerEditCardResult added in v1.0.182

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

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         // 请求
}

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         // 请求
}

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             // 请求
}

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            // 请求
}

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         // 请求
}

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    // 请求
}

Jump to

Keyboard shortcuts

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