Compare commits
120 Commits
852c5e4a94
...
7fd48edef8
| Author | SHA1 | Date | |
|---|---|---|---|
| 7fd48edef8 | |||
| 049aedf115 | |||
| 47ae46c46d | |||
| 12f85aecd7 | |||
|
|
b8c77f1db1 | ||
|
|
297c65776b | ||
|
|
1fd7721e99 | ||
|
|
3a9c1fb8d9 | ||
|
|
fef9f8d390 | ||
|
|
5871da7b54 | ||
|
|
a33f39df5c | ||
|
|
8be93b9d5c | ||
|
|
b3f28c3cb8 | ||
|
|
a3e0f4b7d7 | ||
|
|
9c3d9c06b3 | ||
|
|
3e703cf85a | ||
|
|
f316a340c8 | ||
|
|
648ef75a2e | ||
|
|
719c41db00 | ||
|
|
11cc2547c9 | ||
|
|
66808fc735 | ||
|
|
ae717f932e | ||
|
|
335ecc1f41 | ||
|
|
334ea4aa3f | ||
|
|
8f5bcc76ec | ||
|
|
15b2a80f58 | ||
|
|
a158f562b6 | ||
|
|
aa39146cfb | ||
|
|
164c737dd3 | ||
|
|
64e7361d50 | ||
|
|
3be161a011 | ||
|
|
2c537bf823 | ||
|
|
18bbc6788f | ||
|
|
687c18641f | ||
|
|
64a284bd77 | ||
|
|
9f9f7d3fd6 | ||
|
|
cf30fc2b88 | ||
|
|
64c6c19918 | ||
|
|
42a965ab39 | ||
|
|
d635811b5f | ||
|
|
0ce35645b2 | ||
|
|
d843fff73d | ||
|
|
58c0580cad | ||
|
|
4eb37c3820 | ||
|
|
5532cd1a11 | ||
|
|
7297a1ef02 | ||
|
|
55a879ada8 | ||
|
|
c375d17c07 | ||
|
|
8469253131 | ||
|
|
2a06a28ad6 | ||
|
|
abc315a39b | ||
|
|
19ad6625e6 | ||
|
|
2cb4549f00 | ||
|
|
2b30911ec6 | ||
| 529a02ac75 | |||
|
|
72543d519f | ||
|
|
dbf500813c | ||
|
|
f609fa364d | ||
|
|
636bc0aee7 | ||
|
|
857a632cea | ||
|
|
9255a0073f | ||
|
|
32e954ccc8 | ||
|
|
265fd81b27 | ||
|
|
fdaddf9184 | ||
|
|
9a8bdcb5ba | ||
|
|
fcd20e7fc2 | ||
|
|
06e4f1f96e | ||
|
|
7280c38b16 | ||
|
|
0142e04ef5 | ||
|
|
be045b2615 | ||
|
|
3c5b0d7e42 | ||
|
|
d5ff15849d | ||
|
|
436ed9ae4f | ||
|
|
5a92db70eb | ||
|
|
3deda93e7e | ||
|
|
7dc9760d94 | ||
|
|
e25cc97ea0 | ||
|
|
88a59bbdea | ||
|
|
36aad6a088 | ||
|
|
a896d42bc1 | ||
|
|
e07d55efca | ||
|
|
34d5e62824 | ||
|
|
ae58ebe35a | ||
|
|
918b5903d7 | ||
|
|
e40a4d43f4 | ||
|
|
736f57c0c2 | ||
|
|
16feddfe3e | ||
|
|
01cc7da3b4 | ||
|
|
b9afdf1dda | ||
|
|
999dc36e76 | ||
|
|
e05fcd8248 | ||
|
|
95baad761a | ||
|
|
c7536d0fdb | ||
|
|
4c104b56ae | ||
|
|
c378c6d8da | ||
|
|
0657307265 | ||
|
|
59edb394fa | ||
|
|
3be83ed424 | ||
|
|
743ea96157 | ||
|
|
222b9ec155 | ||
|
|
932ee1a578 | ||
|
|
b0f598af68 | ||
|
|
d0fc91b61b | ||
|
|
17aac7ad66 | ||
|
|
9c72a8a4c9 | ||
|
|
a4164dbdf6 | ||
|
|
5fadf0697d | ||
|
|
03627b93e9 | ||
|
|
25c3de6b99 | ||
|
|
05e5842992 | ||
|
|
b28fefdb0e | ||
|
|
148e0681ec | ||
|
|
fc59840235 | ||
|
|
fd9e30ea74 | ||
|
|
9d4bbbf80b | ||
|
|
7e22f47a0d | ||
|
|
95e6491de5 | ||
|
|
f5cfed20d3 | ||
|
|
5b4c43978e | ||
|
|
f792215c2f |
33
config_replica_id.sh
Normal file
33
config_replica_id.sh
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
replica_id=5
|
||||||
|
|
||||||
|
change_config(){
|
||||||
|
|
||||||
|
server_name=$1
|
||||||
|
config_file="server/${server_name}/etc/${server_name}.yaml"
|
||||||
|
|
||||||
|
# 无论ReplicaId存在与否,都重置replica_id
|
||||||
|
((replica_id+=5))
|
||||||
|
|
||||||
|
if ! grep -q "ReplicaId:" "$config_file"; then
|
||||||
|
|
||||||
|
sed -i "s/^Port:.*$/&\nReplicaId: $replica_id/" "$config_file"
|
||||||
|
echo "Added ReplicaId: $replica_id to $config_file"
|
||||||
|
|
||||||
|
else
|
||||||
|
|
||||||
|
exist_id=$(grep -oP "ReplicaId:\s*\K[0-9]+" "$config_file")
|
||||||
|
sed -i "s/^ReplicaId:.*$/ReplicaId: $replica_id/" "$config_file"
|
||||||
|
echo "Updated ReplicaId to $replica_id in $config_file"
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
# 读取server目录,忽略指定的三个目录
|
||||||
|
server_dirs=($(cd server && ls | grep -vE "backend|product-template|product-model"))
|
||||||
|
|
||||||
|
for server_dir in "${server_dirs[@]}"; do
|
||||||
|
change_config $server_dir
|
||||||
|
done
|
||||||
22
constants/pay.go
Normal file
22
constants/pay.go
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
package constants
|
||||||
|
|
||||||
|
type PayMethod int64
|
||||||
|
|
||||||
|
const (
|
||||||
|
PAYMETHOD_STRIPE PayMethod = 1
|
||||||
|
PAYMETHOD_PAYPAL PayMethod = 2
|
||||||
|
)
|
||||||
|
|
||||||
|
type PayStatus int64
|
||||||
|
|
||||||
|
const (
|
||||||
|
PAYSTATUS_SUCCESS PayStatus = 1
|
||||||
|
PAYSTATUS_UNSUCCESS PayStatus = 0
|
||||||
|
)
|
||||||
|
|
||||||
|
type PayStage int64
|
||||||
|
|
||||||
|
const (
|
||||||
|
PAYSTAGE_DEPOSIT PayStage = 1 // 首付
|
||||||
|
PAYSTAGE_REMAINING PayStage = 2 // 尾款
|
||||||
|
)
|
||||||
17
constants/rabbitmq.go
Normal file
17
constants/rabbitmq.go
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
package constants
|
||||||
|
|
||||||
|
type RABBIT_MQ string
|
||||||
|
|
||||||
|
// 消息队列队列名
|
||||||
|
const (
|
||||||
|
//组装渲染数据队列
|
||||||
|
RABBIT_MQ_ASSEMBLE_RENDER_DATA RABBIT_MQ = "RABBIT_MQ_ASSEMBLE_RENDER_DATA"
|
||||||
|
//渲染结果数据队列
|
||||||
|
RABBIT_MQ_RENDER_RESULT_DATA RABBIT_MQ = "RABBIT_MQ_RENDER_RESULT_DATA"
|
||||||
|
)
|
||||||
|
|
||||||
|
// 队列列表
|
||||||
|
var MQ_QUEUE_ARR = []RABBIT_MQ{
|
||||||
|
RABBIT_MQ_ASSEMBLE_RENDER_DATA,
|
||||||
|
RABBIT_MQ_RENDER_RESULT_DATA,
|
||||||
|
}
|
||||||
23
constants/websocket.go
Normal file
23
constants/websocket.go
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
package constants
|
||||||
|
|
||||||
|
type websocket string
|
||||||
|
|
||||||
|
// websocket消息类型
|
||||||
|
const (
|
||||||
|
//鉴权失败
|
||||||
|
WEBSOCKET_UNAUTH = "WEBSOCKET_UNAUTH"
|
||||||
|
//ws连接成功
|
||||||
|
WEBSOCKET_CONNECT_SUCCESS = "WEBSOCKET_CONNECT_SUCCESS"
|
||||||
|
//图片渲染
|
||||||
|
WEBSOCKET_RENDER_IMAGE = "WEBSOCKET_RENDER_IMAGE"
|
||||||
|
//数据格式错误
|
||||||
|
WEBSOCKET_ERR_DATA_FORMAT = "WEBSOCKET_ERR_DATA_FORMAT"
|
||||||
|
//第三方登录通知
|
||||||
|
WEBSOCKET_THIRD_PARTY_LOGIN_NOTIFY = "WEBSOCKET_THIRD_PARTY_LOGIN_NOTIFY"
|
||||||
|
)
|
||||||
|
|
||||||
|
// 云渲染完成通知api需要的签名字符串
|
||||||
|
const RENDER_NOTIFY_SIGN_KEY = "fusen-render-notify-%s-%d"
|
||||||
|
|
||||||
|
// 第三方登录通知api需要的签名字符串
|
||||||
|
const THIRD_PARTY_LOGIN_NOTIFY_SIGN_KEY = "fusen-render-notify-%s-%d"
|
||||||
@ -1,6 +1,6 @@
|
|||||||
#! /bin/bash
|
#! /bin/bash
|
||||||
name=${1%%\\*}
|
name=${1%%\\*}
|
||||||
options=("backend" "product-template" "product-model")
|
options=("backend" "product-template" "product-template-tag" "product-model")
|
||||||
for option in "${options[@]}"; do
|
for option in "${options[@]}"; do
|
||||||
if [ "$name" = "$option" ]; then
|
if [ "$name" = "$option" ]; then
|
||||||
echo $name
|
echo $name
|
||||||
|
|||||||
198
fsm/fsm.go
198
fsm/fsm.go
@ -4,6 +4,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"encoding/gob"
|
"encoding/gob"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"fusenapi/initalize"
|
||||||
"fusenapi/model/gmodel"
|
"fusenapi/model/gmodel"
|
||||||
"fusenapi/utils/auth"
|
"fusenapi/utils/auth"
|
||||||
"io"
|
"io"
|
||||||
@ -11,125 +12,166 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/hashicorp/raft"
|
"github.com/lni/dragonboat/v4"
|
||||||
|
sm "github.com/lni/dragonboat/v4/statemachine"
|
||||||
"gorm.io/gorm"
|
"gorm.io/gorm"
|
||||||
)
|
)
|
||||||
|
|
||||||
// StateCluster is a simple key-value store as an FSM.
|
// FsStateMachine is a simple key-value store as an FSM.
|
||||||
type StateCluster struct {
|
type FsStateMachine struct {
|
||||||
mu sync.Mutex
|
shardID uint64
|
||||||
|
replicaID uint64
|
||||||
|
|
||||||
|
mu sync.Mutex
|
||||||
store map[int64]*UserState
|
store map[int64]*UserState
|
||||||
|
|
||||||
gdb *gorm.DB
|
gdb *gorm.DB
|
||||||
waiter *WaitCallback
|
// waiter *WaitCallback
|
||||||
ra *raft.Raft // The consensus mechanism
|
// ra *raft.Raft // The consensus mechanism
|
||||||
}
|
}
|
||||||
|
|
||||||
func (fsm *StateCluster) GetUserState(Userid int64) (*UserState, error) {
|
func NewFsStateMachine(shardID uint64, replicaID uint64) sm.IStateMachine {
|
||||||
|
return &FsStateMachine{
|
||||||
fsm.mu.Lock()
|
shardID: shardID,
|
||||||
if us, ok := fsm.store[Userid]; ok {
|
replicaID: replicaID,
|
||||||
// log.Println("exists")
|
store: make(map[int64]*UserState),
|
||||||
fsm.mu.Unlock()
|
gdb: initalize.InitMysql("fusentest:XErSYmLELKMnf3Dh@tcp(110.41.19.98:3306)/fusentest"),
|
||||||
return us, nil
|
|
||||||
}
|
}
|
||||||
fsm.mu.Unlock()
|
}
|
||||||
|
|
||||||
// log.Println("apply")
|
type SharedState struct {
|
||||||
cmd := &command{
|
shardID uint64
|
||||||
Op: "update",
|
replicaID uint64
|
||||||
|
nh *dragonboat.NodeHost
|
||||||
|
}
|
||||||
|
|
||||||
|
func (fsm *SharedState) GetUserState(Userid int64) (us *UserState, err error) {
|
||||||
|
|
||||||
|
ius, err := nh.SyncRead(context.TODO(), fsm.shardID, Userid)
|
||||||
|
if err != nil {
|
||||||
|
log.Println(err)
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
if ius != nil {
|
||||||
|
return ius.(*UserState), nil
|
||||||
|
}
|
||||||
|
|
||||||
|
cmd := &Command{
|
||||||
|
Op: OP_Update,
|
||||||
Key: Userid,
|
Key: Userid,
|
||||||
}
|
}
|
||||||
|
|
||||||
future := fsm.ra.Apply(cmd.Encode(), time.Minute)
|
cs := nh.GetNoOPSession(128)
|
||||||
// log.Println(future.Index())
|
err = cmd.Encode(func(buf []byte) error {
|
||||||
|
result, err := nh.SyncPropose(context.TODO(), cs, buf)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
if future.Response() != nil {
|
us = &UserState{}
|
||||||
return nil, future.Response().(error)
|
err = us.Decode(result.Data)
|
||||||
}
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
if us := fsm.waiter.Wait(Userid, time.Second*5); us != nil {
|
return nil
|
||||||
return us, nil
|
})
|
||||||
} else {
|
|
||||||
return nil, fmt.Errorf("timeout")
|
return us, err
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Apply applies a Raft log entry to the key-value store.
|
// Lookup performs local lookup on the ExampleStateMachine instance. In this example,
|
||||||
func (fsm *StateCluster) Apply(fsmlog *raft.Log) interface{} {
|
// we always return the Count value as a little endian binary encoded byte
|
||||||
var cmd command
|
// slice.
|
||||||
|
func (s *FsStateMachine) Lookup(query interface{}) (item interface{}, err error) {
|
||||||
|
s.mu.Lock()
|
||||||
|
defer s.mu.Unlock()
|
||||||
|
|
||||||
err := cmd.Decode(fsmlog.Data)
|
userid := query.(int64)
|
||||||
|
if us, ok := s.store[userid]; ok {
|
||||||
|
return us, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update updates the object using the specified committed raft entry.
|
||||||
|
func (s *FsStateMachine) Update(e sm.Entry) (result sm.Result, err error) {
|
||||||
|
|
||||||
|
var cmd Command
|
||||||
|
err = cmd.Decode(e.Cmd)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return result, err
|
||||||
}
|
}
|
||||||
|
|
||||||
switch cmd.Op {
|
switch cmd.Op {
|
||||||
case "update":
|
case OP_Update:
|
||||||
fsm.mu.Lock()
|
s.mu.Lock()
|
||||||
defer fsm.mu.Unlock()
|
defer s.mu.Unlock()
|
||||||
|
|
||||||
|
if old, ok := s.store[cmd.Key]; ok {
|
||||||
|
if time.Since(old.UpdateAt) <= time.Second {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// log.Println("update")
|
// log.Println("update")
|
||||||
models := gmodel.NewAllModels(fsm.gdb)
|
models := gmodel.NewAllModels(s.gdb)
|
||||||
user, err := models.FsUser.FindUserById(context.TODO(), cmd.Key)
|
user, err := models.FsUser.FindUserById(context.TODO(), cmd.Key)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println(err)
|
log.Println(err)
|
||||||
}
|
}
|
||||||
userState := &UserState{
|
userState := &UserState{
|
||||||
UserId: cmd.Key,
|
UserId: cmd.Key,
|
||||||
PwdHash: auth.StringToHash(*user.PasswordHash),
|
PwdHash: auth.StringToHash(*user.PasswordHash),
|
||||||
Expired: time.Now(),
|
UpdateAt: time.Now(),
|
||||||
}
|
}
|
||||||
fsm.store[cmd.Key] = userState
|
s.store[cmd.Key] = userState
|
||||||
fsm.waiter.Done(userState)
|
err = userState.Encode(func(b []byte) error {
|
||||||
|
e.Result.Data = b
|
||||||
|
result.Data = b
|
||||||
|
return nil
|
||||||
|
})
|
||||||
|
|
||||||
|
return result, err
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return fmt.Errorf("unrecognized command operation: %s", cmd.Op)
|
return result, fmt.Errorf("unknonw cmd type: %s", cmd.Op)
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Snapshot returns a snapshot of the key-value store.
|
// SaveSnapshot saves the current IStateMachine state into a snapshot using the
|
||||||
func (fsm *StateCluster) Snapshot() (raft.FSMSnapshot, error) {
|
// specified io.Writer object.
|
||||||
fsm.mu.Lock()
|
func (s *FsStateMachine) SaveSnapshot(w io.Writer,
|
||||||
defer fsm.mu.Unlock()
|
fc sm.ISnapshotFileCollection, done <-chan struct{}) error {
|
||||||
|
// as shown above, the only state that can be saved is the Count variable
|
||||||
|
// there is no external file in this IStateMachine example, we thus leave
|
||||||
|
// the fc untouched
|
||||||
|
|
||||||
snapshot := kvStoreSnapshot{
|
s.mu.Lock()
|
||||||
store: make(map[int64]*UserState),
|
defer s.mu.Unlock()
|
||||||
}
|
|
||||||
|
|
||||||
for k, v := range fsm.store {
|
return gob.NewEncoder(w).Encode(&s.store)
|
||||||
snapshot.store[k] = v
|
|
||||||
}
|
|
||||||
|
|
||||||
return &snapshot, nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Restore stores the key-value store to a previous state.
|
// RecoverFromSnapshot recovers the state using the provided snapshot.
|
||||||
func (fsm *StateCluster) Restore(rc io.ReadCloser) error {
|
func (s *FsStateMachine) RecoverFromSnapshot(r io.Reader,
|
||||||
var snapshot kvStoreSnapshot
|
files []sm.SnapshotFile,
|
||||||
dec := gob.NewDecoder(rc)
|
done <-chan struct{}) error {
|
||||||
if err := dec.Decode(&snapshot); err != nil {
|
// restore the Count variable, that is the only state we maintain in this
|
||||||
|
// example, the input files is expected to be empty
|
||||||
|
|
||||||
|
err := gob.NewDecoder(r).Decode(&s.store)
|
||||||
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
fsm.store = snapshot.store
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// kvStoreSnapshot represents a snapshot of the key-value store.
|
// Close closes the IStateMachine instance. There is nothing for us to cleanup
|
||||||
type kvStoreSnapshot struct {
|
// or release as this is a pure in memory data store. Note that the Close
|
||||||
store map[int64]*UserState
|
// method is not guaranteed to be called as node can crash at any time.
|
||||||
}
|
func (s *FsStateMachine) Close() error { return nil }
|
||||||
|
|
||||||
// Persist writes the snapshot to the provided sink.
|
|
||||||
func (snapshot *kvStoreSnapshot) Persist(sink raft.SnapshotSink) error {
|
|
||||||
// The example has been simplified. In a production environment, you would
|
|
||||||
// need to handle this operation with more care.
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// Release is invoked when the Raft instance is finished with the snapshot.
|
|
||||||
func (snapshot *kvStoreSnapshot) Release() {
|
|
||||||
// Normally you would put any cleanup here.
|
|
||||||
}
|
|
||||||
|
|||||||
288
fsm/main.go
288
fsm/main.go
@ -3,40 +3,143 @@ package fsm
|
|||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"encoding/gob"
|
"encoding/gob"
|
||||||
|
"flag"
|
||||||
"fmt"
|
"fmt"
|
||||||
"fusenapi/initalize"
|
"fusenapi/utils/autoconfig"
|
||||||
"log"
|
"log"
|
||||||
"net"
|
"net"
|
||||||
"os"
|
"os"
|
||||||
|
"os/signal"
|
||||||
|
"path/filepath"
|
||||||
|
"runtime"
|
||||||
|
"syscall"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/hashicorp/raft"
|
"github.com/hashicorp/raft"
|
||||||
|
"github.com/lni/dragonboat/v4"
|
||||||
|
"github.com/lni/dragonboat/v4/config"
|
||||||
|
"github.com/lni/dragonboat/v4/logger"
|
||||||
"gorm.io/gorm"
|
"gorm.io/gorm"
|
||||||
)
|
)
|
||||||
|
|
||||||
func test1() {
|
func test1() {
|
||||||
log.SetFlags(log.Llongfile)
|
// log.SetFlags(log.Llongfile)
|
||||||
|
|
||||||
fsm := StartNode("fs1", "localhost:5500", initalize.InitMysql("fusentest:XErSYmLELKMnf3Dh@tcp(110.41.19.98:3306)/fusentest"))
|
// fsm := StartNode("fs1", "localhost:5500", nil, initalize.InitMysql("fusentest:XErSYmLELKMnf3Dh@tcp(110.41.19.98:3306)/fusentest"))
|
||||||
|
|
||||||
time.Sleep(time.Second * 5)
|
// time.Sleep(time.Second * 5)
|
||||||
|
|
||||||
for i := 0; i < 30; i++ {
|
// for i := 0; i < 30; i++ {
|
||||||
go log.Println(fsm.GetUserState(39))
|
// go log.Println(fsm.GetUserState(39))
|
||||||
|
// }
|
||||||
|
|
||||||
|
// log.Println(fsm.GetUserState(39))
|
||||||
|
|
||||||
|
// select {}
|
||||||
|
}
|
||||||
|
|
||||||
|
var addresses []string = []string{
|
||||||
|
"localhost:5500",
|
||||||
|
"localhost:5501",
|
||||||
|
"localhost:5502",
|
||||||
|
}
|
||||||
|
|
||||||
|
func StartNode(replicaID uint64, exampleShardID uint64, addr string, gdb *gorm.DB) *dragonboat.NodeHost {
|
||||||
|
|
||||||
|
// addr := "localhost"
|
||||||
|
|
||||||
|
// addr = fmt.Sprintf("%s:%d", addr, port)
|
||||||
|
|
||||||
|
flag.Parse()
|
||||||
|
if len(addr) == 0 && replicaID != 1 && replicaID != 2 && replicaID != 3 {
|
||||||
|
fmt.Fprintf(os.Stderr, "node id must be 1, 2 or 3 when address is not specified\n")
|
||||||
|
os.Exit(1)
|
||||||
|
}
|
||||||
|
// https://github.com/golang/go/issues/17393
|
||||||
|
if runtime.GOOS == "darwin" {
|
||||||
|
signal.Ignore(syscall.Signal(0xd))
|
||||||
|
}
|
||||||
|
initialMembers := make(map[uint64]string)
|
||||||
|
|
||||||
|
// when joining a new node which is not an initial members, the initialMembers
|
||||||
|
// map should be empty.
|
||||||
|
// when restarting a node that is not a member of the initial nodes, you can
|
||||||
|
// leave the initialMembers to be empty. we still populate the initialMembers
|
||||||
|
// here for simplicity.
|
||||||
|
|
||||||
|
for idx, v := range addresses {
|
||||||
|
// key is the ReplicaID, ReplicaID is not allowed to be 0
|
||||||
|
// value is the raft address
|
||||||
|
initialMembers[uint64(idx+1)] = v
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Println(fsm.GetUserState(39))
|
// for simplicity, in this example program, addresses of all those 3 initial
|
||||||
|
// raft members are hard coded. when address is not specified on the command
|
||||||
|
// line, we assume the node being launched is an initial raft member.
|
||||||
|
|
||||||
|
var nodeAddr = initialMembers[uint64(replicaID)]
|
||||||
|
|
||||||
|
fmt.Fprintf(os.Stdout, "node address: %s\n", nodeAddr)
|
||||||
|
// change the log verbosity
|
||||||
|
logger.GetLogger("raft").SetLevel(logger.ERROR)
|
||||||
|
logger.GetLogger("rsm").SetLevel(logger.WARNING)
|
||||||
|
logger.GetLogger("transport").SetLevel(logger.WARNING)
|
||||||
|
logger.GetLogger("grpc").SetLevel(logger.WARNING)
|
||||||
|
// config for raft node
|
||||||
|
// See GoDoc for all available options
|
||||||
|
rc := config.Config{
|
||||||
|
// ShardID and ReplicaID of the raft node
|
||||||
|
ReplicaID: uint64(replicaID),
|
||||||
|
ShardID: exampleShardID,
|
||||||
|
|
||||||
|
ElectionRTT: 10,
|
||||||
|
|
||||||
|
HeartbeatRTT: 1,
|
||||||
|
CheckQuorum: true,
|
||||||
|
|
||||||
|
SnapshotEntries: 10,
|
||||||
|
|
||||||
|
CompactionOverhead: 5,
|
||||||
|
}
|
||||||
|
datadir := filepath.Join(
|
||||||
|
"example-data",
|
||||||
|
"queue-data",
|
||||||
|
fmt.Sprintf("node%d", replicaID))
|
||||||
|
|
||||||
|
nhc := config.NodeHostConfig{
|
||||||
|
|
||||||
|
WALDir: datadir,
|
||||||
|
// NodeHostDir is where everything else is stored.
|
||||||
|
NodeHostDir: datadir,
|
||||||
|
// RTTMillisecond is the average round trip time between NodeHosts (usually
|
||||||
|
// on two machines/vms), it is in millisecond. Such RTT includes the
|
||||||
|
// processing delays caused by NodeHosts, not just the network delay between
|
||||||
|
// two NodeHost instances.
|
||||||
|
RTTMillisecond: 200,
|
||||||
|
// RaftAddress is used to identify the NodeHost instance
|
||||||
|
RaftAddress: nodeAddr,
|
||||||
|
}
|
||||||
|
nh, err := dragonboat.NewNodeHost(nhc)
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := nh.StartReplica(initialMembers, false, New, rc); err != nil {
|
||||||
|
fmt.Fprintf(os.Stderr, "failed to add cluster, %v\n", err)
|
||||||
|
os.Exit(1)
|
||||||
|
}
|
||||||
|
|
||||||
|
return nh
|
||||||
|
|
||||||
select {}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// StartNode 启动节点
|
// StartNode 启动节点
|
||||||
func StartNode(ServerID string, RaftBind string, gdb *gorm.DB) *StateCluster {
|
func StartNode1(ServerID string, RaftBind string, serverconfigs []*autoconfig.ConfigServer, gdb *gorm.DB) *FsStateMachine {
|
||||||
|
|
||||||
fsm := &StateCluster{
|
fsm := &FsStateMachine{
|
||||||
store: make(map[int64]*UserState),
|
store: make(map[int64]*UserState),
|
||||||
waiter: NewWaitCallback(),
|
|
||||||
gdb: gdb,
|
gdb: gdb,
|
||||||
}
|
}
|
||||||
|
|
||||||
var retainSnapshotCount = 2
|
var retainSnapshotCount = 2
|
||||||
@ -74,62 +177,80 @@ func StartNode(ServerID string, RaftBind string, gdb *gorm.DB) *StateCluster {
|
|||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
configuration := raft.Configuration{
|
var dup map[string]bool = make(map[string]bool)
|
||||||
Servers: []raft.Server{
|
var rserver []raft.Server = []raft.Server{
|
||||||
{
|
{
|
||||||
Suffrage: raft.Voter,
|
Suffrage: raft.Voter,
|
||||||
ID: config.LocalID,
|
ID: config.LocalID,
|
||||||
Address: transport.LocalAddr(),
|
Address: transport.LocalAddr(),
|
||||||
},
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
dup[string(config.LocalID)] = true
|
||||||
|
dup[string("backend")] = true
|
||||||
|
dup[string("product-model")] = true
|
||||||
|
dup[string("product-template")] = true
|
||||||
|
|
||||||
|
for _, cfg := range serverconfigs {
|
||||||
|
if _, ok := dup[cfg.Name]; !ok {
|
||||||
|
dup[cfg.Name] = true
|
||||||
|
rserver = append(rserver, raft.Server{
|
||||||
|
Suffrage: raft.Voter,
|
||||||
|
ID: raft.ServerID(cfg.Name),
|
||||||
|
Address: raft.ServerAddress(fmt.Sprintf("%s:%d", cfg.Host, cfg.Port-2000)),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
configuration := raft.Configuration{
|
||||||
|
Servers: rserver,
|
||||||
|
}
|
||||||
|
|
||||||
fu := fsm.ra.BootstrapCluster(configuration)
|
fu := fsm.ra.BootstrapCluster(configuration)
|
||||||
if err := fu.Error(); err != nil {
|
if err := fu.Error(); err != nil {
|
||||||
log.Println(err)
|
log.Println(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
waitForLeader(fsm.ra)
|
waitForCluster(fsm.ra)
|
||||||
|
|
||||||
return fsm
|
return fsm
|
||||||
}
|
}
|
||||||
|
|
||||||
func JoinCluster(ServerID string, LeaderAddress string, RaftBind string, gdb *gorm.DB) *StateCluster {
|
// func JoinCluster(ServerID string, LeaderAddress string, RaftBind string, gdb *gorm.DB) *StateCluster {
|
||||||
|
|
||||||
fsm := StartNode(ServerID, RaftBind, gdb)
|
// fsm := StartNode(ServerID, RaftBind, gdb)
|
||||||
|
|
||||||
configFuture := fsm.ra.GetConfiguration()
|
// configFuture := fsm.ra.GetConfiguration()
|
||||||
if err := configFuture.Error(); err != nil {
|
// if err := configFuture.Error(); err != nil {
|
||||||
log.Fatalf("failed to get raft configuration: %v", err)
|
// log.Fatalf("failed to get raft configuration: %v", err)
|
||||||
}
|
// }
|
||||||
|
|
||||||
for _, srv := range configFuture.Configuration().Servers {
|
// for _, srv := range configFuture.Configuration().Servers {
|
||||||
if srv.ID == raft.ServerID(ServerID) && srv.Address == raft.ServerAddress(LeaderAddress) {
|
// if srv.ID == raft.ServerID(ServerID) && srv.Address == raft.ServerAddress(LeaderAddress) {
|
||||||
if future := fsm.ra.RemoveServer(srv.ID, 0, 0); future.Error() != nil {
|
// if future := fsm.ra.RemoveServer(srv.ID, 0, 0); future.Error() != nil {
|
||||||
log.Fatalf("Error removing existing server [%s]: %v", ServerID, future.Error())
|
// log.Fatalf("Error removing existing server [%s]: %v", ServerID, future.Error())
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
f := fsm.ra.AddVoter(raft.ServerID(ServerID), raft.ServerAddress(RaftBind), 0, 0)
|
// f := fsm.ra.AddVoter(raft.ServerID(ServerID), raft.ServerAddress(RaftBind), 0, 0)
|
||||||
if f.Error() != nil {
|
// if f.Error() != nil {
|
||||||
log.Fatalf("Error adding voter: %v", f.Error())
|
// log.Fatalf("Error adding voter: %v", f.Error())
|
||||||
}
|
// }
|
||||||
|
|
||||||
return fsm
|
// return fsm
|
||||||
}
|
// }
|
||||||
|
|
||||||
func waitForLeader(ra *raft.Raft) {
|
func waitForCluster(ra *raft.Raft) {
|
||||||
leaderCh := ra.LeaderCh()
|
ticker := time.NewTicker(500 * time.Millisecond)
|
||||||
|
defer ticker.Stop()
|
||||||
|
|
||||||
for {
|
for range ticker.C {
|
||||||
select {
|
state := ra.State()
|
||||||
case isLeader := <-leaderCh:
|
if state == raft.Leader || state == raft.Follower {
|
||||||
if isLeader {
|
log.Println("Raft cluster is running")
|
||||||
return
|
return
|
||||||
}
|
} else {
|
||||||
case <-time.After(10 * time.Second):
|
log.Println("Still waiting for the cluster to start...")
|
||||||
log.Println("Still waiting for the leader...")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -137,41 +258,70 @@ func waitForLeader(ra *raft.Raft) {
|
|||||||
// var gdb *gorm.DB = initalize.InitMysql("fusentest:XErSYmLELKMnf3Dh@tcp(110.41.19.98:3306)/fusentest")
|
// var gdb *gorm.DB = initalize.InitMysql("fusentest:XErSYmLELKMnf3Dh@tcp(110.41.19.98:3306)/fusentest")
|
||||||
|
|
||||||
type UserState struct {
|
type UserState struct {
|
||||||
Expired time.Time
|
UpdateAt time.Time
|
||||||
UserId int64
|
UserId int64
|
||||||
PwdHash uint64
|
PwdHash uint64
|
||||||
}
|
}
|
||||||
|
|
||||||
func (us *UserState) Encode() []byte {
|
func (us *UserState) Encode(do func([]byte) error) error {
|
||||||
var buf = bytes.NewBuffer(nil)
|
|
||||||
err := gob.NewEncoder(buf).Encode(us)
|
var buf bytes.Buffer
|
||||||
|
err := gob.NewEncoder(&buf).Encode(us)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Panic(err)
|
return err
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return buf.Bytes()
|
if do != nil {
|
||||||
|
err := do(buf.Bytes())
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// command is used for internal command representation.
|
func (us *UserState) Decode(data []byte) error {
|
||||||
type command struct {
|
buf := bytes.NewBuffer(data)
|
||||||
Op string
|
err := gob.NewDecoder(buf).Decode(us)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
type OperateType string
|
||||||
|
|
||||||
|
const (
|
||||||
|
OP_Update OperateType = "update"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Command is used for internal Command representation.
|
||||||
|
type Command struct {
|
||||||
|
Op OperateType
|
||||||
Key int64
|
Key int64
|
||||||
Value *UserState
|
Value *UserState
|
||||||
}
|
}
|
||||||
|
|
||||||
func (cmd *command) Encode() []byte {
|
func (cmd *Command) Encode(do func(buf []byte) error) error {
|
||||||
var buf = bytes.NewBuffer(nil)
|
var buf bytes.Buffer
|
||||||
err := gob.NewEncoder(buf).Encode(cmd)
|
|
||||||
|
err := gob.NewEncoder(&buf).Encode(cmd)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Panic(err)
|
return err
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return buf.Bytes()
|
if do != nil {
|
||||||
|
err := do(buf.Bytes())
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (cmd *command) Decode(sbuf []byte) error {
|
func (cmd *Command) Decode(sbuf []byte) error {
|
||||||
var buf = bytes.NewBuffer(sbuf)
|
var buf = bytes.NewBuffer(sbuf)
|
||||||
err := gob.NewDecoder(buf).Decode(cmd)
|
err := gob.NewDecoder(buf).Decode(cmd)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
32
go.mod
32
go.mod
@ -8,9 +8,12 @@ require (
|
|||||||
github.com/bwmarrin/snowflake v0.3.0
|
github.com/bwmarrin/snowflake v0.3.0
|
||||||
github.com/golang-jwt/jwt v3.2.2+incompatible
|
github.com/golang-jwt/jwt v3.2.2+incompatible
|
||||||
github.com/google/uuid v1.3.0
|
github.com/google/uuid v1.3.0
|
||||||
|
github.com/gorilla/websocket v1.5.0
|
||||||
github.com/hashicorp/raft v1.5.0
|
github.com/hashicorp/raft v1.5.0
|
||||||
|
github.com/lni/dragonboat/v4 v4.0.0-20230709075559-54497b9553be
|
||||||
github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646
|
github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646
|
||||||
github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e
|
github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e
|
||||||
|
github.com/streadway/amqp v1.1.0
|
||||||
github.com/stripe/stripe-go/v74 v74.26.0
|
github.com/stripe/stripe-go/v74 v74.26.0
|
||||||
github.com/zeromicro/go-zero v1.5.4
|
github.com/zeromicro/go-zero v1.5.4
|
||||||
golang.org/x/image v0.0.0-20190802002840-cff245a6509b
|
golang.org/x/image v0.0.0-20190802002840-cff245a6509b
|
||||||
@ -22,15 +25,44 @@ require (
|
|||||||
require (
|
require (
|
||||||
cloud.google.com/go/compute v1.20.1 // indirect
|
cloud.google.com/go/compute v1.20.1 // indirect
|
||||||
cloud.google.com/go/compute/metadata v0.2.3 // indirect
|
cloud.google.com/go/compute/metadata v0.2.3 // indirect
|
||||||
|
github.com/DataDog/zstd v1.4.5 // indirect
|
||||||
|
github.com/HdrHistogram/hdrhistogram-go v1.1.2 // indirect
|
||||||
|
github.com/VictoriaMetrics/metrics v1.18.1 // indirect
|
||||||
github.com/andybalholm/brotli v1.0.5 // indirect
|
github.com/andybalholm/brotli v1.0.5 // indirect
|
||||||
github.com/armon/go-metrics v0.4.1 // indirect
|
github.com/armon/go-metrics v0.4.1 // indirect
|
||||||
|
github.com/cockroachdb/errors v1.9.0 // indirect
|
||||||
|
github.com/cockroachdb/logtags v0.0.0-20211118104740-dabe8e521a4f // indirect
|
||||||
|
github.com/cockroachdb/pebble v0.0.0-20221207173255-0f086d933dac // indirect
|
||||||
|
github.com/cockroachdb/redact v1.1.3 // indirect
|
||||||
|
github.com/getsentry/sentry-go v0.12.0 // indirect
|
||||||
|
github.com/gogo/protobuf v1.3.2 // indirect
|
||||||
|
github.com/golang/snappy v0.0.4 // indirect
|
||||||
|
github.com/google/btree v1.0.0 // indirect
|
||||||
|
github.com/hashicorp/errwrap v1.1.0 // indirect
|
||||||
github.com/hashicorp/go-hclog v1.5.0 // indirect
|
github.com/hashicorp/go-hclog v1.5.0 // indirect
|
||||||
github.com/hashicorp/go-immutable-radix v1.0.0 // indirect
|
github.com/hashicorp/go-immutable-radix v1.0.0 // indirect
|
||||||
github.com/hashicorp/go-msgpack v0.5.5 // indirect
|
github.com/hashicorp/go-msgpack v0.5.5 // indirect
|
||||||
|
github.com/hashicorp/go-multierror v1.1.1 // indirect
|
||||||
|
github.com/hashicorp/go-sockaddr v1.0.0 // indirect
|
||||||
github.com/hashicorp/golang-lru v0.5.1 // indirect
|
github.com/hashicorp/golang-lru v0.5.1 // indirect
|
||||||
|
github.com/hashicorp/memberlist v0.3.1 // indirect
|
||||||
github.com/jmespath/go-jmespath v0.4.0 // indirect
|
github.com/jmespath/go-jmespath v0.4.0 // indirect
|
||||||
|
github.com/klauspost/compress v1.15.15 // indirect
|
||||||
|
github.com/kr/pretty v0.3.1 // indirect
|
||||||
|
github.com/kr/text v0.2.0 // indirect
|
||||||
|
github.com/lni/goutils v1.3.1-0.20220604063047-388d67b4dbc4 // indirect
|
||||||
|
github.com/lni/vfs v0.2.1-0.20220616104132-8852fd867376 // indirect
|
||||||
|
github.com/miekg/dns v1.1.26 // indirect
|
||||||
|
github.com/pierrec/lz4/v4 v4.1.17 // indirect
|
||||||
|
github.com/pkg/errors v0.9.1 // indirect
|
||||||
|
github.com/rogpeppe/go-internal v1.9.0 // indirect
|
||||||
github.com/schollz/progressbar v1.0.0 // indirect
|
github.com/schollz/progressbar v1.0.0 // indirect
|
||||||
|
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 // indirect
|
||||||
|
github.com/valyala/fastrand v1.1.0 // indirect
|
||||||
|
github.com/valyala/histogram v1.2.0 // indirect
|
||||||
go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.14.0 // indirect
|
go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.14.0 // indirect
|
||||||
|
golang.org/x/crypto v0.11.0 // indirect
|
||||||
|
golang.org/x/exp v0.0.0-20200513190911-00229845015e // indirect
|
||||||
google.golang.org/appengine v1.6.7 // indirect
|
google.golang.org/appengine v1.6.7 // indirect
|
||||||
google.golang.org/genproto/googleapis/api v0.0.0-20230530153820-e85fd2cbaebc // indirect
|
google.golang.org/genproto/googleapis/api v0.0.0-20230530153820-e85fd2cbaebc // indirect
|
||||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc // indirect
|
google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc // indirect
|
||||||
|
|||||||
306
go.sum
306
go.sum
@ -38,13 +38,29 @@ dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7
|
|||||||
github.com/474420502/random v0.4.1 h1:HUUyLXRWMijVb7CJoEC16f0aFQOW25Lkr80Mut6PoKU=
|
github.com/474420502/random v0.4.1 h1:HUUyLXRWMijVb7CJoEC16f0aFQOW25Lkr80Mut6PoKU=
|
||||||
github.com/474420502/requests v1.40.0 h1:VDuLxSG/3IGBvMfjPV8+o7s1l5mOwLAgfo5Og6vMAJw=
|
github.com/474420502/requests v1.40.0 h1:VDuLxSG/3IGBvMfjPV8+o7s1l5mOwLAgfo5Og6vMAJw=
|
||||||
github.com/474420502/requests v1.40.0/go.mod h1:2SCVzim0ONFYG09g/GrM7RTeJIC6qTyZfnohsjnG5C8=
|
github.com/474420502/requests v1.40.0/go.mod h1:2SCVzim0ONFYG09g/GrM7RTeJIC6qTyZfnohsjnG5C8=
|
||||||
|
github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8=
|
||||||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
||||||
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
|
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
|
||||||
|
github.com/CloudyKit/fastprinter v0.0.0-20170127035650-74b38d55f37a/go.mod h1:EFZQ978U7x8IRnstaskI3IysnWY5Ao3QgZUKOXlsAdw=
|
||||||
|
github.com/CloudyKit/fastprinter v0.0.0-20200109182630-33d98a066a53/go.mod h1:+3IMCy2vIlbG1XG/0ggNQv0SvxCAIpPM5b1nCz56Xno=
|
||||||
|
github.com/CloudyKit/jet v2.1.3-0.20180809161101-62edd43e4f88+incompatible/go.mod h1:HPYO+50pSWkPoj9Q/eq0aRGByCL6ScRlUmiEX5Zgm+w=
|
||||||
|
github.com/CloudyKit/jet/v3 v3.0.0/go.mod h1:HKQPgSJmdK8hdoAbKUUWajkHyHo4RaU5rMdUywE7VMo=
|
||||||
github.com/DATA-DOG/go-sqlmock v1.5.0 h1:Shsta01QNfFxHCfpW6YH2STWB0MudeXXEWMr20OEh60=
|
github.com/DATA-DOG/go-sqlmock v1.5.0 h1:Shsta01QNfFxHCfpW6YH2STWB0MudeXXEWMr20OEh60=
|
||||||
github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ=
|
github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ=
|
||||||
|
github.com/DataDog/zstd v1.4.5 h1:EndNeuB0l9syBZhut0wns3gV1hL8zX8LIu6ZiVHWLIQ=
|
||||||
|
github.com/DataDog/zstd v1.4.5/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo=
|
||||||
|
github.com/HdrHistogram/hdrhistogram-go v1.1.2 h1:5IcZpTvzydCQeHzK4Ef/D5rrSqwxob0t8PQPMybUNFM=
|
||||||
|
github.com/HdrHistogram/hdrhistogram-go v1.1.2/go.mod h1:yDgFjdqOqDEKOvasDdhWNXYg9BVp4O+o5f6V/ehm6Oo=
|
||||||
|
github.com/Joker/hpp v1.0.0/go.mod h1:8x5n+M1Hp5hC0g8okX3sR3vFQwynaX/UgSOM9MeBKzY=
|
||||||
|
github.com/Joker/jade v1.0.1-0.20190614124447-d475f43051e7/go.mod h1:6E6s8o2AE4KhCrqr6GRJjdC/gNfTdxkIXvuGZZda2VM=
|
||||||
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
|
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
|
||||||
github.com/SebastiaanKlippert/go-wkhtmltopdf v1.9.0 h1:DNrExYwvyyI404SxdUCCANAj9TwnGjRfa3cYFMNY1AU=
|
github.com/SebastiaanKlippert/go-wkhtmltopdf v1.9.0 h1:DNrExYwvyyI404SxdUCCANAj9TwnGjRfa3cYFMNY1AU=
|
||||||
github.com/SebastiaanKlippert/go-wkhtmltopdf v1.9.0/go.mod h1:SQq4xfIdvf6WYKSDxAJc+xOJdolt+/bc1jnQKMtPMvQ=
|
github.com/SebastiaanKlippert/go-wkhtmltopdf v1.9.0/go.mod h1:SQq4xfIdvf6WYKSDxAJc+xOJdolt+/bc1jnQKMtPMvQ=
|
||||||
|
github.com/Shopify/goreferrer v0.0.0-20181106222321-ec9c9a553398/go.mod h1:a1uqRtAwp2Xwc6WNPJEufxJ7fx3npB4UV/JOLmbu5I0=
|
||||||
|
github.com/VictoriaMetrics/metrics v1.18.1 h1:OZ0+kTTto8oPfHnVAnTOoyl0XlRhRkoQrD2n2cOuRw0=
|
||||||
|
github.com/VictoriaMetrics/metrics v1.18.1/go.mod h1:ArjwVz7WpgpegX/JpB0zpNF2h2232kErkEnzH1sxMmA=
|
||||||
|
github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY=
|
||||||
|
github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw=
|
||||||
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
|
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
|
||||||
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
|
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
|
||||||
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
|
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
|
||||||
@ -54,10 +70,13 @@ github.com/alicebob/miniredis/v2 v2.30.4 h1:8S4/o1/KoUArAGbGwPxcwf0krlzceva2XVOS
|
|||||||
github.com/andybalholm/brotli v1.0.5 h1:8uQZIdzKmjc/iuPu7O2ioW48L81FgatrcpfFmiq/cCs=
|
github.com/andybalholm/brotli v1.0.5 h1:8uQZIdzKmjc/iuPu7O2ioW48L81FgatrcpfFmiq/cCs=
|
||||||
github.com/andybalholm/brotli v1.0.5/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig=
|
github.com/andybalholm/brotli v1.0.5/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig=
|
||||||
github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY=
|
github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY=
|
||||||
|
github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8=
|
||||||
|
github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY=
|
||||||
github.com/armon/go-metrics v0.4.1 h1:hR91U9KYmb6bLBYLQjyM+3j+rcd/UhE+G78SFnF8gJA=
|
github.com/armon/go-metrics v0.4.1 h1:hR91U9KYmb6bLBYLQjyM+3j+rcd/UhE+G78SFnF8gJA=
|
||||||
github.com/armon/go-metrics v0.4.1/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+3JqfkOG4=
|
github.com/armon/go-metrics v0.4.1/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+3JqfkOG4=
|
||||||
github.com/aws/aws-sdk-go v1.44.295 h1:SGjU1+MqttXfRiWHD6WU0DRhaanJgAFY+xIhEaugV8Y=
|
github.com/aws/aws-sdk-go v1.44.295 h1:SGjU1+MqttXfRiWHD6WU0DRhaanJgAFY+xIhEaugV8Y=
|
||||||
github.com/aws/aws-sdk-go v1.44.295/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI=
|
github.com/aws/aws-sdk-go v1.44.295/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI=
|
||||||
|
github.com/aymerick/raymond v2.0.3-0.20180322193309-b565731e1464+incompatible/go.mod h1:osfaiScAUVup+UC9Nfq76eWqDhXlp+4UYaA8uhTBO6g=
|
||||||
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
|
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
|
||||||
github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
|
github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
|
||||||
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
|
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
|
||||||
@ -84,24 +103,69 @@ github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWH
|
|||||||
github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
|
github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
|
||||||
github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
|
github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
|
||||||
github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
|
github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
|
||||||
|
github.com/cockroachdb/datadriven v1.0.0/go.mod h1:5Ib8Meh+jk1RlHIXej6Pzevx/NLlNvQB9pmSBZErGA4=
|
||||||
|
github.com/cockroachdb/datadriven v1.0.1-0.20211007161720-b558070c3be0/go.mod h1:5Ib8Meh+jk1RlHIXej6Pzevx/NLlNvQB9pmSBZErGA4=
|
||||||
|
github.com/cockroachdb/datadriven v1.0.1-0.20220214170620-9913f5bc19b7/go.mod h1:hi0MtSY3AYDQNDi83kDkMH5/yqM/CsIrsOITkSoH7KI=
|
||||||
|
github.com/cockroachdb/errors v1.6.1/go.mod h1:tm6FTP5G81vwJ5lC0SizQo374JNCOPrHyXGitRJoDqM=
|
||||||
|
github.com/cockroachdb/errors v1.8.1/go.mod h1:qGwQn6JmZ+oMjuLwjWzUNqblqk0xl4CVV3SQbGwK7Ac=
|
||||||
|
github.com/cockroachdb/errors v1.8.8/go.mod h1:z6VnEL3hZ/2ONZEvG7S5Ym0bU2AqPcEKnIiA1wbsSu0=
|
||||||
|
github.com/cockroachdb/errors v1.9.0 h1:B48dYem5SlAY7iU8AKsgedb4gH6mo+bDkbtLIvM/a88=
|
||||||
|
github.com/cockroachdb/errors v1.9.0/go.mod h1:vaNcEYYqbIqB5JhKBhFV9CneUqeuEbB2OYJBK4GBNYQ=
|
||||||
|
github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f/go.mod h1:i/u985jwjWRlyHXQbwatDASoW0RMlZ/3i9yJHE2xLkI=
|
||||||
|
github.com/cockroachdb/logtags v0.0.0-20211118104740-dabe8e521a4f h1:6jduT9Hfc0njg5jJ1DdKCFPdMBrp/mdZfCpa5h+WM74=
|
||||||
|
github.com/cockroachdb/logtags v0.0.0-20211118104740-dabe8e521a4f/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs=
|
||||||
|
github.com/cockroachdb/pebble v0.0.0-20221207173255-0f086d933dac h1:pwyQPbghSh6PC4MgXNvMZjf19LTugkIIPUSRzAD5LEE=
|
||||||
|
github.com/cockroachdb/pebble v0.0.0-20221207173255-0f086d933dac/go.mod h1:890yq1fUb9b6dGNwssgeUO5vQV9qfXnCPxAJhBQfXw0=
|
||||||
|
github.com/cockroachdb/redact v1.0.8/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg=
|
||||||
|
github.com/cockroachdb/redact v1.1.3 h1:AKZds10rFSIj7qADf0g46UixK8NNLwWTNdCIGS5wfSQ=
|
||||||
|
github.com/cockroachdb/redact v1.1.3/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg=
|
||||||
|
github.com/cockroachdb/sentry-go v0.6.1-cockroachdb.2/go.mod h1:8BT+cPK6xvFOcRlk0R8eg+OTkcqI6baNH4xAkpiYVvQ=
|
||||||
|
github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0/go.mod h1:4Zcjuz89kmFXt9morQgcfYZAYZ5n8WHjt81YYWIwtTM=
|
||||||
|
github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
|
||||||
|
github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk=
|
||||||
|
github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
|
||||||
|
github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE=
|
||||||
|
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
|
||||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||||
|
github.com/dgraph-io/badger v1.6.0/go.mod h1:zwt7syl517jmP8s94KqSxTlM6IMsdhYy6psNgSztDR4=
|
||||||
|
github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
|
||||||
|
github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw=
|
||||||
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78=
|
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78=
|
||||||
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc=
|
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc=
|
||||||
|
github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
|
||||||
|
github.com/eknkc/amber v0.0.0-20171010120322-cdade1c07385/go.mod h1:0vRUJqYpeSZifjYj7uP3BG/gKcuzL9xWVV/Y+cK33KM=
|
||||||
github.com/elazarl/goproxy v0.0.0-20210801061803-8e322dfb79c4 h1:lS3P5Nw3oPO05Lk2gFiYUOL3QPaH+fRoI1wFOc4G1UY=
|
github.com/elazarl/goproxy v0.0.0-20210801061803-8e322dfb79c4 h1:lS3P5Nw3oPO05Lk2gFiYUOL3QPaH+fRoI1wFOc4G1UY=
|
||||||
github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
|
github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
|
||||||
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
|
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
|
||||||
github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=
|
github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=
|
||||||
github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk=
|
github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk=
|
||||||
|
github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk=
|
||||||
github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ=
|
github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ=
|
||||||
github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0=
|
github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0=
|
||||||
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
|
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
|
||||||
|
github.com/etcd-io/bbolt v1.3.3/go.mod h1:ZF2nL25h33cCyBtcyWeZ2/I3HQOfTP+0PIEvHjkjCrw=
|
||||||
|
github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072/go.mod h1:duJ4Jxv5lDcvg4QuQr0oowTf7dz4/CR8NtyCooz9HL8=
|
||||||
github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk=
|
github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk=
|
||||||
github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs=
|
github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs=
|
||||||
github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw=
|
github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw=
|
||||||
|
github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M=
|
||||||
|
github.com/flosch/pongo2 v0.0.0-20190707114632-bbf5a6c351f4/go.mod h1:T9YF2M40nIgbVgp3rreNmTged+9HrbNTIQf1PsaIiTA=
|
||||||
|
github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k=
|
||||||
|
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
|
||||||
github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4=
|
github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4=
|
||||||
|
github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
|
||||||
|
github.com/gavv/httpexpect v2.0.0+incompatible/go.mod h1:x+9tiU1YnrOvnB725RkpoLv1M62hOWzwo5OXotisrKc=
|
||||||
|
github.com/getsentry/sentry-go v0.12.0 h1:era7g0re5iY13bHSdN/xMkyV+5zZppjRVQhZrXCaEIk=
|
||||||
|
github.com/getsentry/sentry-go v0.12.0/go.mod h1:NSap0JBYWzHND8oMbyi0+XZhUalc1TBdRL1M71JZW2c=
|
||||||
|
github.com/ghemawat/stream v0.0.0-20171120220530-696b145b53b9/go.mod h1:106OIgooyS7OzLDOpUGgm9fA3bQENb/cFSyyBmMoJDs=
|
||||||
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
|
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
|
||||||
|
github.com/gin-contrib/sse v0.0.0-20190301062529-5545eab6dad3/go.mod h1:VJ0WA2NBN22VlZ2dKZQPAPnyWw5XTlK1KymzLKsr59s=
|
||||||
|
github.com/gin-gonic/gin v1.4.0/go.mod h1:OW2EZn3DO8Ln9oIKOvM++LBO+5UPHJJDH72/q/3rZdM=
|
||||||
|
github.com/go-check/check v0.0.0-20180628173108-788fd7840127/go.mod h1:9ES+weclKsC9YodN5RgxqK/VD9HM9JsCSh7rNhMZE98=
|
||||||
|
github.com/go-errors/errors v1.0.1 h1:LUHzmkK3GUKUrL/1gfBUxAHzcev3apQlezX/+O7ma6w=
|
||||||
|
github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q=
|
||||||
github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
|
github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
|
||||||
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
|
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
|
||||||
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
|
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
|
||||||
@ -114,17 +178,29 @@ github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0=
|
|||||||
github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
|
github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
|
||||||
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
|
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
|
||||||
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
|
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
|
||||||
|
github.com/go-martini/martini v0.0.0-20170121215854-22fa46961aab/go.mod h1:/P9AEU963A2AYjv4d1V5eVL1CQbEJq6aCNHDDjibzu8=
|
||||||
github.com/go-redis/redis/v8 v8.11.5 h1:AcZZR7igkdvfVmQTPnu9WE37LRrO/YrBH5zWyjDC0oI=
|
github.com/go-redis/redis/v8 v8.11.5 h1:AcZZR7igkdvfVmQTPnu9WE37LRrO/YrBH5zWyjDC0oI=
|
||||||
github.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq8Jd4h5lpwo=
|
github.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq8Jd4h5lpwo=
|
||||||
github.com/go-sql-driver/mysql v1.7.0/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI=
|
github.com/go-sql-driver/mysql v1.7.0/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI=
|
||||||
github.com/go-sql-driver/mysql v1.7.1 h1:lUIinVbN1DY0xBg0eMOzmmtGoHwWBbvnWubQUrtU8EI=
|
github.com/go-sql-driver/mysql v1.7.1 h1:lUIinVbN1DY0xBg0eMOzmmtGoHwWBbvnWubQUrtU8EI=
|
||||||
github.com/go-sql-driver/mysql v1.7.1/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI=
|
github.com/go-sql-driver/mysql v1.7.1/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI=
|
||||||
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
|
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
|
||||||
|
github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo=
|
||||||
|
github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw=
|
||||||
|
github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM=
|
||||||
|
github.com/gogo/googleapis v0.0.0-20180223154316-0cd9801be74a/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s=
|
||||||
|
github.com/gogo/googleapis v1.4.1/go.mod h1:2lpHqI5OcWCtVElxXnPt+s8oJvMpySlOyM6xDCrzib4=
|
||||||
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
|
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
|
||||||
|
github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
|
||||||
|
github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o=
|
||||||
|
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
|
||||||
|
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
|
||||||
|
github.com/gogo/status v1.1.0/go.mod h1:BFv9nrluPLmrS0EmGVvLaPNmRosr9KapBYd5/hpY1WM=
|
||||||
github.com/golang-jwt/jwt v3.2.2+incompatible h1:IfV12K8xAKAnZqdXVzCZ+TOjboZ2keLg81eXfW3O+oY=
|
github.com/golang-jwt/jwt v3.2.2+incompatible h1:IfV12K8xAKAnZqdXVzCZ+TOjboZ2keLg81eXfW3O+oY=
|
||||||
github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I=
|
github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I=
|
||||||
github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg=
|
github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg=
|
||||||
github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0=
|
github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0=
|
||||||
|
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k=
|
||||||
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
|
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
|
||||||
github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4=
|
github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4=
|
||||||
github.com/golang/glog v1.1.0 h1:/d3pCKDPWNnvIWe0vVUpNP32qc8U3PDVxySP/y360qE=
|
github.com/golang/glog v1.1.0 h1:/d3pCKDPWNnvIWe0vVUpNP32qc8U3PDVxySP/y360qE=
|
||||||
@ -156,7 +232,12 @@ github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaS
|
|||||||
github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
|
github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
|
||||||
github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=
|
github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=
|
||||||
github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
|
github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
|
||||||
|
github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
|
||||||
|
github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM=
|
||||||
|
github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
|
||||||
|
github.com/gomodule/redigo v1.7.1-0.20190724094224-574c33c3df38/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4=
|
||||||
github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
|
github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
|
||||||
|
github.com/google/btree v1.0.0 h1:0udJVsspx3VBr5FwtLhQQtuAsVc79tTq0ocGIPAU6qo=
|
||||||
github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
|
github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
|
||||||
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
|
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
|
||||||
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
|
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
|
||||||
@ -165,9 +246,11 @@ github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
|
|||||||
github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||||
github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||||
github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||||
|
github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||||
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||||
github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||||
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
|
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
|
||||||
|
github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck=
|
||||||
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
||||||
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
|
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
|
||||||
github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
|
github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
|
||||||
@ -184,27 +267,57 @@ github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
|
|||||||
github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||||
github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
|
github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
|
||||||
github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
|
github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
|
||||||
|
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
|
||||||
|
github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
|
||||||
|
github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
|
||||||
|
github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc=
|
||||||
|
github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
|
||||||
github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw=
|
github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw=
|
||||||
github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0/go.mod h1:hgWBS7lorOAVIJEQMi4ZsPv9hVvWI6+ch50m39Pf2Ks=
|
github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0/go.mod h1:hgWBS7lorOAVIJEQMi4ZsPv9hVvWI6+ch50m39Pf2Ks=
|
||||||
github.com/grpc-ecosystem/grpc-gateway/v2 v2.15.0 h1:1JYBfzqrWPcCclBwxFCPAou9n+q86mfnu7NAeHfte7A=
|
github.com/grpc-ecosystem/grpc-gateway/v2 v2.15.0 h1:1JYBfzqrWPcCclBwxFCPAou9n+q86mfnu7NAeHfte7A=
|
||||||
github.com/grpc-ecosystem/grpc-gateway/v2 v2.15.0/go.mod h1:YDZoGHuwE+ov0c8smSH49WLF3F2LaWnYYuDVd+EWrc0=
|
github.com/grpc-ecosystem/grpc-gateway/v2 v2.15.0/go.mod h1:YDZoGHuwE+ov0c8smSH49WLF3F2LaWnYYuDVd+EWrc0=
|
||||||
github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542 h1:2VTzZjLZBgl62/EtslCrtky5vbi9dd7HrQPQIx6wqiw=
|
github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542 h1:2VTzZjLZBgl62/EtslCrtky5vbi9dd7HrQPQIx6wqiw=
|
||||||
|
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
|
||||||
|
github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I=
|
||||||
|
github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
|
||||||
github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80=
|
github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80=
|
||||||
github.com/hashicorp/go-hclog v1.5.0 h1:bI2ocEMgcVlz55Oj1xZNBsVi900c7II+fWDyV9o+13c=
|
github.com/hashicorp/go-hclog v1.5.0 h1:bI2ocEMgcVlz55Oj1xZNBsVi900c7II+fWDyV9o+13c=
|
||||||
github.com/hashicorp/go-hclog v1.5.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M=
|
github.com/hashicorp/go-hclog v1.5.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M=
|
||||||
github.com/hashicorp/go-immutable-radix v1.0.0 h1:AKDB1HM5PWEA7i4nhcpwOrO2byshxBjXVn/J/3+z5/0=
|
github.com/hashicorp/go-immutable-radix v1.0.0 h1:AKDB1HM5PWEA7i4nhcpwOrO2byshxBjXVn/J/3+z5/0=
|
||||||
github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60=
|
github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60=
|
||||||
|
github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM=
|
||||||
github.com/hashicorp/go-msgpack v0.5.5 h1:i9R9JSrqIz0QVLz3sz+i3YJdT7TTSLcfLLzJi9aZTuI=
|
github.com/hashicorp/go-msgpack v0.5.5 h1:i9R9JSrqIz0QVLz3sz+i3YJdT7TTSLcfLLzJi9aZTuI=
|
||||||
github.com/hashicorp/go-msgpack v0.5.5/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM=
|
github.com/hashicorp/go-msgpack v0.5.5/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM=
|
||||||
|
github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk=
|
||||||
|
github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo=
|
||||||
|
github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM=
|
||||||
github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs=
|
github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs=
|
||||||
|
github.com/hashicorp/go-sockaddr v1.0.0 h1:GeH6tui99pF4NJgfnhp+L6+FfobzVW3Ah46sLo0ICXs=
|
||||||
|
github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU=
|
||||||
github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
|
github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
|
||||||
github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8=
|
github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8=
|
||||||
|
github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
|
||||||
|
github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
|
||||||
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
|
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
|
||||||
github.com/hashicorp/golang-lru v0.5.1 h1:0hERBMJE1eitiLkihrMvRVBYAkpHzc/J3QdDN+dAcgU=
|
github.com/hashicorp/golang-lru v0.5.1 h1:0hERBMJE1eitiLkihrMvRVBYAkpHzc/J3QdDN+dAcgU=
|
||||||
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
|
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
|
||||||
|
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
|
||||||
|
github.com/hashicorp/memberlist v0.3.1 h1:MXgUXLqva1QvpVEDQW1IQLG0wivQAtmFlHRQ+1vWZfM=
|
||||||
|
github.com/hashicorp/memberlist v0.3.1/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE=
|
||||||
github.com/hashicorp/raft v1.5.0 h1:uNs9EfJ4FwiArZRxxfd/dQ5d33nV31/CdCHArH89hT8=
|
github.com/hashicorp/raft v1.5.0 h1:uNs9EfJ4FwiArZRxxfd/dQ5d33nV31/CdCHArH89hT8=
|
||||||
github.com/hashicorp/raft v1.5.0/go.mod h1:pKHB2mf/Y25u3AHNSXVRv+yT+WAnmeTX0BwVppVQV+M=
|
github.com/hashicorp/raft v1.5.0/go.mod h1:pKHB2mf/Y25u3AHNSXVRv+yT+WAnmeTX0BwVppVQV+M=
|
||||||
|
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
|
||||||
|
github.com/hydrogen18/memlistener v0.0.0-20141126152155-54553eb933fb/go.mod h1:qEIFzExnS6016fRpRfxrExeVn2gbClQA99gQhnIcdhE=
|
||||||
|
github.com/hydrogen18/memlistener v0.0.0-20200120041712-dcc25e7acd91/go.mod h1:qEIFzExnS6016fRpRfxrExeVn2gbClQA99gQhnIcdhE=
|
||||||
github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
|
github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
|
||||||
|
github.com/imkira/go-interpol v1.1.0/go.mod h1:z0h2/2T3XF8kyEPpRgJ3kmNv+C43p+I/CoI+jC3w2iA=
|
||||||
|
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
|
||||||
|
github.com/iris-contrib/blackfriday v2.0.0+incompatible/go.mod h1:UzZ2bDEoaSGPbkg6SAB4att1aAwTmVIx/5gCVqeyUdI=
|
||||||
|
github.com/iris-contrib/go.uuid v2.0.0+incompatible/go.mod h1:iz2lgM/1UnEf1kP0L/+fafWORmlnuysV2EMP8MW+qe0=
|
||||||
|
github.com/iris-contrib/i18n v0.0.0-20171121225848-987a633949d0/go.mod h1:pMCz62A0xJL6I+umB2YTlFRwWXaDFA0jy+5HzGiJjqI=
|
||||||
|
github.com/iris-contrib/jade v1.1.3/go.mod h1:H/geBymxJhShH5kecoiOCSssPX7QWYH7UaeZTSWddIk=
|
||||||
|
github.com/iris-contrib/pongo2 v0.0.1/go.mod h1:Ssh+00+3GAZqSQb30AvBRNxBx7rf0GqwkjqxNd0u65g=
|
||||||
|
github.com/iris-contrib/schema v0.0.1/go.mod h1:urYA3uvUNG1TIIjOSCzHr9/LmbQo8LrOcOqfqxa4hXw=
|
||||||
github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E=
|
github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E=
|
||||||
github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc=
|
github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc=
|
||||||
github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ=
|
github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ=
|
||||||
@ -217,46 +330,120 @@ github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCV
|
|||||||
github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
|
github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
|
||||||
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
|
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
|
||||||
github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk=
|
github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk=
|
||||||
|
github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
|
||||||
|
github.com/juju/errors v0.0.0-20181118221551-089d3ea4e4d5/go.mod h1:W54LbzXuIE0boCoNJfwqpmkKJ1O4TCTZMetAt6jGk7Q=
|
||||||
|
github.com/juju/loggo v0.0.0-20180524022052-584905176618/go.mod h1:vgyd7OREkbtVEN/8IXZe5Ooef3LQePvuBm9UWj6ZL8U=
|
||||||
|
github.com/juju/testing v0.0.0-20180920084828-472a3e8b2073/go.mod h1:63prj8cnj0tU0S9OHjGJn+b1h0ZghCndfnbQolrYTwA=
|
||||||
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
|
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
|
||||||
|
github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E/uU8ce6rXgefFLlgrJj/GYY22cpxn+r32jIOes=
|
||||||
|
github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88/go.mod h1:3w7q1U84EfirKl04SVQ/s7nPm1ZPhiXd34z40TNz36k=
|
||||||
|
github.com/kataras/golog v0.0.9/go.mod h1:12HJgwBIZFNGL0EJnMRhmvGA0PQGx8VFwrZtM4CqbAk=
|
||||||
|
github.com/kataras/golog v0.0.10/go.mod h1:yJ8YKCmyL+nWjERB90Qwn+bdyBZsaQwU3bTVFgkFIp8=
|
||||||
|
github.com/kataras/iris/v12 v12.0.1/go.mod h1:udK4vLQKkdDqMGJJVd/msuMtN6hpYJhg/lSzuxjhO+U=
|
||||||
|
github.com/kataras/iris/v12 v12.1.8/go.mod h1:LMYy4VlP67TQ3Zgriz8RE2h2kMZV2SgMYbq3UhfoFmE=
|
||||||
|
github.com/kataras/neffos v0.0.10/go.mod h1:ZYmJC07hQPW67eKuzlfY7SO3bC0mw83A3j6im82hfqw=
|
||||||
|
github.com/kataras/neffos v0.0.14/go.mod h1:8lqADm8PnbeFfL7CLXh1WHw53dG27MC3pgi2R1rmoTE=
|
||||||
|
github.com/kataras/pio v0.0.0-20190103105442-ea782b38602d/go.mod h1:NV88laa9UiiDuX9AhMbDPkGYSPugBOV6yTZB1l2K9Z0=
|
||||||
|
github.com/kataras/pio v0.0.2/go.mod h1:hAoW0t9UmXi4R5Oyq5Z4irTbaTsOemSrDGUtaTl7Dro=
|
||||||
|
github.com/kataras/sitemap v0.0.5/go.mod h1:KY2eugMKiPwsJgx7+U103YZehfvNGOXURubcGyk0Bz8=
|
||||||
|
github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00=
|
||||||
|
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
|
||||||
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
|
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
|
||||||
|
github.com/klauspost/compress v1.8.2/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A=
|
||||||
|
github.com/klauspost/compress v1.9.0/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A=
|
||||||
|
github.com/klauspost/compress v1.9.7/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A=
|
||||||
|
github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs=
|
||||||
github.com/klauspost/compress v1.15.15 h1:EF27CXIuDsYJ6mmvtBRlEuB2UVOqHG1tAXgZ7yIO+lw=
|
github.com/klauspost/compress v1.15.15 h1:EF27CXIuDsYJ6mmvtBRlEuB2UVOqHG1tAXgZ7yIO+lw=
|
||||||
|
github.com/klauspost/compress v1.15.15/go.mod h1:ZcK2JAFqKOpnBlxcLsJzYfrS9X1akm9fHZNnD9+Vo/4=
|
||||||
|
github.com/klauspost/cpuid v1.2.1/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek=
|
||||||
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
|
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
|
||||||
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
|
github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
|
||||||
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
|
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
|
||||||
|
github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk=
|
||||||
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
|
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
|
||||||
|
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
|
||||||
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
||||||
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
||||||
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
||||||
|
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
|
||||||
|
github.com/labstack/echo/v4 v4.1.11/go.mod h1:i541M3Fj6f76NZtHSj7TXnyM8n2gaodfvfxNnFqi74g=
|
||||||
|
github.com/labstack/echo/v4 v4.5.0/go.mod h1:czIriw4a0C1dFun+ObrXp7ok03xON0N1awStJ6ArI7Y=
|
||||||
|
github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k=
|
||||||
|
github.com/lni/dragonboat/v4 v4.0.0-20230709075559-54497b9553be h1:0K1suLIEoHH6f2OnWF9IIlVAjR8OhFt+VuC9ZKpEJCk=
|
||||||
|
github.com/lni/dragonboat/v4 v4.0.0-20230709075559-54497b9553be/go.mod h1:DbE6sDHHvYPZvJPgP5K82+HHn6OMTgbAWy/ISa42VEk=
|
||||||
|
github.com/lni/goutils v1.3.1-0.20220604063047-388d67b4dbc4 h1:6gzI38ZJmbzZ7oZebXz6jII0uVK+MZ3+ds+7mIt1ioI=
|
||||||
|
github.com/lni/goutils v1.3.1-0.20220604063047-388d67b4dbc4/go.mod h1:LIHvF0fflR+zyXUQFQOiHPpKANf3UIr7DFIv5CBPOoU=
|
||||||
|
github.com/lni/vfs v0.2.1-0.20220616104132-8852fd867376 h1:jX9CoRWNPwrZ2yY3RJFTSwa49qDQqtXglrCByGdQGZg=
|
||||||
|
github.com/lni/vfs v0.2.1-0.20220616104132-8852fd867376/go.mod h1:LOatfyR8Xeej1jbXybwYGVfCccR0u+BQRG9xg7BD7xo=
|
||||||
|
github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
|
||||||
|
github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
|
||||||
|
github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
|
||||||
github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
|
github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
|
||||||
|
github.com/mattn/go-colorable v0.1.11/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4=
|
||||||
github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4=
|
github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4=
|
||||||
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
|
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
|
||||||
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
|
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
|
||||||
|
github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
|
||||||
|
github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
|
||||||
|
github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ=
|
||||||
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
|
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
|
||||||
github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94=
|
github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94=
|
||||||
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
|
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
|
||||||
github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng=
|
github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng=
|
||||||
github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
|
github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
|
||||||
|
github.com/mattn/goveralls v0.0.2/go.mod h1:8d1ZMHsd7fW6IRPKQh46F2WRpyib5/X4FOpevwGNQEw=
|
||||||
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
|
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
|
||||||
github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo=
|
github.com/matttproud/golang_protobuf_extensions v1.0.4 h1:mmDVorXM7PCGKw94cs5zkfA9PSy5pEvNWRP0ET0TIVo=
|
||||||
github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4=
|
github.com/matttproud/golang_protobuf_extensions v1.0.4/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4=
|
||||||
|
github.com/mediocregopher/mediocre-go-lib v0.0.0-20181029021733-cb65787f37ed/go.mod h1:dSsfyI2zABAdhcbvkXqgxOxrCsbYeHCPgrZkku60dSg=
|
||||||
|
github.com/mediocregopher/radix/v3 v3.3.0/go.mod h1:EmfVyvspXz1uZEyPBMyGK+kjWiKQGvsUt6O3Pj+LDCQ=
|
||||||
|
github.com/mediocregopher/radix/v3 v3.4.2/go.mod h1:8FL3F6UQRXHXIBSPUs5h0RybMF8i4n7wVopoX3x7Bv8=
|
||||||
|
github.com/microcosm-cc/bluemonday v1.0.2/go.mod h1:iVP4YcDBq+n/5fb23BhYFvIMq/leAFZyRl6bYmGDlGc=
|
||||||
|
github.com/miekg/dns v1.1.26 h1:gPxPSwALAeHJSjarOs00QjVdV9QoBvc1D2ujQUr5BzU=
|
||||||
|
github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso=
|
||||||
|
github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
|
||||||
|
github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
|
||||||
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
|
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
|
||||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
|
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
|
||||||
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
|
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
|
||||||
github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
|
github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
|
||||||
|
github.com/moul/http2curl v1.0.0/go.mod h1:8UbvGypXm98wA/IqH45anm5Y2Z6ep6O31QGOAZ3H0fQ=
|
||||||
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
|
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
|
||||||
|
github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5VglpSg=
|
||||||
|
github.com/nats-io/nats.go v1.8.1/go.mod h1:BrFz9vVn0fU3AcH9Vn4Kd7W0NpJ651tD5omQ3M8LwxM=
|
||||||
|
github.com/nats-io/nats.go v1.9.1/go.mod h1:ZjDU1L/7fJ09jvUSRVBR2e7+RnLiiIQyqyzEE/Zbp4w=
|
||||||
|
github.com/nats-io/nkeys v0.0.2/go.mod h1:dab7URMsZm6Z/jp9Z5UGa87Uutgc2mVpXLC4B7TDb/4=
|
||||||
|
github.com/nats-io/nkeys v0.1.0/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w=
|
||||||
|
github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c=
|
||||||
github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646 h1:zYyBkD/k9seD2A7fsi6Oo2LfFZAehjjQMERAvZLEDnQ=
|
github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646 h1:zYyBkD/k9seD2A7fsi6Oo2LfFZAehjjQMERAvZLEDnQ=
|
||||||
github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646/go.mod h1:jpp1/29i3P1S/RLdc7JQKbRpFeM1dOBd8T9ki5s+AY8=
|
github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646/go.mod h1:jpp1/29i3P1S/RLdc7JQKbRpFeM1dOBd8T9ki5s+AY8=
|
||||||
|
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
|
||||||
|
github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
|
||||||
github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE=
|
github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE=
|
||||||
|
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
|
||||||
|
github.com/onsi/ginkgo v1.10.3/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
|
||||||
|
github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk=
|
||||||
|
github.com/onsi/ginkgo v1.13.0/go.mod h1:+REjRxOmWfHCjfv9TTWB1jD1Frx4XydAD3zm1lskyM0=
|
||||||
github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE=
|
github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE=
|
||||||
|
github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY=
|
||||||
|
github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo=
|
||||||
github.com/onsi/gomega v1.18.1 h1:M1GfJqGRrBrrGGsbxzV5dqM2U2ApXefZCQpkukxYRLE=
|
github.com/onsi/gomega v1.18.1 h1:M1GfJqGRrBrrGGsbxzV5dqM2U2ApXefZCQpkukxYRLE=
|
||||||
github.com/openzipkin/zipkin-go v0.4.1 h1:kNd/ST2yLLWhaWrkgchya40TJabe8Hioj9udfPcEO5A=
|
github.com/openzipkin/zipkin-go v0.4.1 h1:kNd/ST2yLLWhaWrkgchya40TJabe8Hioj9udfPcEO5A=
|
||||||
github.com/openzipkin/zipkin-go v0.4.1/go.mod h1:qY0VqDSN1pOBN94dBc6w2GJlWLiovAyg7Qt6/I9HecM=
|
github.com/openzipkin/zipkin-go v0.4.1/go.mod h1:qY0VqDSN1pOBN94dBc6w2GJlWLiovAyg7Qt6/I9HecM=
|
||||||
|
github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=
|
||||||
github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY=
|
github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY=
|
||||||
github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=
|
github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc=
|
||||||
|
github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
|
||||||
github.com/pelletier/go-toml/v2 v2.0.9 h1:uH2qQXheeefCCkuBBSLi7jCiSmj3VRh2+Goq2N7Xxu0=
|
github.com/pelletier/go-toml/v2 v2.0.9 h1:uH2qQXheeefCCkuBBSLi7jCiSmj3VRh2+Goq2N7Xxu0=
|
||||||
github.com/pelletier/go-toml/v2 v2.0.9/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc=
|
github.com/pelletier/go-toml/v2 v2.0.9/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc=
|
||||||
|
github.com/pierrec/lz4/v4 v4.1.17 h1:kV4Ip+/hUBC+8T6+2EgburRtkE9ef4nbY3f4dFhGjMc=
|
||||||
|
github.com/pierrec/lz4/v4 v4.1.17/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4=
|
||||||
|
github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4=
|
||||||
|
github.com/pingcap/errors v0.11.4/go.mod h1:Oi8TUi2kEtXXLMJk9l1cGmz20kV3TaQ0usTwv5KuLY8=
|
||||||
|
github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=
|
||||||
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||||
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||||
|
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
|
||||||
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||||
@ -283,16 +470,38 @@ github.com/prometheus/procfs v0.10.1 h1:kYK1Va/YMlutzCGazswoHKo//tZVlFpKYh+Pymzi
|
|||||||
github.com/prometheus/procfs v0.10.1/go.mod h1:nwNm2aOCAYw8uTR/9bWRREkZFxAUcWzPHWJq+XBB/FM=
|
github.com/prometheus/procfs v0.10.1/go.mod h1:nwNm2aOCAYw8uTR/9bWRREkZFxAUcWzPHWJq+XBB/FM=
|
||||||
github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
|
github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
|
||||||
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
|
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
|
||||||
|
github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
|
||||||
|
github.com/rogpeppe/go-internal v1.8.1/go.mod h1:JeRgkft04UBgHMgCIwADu4Pn6Mtm5d4nPKWu0nJ5d+o=
|
||||||
github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8=
|
github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8=
|
||||||
|
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
|
||||||
|
github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g=
|
||||||
|
github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
|
||||||
|
github.com/schollz/closestmatch v2.1.0+incompatible/go.mod h1:RtP1ddjLong6gTkbtmuhtR2uUrrJOpYzYRvbcPAid+g=
|
||||||
github.com/schollz/progressbar v1.0.0 h1:gbyFReLHDkZo8mxy/dLWMr+Mpb1MokGJ1FqCiqacjZM=
|
github.com/schollz/progressbar v1.0.0 h1:gbyFReLHDkZo8mxy/dLWMr+Mpb1MokGJ1FqCiqacjZM=
|
||||||
github.com/schollz/progressbar v1.0.0/go.mod h1:/l9I7PC3L3erOuz54ghIRKUEFcosiWfLvJv+Eq26UMs=
|
github.com/schollz/progressbar v1.0.0/go.mod h1:/l9I7PC3L3erOuz54ghIRKUEFcosiWfLvJv+Eq26UMs=
|
||||||
|
github.com/sclevine/agouti v3.0.0+incompatible/go.mod h1:b4WX9W9L1sfQKXeJf1mUTLZKJ48R1S7H23Ji7oFO5Bw=
|
||||||
|
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 h1:nn5Wsu0esKSJiIVhscUtVbo7ada43DJhG55ua/hjS5I=
|
||||||
|
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc=
|
||||||
|
github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=
|
||||||
|
github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM=
|
||||||
|
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
|
||||||
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
|
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
|
||||||
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
|
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
|
||||||
github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e h1:MRM5ITcdelLK2j1vwZ3Je0FKVCfqOLp5zO6trqMLYs0=
|
github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e h1:MRM5ITcdelLK2j1vwZ3Je0FKVCfqOLp5zO6trqMLYs0=
|
||||||
github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e/go.mod h1:XV66xRDqSt+GTGFMVlhk3ULuV0y9ZmzeVGR4mloJI3M=
|
github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e/go.mod h1:XV66xRDqSt+GTGFMVlhk3ULuV0y9ZmzeVGR4mloJI3M=
|
||||||
|
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
|
||||||
|
github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
|
||||||
github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
|
github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
|
||||||
github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI=
|
github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI=
|
||||||
github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
|
github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
|
||||||
|
github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ=
|
||||||
|
github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
|
||||||
|
github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU=
|
||||||
|
github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo=
|
||||||
|
github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
|
||||||
|
github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s=
|
||||||
|
github.com/streadway/amqp v1.1.0 h1:py12iX8XSyI7aN/3dUT8DFIDJazNJsVJdxNVEpnQTZM=
|
||||||
|
github.com/streadway/amqp v1.1.0/go.mod h1:WYSrTEYHOXHd0nwFeUXAe2G2hRnQT+deZJJf88uS9Bg=
|
||||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||||
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||||
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
|
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
|
||||||
@ -318,9 +527,33 @@ github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JT
|
|||||||
github.com/tidwall/pretty v1.2.0 h1:RWIZEg2iJ8/g6fDDYzMpobmaoGh5OLl4AXtGUGPcqCs=
|
github.com/tidwall/pretty v1.2.0 h1:RWIZEg2iJ8/g6fDDYzMpobmaoGh5OLl4AXtGUGPcqCs=
|
||||||
github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU=
|
github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU=
|
||||||
github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM=
|
github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM=
|
||||||
|
github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc=
|
||||||
|
github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw=
|
||||||
|
github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0=
|
||||||
|
github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY=
|
||||||
|
github.com/urfave/negroni v1.0.0/go.mod h1:Meg73S6kFm/4PpbYdq35yYWoCZ9mS/YSx+lKnmiohz4=
|
||||||
|
github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
|
||||||
|
github.com/valyala/fasthttp v1.6.0/go.mod h1:FstJa9V+Pj9vQ7OJie2qMHdwemEDaDiSdBnvPM1Su9w=
|
||||||
|
github.com/valyala/fastrand v1.1.0 h1:f+5HkLW4rsgzdNoleUOB69hyT9IlD2ZQh9GyDMfb5G8=
|
||||||
|
github.com/valyala/fastrand v1.1.0/go.mod h1:HWqCzkrkg6QXT8V2EXWvXCoow7vLwOFN002oeRzjapQ=
|
||||||
|
github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8=
|
||||||
|
github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ=
|
||||||
|
github.com/valyala/histogram v1.2.0 h1:wyYGAZZt3CpwUiIb9AU/Zbllg1llXyrtApRS815OLoQ=
|
||||||
|
github.com/valyala/histogram v1.2.0/go.mod h1:Hb4kBwb4UxsaNbbbh+RRz8ZR6pdodR57tzWUS3BUzXY=
|
||||||
|
github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a/go.mod h1:v3UYOV9WzVtRmSR+PDvWpU/qWl4Wa5LApYYX4ZtKbio=
|
||||||
|
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU=
|
||||||
|
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ=
|
||||||
|
github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y=
|
||||||
|
github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q=
|
||||||
|
github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0/go.mod h1:/LWChgwKmvncFJFHJ7Gvn9wZArjbV5/FppcK2fKk/tI=
|
||||||
|
github.com/yudai/gojsondiff v1.0.0/go.mod h1:AY32+k2cwILAkW1fbgxQ5mUmMiZFgLIV+FBNExI05xg=
|
||||||
|
github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82/go.mod h1:lgjkn3NuSvDfVJdfcVVdX+jpBxNmX4rDAzaS45IcYoM=
|
||||||
|
github.com/yudai/pp v2.0.1+incompatible/go.mod h1:PuxR/8QJ7cyCkFp/aUDS+JY727OFEZkTdatxwunjIkc=
|
||||||
github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||||
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||||
github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||||
|
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||||
|
github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
|
||||||
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
|
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
|
||||||
github.com/yuin/gopher-lua v1.1.0 h1:BojcDhfyDWgU2f2TOzYK/g5p2gxMrku8oupLDqlnSqE=
|
github.com/yuin/gopher-lua v1.1.0 h1:BojcDhfyDWgU2f2TOzYK/g5p2gxMrku8oupLDqlnSqE=
|
||||||
github.com/zeromicro/go-zero v1.5.4 h1:kRvcYuxcHOkUZvg7887KQl77Qv4klGL7MqGkTBgkpS8=
|
github.com/zeromicro/go-zero v1.5.4 h1:kRvcYuxcHOkUZvg7887KQl77Qv4klGL7MqGkTBgkpS8=
|
||||||
@ -357,13 +590,23 @@ go.uber.org/automaxprocs v1.5.2 h1:2LxUOGiR3O6tw8ui5sZa2LAaHnsviZdVOUZw4fvbnME=
|
|||||||
go.uber.org/automaxprocs v1.5.2/go.mod h1:eRbA25aqJrxAbsLO0xy5jVwPt7FQnRgjW+efnwa1WM0=
|
go.uber.org/automaxprocs v1.5.2/go.mod h1:eRbA25aqJrxAbsLO0xy5jVwPt7FQnRgjW+efnwa1WM0=
|
||||||
go.uber.org/goleak v1.2.1 h1:NBol2c7O1ZokfZ0LEU9K6Whx/KnwvepVetCUhtKja4A=
|
go.uber.org/goleak v1.2.1 h1:NBol2c7O1ZokfZ0LEU9K6Whx/KnwvepVetCUhtKja4A=
|
||||||
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
||||||
|
golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
|
||||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||||
golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||||
golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||||
|
golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||||
|
golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY=
|
||||||
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||||
|
golang.org/x/crypto v0.0.0-20191227163750-53104e6ec876/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||||
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||||
|
golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4=
|
||||||
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
||||||
|
golang.org/x/crypto v0.11.0 h1:6Ewdq3tDic1mg5xRO4milcWCfMVQhI4NkqWWvqejpuA=
|
||||||
|
golang.org/x/crypto v0.11.0/go.mod h1:xgJhtzW8F9jGdVFWZESrid1U1bjeNy4zgy5cRr/CIio=
|
||||||
|
golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||||
|
golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||||
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||||
|
golang.org/x/exp v0.0.0-20190125153040-c74c464bbbf2/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||||
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||||
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
|
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
|
||||||
golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek=
|
golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek=
|
||||||
@ -373,6 +616,9 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0
|
|||||||
golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
|
golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
|
||||||
golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM=
|
golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM=
|
||||||
golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU=
|
golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU=
|
||||||
|
golang.org/x/exp v0.0.0-20200513190911-00229845015e h1:rMqLP+9XLy+LdbCXHjJHAmTfXCr93W7oruWA6Hq1Alc=
|
||||||
|
golang.org/x/exp v0.0.0-20200513190911-00229845015e/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw=
|
||||||
|
golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs=
|
||||||
golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
|
golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
|
||||||
golang.org/x/image v0.0.0-20190802002840-cff245a6509b h1:+qEpEAPhDZ1o0x3tHzZTQDArnOixOzGD9HUJfcg0mb4=
|
golang.org/x/image v0.0.0-20190802002840-cff245a6509b h1:+qEpEAPhDZ1o0x3tHzZTQDArnOixOzGD9HUJfcg0mb4=
|
||||||
golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
|
golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
|
||||||
@ -386,6 +632,7 @@ golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHl
|
|||||||
golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs=
|
golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs=
|
||||||
golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
|
golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
|
||||||
golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
|
golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
|
||||||
|
golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
|
||||||
golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE=
|
golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE=
|
||||||
golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o=
|
golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o=
|
||||||
golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc=
|
golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc=
|
||||||
@ -394,13 +641,17 @@ golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzB
|
|||||||
golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
|
golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
|
||||||
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||||
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||||
|
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||||
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
|
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
|
||||||
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||||
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||||
|
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||||
golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||||
|
golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||||
golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||||
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||||
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||||
|
golang.org/x/net v0.0.0-20190327091125-710a502c58a2/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||||
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||||
golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||||
golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||||
@ -409,6 +660,8 @@ golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLL
|
|||||||
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||||
golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||||
golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||||
|
golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||||
|
golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||||
golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||||
golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||||
golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||||
@ -419,13 +672,16 @@ golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/
|
|||||||
golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
|
golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
|
||||||
golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
|
golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
|
||||||
golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
|
golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
|
||||||
|
golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
|
||||||
golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
|
golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
|
||||||
golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
|
golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
|
||||||
golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
|
golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
|
||||||
golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
|
golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
|
||||||
|
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
|
||||||
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||||
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
|
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
|
||||||
golang.org/x/net v0.0.0-20210520170846-37e1c6afe023/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
golang.org/x/net v0.0.0-20210520170846-37e1c6afe023/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||||
|
golang.org/x/net v0.0.0-20211008194852-3b03d305991f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||||
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
|
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
|
||||||
golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco=
|
golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco=
|
||||||
golang.org/x/net v0.12.0 h1:cfawfvKITfUsFCeJIHJrbSxpeu/E81khclypR0GVT50=
|
golang.org/x/net v0.12.0 h1:cfawfvKITfUsFCeJIHJrbSxpeu/E81khclypR0GVT50=
|
||||||
@ -446,11 +702,17 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ
|
|||||||
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
|
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
|
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
|
golang.org/x/sync v0.2.0 h1:PUR+T4wwASmuSTYdKjYHI5TD22Wy5ogLU5qZCOLxBrI=
|
||||||
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
|
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
|
golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
|
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
@ -458,8 +720,15 @@ golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7w
|
|||||||
golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
@ -474,15 +743,21 @@ golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7w
|
|||||||
golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
|
golang.org/x/sys v0.0.0-20210909193231-528a39cd75f3/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
|
golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
|
golang.org/x/sys v0.0.0-20220209214540-3681064d5158/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
@ -507,12 +782,19 @@ golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
|
|||||||
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||||
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||||
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||||
|
golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||||
|
golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||||
|
golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||||
|
golang.org/x/tools v0.0.0-20181221001348-537d06c36207/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||||
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||||
|
golang.org/x/tools v0.0.0-20190206041539-40960b6deb8e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||||
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
|
golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
|
||||||
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
||||||
golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
||||||
golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
||||||
|
golang.org/x/tools v0.0.0-20190327201419-c70d86f8b7cf/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
||||||
|
golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
|
||||||
golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
|
golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
|
||||||
golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
|
golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
|
||||||
golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
|
golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
|
||||||
@ -520,6 +802,7 @@ golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgw
|
|||||||
golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
|
golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
|
||||||
golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
|
golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
|
||||||
golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||||
|
golang.org/x/tools v0.0.0-20190907020128-2ca718005c18/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||||
golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||||
golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||||
golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||||
@ -544,14 +827,22 @@ golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roY
|
|||||||
golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||||
golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||||
golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||||
|
golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
|
||||||
golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
|
golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
|
||||||
golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
|
golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
|
||||||
golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
|
golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
|
||||||
|
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
|
||||||
|
golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk=
|
||||||
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
|
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
|
||||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||||
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||||
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||||
|
gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJDxZx5Dpnq+c3wtXuadVZAcxbbBo=
|
||||||
|
gonum.org/v1/gonum v0.8.2 h1:CCXrcPKiGGotvnN6jfUsKk4rRqm7q09/YbKb5xCEvtM=
|
||||||
|
gonum.org/v1/gonum v0.8.2/go.mod h1:oe/vMfY3deqTw+1EZJhuvEW2iwGF1bW9wwu7XCu0+v0=
|
||||||
|
gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw=
|
||||||
|
gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b/go.mod h1:Wt8AAjI+ypCyYX3nZBvf6cAIx93T+c/OS2HFAYskSZc=
|
||||||
google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE=
|
google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE=
|
||||||
google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M=
|
google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M=
|
||||||
google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg=
|
google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg=
|
||||||
@ -576,6 +867,7 @@ google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCID
|
|||||||
google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
|
google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
|
||||||
google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c=
|
google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c=
|
||||||
google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
|
google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
|
||||||
|
google.golang.org/genproto v0.0.0-20180518175338-11a468237815/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
|
||||||
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
|
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
|
||||||
google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
|
google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
|
||||||
google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
|
google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
|
||||||
@ -606,6 +898,7 @@ google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7Fc
|
|||||||
google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||||
google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||||
google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||||
|
google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24=
|
||||||
google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
|
google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
|
||||||
google.golang.org/genproto v0.0.0-20230530153820-e85fd2cbaebc h1:8DyZCyvI8mE1IdLy/60bS+52xfymkE72wv1asokgtao=
|
google.golang.org/genproto v0.0.0-20230530153820-e85fd2cbaebc h1:8DyZCyvI8mE1IdLy/60bS+52xfymkE72wv1asokgtao=
|
||||||
google.golang.org/genproto v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:xZnkP7mREFX5MORlOPEzLMr+90PPZQ2QWzrVTWfAq64=
|
google.golang.org/genproto v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:xZnkP7mREFX5MORlOPEzLMr+90PPZQ2QWzrVTWfAq64=
|
||||||
@ -613,6 +906,7 @@ google.golang.org/genproto/googleapis/api v0.0.0-20230530153820-e85fd2cbaebc h1:
|
|||||||
google.golang.org/genproto/googleapis/api v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:vHYtlOoi6TsQ3Uk2yxR7NI5z8uoV+3pZtR4jmHIkRig=
|
google.golang.org/genproto/googleapis/api v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:vHYtlOoi6TsQ3Uk2yxR7NI5z8uoV+3pZtR4jmHIkRig=
|
||||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc h1:XSJ8Vk1SWuNr8S18z1NZSziL0CPIXLCCMDOEFtHBOFc=
|
google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc h1:XSJ8Vk1SWuNr8S18z1NZSziL0CPIXLCCMDOEFtHBOFc=
|
||||||
google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA=
|
google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA=
|
||||||
|
google.golang.org/grpc v1.12.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw=
|
||||||
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
|
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
|
||||||
google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
|
google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
|
||||||
google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
|
google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
|
||||||
@ -627,6 +921,7 @@ google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM
|
|||||||
google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
|
google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
|
||||||
google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0=
|
google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0=
|
||||||
google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
|
google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
|
||||||
|
google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM=
|
||||||
google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34=
|
google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34=
|
||||||
google.golang.org/grpc v1.42.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU=
|
google.golang.org/grpc v1.42.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU=
|
||||||
google.golang.org/grpc v1.56.2 h1:fVRFRnXvU+x6C4IlHZewvJOVHoOv1TUuQyoRsYnB4bI=
|
google.golang.org/grpc v1.56.2 h1:fVRFRnXvU+x6C4IlHZewvJOVHoOv1TUuQyoRsYnB4bI=
|
||||||
@ -650,19 +945,29 @@ gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLks
|
|||||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||||
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||||
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||||
|
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
|
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
|
||||||
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
|
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
|
||||||
|
gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
|
||||||
|
gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE=
|
||||||
|
gopkg.in/go-playground/validator.v8 v8.18.2/go.mod h1:RX2a/7Ha8BgOhfk7j780h4/u/RRjR0eouCJSH80/M2Y=
|
||||||
gopkg.in/h2non/gock.v1 v1.1.2 h1:jBbHXgGBK/AoPVfJh5x4r/WxIrElvbLel8TCZkkZJoY=
|
gopkg.in/h2non/gock.v1 v1.1.2 h1:jBbHXgGBK/AoPVfJh5x4r/WxIrElvbLel8TCZkkZJoY=
|
||||||
|
gopkg.in/ini.v1 v1.51.1/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
|
||||||
|
gopkg.in/mgo.v2 v2.0.0-20180705113604-9856a29383ce/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA=
|
||||||
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=
|
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=
|
||||||
|
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
|
||||||
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||||
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||||
gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||||
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||||
gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||||
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||||
|
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||||
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
|
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
|
||||||
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
|
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
|
||||||
|
gopkg.in/yaml.v3 v3.0.0-20191120175047-4206685974f2/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||||
|
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||||
gorm.io/driver/mysql v1.5.1 h1:WUEH5VF9obL/lTtzjmML/5e6VfFR/788coz2uaVCAZw=
|
gorm.io/driver/mysql v1.5.1 h1:WUEH5VF9obL/lTtzjmML/5e6VfFR/788coz2uaVCAZw=
|
||||||
@ -678,5 +983,6 @@ honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9
|
|||||||
honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
|
honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
|
||||||
k8s.io/utils v0.0.0-20230209194617-a36077c30491 h1:r0BAOLElQnnFhE/ApUsg3iHdVYYPBjNSSOMowRZxxsY=
|
k8s.io/utils v0.0.0-20230209194617-a36077c30491 h1:r0BAOLElQnnFhE/ApUsg3iHdVYYPBjNSSOMowRZxxsY=
|
||||||
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
|
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
|
||||||
|
rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4=
|
||||||
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
|
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
|
||||||
rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
|
rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
|
||||||
|
|||||||
@ -6,6 +6,7 @@ type Config struct {
|
|||||||
rest.RestConf
|
rest.RestConf
|
||||||
SourceMysql string
|
SourceMysql string
|
||||||
Auth types.Auth
|
Auth types.Auth
|
||||||
|
SourceRabbitMq string
|
||||||
{{.auth}}
|
{{.auth}}
|
||||||
{{.jwtTrans}}
|
{{.jwtTrans}}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,6 +6,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
|
"fusenapi/utils/autoconfig"
|
||||||
"fusenapi/initalize"
|
"fusenapi/initalize"
|
||||||
"fusenapi/model/gmodel"
|
"fusenapi/model/gmodel"
|
||||||
|
|
||||||
@ -16,49 +17,23 @@ import (
|
|||||||
type ServiceContext struct {
|
type ServiceContext struct {
|
||||||
Config {{.config}}
|
Config {{.config}}
|
||||||
{{.middleware}}
|
{{.middleware}}
|
||||||
|
|
||||||
|
SharedState *fsm.StateCluster
|
||||||
MysqlConn *gorm.DB
|
MysqlConn *gorm.DB
|
||||||
AllModels *gmodel.AllModelsGen
|
AllModels *gmodel.AllModelsGen
|
||||||
|
RabbitMq *initalize.RabbitMqHandle
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewServiceContext(c {{.config}}) *ServiceContext {
|
func NewServiceContext(c {{.config}}) *ServiceContext {
|
||||||
|
conn := initalize.InitMysql(c.SourceMysql)
|
||||||
|
StateServer := fsm.StartNode(c.Name, fmt.Sprintf("localhost:%d", c.Port-2000), autoconfig.AutoGetAllServerConfig(), conn)
|
||||||
|
|
||||||
return &ServiceContext{
|
return &ServiceContext{
|
||||||
Config: c,
|
Config: c,
|
||||||
MysqlConn: initalize.InitMysql(c.SourceMysql),
|
MysqlConn: conn,
|
||||||
AllModels: gmodel.NewAllModels(initalize.InitMysql(c.SourceMysql)),
|
SharedState: StateServer,
|
||||||
|
AllModels: gmodel.NewAllModels(initalize.InitMysql(c.SourceMysql)),
|
||||||
|
RabbitMq:initalize.InitRabbitMq(c.SourceRabbitMq, nil),
|
||||||
{{.middlewareAssignment}}
|
{{.middlewareAssignment}}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
func (svcCtx *ServiceContext) ParseJwtToken(r *http.Request) (jwt.MapClaims, error) {
|
|
||||||
AuthKey := r.Header.Get("Authorization")
|
|
||||||
if AuthKey == "" {
|
|
||||||
return nil, nil
|
|
||||||
}
|
|
||||||
AuthKey = AuthKey[7:]
|
|
||||||
|
|
||||||
|
|
||||||
if len(AuthKey) <= 50 {
|
|
||||||
return nil, errors.New(fmt.Sprint("Error parsing token, len:", len(AuthKey)))
|
|
||||||
}
|
|
||||||
|
|
||||||
token, err := jwt.Parse(AuthKey, func(token *jwt.Token) (interface{}, error) {
|
|
||||||
// 检查签名方法是否为 HS256
|
|
||||||
if _, ok := token.Method.(*jwt.SigningMethodHMAC); !ok {
|
|
||||||
return nil, fmt.Errorf("unexpected signing method: %v", token.Header["alg"])
|
|
||||||
}
|
|
||||||
// 返回用于验证签名的密钥
|
|
||||||
return []byte(svcCtx.Config.Auth.AccessSecret), nil
|
|
||||||
})
|
|
||||||
if err != nil {
|
|
||||||
return nil, errors.New(fmt.Sprint("Error parsing token:", err))
|
|
||||||
}
|
|
||||||
|
|
||||||
// 验证成功返回
|
|
||||||
if claims, ok := token.Claims.(jwt.MapClaims); ok && token.Valid {
|
|
||||||
return claims, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil, errors.New(fmt.Sprint("Invalid token", err))
|
|
||||||
}
|
}
|
||||||
@ -2,7 +2,8 @@ Name: {{.serviceName}}
|
|||||||
Host: {{.host}}
|
Host: {{.host}}
|
||||||
Port: {{.port}}
|
Port: {{.port}}
|
||||||
SourceMysql: fusentest:XErSYmLELKMnf3Dh@tcp(110.41.19.98:3306)/fusentest
|
SourceMysql: fusentest:XErSYmLELKMnf3Dh@tcp(110.41.19.98:3306)/fusentest
|
||||||
|
SourceRabbitMq: amqp://rabbit001:rabbit001129@110.41.19.98:5672
|
||||||
Auth:
|
Auth:
|
||||||
AccessSecret: fusen2023
|
AccessSecret: fusen2023
|
||||||
AccessExpire: 2592000
|
AccessExpire: 2592000
|
||||||
RefreshAfter: 1592000
|
RefreshAfter: 1592000
|
||||||
|
|||||||
@ -13,7 +13,7 @@ func {{.HandlerName}}(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
|||||||
return func(w http.ResponseWriter, r *http.Request) {
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
{{if .HasRequest}}var req types.{{.RequestType}}
|
{{if .HasRequest}}var req types.{{.RequestType}}
|
||||||
userinfo, err := basic.RequestParse(w, r, svcCtx, &req)
|
userinfo, err := basic.RequestParse(w, r, svcCtx.SharedState, &req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@ -25,14 +25,15 @@ func New{{.logic}}(ctx context.Context, svcCtx *svc.ServiceContext) *{{.logic}}
|
|||||||
// func (l *{{.logic}}) BeforeLogic(w http.ResponseWriter, r *http.Request) {
|
// func (l *{{.logic}}) BeforeLogic(w http.ResponseWriter, r *http.Request) {
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// 处理逻辑后 w,r 如:重定向, resp 必须重新处理
|
|
||||||
// func (l *{{.logic}}) AfterLogic(w http.ResponseWriter, r *http.Request, resp *basic.Response) {
|
|
||||||
// // httpx.OkJsonCtx(r.Context(), w, resp)
|
|
||||||
// }
|
|
||||||
|
|
||||||
func (l *{{.logic}}) {{.function}}({{.request}}, userinfo *auth.UserInfo) (resp *basic.Response) {
|
func (l *{{.logic}}) {{.function}}({{.request}}, userinfo *auth.UserInfo) (resp *basic.Response) {
|
||||||
// 返回值必须调用Set重新返回, resp可以空指针调用 resp.SetStatus(basic.CodeOK, data)
|
// 返回值必须调用Set重新返回, resp可以空指针调用 resp.SetStatus(basic.CodeOK, data)
|
||||||
// userinfo 传入值时, 一定不为null
|
// userinfo 传入值时, 一定不为null
|
||||||
|
|
||||||
{{.returnString}} resp.SetStatus(basic.CodeOK)
|
{{.returnString}} resp.SetStatus(basic.CodeOK)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 处理逻辑后 w,r 如:重定向, resp 必须重新处理
|
||||||
|
// func (l *{{.logic}}) AfterLogic(w http.ResponseWriter, r *http.Request, resp *basic.Response) {
|
||||||
|
// // httpx.OkJsonCtx(r.Context(), w, resp)
|
||||||
|
// }
|
||||||
|
|
||||||
|
|||||||
120
initalize/rabbitmq.go
Normal file
120
initalize/rabbitmq.go
Normal file
@ -0,0 +1,120 @@
|
|||||||
|
package initalize
|
||||||
|
|
||||||
|
import (
|
||||||
|
"crypto/tls"
|
||||||
|
"errors"
|
||||||
|
"fusenapi/constants"
|
||||||
|
"github.com/streadway/amqp"
|
||||||
|
"github.com/zeromicro/go-zero/core/logx"
|
||||||
|
"log"
|
||||||
|
)
|
||||||
|
|
||||||
|
type RabbitMqHandle struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
// 连接属性
|
||||||
|
type queueItem struct {
|
||||||
|
ch *amqp.Channel
|
||||||
|
queue amqp.Queue
|
||||||
|
}
|
||||||
|
|
||||||
|
// 存储连接
|
||||||
|
var mapMq = make(map[constants.RABBIT_MQ]queueItem)
|
||||||
|
|
||||||
|
func InitRabbitMq(url string, config *tls.Config) *RabbitMqHandle {
|
||||||
|
if url == "" {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
conn, err := amqp.DialTLS(url, config)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("Failed to connect to RabbitMQ: %v", err)
|
||||||
|
}
|
||||||
|
// 创建一个通道
|
||||||
|
ch, err := conn.Channel()
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("Failed to open a channel: %v", err)
|
||||||
|
}
|
||||||
|
//声明队列
|
||||||
|
for _, queueName := range constants.MQ_QUEUE_ARR {
|
||||||
|
q, err := ch.QueueDeclare(
|
||||||
|
string(queueName), // 队列名
|
||||||
|
true, // 是否持久化
|
||||||
|
false, // 是否自动删除
|
||||||
|
false, // 是否排他
|
||||||
|
false, // 是否等待服务器响应
|
||||||
|
nil, // 其他参数
|
||||||
|
)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("Failed to declare a queue: %v", err)
|
||||||
|
}
|
||||||
|
mapMq[queueName] = queueItem{
|
||||||
|
ch: ch,
|
||||||
|
queue: q,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return &RabbitMqHandle{}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 发送消息
|
||||||
|
func (h *RabbitMqHandle) SendMsg(queueName constants.RABBIT_MQ, message []byte) error {
|
||||||
|
object, ok := mapMq[queueName]
|
||||||
|
if !ok {
|
||||||
|
return errors.New("unknown queue")
|
||||||
|
}
|
||||||
|
// 发送消息到队列
|
||||||
|
return object.ch.Publish(
|
||||||
|
"", // exchange,如果为空,则使用默认交换机
|
||||||
|
object.queue.Name, // routing key,将消息发送到指定队列
|
||||||
|
false, // 是否等待服务器响应
|
||||||
|
false, // 是否立即发送
|
||||||
|
amqp.Publishing{
|
||||||
|
ContentType: "text/plain", //普通文本
|
||||||
|
Body: message,
|
||||||
|
}, // 消息内容
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 消费消息
|
||||||
|
func (h *RabbitMqHandle) Consume(queueName constants.RABBIT_MQ, handleFunc func(data []byte) error) error {
|
||||||
|
object, ok := mapMq[queueName]
|
||||||
|
if !ok {
|
||||||
|
return errors.New("unknown queue")
|
||||||
|
}
|
||||||
|
msgs, err := object.ch.Consume(
|
||||||
|
object.queue.Name, // 队列名
|
||||||
|
object.queue.Name, // 消费者名,如果为空,则是随机生成一个
|
||||||
|
false, // 自动应答
|
||||||
|
false, // 是否排他
|
||||||
|
false, // 是否阻塞
|
||||||
|
false, // 是否等待服务器响应
|
||||||
|
nil, // 其他参数
|
||||||
|
)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("Failed to register a consumer: %v", err)
|
||||||
|
}
|
||||||
|
//允许20的并发
|
||||||
|
limit := make(chan struct{}, 20)
|
||||||
|
defer close(limit)
|
||||||
|
// 消费消息
|
||||||
|
for msg := range msgs {
|
||||||
|
limit <- struct{}{}
|
||||||
|
go func(m amqp.Delivery) {
|
||||||
|
if err := recover(); err != nil {
|
||||||
|
logx.Error(err)
|
||||||
|
}
|
||||||
|
defer func() {
|
||||||
|
<-limit
|
||||||
|
}()
|
||||||
|
if err = handleFunc(m.Body); err != nil {
|
||||||
|
logx.Error("failed to deal with MQ message:", string(m.Body))
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if err = object.ch.Ack(m.DeliveryTag, false); err != nil {
|
||||||
|
logx.Error("failed to ack mq to delete")
|
||||||
|
} else {
|
||||||
|
log.Printf("Consume Mq message success: %s", m.Body)
|
||||||
|
}
|
||||||
|
}(msg)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
@ -87,3 +87,10 @@ func (c *FsCartModel) GetUserCartsByIds(ctx context.Context, userId int64, ids [
|
|||||||
err = c.db.WithContext(ctx).Model(&FsCart{}).Where("`id` in (?) and `user_id` = ?", ids, userId).Find(&resp).Error
|
err = c.db.WithContext(ctx).Model(&FsCart{}).Where("`id` in (?) and `user_id` = ?", ids, userId).Find(&resp).Error
|
||||||
return resp, err
|
return resp, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *FsCartModel) DeleteCartsByIds(ctx context.Context, ids []int64) ( err error) {
|
||||||
|
if len(ids) == 0 {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
return c.db.WithContext(ctx).Model(&FsCart{}).Where("`id` in (?)", ids).Delete(&FsCart{}).Error
|
||||||
|
}
|
||||||
|
|||||||
@ -25,3 +25,7 @@ func (dt *FsOrderDetailTemplateModel) FindOne(ctx context.Context, id int64) (re
|
|||||||
err = dt.db.WithContext(ctx).Model(&FsOrderDetailTemplate{}).Where("`id` = ?", id).Take(&resp).Error
|
err = dt.db.WithContext(ctx).Model(&FsOrderDetailTemplate{}).Where("`id` = ?", id).Take(&resp).Error
|
||||||
return resp, err
|
return resp, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (m *FsOrderDetailTemplateModel) TableName() string {
|
||||||
|
return m.name
|
||||||
|
}
|
||||||
|
|||||||
@ -77,7 +77,7 @@ func (o *FsOrderModel) FindPageListByPage(ctx context.Context, rowBuilder *gorm.
|
|||||||
rowBuilder = rowBuilder.Scopes(handler.Paginate(page, pageSize))
|
rowBuilder = rowBuilder.Scopes(handler.Paginate(page, pageSize))
|
||||||
|
|
||||||
// 结果
|
// 结果
|
||||||
result := rowBuilder.WithContext(ctx).Find(&resp)
|
result := rowBuilder.Debug().WithContext(ctx).Find(&resp)
|
||||||
if result.Error != nil {
|
if result.Error != nil {
|
||||||
return nil, result.Error
|
return nil, result.Error
|
||||||
} else {
|
} else {
|
||||||
@ -93,8 +93,20 @@ type FsOrderRel struct {
|
|||||||
|
|
||||||
type FsOrderDetails struct {
|
type FsOrderDetails struct {
|
||||||
FsOrderDetail
|
FsOrderDetail
|
||||||
FsOrderDetailTemplateInfo FsOrderDetailTemplate `gorm:"foreignKey:id;references:order_detail_template_id"`
|
FsOrderDetailTemplateInfo FsOrderDetailTemplateInfo `gorm:"foreignKey:id;references:order_detail_template_id"`
|
||||||
FsProductInfo FsProduct `gorm:"foreignKey:id;references:product_id"`
|
FsProductInfo FsProduct `gorm:"foreignKey:id;references:product_id"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type FsOrderDetailTemplateInfo struct {
|
||||||
|
FsOrderDetailTemplate
|
||||||
|
FsProductDesignInfo FsProductDesignInfo `gorm:"foreignKey:id;references:design_id"` //获取设计数据
|
||||||
|
FsProductSizeInfo FsProductSize `gorm:"foreignKey:id;references:size_id"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type FsProductDesignInfo struct {
|
||||||
|
FsProductDesign
|
||||||
|
OptionData FsProduct `gorm:"foreignKey:id;references:optional_id"` //获取配件信息
|
||||||
|
TemplateData FsProductTemplateV2 `gorm:"foreignKey:id;references:template_id"` //获取模板信息
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *FsOrderModel) RowSelectBuilder(selectData []string) *gorm.DB {
|
func (m *FsOrderModel) RowSelectBuilder(selectData []string) *gorm.DB {
|
||||||
@ -124,6 +136,42 @@ func (m *FsOrderModel) FindCount(ctx context.Context, countBuilder *gorm.DB, fil
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (m *FsOrderModel) FindOneByQuery(ctx context.Context, rowBuilder *gorm.DB, filterMap map[string]string) (*FsOrderRel, error) {
|
||||||
|
var resp FsOrderRel
|
||||||
|
|
||||||
|
if filterMap != nil {
|
||||||
|
rowBuilder = rowBuilder.Scopes(handler.FilterData(filterMap))
|
||||||
|
}
|
||||||
|
|
||||||
|
result := rowBuilder.WithContext(ctx).Limit(1).Find(&resp)
|
||||||
|
if result.Error != nil {
|
||||||
|
return nil, result.Error
|
||||||
|
} else {
|
||||||
|
return &resp, nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 事务
|
||||||
|
func (m *FsOrderModel) Trans(ctx context.Context, fn func(ctx context.Context, connGorm *gorm.DB) error) error {
|
||||||
|
tx := m.db.Table(m.name).WithContext(ctx).Begin()
|
||||||
|
defer func() {
|
||||||
|
if r := recover(); r != nil {
|
||||||
|
tx.Rollback()
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
|
||||||
|
if err := tx.Error; err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := fn(ctx, tx); err != nil {
|
||||||
|
tx.Rollback()
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return tx.Commit().Error
|
||||||
|
}
|
||||||
|
|
||||||
func (m *FsOrderModel) TableName() string {
|
func (m *FsOrderModel) TableName() string {
|
||||||
return m.name
|
return m.name
|
||||||
}
|
}
|
||||||
|
|||||||
25
model/gmodel/fs_pay_event_gen.go
Normal file
25
model/gmodel/fs_pay_event_gen.go
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
package gmodel
|
||||||
|
|
||||||
|
import (
|
||||||
|
"gorm.io/gorm"
|
||||||
|
)
|
||||||
|
|
||||||
|
// fs_pay_event 支付回调事件日志
|
||||||
|
type FsPayEvent struct {
|
||||||
|
Id int64 `gorm:"primary_key;default:0;auto_increment;" json:"id"` //
|
||||||
|
PayMethod *int64 `gorm:"default:0;" json:"pay_method"` // 支付方式 1 stripe 2 paypal
|
||||||
|
EventId *string `gorm:"default:'';" json:"event_id"` // 事件ID
|
||||||
|
EventType *string `gorm:"default:'';" json:"event_type"` // 事件类型
|
||||||
|
EventData *string `gorm:"default:'';" json:"event_data"` // 事件数据
|
||||||
|
EventCreated *int64 `gorm:"default:0;" json:"event_created"` // 事件时间
|
||||||
|
Ip *string `gorm:"default:'';" json:"ip"` // 请求IP
|
||||||
|
CreatedAt *int64 `gorm:"default:0;" json:"created_at"` // 创建时间
|
||||||
|
}
|
||||||
|
type FsPayEventModel struct {
|
||||||
|
db *gorm.DB
|
||||||
|
name string
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewFsPayEventModel(db *gorm.DB) *FsPayEventModel {
|
||||||
|
return &FsPayEventModel{db: db, name: "fs_pay_event"}
|
||||||
|
}
|
||||||
2
model/gmodel/fs_pay_event_logic.go
Normal file
2
model/gmodel/fs_pay_event_logic.go
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
package gmodel
|
||||||
|
// TODO: 使用model的属性做你想做的
|
||||||
@ -1,6 +1,11 @@
|
|||||||
package gmodel
|
package gmodel
|
||||||
|
|
||||||
import "context"
|
import (
|
||||||
|
"context"
|
||||||
|
"fusenapi/utils/handler"
|
||||||
|
|
||||||
|
"gorm.io/gorm"
|
||||||
|
)
|
||||||
|
|
||||||
func (p *FsPayModel) GetListByOrderNumber(ctx context.Context, sn string) (resp []FsPay, err error) {
|
func (p *FsPayModel) GetListByOrderNumber(ctx context.Context, sn string) (resp []FsPay, err error) {
|
||||||
err = p.db.WithContext(ctx).Model(&FsPay{}).Where("`order_number` = ? ", sn).Find(&resp).Error
|
err = p.db.WithContext(ctx).Model(&FsPay{}).Where("`order_number` = ? ", sn).Find(&resp).Error
|
||||||
@ -14,3 +19,88 @@ func (p *FsPayModel) GetOrderPayList(ctx context.Context, sn string, payStatus i
|
|||||||
err = p.db.WithContext(ctx).Model(&FsPay{}).Where("`order_number` = ? and `pay_status` = ? and `is_refund` = ?", sn, payStatus, isRefund).Find(&resp).Error
|
err = p.db.WithContext(ctx).Model(&FsPay{}).Where("`order_number` = ? and `pay_status` = ? and `is_refund` = ?", sn, payStatus, isRefund).Find(&resp).Error
|
||||||
return resp, err
|
return resp, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (p *FsPayModel) GetListByOrderNumberStage(ctx context.Context, sn string, stage int64) (resp *FsPay, err error) {
|
||||||
|
err = p.db.Table(p.name).WithContext(ctx).Model(&FsPay{}).Where("`order_number` = ? ", sn).Where("`pay_stage` = ? ", stage).Take(&resp).Error
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return resp, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *FsPayModel) CreateOrUpdate(ctx context.Context, req *FsPay) (resp *FsPay, err error) {
|
||||||
|
rowBuilder := p.db.Table(p.name).WithContext(ctx)
|
||||||
|
if req.Id > 0 {
|
||||||
|
err = rowBuilder.Save(req).Error
|
||||||
|
} else {
|
||||||
|
err = rowBuilder.Create(req).Error
|
||||||
|
}
|
||||||
|
return req, err
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *FsPayModel) RowSelectBuilder(selectData []string) *gorm.DB {
|
||||||
|
var rowBuilder = m.db.Table(m.name)
|
||||||
|
|
||||||
|
if selectData != nil {
|
||||||
|
rowBuilder = rowBuilder.Select(selectData)
|
||||||
|
} else {
|
||||||
|
rowBuilder = rowBuilder.Select("*")
|
||||||
|
}
|
||||||
|
return rowBuilder
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *FsPayModel) FindCount(ctx context.Context, countBuilder *gorm.DB, filterMap map[string]string) (int64, error) {
|
||||||
|
var count int64
|
||||||
|
|
||||||
|
// 过滤
|
||||||
|
if filterMap != nil {
|
||||||
|
countBuilder = countBuilder.Scopes(handler.FilterData(filterMap))
|
||||||
|
}
|
||||||
|
|
||||||
|
result := countBuilder.WithContext(ctx).Limit(1).Count(&count)
|
||||||
|
if result.Error != nil {
|
||||||
|
return 0, result.Error
|
||||||
|
} else {
|
||||||
|
return count, nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *FsPayModel) FindOneByQuery(ctx context.Context, rowBuilder *gorm.DB, filterMap map[string]string) (*FsPay, error) {
|
||||||
|
var resp FsPay
|
||||||
|
|
||||||
|
if filterMap != nil {
|
||||||
|
rowBuilder = rowBuilder.Scopes(handler.FilterData(filterMap))
|
||||||
|
}
|
||||||
|
|
||||||
|
result := rowBuilder.WithContext(ctx).Limit(1).Find(&resp)
|
||||||
|
if result.Error != nil {
|
||||||
|
return nil, result.Error
|
||||||
|
} else {
|
||||||
|
return &resp, nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 事务
|
||||||
|
func (m *FsPayModel) Trans(ctx context.Context, fn func(ctx context.Context, connGorm *gorm.DB) error) error {
|
||||||
|
tx := m.db.Table(m.name).WithContext(ctx).Begin()
|
||||||
|
defer func() {
|
||||||
|
if r := recover(); r != nil {
|
||||||
|
tx.Rollback()
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
|
||||||
|
if err := tx.Error; err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := fn(ctx, tx); err != nil {
|
||||||
|
tx.Rollback()
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return tx.Commit().Error
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *FsPayModel) TableName() string {
|
||||||
|
return m.name
|
||||||
|
}
|
||||||
|
|||||||
@ -34,3 +34,11 @@ func (d *FsProductDesignModel) Create(ctx context.Context, data *FsProductDesign
|
|||||||
func (d *FsProductDesignModel) UpdateBySn(ctx context.Context, sn string, data *FsProductDesign) error {
|
func (d *FsProductDesignModel) UpdateBySn(ctx context.Context, sn string, data *FsProductDesign) error {
|
||||||
return d.db.WithContext(ctx).Model(&FsProductDesign{}).Where("`sn` = ?", sn).Updates(&data).Error
|
return d.db.WithContext(ctx).Model(&FsProductDesign{}).Where("`sn` = ?", sn).Updates(&data).Error
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (d *FsProductDesignModel) UpdateByIds(ctx context.Context, ids []int64, data *FsProductDesign) error {
|
||||||
|
return d.db.Table(d.name).WithContext(ctx).Model(&FsProductDesign{}).Where("`id` in ?", ids).Updates(&data).Error
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *FsProductDesignModel) TableName() string {
|
||||||
|
return m.name
|
||||||
|
}
|
||||||
|
|||||||
@ -8,6 +8,7 @@ import (
|
|||||||
type FsProductTemplateTags struct {
|
type FsProductTemplateTags struct {
|
||||||
Id int64 `gorm:"primary_key;default:0;auto_increment;" json:"id"` // ID
|
Id int64 `gorm:"primary_key;default:0;auto_increment;" json:"id"` // ID
|
||||||
Title *string `gorm:"default:'';" json:"title"` // 标题
|
Title *string `gorm:"default:'';" json:"title"` // 标题
|
||||||
|
CoverImg *string `gorm:"default:'';" json:"cover_img"` // 封面图
|
||||||
Status *int64 `gorm:"default:0;" json:"status"` // 状态 1:可用
|
Status *int64 `gorm:"default:0;" json:"status"` // 状态 1:可用
|
||||||
CreateAt *int64 `gorm:"default:0;" json:"create_at"` // 创建时间
|
CreateAt *int64 `gorm:"default:0;" json:"create_at"` // 创建时间
|
||||||
}
|
}
|
||||||
|
|||||||
@ -23,3 +23,12 @@ func (pt *FsProductTemplateTagsModel) FindOne(ctx context.Context, id int64, fie
|
|||||||
err = db.Take(&resp).Error
|
err = db.Take(&resp).Error
|
||||||
return resp, err
|
return resp, err
|
||||||
}
|
}
|
||||||
|
func (pt *FsProductTemplateTagsModel) GetList(ctx context.Context, page, limit int, orderBy string) (resp []FsProductTemplateTags, err error) {
|
||||||
|
db := pt.db.WithContext(ctx).Model(&FsProductTemplateTags{}).Where("`status` = ?", 1)
|
||||||
|
if orderBy != "" {
|
||||||
|
db = db.Order(orderBy)
|
||||||
|
}
|
||||||
|
offset := (page - 1) * limit
|
||||||
|
err = db.Offset(offset).Limit(limit).Find(&resp).Error
|
||||||
|
return resp, err
|
||||||
|
}
|
||||||
|
|||||||
27
model/gmodel/fs_resource_gen.go
Normal file
27
model/gmodel/fs_resource_gen.go
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
package gmodel
|
||||||
|
|
||||||
|
import (
|
||||||
|
"gorm.io/gorm"
|
||||||
|
"time"
|
||||||
|
)
|
||||||
|
|
||||||
|
// fs_resource 资源表
|
||||||
|
type FsResource struct {
|
||||||
|
ResourceId string `gorm:"primary_key;default:'';" json:"resource_id"` // 资源 ID
|
||||||
|
UserId *int64 `gorm:"index;default:0;" json:"user_id"` // 用户 ID
|
||||||
|
GuestId *int64 `gorm:"index;default:0;" json:"guest_id"` // 访客 ID
|
||||||
|
ResourceType *string `gorm:"index;default:'';" json:"resource_type"` // 资源类型
|
||||||
|
ResourceUrl *string `gorm:"default:'';" json:"resource_url"` // 资源 URL
|
||||||
|
Version *string `gorm:"index;default:'0';" json:"version"` // 版本信息
|
||||||
|
UploadedAt *time.Time `gorm:"index;default:'0000-00-00 00:00:00';" json:"uploaded_at"` // 上传时间
|
||||||
|
Metadata *string `gorm:"default:'';" json:"metadata"` // 元数据,json格式,存储图像分率
|
||||||
|
MetaKey1 *string `gorm:"index;default:'';" json:"meta_key1"` // 需要关键信息查询的自定义属性1,可以动态增加
|
||||||
|
}
|
||||||
|
type FsResourceModel struct {
|
||||||
|
db *gorm.DB
|
||||||
|
name string
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewFsResourceModel(db *gorm.DB) *FsResourceModel {
|
||||||
|
return &FsResourceModel{db: db, name: "fs_resource"}
|
||||||
|
}
|
||||||
1
model/gmodel/fs_resource_logic.go
Normal file
1
model/gmodel/fs_resource_logic.go
Normal file
@ -0,0 +1 @@
|
|||||||
|
package gmodel
|
||||||
@ -30,7 +30,7 @@ type FsUser struct {
|
|||||||
IsPhoneAdvertisement *int64 `gorm:"default:0;" json:"is_phone_advertisement"` // 是否接收短信广告
|
IsPhoneAdvertisement *int64 `gorm:"default:0;" json:"is_phone_advertisement"` // 是否接收短信广告
|
||||||
IsOpenRender *int64 `gorm:"default:0;" json:"is_open_render"` // 是否打开个性化渲染(1:开启,0:关闭)
|
IsOpenRender *int64 `gorm:"default:0;" json:"is_open_render"` // 是否打开个性化渲染(1:开启,0:关闭)
|
||||||
IsThousandFace *int64 `gorm:"default:0;" json:"is_thousand_face"` // 是否已经存在千人千面(1:存在,0:不存在)
|
IsThousandFace *int64 `gorm:"default:0;" json:"is_thousand_face"` // 是否已经存在千人千面(1:存在,0:不存在)
|
||||||
IsLowRendering *int64 `gorm:"default:0;" json:"is_low_rendering"` //
|
IsLowRendering *int64 `gorm:"default:0;" json:"is_low_rendering"` // 是否开启低渲染模型渲染
|
||||||
IsRemoveBg *int64 `gorm:"default:1;" json:"is_remove_bg"` // 用户上传logo是否去除背景
|
IsRemoveBg *int64 `gorm:"default:1;" json:"is_remove_bg"` // 用户上传logo是否去除背景
|
||||||
}
|
}
|
||||||
type FsUserModel struct {
|
type FsUserModel struct {
|
||||||
|
|||||||
@ -2,6 +2,8 @@ package gmodel
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"fusenapi/utils/auth"
|
||||||
|
"time"
|
||||||
|
|
||||||
"gorm.io/gorm"
|
"gorm.io/gorm"
|
||||||
)
|
)
|
||||||
@ -39,10 +41,55 @@ func (u *FsUserModel) FindUserByGoogleId(ctx context.Context, Id int64) (resp *F
|
|||||||
return resp, err
|
return resp, err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (u *FsUserModel) TransactionRegsterGoogle(ctx context.Context, fc func(tx *gorm.DB) error) (err error) {
|
func (u *FsUserModel) Transaction(ctx context.Context, fc func(tx *gorm.DB) error) (err error) {
|
||||||
return u.db.WithContext(ctx).Transaction(fc)
|
return u.db.WithContext(ctx).Transaction(fc)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 谷歌平台的注册流程
|
||||||
|
func (u *FsUserModel) RegisterByGoogleOAuth(ctx context.Context, token *auth.RegisterToken) (*FsUser, error) {
|
||||||
|
user := &FsUser{}
|
||||||
|
|
||||||
|
err := u.db.WithContext(ctx).Transaction(func(tx *gorm.DB) error {
|
||||||
|
|
||||||
|
err := tx.Model(user).Where("email = ?", token.Email).Take(user).Error
|
||||||
|
if err != nil {
|
||||||
|
// 没有找到在数据库就创建注册
|
||||||
|
if err == gorm.ErrRecordNotFound {
|
||||||
|
createAt := time.Now().Unix()
|
||||||
|
user.Email = &token.Email
|
||||||
|
user.CreatedAt = &createAt
|
||||||
|
user.GoogleId = &token.Id
|
||||||
|
user.PasswordHash = &token.Password
|
||||||
|
err = tx.Model(user).Create(user).Error
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
if token.GuestId != 0 {
|
||||||
|
// 继承guest_id的资源表
|
||||||
|
return tx.Model(&FsResource{}).
|
||||||
|
Where("guest_id = ?", token.GuestId).
|
||||||
|
UpdateColumn("user_id", user.Id).Error
|
||||||
|
}
|
||||||
|
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
// 如果已经存在,把谷歌id 加入到用户信息里
|
||||||
|
user.GoogleId = &token.Id
|
||||||
|
return tx.Model(user).Update("google_id", user).Error
|
||||||
|
})
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return user, nil
|
||||||
|
}
|
||||||
|
|
||||||
func (u *FsUserModel) UpdateUserBasicInfoById(ctx context.Context, Id int64, user *UserBasicInfoForSave) (err error) {
|
func (u *FsUserModel) UpdateUserBasicInfoById(ctx context.Context, Id int64, user *UserBasicInfoForSave) (err error) {
|
||||||
|
|
||||||
err = u.db.WithContext(ctx).Model(&FsUser{}).
|
err = u.db.WithContext(ctx).Model(&FsUser{}).
|
||||||
|
|||||||
@ -52,6 +52,7 @@ type AllModelsGen struct {
|
|||||||
FsOrderDetailTemplate *FsOrderDetailTemplateModel // fs_order_detail_template 订单模板详细表
|
FsOrderDetailTemplate *FsOrderDetailTemplateModel // fs_order_detail_template 订单模板详细表
|
||||||
FsOrderRemark *FsOrderRemarkModel // fs_order_remark 订单备注表
|
FsOrderRemark *FsOrderRemarkModel // fs_order_remark 订单备注表
|
||||||
FsPay *FsPayModel // fs_pay 支付记录
|
FsPay *FsPayModel // fs_pay 支付记录
|
||||||
|
FsPayEvent *FsPayEventModel // fs_pay_event 支付回调事件日志
|
||||||
FsProduct *FsProductModel // fs_product 产品表
|
FsProduct *FsProductModel // fs_product 产品表
|
||||||
FsProductCopy1 *FsProductCopy1Model // fs_product_copy1 产品表
|
FsProductCopy1 *FsProductCopy1Model // fs_product_copy1 产品表
|
||||||
FsProductDesign *FsProductDesignModel // fs_product_design 产品设计表
|
FsProductDesign *FsProductDesignModel // fs_product_design 产品设计表
|
||||||
@ -79,6 +80,7 @@ type AllModelsGen struct {
|
|||||||
FsQuotationRemarkTemplate *FsQuotationRemarkTemplateModel // fs_quotation_remark_template 报价单备注模板
|
FsQuotationRemarkTemplate *FsQuotationRemarkTemplateModel // fs_quotation_remark_template 报价单备注模板
|
||||||
FsQuotationSaler *FsQuotationSalerModel // fs_quotation_saler 报价单业务员表
|
FsQuotationSaler *FsQuotationSalerModel // fs_quotation_saler 报价单业务员表
|
||||||
FsRefundReason *FsRefundReasonModel // fs_refund_reason
|
FsRefundReason *FsRefundReasonModel // fs_refund_reason
|
||||||
|
FsResource *FsResourceModel // fs_resource 资源表
|
||||||
FsStandardLogo *FsStandardLogoModel // fs_standard_logo 标准logo
|
FsStandardLogo *FsStandardLogoModel // fs_standard_logo 标准logo
|
||||||
FsTags *FsTagsModel // fs_tags 产品分类表
|
FsTags *FsTagsModel // fs_tags 产品分类表
|
||||||
FsToolLogs *FsToolLogsModel // fs_tool_logs 3d设计工具日志表
|
FsToolLogs *FsToolLogsModel // fs_tool_logs 3d设计工具日志表
|
||||||
@ -142,6 +144,7 @@ func NewAllModels(gdb *gorm.DB) *AllModelsGen {
|
|||||||
FsOrderDetailTemplate: NewFsOrderDetailTemplateModel(gdb),
|
FsOrderDetailTemplate: NewFsOrderDetailTemplateModel(gdb),
|
||||||
FsOrderRemark: NewFsOrderRemarkModel(gdb),
|
FsOrderRemark: NewFsOrderRemarkModel(gdb),
|
||||||
FsPay: NewFsPayModel(gdb),
|
FsPay: NewFsPayModel(gdb),
|
||||||
|
FsPayEvent: NewFsPayEventModel(gdb),
|
||||||
FsProduct: NewFsProductModel(gdb),
|
FsProduct: NewFsProductModel(gdb),
|
||||||
FsProductCopy1: NewFsProductCopy1Model(gdb),
|
FsProductCopy1: NewFsProductCopy1Model(gdb),
|
||||||
FsProductDesign: NewFsProductDesignModel(gdb),
|
FsProductDesign: NewFsProductDesignModel(gdb),
|
||||||
@ -169,6 +172,7 @@ func NewAllModels(gdb *gorm.DB) *AllModelsGen {
|
|||||||
FsQuotationRemarkTemplate: NewFsQuotationRemarkTemplateModel(gdb),
|
FsQuotationRemarkTemplate: NewFsQuotationRemarkTemplateModel(gdb),
|
||||||
FsQuotationSaler: NewFsQuotationSalerModel(gdb),
|
FsQuotationSaler: NewFsQuotationSalerModel(gdb),
|
||||||
FsRefundReason: NewFsRefundReasonModel(gdb),
|
FsRefundReason: NewFsRefundReasonModel(gdb),
|
||||||
|
FsResource: NewFsResourceModel(gdb),
|
||||||
FsStandardLogo: NewFsStandardLogoModel(gdb),
|
FsStandardLogo: NewFsStandardLogoModel(gdb),
|
||||||
FsTags: NewFsTagsModel(gdb),
|
FsTags: NewFsTagsModel(gdb),
|
||||||
FsToolLogs: NewFsToolLogsModel(gdb),
|
FsToolLogs: NewFsToolLogsModel(gdb),
|
||||||
|
|||||||
@ -1,7 +0,0 @@
|
|||||||
package main
|
|
||||||
|
|
||||||
import "testing"
|
|
||||||
|
|
||||||
func TestMain(t *testing.T) {
|
|
||||||
main()
|
|
||||||
}
|
|
||||||
@ -1,35 +0,0 @@
|
|||||||
package handler
|
|
||||||
|
|
||||||
import (
|
|
||||||
"net/http"
|
|
||||||
"reflect"
|
|
||||||
|
|
||||||
"fusenapi/utils/basic"
|
|
||||||
|
|
||||||
"fusenapi/server/assistant/internal/logic"
|
|
||||||
"fusenapi/server/assistant/internal/svc"
|
|
||||||
"fusenapi/server/assistant/internal/types"
|
|
||||||
)
|
|
||||||
|
|
||||||
func RedirectHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
|
||||||
return func(w http.ResponseWriter, r *http.Request) {
|
|
||||||
|
|
||||||
var req types.RequestRedirect
|
|
||||||
userinfo, err := basic.RequestParse(w, r, svcCtx, &req)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
// 创建一个业务逻辑层实例
|
|
||||||
l := logic.NewRedirectLogic(r.Context(), svcCtx)
|
|
||||||
|
|
||||||
rl := reflect.ValueOf(l)
|
|
||||||
basic.BeforeLogic(w, r, rl)
|
|
||||||
|
|
||||||
resp := l.Redirect(&req, userinfo)
|
|
||||||
|
|
||||||
if !basic.AfterLogic(w, r, rl, resp) {
|
|
||||||
basic.NormalAfterLogic(w, r, resp)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,67 +0,0 @@
|
|||||||
package logic
|
|
||||||
|
|
||||||
import (
|
|
||||||
"fmt"
|
|
||||||
"fusenapi/utils/auth"
|
|
||||||
"fusenapi/utils/basic"
|
|
||||||
"log"
|
|
||||||
"net/http"
|
|
||||||
|
|
||||||
"context"
|
|
||||||
|
|
||||||
"fusenapi/server/assistant/internal/svc"
|
|
||||||
"fusenapi/server/assistant/internal/types"
|
|
||||||
|
|
||||||
"github.com/zeromicro/go-zero/core/logx"
|
|
||||||
)
|
|
||||||
|
|
||||||
type RedirectLogic struct {
|
|
||||||
logx.Logger
|
|
||||||
ctx context.Context
|
|
||||||
svcCtx *svc.ServiceContext
|
|
||||||
|
|
||||||
RedirectUrl string
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewRedirectLogic(ctx context.Context, svcCtx *svc.ServiceContext) *RedirectLogic {
|
|
||||||
return &RedirectLogic{
|
|
||||||
Logger: logx.WithContext(ctx),
|
|
||||||
ctx: ctx,
|
|
||||||
svcCtx: svcCtx,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 处理进入前逻辑w,r
|
|
||||||
// func (l *RedirectLogic) BeforeLogic(w http.ResponseWriter, r *http.Request) {
|
|
||||||
// }
|
|
||||||
|
|
||||||
// 处理逻辑后 w,r 如:重定向
|
|
||||||
func (l *RedirectLogic) AfterLogic(w http.ResponseWriter, r *http.Request, resp *basic.Response) {
|
|
||||||
if l.RedirectUrl != "" {
|
|
||||||
html := fmt.Sprintf(`
|
|
||||||
<!DOCTYPE html>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>Redirect</title>
|
|
||||||
<script type="text/javascript">
|
|
||||||
window.onload = function() {
|
|
||||||
window.location = %s;
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
`, l.RedirectUrl)
|
|
||||||
fmt.Fprintln(w, html)
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
func (l *RedirectLogic) Redirect(req *types.RequestRedirect, userinfo *auth.UserInfo) (resp *basic.Response) {
|
|
||||||
// 返回值必须调用Set重新返回, resp可以空指针调用 resp.SetStatus(basic.CodeOK, data)
|
|
||||||
// userinfo 传入值时, 一定不为null
|
|
||||||
l.RedirectUrl = req.Url
|
|
||||||
log.Println(req.Url)
|
|
||||||
return resp.SetStatus(basic.CodeOK)
|
|
||||||
}
|
|
||||||
@ -1,6 +1,7 @@
|
|||||||
Name: auth
|
Name: auth
|
||||||
Host: localhost
|
Host: localhost
|
||||||
Port: 9980
|
Port: 9980
|
||||||
|
ReplicaId: 10
|
||||||
MainAddress: "http://localhost:9900"
|
MainAddress: "http://localhost:9900"
|
||||||
SourceMysql: fusentest:XErSYmLELKMnf3Dh@tcp(110.41.19.98:3306)/fusentest
|
SourceMysql: fusentest:XErSYmLELKMnf3Dh@tcp(110.41.19.98:3306)/fusentest
|
||||||
Auth:
|
Auth:
|
||||||
|
|||||||
@ -15,7 +15,7 @@ func AcceptCookieHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
|||||||
return func(w http.ResponseWriter, r *http.Request) {
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
var req types.Request
|
var req types.Request
|
||||||
userinfo, err := basic.RequestParse(w, r, svcCtx, &req)
|
userinfo, err := basic.RequestParse(w, r, svcCtx.SharedState, &req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@ -27,6 +27,11 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
|
|||||||
Path: "/api/auth/oauth2/login/google",
|
Path: "/api/auth/oauth2/login/google",
|
||||||
Handler: UserGoogleLoginHandler(serverCtx),
|
Handler: UserGoogleLoginHandler(serverCtx),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
Method: http.MethodGet,
|
||||||
|
Path: "/api/auth/email/confirmation",
|
||||||
|
Handler: UserEmailConfirmationHandler(serverCtx),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
Method: http.MethodGet,
|
Method: http.MethodGet,
|
||||||
Path: "/api/auth/oauth2/register",
|
Path: "/api/auth/oauth2/register",
|
||||||
|
|||||||
35
server/auth/internal/handler/useremailconfirmationhandler.go
Normal file
35
server/auth/internal/handler/useremailconfirmationhandler.go
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
package handler
|
||||||
|
|
||||||
|
import (
|
||||||
|
"net/http"
|
||||||
|
"reflect"
|
||||||
|
|
||||||
|
"fusenapi/utils/basic"
|
||||||
|
|
||||||
|
"fusenapi/server/auth/internal/logic"
|
||||||
|
"fusenapi/server/auth/internal/svc"
|
||||||
|
"fusenapi/server/auth/internal/types"
|
||||||
|
)
|
||||||
|
|
||||||
|
func UserEmailConfirmationHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||||
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
|
var req types.RequestEmailConfirmation
|
||||||
|
userinfo, err := basic.RequestParse(w, r, svcCtx.SharedState, &req)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 创建一个业务逻辑层实例
|
||||||
|
l := logic.NewUserEmailConfirmationLogic(r.Context(), svcCtx)
|
||||||
|
|
||||||
|
rl := reflect.ValueOf(l)
|
||||||
|
basic.BeforeLogic(w, r, rl)
|
||||||
|
|
||||||
|
resp := l.UserEmailConfirmation(&req, userinfo)
|
||||||
|
|
||||||
|
if !basic.AfterLogic(w, r, rl, resp) {
|
||||||
|
basic.NormalAfterLogic(w, r, resp)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -15,7 +15,7 @@ func UserEmailRegisterHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
|||||||
return func(w http.ResponseWriter, r *http.Request) {
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
var req types.RequestEmailRegister
|
var req types.RequestEmailRegister
|
||||||
userinfo, err := basic.RequestParse(w, r, svcCtx, &req)
|
userinfo, err := basic.RequestParse(w, r, svcCtx.SharedState, &req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@ -15,7 +15,7 @@ func UserGoogleLoginHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
|||||||
return func(w http.ResponseWriter, r *http.Request) {
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
var req types.RequestGoogleLogin
|
var req types.RequestGoogleLogin
|
||||||
userinfo, err := basic.RequestParse(w, r, svcCtx, &req)
|
userinfo, err := basic.RequestParse(w, r, svcCtx.SharedState, &req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@ -15,7 +15,7 @@ func UserLoginHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
|||||||
return func(w http.ResponseWriter, r *http.Request) {
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
var req types.RequestUserLogin
|
var req types.RequestUserLogin
|
||||||
userinfo, err := basic.RequestParse(w, r, svcCtx, &req)
|
userinfo, err := basic.RequestParse(w, r, svcCtx.SharedState, &req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@ -11,40 +11,49 @@ import (
|
|||||||
|
|
||||||
var EmailManager *EmailSender
|
var EmailManager *EmailSender
|
||||||
|
|
||||||
|
type EmailFormat struct {
|
||||||
|
TargetEmail string // 发送的目标email
|
||||||
|
CompanyName string // fs公司名
|
||||||
|
ConfirmationLink string // fs确认连接
|
||||||
|
SenderName string // 发送人
|
||||||
|
SenderTitle string // 发送标题
|
||||||
|
}
|
||||||
|
|
||||||
// EmailSender
|
// EmailSender
|
||||||
type EmailSender struct {
|
type EmailSender struct {
|
||||||
lock sync.Mutex
|
lock sync.Mutex
|
||||||
EmailTasks chan string
|
EmailTasks chan *EmailFormat
|
||||||
Auth smtp.Auth
|
Auth smtp.Auth
|
||||||
FromEmail string
|
FromEmail string
|
||||||
emailSending map[string]*EmailTask
|
|
||||||
ResendTimeLimit time.Duration
|
ResendTimeLimit time.Duration
|
||||||
semaphore chan struct{}
|
|
||||||
|
emailSending map[string]*EmailTask
|
||||||
|
semaphore chan struct{}
|
||||||
}
|
}
|
||||||
|
|
||||||
// EmailTask
|
// EmailTask
|
||||||
type EmailTask struct {
|
type EmailTask struct {
|
||||||
Email string // email
|
Email *EmailFormat // email
|
||||||
SendTime time.Time // 处理的任务时间
|
SendTime time.Time // 处理的任务时间
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *EmailSender) ProcessEmailTasks() {
|
func (m *EmailSender) ProcessEmailTasks() {
|
||||||
for {
|
for {
|
||||||
emailTarget, ok := <-m.EmailTasks
|
emailformat, ok := <-m.EmailTasks
|
||||||
if !ok {
|
if !ok {
|
||||||
log.Println("Email task channel closed")
|
log.Println("Email task channel closed")
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
m.lock.Lock()
|
m.lock.Lock()
|
||||||
_, isSending := m.emailSending[emailTarget]
|
_, isSending := m.emailSending[emailformat.TargetEmail]
|
||||||
if isSending {
|
if isSending {
|
||||||
m.lock.Unlock()
|
m.lock.Unlock()
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
m.emailSending[emailTarget] = &EmailTask{
|
m.emailSending[emailformat.TargetEmail] = &EmailTask{
|
||||||
Email: emailTarget,
|
Email: emailformat,
|
||||||
SendTime: time.Now(),
|
SendTime: time.Now(),
|
||||||
}
|
}
|
||||||
m.lock.Unlock()
|
m.lock.Unlock()
|
||||||
@ -55,11 +64,11 @@ func (m *EmailSender) ProcessEmailTasks() {
|
|||||||
go func() {
|
go func() {
|
||||||
defer func() { <-m.semaphore }() // Release a token
|
defer func() { <-m.semaphore }() // Release a token
|
||||||
|
|
||||||
content := RenderEmailTemplate("fusen", "http://www.baidu.com", "fusen@gmail.com", "mail-valid")
|
content := RenderEmailTemplate(emailformat.CompanyName, emailformat.ConfirmationLink, emailformat.SenderName, emailformat.SenderTitle)
|
||||||
err := smtp.SendMail("smtp.gmail.com:587", m.Auth, m.FromEmail, []string{emailTarget}, content)
|
err := smtp.SendMail("smtp.gmail.com:587", m.Auth, m.FromEmail, []string{emailformat.TargetEmail}, content)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("Failed to send email to %s: %v\n", emailTarget, err)
|
log.Printf("Failed to send email to %s: %v\n", emailformat, err)
|
||||||
m.Resend(emailTarget, content)
|
m.Resend(emailformat.TargetEmail, content)
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
}
|
}
|
||||||
@ -105,7 +114,7 @@ func init() {
|
|||||||
|
|
||||||
// Initialize the email manager
|
// Initialize the email manager
|
||||||
EmailManager = &EmailSender{
|
EmailManager = &EmailSender{
|
||||||
EmailTasks: make(chan string, 10),
|
EmailTasks: make(chan *EmailFormat, 10),
|
||||||
Auth: smtp.PlainAuth(
|
Auth: smtp.PlainAuth(
|
||||||
"",
|
"",
|
||||||
"user@example.com",
|
"user@example.com",
|
||||||
|
|||||||
90
server/auth/internal/logic/useremailconfirmationlogic.go
Normal file
90
server/auth/internal/logic/useremailconfirmationlogic.go
Normal file
@ -0,0 +1,90 @@
|
|||||||
|
package logic
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fusenapi/utils/auth"
|
||||||
|
"fusenapi/utils/basic"
|
||||||
|
"log"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"context"
|
||||||
|
|
||||||
|
"fusenapi/server/auth/internal/svc"
|
||||||
|
"fusenapi/server/auth/internal/types"
|
||||||
|
|
||||||
|
"github.com/zeromicro/go-zero/core/logx"
|
||||||
|
)
|
||||||
|
|
||||||
|
type UserEmailConfirmationLogic struct {
|
||||||
|
logx.Logger
|
||||||
|
ctx context.Context
|
||||||
|
svcCtx *svc.ServiceContext
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewUserEmailConfirmationLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UserEmailConfirmationLogic {
|
||||||
|
return &UserEmailConfirmationLogic{
|
||||||
|
Logger: logx.WithContext(ctx),
|
||||||
|
ctx: ctx,
|
||||||
|
svcCtx: svcCtx,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 处理进入前逻辑w,r
|
||||||
|
// func (l *UserEmailConfirmationLogic) BeforeLogic(w http.ResponseWriter, r *http.Request) {
|
||||||
|
// }
|
||||||
|
|
||||||
|
func (l *UserEmailConfirmationLogic) UserEmailConfirmation(req *types.RequestEmailConfirmation, userinfo *auth.UserInfo) (resp *basic.Response) {
|
||||||
|
// 返回值必须调用Set重新返回, resp可以空指针调用 resp.SetStatus(basic.CodeOK, data)
|
||||||
|
// userinfo 传入值时, 一定不为null
|
||||||
|
|
||||||
|
token, err := l.svcCtx.TokenManger.Decrypt(req.Token)
|
||||||
|
if err != nil {
|
||||||
|
logx.Error(err)
|
||||||
|
return resp.SetStatus(basic.CodeOAuthRegisterTokenErr)
|
||||||
|
}
|
||||||
|
|
||||||
|
switch token.OperateType {
|
||||||
|
case auth.OpTypeRegister:
|
||||||
|
if time.Since(token.CreateAt) >= 24*time.Hour {
|
||||||
|
return resp.SetStatus(basic.CodeOAuthConfirmationTimeoutErr)
|
||||||
|
}
|
||||||
|
|
||||||
|
switch token.Platform {
|
||||||
|
case "google":
|
||||||
|
// 谷歌平台的注册流程
|
||||||
|
user, err := l.svcCtx.AllModels.FsUser.RegisterByGoogleOAuth(l.ctx, token)
|
||||||
|
if err != nil {
|
||||||
|
logx.Error(err)
|
||||||
|
return resp.SetStatus(basic.CodeDbSqlErr)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 创建签证
|
||||||
|
jwtToken, err := auth.GenerateJwtTokenUint64(
|
||||||
|
auth.StringToHash(*user.PasswordHash),
|
||||||
|
l.svcCtx.Config.Auth.AccessExpire,
|
||||||
|
time.Now().Unix(),
|
||||||
|
user.Id,
|
||||||
|
0,
|
||||||
|
)
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
logx.Error(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
log.Println(jwtToken)
|
||||||
|
|
||||||
|
case "facebook":
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
default:
|
||||||
|
return resp.SetStatus(basic.CodeOAuthRegisterTokenErr)
|
||||||
|
}
|
||||||
|
|
||||||
|
return resp.SetStatus(basic.CodeOK)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 处理逻辑后 w,r 如:重定向, resp 必须重新处理
|
||||||
|
// func (l *UserEmailConfirmationLogic) AfterLogic(w http.ResponseWriter, r *http.Request, resp *basic.Response) {
|
||||||
|
// // httpx.OkJsonCtx(r.Context(), w, resp)
|
||||||
|
// }
|
||||||
@ -39,5 +39,43 @@ func (l *UserEmailRegisterLogic) UserEmailRegister(req *types.RequestEmailRegist
|
|||||||
// 返回值必须调用Set重新返回, resp可以空指针调用 resp.SetStatus(basic.CodeOK, data)
|
// 返回值必须调用Set重新返回, resp可以空指针调用 resp.SetStatus(basic.CodeOK, data)
|
||||||
// userinfo 传入值时, 一定不为null
|
// userinfo 传入值时, 一定不为null
|
||||||
|
|
||||||
|
// 进入邮件注册流程
|
||||||
|
// 这里是注册模块, 发邮件, 通过邮件注册确认邮箱存在
|
||||||
|
|
||||||
|
// 邮箱验证格式错误
|
||||||
|
if !auth.ValidateEmail(req.Email) {
|
||||||
|
return resp.SetStatus(basic.CodeOAuthEmailErr)
|
||||||
|
}
|
||||||
|
|
||||||
|
token, err := l.svcCtx.TokenManger.Decrypt(req.RegisterToken)
|
||||||
|
if err != nil {
|
||||||
|
logx.Error(err)
|
||||||
|
return resp.SetStatus(basic.CodeOAuthRegisterTokenErr)
|
||||||
|
}
|
||||||
|
|
||||||
|
if token.OperateType != auth.OpTypeRegister {
|
||||||
|
return resp.SetStatus(basic.CodeOAuthRegisterTokenErr)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 确认email 重新序列化
|
||||||
|
token.Email = req.Email
|
||||||
|
token.WCId = req.WCId
|
||||||
|
token.GuestId = req.GuestId
|
||||||
|
|
||||||
|
clurl, err := l.svcCtx.TokenManger.Generate(token)
|
||||||
|
if err != nil {
|
||||||
|
logx.Error(err)
|
||||||
|
return resp.SetStatus(basic.CodeOAuthRegisterTokenErr)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 进入发送邮箱的系统
|
||||||
|
EmailManager.EmailTasks <- &EmailFormat{
|
||||||
|
TargetEmail: req.Email,
|
||||||
|
CompanyName: "fusen",
|
||||||
|
ConfirmationLink: clurl,
|
||||||
|
SenderName: "support@fusenpack.com",
|
||||||
|
SenderTitle: "register-valid",
|
||||||
|
} // email进入队
|
||||||
|
|
||||||
return resp.SetStatus(basic.CodeOK)
|
return resp.SetStatus(basic.CodeOK)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,9 +1,12 @@
|
|||||||
package logic
|
package logic
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"crypto/rand"
|
||||||
|
"encoding/base64"
|
||||||
"fmt"
|
"fmt"
|
||||||
"fusenapi/utils/auth"
|
"fusenapi/utils/auth"
|
||||||
"fusenapi/utils/basic"
|
"fusenapi/utils/basic"
|
||||||
|
"io"
|
||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
"time"
|
"time"
|
||||||
@ -31,7 +34,7 @@ type UserGoogleLoginLogic struct {
|
|||||||
|
|
||||||
isRegistered bool // 是否注册
|
isRegistered bool // 是否注册
|
||||||
registerToken string // 注册邮箱的token
|
registerToken string // 注册邮箱的token
|
||||||
oauthinfo *auth.OAuthInfo
|
registerInfo *auth.RegisterToken
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewUserGoogleLoginLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UserGoogleLoginLogic {
|
func NewUserGoogleLoginLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UserGoogleLoginLogic {
|
||||||
@ -46,57 +49,6 @@ func NewUserGoogleLoginLogic(ctx context.Context, svcCtx *svc.ServiceContext) *U
|
|||||||
// func (l *UserGoogleLoginLogic) BeforeLogic(w http.ResponseWriter, r *http.Request) {
|
// func (l *UserGoogleLoginLogic) BeforeLogic(w http.ResponseWriter, r *http.Request) {
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// 处理逻辑后 w,r 如:重定向, resp 必须重新处理
|
|
||||||
func (l *UserGoogleLoginLogic) AfterLogic(w http.ResponseWriter, r *http.Request, resp *basic.Response) {
|
|
||||||
|
|
||||||
if resp.Code == 200 {
|
|
||||||
|
|
||||||
if !l.isRegistered {
|
|
||||||
now := time.Now()
|
|
||||||
rtoken, err := auth.GenerateRegisterToken(
|
|
||||||
&l.svcCtx.Config.Auth.AccessSecret,
|
|
||||||
l.svcCtx.Config.Auth.AccessExpire,
|
|
||||||
now.Unix(),
|
|
||||||
l.oauthinfo.Id,
|
|
||||||
l.oauthinfo.Platform,
|
|
||||||
)
|
|
||||||
|
|
||||||
if err != nil {
|
|
||||||
resp.SetStatus(basic.CodeOAuthRegisterTokenErr)
|
|
||||||
}
|
|
||||||
|
|
||||||
l.registerToken = rtoken
|
|
||||||
}
|
|
||||||
|
|
||||||
rurl := fmt.Sprintf(
|
|
||||||
l.svcCtx.Config.MainAddress+"/oauth?token=%s&is_registered=%t®ister_token=%s",
|
|
||||||
l.token,
|
|
||||||
l.isRegistered,
|
|
||||||
l.registerToken,
|
|
||||||
)
|
|
||||||
|
|
||||||
html := fmt.Sprintf(`
|
|
||||||
<!DOCTYPE html>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>Redirect</title>
|
|
||||||
<script type="text/javascript">
|
|
||||||
window.onload = function() {
|
|
||||||
window.location = "%s";
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
`, rurl)
|
|
||||||
fmt.Fprintln(w, html)
|
|
||||||
} else {
|
|
||||||
httpx.OkJson(w, resp)
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
func (l *UserGoogleLoginLogic) UserGoogleLogin(req *types.RequestGoogleLogin, userinfo *auth.UserInfo) (resp *basic.Response) {
|
func (l *UserGoogleLoginLogic) UserGoogleLogin(req *types.RequestGoogleLogin, userinfo *auth.UserInfo) (resp *basic.Response) {
|
||||||
// 返回值必须调用Set重新返回, resp可以空指针调用 resp.SetStatus(basic.CodeOK, data)
|
// 返回值必须调用Set重新返回, resp可以空指针调用 resp.SetStatus(basic.CodeOK, data)
|
||||||
// userinfo 传入值时, 一定不为null
|
// userinfo 传入值时, 一定不为null
|
||||||
@ -139,6 +91,7 @@ func (l *UserGoogleLoginLogic) UserGoogleLogin(req *types.RequestGoogleLogin, us
|
|||||||
log.Println(r.Json())
|
log.Println(r.Json())
|
||||||
|
|
||||||
googleId := r.Json().Get("id").Int()
|
googleId := r.Json().Get("id").Int()
|
||||||
|
|
||||||
user, err := l.svcCtx.AllModels.FsUser.FindUserByGoogleId(context.TODO(), googleId)
|
user, err := l.svcCtx.AllModels.FsUser.FindUserByGoogleId(context.TODO(), googleId)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if err != gorm.ErrRecordNotFound {
|
if err != gorm.ErrRecordNotFound {
|
||||||
@ -146,26 +99,34 @@ func (l *UserGoogleLoginLogic) UserGoogleLogin(req *types.RequestGoogleLogin, us
|
|||||||
return resp.SetStatus(basic.CodeDbSqlErr)
|
return resp.SetStatus(basic.CodeDbSqlErr)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 进入邮件注册流程
|
nonce := make([]byte, 16)
|
||||||
if req.Email == "" {
|
if _, err := io.ReadFull(rand.Reader, nonce); err != nil {
|
||||||
|
logx.Error(err)
|
||||||
return resp.SetStatus(basic.CodeOK)
|
return resp.SetStatus(basic.CodeOK)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 这里是注册模块, 发邮件, 通过邮件注册确认邮箱存在
|
l.registerInfo = &auth.RegisterToken{
|
||||||
|
Id: googleId,
|
||||||
// 邮箱验证格式错误
|
Password: base64.URLEncoding.EncodeToString(nonce),
|
||||||
if !auth.ValidateEmail(req.Email) {
|
Platform: "google",
|
||||||
return resp.SetStatus(basic.CodeOAuthEmailErr)
|
OperateType: auth.OpTypeRegister,
|
||||||
|
CreateAt: time.Now(),
|
||||||
}
|
}
|
||||||
|
|
||||||
EmailManager.EmailTasks <- req.Email // email进入队
|
l.isRegistered = false
|
||||||
|
token, err := l.svcCtx.TokenManger.Encrypt(l.registerInfo)
|
||||||
|
if err != nil {
|
||||||
|
logx.Error(err)
|
||||||
|
return resp.SetStatus(basic.CodeOAuthRegisterTokenErr)
|
||||||
|
}
|
||||||
|
l.registerToken = token
|
||||||
|
|
||||||
return resp.SetStatus(basic.CodeOK)
|
return resp.SetStatus(basic.CodeOK)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
l.isRegistered = true
|
||||||
// 如果密码匹配,则生成 JWT Token。
|
// 如果密码匹配,则生成 JWT Token。
|
||||||
nowSec := time.Now().Unix()
|
jwtToken, err := auth.GenerateJwtTokenUint64(auth.StringToHash(*user.PasswordHash), l.svcCtx.Config.Auth.AccessExpire, time.Now().Unix(), user.Id, 0)
|
||||||
jwtToken, err := auth.GenerateJwtToken(&l.svcCtx.Config.Auth.AccessSecret, l.svcCtx.Config.Auth.AccessExpire, nowSec, user.Id, 0)
|
|
||||||
|
|
||||||
// 如果生成 JWT Token 失败,则抛出错误并返回未认证的状态码。
|
// 如果生成 JWT Token 失败,则抛出错误并返回未认证的状态码。
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -177,3 +138,37 @@ func (l *UserGoogleLoginLogic) UserGoogleLogin(req *types.RequestGoogleLogin, us
|
|||||||
|
|
||||||
return resp.SetStatus(basic.CodeOK)
|
return resp.SetStatus(basic.CodeOK)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 处理逻辑后 w,r 如:重定向, resp 必须重新处理
|
||||||
|
func (l *UserGoogleLoginLogic) AfterLogic(w http.ResponseWriter, r *http.Request, resp *basic.Response) {
|
||||||
|
|
||||||
|
if resp.Code == 200 {
|
||||||
|
|
||||||
|
rurl := fmt.Sprintf(
|
||||||
|
l.svcCtx.Config.MainAddress+"/oauth?token=%s&is_registered=%t®ister_token=%s",
|
||||||
|
l.token,
|
||||||
|
l.isRegistered,
|
||||||
|
l.registerToken,
|
||||||
|
)
|
||||||
|
|
||||||
|
html := fmt.Sprintf(`
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>Redirect</title>
|
||||||
|
<script type="text/javascript">
|
||||||
|
window.onload = function() {
|
||||||
|
window.location = "%s";
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
`, rurl)
|
||||||
|
fmt.Fprintln(w, html)
|
||||||
|
} else {
|
||||||
|
httpx.OkJson(w, resp)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@ -68,8 +68,13 @@ func (l *UserLoginLogic) UserLogin(req *types.RequestUserLogin, userinfo *auth.U
|
|||||||
|
|
||||||
// 如果密码匹配,则生成 JWT Token。
|
// 如果密码匹配,则生成 JWT Token。
|
||||||
nowSec := time.Now().Unix()
|
nowSec := time.Now().Unix()
|
||||||
|
us, err := l.svcCtx.SharedState.GetUserState(user.Id)
|
||||||
|
if err != nil {
|
||||||
|
logx.Error(err)
|
||||||
|
return resp.SetStatus(basic.CodeSharedStateErr)
|
||||||
|
}
|
||||||
|
|
||||||
jwtToken, err := auth.GenerateJwtToken(&l.svcCtx.Config.Auth.AccessSecret, l.svcCtx.Config.Auth.AccessExpire, nowSec, user.Id, 0)
|
jwtToken, err := auth.GenerateJwtTokenUint64(us.PwdHash, l.svcCtx.Config.Auth.AccessExpire, nowSec, user.Id, 0)
|
||||||
|
|
||||||
// 如果生成 JWT Token 失败,则抛出错误并返回未认证的状态码。
|
// 如果生成 JWT Token 失败,则抛出错误并返回未认证的状态码。
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@ -5,6 +5,8 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"fusenapi/fsm"
|
"fusenapi/fsm"
|
||||||
"fusenapi/server/auth/internal/config"
|
"fusenapi/server/auth/internal/config"
|
||||||
|
"fusenapi/utils/auth"
|
||||||
|
"fusenapi/utils/autoconfig"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"fusenapi/initalize"
|
"fusenapi/initalize"
|
||||||
@ -16,21 +18,24 @@ import (
|
|||||||
|
|
||||||
type ServiceContext struct {
|
type ServiceContext struct {
|
||||||
Config config.Config
|
Config config.Config
|
||||||
SharedState *fsm.StateCluster
|
SharedState *fsm.FsStateMachine
|
||||||
|
|
||||||
MysqlConn *gorm.DB
|
MysqlConn *gorm.DB
|
||||||
AllModels *gmodel.AllModelsGen
|
AllModels *gmodel.AllModelsGen
|
||||||
|
|
||||||
|
TokenManger *auth.ConfirmationLink[auth.RegisterToken]
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewServiceContext(c config.Config) *ServiceContext {
|
func NewServiceContext(c config.Config) *ServiceContext {
|
||||||
conn := initalize.InitMysql(c.SourceMysql)
|
conn := initalize.InitMysql(c.SourceMysql)
|
||||||
StateServer := fsm.StartNode(c.Name, fmt.Sprintf("localhost:%d", c.Port-2001), conn)
|
StateServer := fsm.StartNode(c.Name, fmt.Sprintf("localhost:%d", c.Port-2000), autoconfig.AutoGetAllServerConfig(), conn)
|
||||||
|
|
||||||
return &ServiceContext{
|
return &ServiceContext{
|
||||||
Config: c,
|
Config: c,
|
||||||
MysqlConn: conn,
|
MysqlConn: conn,
|
||||||
SharedState: StateServer,
|
SharedState: StateServer,
|
||||||
AllModels: gmodel.NewAllModels(initalize.InitMysql(c.SourceMysql)),
|
AllModels: gmodel.NewAllModels(initalize.InitMysql(c.SourceMysql)),
|
||||||
|
TokenManger: auth.NewConfirmationLink[auth.RegisterToken](c.Auth.AccessSecret, "http://localhost:9900/api/auth/oauth2/register"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -15,11 +15,16 @@ type RequestGoogleLogin struct {
|
|||||||
Scope string `form:"scope"`
|
Scope string `form:"scope"`
|
||||||
AuthUser string `form:"authuser"`
|
AuthUser string `form:"authuser"`
|
||||||
Prompt string `form:"prompt"`
|
Prompt string `form:"prompt"`
|
||||||
Email string `form:"email,optional"`
|
}
|
||||||
|
|
||||||
|
type RequestEmailConfirmation struct {
|
||||||
|
Token string `query:"token"` // 操作Token
|
||||||
}
|
}
|
||||||
|
|
||||||
type RequestEmailRegister struct {
|
type RequestEmailRegister struct {
|
||||||
Email string `json:"email"`
|
Email string `json:"email"`
|
||||||
|
WCId uint64 `json:"wcid"`
|
||||||
|
GuestId uint64 `json:"guest_id"`
|
||||||
RegisterToken string `json:"register_token"`
|
RegisterToken string `json:"register_token"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -17,7 +17,7 @@ import (
|
|||||||
|
|
||||||
type ServiceContext struct {
|
type ServiceContext struct {
|
||||||
Config config.Config
|
Config config.Config
|
||||||
SharedState *fsm.StateCluster
|
SharedState *fsm.FsStateMachine
|
||||||
|
|
||||||
MysqlConn *gorm.DB
|
MysqlConn *gorm.DB
|
||||||
AllModels *gmodel.AllModelsGen
|
AllModels *gmodel.AllModelsGen
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
Name: canteen
|
Name: canteen
|
||||||
Host: localhost
|
Host: localhost
|
||||||
Port: 9902
|
Port: 9902
|
||||||
|
ReplicaId: 15
|
||||||
SourceMysql: fusentest:XErSYmLELKMnf3Dh@tcp(110.41.19.98:3306)/fusentest
|
SourceMysql: fusentest:XErSYmLELKMnf3Dh@tcp(110.41.19.98:3306)/fusentest
|
||||||
Auth:
|
Auth:
|
||||||
AccessSecret: fusen2023
|
AccessSecret: fusen2023
|
||||||
|
|||||||
@ -15,7 +15,7 @@ func GetCanteenDetailHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
|||||||
return func(w http.ResponseWriter, r *http.Request) {
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
var req types.GetCanteenDetailReq
|
var req types.GetCanteenDetailReq
|
||||||
userinfo, err := basic.RequestParse(w, r, svcCtx, &req)
|
userinfo, err := basic.RequestParse(w, r, svcCtx.SharedState, &req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@ -15,7 +15,7 @@ func SaveCanteenTypeProductHandler(svcCtx *svc.ServiceContext) http.HandlerFunc
|
|||||||
return func(w http.ResponseWriter, r *http.Request) {
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
var req types.SaveCanteenTypeProductReq
|
var req types.SaveCanteenTypeProductReq
|
||||||
userinfo, err := basic.RequestParse(w, r, svcCtx, &req)
|
userinfo, err := basic.RequestParse(w, r, svcCtx.SharedState, &req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,6 +5,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"fusenapi/fsm"
|
"fusenapi/fsm"
|
||||||
"fusenapi/server/canteen/internal/config"
|
"fusenapi/server/canteen/internal/config"
|
||||||
|
"fusenapi/utils/autoconfig"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"fusenapi/initalize"
|
"fusenapi/initalize"
|
||||||
@ -16,7 +17,7 @@ import (
|
|||||||
|
|
||||||
type ServiceContext struct {
|
type ServiceContext struct {
|
||||||
Config config.Config
|
Config config.Config
|
||||||
SharedState *fsm.StateCluster
|
SharedState *fsm.FsStateMachine
|
||||||
|
|
||||||
MysqlConn *gorm.DB
|
MysqlConn *gorm.DB
|
||||||
AllModels *gmodel.AllModelsGen
|
AllModels *gmodel.AllModelsGen
|
||||||
@ -24,7 +25,7 @@ type ServiceContext struct {
|
|||||||
|
|
||||||
func NewServiceContext(c config.Config) *ServiceContext {
|
func NewServiceContext(c config.Config) *ServiceContext {
|
||||||
conn := initalize.InitMysql(c.SourceMysql)
|
conn := initalize.InitMysql(c.SourceMysql)
|
||||||
StateServer := fsm.StartNode(c.Name, fmt.Sprintf("%s:%d", c.Host, c.Port-2000), conn)
|
StateServer := fsm.StartNode(c.Name, fmt.Sprintf("%s:%d", c.Host, c.Port-2000), autoconfig.AutoGetAllServerConfig(), conn)
|
||||||
|
|
||||||
return &ServiceContext{
|
return &ServiceContext{
|
||||||
Config: c,
|
Config: c,
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
Name: data-transfer
|
Name: data-transfer
|
||||||
Host: localhost
|
Host: localhost
|
||||||
Port: 9903
|
Port: 9903
|
||||||
|
ReplicaId: 20
|
||||||
SourceMysql: fusentest:XErSYmLELKMnf3Dh@tcp(110.41.19.98:3306)/fusentest
|
SourceMysql: fusentest:XErSYmLELKMnf3Dh@tcp(110.41.19.98:3306)/fusentest
|
||||||
Auth:
|
Auth:
|
||||||
AccessSecret: fusen2023
|
AccessSecret: fusen2023
|
||||||
|
|||||||
@ -15,7 +15,7 @@ func GetQrCodeSetListHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
|||||||
return func(w http.ResponseWriter, r *http.Request) {
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
var req types.Request
|
var req types.Request
|
||||||
userinfo, err := basic.RequestParse(w, r, svcCtx, &req)
|
userinfo, err := basic.RequestParse(w, r, svcCtx.SharedState, &req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@ -15,7 +15,7 @@ func GetStandardLogoListHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
|||||||
return func(w http.ResponseWriter, r *http.Request) {
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
var req types.Request
|
var req types.Request
|
||||||
userinfo, err := basic.RequestParse(w, r, svcCtx, &req)
|
userinfo, err := basic.RequestParse(w, r, svcCtx.SharedState, &req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,6 +5,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"fusenapi/fsm"
|
"fusenapi/fsm"
|
||||||
"fusenapi/server/data-transfer/internal/config"
|
"fusenapi/server/data-transfer/internal/config"
|
||||||
|
"fusenapi/utils/autoconfig"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"fusenapi/initalize"
|
"fusenapi/initalize"
|
||||||
@ -16,7 +17,7 @@ import (
|
|||||||
|
|
||||||
type ServiceContext struct {
|
type ServiceContext struct {
|
||||||
Config config.Config
|
Config config.Config
|
||||||
SharedState *fsm.StateCluster
|
SharedState *fsm.FsStateMachine
|
||||||
|
|
||||||
MysqlConn *gorm.DB
|
MysqlConn *gorm.DB
|
||||||
AllModels *gmodel.AllModelsGen
|
AllModels *gmodel.AllModelsGen
|
||||||
@ -24,7 +25,7 @@ type ServiceContext struct {
|
|||||||
|
|
||||||
func NewServiceContext(c config.Config) *ServiceContext {
|
func NewServiceContext(c config.Config) *ServiceContext {
|
||||||
conn := initalize.InitMysql(c.SourceMysql)
|
conn := initalize.InitMysql(c.SourceMysql)
|
||||||
StateServer := fsm.StartNode(c.Name, fmt.Sprintf("%s:%d", c.Host, c.Port-2000), conn)
|
StateServer := fsm.StartNode(c.Name, fmt.Sprintf("%s:%d", c.Host, c.Port-2000), autoconfig.AutoGetAllServerConfig(), conn)
|
||||||
|
|
||||||
return &ServiceContext{
|
return &ServiceContext{
|
||||||
Config: c,
|
Config: c,
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
Name: home-user-auth
|
Name: home-user-auth
|
||||||
Host: localhost
|
Host: localhost
|
||||||
Port: 9904
|
Port: 9904
|
||||||
|
ReplicaId: 25
|
||||||
MainAddress: "http://localhost:9900"
|
MainAddress: "http://localhost:9900"
|
||||||
SourceMysql: fusentest:XErSYmLELKMnf3Dh@tcp(110.41.19.98:3306)/fusentest
|
SourceMysql: fusentest:XErSYmLELKMnf3Dh@tcp(110.41.19.98:3306)/fusentest
|
||||||
|
|
||||||
|
|||||||
@ -62,6 +62,11 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
|
|||||||
Path: "/api/user/order-list",
|
Path: "/api/user/order-list",
|
||||||
Handler: UserOrderListHandler(serverCtx),
|
Handler: UserOrderListHandler(serverCtx),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
Method: http.MethodGet,
|
||||||
|
Path: "/api/user/order-delete",
|
||||||
|
Handler: UserOrderDeleteHandler(serverCtx),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
Method: http.MethodGet,
|
Method: http.MethodGet,
|
||||||
Path: "/api/user/order-cancel",
|
Path: "/api/user/order-cancel",
|
||||||
|
|||||||
@ -15,7 +15,7 @@ func UserAddAddressHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
|||||||
return func(w http.ResponseWriter, r *http.Request) {
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
var req types.RequestAddAddress
|
var req types.RequestAddAddress
|
||||||
userinfo, err := basic.RequestParse(w, r, svcCtx, &req)
|
userinfo, err := basic.RequestParse(w, r, svcCtx.SharedState, &req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@ -15,7 +15,7 @@ func UserAddressListHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
|||||||
return func(w http.ResponseWriter, r *http.Request) {
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
var req types.Request
|
var req types.Request
|
||||||
userinfo, err := basic.RequestParse(w, r, svcCtx, &req)
|
userinfo, err := basic.RequestParse(w, r, svcCtx.SharedState, &req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@ -15,7 +15,7 @@ func UserBasicInfoHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
|||||||
return func(w http.ResponseWriter, r *http.Request) {
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
var req types.Request
|
var req types.Request
|
||||||
userinfo, err := basic.RequestParse(w, r, svcCtx, &req)
|
userinfo, err := basic.RequestParse(w, r, svcCtx.SharedState, &req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@ -15,7 +15,7 @@ func UserContactServiceHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
|||||||
return func(w http.ResponseWriter, r *http.Request) {
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
var req types.RequestContactService
|
var req types.RequestContactService
|
||||||
userinfo, err := basic.RequestParse(w, r, svcCtx, &req)
|
userinfo, err := basic.RequestParse(w, r, svcCtx.SharedState, &req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@ -15,7 +15,7 @@ func UserFontsHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
|||||||
return func(w http.ResponseWriter, r *http.Request) {
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
var req types.Request
|
var req types.Request
|
||||||
userinfo, err := basic.RequestParse(w, r, svcCtx, &req)
|
userinfo, err := basic.RequestParse(w, r, svcCtx.SharedState, &req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@ -15,7 +15,7 @@ func UserGetTypeHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
|||||||
return func(w http.ResponseWriter, r *http.Request) {
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
var req types.Request
|
var req types.Request
|
||||||
userinfo, err := basic.RequestParse(w, r, svcCtx, &req)
|
userinfo, err := basic.RequestParse(w, r, svcCtx.SharedState, &req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@ -15,7 +15,7 @@ func UserOderDeleteHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
|||||||
return func(w http.ResponseWriter, r *http.Request) {
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
var req types.RequestOrderId
|
var req types.RequestOrderId
|
||||||
userinfo, err := basic.RequestParse(w, r, svcCtx, &req)
|
userinfo, err := basic.RequestParse(w, r, svcCtx.SharedState, &req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@ -15,7 +15,7 @@ func UserOrderCancelHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
|||||||
return func(w http.ResponseWriter, r *http.Request) {
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
var req types.UserOrderCancelReq
|
var req types.UserOrderCancelReq
|
||||||
userinfo, err := basic.RequestParse(w, r, svcCtx, &req)
|
userinfo, err := basic.RequestParse(w, r, svcCtx.SharedState, &req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,35 @@
|
|||||||
|
package handler
|
||||||
|
|
||||||
|
import (
|
||||||
|
"net/http"
|
||||||
|
"reflect"
|
||||||
|
|
||||||
|
"fusenapi/utils/basic"
|
||||||
|
|
||||||
|
"fusenapi/server/home-user-auth/internal/logic"
|
||||||
|
"fusenapi/server/home-user-auth/internal/svc"
|
||||||
|
"fusenapi/server/home-user-auth/internal/types"
|
||||||
|
)
|
||||||
|
|
||||||
|
func UserOrderDeleteHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||||
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
|
var req types.UserOrderDeleteReq
|
||||||
|
userinfo, err := basic.RequestParse(w, r, svcCtx.SharedState, &req)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 创建一个业务逻辑层实例
|
||||||
|
l := logic.NewUserOrderDeleteLogic(r.Context(), svcCtx)
|
||||||
|
|
||||||
|
rl := reflect.ValueOf(l)
|
||||||
|
basic.BeforeLogic(w, r, rl)
|
||||||
|
|
||||||
|
resp := l.UserOrderDelete(&req, userinfo)
|
||||||
|
|
||||||
|
if !basic.AfterLogic(w, r, rl, resp) {
|
||||||
|
basic.NormalAfterLogic(w, r, resp)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -15,7 +15,7 @@ func UserOrderListHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
|||||||
return func(w http.ResponseWriter, r *http.Request) {
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
var req types.UserOrderListReq
|
var req types.UserOrderListReq
|
||||||
userinfo, err := basic.RequestParse(w, r, svcCtx, &req)
|
userinfo, err := basic.RequestParse(w, r, svcCtx.SharedState, &req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@ -15,7 +15,7 @@ func UserSaveBasicInfoHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
|||||||
return func(w http.ResponseWriter, r *http.Request) {
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
var req types.RequestBasicInfoForm
|
var req types.RequestBasicInfoForm
|
||||||
userinfo, err := basic.RequestParse(w, r, svcCtx, &req)
|
userinfo, err := basic.RequestParse(w, r, svcCtx.SharedState, &req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@ -15,7 +15,7 @@ func UserStatusConfigHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
|||||||
return func(w http.ResponseWriter, r *http.Request) {
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
var req types.Request
|
var req types.Request
|
||||||
userinfo, err := basic.RequestParse(w, r, svcCtx, &req)
|
userinfo, err := basic.RequestParse(w, r, svcCtx.SharedState, &req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
78
server/home-user-auth/internal/logic/userorderdeletelogic.go
Normal file
78
server/home-user-auth/internal/logic/userorderdeletelogic.go
Normal file
@ -0,0 +1,78 @@
|
|||||||
|
package logic
|
||||||
|
|
||||||
|
import (
|
||||||
|
"errors"
|
||||||
|
"fusenapi/constants"
|
||||||
|
"fusenapi/model/gmodel"
|
||||||
|
"fusenapi/utils/auth"
|
||||||
|
"fusenapi/utils/basic"
|
||||||
|
|
||||||
|
"context"
|
||||||
|
|
||||||
|
"fusenapi/server/home-user-auth/internal/svc"
|
||||||
|
"fusenapi/server/home-user-auth/internal/types"
|
||||||
|
|
||||||
|
"github.com/zeromicro/go-zero/core/logx"
|
||||||
|
"gorm.io/gorm"
|
||||||
|
)
|
||||||
|
|
||||||
|
type UserOrderDeleteLogic struct {
|
||||||
|
logx.Logger
|
||||||
|
ctx context.Context
|
||||||
|
svcCtx *svc.ServiceContext
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewUserOrderDeleteLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UserOrderDeleteLogic {
|
||||||
|
return &UserOrderDeleteLogic{
|
||||||
|
Logger: logx.WithContext(ctx),
|
||||||
|
ctx: ctx,
|
||||||
|
svcCtx: svcCtx,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 处理进入前逻辑w,r
|
||||||
|
// func (l *UserOrderDeleteLogic) BeforeLogic(w http.ResponseWriter, r *http.Request) {
|
||||||
|
// }
|
||||||
|
|
||||||
|
// 处理逻辑后 w,r 如:重定向, resp 必须重新处理
|
||||||
|
// func (l *UserOrderDeleteLogic) AfterLogic(w http.ResponseWriter, r *http.Request, resp *basic.Response) {
|
||||||
|
// // httpx.OkJsonCtx(r.Context(), w, resp)
|
||||||
|
// }
|
||||||
|
|
||||||
|
func (l *UserOrderDeleteLogic) UserOrderDelete(req *types.UserOrderDeleteReq, userinfo *auth.UserInfo) (resp *basic.Response) {
|
||||||
|
// 返回值必须调用Set重新返回, resp可以空指针调用 resp.SetStatus(basic.CodeOK, data)
|
||||||
|
// userinfo 传入值时, 一定不为null
|
||||||
|
|
||||||
|
if userinfo == nil || userinfo.UserId == 0 {
|
||||||
|
return resp.SetStatusWithMessage(basic.CodeDbRecordNotFoundErr, "order not found")
|
||||||
|
}
|
||||||
|
|
||||||
|
orderModel := gmodel.NewFsOrderModel(l.svcCtx.MysqlConn)
|
||||||
|
orderInfo, err := orderModel.FindOne(l.ctx, userinfo.UserId, req.ID)
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
if errors.Is(err, gorm.ErrRecordNotFound) {
|
||||||
|
return resp.SetStatusWithMessage(basic.CodeDbRecordNotFoundErr, "order not found")
|
||||||
|
}
|
||||||
|
logx.Error(err)
|
||||||
|
return resp.SetStatusWithMessage(basic.CodeServiceErr, "failed to get order info")
|
||||||
|
}
|
||||||
|
|
||||||
|
updateStatusMap := make(map[constants.Order]struct{}, 4)
|
||||||
|
updateStatusMap[constants.STATUS_NEW_COMPLETED] = struct{}{}
|
||||||
|
updateStatusMap[constants.STATUS_NEW_CANCEL] = struct{}{}
|
||||||
|
updateStatusMap[constants.STATUS_NEW_REFUNDED] = struct{}{}
|
||||||
|
updateStatusMap[constants.STATUS_NEW_CLOSE] = struct{}{}
|
||||||
|
if _, ok := updateStatusMap[constants.Order(*orderInfo.Status)]; !ok {
|
||||||
|
return resp.SetStatusWithMessage(basic.CodeDbRecordNotFoundErr, "order not found")
|
||||||
|
}
|
||||||
|
*orderInfo.Status = int64(constants.STATUS_NEW_DELETE)
|
||||||
|
*orderInfo.IsDeleted = 1
|
||||||
|
err = orderModel.Update(l.ctx, orderInfo)
|
||||||
|
if err != nil {
|
||||||
|
logx.Error(err)
|
||||||
|
return resp.SetStatusWithMessage(basic.CodeServiceErr, "fail to delete")
|
||||||
|
}
|
||||||
|
|
||||||
|
return resp.SetStatus(basic.CodeOK)
|
||||||
|
}
|
||||||
@ -2,10 +2,14 @@ package logic
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
|
"fmt"
|
||||||
"fusenapi/constants"
|
"fusenapi/constants"
|
||||||
"fusenapi/model/gmodel"
|
"fusenapi/model/gmodel"
|
||||||
"fusenapi/utils/auth"
|
"fusenapi/utils/auth"
|
||||||
"fusenapi/utils/basic"
|
"fusenapi/utils/basic"
|
||||||
|
"fusenapi/utils/configs"
|
||||||
|
"fusenapi/utils/image"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"fusenapi/utils/format"
|
"fusenapi/utils/format"
|
||||||
"fusenapi/utils/order"
|
"fusenapi/utils/order"
|
||||||
@ -39,7 +43,15 @@ func (l *UserOrderListLogic) UserOrderList(req *types.UserOrderListReq, userinfo
|
|||||||
// 返回值必须调用Set重新返回, resp可以空指针调用 resp.SetStatus(basic.CodeOK, data)
|
// 返回值必须调用Set重新返回, resp可以空指针调用 resp.SetStatus(basic.CodeOK, data)
|
||||||
// userinfo 传入值时, 一定不为null
|
// userinfo 传入值时, 一定不为null
|
||||||
|
|
||||||
|
size := req.Size
|
||||||
|
|
||||||
|
if size > 0 {
|
||||||
|
size = int64(image.GetCurrentSize(uint32(size)))
|
||||||
|
}
|
||||||
|
|
||||||
orderDetailModel := gmodel.NewFsOrderDetailModel(l.svcCtx.MysqlConn)
|
orderDetailModel := gmodel.NewFsOrderDetailModel(l.svcCtx.MysqlConn)
|
||||||
|
orderDetailTemplateModel := gmodel.NewFsOrderDetailTemplateModel(l.svcCtx.MysqlConn)
|
||||||
|
fsProductDesignModel := gmodel.NewFsProductDesignModel(l.svcCtx.MysqlConn)
|
||||||
orderModel := gmodel.NewFsOrderModel(l.svcCtx.MysqlConn)
|
orderModel := gmodel.NewFsOrderModel(l.svcCtx.MysqlConn)
|
||||||
rowBuilder := orderModel.RowSelectBuilder(nil)
|
rowBuilder := orderModel.RowSelectBuilder(nil)
|
||||||
if userinfo == nil || userinfo.UserId == 0 {
|
if userinfo == nil || userinfo.UserId == 0 {
|
||||||
@ -50,10 +62,39 @@ func (l *UserOrderListLogic) UserOrderList(req *types.UserOrderListReq, userinfo
|
|||||||
var page = req.Page
|
var page = req.Page
|
||||||
var pageSize = req.PageSize
|
var pageSize = req.PageSize
|
||||||
var listRes []*gmodel.FsOrderRel
|
var listRes []*gmodel.FsOrderRel
|
||||||
rowBuilder = rowBuilder.Where("user_id =?", userinfo.UserId)
|
rowBuilder = rowBuilder.Where("user_id =?", userinfo.UserId).Where("status <> ?", constants.STATUS_NEW_NOT_PAY).Where("status <>?", constants.STATUS_NEW_DELETE)
|
||||||
|
|
||||||
|
// 根据时间来查询不同范围的订单
|
||||||
|
switch req.Time {
|
||||||
|
case 1:
|
||||||
|
rowBuilder = rowBuilder.Where("ctime >?", time.Now().AddDate(0, -1, 0).Unix())
|
||||||
|
case 2:
|
||||||
|
rowBuilder = rowBuilder.Where("ctime >?", time.Now().AddDate(0, -3, 0).Unix())
|
||||||
|
case 3:
|
||||||
|
rowBuilder = rowBuilder.Where("ctime >?", time.Now().AddDate(0, -6, 0).Unix())
|
||||||
|
case 4:
|
||||||
|
rowBuilder = rowBuilder.Where("ctime >?", time.Now().AddDate(-1, 0, 0).Unix())
|
||||||
|
default:
|
||||||
|
}
|
||||||
|
|
||||||
|
//按照订单状态查询不同的订单
|
||||||
if req.Status != -1 {
|
if req.Status != -1 {
|
||||||
rowBuilder = rowBuilder.Where("status = ?", req.Status)
|
switch req.Status {
|
||||||
|
case 1:
|
||||||
|
rowBuilder = rowBuilder.Where("status in ?", [3]constants.Order{constants.STATUS_NEW_PART_PAY, constants.STATUS_NEW_PAY_COMPLETED, constants.STATUS_NEW_SURE})
|
||||||
|
case 2:
|
||||||
|
rowBuilder = rowBuilder.Where("status in ?", [2]constants.Order{constants.STATUS_NEW_PRODUTING, constants.STATUS_NEW_PRODUT_COMPLETED})
|
||||||
|
case 3:
|
||||||
|
rowBuilder = rowBuilder.Where("status in ?", [2]constants.Order{constants.STATUS_NEW_DELIVER, constants.STATUS_NEW_UPS})
|
||||||
|
case 4:
|
||||||
|
rowBuilder = rowBuilder.Where("status =?", constants.STATUS_NEW_ARRIVAL)
|
||||||
|
case 5:
|
||||||
|
rowBuilder = rowBuilder.Where("status =?", constants.STATUS_NEW_COMPLETED).Where("delivery_method =?", constants.DELIVERY_METHOD_ADDRESS)
|
||||||
|
case 7:
|
||||||
|
rowBuilder = rowBuilder.Where("status in ?", [3]constants.Order{constants.STATUS_NEW_CANCEL, constants.STATUS_NEW_REFUNDED, constants.STATUS_NEW_REFUNDING})
|
||||||
|
case 8:
|
||||||
|
rowBuilder = rowBuilder.Where("status =?", constants.STATUS_NEW_COMPLETED).Where("delivery_method =?", constants.DELIVERY_METHOD_CLOUD)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 查询总数
|
// 查询总数
|
||||||
@ -69,7 +110,11 @@ func (l *UserOrderListLogic) UserOrderList(req *types.UserOrderListReq, userinfo
|
|||||||
// 查询数据
|
// 查询数据
|
||||||
if total > 0 {
|
if total > 0 {
|
||||||
rowBuilder = rowBuilder.Preload("FsOrderAffiliateInfo").Preload("FsOrderDetails", func(dbPreload *gorm.DB) *gorm.DB {
|
rowBuilder = rowBuilder.Preload("FsOrderAffiliateInfo").Preload("FsOrderDetails", func(dbPreload *gorm.DB) *gorm.DB {
|
||||||
return dbPreload.Table(orderDetailModel.TableName()).Preload("FsOrderDetailTemplateInfo").Preload("FsProductInfo")
|
return dbPreload.Table(orderDetailModel.TableName()).Preload("FsOrderDetailTemplateInfo", func(dbPreload *gorm.DB) *gorm.DB {
|
||||||
|
return dbPreload.Table(orderDetailTemplateModel.TableName()).Preload("FsProductDesignInfo", func(dbPreload *gorm.DB) *gorm.DB {
|
||||||
|
return dbPreload.Table(fsProductDesignModel.TableName()).Preload("OptionData").Preload("TemplateData")
|
||||||
|
}).Preload("FsProductSizeInfo")
|
||||||
|
}).Preload("FsProductInfo")
|
||||||
})
|
})
|
||||||
listRes, err = orderModel.FindPageListByPage(l.ctx, rowBuilder, &page, &pageSize, nil, "")
|
listRes, err = orderModel.FindPageListByPage(l.ctx, rowBuilder, &page, &pageSize, nil, "")
|
||||||
}
|
}
|
||||||
@ -86,10 +131,10 @@ func (l *UserOrderListLogic) UserOrderList(req *types.UserOrderListReq, userinfo
|
|||||||
var respList []types.Items
|
var respList []types.Items
|
||||||
if listResLen > 0 {
|
if listResLen > 0 {
|
||||||
// 获取订单时间配置
|
// 获取订单时间配置
|
||||||
// orderTimeConfig, err := configs.GetOrderTimeConfig(l.ctx, l.svcCtx.MysqlConn)
|
orderTimeConfig, err := configs.GetOrderTimeConfig(l.ctx, l.svcCtx.MysqlConn)
|
||||||
// if err != nil {
|
if err != nil {
|
||||||
// return resp.SetStatusWithMessage(basic.CodeServiceErr, "failed to get config time info")
|
return resp.SetStatusWithMessage(basic.CodeServiceErr, "failed to get config time info")
|
||||||
// }
|
}
|
||||||
|
|
||||||
// 数据处理
|
// 数据处理
|
||||||
for _, item := range listRes {
|
for _, item := range listRes {
|
||||||
@ -107,7 +152,7 @@ func (l *UserOrderListLogic) UserOrderList(req *types.UserOrderListReq, userinfo
|
|||||||
|
|
||||||
var pcsBox int64
|
var pcsBox int64
|
||||||
var pcs int64
|
var pcs int64
|
||||||
var productList []*types.Product
|
var productList []types.Product
|
||||||
|
|
||||||
var surplusAt int64
|
var surplusAt int64
|
||||||
|
|
||||||
@ -121,27 +166,49 @@ func (l *UserOrderListLogic) UserOrderList(req *types.UserOrderListReq, userinfo
|
|||||||
|
|
||||||
fsOrderAffiliateInfo := item.FsOrderAffiliateInfo
|
fsOrderAffiliateInfo := item.FsOrderAffiliateInfo
|
||||||
|
|
||||||
statusAndLogisticsRes := order.GetOrderStatusAndLogistics(order.GetOrderStatusAndLogisticsReq{
|
var sureTime int64
|
||||||
|
var productTime int64
|
||||||
|
var ProductEndtime int64
|
||||||
|
var deliverTime int64
|
||||||
|
var upsDeliverTime int64
|
||||||
|
var upsTime int64
|
||||||
|
var arrivalTime int64
|
||||||
|
var recevieTime int64
|
||||||
|
if fsOrderAffiliateInfo.Id > 0 {
|
||||||
|
sureTime = *fsOrderAffiliateInfo.SureTime
|
||||||
|
productTime = *fsOrderAffiliateInfo.ProductTime
|
||||||
|
ProductEndtime = *fsOrderAffiliateInfo.ProductEndtime
|
||||||
|
deliverTime = *fsOrderAffiliateInfo.DeliverTime
|
||||||
|
upsDeliverTime = *fsOrderAffiliateInfo.UpsDeliverTime
|
||||||
|
upsTime = *fsOrderAffiliateInfo.UpsTime
|
||||||
|
arrivalTime = *fsOrderAffiliateInfo.ArrivalTime
|
||||||
|
recevieTime = *fsOrderAffiliateInfo.RecevieTime
|
||||||
|
}
|
||||||
|
|
||||||
|
var getOrderStatusAndLogisticsReq = order.GetOrderStatusAndLogisticsReq{
|
||||||
OrderStatus: constants.Order(*item.Status),
|
OrderStatus: constants.Order(*item.Status),
|
||||||
DeliveryMethod: constants.DeliveryMethod(*item.DeliveryMethod),
|
DeliveryMethod: constants.DeliveryMethod(*item.DeliveryMethod),
|
||||||
IsPayCompleted: *item.IsAllProductCompleted,
|
IsPayCompleted: *item.IsAllProductCompleted,
|
||||||
SureTime: *fsOrderAffiliateInfo.SureTime,
|
OrderCtime: *item.Ctime,
|
||||||
ProductTime: *fsOrderAffiliateInfo.SureTime,
|
|
||||||
ProductEndtime: *fsOrderAffiliateInfo.SureTime,
|
|
||||||
DeliverTime: *fsOrderAffiliateInfo.SureTime,
|
|
||||||
UpsDeliverTime: *fsOrderAffiliateInfo.SureTime,
|
|
||||||
UpsTime: *fsOrderAffiliateInfo.SureTime,
|
|
||||||
ArrivalTime: *fsOrderAffiliateInfo.SureTime,
|
|
||||||
RecevieTime: *fsOrderAffiliateInfo.SureTime,
|
|
||||||
|
|
||||||
OrderCtime: *item.Ctime,
|
SureTime: sureTime,
|
||||||
//WebSetTimeInfo: orderTimeConfig,
|
ProductTime: productTime,
|
||||||
})
|
ProductEndtime: ProductEndtime,
|
||||||
|
DeliverTime: deliverTime,
|
||||||
|
UpsDeliverTime: upsDeliverTime,
|
||||||
|
UpsTime: upsTime,
|
||||||
|
ArrivalTime: arrivalTime,
|
||||||
|
RecevieTime: recevieTime,
|
||||||
|
|
||||||
|
WebSetTimeInfo: orderTimeConfig,
|
||||||
|
}
|
||||||
|
|
||||||
|
statusAndLogisticsRes := order.GetOrderStatusAndLogistics(getOrderStatusAndLogisticsReq)
|
||||||
|
|
||||||
// 流程控制
|
// 流程控制
|
||||||
statusTime := make([]*types.StatusTime, 5)
|
var statusTime []types.StatusTime
|
||||||
for _, itemTimes := range statusAndLogisticsRes.Times {
|
for _, itemTimes := range statusAndLogisticsRes.Times {
|
||||||
statusTime = append(statusTime, &types.StatusTime{
|
statusTime = append(statusTime, types.StatusTime{
|
||||||
Key: itemTimes.Key,
|
Key: itemTimes.Key,
|
||||||
Time: itemTimes.Time,
|
Time: itemTimes.Time,
|
||||||
})
|
})
|
||||||
@ -150,8 +217,10 @@ func (l *UserOrderListLogic) UserOrderList(req *types.UserOrderListReq, userinfo
|
|||||||
pbData.LogisticsStatus = int64(statusAndLogisticsRes.LogisticsStatus)
|
pbData.LogisticsStatus = int64(statusAndLogisticsRes.LogisticsStatus)
|
||||||
pbData.Status = int64(statusAndLogisticsRes.OrderStatus)
|
pbData.Status = int64(statusAndLogisticsRes.OrderStatus)
|
||||||
|
|
||||||
|
var isStopMax int64
|
||||||
if len(item.FsOrderDetails) > 0 {
|
if len(item.FsOrderDetails) > 0 {
|
||||||
for _, fsOrderDetailItem := range item.FsOrderDetails {
|
for _, fsOrderDetailItem := range item.FsOrderDetails {
|
||||||
|
|
||||||
fsOrderDetailBuyNum := *fsOrderDetailItem.FsOrderDetail.BuyNum
|
fsOrderDetailBuyNum := *fsOrderDetailItem.FsOrderDetail.BuyNum
|
||||||
fsOrderDetailEachBoxNum := *fsOrderDetailItem.FsOrderDetailTemplateInfo.EachBoxNum
|
fsOrderDetailEachBoxNum := *fsOrderDetailItem.FsOrderDetailTemplateInfo.EachBoxNum
|
||||||
pcs = pcs + fsOrderDetailBuyNum
|
pcs = pcs + fsOrderDetailBuyNum
|
||||||
@ -162,23 +231,58 @@ func (l *UserOrderListLogic) UserOrderList(req *types.UserOrderListReq, userinfo
|
|||||||
}
|
}
|
||||||
pcsBox = pcsBox + pcsBoxNum + csBoxNumF
|
pcsBox = pcsBox + pcsBoxNum + csBoxNumF
|
||||||
|
|
||||||
var product types.Product
|
productCover := *fsOrderDetailItem.Cover
|
||||||
product.Cover = *fsOrderDetailItem.Cover
|
// 尺寸
|
||||||
product.Fitting = *fsOrderDetailItem.OptionalTitle
|
if size >= 200 {
|
||||||
product.OptionPrice = *fsOrderDetailItem.OptionPrice
|
coverArr := strings.Split(*fsOrderDetailItem.Cover, ".")
|
||||||
product.OrderDetailTemplateId = *fsOrderDetailItem.OrderDetailTemplateId
|
if len(coverArr) < 2 {
|
||||||
product.OrderId = *fsOrderDetailItem.OrderId
|
return resp.SetStatusWithMessage(basic.CodeServiceErr, "cover split slice item count is less than 2")
|
||||||
product.Pcs = fsOrderDetailBuyNum
|
}
|
||||||
product.PcsBox = pcsBox
|
productCover = fmt.Sprintf("%s_%d.%s", coverArr[0], req.Size, coverArr[1])
|
||||||
product.Price = *fsOrderDetailItem.FsOrderDetail.Amount
|
}
|
||||||
product.ProductId = *fsOrderDetailItem.OptionPrice
|
|
||||||
product.Title = *fsOrderDetailItem.FsProductInfo.Title
|
|
||||||
|
|
||||||
productList = append(productList, &product)
|
// 判断stop
|
||||||
|
var isStop int64
|
||||||
|
if fsOrderDetailItem.FsOrderDetailTemplateInfo.FsProductDesignInfo.OptionData.Id != 0 {
|
||||||
|
// 尺寸或者模板下架
|
||||||
|
if fsOrderDetailItem.FsOrderDetailTemplateInfo.FsProductDesignInfo.Id != 0 {
|
||||||
|
isStop = 1
|
||||||
|
} else {
|
||||||
|
isStop = 3
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if fsOrderDetailItem.FsOrderDetailTemplateInfo.FsProductDesignInfo.Id != 0 {
|
||||||
|
isStop = 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 判断产品是否下架
|
||||||
|
if *fsOrderDetailItem.FsProductInfo.IsShelf == 0 || *fsOrderDetailItem.FsProductInfo.IsDel == 1 {
|
||||||
|
isStop = 2
|
||||||
|
}
|
||||||
|
if isStop > isStopMax {
|
||||||
|
isStopMax = isStop
|
||||||
|
}
|
||||||
|
|
||||||
|
productList = append(productList, types.Product{
|
||||||
|
Cover: productCover,
|
||||||
|
Fitting: *fsOrderDetailItem.OptionalTitle,
|
||||||
|
OptionPrice: *fsOrderDetailItem.OptionPrice,
|
||||||
|
OrderDetailTemplateId: *fsOrderDetailItem.OrderDetailTemplateId,
|
||||||
|
OrderId: *fsOrderDetailItem.OrderId,
|
||||||
|
Pcs: fsOrderDetailBuyNum,
|
||||||
|
PcsBox: pcsBox,
|
||||||
|
Price: *fsOrderDetailItem.FsOrderDetail.Amount,
|
||||||
|
ProductId: *fsOrderDetailItem.OptionPrice,
|
||||||
|
Title: *fsOrderDetailItem.FsProductInfo.Title,
|
||||||
|
Size: *fsOrderDetailItem.FsOrderDetailTemplateInfo.FsProductSizeInfo.Capacity,
|
||||||
|
IsStop: isStop,
|
||||||
|
})
|
||||||
}
|
}
|
||||||
pbData.ProductList = productList
|
pbData.ProductList = productList
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pbData.IsStop = isStopMax
|
||||||
pbData.PcsBox = pcsBox
|
pbData.PcsBox = pcsBox
|
||||||
pbData.Pcs = pcs
|
pbData.Pcs = pcs
|
||||||
pbData.SurplusAt = surplusAt
|
pbData.SurplusAt = surplusAt
|
||||||
|
|||||||
@ -4,6 +4,7 @@ import (
|
|||||||
"fusenapi/fsm"
|
"fusenapi/fsm"
|
||||||
"fusenapi/initalize"
|
"fusenapi/initalize"
|
||||||
"fusenapi/model/gmodel"
|
"fusenapi/model/gmodel"
|
||||||
|
"fusenapi/utils/autoconfig"
|
||||||
|
|
||||||
"github.com/golang-jwt/jwt"
|
"github.com/golang-jwt/jwt"
|
||||||
"gorm.io/gorm"
|
"gorm.io/gorm"
|
||||||
@ -16,7 +17,7 @@ import (
|
|||||||
|
|
||||||
type ServiceContext struct {
|
type ServiceContext struct {
|
||||||
Config config.Config
|
Config config.Config
|
||||||
SharedState *fsm.StateCluster
|
SharedState *fsm.FsStateMachine
|
||||||
|
|
||||||
MysqlConn *gorm.DB
|
MysqlConn *gorm.DB
|
||||||
AllModels *gmodel.AllModelsGen
|
AllModels *gmodel.AllModelsGen
|
||||||
@ -24,7 +25,7 @@ type ServiceContext struct {
|
|||||||
|
|
||||||
func NewServiceContext(c config.Config) *ServiceContext {
|
func NewServiceContext(c config.Config) *ServiceContext {
|
||||||
conn := initalize.InitMysql(c.SourceMysql)
|
conn := initalize.InitMysql(c.SourceMysql)
|
||||||
StateServer := fsm.StartNode(c.Name, fmt.Sprintf("%s:%d", c.Host, c.Port-2000), conn)
|
StateServer := fsm.StartNode(c.Name, fmt.Sprintf("%s:%d", c.Host, c.Port-2000), autoconfig.AutoGetAllServerConfig(), conn)
|
||||||
|
|
||||||
return &ServiceContext{
|
return &ServiceContext{
|
||||||
Config: c,
|
Config: c,
|
||||||
|
|||||||
@ -5,6 +5,13 @@ import (
|
|||||||
"fusenapi/utils/basic"
|
"fusenapi/utils/basic"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type UserOrderDeleteReq struct {
|
||||||
|
ID int64 `form:"id"` //订单id
|
||||||
|
}
|
||||||
|
|
||||||
|
type UserOrderDeleteRes struct {
|
||||||
|
}
|
||||||
|
|
||||||
type UserOrderCancelReq struct {
|
type UserOrderCancelReq struct {
|
||||||
ID int64 `form:"id"` //订单id
|
ID int64 `form:"id"` //订单id
|
||||||
RefundReasonId int64 `form:"refund_reason_id"` //退款配置id
|
RefundReasonId int64 `form:"refund_reason_id"` //退款配置id
|
||||||
@ -29,25 +36,25 @@ type UserOrderListRsp struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type Items struct {
|
type Items struct {
|
||||||
ID int64 `json:"id"`
|
ID int64 `json:"id"`
|
||||||
Sn string `json:"sn"`
|
Sn string `json:"sn"`
|
||||||
UserID int64 `json:"user_id"`
|
UserID int64 `json:"user_id"`
|
||||||
TotalAmount int64 `json:"total_amount"`
|
TotalAmount int64 `json:"total_amount"`
|
||||||
Ctime string `json:"ctime"`
|
Ctime string `json:"ctime"`
|
||||||
Status int64 `json:"status"`
|
Status int64 `json:"status"`
|
||||||
DeliveryMethod int64 `json:"delivery_method"`
|
DeliveryMethod int64 `json:"delivery_method"`
|
||||||
TsTime string `json:"ts_time"`
|
TsTime string `json:"ts_time"`
|
||||||
IsPayCompleted int64 `json:"is_pay_completed"`
|
IsPayCompleted int64 `json:"is_pay_completed"`
|
||||||
DeliverSn string `json:"deliver_sn"`
|
DeliverSn string `json:"deliver_sn"`
|
||||||
PcsBox int64 `json:"pcs_box"`
|
PcsBox int64 `json:"pcs_box"`
|
||||||
Pcs int64 `json:"pcs"`
|
Pcs int64 `json:"pcs"`
|
||||||
SurplusAt int64 `json:"surplus_at"`
|
SurplusAt int64 `json:"surplus_at"`
|
||||||
LogisticsStatus int64 `json:"logistics_status"`
|
LogisticsStatus int64 `json:"logistics_status"`
|
||||||
StatusTimes []*StatusTime `json:"status_times"`
|
StatusTimes []StatusTime `json:"status_times"`
|
||||||
Deposit int64 `json:"deposit"`
|
Deposit int64 `json:"deposit"`
|
||||||
Remaining int64 `json:"remaining"`
|
Remaining int64 `json:"remaining"`
|
||||||
ProductList []*Product `json:"productList"`
|
ProductList []Product `json:"productList"`
|
||||||
IsStop int64 `json:"is_stop"`
|
IsStop int64 `json:"is_stop"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type StatusTime struct {
|
type StatusTime struct {
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
Name: inventory
|
Name: inventory
|
||||||
Host: localhost
|
Host: localhost
|
||||||
Port: 9905
|
Port: 9905
|
||||||
|
ReplicaId: 30
|
||||||
SourceMysql: fusentest:XErSYmLELKMnf3Dh@tcp(110.41.19.98:3306)/fusentest
|
SourceMysql: fusentest:XErSYmLELKMnf3Dh@tcp(110.41.19.98:3306)/fusentest
|
||||||
Auth:
|
Auth:
|
||||||
AccessSecret: fusen2023
|
AccessSecret: fusen2023
|
||||||
|
|||||||
@ -15,7 +15,7 @@ func GetCloudListHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
|||||||
return func(w http.ResponseWriter, r *http.Request) {
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
var req types.GetCloudListReq
|
var req types.GetCloudListReq
|
||||||
userinfo, err := basic.RequestParse(w, r, svcCtx, &req)
|
userinfo, err := basic.RequestParse(w, r, svcCtx.SharedState, &req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@ -15,7 +15,7 @@ func GetPickupListHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
|||||||
return func(w http.ResponseWriter, r *http.Request) {
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
var req types.GetPickupListReq
|
var req types.GetPickupListReq
|
||||||
userinfo, err := basic.RequestParse(w, r, svcCtx, &req)
|
userinfo, err := basic.RequestParse(w, r, svcCtx.SharedState, &req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@ -15,7 +15,7 @@ func SupplementHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
|||||||
return func(w http.ResponseWriter, r *http.Request) {
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
var req types.SupplementReq
|
var req types.SupplementReq
|
||||||
userinfo, err := basic.RequestParse(w, r, svcCtx, &req)
|
userinfo, err := basic.RequestParse(w, r, svcCtx.SharedState, &req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@ -15,7 +15,7 @@ func TakeHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
|||||||
return func(w http.ResponseWriter, r *http.Request) {
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
var req types.TakeReq
|
var req types.TakeReq
|
||||||
userinfo, err := basic.RequestParse(w, r, svcCtx, &req)
|
userinfo, err := basic.RequestParse(w, r, svcCtx.SharedState, &req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,6 +5,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"fusenapi/fsm"
|
"fusenapi/fsm"
|
||||||
"fusenapi/server/inventory/internal/config"
|
"fusenapi/server/inventory/internal/config"
|
||||||
|
"fusenapi/utils/autoconfig"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"fusenapi/initalize"
|
"fusenapi/initalize"
|
||||||
@ -16,7 +17,7 @@ import (
|
|||||||
|
|
||||||
type ServiceContext struct {
|
type ServiceContext struct {
|
||||||
Config config.Config
|
Config config.Config
|
||||||
SharedState *fsm.StateCluster
|
SharedState *fsm.FsStateMachine
|
||||||
|
|
||||||
MysqlConn *gorm.DB
|
MysqlConn *gorm.DB
|
||||||
AllModels *gmodel.AllModelsGen
|
AllModels *gmodel.AllModelsGen
|
||||||
@ -24,7 +25,7 @@ type ServiceContext struct {
|
|||||||
|
|
||||||
func NewServiceContext(c config.Config) *ServiceContext {
|
func NewServiceContext(c config.Config) *ServiceContext {
|
||||||
conn := initalize.InitMysql(c.SourceMysql)
|
conn := initalize.InitMysql(c.SourceMysql)
|
||||||
StateServer := fsm.StartNode(c.Name, fmt.Sprintf("%s:%d", c.Host, c.Port-2000), conn)
|
StateServer := fsm.StartNode(c.Name, fmt.Sprintf("%s:%d", c.Host, c.Port-2000), autoconfig.AutoGetAllServerConfig(), conn)
|
||||||
|
|
||||||
return &ServiceContext{
|
return &ServiceContext{
|
||||||
Config: c,
|
Config: c,
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
Name: map-library
|
Name: map-library
|
||||||
Host: localhost
|
Host: localhost
|
||||||
Port: 9906
|
Port: 9906
|
||||||
|
ReplicaId: 35
|
||||||
SourceMysql: fusentest:XErSYmLELKMnf3Dh@tcp(110.41.19.98:3306)/fusentest
|
SourceMysql: fusentest:XErSYmLELKMnf3Dh@tcp(110.41.19.98:3306)/fusentest
|
||||||
Auth:
|
Auth:
|
||||||
AccessSecret: fusen2023
|
AccessSecret: fusen2023
|
||||||
|
|||||||
@ -15,7 +15,7 @@ func GetMapLibraryListHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
|||||||
return func(w http.ResponseWriter, r *http.Request) {
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
var req types.Request
|
var req types.Request
|
||||||
userinfo, err := basic.RequestParse(w, r, svcCtx, &req)
|
userinfo, err := basic.RequestParse(w, r, svcCtx.SharedState, &req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@ -15,7 +15,7 @@ func SaveMapLibraryHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
|||||||
return func(w http.ResponseWriter, r *http.Request) {
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
var req types.Request
|
var req types.Request
|
||||||
userinfo, err := basic.RequestParse(w, r, svcCtx, &req)
|
userinfo, err := basic.RequestParse(w, r, svcCtx.SharedState, &req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,6 +5,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"fusenapi/fsm"
|
"fusenapi/fsm"
|
||||||
"fusenapi/server/map-library/internal/config"
|
"fusenapi/server/map-library/internal/config"
|
||||||
|
"fusenapi/utils/autoconfig"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"fusenapi/initalize"
|
"fusenapi/initalize"
|
||||||
@ -16,7 +17,7 @@ import (
|
|||||||
|
|
||||||
type ServiceContext struct {
|
type ServiceContext struct {
|
||||||
Config config.Config
|
Config config.Config
|
||||||
SharedState *fsm.StateCluster
|
SharedState *fsm.FsStateMachine
|
||||||
|
|
||||||
MysqlConn *gorm.DB
|
MysqlConn *gorm.DB
|
||||||
AllModels *gmodel.AllModelsGen
|
AllModels *gmodel.AllModelsGen
|
||||||
@ -24,7 +25,7 @@ type ServiceContext struct {
|
|||||||
|
|
||||||
func NewServiceContext(c config.Config) *ServiceContext {
|
func NewServiceContext(c config.Config) *ServiceContext {
|
||||||
conn := initalize.InitMysql(c.SourceMysql)
|
conn := initalize.InitMysql(c.SourceMysql)
|
||||||
StateServer := fsm.StartNode(c.Name, fmt.Sprintf("%s:%d", c.Host, c.Port-2000), conn)
|
StateServer := fsm.StartNode(c.Name, fmt.Sprintf("%s:%d", c.Host, c.Port-2000), autoconfig.AutoGetAllServerConfig(), conn)
|
||||||
|
|
||||||
return &ServiceContext{
|
return &ServiceContext{
|
||||||
Config: c,
|
Config: c,
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
Name: orders
|
Name: orders
|
||||||
Host: localhost
|
Host: localhost
|
||||||
Port: 9907
|
Port: 9907
|
||||||
|
ReplicaId: 40
|
||||||
SourceMysql: fusentest:XErSYmLELKMnf3Dh@tcp(110.41.19.98:3306)/fusentest
|
SourceMysql: fusentest:XErSYmLELKMnf3Dh@tcp(110.41.19.98:3306)/fusentest
|
||||||
Auth:
|
Auth:
|
||||||
AccessSecret: fusen2023
|
AccessSecret: fusen2023
|
||||||
|
|||||||
@ -15,7 +15,7 @@ func GetOrderDetailHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
|||||||
return func(w http.ResponseWriter, r *http.Request) {
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
var req types.GetOrderDetailReq
|
var req types.GetOrderDetailReq
|
||||||
userinfo, err := basic.RequestParse(w, r, svcCtx, &req)
|
userinfo, err := basic.RequestParse(w, r, svcCtx.SharedState, &req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@ -15,7 +15,7 @@ func GetOrderInvoiceHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
|||||||
return func(w http.ResponseWriter, r *http.Request) {
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
var req types.GetOrderInvoiceReq
|
var req types.GetOrderInvoiceReq
|
||||||
userinfo, err := basic.RequestParse(w, r, svcCtx, &req)
|
userinfo, err := basic.RequestParse(w, r, svcCtx.SharedState, &req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@ -202,6 +202,7 @@ func (l *GetOrderDetailLogic) GetOrderDetail(req *types.GetOrderDetailReq, useri
|
|||||||
IsDefault: *addressInfo.IsDefault,
|
IsDefault: *addressInfo.IsDefault,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
data.PayInfo = &types.PayInfo{}
|
||||||
//首款
|
//首款
|
||||||
if payIndex, ok := mapPay[1]; ok {
|
if payIndex, ok := mapPay[1]; ok {
|
||||||
data.PayInfo.Deposit = types.Deposit{
|
data.PayInfo.Deposit = types.Deposit{
|
||||||
|
|||||||
@ -5,6 +5,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"fusenapi/fsm"
|
"fusenapi/fsm"
|
||||||
"fusenapi/server/orders/internal/config"
|
"fusenapi/server/orders/internal/config"
|
||||||
|
"fusenapi/utils/autoconfig"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"fusenapi/initalize"
|
"fusenapi/initalize"
|
||||||
@ -16,7 +17,7 @@ import (
|
|||||||
|
|
||||||
type ServiceContext struct {
|
type ServiceContext struct {
|
||||||
Config config.Config
|
Config config.Config
|
||||||
SharedState *fsm.StateCluster
|
SharedState *fsm.FsStateMachine
|
||||||
|
|
||||||
MysqlConn *gorm.DB
|
MysqlConn *gorm.DB
|
||||||
AllModels *gmodel.AllModelsGen
|
AllModels *gmodel.AllModelsGen
|
||||||
@ -24,7 +25,7 @@ type ServiceContext struct {
|
|||||||
|
|
||||||
func NewServiceContext(c config.Config) *ServiceContext {
|
func NewServiceContext(c config.Config) *ServiceContext {
|
||||||
conn := initalize.InitMysql(c.SourceMysql)
|
conn := initalize.InitMysql(c.SourceMysql)
|
||||||
StateServer := fsm.StartNode(c.Name, fmt.Sprintf("%s:%d", c.Host, c.Port-2000), conn)
|
StateServer := fsm.StartNode(c.Name, fmt.Sprintf("%s:%d", c.Host, c.Port-2000), autoconfig.AutoGetAllServerConfig(), conn)
|
||||||
|
|
||||||
return &ServiceContext{
|
return &ServiceContext{
|
||||||
Config: c,
|
Config: c,
|
||||||
|
|||||||
16
server/pay/etc/pay.yaml
Normal file
16
server/pay/etc/pay.yaml
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
Name: pay
|
||||||
|
Host: 0.0.0.0
|
||||||
|
Port: 9915
|
||||||
|
ReplicaId: 45
|
||||||
|
Timeout: 15000
|
||||||
|
SourceMysql: fusentest:XErSYmLELKMnf3Dh@tcp(110.41.19.98:3306)/fusentest
|
||||||
|
Auth:
|
||||||
|
AccessSecret: fusen2023
|
||||||
|
AccessExpire: 2592000
|
||||||
|
RefreshAfter: 1592000
|
||||||
|
PayConfig:
|
||||||
|
Stripe:
|
||||||
|
Key: "sk_test_51IisojHygnIJZeghPVSBhkwySfcyDV4SoAduIxu3J7bvSJ9cZMD96LY1LO6SpdbYquLJX5oKvgEBB67KT9pecfCy00iEC4pp9y"
|
||||||
|
EndpointSecret: "whsec_f5f9a121d43af3789db7459352f08cf523eb9e0fbf3381f91ba6c97c324c174d"
|
||||||
|
SuccessURL: "http://www.baidu.com"
|
||||||
|
CancelURL: "http://www.baidu.com"
|
||||||
21
server/pay/internal/config/config.go
Normal file
21
server/pay/internal/config/config.go
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
package config
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fusenapi/server/pay/internal/types"
|
||||||
|
|
||||||
|
"github.com/zeromicro/go-zero/rest"
|
||||||
|
)
|
||||||
|
|
||||||
|
type Config struct {
|
||||||
|
rest.RestConf
|
||||||
|
SourceMysql string
|
||||||
|
Auth types.Auth
|
||||||
|
PayConfig struct {
|
||||||
|
Stripe struct {
|
||||||
|
EndpointSecret string
|
||||||
|
Key string
|
||||||
|
CancelURL string
|
||||||
|
SuccessURL string
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
35
server/pay/internal/handler/orderpaymentintenthandler.go
Normal file
35
server/pay/internal/handler/orderpaymentintenthandler.go
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
package handler
|
||||||
|
|
||||||
|
import (
|
||||||
|
"net/http"
|
||||||
|
"reflect"
|
||||||
|
|
||||||
|
"fusenapi/utils/basic"
|
||||||
|
|
||||||
|
"fusenapi/server/pay/internal/logic"
|
||||||
|
"fusenapi/server/pay/internal/svc"
|
||||||
|
"fusenapi/server/pay/internal/types"
|
||||||
|
)
|
||||||
|
|
||||||
|
func OrderPaymentIntentHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||||
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
|
var req types.OrderPaymentIntentReq
|
||||||
|
userinfo, err := basic.RequestParse(w, r, svcCtx.SharedState, &req)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 创建一个业务逻辑层实例
|
||||||
|
l := logic.NewOrderPaymentIntentLogic(r.Context(), svcCtx)
|
||||||
|
|
||||||
|
rl := reflect.ValueOf(l)
|
||||||
|
basic.BeforeLogic(w, r, rl)
|
||||||
|
|
||||||
|
resp := l.OrderPaymentIntent(&req, userinfo)
|
||||||
|
|
||||||
|
if !basic.AfterLogic(w, r, rl, resp) {
|
||||||
|
basic.NormalAfterLogic(w, r, resp)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
27
server/pay/internal/handler/routes.go
Normal file
27
server/pay/internal/handler/routes.go
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
// Code generated by goctl. DO NOT EDIT.
|
||||||
|
package handler
|
||||||
|
|
||||||
|
import (
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
"fusenapi/server/pay/internal/svc"
|
||||||
|
|
||||||
|
"github.com/zeromicro/go-zero/rest"
|
||||||
|
)
|
||||||
|
|
||||||
|
func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
|
||||||
|
server.AddRoutes(
|
||||||
|
[]rest.Route{
|
||||||
|
{
|
||||||
|
Method: http.MethodPost,
|
||||||
|
Path: "/api/pay/payment-intent",
|
||||||
|
Handler: OrderPaymentIntentHandler(serverCtx),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
Method: http.MethodPost,
|
||||||
|
Path: "/api/pay/stripe-webhook",
|
||||||
|
Handler: StripeWebhookHandler(serverCtx),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
)
|
||||||
|
}
|
||||||
48
server/pay/internal/handler/stripewebhookhandler.go
Normal file
48
server/pay/internal/handler/stripewebhookhandler.go
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
package handler
|
||||||
|
|
||||||
|
import (
|
||||||
|
"io"
|
||||||
|
"net/http"
|
||||||
|
"reflect"
|
||||||
|
|
||||||
|
"fusenapi/utils/basic"
|
||||||
|
|
||||||
|
"fusenapi/server/pay/internal/logic"
|
||||||
|
"fusenapi/server/pay/internal/svc"
|
||||||
|
"fusenapi/server/pay/internal/types"
|
||||||
|
)
|
||||||
|
|
||||||
|
func StripeWebhookHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||||
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
|
const MaxBodyBytes = int64(65536)
|
||||||
|
r.Body = http.MaxBytesReader(w, r.Body, MaxBodyBytes)
|
||||||
|
defer r.Body.Close()
|
||||||
|
payload, err := io.ReadAll(r.Body)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
var req types.StripeWebhookReq
|
||||||
|
|
||||||
|
// userinfo, err := basic.RequestParse(w, r, svcCtx, &req)
|
||||||
|
// if err != nil {
|
||||||
|
// return
|
||||||
|
// }
|
||||||
|
|
||||||
|
req.Payload = payload
|
||||||
|
req.StripeSignature = r.Header.Get("Stripe-Signature")
|
||||||
|
|
||||||
|
// 创建一个业务逻辑层实例
|
||||||
|
l := logic.NewStripeWebhookLogic(r.Context(), svcCtx)
|
||||||
|
|
||||||
|
rl := reflect.ValueOf(l)
|
||||||
|
basic.BeforeLogic(w, r, rl)
|
||||||
|
|
||||||
|
resp := l.StripeWebhook(&req, nil)
|
||||||
|
|
||||||
|
if !basic.AfterLogic(w, r, rl, resp) {
|
||||||
|
basic.NormalAfterLogic(w, r, resp)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
186
server/pay/internal/logic/orderpaymentintentlogic.go
Normal file
186
server/pay/internal/logic/orderpaymentintentlogic.go
Normal file
@ -0,0 +1,186 @@
|
|||||||
|
package logic
|
||||||
|
|
||||||
|
import (
|
||||||
|
"errors"
|
||||||
|
"fusenapi/constants"
|
||||||
|
"fusenapi/model/gmodel"
|
||||||
|
"fusenapi/utils/auth"
|
||||||
|
"fusenapi/utils/basic"
|
||||||
|
"fusenapi/utils/pay"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"context"
|
||||||
|
|
||||||
|
"fusenapi/server/pay/internal/svc"
|
||||||
|
"fusenapi/server/pay/internal/types"
|
||||||
|
|
||||||
|
"github.com/zeromicro/go-zero/core/logx"
|
||||||
|
"gorm.io/gorm"
|
||||||
|
)
|
||||||
|
|
||||||
|
type OrderPaymentIntentLogic struct {
|
||||||
|
logx.Logger
|
||||||
|
ctx context.Context
|
||||||
|
svcCtx *svc.ServiceContext
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewOrderPaymentIntentLogic(ctx context.Context, svcCtx *svc.ServiceContext) *OrderPaymentIntentLogic {
|
||||||
|
return &OrderPaymentIntentLogic{
|
||||||
|
Logger: logx.WithContext(ctx),
|
||||||
|
ctx: ctx,
|
||||||
|
svcCtx: svcCtx,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 处理进入前逻辑w,r
|
||||||
|
// func (l *OrderPaymentIntentLogic) BeforeLogic(w http.ResponseWriter, r *http.Request) {
|
||||||
|
// }
|
||||||
|
|
||||||
|
// 处理逻辑后 w,r 如:重定向, resp 必须重新处理
|
||||||
|
// func (l *OrderPaymentIntentLogic) AfterLogic(w http.ResponseWriter, r *http.Request, resp *basic.Response) {
|
||||||
|
// // httpx.OkJsonCtx(r.Context(), w, resp)
|
||||||
|
// }
|
||||||
|
|
||||||
|
func (l *OrderPaymentIntentLogic) OrderPaymentIntent(req *types.OrderPaymentIntentReq, userinfo *auth.UserInfo) (resp *basic.Response) {
|
||||||
|
// 返回值必须调用Set重新返回, resp可以空指针调用 resp.SetStatus(basic.CodeOK, data)
|
||||||
|
// userinfo 传入值时, 一定不为null
|
||||||
|
|
||||||
|
if userinfo == nil || userinfo.UserId == 0 {
|
||||||
|
return resp.SetStatusWithMessage(basic.CodeDbRecordNotFoundErr, "order not found")
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询订单数据
|
||||||
|
orderModel := gmodel.NewFsOrderModel(l.svcCtx.MysqlConn)
|
||||||
|
orderInfo, err := orderModel.FindOneBySn(l.ctx, userinfo.UserId, req.Sn)
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
if errors.Is(err, gorm.ErrRecordNotFound) {
|
||||||
|
return resp.SetStatusWithMessage(basic.CodeDbRecordNotFoundErr, "order not found")
|
||||||
|
}
|
||||||
|
logx.Error(err)
|
||||||
|
return resp.SetStatusWithMessage(basic.CodeServiceErr, "failed to get order info")
|
||||||
|
}
|
||||||
|
|
||||||
|
// 校验订单状态
|
||||||
|
if *orderInfo.IsCancel == 1 {
|
||||||
|
return resp.SetStatusWithMessage(basic.CodeServiceErr, "order cancelled")
|
||||||
|
}
|
||||||
|
|
||||||
|
// 校验地址信息
|
||||||
|
addressModel := gmodel.NewFsAddressModel(l.svcCtx.MysqlConn)
|
||||||
|
_, err = addressModel.GetOne(l.ctx, req.AddressId, userinfo.UserId)
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
if errors.Is(err, gorm.ErrRecordNotFound) {
|
||||||
|
return resp.SetStatusWithMessage(basic.CodeDbRecordNotFoundErr, "address not found")
|
||||||
|
}
|
||||||
|
logx.Error(err)
|
||||||
|
return resp.SetStatusWithMessage(basic.CodeServiceErr, "failed to get address info")
|
||||||
|
}
|
||||||
|
|
||||||
|
// 校验订单支付信息
|
||||||
|
if *orderInfo.IsPayCompleted == 1 {
|
||||||
|
return resp.SetStatusWithMessage(basic.CodeServiceErr, "order is pay completed")
|
||||||
|
}
|
||||||
|
|
||||||
|
// 判断订单状态以及该支付金额
|
||||||
|
var nowAt int64 = time.Now().Unix()
|
||||||
|
var payAmount int64
|
||||||
|
if *orderInfo.Status == int64(constants.STATUS_NEW_NOT_PAY) {
|
||||||
|
payAmount = *orderInfo.TotalAmount / 2
|
||||||
|
*orderInfo.DeliveryMethod = req.DeliveryMethod
|
||||||
|
*orderInfo.AddressId = req.AddressId
|
||||||
|
*orderInfo.PayMethod = req.PayMethod
|
||||||
|
} else {
|
||||||
|
payAmount = *orderInfo.TotalAmount - *orderInfo.TotalAmount/2
|
||||||
|
}
|
||||||
|
|
||||||
|
payConfig := &pay.Config{}
|
||||||
|
var generatePrepaymentReq = &pay.GeneratePrepaymentReq{
|
||||||
|
OrderSn: req.Sn,
|
||||||
|
ProductName: "支付标题",
|
||||||
|
Amount: payAmount,
|
||||||
|
Currency: "eur",
|
||||||
|
Quantity: 1,
|
||||||
|
ProductDescription: "支付描述",
|
||||||
|
}
|
||||||
|
|
||||||
|
var resData types.OrderPaymentIntentRes
|
||||||
|
// 事务处理
|
||||||
|
err = orderModel.Trans(l.ctx, func(ctx context.Context, connGorm *gorm.DB) error {
|
||||||
|
// 支付记录--处理 //支付记录改为一条订单多条,分首款尾款
|
||||||
|
var payStatus int64 = 0
|
||||||
|
var orderSource int64 = 1
|
||||||
|
var payStage int64
|
||||||
|
var fspay *gmodel.FsPay
|
||||||
|
newFsPayModel := gmodel.NewFsPayModel(connGorm)
|
||||||
|
if *orderInfo.Status == int64(constants.STATUS_NEW_NOT_PAY) {
|
||||||
|
fspay, err = newFsPayModel.GetListByOrderNumberStage(ctx, *orderInfo.Sn, 1)
|
||||||
|
if err != nil {
|
||||||
|
if !errors.Is(err, gorm.ErrRecordNotFound) {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
payStage = 1
|
||||||
|
} else {
|
||||||
|
fspay, err = newFsPayModel.GetListByOrderNumberStage(ctx, *orderInfo.Sn, 2)
|
||||||
|
if err != nil {
|
||||||
|
if !errors.Is(err, gorm.ErrRecordNotFound) {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
payStage = 2
|
||||||
|
}
|
||||||
|
|
||||||
|
// 支付预付--生成
|
||||||
|
if constants.PayMethod(req.PayMethod) == constants.PAYMETHOD_STRIPE {
|
||||||
|
payConfig.Stripe.Key = l.svcCtx.Config.PayConfig.Stripe.Key
|
||||||
|
generatePrepaymentReq.SuccessURL = l.svcCtx.Config.PayConfig.Stripe.SuccessURL
|
||||||
|
generatePrepaymentReq.CancelURL = l.svcCtx.Config.PayConfig.Stripe.CancelURL
|
||||||
|
}
|
||||||
|
payDriver := pay.NewPayDriver(req.PayMethod, payConfig)
|
||||||
|
prepaymentRes, err := payDriver.GeneratePrepayment(generatePrepaymentReq)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
// 订单信息--修改
|
||||||
|
err = gmodel.NewFsOrderModel(connGorm).Update(ctx, orderInfo)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
if fspay == nil {
|
||||||
|
fspay = &gmodel.FsPay{
|
||||||
|
UserId: orderInfo.UserId,
|
||||||
|
OrderNumber: orderInfo.Sn,
|
||||||
|
CreatedAt: &nowAt,
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
fspay.UpdatedAt = &nowAt
|
||||||
|
}
|
||||||
|
fspay.PayAmount = &payAmount
|
||||||
|
fspay.PayStage = &payStage
|
||||||
|
//fspay.TradeNo = &prepaymentRes.TradeNo
|
||||||
|
fspay.PaymentMethod = &req.PayMethod
|
||||||
|
fspay.OrderSource = &orderSource
|
||||||
|
fspay.PayStatus = &payStatus
|
||||||
|
|
||||||
|
_, err = newFsPayModel.CreateOrUpdate(ctx, fspay)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
resData.RedirectUrl = prepaymentRes.URL
|
||||||
|
resData.ClientSecret = prepaymentRes.ClientSecret
|
||||||
|
|
||||||
|
return nil
|
||||||
|
})
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
logx.Error(err)
|
||||||
|
return resp.SetStatusWithMessage(basic.CodeServiceErr, "failed to make payment")
|
||||||
|
}
|
||||||
|
|
||||||
|
return resp.SetStatusWithMessage(basic.CodeOK, "success", resData)
|
||||||
|
}
|
||||||
296
server/pay/internal/logic/stripewebhooklogic.go
Normal file
296
server/pay/internal/logic/stripewebhooklogic.go
Normal file
@ -0,0 +1,296 @@
|
|||||||
|
package logic
|
||||||
|
|
||||||
|
import (
|
||||||
|
"encoding/json"
|
||||||
|
"errors"
|
||||||
|
"fusenapi/constants"
|
||||||
|
"fusenapi/model/gmodel"
|
||||||
|
"fusenapi/utils/auth"
|
||||||
|
"fusenapi/utils/basic"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"context"
|
||||||
|
|
||||||
|
"fusenapi/server/pay/internal/svc"
|
||||||
|
"fusenapi/server/pay/internal/types"
|
||||||
|
|
||||||
|
"github.com/stripe/stripe-go/v74"
|
||||||
|
"github.com/stripe/stripe-go/v74/webhook"
|
||||||
|
"github.com/zeromicro/go-zero/core/logx"
|
||||||
|
"gorm.io/gorm"
|
||||||
|
)
|
||||||
|
|
||||||
|
type StripeWebhookLogic struct {
|
||||||
|
logx.Logger
|
||||||
|
ctx context.Context
|
||||||
|
svcCtx *svc.ServiceContext
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewStripeWebhookLogic(ctx context.Context, svcCtx *svc.ServiceContext) *StripeWebhookLogic {
|
||||||
|
return &StripeWebhookLogic{
|
||||||
|
Logger: logx.WithContext(ctx),
|
||||||
|
ctx: ctx,
|
||||||
|
svcCtx: svcCtx,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 处理进入前逻辑w,r
|
||||||
|
// func (l *StripeWebhookLogic) BeforeLogic(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
|
// }
|
||||||
|
|
||||||
|
// 处理逻辑后 w,r 如:重定向, resp 必须重新处理
|
||||||
|
// func (l *StripeWebhookLogic) AfterLogic(w http.ResponseWriter, r *http.Request, resp *basic.Response) {
|
||||||
|
// // httpx.OkJsonCtx(r.Context(), w, resp)
|
||||||
|
// }
|
||||||
|
|
||||||
|
func (l *StripeWebhookLogic) StripeWebhook(req *types.StripeWebhookReq, userinfo *auth.UserInfo) (resp *basic.Response) {
|
||||||
|
// 返回值必须调用Set重新返回, resp可以空指针调用 resp.SetStatus(basic.CodeOK, data)
|
||||||
|
// userinfo 传入值时, 一定不为null
|
||||||
|
|
||||||
|
stripe.Key = l.svcCtx.Config.PayConfig.Stripe.Key
|
||||||
|
event := stripe.Event{}
|
||||||
|
|
||||||
|
if err := json.Unmarshal(req.Payload, &event); err != nil {
|
||||||
|
logx.Error(err)
|
||||||
|
return resp.SetStatusWithMessage(basic.CodeAesCbcDecryptionErr, "pay notify Unmarshal fail")
|
||||||
|
}
|
||||||
|
|
||||||
|
endpointSecret := l.svcCtx.Config.PayConfig.Stripe.EndpointSecret
|
||||||
|
signatureHeader := req.StripeSignature
|
||||||
|
event, err := webhook.ConstructEvent(req.Payload, signatureHeader, endpointSecret)
|
||||||
|
if err != nil {
|
||||||
|
logx.Error(err)
|
||||||
|
return resp.SetStatusWithMessage(basic.CodeAesCbcDecryptionErr, "Webhook signature verification failed")
|
||||||
|
}
|
||||||
|
|
||||||
|
// Unmarshal the event data into an appropriate struct depending on its Type
|
||||||
|
switch event.Type {
|
||||||
|
case "charge.succeeded":
|
||||||
|
// var charge stripe.Charge
|
||||||
|
// err := json.Unmarshal(event.Data.Raw, &charge)
|
||||||
|
// if err != nil {
|
||||||
|
// logx.Error(err)
|
||||||
|
// return resp.SetStatusWithMessage(basic.CodeAesCbcDecryptionErr, "pay notify Unmarshal fail event.Type charge.succeeded")
|
||||||
|
// }
|
||||||
|
|
||||||
|
case "checkout.session.completed":
|
||||||
|
// checkout checkout.session.completed 处理逻辑
|
||||||
|
// var session stripe.CheckoutSession
|
||||||
|
// err := json.Unmarshal(event.Data.Raw, &session)
|
||||||
|
// if err != nil {
|
||||||
|
// logx.Error(err)
|
||||||
|
// return resp.SetStatusWithMessage(basic.CodeAesCbcDecryptionErr, "pay notify Unmarshal fail event.Type payment_intent.succeeded")
|
||||||
|
// }
|
||||||
|
// fmt.Println("checkout.session.completed")
|
||||||
|
// err = l.handlePaymentSessionCompleted(session.ID, session.PaymentIntent.ID)
|
||||||
|
// if err != nil {
|
||||||
|
// return resp.SetStatusWithMessage(basic.CodeAesCbcDecryptionErr, "checkout.session.completed fail")
|
||||||
|
// }
|
||||||
|
case "payment_intent.succeeded":
|
||||||
|
var paymentIntent stripe.PaymentIntent
|
||||||
|
err := json.Unmarshal(event.Data.Raw, &paymentIntent)
|
||||||
|
if err != nil {
|
||||||
|
logx.Error(err)
|
||||||
|
return resp.SetStatusWithMessage(basic.CodeAesCbcDecryptionErr, "pay notify Unmarshal fail event.Type payment_intent.succeeded")
|
||||||
|
}
|
||||||
|
err = l.handlePaymentIntentSucceeded(&paymentIntent)
|
||||||
|
if err != nil {
|
||||||
|
return resp.SetStatusWithMessage(basic.CodeAesCbcDecryptionErr, "pay notify Unmarshal fail event.Type Unhandled")
|
||||||
|
}
|
||||||
|
case "payment_method.attached":
|
||||||
|
var paymentMethod stripe.PaymentMethod
|
||||||
|
err := json.Unmarshal(event.Data.Raw, &paymentMethod)
|
||||||
|
if err != nil {
|
||||||
|
logx.Error(err)
|
||||||
|
return resp.SetStatusWithMessage(basic.CodeAesCbcDecryptionErr, "pay notify Unmarshal fail event.Type payment_method.attached")
|
||||||
|
}
|
||||||
|
// ... handle other event types
|
||||||
|
default:
|
||||||
|
logx.Error("Unhandled event")
|
||||||
|
return resp.SetStatusWithMessage(basic.CodeAesCbcDecryptionErr, "pay notify Unmarshal fail event.Type Unhandled")
|
||||||
|
}
|
||||||
|
|
||||||
|
return resp.SetStatus(basic.CodeOK)
|
||||||
|
}
|
||||||
|
|
||||||
|
// session完成
|
||||||
|
// func (l *StripeWebhookLogic) handlePaymentSessionCompleted(sessionId string, tradeNo string) (err error) {
|
||||||
|
// // 查询支付记录
|
||||||
|
// payModel := gmodel.NewFsPayModel(l.svcCtx.MysqlConn)
|
||||||
|
// rsbPay := payModel.RowSelectBuilder(nil)
|
||||||
|
// rsbPay = rsbPay.Where("session_id = ?", sessionId)
|
||||||
|
// payInfo, err := payModel.FindOneByQuery(l.ctx, rsbPay, nil)
|
||||||
|
// if err != nil {
|
||||||
|
// return err
|
||||||
|
// }
|
||||||
|
// if *payInfo.PayStatus == 0 {
|
||||||
|
// *payInfo.TradeNo = tradeNo
|
||||||
|
// _, err = payModel.CreateOrUpdate(l.ctx, payInfo)
|
||||||
|
// if err != nil {
|
||||||
|
// return err
|
||||||
|
// }
|
||||||
|
// } else {
|
||||||
|
// return errors.New("pay status 1")
|
||||||
|
// }
|
||||||
|
// return err
|
||||||
|
// }
|
||||||
|
|
||||||
|
// 成功的付款
|
||||||
|
func (l *StripeWebhookLogic) handlePaymentIntentSucceeded(paymentIntent *stripe.PaymentIntent) error {
|
||||||
|
orderSn, ok := paymentIntent.Metadata["order_sn"]
|
||||||
|
if !ok || orderSn == "" {
|
||||||
|
return errors.New("order_sn not found")
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询支付记录
|
||||||
|
payModel := gmodel.NewFsPayModel(l.svcCtx.MysqlConn)
|
||||||
|
rsbPay := payModel.RowSelectBuilder(nil)
|
||||||
|
rsbPay = rsbPay.Where("order_number = ?", orderSn)
|
||||||
|
payInfo, err := payModel.FindOneByQuery(l.ctx, rsbPay, nil)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if *payInfo.PayStatus == 1 {
|
||||||
|
return errors.New("pay status 1")
|
||||||
|
}
|
||||||
|
//订单信息
|
||||||
|
orderDetailTemplateModel := gmodel.NewFsOrderDetailTemplateModel(l.svcCtx.MysqlConn)
|
||||||
|
orderModel := gmodel.NewFsOrderModel(l.svcCtx.MysqlConn)
|
||||||
|
fsOrderDetailModel := gmodel.NewFsOrderDetailModel(l.svcCtx.MysqlConn)
|
||||||
|
fsProductDesignModel := gmodel.NewFsProductDesignModel(l.svcCtx.MysqlConn)
|
||||||
|
|
||||||
|
rsbOrder := orderModel.RowSelectBuilder(nil)
|
||||||
|
rsbOrder = rsbOrder.Where("sn =?", orderSn).Preload("FsOrderDetails")
|
||||||
|
rsbOrder = rsbOrder.Preload("FsOrderDetails", func(dbPreload *gorm.DB) *gorm.DB {
|
||||||
|
return dbPreload.Table(fsOrderDetailModel.TableName()).Preload("FsOrderDetailTemplateInfo", func(dbPreload *gorm.DB) *gorm.DB {
|
||||||
|
return dbPreload.Table(orderDetailTemplateModel.TableName()).Preload("FsProductDesignInfo", func(dbPreload *gorm.DB) *gorm.DB {
|
||||||
|
return dbPreload.Table(fsProductDesignModel.TableName())
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
|
fsOrderRelInfo, err := orderModel.FindOneByQuery(l.ctx, rsbOrder, nil)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
var designIds []int64
|
||||||
|
var cartIds []int64
|
||||||
|
if len(fsOrderRelInfo.FsOrderDetails) > 0 {
|
||||||
|
for _, fsOrderDetail := range fsOrderRelInfo.FsOrderDetails {
|
||||||
|
if fsOrderDetail.FsOrderDetailTemplateInfo.FsProductDesignInfo.Id != 0 {
|
||||||
|
designIds = append(designIds, fsOrderDetail.FsOrderDetailTemplateInfo.FsProductDesignInfo.Id)
|
||||||
|
}
|
||||||
|
cartIds = append(cartIds, *fsOrderDetail.CartId)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var nowTime int64 = time.Now().Unix()
|
||||||
|
|
||||||
|
// 支付成功
|
||||||
|
if paymentIntent.Status == "succeeded" {
|
||||||
|
var card string
|
||||||
|
var brand string
|
||||||
|
if paymentIntent.LatestCharge.PaymentMethodDetails != nil {
|
||||||
|
if paymentIntent.LatestCharge.PaymentMethodDetails.Card != nil {
|
||||||
|
if paymentIntent.LatestCharge.PaymentMethodDetails.Card.Last4 != "" {
|
||||||
|
card = paymentIntent.LatestCharge.PaymentMethodDetails.Card.Last4
|
||||||
|
}
|
||||||
|
if paymentIntent.LatestCharge.PaymentMethodDetails.Card.Brand != "" {
|
||||||
|
brand = string(paymentIntent.LatestCharge.PaymentMethodDetails.Card.Brand)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
err = orderModel.Trans(l.ctx, func(ctx context.Context, connGorm *gorm.DB) (err error) {
|
||||||
|
// 更新支付信息
|
||||||
|
payModelT := gmodel.NewFsPayModel(connGorm)
|
||||||
|
*payInfo.PayStatus = 1
|
||||||
|
*payInfo.PayTime = nowTime
|
||||||
|
*payInfo.CardNo = card
|
||||||
|
*payInfo.Brand = brand
|
||||||
|
_, err = payModelT.CreateOrUpdate(ctx, payInfo)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
// 更新设计数据
|
||||||
|
productDesignModelT := gmodel.NewFsProductDesignModel(connGorm)
|
||||||
|
var isPay int64 = 1
|
||||||
|
err = productDesignModelT.UpdateByIds(ctx, designIds, &gmodel.FsProductDesign{IsPay: &isPay})
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
var orderInfo = &gmodel.FsOrder{}
|
||||||
|
var orderStatus int64
|
||||||
|
var orderIsPartPay int64
|
||||||
|
var orderPayedAmount int64
|
||||||
|
var orderIsPayCompleted int64
|
||||||
|
// 支付记录是首款
|
||||||
|
if *payInfo.PayStage == int64(constants.PAYSTAGE_DEPOSIT) {
|
||||||
|
orderStatus = int64(constants.STATUS_NEW_PART_PAY)
|
||||||
|
orderIsPartPay = 1
|
||||||
|
orderInfo.IsPartPay = &orderIsPartPay
|
||||||
|
orderPayedAmount = paymentIntent.Amount
|
||||||
|
|
||||||
|
// 删除购物车
|
||||||
|
cartModelT := gmodel.NewFsCartModel(connGorm)
|
||||||
|
err = cartModelT.DeleteCartsByIds(ctx, cartIds)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 支付记录是尾款
|
||||||
|
if *payInfo.PayStage == int64(constants.PAYSTAGE_REMAINING) {
|
||||||
|
if *orderInfo.Status < int64(constants.STATUS_NEW_PAY_COMPLETED) {
|
||||||
|
orderStatus = int64(constants.STATUS_NEW_PAY_COMPLETED)
|
||||||
|
}
|
||||||
|
orderIsPayCompleted = 1
|
||||||
|
orderInfo.IsPayCompleted = &orderIsPayCompleted
|
||||||
|
orderPayedAmount = *orderInfo.PayedAmount + paymentIntent.Amount
|
||||||
|
}
|
||||||
|
|
||||||
|
// 更新订单信息
|
||||||
|
orderInfo.Id = fsOrderRelInfo.Id
|
||||||
|
orderInfo.Status = &orderStatus
|
||||||
|
orderInfo.Ptime = &nowTime
|
||||||
|
orderInfo.PayedAmount = &orderPayedAmount
|
||||||
|
orderModelT := gmodel.NewFsOrderModel(connGorm)
|
||||||
|
err = orderModelT.Update(ctx, orderInfo)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return err
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
//千人千面的处理
|
||||||
|
// $renderServer = (new RenderService());
|
||||||
|
// $renderServer->thousandsFacesV2($order->id);
|
||||||
|
// //清除用户最新的设计
|
||||||
|
// $cache = \Yii::$app->cache;
|
||||||
|
// $cache->delete(CacheConfigHelper::LAST_DESIGN . $order->user_id);
|
||||||
|
// //缓存最新订单编号
|
||||||
|
// $cache->set(CacheConfigHelper::USER_ORDERNO . $order->user_id, $order->sn);
|
||||||
|
|
||||||
|
// //查询用户邮箱信息
|
||||||
|
// $user = \api\models\User::find()->where(['id' => $order->user_id])->one();
|
||||||
|
// $redisData = [
|
||||||
|
// 'key' => 'receipt_download',
|
||||||
|
// 'param' => [
|
||||||
|
// 'email' => $user->email,
|
||||||
|
// 'order_id' => $order->id,
|
||||||
|
// 'pay_id' => $pay->id,
|
||||||
|
// 'type' => 1,//付款成功为1
|
||||||
|
// ]
|
||||||
|
// ];
|
||||||
|
// Email::timely($redisData);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 订单记录
|
||||||
|
return nil
|
||||||
|
}
|
||||||
@ -4,7 +4,8 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"fusenapi/fsm"
|
"fusenapi/fsm"
|
||||||
"fusenapi/server/assistant/internal/config"
|
"fusenapi/server/pay/internal/config"
|
||||||
|
"fusenapi/utils/autoconfig"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"fusenapi/initalize"
|
"fusenapi/initalize"
|
||||||
@ -16,7 +17,7 @@ import (
|
|||||||
|
|
||||||
type ServiceContext struct {
|
type ServiceContext struct {
|
||||||
Config config.Config
|
Config config.Config
|
||||||
SharedState *fsm.StateCluster
|
SharedState *fsm.FsStateMachine
|
||||||
|
|
||||||
MysqlConn *gorm.DB
|
MysqlConn *gorm.DB
|
||||||
AllModels *gmodel.AllModelsGen
|
AllModels *gmodel.AllModelsGen
|
||||||
@ -24,7 +25,7 @@ type ServiceContext struct {
|
|||||||
|
|
||||||
func NewServiceContext(c config.Config) *ServiceContext {
|
func NewServiceContext(c config.Config) *ServiceContext {
|
||||||
conn := initalize.InitMysql(c.SourceMysql)
|
conn := initalize.InitMysql(c.SourceMysql)
|
||||||
StateServer := fsm.StartNode(c.Name, fmt.Sprintf("%s:%d", c.Host, c.Port-2000), conn)
|
StateServer := fsm.StartNode(c.Name, fmt.Sprintf("%s:%d", c.Host, c.Port-2000), autoconfig.AutoGetAllServerConfig(), conn)
|
||||||
|
|
||||||
return &ServiceContext{
|
return &ServiceContext{
|
||||||
Config: c,
|
Config: c,
|
||||||
92
server/pay/internal/types/types.go
Normal file
92
server/pay/internal/types/types.go
Normal file
@ -0,0 +1,92 @@
|
|||||||
|
// Code generated by goctl. DO NOT EDIT.
|
||||||
|
package types
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fusenapi/utils/basic"
|
||||||
|
)
|
||||||
|
|
||||||
|
type OrderPaymentIntentReq struct {
|
||||||
|
Sn string `form:"sn"` //订单编号
|
||||||
|
DeliveryMethod int64 `form:"delivery_method"` //发货方式
|
||||||
|
AddressId int64 `form:"address_id"` //地址id
|
||||||
|
PayMethod int64 `form:"pay_method"` //支付方式
|
||||||
|
}
|
||||||
|
|
||||||
|
type OrderPaymentIntentRes struct {
|
||||||
|
RedirectUrl string `json:"redirect_url"`
|
||||||
|
ClientSecret string `json:"clientSecret"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type StripeWebhookReq struct {
|
||||||
|
Payload []byte `json:"base_byte_slice,optional"`
|
||||||
|
StripeSignature string `json:"Stripe-Signature"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type Request struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
type Response struct {
|
||||||
|
Code int `json:"code"`
|
||||||
|
Message string `json:"msg"`
|
||||||
|
Data interface{} `json:"data"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type Auth struct {
|
||||||
|
AccessSecret string `json:"accessSecret"`
|
||||||
|
AccessExpire int64 `json:"accessExpire"`
|
||||||
|
RefreshAfter int64 `json:"refreshAfter"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type File struct {
|
||||||
|
Filename string `fsfile:"filename"`
|
||||||
|
Header map[string][]string `fsfile:"header"`
|
||||||
|
Size int64 `fsfile:"size"`
|
||||||
|
Data []byte `fsfile:"data"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type Meta struct {
|
||||||
|
TotalCount int64 `json:"totalCount"`
|
||||||
|
PageCount int64 `json:"pageCount"`
|
||||||
|
CurrentPage int `json:"currentPage"`
|
||||||
|
PerPage int `json:"perPage"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set 设置Response的Code和Message值
|
||||||
|
func (resp *Response) Set(Code int, Message string) *Response {
|
||||||
|
return &Response{
|
||||||
|
Code: Code,
|
||||||
|
Message: Message,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set 设置整个Response
|
||||||
|
func (resp *Response) SetWithData(Code int, Message string, Data interface{}) *Response {
|
||||||
|
return &Response{
|
||||||
|
Code: Code,
|
||||||
|
Message: Message,
|
||||||
|
Data: Data,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetStatus 设置默认StatusResponse(内部自定义) 默认msg, 可以带data, data只使用一个参数
|
||||||
|
func (resp *Response) SetStatus(sr *basic.StatusResponse, data ...interface{}) *Response {
|
||||||
|
newResp := &Response{
|
||||||
|
Code: sr.Code,
|
||||||
|
}
|
||||||
|
if len(data) == 1 {
|
||||||
|
newResp.Data = data[0]
|
||||||
|
}
|
||||||
|
return newResp
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetStatusWithMessage 设置默认StatusResponse(内部自定义) 非默认msg, 可以带data, data只使用一个参数
|
||||||
|
func (resp *Response) SetStatusWithMessage(sr *basic.StatusResponse, msg string, data ...interface{}) *Response {
|
||||||
|
newResp := &Response{
|
||||||
|
Code: sr.Code,
|
||||||
|
Message: msg,
|
||||||
|
}
|
||||||
|
if len(data) == 1 {
|
||||||
|
newResp.Data = data[0]
|
||||||
|
}
|
||||||
|
return newResp
|
||||||
|
}
|
||||||
36
server/pay/pay.go
Normal file
36
server/pay/pay.go
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"flag"
|
||||||
|
"fmt"
|
||||||
|
"net/http"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"fusenapi/utils/auth"
|
||||||
|
|
||||||
|
"fusenapi/server/pay/internal/config"
|
||||||
|
"fusenapi/server/pay/internal/handler"
|
||||||
|
"fusenapi/server/pay/internal/svc"
|
||||||
|
|
||||||
|
"github.com/zeromicro/go-zero/core/conf"
|
||||||
|
"github.com/zeromicro/go-zero/rest"
|
||||||
|
)
|
||||||
|
|
||||||
|
var configFile = flag.String("f", "etc/pay.yaml", "the config file")
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
flag.Parse()
|
||||||
|
|
||||||
|
var c config.Config
|
||||||
|
conf.MustLoad(*configFile, &c)
|
||||||
|
c.Timeout = int64(time.Second * 15)
|
||||||
|
server := rest.MustNewServer(c.RestConf, rest.WithCustomCors(auth.FsCors, func(w http.ResponseWriter) {
|
||||||
|
}))
|
||||||
|
defer server.Stop()
|
||||||
|
|
||||||
|
ctx := svc.NewServiceContext(c)
|
||||||
|
handler.RegisterHandlers(server, ctx)
|
||||||
|
|
||||||
|
fmt.Printf("Starting server at %s:%d...\n", c.Host, c.Port)
|
||||||
|
server.Start()
|
||||||
|
}
|
||||||
12
server/pay/pay_test.go
Normal file
12
server/pay/pay_test.go
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"testing"
|
||||||
|
)
|
||||||
|
|
||||||
|
// var configFile = flag.String("f", "etc/home-user-auth.yaml", "the config file")
|
||||||
|
|
||||||
|
func TestMain(t *testing.T) {
|
||||||
|
// log.Println(model.RawFieldNames[FsCanteenType]())
|
||||||
|
main()
|
||||||
|
}
|
||||||
@ -3,7 +3,6 @@ package svc
|
|||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"fusenapi/fsm"
|
|
||||||
"fusenapi/server/product-model/internal/config"
|
"fusenapi/server/product-model/internal/config"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
@ -15,8 +14,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type ServiceContext struct {
|
type ServiceContext struct {
|
||||||
Config config.Config
|
Config config.Config
|
||||||
SharedState *fsm.StateCluster
|
|
||||||
|
|
||||||
MysqlConn *gorm.DB
|
MysqlConn *gorm.DB
|
||||||
AllModels *gmodel.AllModelsGen
|
AllModels *gmodel.AllModelsGen
|
||||||
@ -24,13 +22,11 @@ type ServiceContext struct {
|
|||||||
|
|
||||||
func NewServiceContext(c config.Config) *ServiceContext {
|
func NewServiceContext(c config.Config) *ServiceContext {
|
||||||
conn := initalize.InitMysql(c.SourceMysql)
|
conn := initalize.InitMysql(c.SourceMysql)
|
||||||
StateServer := fsm.StartNode(c.Name, fmt.Sprintf("%s:%d", c.Host, c.Port-2000), conn)
|
|
||||||
|
|
||||||
return &ServiceContext{
|
return &ServiceContext{
|
||||||
Config: c,
|
Config: c,
|
||||||
MysqlConn: conn,
|
MysqlConn: conn,
|
||||||
SharedState: StateServer,
|
AllModels: gmodel.NewAllModels(initalize.InitMysql(c.SourceMysql)),
|
||||||
AllModels: gmodel.NewAllModels(initalize.InitMysql(c.SourceMysql)),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user