praise_goodness

package module
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CodeSuccess = 1
	CodeError   = -1
)
View Source
const (
	LogTable = "praise_goodness"
)
View Source
const (
	Version = "1.0.4"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AddProductOrderResponse

type AddProductOrderResponse struct {
	Code int      `json:"code"` // 1:请求成功 -1:请求失败
	Msg  string   `json:"msg"`  // 返回说明
	Time string   `json:"time"` // 时间戳
	Data struct{} `json:"data"`
}

type AddProductOrderResult

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

type Client

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

Client 实例

func NewClient

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

NewClient 创建实例化

func (*Client) AddProductOrder

func (c *Client) AddProductOrder(ctx context.Context, Type int64, mobile string, tradeID string, amount int64, official int64, area string, notifyurl string, notMustParams ...gorequest.Params) (*AddProductOrderResult, error)

AddProductOrder 下单接口 type = 固定值:1 mobile = 充值账号 trade_id = 商户订单号,10-32位 amount = 充值金额,单位 (元) ,只传整 数不带小数点,例如:100 official = 运营商 1 :中国移动 2 :中国联通 3 :中国电信 area = 归属地,填省份,如:山东,北京 ,内蒙古,黑龙江,重庆 填:auto,系统自动识别归属地 notifyurl = 回调通知地址

func (*Client) GetApiURL

func (c *Client) GetApiURL() string

func (*Client) GetKey

func (c *Client) GetKey() string

func (*Client) GetMchID

func (c *Client) GetMchID() int64

func (*Client) QuerySupplierOrderInfo

func (c *Client) QuerySupplierOrderInfo(ctx context.Context, tradeID string, notMustParams ...gorequest.Params) (*QuerySupplierOrderInfoResult, error)

QuerySupplierOrderInfo 订单查询接口 trade_id = 商户订单号

func (*Client) SetApiURL

func (c *Client) SetApiURL(v string) *Client

func (*Client) SetClientIP

func (c *Client) SetClientIP(clientIP string) *Client

SetClientIP 配置

func (*Client) SetKey

func (c *Client) SetKey(v string) *Client

func (*Client) SetLogFun

func (c *Client) SetLogFun(logFun gorequest.LogFunc)

SetLogFun 设置日志记录函数

func (*Client) SetMchID

func (c *Client) SetMchID(v int64) *Client

func (*Client) SetTrace

func (c *Client) SetTrace(trace bool)

SetTrace 设置OpenTelemetry链路追踪

func (*Client) SupplierBalance

func (c *Client) SupplierBalance(ctx context.Context, notMustParams ...gorequest.Params) (*SupplierBalanceResult, error)

SupplierBalance 用户余额查询接口

func (*Client) TraceEndSpan

func (c *Client) TraceEndSpan()

TraceEndSpan 结束OpenTelemetry链路追踪状态

func (*Client) TraceGetSpanID

func (c *Client) TraceGetSpanID() (spanID string)

TraceGetSpanID 获取OpenTelemetry链路追踪SpanID

func (*Client) TraceGetTraceID

func (c *Client) TraceGetTraceID() (traceID string)

TraceGetTraceID 获取OpenTelemetry链路追踪TraceID

func (*Client) TraceRecordError

func (c *Client) TraceRecordError(err error, options ...trace.EventOption)

TraceRecordError 记录OpenTelemetry链路追踪错误

func (*Client) TraceSetAttributes

func (c *Client) TraceSetAttributes(kv ...attribute.KeyValue)

TraceSetAttributes 设置OpenTelemetry链路追踪属性

func (*Client) TraceSetStatus

func (c *Client) TraceSetStatus(code codes.Code, description string)

TraceSetStatus 设置OpenTelemetry链路追踪状态

func (*Client) TraceStartSpan

func (c *Client) TraceStartSpan(ctx context.Context, spanName string) context.Context

TraceStartSpan 开始OpenTelemetry链路追踪状态

type ClientConfig

type ClientConfig struct {
	ApiURL string // 接口地址
	MchID  int64
	Key    string
}

ClientConfig 实例配置

type QuerySupplierOrderInfoResponse

type QuerySupplierOrderInfoResponse struct {
	Code int    `json:"code"` // 1:请求成功 -1:请求失败
	Msg  string `json:"msg"`  // 返回说明
	Time string `json:"time"` // 时间戳
	Data struct {
		OrderID    string `json:"order_id"`   // 我方订单号
		TradeID    string `json:"trade_id"`   // 商户订单号
		Status     int    `json:"status"`     // 88:充值成功 22:充值失败 66:充值中 55:订单不存在
		Voucher    string `json:"voucher"`    // 充值凭证 (有可能为空值,不一定返回)
		Createtime int    `json:"createtime"` // 订单创建时间
		Proof      string `json:"proof"`      // 请求token
	} `json:"data"`
}

func (QuerySupplierOrderInfoResponse) GetStatusDesc

func (QuerySupplierOrderInfoResponse) GetStatusDesc(status int) string

type QuerySupplierOrderInfoResult

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

type SupplierBalanceResponse

type SupplierBalanceResponse struct {
	Code int    `json:"code"` // 1:请求成功 -1:请求失败
	Msg  string `json:"msg"`  // 返回说明
	Time string `json:"time"` // 时间戳
	Data struct {
		Balance string `json:"balance"` // 用户余额
	} `json:"data"`
}

type SupplierBalanceResult

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

Jump to

Keyboard shortcuts

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