From 731989dcc74a8ce7d96a0d523b4dac746b1775cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E9=A2=A2=E7=90=A6?= <13436010+shizuizaodezaoan@user.noreply.gitee.com> Date: Sat, 30 Mar 2024 11:06:03 +0800 Subject: [PATCH] first --- .gitignore | 1 - discover.go | 10 +- discoverclient/discover.go | 4 +- go.mod | 125 +++++++++++++++++++++ internal/logic/createdetaillogic.go | 8 +- internal/logic/creategoodsdiscoverlogic.go | 8 +- internal/logic/searchgoodsdiscoverlogic.go | 8 +- internal/server/discoverserver.go | 6 +- internal/svc/servicecontext.go | 2 +- mysql/mysql.go | 2 +- 10 files changed, 150 insertions(+), 24 deletions(-) create mode 100644 go.mod diff --git a/.gitignore b/.gitignore index 0e2aa3e..3b798ed 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,2 @@ -go.mod go.sum etc \ No newline at end of file diff --git a/discover.go b/discover.go index c903330..100fc77 100644 --- a/discover.go +++ b/discover.go @@ -14,11 +14,11 @@ import ( "google.golang.org/grpc" "google.golang.org/grpc/reflection" - "discover-rpc/discover" - "discover-rpc/internal/config" - "discover-rpc/internal/server" - "discover-rpc/internal/svc" - "discover-rpc/mysql" + "gitee.com/A1001574000/discover-rpc/discover" + "gitee.com/A1001574000/discover-rpc/internal/config" + "gitee.com/A1001574000/discover-rpc/internal/server" + "gitee.com/A1001574000/discover-rpc/internal/svc" + "gitee.com/A1001574000/discover-rpc/mysql" ) var configFile = flag.String("f", "etc/discover.yaml", "the config file") diff --git a/discoverclient/discover.go b/discoverclient/discover.go index 6bf9652..054ebce 100644 --- a/discoverclient/discover.go +++ b/discoverclient/discover.go @@ -6,10 +6,12 @@ package discoverclient import ( "context" - "discover-rpc/discover" + "github.com/zeromicro/go-zero/zrpc" "google.golang.org/grpc" + + "gitee.com/A1001574000/discover-rpc/discover" ) type ( diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..3a9df86 --- /dev/null +++ b/go.mod @@ -0,0 +1,125 @@ +module gitee.com/A1001574000/discover-rpc + +go 1.22.1 + +require ( + github.com/ghodss/yaml v1.0.0 + github.com/zeromicro/go-zero v1.6.3 + google.golang.org/grpc v1.62.1 + google.golang.org/protobuf v1.33.0 + gorm.io/driver/mysql v1.5.6 // indirect + gorm.io/gorm v1.25.9 +) + +require github.com/BarnabyCharles/frame v0.0.0-20240328110456-66fd1b4ec1ae + +require ( + github.com/aliyun/alibaba-cloud-sdk-go v1.61.1800 // indirect + github.com/buger/jsonparser v1.1.1 // indirect + github.com/fsnotify/fsnotify v1.7.0 // indirect + github.com/go-errors/errors v1.0.1 // indirect + github.com/hashicorp/hcl v1.0.0 // indirect + github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af // indirect + github.com/magiconair/properties v1.8.7 // indirect + github.com/mitchellh/mapstructure v1.5.0 // indirect + github.com/nacos-group/nacos-sdk-go v1.1.4 // indirect + github.com/pkg/errors v0.9.1 // indirect + github.com/sagikazarmark/locafero v0.4.0 // indirect + github.com/sagikazarmark/slog-shim v0.1.0 // indirect + github.com/sourcegraph/conc v0.3.0 // indirect + github.com/spf13/afero v1.11.0 // indirect + github.com/spf13/cast v1.6.0 // indirect + github.com/spf13/pflag v1.0.5 // indirect + github.com/spf13/viper v1.18.2 // indirect + github.com/subosito/gotenv v1.6.0 // indirect + golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect + golang.org/x/sync v0.6.0 // indirect + gopkg.in/ini.v1 v1.67.0 // indirect + gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect +) + +require ( + github.com/BurntSushi/toml v1.2.0 // indirect + github.com/beorn7/perks v1.0.1 // indirect + github.com/cenkalti/backoff/v4 v4.2.1 // indirect + github.com/cespare/xxhash/v2 v2.2.0 // indirect + github.com/coreos/go-semver v0.3.1 // indirect + github.com/coreos/go-systemd/v22 v22.5.0 // indirect + github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect + github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect + github.com/emicklei/go-restful/v3 v3.11.0 // indirect + github.com/fatih/color v1.16.0 // indirect + github.com/go-logr/logr v1.3.0 // indirect + github.com/go-logr/stdr v1.2.2 // indirect + github.com/go-openapi/jsonpointer v0.19.6 // indirect + github.com/go-openapi/jsonreference v0.20.2 // indirect + github.com/go-openapi/swag v0.22.4 // indirect + github.com/go-sql-driver/mysql v1.7.1 // indirect + github.com/gogo/protobuf v1.3.2 // indirect + github.com/golang/mock v1.6.0 // indirect + github.com/golang/protobuf v1.5.3 // indirect + github.com/google/gnostic-models v0.6.8 // indirect + github.com/google/go-cmp v0.6.0 // indirect + github.com/google/gofuzz v1.2.0 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.0 // indirect + github.com/jinzhu/inflection v1.0.0 // indirect + github.com/jinzhu/now v1.1.5 // indirect + github.com/josharian/intern v1.0.0 // indirect + github.com/json-iterator/go v1.1.12 // indirect + github.com/mailru/easyjson v0.7.7 // indirect + github.com/mattn/go-colorable v0.1.13 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect + github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect + github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect + github.com/modern-go/reflect2 v1.0.2 // indirect + github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect + github.com/openzipkin/zipkin-go v0.4.2 // indirect + github.com/pelletier/go-toml/v2 v2.1.1 // indirect + github.com/prometheus/client_golang v1.18.0 // indirect + github.com/prometheus/client_model v0.5.0 // indirect + github.com/prometheus/common v0.45.0 // indirect + github.com/prometheus/procfs v0.12.0 // indirect + github.com/redis/go-redis/v9 v9.4.0 // indirect + github.com/spaolacci/murmur3 v1.1.0 // indirect + go.etcd.io/etcd/api/v3 v3.5.12 // indirect + go.etcd.io/etcd/client/pkg/v3 v3.5.12 // indirect + go.etcd.io/etcd/client/v3 v3.5.12 // indirect + go.opentelemetry.io/otel v1.19.0 // indirect + go.opentelemetry.io/otel/exporters/jaeger v1.17.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.19.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.19.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.19.0 // indirect + go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.19.0 // indirect + go.opentelemetry.io/otel/exporters/zipkin v1.19.0 // indirect + go.opentelemetry.io/otel/metric v1.19.0 // indirect + go.opentelemetry.io/otel/sdk v1.19.0 // indirect + go.opentelemetry.io/otel/trace v1.19.0 // indirect + go.opentelemetry.io/proto/otlp v1.0.0 // indirect + go.uber.org/atomic v1.10.0 // indirect + go.uber.org/automaxprocs v1.5.3 // indirect + go.uber.org/multierr v1.9.0 // indirect + go.uber.org/zap v1.24.0 // indirect + golang.org/x/net v0.21.0 // indirect + golang.org/x/oauth2 v0.16.0 // indirect + golang.org/x/sys v0.17.0 // indirect + golang.org/x/term v0.17.0 // indirect + golang.org/x/text v0.14.0 // indirect + golang.org/x/time v0.5.0 // indirect + google.golang.org/appengine v1.6.8 // indirect + google.golang.org/genproto v0.0.0-20240123012728-ef4313101c80 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20240123012728-ef4313101c80 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240123012728-ef4313101c80 // indirect + gopkg.in/inf.v0 v0.9.1 // indirect + gopkg.in/yaml.v2 v2.4.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect + k8s.io/api v0.29.2 // indirect + k8s.io/apimachinery v0.29.2 // indirect + k8s.io/client-go v0.29.2 // indirect + k8s.io/klog/v2 v2.110.1 // indirect + k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 // indirect + k8s.io/utils v0.0.0-20230726121419-3b25d923346b // indirect + sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect + sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect + sigs.k8s.io/yaml v1.3.0 // indirect +) diff --git a/internal/logic/createdetaillogic.go b/internal/logic/createdetaillogic.go index df966dc..75d48a4 100644 --- a/internal/logic/createdetaillogic.go +++ b/internal/logic/createdetaillogic.go @@ -4,12 +4,12 @@ import ( "context" "net/http" - "discover-rpc/discover" - "discover-rpc/internal/svc" - "discover-rpc/model" - "github.com/zeromicro/go-zero/core/logx" "google.golang.org/grpc/status" + + "gitee.com/A1001574000/discover-rpc/discover" + "gitee.com/A1001574000/discover-rpc/internal/svc" + "gitee.com/A1001574000/discover-rpc/model" ) type CreateDetailLogic struct { diff --git a/internal/logic/creategoodsdiscoverlogic.go b/internal/logic/creategoodsdiscoverlogic.go index 7a65d2c..b1fcd30 100644 --- a/internal/logic/creategoodsdiscoverlogic.go +++ b/internal/logic/creategoodsdiscoverlogic.go @@ -6,11 +6,11 @@ import ( "google.golang.org/grpc/status" - "discover-rpc/discover" - "discover-rpc/internal/svc" - "discover-rpc/model" - "github.com/zeromicro/go-zero/core/logx" + + "gitee.com/A1001574000/discover-rpc/discover" + "gitee.com/A1001574000/discover-rpc/internal/svc" + "gitee.com/A1001574000/discover-rpc/model" ) type CreateGoodsDiscoverLogic struct { diff --git a/internal/logic/searchgoodsdiscoverlogic.go b/internal/logic/searchgoodsdiscoverlogic.go index 5ae6019..32ca6b7 100644 --- a/internal/logic/searchgoodsdiscoverlogic.go +++ b/internal/logic/searchgoodsdiscoverlogic.go @@ -3,11 +3,11 @@ package logic import ( "context" - "discover-rpc/discover" - "discover-rpc/internal/svc" - "discover-rpc/model" - "github.com/zeromicro/go-zero/core/logx" + + "gitee.com/A1001574000/discover-rpc/discover" + "gitee.com/A1001574000/discover-rpc/internal/svc" + "gitee.com/A1001574000/discover-rpc/model" ) type SearchGoodsDiscoverLogic struct { diff --git a/internal/server/discoverserver.go b/internal/server/discoverserver.go index e78ac99..bb377f3 100644 --- a/internal/server/discoverserver.go +++ b/internal/server/discoverserver.go @@ -6,9 +6,9 @@ package server import ( "context" - "discover-rpc/discover" - "discover-rpc/internal/logic" - "discover-rpc/internal/svc" + "gitee.com/A1001574000/discover-rpc/discover" + "gitee.com/A1001574000/discover-rpc/internal/logic" + "gitee.com/A1001574000/discover-rpc/internal/svc" ) type DiscoverServer struct { diff --git a/internal/svc/servicecontext.go b/internal/svc/servicecontext.go index fc1ba41..85f1900 100644 --- a/internal/svc/servicecontext.go +++ b/internal/svc/servicecontext.go @@ -1,6 +1,6 @@ package svc -import "discover-rpc/internal/config" +import "gitee.com/A1001574000/discover-rpc/internal/config" type ServiceContext struct { Config config.Config diff --git a/mysql/mysql.go b/mysql/mysql.go index 0f17318..2fc3776 100644 --- a/mysql/mysql.go +++ b/mysql/mysql.go @@ -5,7 +5,7 @@ import ( "github.com/BarnabyCharles/frame/databases/mysql" - "discover-rpc/model" + "gitee.com/A1001574000/discover-rpc/model" ) func NewAutoMigrate() error { -- Gitee