Documentation
¶
Index ¶
- Constants
- func ErrorInfo[...](error ET) string
- func OperatorInfo(operator string) string
- func StateInfo[...](state ST) string
- type ChOngZhiJkOrdersResponse
- type ChOngZhiJkOrdersResult
- type CheckCostResponse
- type CheckCostResult
- type Client
- func (c *Client) ChOngZhiJkOrders(ctx context.Context, orderid string, face int64, account string, amount int64, ...) (*ChOngZhiJkOrdersResult, error)
- func (c *Client) CheckCost(ctx context.Context, orderid string, notMustParams ...gorequest.Params) (*CheckCostResult, error)
- func (c *Client) FindBalance(ctx context.Context, notMustParams ...gorequest.Params) (*FindBalanceResult, error)
- func (c *Client) FindOrder(ctx context.Context, orderID string, notMustParams ...gorequest.Params) (*FindOrderResult, error)
- func (c *Client) GetKey() string
- func (c *Client) GetPwd() string
- func (c *Client) GetUserId() string
- func (c *Client) GprsChOngZhiAdvance(ctx context.Context, orderid string, account string, gprs int64, area int64, ...) (*GprsChOngZhiAdvanceResult, error)
- func (c *Client) MoneyJkUser(ctx context.Context, notMustParams ...gorequest.Params) (*MoneyJkUserResult, error)
- func (c *Client) QueryJkOrders(ctx context.Context, orderid string, notMustParams ...gorequest.Params) (*QueryJkOrdersResult, error)
- func (c *Client) QueryTxProduct(ctx context.Context, notMustParams ...gorequest.Params) (*QueryTxProductResult, error)
- func (c *Client) Recharge(ctx context.Context, rechargeType int64, orderId string, account string, ...) (*RechargeResult, error)
- func (c *Client) SetClientIP(clientIP string) *Client
- func (c *Client) SetKey(v string) *Client
- func (c *Client) SetLogFun(logFun gorequest.LogFunc)
- func (c *Client) SetPwd(v string) *Client
- func (c *Client) SetTrace(trace bool)
- func (c *Client) SetUserId(v string) *Client
- func (c *Client) TraceEndSpan()
- func (c *Client) TraceGetSpanID() (spanID string)
- func (c *Client) TraceGetTraceID() (traceID string)
- func (c *Client) TraceRecordError(err error, options ...trace.EventOption)
- func (c *Client) TraceSetAttributes(kv ...attribute.KeyValue)
- func (c *Client) TraceSetStatus(code codes.Code, description string)
- func (c *Client) TraceStartSpan(ctx context.Context, spanName string) context.Context
- func (c *Client) TxChOngZhi(ctx context.Context, orderid string, account string, productid int64, ...) (*TxChOngZhiResult, error)
- type ClientConfig
- type FindBalanceResponse
- type FindBalanceResult
- type FindOrderResponse
- type FindOrderResult
- type GprsChOngZhiAdvanceParams
- type GprsChOngZhiAdvanceResponse
- type GprsChOngZhiAdvanceResult
- type MoneyJkUserResponse
- type MoneyJkUserResult
- type QueryJkOrdersResponse
- type QueryJkOrdersResult
- type QueryTxProductResponse
- type QueryTxProductResult
- type RechargeResponse
- type RechargeResult
- type TxChOngZhiParams
- type TxChOngZhiResponse
- type TxChOngZhiResult
Constants ¶
const (
LogTable = "ejiaofei"
)
const (
Version = "1.0.14"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ChOngZhiJkOrdersResponse ¶
type ChOngZhiJkOrdersResponse struct {
XMLName xml.Name `xml:"response"`
UserID string `xml:"userid"` // 会员账号
PorderID string `xml:"Porderid"` // 鼎信平台订单号
OrderID string `xml:"orderid"` // 用户订单号
Account string `xml:"account"` // 需要充值的手机号码
Face string `xml:"face"` // 充值面值
Amount string `xml:"amount"` // 购买数量
StartTime string `xml:"starttime"` // 开始时间
State string `xml:"state"` // 订单状态
EndTime string `xml:"endtime"` // 结束时间
Error string `xml:"error"` // 错误提示
}
type ChOngZhiJkOrdersResult ¶
type ChOngZhiJkOrdersResult struct {
Result ChOngZhiJkOrdersResponse // 结果
Body []byte // 内容
Http gorequest.Response // 请求
}
type CheckCostResponse ¶
type CheckCostResult ¶
type CheckCostResult struct {
Result CheckCostResponse // 结果
Body []byte // 内容
Http gorequest.Response // 请求
}
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client 实例
func (*Client) ChOngZhiJkOrders ¶
func (c *Client) ChOngZhiJkOrders(ctx context.Context, orderid string, face int64, account string, amount int64, notMustParams ...gorequest.Params) (*ChOngZhiJkOrdersResult, error)
ChOngZhiJkOrders 话费充值接口 orderid = 用户提交的订单号 用户提交的订单号,最长32位(用户保证其唯一性) face = 充值面值 以元为单位,包含10、20、30、50、100、200、300、500 移动联通电信 account = 手机号码 需要充值的手机号码 amount = 购买数量 只能为1 operator = 运营商可指定当前手机号的运营商信息进行充值,为空则自动匹配号段对应的运营商进行充值; 具体对应的运营商信息表3.3
func (*Client) CheckCost ¶
func (c *Client) CheckCost(ctx context.Context, orderid string, notMustParams ...gorequest.Params) (*CheckCostResult, error)
CheckCost 会员订单成本价查询接口 orderid 用户订单号 用户提交订单号
func (*Client) FindBalance ¶ added in v1.0.10
func (c *Client) FindBalance(ctx context.Context, notMustParams ...gorequest.Params) (*FindBalanceResult, error)
FindBalance 余额查询接口
func (*Client) FindOrder ¶ added in v1.0.10
func (c *Client) FindOrder(ctx context.Context, orderID string, notMustParams ...gorequest.Params) (*FindOrderResult, error)
FindOrder 订单查询接口 orderId = 用户提交的订单号 是 用户提交的订单号,最长32位(用户保证其唯一性)
func (*Client) GprsChOngZhiAdvance ¶
func (c *Client) GprsChOngZhiAdvance(ctx context.Context, orderid string, account string, gprs int64, area int64, effectTime int64, validity int64, notMustParams ...gorequest.Params) (*GprsChOngZhiAdvanceResult, error)
GprsChOngZhiAdvance 流量充值接口 orderid = 用户提交的订单号 用户提交的订单号,最长32位(用户保证其唯一性) account = 充值手机号 需要充值的手机号 gprs = 充值流量值 单位:MB(具体流量值请咨询商务) area = 充值流量范围 0 全国流量,1 省内流量 effecttime = 生效日期 0 即时生效,1次日生效,2 次月生效 validity = 流量有效期 传入月数,0为当月有效
func (*Client) MoneyJkUser ¶
func (c *Client) MoneyJkUser(ctx context.Context, notMustParams ...gorequest.Params) (*MoneyJkUserResult, error)
MoneyJkUser 用户余额查询
func (*Client) QueryJkOrders ¶
func (c *Client) QueryJkOrders(ctx context.Context, orderid string, notMustParams ...gorequest.Params) (*QueryJkOrdersResult, error)
QueryJkOrders 通用查询接口 orderid = 用户提交的订单号 用户提交的订单号,最长32位(用户保证其唯一性)
func (*Client) QueryTxProduct ¶
func (c *Client) QueryTxProduct(ctx context.Context, notMustParams ...gorequest.Params) (*QueryTxProductResult, error)
QueryTxProduct 可充值腾讯产品查询
func (*Client) Recharge ¶ added in v1.0.10
func (c *Client) Recharge(ctx context.Context, rechargeType int64, orderId string, account string, face int64, notMustParams ...gorequest.Params) (*RechargeResult, error)
Recharge 充值接口 rechargeType = 充值类型(1-话费,2-流量,3-加油卡) 由鼎信商务提供 orderId = 用户提交的订单号 用户提交的订单号,最长32位(用户保证其唯一性) account = 充值账户 需要充值的手机号码 face = 充值面值 话费以元为单位,包含10、20、30、50、100、200、300、500 移动联通电信; 加油卡以元为单位,包含50、100、200、500、800、1000、2000; 流量待定 isSlowRecharge = 是否慢充 0-否 1-是 默认不传会指定快充 area = 充值流量范围 0 全国流量,1 省内流量 effectTime = 生效日期 0 即时生效,1次日生效,2 次月生效 validity = 流量有效期数量 所传为正整数 unit = 流量有效期 0/小时,1/天 ,2/个月,3/季度,4/年 oilType = 加油卡类型(300-中石化,310-中石油) operator = 运营商
func (*Client) SetClientIP ¶ added in v1.0.13
SetClientIP 配置
func (*Client) TraceEndSpan ¶ added in v1.0.13
func (c *Client) TraceEndSpan()
TraceEndSpan 结束OpenTelemetry链路追踪状态
func (*Client) TraceGetSpanID ¶ added in v1.0.13
TraceGetSpanID 获取OpenTelemetry链路追踪SpanID
func (*Client) TraceGetTraceID ¶ added in v1.0.13
TraceGetTraceID 获取OpenTelemetry链路追踪TraceID
func (*Client) TraceRecordError ¶ added in v1.0.13
func (c *Client) TraceRecordError(err error, options ...trace.EventOption)
TraceRecordError 记录OpenTelemetry链路追踪错误
func (*Client) TraceSetAttributes ¶ added in v1.0.13
TraceSetAttributes 设置OpenTelemetry链路追踪属性
func (*Client) TraceSetStatus ¶ added in v1.0.13
TraceSetStatus 设置OpenTelemetry链路追踪状态
func (*Client) TraceStartSpan ¶ added in v1.0.13
TraceStartSpan 开始OpenTelemetry链路追踪状态
func (*Client) TxChOngZhi ¶
func (c *Client) TxChOngZhi(ctx context.Context, orderid string, account string, productid int64, amount int64, notMustParams ...gorequest.Params) (*TxChOngZhiResult, error)
TxChOngZhi 流量充值接口 orderid = 用户提交的订单号 用户提交的订单号,最长32位(用户保证其唯一性) account = QQ号 需要充值的QQ号 productid = 产品id 可以通过2.5查询 amount = 购买数量 ip = 可以为空
type ClientConfig ¶ added in v1.0.4
ClientConfig 实例配置
type FindBalanceResponse ¶ added in v1.0.10
type FindBalanceResult ¶ added in v1.0.10
type FindBalanceResult struct {
Result FindBalanceResponse // 结果
Body []byte // 内容
Http gorequest.Response // 请求
}
type FindOrderResponse ¶ added in v1.0.10
type FindOrderResponse struct {
Code int64 `json:"code"` // 返回状态编码
State int64 `json:"state"` // 订单状态
AppId string `json:"appId"` // 用户编号
OrderId string `json:"orderId"` // 用户提交的订单号
POrderId string `json:"pOrderId"` // 平台订单号
UserPrice float64 `json:"userPrice"` // 扣款金额
EndTime int64 `json:"endTime"` // 结束时间
}
type FindOrderResult ¶ added in v1.0.10
type FindOrderResult struct {
Result FindOrderResponse // 结果
Body []byte // 内容
Http gorequest.Response // 请求
}
type GprsChOngZhiAdvanceParams ¶
type GprsChOngZhiAdvanceParams struct {
OrderID string `json:"orderid"` // 用户提交的订单号 用户提交的订单号,最长32位(用户保证其唯一性)
Account string `json:"account"` // 充值手机号 需要充值的手机号
Gprs int64 `json:"gprs"` // 充值流量值 单位:MB(具体流量值请咨询商务)
Area int64 `json:"area"` // 充值流量范围 0 全国流量,1 省内流量
EffectTime int64 `json:"effecttime"` // 生效日期 0 即时生效,1次日生效,2 次月生效
Validity int64 `json:"validity"` // 流量有效期 传入月数,0为当月有效
Times string `json:"times"` // 时间戳 格式:yyyyMMddhhmmss
}
type GprsChOngZhiAdvanceResponse ¶
type GprsChOngZhiAdvanceResponse struct {
XMLName xml.Name `xml:"response"`
UserID string `xml:"userid"` // 会员账号
OrderID string `xml:"orderid"` // 会员提交订单号
PorderID string `xml:"Porderid"` // 平台订单号
Account string `xml:"account"` // 充值手机号
State int64 `xml:"state"` // 订单状态
StartTime string `xml:"starttime"` // 开始时间
EndTime string `xml:"endtime"` // 结束时间
Error string `xml:"error"` // 错误提示
UserPrice float64 `xml:"userprice"` // 会员购买价格
Gprs string `xml:"gprs"` // 充值流量值(单位MB)
Area string `xml:"area"` // 流量范围(0 全国流量,1省内流量)
EffectTime string `xml:"effecttime"` // 生效日期(0即时,1次日,2次月)
Validity string `xml:"validity"` // 流量有效期(显示月数,0为当月)
}
type GprsChOngZhiAdvanceResult ¶
type GprsChOngZhiAdvanceResult struct {
Result GprsChOngZhiAdvanceResponse // 结果
Body []byte // 内容
Http gorequest.Response // 请求
}
type MoneyJkUserResponse ¶
type MoneyJkUserResult ¶
type MoneyJkUserResult struct {
Result MoneyJkUserResponse // 结果
Body []byte // 内容
Http gorequest.Response // 请求
}
type QueryJkOrdersResponse ¶
type QueryJkOrdersResponse struct {
XMLName xml.Name `xml:"response"`
UserID string `xml:"userid"` // 会员账号
POrderID string `xml:"Porderid"` // 鼎信平台订单号
OrderID string `xml:"orderid"` // 用户订单号
Account string `xml:"account"` // 需要充值的手机号码
Face string `xml:"face"` // 充值面值
Amount string `xml:"amount"` // 购买数量
StartTime string `xml:"starttime"` // 开始时间
State string `xml:"state"` // 订单状态
EndTime string `xml:"endtime"` // 结束时间
Error string `xml:"error"` // 错误提示
}
type QueryJkOrdersResult ¶
type QueryJkOrdersResult struct {
Result QueryJkOrdersResponse // 结果
Body []byte // 内容
Http gorequest.Response // 请求
}
type QueryTxProductResponse ¶
type QueryTxProductResult ¶
type QueryTxProductResult struct {
Result QueryTxProductResponse // 结果
Body []byte // 内容
Http gorequest.Response // 请求
}
type RechargeResponse ¶ added in v1.0.10
type RechargeResult ¶ added in v1.0.10
type RechargeResult struct {
Result RechargeResponse // 结果
Body []byte // 内容
Http gorequest.Response // 请求
}
type TxChOngZhiParams ¶
type TxChOngZhiParams struct {
OrderID string `json:"orderid"` // 用户提交的订单号 用户提交的订单号,最长32位(用户保证其唯一性)
Account string `json:"account"` // QQ号 需要充值的QQ号
ProductID int64 `json:"productid"` // 产品id
Amount int64 `json:"amount"` // 购买数量
Ip string `json:"ip"` // 充值QQ号ip
Times string `json:"times"` // 时间戳 格式:yyyyMMddhhmmss
}
type TxChOngZhiResponse ¶
type TxChOngZhiResponse struct {
XMLName xml.Name `xml:"response"`
UserID string `xml:"userid"` // 用户编号
PorderID string `xml:"Porderid"` // 鼎信平台订单号
OrderID string `xml:"orderid"` // 用户订单号
Account string `xml:"account"` // 需要充值的QQ号
ProductID int64 `xml:"productid"` // 充值产品id
Amount int64 `xml:"amount"` // 购买数量
State int64 `xml:"state"` // 订单状态
StartTime string `xml:"starttime"` // 开始时间
EndTime string `xml:"endtime"` // 结束时间
Error string `xml:"error"` // 错误提示
}
type TxChOngZhiResult ¶
type TxChOngZhiResult struct {
Result TxChOngZhiResponse // 结果
Body []byte // 内容
Http gorequest.Response // 请求
}