diff --git a/protoc-gen-go-crud/api/v1/users/users.proto b/protoc-gen-go-crud/api/v1/users/users.proto index 1d7e296..ddff99b 100644 --- a/protoc-gen-go-crud/api/v1/users/users.proto +++ b/protoc-gen-go-crud/api/v1/users/users.proto @@ -14,7 +14,7 @@ option go_package = "bitbucket.org/antalphadev/earn/api/v1/users;usersV1"; // 用户管理 -service Users { +service User { // 用户列表 rpc ListUsers(ListUsersRequest) returns (ListUsersReply) { option (google.api.http) = {get: "/v1/users"}; diff --git a/protoc-gen-go-crud/protoc-gen-go-crud b/protoc-gen-go-crud/protoc-gen-go-crud index b781c48..c584331 100755 Binary files a/protoc-gen-go-crud/protoc-gen-go-crud and b/protoc-gen-go-crud/protoc-gen-go-crud differ diff --git a/protoc-gen-go-crud/repositories/wire.go b/protoc-gen-go-crud/repositories/wire.go index 82ce685..ae23184 100644 --- a/protoc-gen-go-crud/repositories/wire.go +++ b/protoc-gen-go-crud/repositories/wire.go @@ -14,7 +14,7 @@ type TemplateParams struct { func GenerateWireFile(path string, sets []string) error { // 定义模板 - tmpl := `package deliveries + tmpl := `package repositories import "github.com/google/wire" diff --git a/protoc-gen-go-crud/usecase/template.go b/protoc-gen-go-crud/usecase/template.go index cbb73df..ccd558e 100644 --- a/protoc-gen-go-crud/usecase/template.go +++ b/protoc-gen-go-crud/usecase/template.go @@ -11,7 +11,7 @@ var crudTemplate = ` {{$firstLetter := (GetFirstLetter .ServiceType)}} -type I{{.ServiceType}}Usecase interface { +type I{{.ServiceType}}UseCase interface { Create{{.ServiceType}}(ctx context.Context,in *{{.PackageName}}.Create{{.ServiceType}}Request) error Update{{.ServiceType}}(ctx context.Context,in *{{.PackageName}}.Update{{.ServiceType}}Request) error Delete{{.ServiceType}}(ctx context.Context,in *{{.PackageName}}.Delete{{.ServiceType}}Request) error @@ -23,7 +23,7 @@ type I{{.ServiceType}}Usecase interface { type {{.ServiceType}}UseCase struct { } -func New{{.ServiceType}}UseCase() I{{.ServiceType}}Usecase { +func New{{.ServiceType}}UseCase() I{{.ServiceType}}UseCase { return &{{.ServiceType}}UseCase{} } diff --git a/protoc-gen-go-crud/usecase/wire.go b/protoc-gen-go-crud/usecase/wire.go index 5e5bf5e..43b9e2d 100644 --- a/protoc-gen-go-crud/usecase/wire.go +++ b/protoc-gen-go-crud/usecase/wire.go @@ -14,7 +14,7 @@ type TemplateParams struct { func GenerateWireFile(path string, sets []string) error { // 定义模板 - tmpl := `package deliveries + tmpl := `package usecase import "github.com/google/wire"