Commit 3c1479e0 authored by Your Name's avatar Your Name

delete swagger

parent 7967213e
FROM golang:1.21.3 AS base FROM golang:1.21.6-alpine3.18 AS build
#FROM golang:1.20.6-alpine3.18 AS base #FROM golang:1.20.6-alpine3.18 AS build
#FROM golang:1.21.3 AS base #FROM golang:1.21.3 AS base
#FROM golang:1.20.6-alpine3.18 AS build #FROM golang:1.20.6-alpine3.18 AS build
WORKDIR /go/src/github.com/odysseus/ WORKDIR /go/src/github.com/odysseus/
ENV https_proxy 'http://192.168.1.180:1080' ENV https_proxy 'http://192.168.1.180:1080'
...@@ -16,21 +15,37 @@ COPY ./payment ./payment ...@@ -16,21 +15,37 @@ COPY ./payment ./payment
COPY ./odysseus-protocol ./odysseus-protocol COPY ./odysseus-protocol ./odysseus-protocol
#RUN pwd && ls && sleep 10 #RUN pwd && ls && sleep 10
# RUN go mod tidy # RUN go mod tidy
#RUN go build -o /go-kafka #RUN go build -o /go-kafka
RUN cd go-kafka && go mod tidy && go build -o /ai-api-mgr RUN cd go-kafka && go mod tidy && go build -o /ai-api-mgr
RUN ls /ai-api-mgr && sleep 30
FROM alpine FROM alpine
WORKDIR /root WORKDIR /root
RUN ls /usr/bin/ && sleep 10
COPY --from=base /ai-api-mgr /usr/bin/ COPY --from=build /ai-api-mgr /usr/bin/ai-api-mgr
RUN ls /usr/bin/ai-api-mgr && sleep 10
#ENTRYPOINT [ "/usr/bin/ai-api-mgr" ]
# FROM alpine
# WORKDIR /root
# COPY --from=base /ai-api-mgr /usr/bin/
# RUN ls /usr/bin/ai-api-mgr && sleep 30
# ENTRYPOINT [ "/usr/bin/ai-api-mgr" ]
# RUN ls /ai-api-mgr && sleep 30
# FROM alpine
# WORKDIR /root
# RUN ls /usr/bin/ && sleep 10
# COPY --from=base /ai-api-mgr /usr/bin/
# RUN ls /usr/bin/ai-api-mgr && sleep 10
......
module go-kafka module github.com/odysseus/go-kafka
go 1.21.3 go 1.21.3
...@@ -8,15 +8,17 @@ replace github.com/odysseus/payment => ../payment ...@@ -8,15 +8,17 @@ replace github.com/odysseus/payment => ../payment
require ( require (
github.com/IBM/sarama v1.42.1 github.com/IBM/sarama v1.42.1
github.com/gofiber/contrib/swagger v1.1.1
github.com/gofiber/fiber/v2 v2.52.0 github.com/gofiber/fiber/v2 v2.52.0
github.com/gogo/protobuf v1.3.2 github.com/gogo/protobuf v1.3.2
github.com/odysseus/odysseus-protocol v0.0.0-00010101000000-000000000000 github.com/odysseus/odysseus-protocol v0.0.0-00010101000000-000000000000
github.com/odysseus/payment v0.0.0-00010101000000-000000000000
github.com/questdb/go-questdb-client/v2 v2.0.0
github.com/swaggo/swag v1.16.3
) )
require ( require (
github.com/KyleBanks/depth v1.2.1 // indirect github.com/KyleBanks/depth v1.2.1 // indirect
github.com/PuerkitoBio/purell v1.1.1 // indirect
github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
github.com/andybalholm/brotli v1.0.5 // indirect github.com/andybalholm/brotli v1.0.5 // indirect
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
github.com/astaxie/beego v1.12.3 // indirect github.com/astaxie/beego v1.12.3 // indirect
...@@ -37,7 +39,6 @@ require ( ...@@ -37,7 +39,6 @@ require (
github.com/go-openapi/swag v0.22.3 // indirect github.com/go-openapi/swag v0.22.3 // indirect
github.com/go-openapi/validate v0.22.1 // indirect github.com/go-openapi/validate v0.22.1 // indirect
github.com/go-sql-driver/mysql v1.7.1 // indirect github.com/go-sql-driver/mysql v1.7.1 // indirect
github.com/gofiber/contrib/swagger v1.1.1 // indirect
github.com/golang/snappy v0.0.4 // indirect github.com/golang/snappy v0.0.4 // indirect
github.com/gomodule/redigo v2.0.0+incompatible // indirect github.com/gomodule/redigo v2.0.0+incompatible // indirect
github.com/google/uuid v1.5.0 // indirect github.com/google/uuid v1.5.0 // indirect
...@@ -52,23 +53,19 @@ require ( ...@@ -52,23 +53,19 @@ require (
github.com/jcmturner/rpc/v2 v2.0.3 // indirect github.com/jcmturner/rpc/v2 v2.0.3 // indirect
github.com/josharian/intern v1.0.0 // indirect github.com/josharian/intern v1.0.0 // indirect
github.com/klauspost/compress v1.17.0 // indirect github.com/klauspost/compress v1.17.0 // indirect
github.com/konsorten/go-windows-terminal-sequences v1.0.2 // indirect
github.com/mailru/easyjson v0.7.7 // indirect github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-runewidth v0.0.15 // indirect github.com/mattn/go-runewidth v0.0.15 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/odysseus/payment v0.0.0-00010101000000-000000000000 // indirect
github.com/oklog/ulid v1.3.1 // indirect github.com/oklog/ulid v1.3.1 // indirect
github.com/pierrec/lz4/v4 v4.1.18 // indirect github.com/pierrec/lz4/v4 v4.1.18 // indirect
github.com/pkg/errors v0.9.1 // indirect github.com/pkg/errors v0.9.1 // indirect
github.com/questdb/go-questdb-client/v2 v2.0.0 // indirect
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
github.com/redis/go-redis/v9 v9.4.0 // indirect github.com/redis/go-redis/v9 v9.4.0 // indirect
github.com/rivo/uniseg v0.2.0 // indirect github.com/rivo/uniseg v0.2.0 // indirect
github.com/shopspring/decimal v1.3.1 // indirect github.com/rogpeppe/go-internal v1.12.0 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect github.com/sirupsen/logrus v1.9.3 // indirect
github.com/swaggo/swag v1.16.2 // indirect
github.com/valyala/bytebufferpool v1.0.0 // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect
github.com/valyala/fasthttp v1.51.0 // indirect github.com/valyala/fasthttp v1.51.0 // indirect
github.com/valyala/tcplisten v1.0.0 // indirect github.com/valyala/tcplisten v1.0.0 // indirect
...@@ -76,7 +73,6 @@ require ( ...@@ -76,7 +73,6 @@ require (
golang.org/x/crypto v0.14.0 // indirect golang.org/x/crypto v0.14.0 // indirect
golang.org/x/net v0.17.0 // indirect golang.org/x/net v0.17.0 // indirect
golang.org/x/sys v0.15.0 // indirect golang.org/x/sys v0.15.0 // indirect
golang.org/x/text v0.13.0 // indirect
golang.org/x/tools v0.14.0 // indirect golang.org/x/tools v0.14.0 // indirect
google.golang.org/protobuf v1.32.0 // indirect google.golang.org/protobuf v1.32.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect
......
This diff is collapsed.
...@@ -25,8 +25,6 @@ import ( ...@@ -25,8 +25,6 @@ import (
"github.com/odysseus/payment/cachedata" "github.com/odysseus/payment/cachedata"
"github.com/odysseus/payment/model" "github.com/odysseus/payment/model"
"github.com/gofiber/contrib/swagger"
) )
var ( var (
...@@ -303,18 +301,23 @@ type ResponseJson struct { ...@@ -303,18 +301,23 @@ type ResponseJson struct {
TaskError string TaskError string
} }
func newCache() *cachedata.CacheData { func newCache(redisAddr, redisPass, mysqlIP, dbName, user, passwd string, port int) *cachedata.CacheData {
_cache := cachedata.NewCacheData(context.Background(), cachedata.RedisConnParam{ _cache := cachedata.NewCacheData(context.Background(), cachedata.RedisConnParam{
Addr: "192.168.1.10:6379", //Addr: "192.168.1.10:6379",
Addr: redisAddr,
Password: "", Password: "",
DbIndex: 0, DbIndex: 0,
}, model.DbConfig{ }, model.DbConfig{
Host: "192.168.1.211", //Host: "192.168.1.211",
Port: 3306, Host: mysqlIP,
DbName: "liuxuzhong", Port: port,
Passwd: "12345678", DbName: dbName,
User: "root", Passwd: passwd,
User: user,
// DbName: "liuxuzhong",
// Passwd: "12345678",
// User: "root",
}) })
return _cache return _cache
} }
...@@ -381,14 +384,23 @@ func main() { ...@@ -381,14 +384,23 @@ func main() {
var questAddr, kafkaBroker, callbackAddrP, listenIpPort, aigcProduceTopic, aigcConsumerTopic string var questAddr, kafkaBroker, callbackAddrP, listenIpPort, aigcProduceTopic, aigcConsumerTopic string
var redisAddr, mysqlAddr string var redisAddr, redisPassWd, mysqlAddr string
var mysqlPort int
var mysqlDbName, mysqlUser, mysqlPassWd string
//var redisPassWd string
//flag.StringVar(&questAddr, "questAddr", "192.168.1.10:9009", "questDbAddr") //flag.StringVar(&questAddr, "questAddr", "192.168.1.10:9009", "questDbAddr")
flag.StringVar(&questAddr, "questAddr", "localhost:9009", "questDbAddr") flag.StringVar(&questAddr, "questAddr", "localhost:9009", "questDbAddr")
flag.StringVar(&kafkaBroker, "kafkaBroker", "localhost:9092", "single kafka broker") flag.StringVar(&kafkaBroker, "kafkaBroker", "localhost:9092", "single kafka broker")
flag.StringVar(&redisAddr, "redisAddr", "localhost:6379", "Redis Addr") flag.StringVar(&redisAddr, "redisAddr", "localhost:6379", "Redis Addr")
flag.StringVar(&mysqlAddr, "mysqlAddr", "localhost:3306", "Mysql Addr") flag.StringVar(&redisPassWd, "redisPassWd", "", "Redis password")
flag.StringVar(&mysqlAddr, "mysqlAddr", "localhost", "onely ip address")
flag.IntVar(&mysqlPort, "mysqlPort", 3306, "onely port")
flag.StringVar(&mysqlDbName, "mysqlDbName", "liuxuzhong", "mysql db name")
flag.StringVar(&mysqlUser, "mysqlUser", "liuxuzhong", "connect to mysql user")
flag.StringVar(&mysqlPassWd, "mysqlPassWd", "12345678", "mysql user password")
flag.StringVar(&callbackAddrP, "callbackIpAddr", "localhost:6001", "ip:port") flag.StringVar(&callbackAddrP, "callbackIpAddr", "localhost:6001", "ip:port")
flag.StringVar(&listenIpPort, "listenIpPort", "0.0.0.0:6001", "api listen on ip:port") flag.StringVar(&listenIpPort, "listenIpPort", "0.0.0.0:6001", "api listen on ip:port")
...@@ -398,14 +410,20 @@ func main() { ...@@ -398,14 +410,20 @@ func main() {
flag.Parse() flag.Parse()
fmt.Println("questAddr|", questAddr) fmt.Println("questAddr|", questAddr)
fmt.Println("redisAddr|", redisAddr)
fmt.Println("mysqlAddr|", mysqlAddr)
fmt.Println("kafkaBroker|", kafkaBroker) fmt.Println("kafkaBroker|", kafkaBroker)
fmt.Println("callbackIpAddr|", callbackAddrP) fmt.Println("callbackIpAddr|", callbackAddrP)
fmt.Println("listenIpPort|", listenIpPort) fmt.Println("listenIpPort|", listenIpPort)
fmt.Println("aigcProduceTopic|", aigcProduceTopic) fmt.Println("aigcProduceTopic|", aigcProduceTopic)
fmt.Println("aigcConsumerTopic|", aigcConsumerTopic) fmt.Println("aigcConsumerTopic|", aigcConsumerTopic)
fmt.Println("redisAddr|", redisAddr)
fmt.Println("redisPassWd|", redisPassWd)
fmt.Println("mysqlAddr|", mysqlAddr)
fmt.Println("mysqlPort|", mysqlPort)
fmt.Println("mysqlDbName|", mysqlDbName)
fmt.Println("mysqlUser|", mysqlUser)
fmt.Println("mysqlPassWd|", mysqlPassWd)
kafkaBrokers = []string{kafkaBroker} kafkaBrokers = []string{kafkaBroker}
callbackAddr = callbackAddrP callbackAddr = callbackAddrP
...@@ -419,7 +437,11 @@ func main() { ...@@ -419,7 +437,11 @@ func main() {
createTable(questAddr[:idx], createTaskTableSql) createTable(questAddr[:idx], createTaskTableSql)
createTable(questAddr[:idx], createBillsTableSql) createTable(questAddr[:idx], createBillsTableSql)
cache = newCache() // DbName: "liuxuzhong",
// Passwd: "12345678",
// User: "root",
cache = newCache(redisAddr, redisPassWd, mysqlAddr, mysqlDbName, mysqlUser, mysqlPassWd, mysqlPort)
// Create a WaitGroup to synchronize goroutines. // Create a WaitGroup to synchronize goroutines.
wg := &sync.WaitGroup{} wg := &sync.WaitGroup{}
...@@ -442,14 +464,14 @@ func main() { ...@@ -442,14 +464,14 @@ func main() {
// Create a new instance of the Fiber web framework. // Create a new instance of the Fiber web framework.
app := fiber.New() app := fiber.New()
cfg := swagger.Config{ // cfg := swagger.Config{
BasePath: "/", // BasePath: "/",
FilePath: "./docs/swagger.json", // FilePath: "./docs/swagger.json",
Path: "swagger", // Path: "swagger",
Title: "Swagger API Docs", // Title: "Swagger API Docs",
} // }
app.Use(swagger.New(cfg)) // app.Use(swagger.New(cfg))
apiGroup := app.Group("/api") apiGroup := app.Group("/api")
jwtGroup := app.Group("/jwt") jwtGroup := app.Group("/jwt")
......
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