master
李光春 12 months ago
parent af516e8040
commit ae848ac95d

@ -33,7 +33,7 @@ require (
go.mongodb.org/mongo-driver v1.11.6
go.uber.org/zap v1.24.0
golang.org/x/crypto v0.9.0
golang.org/x/exp v0.0.0-20230510235704-dd950f8aeaea
golang.org/x/exp v0.0.0-20230515195305-f3d0a9c9a5cc
golang.org/x/text v0.9.0
gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df
gorm.io/datatypes v1.2.0

@ -618,8 +618,8 @@ golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58
golang.org/x/crypto v0.9.0 h1:LF6fAI+IutBocDJ2OT0Q1g8plpYljMZ4+lty+dsqw3g=
golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20230510235704-dd950f8aeaea h1:vLCWI/yYrdEHyN2JzIzPO3aaQJHQdp89IZBA/+azVC4=
golang.org/x/exp v0.0.0-20230510235704-dd950f8aeaea/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w=
golang.org/x/exp v0.0.0-20230515195305-f3d0a9c9a5cc h1:mCRnTeVUjcrhlRmO0VK8a6k6Rrf6TF9htwo2pJVSjIU=
golang.org/x/exp v0.0.0-20230515195305-f3d0a9c9a5cc/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w=
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=

@ -1,5 +1,5 @@
package go_library
func Version() string {
return "1.0.144"
return "1.0.145"
}

@ -9,15 +9,22 @@ import (
type CheckResponse struct {
Errno int64 `json:"errno"` // 错误码0代表成功非0代表失败
Errmsg string `json:"errmsg"` // 错误描述
Data struct {
OrderNumber string `json:"order_number"` // 系统定单号
OutTradeNum string `json:"out_trade_num"` // 商户订单号
CreateTime string `json:"create_time"` // 下单时间
Mobile string `json:"mobile"` // 手机号
ProductId string `json:"product_id"` // 产品ID
ChargeAmount float64 `json:"charge_amount"` // 充值成功面额
ChargeKami string `json:"charge_kami"` // 卡密流水
State string `json:"state"` // 充值状态:-1取消0充值中 1充值成功2充值失败3部分成功
Data []struct {
Id int64 `json:"id,omitempty"` // 编号
OrderNumber string `json:"order_number"` // 系统定单号
Status int64 `json:"status"` // 充值状态:-1取消0充值中 1充值成功2充值失败3部分成功
OutTradeNum string `json:"out_trade_num"` // 商户订单号
CreateTime int64 `json:"create_time"` // 下单时间
Mobile string `json:"mobile"` // 手机号
ProductId int64 `json:"product_id"` // 产品ID
ChargeAmount string `json:"charge_amount"` // 充值成功面额
ChargeKami string `json:"charge_kami"` // 卡密流水
Isp string `json:"isp,omitempty"` // 运营商
ProductName string `json:"product_name,omitempty"` // 产品名称
FinishTime int64 `json:"finish_time,omitempty"` // 完成时间
Remark string `json:"remark,omitempty"` // 备注
State int64 `json:"state"` // 充值状态:-1取消0充值中 1充值成功2充值失败3部分成功
Voucher string `json:"voucher,omitempty"` // 凭证
} `json:"data,omitempty"`
}

@ -10,13 +10,16 @@ type RechargeResponse struct {
Errno int64 `json:"errno"` // 错误码0代表成功非0代表失败
Errmsg string `json:"errmsg"` // 错误描述
Data struct {
OrderNumber string `json:"order_number"` // 系统定单号
Mobile string `json:"mobile"` // 充值手机号
ProductId string `json:"product_id"` // 产品ID
TotalPrice string `json:"total_price"` // 消费金额
OutTradeNum string `json:"out_trade_num"` // 商户订单号
Title string `json:"title"` // 充值产品说明
} `json:"data"`
CreateTime int64 `json:"create_time,omitempty"` // 下单时间
Guishu string `json:"guishu,omitempty"` // 归属地
Id int64 `json:"id,omitempty"` // 编号
Mobile string `json:"mobile"` // 充值手机号
OrderNumber string `json:"order_number"` // 系统定单号
OutTradeNum string `json:"out_trade_num"` // 商户订单号
ProductId int64 `json:"product_id"` // 产品ID
Title string `json:"title"` // 充值产品说明
TotalPrice string `json:"total_price"` // 消费金额
} `json:"data,omitempty"`
}
type RechargeResult struct {

@ -1,85 +0,0 @@
package slog
// A list[T] is an immutable sequence.
// It supports three operations: append, len and indexing (at).
// The zero value is an empty list.
//
// Repeated calls to append happen in amortized O(1) space and time. (Appending
// an element allocates one node directly, and the normalize operation always
// doubles the front slice, so we can charge two slots to each element.)
//
// The len method takes constant time.
//
// The at method requires a normalized list, and then takes constant time.
//
// It is possible to obtain quadratic behavior by alternating append and at:
// the normalize required by at is called for each appended element, causing
// front to be copied each time.
type list[T any] struct {
front []T
back *node[T] // reversed
lenBack int
}
type node[T any] struct {
el T
next *node[T]
}
// append returns a new list consisting of the receiver with x appended.
func (l list[T]) append(x T) list[T] {
if l.front == nil {
// Empty list; return one with one element.
return list[T]{
front: []T{x},
back: nil,
lenBack: 0,
}
}
if l.lenBack == len(l.front) {
// When there are as many elements in back as in front, grow
// front and move all of back to it.
l = l.normalize()
}
// Push a new node with the element onto back, which is stored in
// reverse order.
return list[T]{
front: l.front,
back: &node[T]{el: x, next: l.back},
lenBack: l.lenBack + 1,
}
}
// len returns the number of elements in the list.
func (l list[T]) len() int {
return len(l.front) + l.lenBack
}
// at returns the ith element of the list.
// The list must be normalized.
func (l list[T]) at(i int) T {
if l.back != nil {
panic("not normalized")
}
return l.front[i]
}
// normalize returns a list whose back is nil and whose front contains all the
// receiver's elements.
func (l list[T]) normalize() list[T] {
if l.back == nil {
return l
}
newFront := make([]T, len(l.front)+l.lenBack)
copy(newFront, l.front)
i := len(newFront) - 1
for b := l.back; b != nil; b = b.next {
newFront[i] = b.el
i--
}
return list[T]{
front: newFront,
back: nil,
lenBack: 0,
}
}

@ -475,7 +475,7 @@ golang.org/x/crypto/scrypt
golang.org/x/crypto/sha3
golang.org/x/crypto/ssh
golang.org/x/crypto/ssh/internal/bcrypt_pbkdf
# golang.org/x/exp v0.0.0-20230510235704-dd950f8aeaea
# golang.org/x/exp v0.0.0-20230515195305-f3d0a9c9a5cc
## explicit; go 1.20
golang.org/x/exp/constraints
golang.org/x/exp/slices

Loading…
Cancel
Save