Commit 08a9b1b4 authored by brent's avatar brent

difff income & charge

parent 7e57e227
No preview for this file type
......@@ -4,6 +4,7 @@ postgrespass = "quest"
postgreshost = "192.168.1.10"
postgresport = 8812
postgresdb = "qdb"
senderport = 9009
; postgresuser = "admin"
; postgrespass = "quest"
......@@ -17,10 +18,12 @@ postgrespass = "quest"
postgreshost = "43.198.252.255"
postgresport = 8812
postgresdb = "qdb"
senderport = 9009
[prod]
postgresuser = "admin"
postgrespass = "quest"
postgreshost = "172.31.12.187"
postgresport = 8812
postgresdb = "qdb"
\ No newline at end of file
postgresdb = "qdb"
senderport = 9009
\ No newline at end of file
......@@ -4,8 +4,10 @@ import (
"ai_developer_admin/libs/kong"
"ai_developer_admin/libs/mysql"
"ai_developer_admin/libs/odysseus"
"ai_developer_admin/libs/postgres"
"ai_developer_admin/models"
"encoding/json"
"fmt"
"github.com/beego/beego/v2/core/logs"
"net/http"
"strconv"
......@@ -40,27 +42,94 @@ func (server *FundsController) Recharge() {
timestamp := time.Now()
amount := int64(chargeRequest.Amount * 1000000)
charge := models.ChargeRecord{
UserId: checkUser.Id,
Status: 1,
PayMethodDesc: chargeRequest.PaymentMethod.String(),
PayMethod: int(chargeRequest.PaymentMethod),
ChargeTime: timestamp,
CreatedTime: timestamp,
UpdatedTime: timestamp,
Amount: amount,
}
//charge := models.ChargeRecord{
// UserId: checkUser.Id,
// Status: 1,
// PayMethodDesc: chargeRequest.PaymentMethod.String(),
// PayMethod: int(chargeRequest.PaymentMethod),
// ChargeTime: timestamp,
// CreatedTime: timestamp,
// UpdatedTime: timestamp,
// Amount: amount,
//}
mysql.GetMysqlInstace().Ormer.Insert(&charge)
//mysql.GetMysqlInstace().Ormer.Insert(&charge)
balance := int64((float64(checkUser.Balance/1000000) + chargeRequest.Amount) * 1000000)
sql := "SELECT Max(id) AS count FROM funds;"
max, err := postgres.QueryTotal(sql)
if err != nil {
server.respond(models.BusinessFailed, err.Error())
return
}
tradeTime := fmt.Sprintf(time.Now().Format(format))
//fundsData := models.Funds{
// Id: max + 1,
// Uid: info.UserID,
// Amount: amount,
// TradeChannel: int(chargeRequest.PaymentMethod),
// ChannelSerial: "",
// Status: 4,
// TradeTime: tradeTime,
// TradeFlow: int(models.Income),
// TradeType: int(models.Charge),
// Balance: balance,
// Remark: "",
// OrderId: "",
//}
//flag, err := postgres.InsertFunds(&fundsData)
sql = fmt.Sprintf("INSERT INTO funds ("+
"channel_serial,"+
"order_id,"+
"remark,"+
"id, "+
"status,"+
"uid,"+
"trade_flow,"+
"trade_type,"+
"trade_channel,"+
"amount,"+
"balance,"+
"trade_time) "+
"VALUES ("+
"'%s','%s','%s',"+
"%d,"+
"%d,"+
"%d,"+
"%d,"+
"%d,"+
"%d,"+
"%d,"+
"%d,"+
"'%s');",
"",
"",
"",
max+1,
4,
info.UserID,
int(models.Income),
int(models.Charge),
int(chargeRequest.PaymentMethod),
amount,
balance,
tradeTime)
flag, err := postgres.InsertWithSql(sql)
if err != nil {
server.respond(models.BusinessFailed, err.Error())
return
}
//tempUser := models.User{
// Id: checkUser.Id,
// Balance: balance,
//}
checkUser.Balance = balance
checkUser.UpdatedTime = timestamp
flag, err := mysql.GetMysqlInstace().Ormer.Update(checkUser)
flag, err = mysql.GetMysqlInstace().Ormer.Update(checkUser)
if err != nil {
server.respond(http.StatusOK, "充值失败")
}
......@@ -142,9 +211,108 @@ func (server *FundsController) RechargeRecords() {
}
func (server *FundsController) IncomeAndExpense() {
//info, err := server.Check()
//if err != nil {
// server.respond(http.StatusUnauthorized, err.Error())
// return
//}
info, err := server.Check()
if err != nil {
server.respond(http.StatusUnauthorized, err.Error())
return
}
body := server.Ctx.Input.RequestBody
appRequest := models.AppRequest{}
err = json.Unmarshal(body, &appRequest) //解析body中数据
logs.Debug("appRequest", appRequest, string(body))
if err != nil {
server.respond(models.NoRequestBody, err.Error())
return
}
if appRequest.Page == 0 {
appRequest.Page = 1
}
if appRequest.Size == 0 {
appRequest.Size = 10
}
offset := (appRequest.Page - 1) * appRequest.Size
size := appRequest.Page * appRequest.Size
if appRequest.StartTime == "" && appRequest.EndTime != "" {
server.respond(models.MissingParameter, "缺少开始时间")
return
}
if appRequest.StartTime != "" && appRequest.EndTime == "" {
server.respond(models.MissingParameter, "缺少结束时间")
return
}
//qs := postgres.GetOrmer().QueryTable("funds")
//infoQs := qs.Filter("id", 1)
timeCondition := ""
if appRequest.StartTime != "" && appRequest.EndTime != "" {
temp, _ := time.Parse(layout, appRequest.StartTime)
startTime := fmt.Sprintf(temp.Format(format))
temp, _ = time.Parse(layout, appRequest.EndTime)
endTime := fmt.Sprintf(temp.Format(format))
timeCondition = fmt.Sprintf("time >= '%s' and time <= '%s'", startTime, endTime)
// //infoQs = qs.Filter("trade_time__gte", startTime).Filter("trade_time__lte", endTime)
}
var types []*models.Funds
sql := fmt.Sprintf("SELECT count(*) FROM funds WHERE uid = %d %s;", info.UserID, timeCondition)
total, err := postgres.QueryTotal(sql)
logs.Debug("total = %d", total)
if total == 0 {
responseData := struct {
Total int64 `json:"total"`
Data interface{} `json:"data,omitempty"`
}{
Total: total,
Data: types,
}
server.respond(http.StatusOK, "", responseData)
return
}
sql = fmt.Sprintf("SELECT * FROM funds WHERE uid = %d %s LIMIT %d,%d;", info.UserID, timeCondition, offset, size)
data, err := postgres.QueryFunds(sql)
if err != nil {
server.respond(models.BusinessFailed, err.Error())
return
}
var responseTypes []models.ResponseFunds
for _, fund := range data {
amountInt, _ := strconv.Atoi(fund.Amount)
amount := amountInt / 1000000
balanceInt, _ := strconv.Atoi(fund.Balance)
balance := balanceInt / 1000000
tradeChannel, _ := strconv.Atoi(fund.TradeChannel)
status, _ := strconv.Atoi(fund.Status)
tradeFlow, _ := strconv.Atoi(fund.TradeFlow)
tradeType, _ := strconv.Atoi(fund.TradeType)
responseType := models.ResponseFunds{
Id: fund.Id, // int64
Uid: fund.Uid, // int
Amount: float64(amount), // int64
TradeChannel: models.PayMethodType(tradeChannel).String(), // int
ChannelSerial: fund.ChannelSerial, // string
StatusDesc: models.PayStatus(status).String(), // int
Status: status,
TradeTime: fund.TradeTime, // string
TradeFlow: models.TradeFlowType(tradeFlow).String(), // int
TradeType: models.TradeKind(tradeType).String(), // int
Balance: float64(balance), // int64
Remark: fund.Remark, // string
OrderId: fund.OrderId,
}
responseTypes = append(responseTypes, responseType)
}
responseData := struct {
Total int64 `json:"total"`
Data interface{} `json:"data,omitempty"`
}{
Total: total,
Data: responseTypes,
}
server.respond(http.StatusOK, "", responseData)
}
package controllers
import (
"ai_developer_admin/libs/registry"
"ai_developer_admin/models"
"net/http"
)
type MonitorController struct {
MainController
}
func (server *MonitorController) NodeManagers() {
data, err := registry.NodeManagers()
if err != nil {
server.respond(models.BusinessFailed, err.Error())
return
}
server.respond(http.StatusOK, "", data)
}
func (server *MonitorController) Gateways() {
data, err := registry.Gateways()
if err != nil {
server.respond(models.BusinessFailed, err.Error())
return
}
server.respond(http.StatusOK, "", data)
}
func (server *MonitorController) Workers() {
data, err := registry.Workers()
if err != nil {
server.respond(models.BusinessFailed, err.Error())
return
}
server.respond(http.StatusOK, "", data)
}
func (server *MonitorController) Schedules() {
data, err := registry.Schedules()
if err != nil {
server.respond(models.BusinessFailed, err.Error())
return
}
server.respond(http.StatusOK, "", data)
}
......@@ -188,7 +188,7 @@ func (server *TaskController) BillDetails() {
taskType, err1 := odysseus.GetTaskType(int64(taskId))
if err1 == nil {
apiPath = taskType.ApiPath
desc = taskType.Desc
//desc = taskType.Desc
}
}
......@@ -227,10 +227,10 @@ func (server *TaskController) Tasks() {
appRequest := models.AppRequest{}
err := json.Unmarshal(body, &appRequest) //解析body中数据
logs.Debug("appRequest", appRequest, string(body))
if err != nil {
server.respond(models.NoRequestBody, err.Error())
return
}
//if err != nil && {
// server.respond(models.NoRequestBody, err.Error())
// return
//}
if appRequest.Page == 0 {
appRequest.Page = 1
......@@ -326,23 +326,32 @@ func (server *TaskController) Tasks() {
for _, task := range data {
apiPath := ""
desc := ""
model := ""
baseModel := ""
kind := 1
typeDe := 1
taskId, err := strconv.Atoi(task.Type)
if err == nil {
taskType, err1 := odysseus.GetTaskType(int64(taskId))
if err1 == nil {
taskType, _ := odysseus.GetTaskType(int64(taskId))
if taskType != nil {
apiPath = taskType.ApiPath
desc = taskType.Desc
model = taskType.Model
baseModel = taskType.BaseModel
kind = taskType.Kind
typeDe = taskType.Type
}
}
reTask := models.Bills{
Id: task.Id,
Type: task.Type,
Type: models.ModelType(typeDe).String(),
Time: task.Time,
Result: task.Result,
ApiPath: apiPath,
Desc: desc,
Model: model,
BaseModel: baseModel,
Kind: kind,
//Desc: desc,
Workload: task.Workload,
ProfitAcc: task.ProfitAcc,
WorkerAcc: task.WorkerAcc,
......@@ -528,7 +537,7 @@ func (server *TaskController) UserTasks() {
taskType, err1 := odysseus.GetTaskType(int64(taskId))
if err1 == nil {
apiPath = taskType.ApiPath
desc = taskType.Desc
//desc = taskType.Desc
}
}
......@@ -1122,7 +1131,7 @@ func (server *TaskController) AddTasktype() {
hardwareRequire, err := json.Marshal(appRequest.TaskTypeIn.HardwareRequire)
cmd, err := json.Marshal(appRequest.TaskTypeIn.Cmd)
//examples, err := json.Marshal(appRequest.Type.Examples)
apiPath := fmt.Sprintf("/%s/%s/%s", appRequest.TaskTypeIn.Type.String(), appRequest.TaskTypeIn.Name, appRequest.TaskTypeIn.BaseModel)
apiPath := fmt.Sprintf("/%s/%s/%s", appRequest.TaskTypeIn.Type.String(), appRequest.TaskTypeIn.BaseModel, appRequest.TaskTypeIn.Model)
//if appRequest.Type.BaseModel != "" {
// apiPath = fmt.Sprintf("/%s/%s", apiPath, appRequest.Type.BaseModel)
//}
......@@ -1133,6 +1142,7 @@ func (server *TaskController) AddTasktype() {
dbType := models.TaskType{
Name: appRequest.TaskTypeIn.Name,
BaseModel: appRequest.TaskTypeIn.BaseModel,
Model: appRequest.TaskTypeIn.Model,
Version: appRequest.TaskTypeIn.Version,
Desc: appRequest.TaskTypeIn.Desc,
Price: price,
......@@ -1275,7 +1285,7 @@ func (server *TaskController) UpdateTaskType() {
hardwareRequire, err := json.Marshal(appRequest.TaskTypeIn.HardwareRequire)
cmd, err := json.Marshal(appRequest.TaskTypeIn.Cmd)
apiPath := fmt.Sprintf("/%s/%s/%s", appRequest.TaskTypeIn.Type.String(), appRequest.TaskTypeIn.Name, appRequest.TaskTypeIn.BaseModel)
apiPath := fmt.Sprintf("/%s/%s/%s", appRequest.TaskTypeIn.Type.String(), appRequest.TaskTypeIn.BaseModel, appRequest.TaskTypeIn.Model)
//apiPath := fmt.Sprintf("/%s/%s", appRequest.Type.Type.String(), appRequest.Type.Name)
//if appRequest.Type.BaseModel != "" {
// apiPath = fmt.Sprintf("/%s/%s", apiPath, appRequest.Type.BaseModel)
......@@ -1288,6 +1298,7 @@ func (server *TaskController) UpdateTaskType() {
Id: appRequest.TaskTypeIn.Id,
Name: appRequest.TaskTypeIn.Name,
BaseModel: appRequest.TaskTypeIn.BaseModel,
Model: appRequest.TaskTypeIn.Model,
Version: appRequest.TaskTypeIn.Version,
Desc: appRequest.TaskTypeIn.Desc,
Price: price,
......@@ -1423,6 +1434,7 @@ func (server *TaskController) GetTaskTypes() {
Id: data.Id,
Name: data.Name,
BaseModel: data.BaseModel,
Model: data.Model,
Version: data.Version,
Desc: data.Desc,
Price: float64(data.Price / 1000000),
......@@ -1488,6 +1500,38 @@ func (server *TaskController) GetTaskTypes() {
//server.respond(http.StatusOK, "", types)
}
func (server *TaskController) DelTaskType() {
_, err := server.Check()
if err != nil {
server.respond(http.StatusUnauthorized, err.Error())
return
}
body := server.Ctx.Input.RequestBody
logs.Debug("AddLevel body", string(body))
request := models.TaskType{}
err = json.Unmarshal(body, &request) //解析body中数据
logs.Debug("request", request)
if err != nil {
server.respond(models.NoRequestBody, err.Error())
return
}
if request.Id == 0 {
server.respond(models.MissingParameter, "id 不能为空")
return
}
checkType := &models.TaskType{Id: request.Id}
err = mysql.GetMysqlInstace().Ormer.Read(checkType)
if err != nil {
server.respond(models.BusinessFailed, err.Error())
return
}
checkType.Deleted = 1
mysql.GetMysqlInstace().Ormer.Update(checkType)
server.respond(http.StatusOK, "删除成功")
}
func (server *TaskController) AddOrUpdateExamples() {
_, err := server.Check()
if err != nil {
......@@ -1571,7 +1615,7 @@ func (server *TaskController) Examples() {
}
var types []*models.Model
sql := fmt.Sprintf("SELECT id, `name` AS tit,type,`desc` AS content, tags ,examples,codes,base_model,api_path,version FROM task_type WHERE deleted = 0 %s LIMIT %d,%d;", where, offset, size)
sql := fmt.Sprintf("SELECT id, `name` AS tit,type,`desc` AS content, tags ,examples,codes,base_model,model,api_path,version FROM task_type WHERE deleted = 0 %s LIMIT %d,%d;", where, offset, size)
mysql.GetMysqlInstace().Ormer.Raw(sql).QueryRows(&types)
var remodels []*models.ResonseModel
for _, data := range types {
......@@ -1598,6 +1642,7 @@ func (server *TaskController) Examples() {
Type: data.Type,
ApiPath: data.ApiPath,
BaseModel: data.BaseModel,
Model: data.Model,
Examples: examples,
ApiDocUrl: data.ApiDocUrl,
ApiDocContent: data.ApiDocContent,
......
......@@ -9,10 +9,14 @@ require (
github.com/go-jose/go-jose/v3 v3.0.1
github.com/go-sql-driver/mysql v1.7.1
github.com/golang-jwt/jwt v3.2.2+incompatible
github.com/google/uuid v1.5.0
github.com/lib/pq v1.0.0
github.com/odysseus/payment v0.0.0-00010101000000-000000000000
github.com/odysseus/cache v0.0.0-00010101000000-000000000000
github.com/odysseus/service-registry v0.0.0-00010101000000-000000000000
github.com/questdb/go-questdb-client/v2 v2.0.0
github.com/robfig/cron/v3 v3.0.1
github.com/smartystreets/goconvey v1.6.4
golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad
golang.org/x/crypto v0.17.0
gopkg.in/redis.v5 v5.2.9
)
......@@ -22,15 +26,11 @@ require (
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
github.com/go-redis/redis/v7 v7.4.0 // indirect
github.com/golang/protobuf v1.4.2 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/gomodule/redigo v2.0.0+incompatible // indirect
github.com/google/uuid v1.5.0 // indirect
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 // indirect
github.com/hashicorp/golang-lru v0.5.4 // indirect
github.com/jtolds/gls v4.20.0+incompatible // indirect
github.com/konsorten/go-windows-terminal-sequences v1.0.1 // indirect
github.com/lestrrat-go/file-rotatelogs v2.4.0+incompatible // indirect
github.com/lestrrat-go/strftime v1.0.6 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
github.com/mitchellh/mapstructure v1.3.3 // indirect
github.com/pkg/errors v0.9.1 // indirect
......@@ -38,20 +38,19 @@ require (
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/common v0.10.0 // indirect
github.com/prometheus/procfs v0.1.3 // indirect
github.com/redis/go-redis/v9 v9.4.0 // indirect
github.com/rifflock/lfshook v0.0.0-20180920164130-b9218ef580f5 // indirect
github.com/robfig/cron/v3 v3.0.1 // indirect
github.com/redis/go-redis/v9 v9.5.1 // indirect
github.com/shiena/ansicolor v0.0.0-20151119151921-a422bbe96644 // indirect
github.com/sirupsen/logrus v1.4.2 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d // indirect
golang.org/x/mod v0.3.0 // indirect
golang.org/x/net v0.0.0-20201021035429-f5854403a974 // indirect
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f // indirect
golang.org/x/text v0.3.3 // indirect
golang.org/x/tools v0.0.0-20201211185031-d93e913c1a58 // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
google.golang.org/protobuf v1.23.0 // indirect
golang.org/x/mod v0.13.0 // indirect
golang.org/x/net v0.16.0 // indirect
golang.org/x/sys v0.16.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/tools v0.14.0 // indirect
google.golang.org/protobuf v1.31.0 // indirect
gopkg.in/yaml.v2 v2.2.8 // indirect
)
replace github.com/odysseus/payment => ../payment
replace github.com/odysseus/cache => ../cache
replace github.com/odysseus/service-registry => ../service-registry
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk=
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25UVaW/CKtUDjefjrs0SPonmDGUVOYP0=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/Knetic/govaluate v3.0.0+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0=
github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow=
github.com/Microsoft/hcsshim v0.11.1 h1:hJ3s7GbWlGK4YVV92sO88BQSyF4ZLVy7/awqOlPxFbA=
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/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
......@@ -23,12 +27,14 @@ github.com/bradfitz/gomemcache v0.0.0-20180710155616-bc664df96737/go.mod h1:PmM6
github.com/bsm/ginkgo/v2 v2.12.0 h1:Ny8MWAHyOepLGlLKYmXG4IEkioBysk6GpaRTLC8zwWs=
github.com/bsm/gomega v1.27.10 h1:yeMWxP2pV2fG3FgAODIY8EiRE3dy0aeFYt4l7wh6yKA=
github.com/casbin/casbin v1.7.0/go.mod h1:c67qKN6Oum3UF5Q1+BByfFxkwKvhwW57ITjqwtzR1KE=
github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44=
github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/cloudflare/golz4 v0.0.0-20150217214814-ef862a3cdc58/go.mod h1:EOBUe0h4xcZ5GoxqC5SDxFQ8gwyZPKQoEzownBlhI80=
github.com/containerd/containerd v1.7.6 h1:oNAVsnhPoy4BTPQivLgTzI9Oleml9l/+eYIDYXRCYo8=
github.com/coreos/etcd v3.3.25+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
......@@ -39,12 +45,18 @@ github.com/couchbase/gomemcached v0.0.0-20200526233749-ec430f949808/go.mod h1:sr
github.com/couchbase/gomemcached v0.1.2-0.20201224031647-c432ccf49f32/go.mod h1:mxliKQxOv84gQ0bJWbI+w9Wxdpt9HjDvgW9MjCym5Vo=
github.com/couchbase/goutils v0.0.0-20180530154633-e865a1461c8a/go.mod h1:BQwMFlJzDjFDG3DJUdU0KORxn88UlsOULuxLExMh3Hs=
github.com/couchbase/goutils v0.0.0-20210118111533-e33d3ffb5401/go.mod h1:BQwMFlJzDjFDG3DJUdU0KORxn88UlsOULuxLExMh3Hs=
github.com/cpuguy83/dockercfg v0.3.1 h1:/FpZ+JaygUR/lZP2NlFI2DVfrOEMAIKP5wWEJdoYe9E=
github.com/cupcake/rdb v0.0.0-20161107195141-43ba34106c76/go.mod h1:vYwsqCOLxGiisLwp9rITslkFNpZD5rz43tf41QFkTWY=
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/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
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/distribution/reference v0.5.0 h1:/FUIFXtfc/x2gpa5/VGfiGLuOIdYa1t65IKK2OFGvA0=
github.com/docker/distribution v2.8.3+incompatible h1:AtKxIZ36LoNK51+Z6RpzLpddBirtxJnzDrHLEKxTAYk=
github.com/docker/docker v24.0.6+incompatible h1:hceabKCtUgDqPu+qm0NgsaXf28Ljf4/pWFL7xjWWDgE=
github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ=
github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4=
github.com/edsrzf/mmap-go v0.0.0-20170320065105-0bce6a688712/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M=
github.com/elastic/go-elasticsearch/v6 v6.8.5/go.mod h1:UwaDJsD3rWLM5rKNFzv9hgox93HoX8utj1kxD9aFUcI=
github.com/elazarl/go-bindata-assetfs v1.0.0 h1:G/bYguwHIzWq9ZoyUQqrjTmJbbYn3j3CKKpKinvZLFk=
......@@ -59,6 +71,7 @@ github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2
github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
github.com/go-ole/go-ole v1.3.0 h1:Dt6ye7+vXGIKZ7Xtk4s6/xVdGDQynvom7xCFEdWr6uE=
github.com/go-redis/redis v6.14.2+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA=
github.com/go-redis/redis/v7 v7.4.0 h1:7obg6wUoj05T0EpY0o8B59S9w5yeMWql7sw2kwNW1x4=
github.com/go-redis/redis/v7 v7.4.0/go.mod h1:JDNMw23GTyLNC4GZu9njt15ctBQVn7xjRfnwdHj/Dcg=
......@@ -68,6 +81,7 @@ github.com/go-sql-driver/mysql v1.7.1/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
github.com/gogo/protobuf v1.1.1/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/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/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
......@@ -80,8 +94,10 @@ github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:x
github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs=
github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w=
github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0=
github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
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/snappy v0.0.0-20170215233205-553a64147049/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/gomodule/redigo v2.0.0+incompatible h1:K/R+8tc58AaqLkqG2Ol3Qk+DR/TlNuhuh457pBFPtt0=
......@@ -90,8 +106,9 @@ github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5a
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.0 h1:/QaMHBdZ26BB3SSst0Iwl10Epc+xhTquomWX0oZEB6w=
github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
......@@ -111,7 +128,7 @@ github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfV
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk=
github.com/klauspost/compress v1.17.0 h1:Rnbp4K9EjcDuVuHtd0dgA4qNuv9yKDYKK1ulpJwgrqM=
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/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
......@@ -119,23 +136,24 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/ledisdb/ledisdb v0.0.0-20200510135210-d35789ec47e6/go.mod h1:n931TsDuKuq+uX4v1fulaMbA/7ZLLhjc85h7chZGBCQ=
github.com/lestrrat-go/envload v0.0.0-20180220234015-a3eb8ddeffcc/go.mod h1:kopuH9ugFRkIXf3YoqHKyrJ9YfUFsckUU9S7B+XP+is=
github.com/lestrrat-go/file-rotatelogs v2.4.0+incompatible h1:Y6sqxHMyB1D2YSzWkLibYKgg+SwmyFU9dF2hn6MdTj4=
github.com/lestrrat-go/file-rotatelogs v2.4.0+incompatible/go.mod h1:ZQnN8lSECaebrkQytbHj4xNgtg8CR7RYXnPok8e0EHA=
github.com/lestrrat-go/strftime v1.0.6 h1:CFGsDEt1pOpFNU+TJB0nhz9jl+K0hZSLE205AhTIGQQ=
github.com/lestrrat-go/strftime v1.0.6/go.mod h1:f7jQKgV5nnJpYgdEasS+/y7EsTb8ykN2z68n3TtcTaw=
github.com/lib/pq v1.0.0 h1:X5PMW56eZitiTeO7tKzZxFCSpbFZJtkMMooicw2us9A=
github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
github.com/lufia/plan9stats v0.0.0-20230326075908-cb1d2100619a h1:N9zuLhTvBSRt0gWSiJswwQ2HqDmtX/ZCDJURnKUt1Ik=
github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY=
github.com/mattn/go-sqlite3 v2.0.3+incompatible h1:gXHsfypPkaMZrKbD5209QV9jbUTJKjyR5WD3HYQSd+U=
github.com/mattn/go-sqlite3 v2.0.3+incompatible/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc=
github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU=
github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
github.com/mitchellh/mapstructure v1.3.3 h1:SzB1nHZ2Xi+17FP0zVQBHIZqvwRN9408fJO8h+eeNA8=
github.com/mitchellh/mapstructure v1.3.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/moby/patternmatcher v0.6.0 h1:GmP9lR19aU5GqSSFko+5pRqHi+Ohk1O69aFiKkVGiPk=
github.com/moby/sys/sequential v0.5.0 h1:OPvI35Lzn9K04PBbCLW0g4LcFAJgHsvXsRyewg5lXtc=
github.com/moby/term v0.5.0 h1:xt8Q1nalod/v7BqbG21f8mQPqH+xAaC9C3N3wfWbVP0=
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/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A=
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
......@@ -146,6 +164,9 @@ github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0
github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
github.com/onsi/gomega v1.7.1 h1:K0jcRCwNQM3vFGh1ppMtDh/+7ApJrjldlX8fA0jDTLQ=
github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY=
github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U=
github.com/opencontainers/image-spec v1.1.0-rc5 h1:Ygwkfw9bpDvs+c9E34SdgGOj41dX/cbdlwvlWt0pnFI=
github.com/opencontainers/runc v1.1.9 h1:XR0VIHTGce5eWPkaPesqTBrhW2yAcaraWfsEalNwQLM=
github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc=
github.com/pelletier/go-toml v1.0.1/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
......@@ -157,6 +178,7 @@ github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
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/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/power-devops/perfstat v0.0.0-20221212215047-62379fc7944b h1:0LFwY6Q3gMACTjAbMZBjXAqTOzOwFaj2Ld6cjeQ7Rig=
github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo=
github.com/prometheus/client_golang v1.7.0 h1:wCi7urQOGBsYcQROHqpUUX4ct84xp40t9R9JX0FuA/U=
......@@ -173,21 +195,24 @@ github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R
github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
github.com/prometheus/procfs v0.1.3 h1:F0+tqvhOksq22sc6iCHF5WGlWjdwj92p0udFh1VFBS8=
github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU=
github.com/redis/go-redis/v9 v9.4.0 h1:Yzoz33UZw9I/mFhx4MNrB6Fk+XHO1VukNcCa1+lwyKk=
github.com/redis/go-redis/v9 v9.4.0/go.mod h1:hdY0cQFCN4fnSYT6TkisLufl/4W5UIXyv0b/CLO2V2M=
github.com/rifflock/lfshook v0.0.0-20180920164130-b9218ef580f5 h1:mZHayPoR0lNmnHyvtYjDeq0zlVHn9K/ZXoy17ylucdo=
github.com/rifflock/lfshook v0.0.0-20180920164130-b9218ef580f5/go.mod h1:GEXHk5HgEKCvEIIrSpFI3ozzG5xOKA2DVlEX/gGnewM=
github.com/questdb/go-questdb-client/v2 v2.0.0 h1:5N4K/siiiuwZ8Lzx+3y+mrKMX5G+8D1FuVXUtbZmgnk=
github.com/questdb/go-questdb-client/v2 v2.0.0/go.mod h1:7E8ymLWyraJprj77cN8VNJq0w4GABHtT8WxMYAOqLEM=
github.com/redis/go-redis/v9 v9.5.1 h1:H1X4D3yHPaYrkL5X06Wh6xNVM/pX0Ft4RV0vMGvLBh8=
github.com/redis/go-redis/v9 v9.5.1/go.mod h1:hdY0cQFCN4fnSYT6TkisLufl/4W5UIXyv0b/CLO2V2M=
github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs=
github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/shiena/ansicolor v0.0.0-20151119151921-a422bbe96644 h1:X+yvsM2yrEktyI+b2qND5gpH8YhURn0k8OCaeRnkINo=
github.com/shiena/ansicolor v0.0.0-20151119151921-a422bbe96644/go.mod h1:nkxAfR/5quYxwPZhyDxgasBMnRtBZd0FCEpawpjMUFg=
github.com/shirou/gopsutil/v3 v3.23.9 h1:ZI5bWVeu2ep4/DIxB4U9okeYJ7zp/QLTO4auRb/ty/E=
github.com/shoenig/go-m1cpu v0.1.6 h1:nxdKQNcEB6vzgA2E2bvzKIYRuNj7XNJ4S/aRSwKzFtM=
github.com/siddontang/go v0.0.0-20170517070808-cb568a3e5cc0/go.mod h1:3yhqj7WBBfRhbBlzyOC3gUxftwsU0u8gqevxwIHQpMw=
github.com/siddontang/goredis v0.0.0-20150324035039-760763f78400/go.mod h1:DDcKzU3qCuvj/tPnimWSsZZzvk9qvkvrIL5naVBPh5s=
github.com/siddontang/rdb v0.0.0-20150307021120-fc89ed2e418d/go.mod h1:AMEsy7v5z92TR1JKMkLLoaOQk++LVnOKL3ScbJ8GNGA=
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4=
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d h1:zE9ykElWQ6/NYmHa3jpm/yHnI4xSofP+UP6SpjHcSeM=
github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc=
github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIKYqbNC9s=
......@@ -199,14 +224,19 @@ github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXf
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/syndtr/goleveldb v0.0.0-20160425020131-cfa635847112/go.mod h1:Z4AUp2Km+PwemOoO/VB5AOx9XSsIItzFjoJlOSiYmn0=
github.com/syndtr/goleveldb v0.0.0-20181127023241-353a9fca669c/go.mod h1:Z4AUp2Km+PwemOoO/VB5AOx9XSsIItzFjoJlOSiYmn0=
github.com/testcontainers/testcontainers-go v0.25.0 h1:erH6cQjsaJrH+rJDU9qIf89KFdhK0Bft0aEZHlYC3Vs=
github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU=
github.com/tklauser/numcpus v0.6.1 h1:ng9scYS7az0Bk4OZLvrNXNSAO2Pxr1XXRAPyjhIx+Fk=
github.com/ugorji/go v0.0.0-20171122102828-84cb69a8af83/go.mod h1:hnLbHMwcvSihnDhEfx2/BzKp2xb0Y+ErdfYcrs9tkJQ=
github.com/wendal/errors v0.0.0-20130201093226-f66c77a7882b/go.mod h1:Q12BUT7DqIlHRmgv3RskH+UCM/4eqVMgI0EMmlSpAXc=
github.com/wendal/errors v0.0.0-20181209125328-7f31f4b264ec/go.mod h1:Q12BUT7DqIlHRmgv3RskH+UCM/4eqVMgI0EMmlSpAXc=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/gopher-lua v0.0.0-20171031051903-609c9cd26973/go.mod h1:aEV29XrmTYFr3CiRxZeGHpkvbwq+prZduBqMaascyCU=
github.com/yusufpapurcu/wmi v1.2.3 h1:E1ctvB7uKFMOJw3fdOW32DwGE9I7t++CRUEMKvFoFiw=
go.etcd.io/etcd v3.3.25+incompatible/go.mod h1:yaeTdrJi5lOmYerz05bd8+V7KubZs8YSFZfzsF9A6aI=
go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=
go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU=
......@@ -218,9 +248,11 @@ golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8U
golang.org/x/crypto v0.0.0-20190911031432-227b76d455e7/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad h1:DN0cp81fZ3njFcrLCytUHRSUkqBjfTo4Tx9RJTWs0EY=
golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I=
golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k=
golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20231005195138-3e424a577f31 h1:9k5exFQKQglLo+RoP+4zMjOFE14P6+vyR0baDAi0Rcs=
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
......@@ -228,8 +260,9 @@ golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHl
golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc=
golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
golang.org/x/mod v0.3.0 h1:RM4zey1++hCTbCVQfnWeKs9/IEsaBLA8vTkd0WVtmH4=
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.13.0 h1:I/DsJXRlw/8l/0c24sM9yb0T4z9liZTduXvdAWYiysY=
golang.org/x/mod v0.13.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
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-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
......@@ -240,8 +273,9 @@ golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn
golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/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-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20201021035429-f5854403a974 h1:IX6qOQeG5uLjB/hjjwjedwfjND0hgjPMMyO1RoIXQNI=
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/net v0.16.0 h1:7eBu7KsSvFDtSXUIDbh3aqlK4DPsZ1rByC8PFfBThos=
golang.org/x/net v0.16.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
......@@ -249,6 +283,7 @@ golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sync v0.0.0-20190423024810-112230192c58/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-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.4.0 h1:zxkM55ReGkDlKSM+Fu41A+zmbZuaPVbGMzvvdUPznYQ=
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-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
......@@ -261,13 +296,16 @@ golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f h1:+Nyd8tzPX9R7BWHguqsrbFdRx3WQ/1ib8I44HXV5yTA=
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU=
golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
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-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
......@@ -281,8 +319,9 @@ golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtn
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
golang.org/x/tools v0.0.0-20201211185031-d93e913c1a58 h1:1Bs6RVeBFtLZ8Yi1Hk07DiOqzvwLD/4hln4iahvFlag=
golang.org/x/tools v0.0.0-20201211185031-d93e913c1a58/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.14.0 h1:jvNa2pY0M4r62jkRQ6RwEZZyPcymeL9XZMLBbV7U2nc=
golang.org/x/tools v0.14.0/go.mod h1:uYBEerGOWcJyEORxN+Ek8+TT266gXkNlHdJBwexUsBg=
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-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
......@@ -292,16 +331,22 @@ google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9Ywl
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
google.golang.org/genproto v0.0.0-20230920204549-e6e6cdab5c13 h1:vlzZttNJGVqTsRFU9AmdnrcO1Znh8Ew9kCD//yjigk0=
google.golang.org/genproto/googleapis/rpc v0.0.0-20231002182017-d307bd883b97 h1:6GQBEOdGkX6MMTLT9V+TjtIRZCw9VPD5Z+yHY9wMgS0=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
google.golang.org/grpc v1.58.2 h1:SXUpjxeVF3FKrTYQI4f4KvbGD5u2xccdYdurwowix5I=
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE=
google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=
google.golang.org/protobuf v1.23.0 h1:4MY060fB1DLGMB/7MBTLnwQUY6+F09GEiz6SsrNqyzM=
google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8=
google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
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=
......@@ -322,8 +367,8 @@ 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.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10=
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
......
{"/Users/brent/Documents/wubanWork/ai_developer_admin/controllers":1708684702731316975}
\ No newline at end of file
{"/Users/brent/Documents/wubanWork/ai_developer_admin/controllers":1709021476821781079}
\ No newline at end of file
......@@ -3,20 +3,35 @@ package cronjob
import (
"ai_developer_admin/libs/postgres"
"ai_developer_admin/libs/redis"
"ai_developer_admin/libs/registry"
"ai_developer_admin/models"
"context"
"encoding/json"
"fmt"
"github.com/beego/beego/v2/core/logs"
beego "github.com/beego/beego/v2/server/web"
qdb "github.com/questdb/go-questdb-client/v2"
"github.com/robfig/cron/v3"
"strconv"
"time"
)
var loopCronTask = cron.New(cron.WithSeconds())
var debitTask = cron.New(cron.WithSeconds())
var registryTask = cron.New(cron.WithSeconds())
var HeatKey = "task:heat"
var format = "2006-01-02T15:04:05.000000Z"
func Start() {
//defer loopCronTask.Stop()
startHeatKey()
startDebit()
startRegistBackend()
}
func startHeatKey() {
//spec := "0 0 * * * ?" //"@every 1h"
spec := "@every 1h" //"@every 1h"
//spec := "*/1 * * * * ?" //"@every 1h"
......@@ -84,6 +99,99 @@ func Start() {
loopCronTask.Start()
}
func startDebit() {
//spec := "*/50 */23 * * * ?" //"@every 1h"
spec := "00 00 00 * * ?"
//spec := "@every 1m"
dbhost, _ := beego.AppConfig.String("postgreshost")
dbport, _ := beego.AppConfig.Int("senderport")
questAddr := fmt.Sprintf("%s:%d", dbhost, dbport)
debitTask.AddFunc(spec, func() {
logs.Debug("startDebit")
ctx := context.TODO()
addrOpt := qdb.WithAddress(questAddr)
sender, err := qdb.NewLineSender(ctx, addrOpt)
if err != nil {
logs.Debug("startDebit NewLineSender = %s", err.Error())
return
}
// Make sure to close the sender on exit to release resources.
defer sender.Close()
currentTime := time.Now()
temp := fmt.Sprintf("-%dh", 2)
m, _ := time.ParseDuration(temp)
dayTime := currentTime.Add(m)
endTime := time.Date(dayTime.Year(), dayTime.Month(), dayTime.Day(), 23, 59, 59, 0, dayTime.Location())
startTime := time.Date(dayTime.Year(), dayTime.Month(), dayTime.Day(), 0, 0, 0, 0, dayTime.Location())
start := fmt.Sprintf(startTime.Format(format))
end := fmt.Sprintf(endTime.Format(format))
sql := fmt.Sprintf("SELECT time, uid,sum(fee) AS amount FROM bills WHERE time >= '%s' and time <= '%s' SAMPLE BY 1d ALIGN TO CALENDAR GROUP BY uid,time;", start, end)
data, err := postgres.CountFunds(sql)
if err != nil {
return
}
if data == nil {
return
}
sql = "SELECT Max(id) AS count FROM funds;"
max, err := postgres.QueryTotal(sql)
if err != nil {
return
}
id := max + 1
for _, fund := range data {
//tradeTime, _ := time.Parse(fund.Time, format)
uid, _ := strconv.Atoi(fund.Uid)
amount, _ := strconv.Atoi(fund.Amount)
nanoseconds := int64(uint64(dayTime.UnixNano()))
seconds := nanoseconds / 1e9
err = sender.Table("funds").
Symbol("order_id", "").
Symbol("remark", "").
Symbol("channel_serial", "").
Int64Column("uid", int64(uid)).
Int64Column("amount", int64(amount)).
Int64Column("balance", 0).
Int64Column("trade_channel", 0).
Int64Column("status", 5).
Int64Column("id", id).
TimestampColumn("trade_time", time.Unix(seconds, nanoseconds%1e9)).
Int64Column("trade_flow", int64(models.Expenditure)).
Int64Column("trade_type", int64(models.Spending)).
AtNow(ctx)
if err != nil {
logs.Debug("startDebit sender = %s,id = %d", err.Error(), id)
}
id = id + 1
//break
}
err = sender.Flush(ctx)
if err != nil {
logs.Debug("startDebit Flush = %s", err.Error())
}
})
debitTask.Start()
}
func startRegistBackend() {
spec := "@every 1h"
registryTask.AddFunc(spec, func() {
logs.Debug("startRegistBackend")
registry.RegistryBackend()
})
debitTask.Start()
}
//func Start() {
// //defer loopCronTask.Stop()
//
......
......@@ -4,8 +4,8 @@ import (
"ai_developer_admin/models"
"context"
"github.com/beego/beego/v2/core/logs"
"github.com/odysseus/payment/cachedata"
"github.com/odysseus/payment/model"
"github.com/odysseus/cache/cachedata"
"github.com/odysseus/cache/model"
)
import (
......
......@@ -12,6 +12,10 @@ import (
var ormpost orm.Ormer
func GetOrmer() orm.Ormer {
return ormpost
}
func init() {
//return
logs.Debug("postgres lib init")
......@@ -20,7 +24,7 @@ func init() {
logs.Error(err.Error())
}
//orm.RegisterModel(new(models.Bills))
//orm.RegisterModel(new(models.Funds))
//orm.RegisterModel(new(models.Tasks))
//orm.RegisterModel(new(models.ChargeRecord))
//orm.RegisterModel(new(models.UserLevel))
......@@ -100,6 +104,50 @@ func QueryBills(sql string) ([]models.Bills, error) {
return containers, nil
}
func QueryFunds(sql string) ([]models.Funds, error) {
logs.Debug("QueryFunds = ", sql)
qs := ormpost.Raw(sql)
var params []orm.Params
_, err := qs.Values(&params)
if err != nil {
return nil, err
}
arr, err := json.Marshal(params)
if err != nil {
return nil, err
}
var containers []models.Funds
logs.Debug("QueryFunds = ", string(arr))
err = json.Unmarshal(arr, &containers)
if err != nil {
return nil, err
}
return containers, nil
}
func CountFunds(sql string) ([]models.IncomeAndExpenseRsponse, error) {
logs.Debug("CountFunds = ", sql)
qs := ormpost.Raw(sql)
var params []orm.Params
_, err := qs.Values(&params)
if err != nil {
return nil, err
}
arr, err := json.Marshal(params)
if err != nil {
return nil, err
}
var containers []models.IncomeAndExpenseRsponse
logs.Debug("CountFunds = ", string(arr))
err = json.Unmarshal(arr, &containers)
if err != nil {
return nil, err
}
return containers, nil
}
func QueryTotal(sql string) (int64, error) {
logs.Debug("QueryBills = ", sql)
var count int64
......@@ -132,6 +180,19 @@ func QueryTotal(sql string) (int64, error) {
return count, nil
}
func InsertFunds(funds *models.Funds) (int64, error) {
return ormpost.Insert(funds)
}
func InsertWithSql(sql string) (int64, error) {
logs.Debug("InsertWithSql = %s", sql)
_, err := ormpost.Raw(sql).Exec()
if err != nil {
return 0, err
}
return 0, nil
}
func CountTasks(sql string) ([]models.TaskCount, error) {
logs.Debug("CountTasks = ", sql)
qs := ormpost.Raw(sql)
......
package registry
import (
"encoding/json"
beego "github.com/beego/beego/v2/server/web"
"github.com/odysseus/service-registry/common"
"github.com/odysseus/service-registry/query"
registor "github.com/odysseus/service-registry/registry"
"os"
"time"
)
var querier *query.ServiceQuerier
var redisParam registor.RedisConnParam
type backendService struct {
}
func init() {
host, _ := beego.AppConfig.String("balancehost")
db, _ := beego.AppConfig.Int("balancedb")
pass, _ := beego.AppConfig.String("balancepass")
redisParam = registor.RedisConnParam{
Addr: host,
Password: pass,
DbIndex: db,
}
querier = query.NewQuery(redisParam)
}
func NodeManagers() ([]string, error) {
return querier.Select(common.SERVICE_NODE_MANAGER).List()
}
func Gateways() ([]string, error) {
return querier.Select(common.SERVICE_API_GATEWAY).List()
}
func Workers() ([]string, error) {
return querier.Select(common.SERVICE_WORKER).List()
}
func Schedules() ([]string, error) {
return querier.Select(common.SERVICE_SCHEDULER).List()
}
func (d backendService) ServiceType() common.ServiceType {
return common.SERVICE_BACKEND
}
func (d backendService) Instance() string {
hostname, _ := os.Hostname()
port, _ := beego.AppConfig.String("httpport")
return "http://" + hostname + ":" + port
}
func (d backendService) Status() string {
//hostname, _ := os.Hostname()
//port, _ := beego.AppConfig.String("httpport")
return "200"
}
func (d backendService) DetailInfo() (json.RawMessage, error) {
hostname, _ := os.Hostname()
detail := struct {
IP string `json:"ip"`
HostName string `json:"hostName"`
}{
IP: "",
HostName: hostname,
}
return json.Marshal(detail)
}
func RegistryBackend() {
r := registor.NewRegistry(redisParam, backendService{})
r.Start()
time.Sleep(time.Second * 5)
r.Stop()
}
......@@ -27,11 +27,77 @@ func (m PayMethodType) String() string {
return "苹果支付"
case ManualPay:
return "手动充值"
default:
return "_"
}
}
type TradeFlowType int
const (
Income TradeFlowType = iota + 1
Expenditure
)
func (m TradeFlowType) String() string {
switch m {
case Income:
return "收入"
case Expenditure:
return "支出"
default:
return "未知支付方式"
}
}
type TradeKind int
const (
Charge TradeKind = iota + 1
Spending
Withdrawal
)
func (m TradeKind) String() string {
switch m {
case Charge:
return "充值"
case Spending:
return "消费"
case Withdrawal:
return "提现"
default:
return "未知支付方式"
}
}
type PayStatus int
const (
InitiatePay PayStatus = iota + 1
PendingPay
SuccessPay
FinishCharge
Billed
)
func (m PayStatus) String() string {
switch m {
case InitiatePay:
return "发起充值"
case PendingPay:
return "待支付"
case SuccessPay:
return "支付成功"
case FinishCharge:
return "充值完成"
case Billed:
return "已出账"
default:
return "未知"
}
}
type ChargeRequest struct {
Amount float64 `json:"amount"`
PaymentMethod PayMethodType `json:"pay_method"`
......@@ -50,5 +116,39 @@ type ChargeRecord struct {
Deleted int `json:"deleted";orm:"column(deleted);size(1)"`
}
type Funds struct {
Id string `json:"id";orm:"column(id)"` // int64
Uid string `json:"uid";orm:"column(uid)"` // int
Amount string `json:"amount";orm:"column(amount)"` // int64
TradeChannel string `json:"trade_channel";orm:"column(trade_channel)"` // int
ChannelSerial string `json:"channel_serial";orm:"column(channel_serial)"` // string
Status string `json:"status";orm:"column(status);size(1)"` // int
TradeTime string `json:"trade_time";orm:"column(trade_time);type(datetime)"` // string
TradeFlow string `json:"trade_flow";orm:"column(trade_flow)"` // int
TradeType string `json:"trade_type";orm:"column(trade_type)"` // int
Balance string `json:"balance";orm:"column(balance)"` // int64
Remark string `json:"remark";orm:"column(remark)"` // string
OrderId string `json:"order_id";orm:"column(order_id)"` // string
}
type ResponseFunds struct {
Id string `json:"id";orm:"column(id)"` // int64
Uid string `json:"uid";orm:"column(uid)"` // int
Amount float64 `json:"amount";orm:"column(amount)"` // int64
TradeChannel string `json:"trade_channel";orm:"column(trade_channel)"` // int
ChannelSerial string `json:"channel_serial";orm:"column(channel_serial)"` // string
Status int `json:"status";orm:"column(status);size(1)"` // int
StatusDesc string `json:"status_desc";orm:"column(status_desc);size(1)"` // int
TradeTime string `json:"trade_time";orm:"column(trade_time);type(datetime)"` // string
TradeFlow string `json:"trade_flow";orm:"column(trade_flow)"` // int
TradeType string `json:"trade_type";orm:"column(trade_type)"` // int
Balance float64 `json:"balance";orm:"column(balance)"` // int64
Remark string `json:"remark";orm:"column(remark)"` // string
OrderId string `json:"order_id";orm:"column(order_id)"` // string
}
type IncomeAndExpenseRsponse struct {
Uid string `json:"uid";orm:"column(uid)"` // int
Amount string `json:"amount";orm:"column(amount)"`
Time string `json:"time";orm:"column(time);type(datetime)"`
}
......@@ -50,6 +50,7 @@ type TaskType struct {
SignUrl string `json:"sign_url";orm:"column(sign_url)"`
Username string `json:"username";orm:"column(username)"`
Password string `json:"password";orm:"column(password)"`
Model string `json:"model";orm:"column(model)"`
BaseModel string `json:"base_model";orm:"column(base_model)"`
Examples string `json:"examples";orm:"column(examples)"`
ApiDocUrl string `json:"api_doc_url";orm:"column(api_doc_url)"`
......@@ -65,6 +66,7 @@ type NewTaskType struct {
Id int `orm:"column(id);auto"`
Name string `json:"name";orm:"column(desc)"`
BaseModel string `json:"base_model";orm:"column(desc)"`
Model string `json:"model";orm:"column(model)"`
Version string `json:"version";orm:"column(desc)"`
Desc string `json:"desc";orm:"column(desc);size(20)"`
Price float64 `json:"price";orm:"column(price)"`
......@@ -102,6 +104,7 @@ type Model struct {
Type int `json:"type";orm:"column(type)"`
ApiPath string `json:"api_path";orm:"column(api_path)"`
BaseModel string `json:"base_model";orm:"column(base_model)"`
Model string `json:"model";orm:"column(model)"`
Examples string `json:"examples";orm:"column(examples)"`
ApiDocUrl string `json:"api_doc_url";orm:"column(api_doc_url)"`
ApiDocContent string `json:"api_doc_content";orm:"column(api_doc_content)"`
......@@ -117,6 +120,7 @@ type ResonseModel struct {
Type int `json:"type";orm:"column(type)"`
ApiPath string `json:"api_path";orm:"column(api_path)"`
BaseModel string `json:"base_model";orm:"column(base_model)"`
Model string `json:"model";orm:"column(model)"`
Examples interface{} `json:"examples";orm:"column(examples)"`
ApiDocUrl string `json:"api_doc_url,omitempty";orm:"column(api_doc_url)"`
ApiDocContent string `json:"api_doc_content,omitempty";orm:"column(api_doc_content)"`
......@@ -128,6 +132,7 @@ type Bills struct {
//Key int `orm:"column(key);auto"`
Id string `json:"id";orm:"column(id)"`
Type string `json:"type";orm:"column(type)"`
Kind int `json:"kind,omitempty"`
Uid string `json:"uid";orm:"column(uid)"`
ProfitAcc string `json:"profit_acc";orm:"column(profit_acc)"`
Fee string `json:"fee";orm:"column(fee)"`
......@@ -143,6 +148,8 @@ type Bills struct {
Desc string `json:"desc,omitempty"`
TaskType string `json:"task_type,omitempty"`
Balance int64 `json:"balance,omitempty"`
BaseModel string `json:"base_model,omitempty"`
Model string `json:"model,omitempty"`
}
type TotalType struct {
......
......@@ -12,4 +12,5 @@ func init() {
beego.AutoPrefix("api", &controllers.FundsController{})
beego.AutoPrefix("api", &controllers.UserLevelController{})
beego.AutoPrefix("api", &controllers.TaskController{})
beego.AutoPrefix("api", &controllers.MonitorController{})
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment