From ae848ac95d2cdda51e1061510d6c087da3b7f19d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=85=89=E6=98=A5?= Date: Tue, 16 May 2023 21:32:36 +0800 Subject: [PATCH] - update --- go.mod | 2 +- go.sum | 4 +- library.go | 2 +- service/wnfuwu/check.go | 25 +++++--- service/wnfuwu/recharge.go | 17 +++--- vendor/golang.org/x/exp/slog/list.go | 85 ---------------------------- vendor/modules.txt | 2 +- 7 files changed, 31 insertions(+), 106 deletions(-) delete mode 100644 vendor/golang.org/x/exp/slog/list.go diff --git a/go.mod b/go.mod index e5d40c98..61dd3b21 100644 --- a/go.mod +++ b/go.mod @@ -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 diff --git a/go.sum b/go.sum index 256172e1..ca0ab131 100644 --- a/go.sum +++ b/go.sum @@ -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= diff --git a/library.go b/library.go index 46605138..dc533cee 100644 --- a/library.go +++ b/library.go @@ -1,5 +1,5 @@ package go_library func Version() string { - return "1.0.144" + return "1.0.145" } diff --git a/service/wnfuwu/check.go b/service/wnfuwu/check.go index 9578372e..cbd770ab 100644 --- a/service/wnfuwu/check.go +++ b/service/wnfuwu/check.go @@ -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"` } diff --git a/service/wnfuwu/recharge.go b/service/wnfuwu/recharge.go index 8ac4033c..997e4b48 100644 --- a/service/wnfuwu/recharge.go +++ b/service/wnfuwu/recharge.go @@ -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 { diff --git a/vendor/golang.org/x/exp/slog/list.go b/vendor/golang.org/x/exp/slog/list.go deleted file mode 100644 index 7b505ea0..00000000 --- a/vendor/golang.org/x/exp/slog/list.go +++ /dev/null @@ -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, - } -} diff --git a/vendor/modules.txt b/vendor/modules.txt index f289222f..decd10ef 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -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