diff --git a/.gitignore b/.gitignore index 0a56a16..ca060ca 100644 --- a/.gitignore +++ b/.gitignore @@ -2,5 +2,6 @@ go.sum account/ gen_result/ -etc/service.yaml -client/ \ No newline at end of file +etc/notification.yaml +client/ +.DS_Store \ No newline at end of file diff --git a/Makefile b/Makefile index 1d51c21..785dc15 100644 --- a/Makefile +++ b/Makefile @@ -21,7 +21,7 @@ fmt: # 格式優化 .PHONY: gen-rpc gen-rpc: # 建立 rpc code - $(GO_CTL_NAME) rpc protoc ./generate/protobuf/service.proto -m --style=$(GO_ZERO_STYLE) --go_out=./gen_result/pb --go-grpc_out=./gen_result/pb --zrpc_out=. + $(GO_CTL_NAME) rpc protoc ./generate/protobuf/notification.proto -m --style=$(GO_ZERO_STYLE) --go_out=./gen_result/pb --go-grpc_out=./gen_result/pb --zrpc_out=. copy ./etc/service.yaml ./etc/service.example.yaml go mod tidy @echo "Generate core-api files successfully" diff --git a/client/senderservice/sender_service.go b/client/senderservice/sender_service.go index 33bcb18..bbc3d18 100644 --- a/client/senderservice/sender_service.go +++ b/client/senderservice/sender_service.go @@ -1,5 +1,5 @@ // Code generated by goctl. DO NOT EDIT. -// Source: service.proto +// Source: notification.proto package senderservice diff --git a/etc/service.yaml b/etc/service.yaml new file mode 100644 index 0000000..319ba6f --- /dev/null +++ b/etc/service.yaml @@ -0,0 +1,16 @@ +Name: service.rpc +ListenOn: 0.0.0.0:8080 +Etcd: + Hosts: + - 127.0.0.1:2379 + Key: service.rpc +SMTP: + Host: smtp.mailgun.org + Port: 25 + User: postmaster@code.30cm.net + Password: 9015592e10f385e4f16705e00a5e0d3d-2b91eb47-31205b4e + +SMSSender: + User: daniel@30cm.net + Password : test123 + diff --git a/generate/protobuf/service.proto b/generate/protobuf/notification.proto similarity index 100% rename from generate/protobuf/service.proto rename to generate/protobuf/notification.proto diff --git a/internal/server/senderservice/sender_service_server.go b/internal/server/senderservice/sender_service_server.go index 99f6d32..6e9e1a1 100644 --- a/internal/server/senderservice/sender_service_server.go +++ b/internal/server/senderservice/sender_service_server.go @@ -1,5 +1,5 @@ // Code generated by goctl. DO NOT EDIT. -// Source: service.proto +// Source: notification.proto package server @@ -7,7 +7,7 @@ import ( "context" "app-cloudep-notification-service/gen_result/pb/notification" - senderservicelogic "app-cloudep-notification-service/internal/logic/senderservice" + "app-cloudep-notification-service/internal/logic/senderservice" "app-cloudep-notification-service/internal/svc" ) diff --git a/service.go b/notification.go similarity index 92% rename from service.go rename to notification.go index e202e4e..b35a92c 100644 --- a/service.go +++ b/notification.go @@ -16,7 +16,7 @@ import ( "google.golang.org/grpc/reflection" ) -var configFile = flag.String("f", "etc/service.yaml", "the config file") +var configFile = flag.String("f", "etc/notification.yaml", "the config file") func main() { flag.Parse()