diff --git a/go.mod b/go.mod index 5fb8ec6..c1657e6 100644 --- a/go.mod +++ b/go.mod @@ -16,6 +16,7 @@ require ( ) require ( + github.com/aws/aws-sdk-go v1.54.2 // indirect github.com/cockroachdb/cockroach-go/v2 v2.1.1 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 // indirect @@ -24,6 +25,7 @@ require ( github.com/jackc/pgpassfile v1.0.0 // indirect github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect github.com/jackc/puddle/v2 v2.2.1 // indirect + github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/klauspost/compress v1.15.11 // indirect github.com/lib/pq v1.10.9 // indirect github.com/pierrec/lz4/v4 v4.1.16 // indirect diff --git a/go.sum b/go.sum index e9a9efe..062b2cf 100644 --- a/go.sum +++ b/go.sum @@ -3,6 +3,8 @@ github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161/go.mod h1:xomTg6 github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= +github.com/aws/aws-sdk-go v1.54.2 h1:Wo6AVWcleNHrYa48YzfYz60hzxGRqsJrK5s/qePe+3I= +github.com/aws/aws-sdk-go v1.54.2/go.mod h1:eRwEWoyTWFMVYVQzKMNHWP5/RV4xIUGMQfXQHfHkpNU= github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ= github.com/cockroachdb/cockroach-go/v2 v2.1.1 h1:3XzfSMuUT0wBe1a3o5C0eOTcArhmmFAg2Jzh/7hhKqo= github.com/cockroachdb/cockroach-go/v2 v2.1.1/go.mod h1:7NtUnP6eK+l6k483WSYNrq3Kb23bWV10IRV1TyeSpwM= @@ -93,6 +95,9 @@ github.com/jackc/puddle/v2 v2.2.1 h1:RhxXJtFG022u4ibrCSMSiu5aOq1i77R3OHKNJj77OAk github.com/jackc/puddle/v2 v2.2.1/go.mod h1:vriiEXHvEE654aYKXXjOvZM39qJ0q+azkZFrfEOc3H4= github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= github.com/jinzhu/now v1.1.1/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= +github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= +github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= +github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= github.com/jmoiron/sqlx v1.3.1/go.mod h1:2BljVx/86SuTyjE+aPYlHCTNvZrnJXghYGpNiXLBMCQ= github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0= github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= @@ -304,6 +309,7 @@ gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EV gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/inconshreveable/log15.v2 v2.0.0-20180818164646-67afb5ed74ec/go.mod h1:aPpfJ7XW+gOuirDoZ8gHhLh3kZ1B08FtV2bbmy7Jv3s= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= 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= diff --git a/go.work.sum b/go.work.sum index 19cc150..a226d4d 100644 --- a/go.work.sum +++ b/go.work.sum @@ -20,6 +20,7 @@ github.com/andybalholm/brotli v1.0.4/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHG github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/apache/arrow/go/v10 v10.0.1/go.mod h1:YvhnlEePVnBS4+0z3fhPfUy7W1Ikj0Ih0vcRo/gZ1M0= github.com/apache/thrift v0.16.0/go.mod h1:PHK3hniurgQaNMZYaCLEqXKsYK8upmhPbmdP2FXSqgU= +github.com/aws/aws-sdk-go v1.49.6 h1:yNldzF5kzLBRvKlKz1S0bkvc2+04R1kt13KfBWQBfFA= github.com/aws/aws-sdk-go v1.49.6/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= github.com/aws/aws-sdk-go-v2 v1.16.16/go.mod h1:SwiyXi/1zTUZ6KIAmLK5V5ll8SiURNUYOqTerZPaF9k= github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.8/go.mod h1:JTnlBSot91steJeti4ryyu/tLd4Sk84O5W22L7O2EQU= @@ -70,12 +71,21 @@ github.com/gorilla/handlers v1.4.2/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/ github.com/gorilla/mux v1.7.4/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c/go.mod h1:NMPJylDgVpX0MLRlPy15sqSwOFv/U1GZ2m21JhFfek0= github.com/hailocab/go-hostpool v0.0.0-20160125115350-e80d13ce29ed/go.mod h1:tMWxXQ9wFIaZeTI9F+hmhFiGpFmhOHzyShyFUhRm0H4= +github.com/jackc/chunkreader v1.0.0 h1:4s39bBR8ByfqH+DKm8rQA3E1LHZWB9XWcrz8fqaZbe0= +github.com/jackc/chunkreader/v2 v2.0.1 h1:i+RDz65UE+mmpjTfyz0MoVTnzeYxroil2G82ki7MGG8= +github.com/jackc/pgconn v1.14.3 h1:bVoTr12EGANZz66nZPkMInAV/KHD2TxH9npjXXgiB3w= github.com/jackc/pgconn v1.14.3/go.mod h1:RZbme4uasqzybK2RK5c65VsHxoyaml09lx3tXOcO/VM= github.com/jackc/pgerrcode v0.0.0-20220416144525-469b46aa5efa/go.mod h1:a/s9Lp5W7n/DD0VrVoyJ00FbP2ytTPDVOivvn2bMlds= +github.com/jackc/pgio v1.0.0 h1:g12B9UwVnzGhueNavwioyEEpAmqMe1E/BN9ES+8ovkE= +github.com/jackc/pgproto3 v1.1.0 h1:FYYE4yRw+AgI8wXIinMlNjBbp/UitDJwfj5LqqewP1A= +github.com/jackc/pgproto3/v2 v2.3.3 h1:1HLSx5H+tXR9pW3in3zaztoEwQYRC9SQaYUHjTSUOag= github.com/jackc/pgproto3/v2 v2.3.3/go.mod h1:WfJCnwN3HIg9Ish/j3sgWXnAfK8A9Y0bwXYU5xKaEdA= +github.com/jackc/pgtype v1.14.0 h1:y+xUdabmyMkJLyApYuPj38mW+aAIqCe5uuBB51rH3Vw= github.com/jackc/pgtype v1.14.0/go.mod h1:LUMuVrfsFfdKGLw+AFFVv6KtHOFMwRgDDzBt76IqCA4= +github.com/jackc/pgx/v4 v4.18.2 h1:xVpYkNR5pk5bMCZGfClbO962UIqVABcAGt7ha1s/FeU= github.com/jackc/pgx/v4 v4.18.2/go.mod h1:Ey4Oru5tH5sB6tV7hDmfWFahwF15Eb7DNXlRKx2CkVw= github.com/jackc/puddle v1.1.3 h1:JnPg/5Q9xVJGfjsO5CPUOjnJps1JaRUm8I9FXVCFK94= +github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= github.com/k0kubun/pp v2.3.0+incompatible/go.mod h1:GWse8YhT0p8pT4ir3ZgBbfZild3tgzSScAn6HmfYukg= github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0/go.mod h1:1NbS8ALrpOvjt0rHPNLyCIeMtbizbir8U//inJ+zuB8= diff --git a/lib/auth/auth_middleware.go b/lib/auth/auth_middleware.go new file mode 100644 index 0000000..024468e --- /dev/null +++ b/lib/auth/auth_middleware.go @@ -0,0 +1,77 @@ +package auth + +import ( + "context" + "errors" + "github.com/golang-jwt/jwt/v5" + "github.com/google/uuid" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" + "monify/lib" + "net/http" + "strings" +) + +type AuthMiddleware struct { + JwtSecret string +} + +func (m AuthMiddleware) HttpMiddleware(next http.Handler) http.Handler { + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + auth := r.Header.Get("Authorization") + if auth != "" { + token, err := validateBearerToken(auth, m.JwtSecret) + if err != nil { + http.Error(w, err.Error(), http.StatusUnauthorized) + return + } + ctx := context.WithValue(r.Context(), lib.UserIdContextKey{}, token) + r = r.WithContext(ctx) + } + next.ServeHTTP(w, r) + }) +} + +func (m AuthMiddleware) GrpcExtractUserId(ctx context.Context, req any, info *grpc.UnaryServerInfo) (uuid.UUID, error) { + md, exists := metadata.FromIncomingContext(ctx) + if !exists { + return uuid.Nil, nil + } + auths := md.Get("authorization") + if len(auths) == 0 { + return uuid.Nil, nil + } + auth := auths[0] + token, err := validateBearerToken(auth, m.JwtSecret) + if err != nil { + return uuid.Nil, status.Error(codes.Unauthenticated, err.Error()) + } + return token, nil + +} + +func validateBearerToken(token string, secret string) (uuid.UUID, error) { + if strings.HasPrefix(token, "Bearer ") { + tokenStr := token[7:] + token, err := jwt.ParseWithClaims(tokenStr, &jwt.RegisteredClaims{}, func(token *jwt.Token) (interface{}, error) { + return []byte(secret), nil + }) + if claims, ok := token.Claims.(*jwt.RegisteredClaims); ok { + userId, err := uuid.Parse(claims.Subject) + if err != nil { + return uuid.Nil, errors.New("invalid user id in token") + } + return userId, nil + } else { + switch err { + case nil: + return uuid.Nil, errors.New("invalid token") + default: + return uuid.Nil, err + } + } + } + return uuid.Nil, errors.New("invalid token") +} diff --git a/lib/context_keys.go b/lib/context_keys.go index 94d5829..896d88b 100644 --- a/lib/context_keys.go +++ b/lib/context_keys.go @@ -4,3 +4,5 @@ type UserIdContextKey struct{} type DatabaseContextKey struct{} type LoggerContextKey struct{} type KafkaWriterContextKey struct{} +type ConfigContextKey struct{} +type ImageStorageContextKey struct{} diff --git a/lib/media/image_storage.go b/lib/media/image_storage.go new file mode 100644 index 0000000..061ccfa --- /dev/null +++ b/lib/media/image_storage.go @@ -0,0 +1,10 @@ +package media + +type ImageStorage interface { + // Store + // Stores the image in the storage and returns the URL + // if image id is empty, a random one will be generated + Store(fileSuffix string, imageData []byte, imageId string) (string, error) + + Delete(path string) error +} diff --git a/lib/media/media_usage.go b/lib/media/media_usage.go new file mode 100644 index 0000000..6e562ab --- /dev/null +++ b/lib/media/media_usage.go @@ -0,0 +1,20 @@ +package media + +type Usage int + +const ( + Undefined Usage = iota + UserAvatar + GroupAvatar +) + +func Parse(str string) Usage { + switch str { + case "userAvatar": + return UserAvatar + case "groupAvatar": + return GroupAvatar + default: + return Undefined + } +} diff --git a/lib/media/tmp_image.go b/lib/media/tmp_image.go new file mode 100644 index 0000000..f186f41 --- /dev/null +++ b/lib/media/tmp_image.go @@ -0,0 +1,23 @@ +package media + +import ( + "github.com/google/uuid" + "time" +) + +type TmpImage struct { + Id uuid.UUID + ExpectedUsage Usage + Uploader uuid.UUID + UploadedAt time.Time + URL string +} + +type ConfirmedImage struct { + Id uuid.UUID + Usage Usage + Uploader uuid.UUID + UploadedAt time.Time + URL string + ConfirmedAt time.Time +} diff --git a/migrations/2406170339_create_image_table.down.sql b/migrations/2406170339_create_image_table.down.sql new file mode 100644 index 0000000..23820e3 --- /dev/null +++ b/migrations/2406170339_create_image_table.down.sql @@ -0,0 +1,2 @@ +DROP TABLE TmpImage; +DROP TABLE ConfirmedImage; diff --git a/migrations/2406170339_create_image_table.up.sql b/migrations/2406170339_create_image_table.up.sql new file mode 100644 index 0000000..e3df38c --- /dev/null +++ b/migrations/2406170339_create_image_table.up.sql @@ -0,0 +1,16 @@ +CREATE TABLE TmpImage( + imgId uuid PRIMARY KEY, + url varchar(100) NOT NULL , + expected_usage int8 NOT NULL , + uploader uuid references user_identity(user_id) NOT NULL, + uploaded_at timestamp NOT NULL +); + +CREATE TABLE ConfirmedImage( + imgId uuid PRIMARY KEY, + url varchar(100) NOT NULL , + usage int8 NOT NULL , + uploader uuid references user_identity(user_id) NOT NULL, + uploaded_at timestamp NOT NULL, + confirmed_at timestamp NOT NULL +) \ No newline at end of file diff --git a/migrations/run.go b/migrations/run.go index dff22fc..bd96f85 100644 --- a/migrations/run.go +++ b/migrations/run.go @@ -16,7 +16,7 @@ func main() { _ = godotenv.Load() secrets, err := utils.LoadSecrets(utils.LoadEnv()) if err != nil { - panic(secrets) + panic(err) } db, err := sql.Open("pgx", secrets["POSTGRES_URI"]) diff --git a/protobuf/Makefile b/protobuf/Makefile index b6aaafe..7a39cf2 100644 --- a/protobuf/Makefile +++ b/protobuf/Makefile @@ -1,5 +1,5 @@ MODULES = $(wildcard *.proto) - +SWAGGER_MODULES = group.proto user.proto auth.proto group_bill.proto O_DIR = gen/go SWAGGER_DIR = gen OUTPUT = $(MODULES:%.proto=$(O_DIR)/%.pb.go) @@ -12,12 +12,12 @@ all: $(OUTPUT) $(SWAGGER_DIR)/monify.swagger.json -$(SWAGGER_DIR)/monify.swagger.json: $(MODULES) +$(SWAGGER_DIR)/monify.swagger.json: -mkdir $(SWAGGER_DIR) protoc -I . --openapiv2_out $(SWAGGER_DIR) --openapiv2_opt=preserve_rpc_order=true \ --openapiv2_opt=allow_merge=true \ --openapiv2_opt=disable_default_errors=true \ - --openapiv2_opt=merge_file_name=monify $(MODULES) + --openapiv2_opt=merge_file_name=monify $(SWAGGER_MODULES) $(O_DIR)/%.pb.go: %.proto $(O_DIR) protoc --go_out=./gen/go --go_opt=paths=source_relative $< diff --git a/protobuf/gen/go/auth.pb.go b/protobuf/gen/go/auth.pb.go index eba0145..96dc065 100644 --- a/protobuf/gen/go/auth.pb.go +++ b/protobuf/gen/go/auth.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.28.1 -// protoc v5.27.0 +// protoc-gen-go v1.34.1 +// protoc v4.25.2 // source: auth.proto package monify @@ -386,26 +386,26 @@ var file_auth_proto_rawDesc = []byte{ 0x6d, 0x61, 0x69, 0x6c, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x12, 0x2e, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x19, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x13, 0x22, 0x0e, 0x2f, 0x76, 0x31, 0x2f, - 0x75, 0x73, 0x65, 0x72, 0x2f, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x3a, 0x01, 0x2a, 0x12, 0x5c, 0x0a, + 0x73, 0x65, 0x22, 0x19, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x13, 0x3a, 0x01, 0x2a, 0x22, 0x0e, 0x2f, + 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x5c, 0x0a, 0x0d, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x12, 0x15, 0x2e, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1c, 0x82, - 0xd3, 0xe4, 0x93, 0x02, 0x16, 0x22, 0x11, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2f, - 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x3a, 0x01, 0x2a, 0x12, 0x5e, 0x0a, 0x0c, 0x52, + 0xd3, 0xe4, 0x93, 0x02, 0x16, 0x3a, 0x01, 0x2a, 0x22, 0x11, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, + 0x65, 0x72, 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x12, 0x5e, 0x0a, 0x0c, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x14, 0x2e, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x21, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1b, - 0x22, 0x16, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x72, 0x65, 0x66, 0x72, 0x65, - 0x73, 0x68, 0x2d, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x3a, 0x01, 0x2a, 0x42, 0x5c, 0x5a, 0x1c, 0x67, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x53, 0x70, 0x65, 0x65, 0x64, 0x52, - 0x65, 0x61, 0x63, 0x68, 0x2f, 0x6d, 0x6f, 0x6e, 0x69, 0x66, 0x79, 0x92, 0x41, 0x3b, 0x12, 0x05, - 0x32, 0x03, 0x31, 0x2e, 0x30, 0x1a, 0x0e, 0x61, 0x70, 0x69, 0x2e, 0x6d, 0x6f, 0x6e, 0x69, 0x66, - 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2a, 0x01, 0x02, 0x5a, 0x1f, 0x0a, 0x1d, 0x0a, 0x06, 0x42, 0x65, - 0x61, 0x72, 0x65, 0x72, 0x12, 0x13, 0x08, 0x02, 0x1a, 0x0d, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, - 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x02, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x3a, 0x01, 0x2a, 0x22, 0x16, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x72, 0x65, + 0x66, 0x72, 0x65, 0x73, 0x68, 0x2d, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x42, 0x5c, 0x92, 0x41, 0x3b, + 0x12, 0x05, 0x32, 0x03, 0x31, 0x2e, 0x30, 0x1a, 0x0e, 0x61, 0x70, 0x69, 0x2e, 0x6d, 0x6f, 0x6e, + 0x69, 0x66, 0x79, 0x2e, 0x64, 0x65, 0x76, 0x2a, 0x01, 0x02, 0x5a, 0x1f, 0x0a, 0x1d, 0x0a, 0x06, + 0x42, 0x65, 0x61, 0x72, 0x65, 0x72, 0x12, 0x13, 0x08, 0x02, 0x1a, 0x0d, 0x41, 0x75, 0x74, 0x68, + 0x6f, 0x72, 0x69, 0x7a, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x02, 0x5a, 0x1c, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x53, 0x70, 0x65, 0x65, 0x64, 0x52, 0x65, 0x61, + 0x63, 0x68, 0x2f, 0x6d, 0x6f, 0x6e, 0x69, 0x66, 0x79, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } diff --git a/protobuf/gen/go/groups_bill.pb.go b/protobuf/gen/go/group_bill.pb.go similarity index 63% rename from protobuf/gen/go/groups_bill.pb.go rename to protobuf/gen/go/group_bill.pb.go index 28d5175..f031f53 100644 --- a/protobuf/gen/go/groups_bill.pb.go +++ b/protobuf/gen/go/group_bill.pb.go @@ -2,7 +2,7 @@ // versions: // protoc-gen-go v1.34.1 // protoc v4.25.2 -// source: groups_bill.proto +// source: group_bill.proto package monify @@ -55,11 +55,11 @@ func (x GroupBillHistoryType) String() string { } func (GroupBillHistoryType) Descriptor() protoreflect.EnumDescriptor { - return file_groups_bill_proto_enumTypes[0].Descriptor() + return file_group_bill_proto_enumTypes[0].Descriptor() } func (GroupBillHistoryType) Type() protoreflect.EnumType { - return &file_groups_bill_proto_enumTypes[0] + return &file_group_bill_proto_enumTypes[0] } func (x GroupBillHistoryType) Number() protoreflect.EnumNumber { @@ -68,7 +68,7 @@ func (x GroupBillHistoryType) Number() protoreflect.EnumNumber { // Deprecated: Use GroupBillHistoryType.Descriptor instead. func (GroupBillHistoryType) EnumDescriptor() ([]byte, []int) { - return file_groups_bill_proto_rawDescGZIP(), []int{0} + return file_group_bill_proto_rawDescGZIP(), []int{0} } type GroupGroupBillEmpty struct { @@ -80,7 +80,7 @@ type GroupGroupBillEmpty struct { func (x *GroupGroupBillEmpty) Reset() { *x = GroupGroupBillEmpty{} if protoimpl.UnsafeEnabled { - mi := &file_groups_bill_proto_msgTypes[0] + mi := &file_group_bill_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -93,7 +93,7 @@ func (x *GroupGroupBillEmpty) String() string { func (*GroupGroupBillEmpty) ProtoMessage() {} func (x *GroupGroupBillEmpty) ProtoReflect() protoreflect.Message { - mi := &file_groups_bill_proto_msgTypes[0] + mi := &file_group_bill_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -106,7 +106,7 @@ func (x *GroupGroupBillEmpty) ProtoReflect() protoreflect.Message { // Deprecated: Use GroupGroupBillEmpty.ProtoReflect.Descriptor instead. func (*GroupGroupBillEmpty) Descriptor() ([]byte, []int) { - return file_groups_bill_proto_rawDescGZIP(), []int{0} + return file_group_bill_proto_rawDescGZIP(), []int{0} } type CreateGroupBillRequest struct { @@ -125,7 +125,7 @@ type CreateGroupBillRequest struct { func (x *CreateGroupBillRequest) Reset() { *x = CreateGroupBillRequest{} if protoimpl.UnsafeEnabled { - mi := &file_groups_bill_proto_msgTypes[1] + mi := &file_group_bill_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -138,7 +138,7 @@ func (x *CreateGroupBillRequest) String() string { func (*CreateGroupBillRequest) ProtoMessage() {} func (x *CreateGroupBillRequest) ProtoReflect() protoreflect.Message { - mi := &file_groups_bill_proto_msgTypes[1] + mi := &file_group_bill_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -151,7 +151,7 @@ func (x *CreateGroupBillRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use CreateGroupBillRequest.ProtoReflect.Descriptor instead. func (*CreateGroupBillRequest) Descriptor() ([]byte, []int) { - return file_groups_bill_proto_rawDescGZIP(), []int{1} + return file_group_bill_proto_rawDescGZIP(), []int{1} } func (x *CreateGroupBillRequest) GetGroupId() string { @@ -208,7 +208,7 @@ type InsertPrepaidPerson struct { func (x *InsertPrepaidPerson) Reset() { *x = InsertPrepaidPerson{} if protoimpl.UnsafeEnabled { - mi := &file_groups_bill_proto_msgTypes[2] + mi := &file_group_bill_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -221,7 +221,7 @@ func (x *InsertPrepaidPerson) String() string { func (*InsertPrepaidPerson) ProtoMessage() {} func (x *InsertPrepaidPerson) ProtoReflect() protoreflect.Message { - mi := &file_groups_bill_proto_msgTypes[2] + mi := &file_group_bill_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -234,7 +234,7 @@ func (x *InsertPrepaidPerson) ProtoReflect() protoreflect.Message { // Deprecated: Use InsertPrepaidPerson.ProtoReflect.Descriptor instead. func (*InsertPrepaidPerson) Descriptor() ([]byte, []int) { - return file_groups_bill_proto_rawDescGZIP(), []int{2} + return file_group_bill_proto_rawDescGZIP(), []int{2} } func (x *InsertPrepaidPerson) GetMemberId() string { @@ -263,7 +263,7 @@ type InsertSplitPerson struct { func (x *InsertSplitPerson) Reset() { *x = InsertSplitPerson{} if protoimpl.UnsafeEnabled { - mi := &file_groups_bill_proto_msgTypes[3] + mi := &file_group_bill_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -276,7 +276,7 @@ func (x *InsertSplitPerson) String() string { func (*InsertSplitPerson) ProtoMessage() {} func (x *InsertSplitPerson) ProtoReflect() protoreflect.Message { - mi := &file_groups_bill_proto_msgTypes[3] + mi := &file_group_bill_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -289,7 +289,7 @@ func (x *InsertSplitPerson) ProtoReflect() protoreflect.Message { // Deprecated: Use InsertSplitPerson.ProtoReflect.Descriptor instead. func (*InsertSplitPerson) Descriptor() ([]byte, []int) { - return file_groups_bill_proto_rawDescGZIP(), []int{3} + return file_group_bill_proto_rawDescGZIP(), []int{3} } func (x *InsertSplitPerson) GetMemberId() string { @@ -319,7 +319,7 @@ type PrepaidPerson struct { func (x *PrepaidPerson) Reset() { *x = PrepaidPerson{} if protoimpl.UnsafeEnabled { - mi := &file_groups_bill_proto_msgTypes[4] + mi := &file_group_bill_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -332,7 +332,7 @@ func (x *PrepaidPerson) String() string { func (*PrepaidPerson) ProtoMessage() {} func (x *PrepaidPerson) ProtoReflect() protoreflect.Message { - mi := &file_groups_bill_proto_msgTypes[4] + mi := &file_group_bill_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -345,7 +345,7 @@ func (x *PrepaidPerson) ProtoReflect() protoreflect.Message { // Deprecated: Use PrepaidPerson.ProtoReflect.Descriptor instead. func (*PrepaidPerson) Descriptor() ([]byte, []int) { - return file_groups_bill_proto_rawDescGZIP(), []int{4} + return file_group_bill_proto_rawDescGZIP(), []int{4} } func (x *PrepaidPerson) GetMemberId() string { @@ -382,7 +382,7 @@ type SplitPerson struct { func (x *SplitPerson) Reset() { *x = SplitPerson{} if protoimpl.UnsafeEnabled { - mi := &file_groups_bill_proto_msgTypes[5] + mi := &file_group_bill_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -395,7 +395,7 @@ func (x *SplitPerson) String() string { func (*SplitPerson) ProtoMessage() {} func (x *SplitPerson) ProtoReflect() protoreflect.Message { - mi := &file_groups_bill_proto_msgTypes[5] + mi := &file_group_bill_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -408,7 +408,7 @@ func (x *SplitPerson) ProtoReflect() protoreflect.Message { // Deprecated: Use SplitPerson.ProtoReflect.Descriptor instead. func (*SplitPerson) Descriptor() ([]byte, []int) { - return file_groups_bill_proto_rawDescGZIP(), []int{5} + return file_group_bill_proto_rawDescGZIP(), []int{5} } func (x *SplitPerson) GetMemberId() string { @@ -443,7 +443,7 @@ type CreateGroupBillResponse struct { func (x *CreateGroupBillResponse) Reset() { *x = CreateGroupBillResponse{} if protoimpl.UnsafeEnabled { - mi := &file_groups_bill_proto_msgTypes[6] + mi := &file_group_bill_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -456,7 +456,7 @@ func (x *CreateGroupBillResponse) String() string { func (*CreateGroupBillResponse) ProtoMessage() {} func (x *CreateGroupBillResponse) ProtoReflect() protoreflect.Message { - mi := &file_groups_bill_proto_msgTypes[6] + mi := &file_group_bill_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -469,7 +469,7 @@ func (x *CreateGroupBillResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use CreateGroupBillResponse.ProtoReflect.Descriptor instead. func (*CreateGroupBillResponse) Descriptor() ([]byte, []int) { - return file_groups_bill_proto_rawDescGZIP(), []int{6} + return file_group_bill_proto_rawDescGZIP(), []int{6} } func (x *CreateGroupBillResponse) GetBillId() string { @@ -490,7 +490,7 @@ type DeleteGroupBillRequest struct { func (x *DeleteGroupBillRequest) Reset() { *x = DeleteGroupBillRequest{} if protoimpl.UnsafeEnabled { - mi := &file_groups_bill_proto_msgTypes[7] + mi := &file_group_bill_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -503,7 +503,7 @@ func (x *DeleteGroupBillRequest) String() string { func (*DeleteGroupBillRequest) ProtoMessage() {} func (x *DeleteGroupBillRequest) ProtoReflect() protoreflect.Message { - mi := &file_groups_bill_proto_msgTypes[7] + mi := &file_group_bill_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -516,7 +516,7 @@ func (x *DeleteGroupBillRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use DeleteGroupBillRequest.ProtoReflect.Descriptor instead. func (*DeleteGroupBillRequest) Descriptor() ([]byte, []int) { - return file_groups_bill_proto_rawDescGZIP(), []int{7} + return file_group_bill_proto_rawDescGZIP(), []int{7} } func (x *DeleteGroupBillRequest) GetBillId() string { @@ -542,7 +542,7 @@ type ModifyGroupBillRequest struct { func (x *ModifyGroupBillRequest) Reset() { *x = ModifyGroupBillRequest{} if protoimpl.UnsafeEnabled { - mi := &file_groups_bill_proto_msgTypes[8] + mi := &file_group_bill_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -555,7 +555,7 @@ func (x *ModifyGroupBillRequest) String() string { func (*ModifyGroupBillRequest) ProtoMessage() {} func (x *ModifyGroupBillRequest) ProtoReflect() protoreflect.Message { - mi := &file_groups_bill_proto_msgTypes[8] + mi := &file_group_bill_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -568,7 +568,7 @@ func (x *ModifyGroupBillRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ModifyGroupBillRequest.ProtoReflect.Descriptor instead. func (*ModifyGroupBillRequest) Descriptor() ([]byte, []int) { - return file_groups_bill_proto_rawDescGZIP(), []int{8} + return file_group_bill_proto_rawDescGZIP(), []int{8} } func (x *ModifyGroupBillRequest) GetBillId() string { @@ -624,7 +624,7 @@ type GetSelfTotalSpendRequest struct { func (x *GetSelfTotalSpendRequest) Reset() { *x = GetSelfTotalSpendRequest{} if protoimpl.UnsafeEnabled { - mi := &file_groups_bill_proto_msgTypes[9] + mi := &file_group_bill_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -637,7 +637,7 @@ func (x *GetSelfTotalSpendRequest) String() string { func (*GetSelfTotalSpendRequest) ProtoMessage() {} func (x *GetSelfTotalSpendRequest) ProtoReflect() protoreflect.Message { - mi := &file_groups_bill_proto_msgTypes[9] + mi := &file_group_bill_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -650,7 +650,7 @@ func (x *GetSelfTotalSpendRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetSelfTotalSpendRequest.ProtoReflect.Descriptor instead. func (*GetSelfTotalSpendRequest) Descriptor() ([]byte, []int) { - return file_groups_bill_proto_rawDescGZIP(), []int{9} + return file_group_bill_proto_rawDescGZIP(), []int{9} } func (x *GetSelfTotalSpendRequest) GetGroupId() string { @@ -671,7 +671,7 @@ type GetSelfTotalSpendResponse struct { func (x *GetSelfTotalSpendResponse) Reset() { *x = GetSelfTotalSpendResponse{} if protoimpl.UnsafeEnabled { - mi := &file_groups_bill_proto_msgTypes[10] + mi := &file_group_bill_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -684,7 +684,7 @@ func (x *GetSelfTotalSpendResponse) String() string { func (*GetSelfTotalSpendResponse) ProtoMessage() {} func (x *GetSelfTotalSpendResponse) ProtoReflect() protoreflect.Message { - mi := &file_groups_bill_proto_msgTypes[10] + mi := &file_group_bill_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -697,7 +697,7 @@ func (x *GetSelfTotalSpendResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetSelfTotalSpendResponse.ProtoReflect.Descriptor instead. func (*GetSelfTotalSpendResponse) Descriptor() ([]byte, []int) { - return file_groups_bill_proto_rawDescGZIP(), []int{10} + return file_group_bill_proto_rawDescGZIP(), []int{10} } func (x *GetSelfTotalSpendResponse) GetAmount() float64 { @@ -718,7 +718,7 @@ type GetGroupTotalSpendRequest struct { func (x *GetGroupTotalSpendRequest) Reset() { *x = GetGroupTotalSpendRequest{} if protoimpl.UnsafeEnabled { - mi := &file_groups_bill_proto_msgTypes[11] + mi := &file_group_bill_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -731,7 +731,7 @@ func (x *GetGroupTotalSpendRequest) String() string { func (*GetGroupTotalSpendRequest) ProtoMessage() {} func (x *GetGroupTotalSpendRequest) ProtoReflect() protoreflect.Message { - mi := &file_groups_bill_proto_msgTypes[11] + mi := &file_group_bill_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -744,7 +744,7 @@ func (x *GetGroupTotalSpendRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetGroupTotalSpendRequest.ProtoReflect.Descriptor instead. func (*GetGroupTotalSpendRequest) Descriptor() ([]byte, []int) { - return file_groups_bill_proto_rawDescGZIP(), []int{11} + return file_group_bill_proto_rawDescGZIP(), []int{11} } func (x *GetGroupTotalSpendRequest) GetGroupId() string { @@ -765,7 +765,7 @@ type GetGroupTotalSpendResponse struct { func (x *GetGroupTotalSpendResponse) Reset() { *x = GetGroupTotalSpendResponse{} if protoimpl.UnsafeEnabled { - mi := &file_groups_bill_proto_msgTypes[12] + mi := &file_group_bill_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -778,7 +778,7 @@ func (x *GetGroupTotalSpendResponse) String() string { func (*GetGroupTotalSpendResponse) ProtoMessage() {} func (x *GetGroupTotalSpendResponse) ProtoReflect() protoreflect.Message { - mi := &file_groups_bill_proto_msgTypes[12] + mi := &file_group_bill_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -791,7 +791,7 @@ func (x *GetGroupTotalSpendResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetGroupTotalSpendResponse.ProtoReflect.Descriptor instead. func (*GetGroupTotalSpendResponse) Descriptor() ([]byte, []int) { - return file_groups_bill_proto_rawDescGZIP(), []int{12} + return file_group_bill_proto_rawDescGZIP(), []int{12} } func (x *GetGroupTotalSpendResponse) GetAmount() float64 { @@ -812,7 +812,7 @@ type GetGroupBillsRequest struct { func (x *GetGroupBillsRequest) Reset() { *x = GetGroupBillsRequest{} if protoimpl.UnsafeEnabled { - mi := &file_groups_bill_proto_msgTypes[13] + mi := &file_group_bill_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -825,7 +825,7 @@ func (x *GetGroupBillsRequest) String() string { func (*GetGroupBillsRequest) ProtoMessage() {} func (x *GetGroupBillsRequest) ProtoReflect() protoreflect.Message { - mi := &file_groups_bill_proto_msgTypes[13] + mi := &file_group_bill_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -838,7 +838,7 @@ func (x *GetGroupBillsRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetGroupBillsRequest.ProtoReflect.Descriptor instead. func (*GetGroupBillsRequest) Descriptor() ([]byte, []int) { - return file_groups_bill_proto_rawDescGZIP(), []int{13} + return file_group_bill_proto_rawDescGZIP(), []int{13} } func (x *GetGroupBillsRequest) GetGroupId() string { @@ -859,7 +859,7 @@ type GetGroupBillsResponse struct { func (x *GetGroupBillsResponse) Reset() { *x = GetGroupBillsResponse{} if protoimpl.UnsafeEnabled { - mi := &file_groups_bill_proto_msgTypes[14] + mi := &file_group_bill_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -872,7 +872,7 @@ func (x *GetGroupBillsResponse) String() string { func (*GetGroupBillsResponse) ProtoMessage() {} func (x *GetGroupBillsResponse) ProtoReflect() protoreflect.Message { - mi := &file_groups_bill_proto_msgTypes[14] + mi := &file_group_bill_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -885,7 +885,7 @@ func (x *GetGroupBillsResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetGroupBillsResponse.ProtoReflect.Descriptor instead. func (*GetGroupBillsResponse) Descriptor() ([]byte, []int) { - return file_groups_bill_proto_rawDescGZIP(), []int{14} + return file_group_bill_proto_rawDescGZIP(), []int{14} } func (x *GetGroupBillsResponse) GetGroupBills() []*CreatedGroupBill { @@ -912,7 +912,7 @@ type CreatedGroupBill struct { func (x *CreatedGroupBill) Reset() { *x = CreatedGroupBill{} if protoimpl.UnsafeEnabled { - mi := &file_groups_bill_proto_msgTypes[15] + mi := &file_group_bill_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -925,7 +925,7 @@ func (x *CreatedGroupBill) String() string { func (*CreatedGroupBill) ProtoMessage() {} func (x *CreatedGroupBill) ProtoReflect() protoreflect.Message { - mi := &file_groups_bill_proto_msgTypes[15] + mi := &file_group_bill_proto_msgTypes[15] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -938,7 +938,7 @@ func (x *CreatedGroupBill) ProtoReflect() protoreflect.Message { // Deprecated: Use CreatedGroupBill.ProtoReflect.Descriptor instead. func (*CreatedGroupBill) Descriptor() ([]byte, []int) { - return file_groups_bill_proto_rawDescGZIP(), []int{15} + return file_group_bill_proto_rawDescGZIP(), []int{15} } func (x *CreatedGroupBill) GetBillId() string { @@ -1003,7 +1003,7 @@ type GetHistoryRequest struct { func (x *GetHistoryRequest) Reset() { *x = GetHistoryRequest{} if protoimpl.UnsafeEnabled { - mi := &file_groups_bill_proto_msgTypes[16] + mi := &file_group_bill_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1016,7 +1016,7 @@ func (x *GetHistoryRequest) String() string { func (*GetHistoryRequest) ProtoMessage() {} func (x *GetHistoryRequest) ProtoReflect() protoreflect.Message { - mi := &file_groups_bill_proto_msgTypes[16] + mi := &file_group_bill_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1029,7 +1029,7 @@ func (x *GetHistoryRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetHistoryRequest.ProtoReflect.Descriptor instead. func (*GetHistoryRequest) Descriptor() ([]byte, []int) { - return file_groups_bill_proto_rawDescGZIP(), []int{16} + return file_group_bill_proto_rawDescGZIP(), []int{16} } func (x *GetHistoryRequest) GetSkip() int32 { @@ -1064,7 +1064,7 @@ type GetHistoryResponse struct { func (x *GetHistoryResponse) Reset() { *x = GetHistoryResponse{} if protoimpl.UnsafeEnabled { - mi := &file_groups_bill_proto_msgTypes[17] + mi := &file_group_bill_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1077,7 +1077,7 @@ func (x *GetHistoryResponse) String() string { func (*GetHistoryResponse) ProtoMessage() {} func (x *GetHistoryResponse) ProtoReflect() protoreflect.Message { - mi := &file_groups_bill_proto_msgTypes[17] + mi := &file_group_bill_proto_msgTypes[17] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1090,7 +1090,7 @@ func (x *GetHistoryResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetHistoryResponse.ProtoReflect.Descriptor instead. func (*GetHistoryResponse) Descriptor() ([]byte, []int) { - return file_groups_bill_proto_rawDescGZIP(), []int{17} + return file_group_bill_proto_rawDescGZIP(), []int{17} } func (x *GetHistoryResponse) GetHistories() []*GroupBillHistory { @@ -1115,7 +1115,7 @@ type GroupBillHistory struct { func (x *GroupBillHistory) Reset() { *x = GroupBillHistory{} if protoimpl.UnsafeEnabled { - mi := &file_groups_bill_proto_msgTypes[18] + mi := &file_group_bill_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1128,7 +1128,7 @@ func (x *GroupBillHistory) String() string { func (*GroupBillHistory) ProtoMessage() {} func (x *GroupBillHistory) ProtoReflect() protoreflect.Message { - mi := &file_groups_bill_proto_msgTypes[18] + mi := &file_group_bill_proto_msgTypes[18] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1141,7 +1141,7 @@ func (x *GroupBillHistory) ProtoReflect() protoreflect.Message { // Deprecated: Use GroupBillHistory.ProtoReflect.Descriptor instead. func (*GroupBillHistory) Descriptor() ([]byte, []int) { - return file_groups_bill_proto_rawDescGZIP(), []int{18} + return file_group_bill_proto_rawDescGZIP(), []int{18} } func (x *GroupBillHistory) GetType() GroupBillHistoryType { @@ -1172,193 +1172,193 @@ func (x *GroupBillHistory) GetTimestamp() *timestamppb.Timestamp { return nil } -var File_groups_bill_proto protoreflect.FileDescriptor - -var file_groups_bill_proto_rawDesc = []byte{ - 0x0a, 0x11, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x5f, 0x62, 0x69, 0x6c, 0x6c, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, - 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x22, 0x15, 0x0a, 0x13, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x47, 0x72, 0x6f, 0x75, 0x70, - 0x42, 0x69, 0x6c, 0x6c, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x80, 0x02, 0x0a, 0x16, 0x43, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x42, 0x69, 0x6c, 0x6c, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x12, - 0x1f, 0x0a, 0x0b, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x6d, 0x6f, 0x6e, 0x65, 0x79, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x01, 0x52, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x4d, 0x6f, 0x6e, 0x65, 0x79, - 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, - 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3b, 0x0a, 0x0e, 0x70, 0x72, 0x65, 0x70, - 0x61, 0x69, 0x64, 0x5f, 0x70, 0x65, 0x6f, 0x70, 0x6c, 0x65, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x14, 0x2e, 0x49, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x50, 0x72, 0x65, 0x70, 0x61, 0x69, 0x64, - 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x52, 0x0d, 0x70, 0x72, 0x65, 0x70, 0x61, 0x69, 0x64, 0x50, - 0x65, 0x6f, 0x70, 0x6c, 0x65, 0x12, 0x35, 0x0a, 0x0c, 0x73, 0x70, 0x6c, 0x69, 0x74, 0x5f, 0x70, - 0x65, 0x6f, 0x70, 0x6c, 0x65, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x49, 0x6e, - 0x73, 0x65, 0x72, 0x74, 0x53, 0x70, 0x6c, 0x69, 0x74, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x52, - 0x0b, 0x73, 0x70, 0x6c, 0x69, 0x74, 0x50, 0x65, 0x6f, 0x70, 0x6c, 0x65, 0x22, 0x4a, 0x0a, 0x13, - 0x49, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x50, 0x72, 0x65, 0x70, 0x61, 0x69, 0x64, 0x50, 0x65, 0x72, - 0x73, 0x6f, 0x6e, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x5f, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x49, 0x64, - 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, - 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x48, 0x0a, 0x11, 0x49, 0x6e, 0x73, 0x65, - 0x72, 0x74, 0x53, 0x70, 0x6c, 0x69, 0x74, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x12, 0x1b, 0x0a, - 0x09, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x08, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, - 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, - 0x6e, 0x74, 0x22, 0x60, 0x0a, 0x0d, 0x50, 0x72, 0x65, 0x70, 0x61, 0x69, 0x64, 0x50, 0x65, 0x72, - 0x73, 0x6f, 0x6e, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x5f, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x49, 0x64, - 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, - 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, - 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, - 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x5e, 0x0a, 0x0b, 0x53, 0x70, 0x6c, 0x69, 0x74, 0x50, 0x65, 0x72, - 0x73, 0x6f, 0x6e, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x5f, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x49, 0x64, - 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, - 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, - 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, - 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x32, 0x0a, 0x17, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x47, 0x72, - 0x6f, 0x75, 0x70, 0x42, 0x69, 0x6c, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x17, 0x0a, 0x07, 0x62, 0x69, 0x6c, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x06, 0x62, 0x69, 0x6c, 0x6c, 0x49, 0x64, 0x22, 0x31, 0x0a, 0x16, 0x44, 0x65, 0x6c, 0x65, - 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x42, 0x69, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x62, 0x69, 0x6c, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x06, 0x62, 0x69, 0x6c, 0x6c, 0x49, 0x64, 0x22, 0x8a, 0x02, 0x0a, 0x16, - 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x42, 0x69, 0x6c, 0x6c, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x62, 0x69, 0x6c, 0x6c, 0x5f, 0x69, - 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x62, 0x69, 0x6c, 0x6c, 0x49, 0x64, 0x12, - 0x1f, 0x0a, 0x0b, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x6d, 0x6f, 0x6e, 0x65, 0x79, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x01, 0x52, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x4d, 0x6f, 0x6e, 0x65, 0x79, - 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, - 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3b, 0x0a, 0x0e, 0x70, 0x72, 0x65, 0x70, - 0x61, 0x69, 0x64, 0x5f, 0x70, 0x65, 0x6f, 0x70, 0x6c, 0x65, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x14, 0x2e, 0x49, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x50, 0x72, 0x65, 0x70, 0x61, 0x69, 0x64, - 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x52, 0x0d, 0x70, 0x72, 0x65, 0x70, 0x61, 0x69, 0x64, 0x50, - 0x65, 0x6f, 0x70, 0x6c, 0x65, 0x12, 0x35, 0x0a, 0x0c, 0x73, 0x70, 0x6c, 0x69, 0x74, 0x5f, 0x70, - 0x65, 0x6f, 0x70, 0x6c, 0x65, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x49, 0x6e, - 0x73, 0x65, 0x72, 0x74, 0x53, 0x70, 0x6c, 0x69, 0x74, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x52, - 0x0b, 0x73, 0x70, 0x6c, 0x69, 0x74, 0x50, 0x65, 0x6f, 0x70, 0x6c, 0x65, 0x4a, 0x04, 0x08, 0x01, - 0x10, 0x02, 0x4a, 0x04, 0x08, 0x08, 0x10, 0x09, 0x22, 0x35, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x53, - 0x65, 0x6c, 0x66, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x53, 0x70, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x22, - 0x33, 0x0a, 0x19, 0x47, 0x65, 0x74, 0x53, 0x65, 0x6c, 0x66, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x53, - 0x70, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, - 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x01, 0x52, 0x06, 0x61, 0x6d, - 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x36, 0x0a, 0x19, 0x47, 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, - 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x53, 0x70, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x22, 0x34, 0x0a, 0x1a, - 0x47, 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x53, 0x70, 0x65, - 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, - 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x01, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, - 0x6e, 0x74, 0x22, 0x31, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x42, 0x69, - 0x6c, 0x6c, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x72, - 0x6f, 0x75, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x67, 0x72, - 0x6f, 0x75, 0x70, 0x49, 0x64, 0x22, 0x4b, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75, - 0x70, 0x42, 0x69, 0x6c, 0x6c, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, - 0x0a, 0x0b, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x62, 0x69, 0x6c, 0x6c, 0x73, 0x18, 0x01, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x47, 0x72, 0x6f, - 0x75, 0x70, 0x42, 0x69, 0x6c, 0x6c, 0x52, 0x0a, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x42, 0x69, 0x6c, - 0x6c, 0x73, 0x22, 0x87, 0x02, 0x0a, 0x10, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x47, 0x72, - 0x6f, 0x75, 0x70, 0x42, 0x69, 0x6c, 0x6c, 0x12, 0x17, 0x0a, 0x07, 0x62, 0x69, 0x6c, 0x6c, 0x5f, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x62, 0x69, 0x6c, 0x6c, 0x49, 0x64, - 0x12, 0x19, 0x0a, 0x08, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x74, - 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x6d, 0x6f, 0x6e, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x01, - 0x52, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x4d, 0x6f, 0x6e, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, - 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, - 0x6c, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x35, 0x0a, 0x0e, 0x70, 0x72, 0x65, 0x70, 0x61, 0x69, 0x64, 0x5f, - 0x70, 0x65, 0x6f, 0x70, 0x6c, 0x65, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x50, - 0x72, 0x65, 0x70, 0x61, 0x69, 0x64, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x52, 0x0d, 0x70, 0x72, - 0x65, 0x70, 0x61, 0x69, 0x64, 0x50, 0x65, 0x6f, 0x70, 0x6c, 0x65, 0x12, 0x2f, 0x0a, 0x0c, 0x73, - 0x70, 0x6c, 0x69, 0x74, 0x5f, 0x70, 0x65, 0x6f, 0x70, 0x6c, 0x65, 0x18, 0x07, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x0c, 0x2e, 0x53, 0x70, 0x6c, 0x69, 0x74, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x52, - 0x0b, 0x73, 0x70, 0x6c, 0x69, 0x74, 0x50, 0x65, 0x6f, 0x70, 0x6c, 0x65, 0x22, 0x58, 0x0a, 0x11, - 0x47, 0x65, 0x74, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x6b, 0x69, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, - 0x04, 0x73, 0x6b, 0x69, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x67, - 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x67, - 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x22, 0x45, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x48, 0x69, 0x73, - 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2f, 0x0a, 0x09, - 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x11, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x42, 0x69, 0x6c, 0x6c, 0x48, 0x69, 0x73, 0x74, 0x6f, - 0x72, 0x79, 0x52, 0x09, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x22, 0xb2, 0x01, - 0x0a, 0x10, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x42, 0x69, 0x6c, 0x6c, 0x48, 0x69, 0x73, 0x74, 0x6f, - 0x72, 0x79, 0x12, 0x29, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, - 0x32, 0x15, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x42, 0x69, 0x6c, 0x6c, 0x48, 0x69, 0x73, 0x74, - 0x6f, 0x72, 0x79, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x23, 0x0a, - 0x0d, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x4e, 0x61, - 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x38, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, - 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, - 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, - 0x6d, 0x70, 0x2a, 0x3a, 0x0a, 0x14, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x42, 0x69, 0x6c, 0x6c, 0x48, - 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0a, 0x0a, 0x06, 0x63, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, - 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x10, 0x02, 0x32, 0x97, - 0x04, 0x0a, 0x11, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x42, 0x69, 0x6c, 0x6c, 0x53, 0x65, 0x72, - 0x76, 0x69, 0x63, 0x65, 0x12, 0x60, 0x0a, 0x0f, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x47, 0x72, - 0x6f, 0x75, 0x70, 0x42, 0x69, 0x6c, 0x6c, 0x12, 0x17, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x47, 0x72, 0x6f, 0x75, 0x70, 0x42, 0x69, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x18, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x42, 0x69, - 0x6c, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1a, 0x82, 0xd3, 0xe4, 0x93, - 0x02, 0x14, 0x3a, 0x01, 0x2a, 0x22, 0x0f, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x72, 0x6f, 0x75, 0x70, - 0x73, 0x5f, 0x62, 0x69, 0x6c, 0x6c, 0x12, 0x62, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x47, 0x72, 0x6f, - 0x75, 0x70, 0x42, 0x69, 0x6c, 0x6c, 0x73, 0x12, 0x15, 0x2e, 0x47, 0x65, 0x74, 0x47, 0x72, 0x6f, - 0x75, 0x70, 0x42, 0x69, 0x6c, 0x6c, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, - 0x2e, 0x47, 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x42, 0x69, 0x6c, 0x6c, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x22, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1c, 0x12, 0x1a, - 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x5f, 0x62, 0x69, 0x6c, 0x6c, 0x2f, - 0x7b, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x69, 0x64, 0x7d, 0x12, 0x63, 0x0a, 0x0f, 0x44, 0x65, - 0x6c, 0x65, 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x42, 0x69, 0x6c, 0x6c, 0x12, 0x17, 0x2e, - 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x42, 0x69, 0x6c, 0x6c, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x47, 0x72, - 0x6f, 0x75, 0x70, 0x42, 0x69, 0x6c, 0x6c, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x21, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x1b, 0x2a, 0x19, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, - 0x5f, 0x62, 0x69, 0x6c, 0x6c, 0x2f, 0x7b, 0x62, 0x69, 0x6c, 0x6c, 0x5f, 0x69, 0x64, 0x7d, 0x12, - 0x66, 0x0a, 0x0f, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x42, 0x69, - 0x6c, 0x6c, 0x12, 0x17, 0x2e, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x47, 0x72, 0x6f, 0x75, 0x70, - 0x42, 0x69, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x47, 0x72, - 0x6f, 0x75, 0x70, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x42, 0x69, 0x6c, 0x6c, 0x45, 0x6d, 0x70, 0x74, - 0x79, 0x22, 0x24, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1e, 0x3a, 0x01, 0x2a, 0x1a, 0x19, 0x2f, 0x76, - 0x31, 0x2f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x5f, 0x62, 0x69, 0x6c, 0x6c, 0x2f, 0x7b, 0x62, - 0x69, 0x6c, 0x6c, 0x5f, 0x69, 0x64, 0x7d, 0x12, 0x6f, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x48, 0x69, - 0x73, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x12, 0x2e, 0x47, 0x65, 0x74, 0x48, 0x69, 0x73, 0x74, 0x6f, - 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x47, 0x65, 0x74, 0x48, - 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x38, - 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x32, 0x12, 0x30, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x72, 0x6f, 0x75, - 0x70, 0x5f, 0x62, 0x69, 0x6c, 0x6c, 0x2f, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x2f, 0x7b, - 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x7b, 0x73, 0x6b, 0x69, 0x70, 0x7d, - 0x2f, 0x7b, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x7d, 0x42, 0x1e, 0x5a, 0x1c, 0x67, 0x69, 0x74, 0x68, - 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x53, 0x70, 0x65, 0x65, 0x64, 0x52, 0x65, 0x61, 0x63, - 0x68, 0x2f, 0x6d, 0x6f, 0x6e, 0x69, 0x66, 0x79, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +var File_group_bill_proto protoreflect.FileDescriptor + +var file_group_bill_proto_rawDesc = []byte{ + 0x0a, 0x10, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x62, 0x69, 0x6c, 0x6c, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, + 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x22, 0x15, 0x0a, 0x13, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x42, + 0x69, 0x6c, 0x6c, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x80, 0x02, 0x0a, 0x16, 0x43, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x42, 0x69, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x12, 0x1f, + 0x0a, 0x0b, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x6d, 0x6f, 0x6e, 0x65, 0x79, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x01, 0x52, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x4d, 0x6f, 0x6e, 0x65, 0x79, 0x12, + 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, + 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, + 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3b, 0x0a, 0x0e, 0x70, 0x72, 0x65, 0x70, 0x61, + 0x69, 0x64, 0x5f, 0x70, 0x65, 0x6f, 0x70, 0x6c, 0x65, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x14, 0x2e, 0x49, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x50, 0x72, 0x65, 0x70, 0x61, 0x69, 0x64, 0x50, + 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x52, 0x0d, 0x70, 0x72, 0x65, 0x70, 0x61, 0x69, 0x64, 0x50, 0x65, + 0x6f, 0x70, 0x6c, 0x65, 0x12, 0x35, 0x0a, 0x0c, 0x73, 0x70, 0x6c, 0x69, 0x74, 0x5f, 0x70, 0x65, + 0x6f, 0x70, 0x6c, 0x65, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x49, 0x6e, 0x73, + 0x65, 0x72, 0x74, 0x53, 0x70, 0x6c, 0x69, 0x74, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x52, 0x0b, + 0x73, 0x70, 0x6c, 0x69, 0x74, 0x50, 0x65, 0x6f, 0x70, 0x6c, 0x65, 0x22, 0x4a, 0x0a, 0x13, 0x49, + 0x6e, 0x73, 0x65, 0x72, 0x74, 0x50, 0x72, 0x65, 0x70, 0x61, 0x69, 0x64, 0x50, 0x65, 0x72, 0x73, + 0x6f, 0x6e, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x49, 0x64, 0x12, + 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x52, + 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x48, 0x0a, 0x11, 0x49, 0x6e, 0x73, 0x65, 0x72, + 0x74, 0x53, 0x70, 0x6c, 0x69, 0x74, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x12, 0x1b, 0x0a, 0x09, + 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x08, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, + 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, + 0x74, 0x22, 0x60, 0x0a, 0x0d, 0x50, 0x72, 0x65, 0x70, 0x61, 0x69, 0x64, 0x50, 0x65, 0x72, 0x73, + 0x6f, 0x6e, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x49, 0x64, 0x12, + 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x52, + 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, + 0x61, 0x6d, 0x65, 0x22, 0x5e, 0x0a, 0x0b, 0x53, 0x70, 0x6c, 0x69, 0x74, 0x50, 0x65, 0x72, 0x73, + 0x6f, 0x6e, 0x12, 0x1b, 0x0a, 0x09, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x49, 0x64, 0x12, + 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x52, + 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, + 0x61, 0x6d, 0x65, 0x22, 0x32, 0x0a, 0x17, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x47, 0x72, 0x6f, + 0x75, 0x70, 0x42, 0x69, 0x6c, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x17, + 0x0a, 0x07, 0x62, 0x69, 0x6c, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x06, 0x62, 0x69, 0x6c, 0x6c, 0x49, 0x64, 0x22, 0x31, 0x0a, 0x16, 0x44, 0x65, 0x6c, 0x65, 0x74, + 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x42, 0x69, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x17, 0x0a, 0x07, 0x62, 0x69, 0x6c, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x62, 0x69, 0x6c, 0x6c, 0x49, 0x64, 0x22, 0x8a, 0x02, 0x0a, 0x16, 0x4d, + 0x6f, 0x64, 0x69, 0x66, 0x79, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x42, 0x69, 0x6c, 0x6c, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x62, 0x69, 0x6c, 0x6c, 0x5f, 0x69, 0x64, + 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x62, 0x69, 0x6c, 0x6c, 0x49, 0x64, 0x12, 0x1f, + 0x0a, 0x0b, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x6d, 0x6f, 0x6e, 0x65, 0x79, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x01, 0x52, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x4d, 0x6f, 0x6e, 0x65, 0x79, 0x12, + 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, + 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, + 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, + 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3b, 0x0a, 0x0e, 0x70, 0x72, 0x65, 0x70, 0x61, + 0x69, 0x64, 0x5f, 0x70, 0x65, 0x6f, 0x70, 0x6c, 0x65, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x14, 0x2e, 0x49, 0x6e, 0x73, 0x65, 0x72, 0x74, 0x50, 0x72, 0x65, 0x70, 0x61, 0x69, 0x64, 0x50, + 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x52, 0x0d, 0x70, 0x72, 0x65, 0x70, 0x61, 0x69, 0x64, 0x50, 0x65, + 0x6f, 0x70, 0x6c, 0x65, 0x12, 0x35, 0x0a, 0x0c, 0x73, 0x70, 0x6c, 0x69, 0x74, 0x5f, 0x70, 0x65, + 0x6f, 0x70, 0x6c, 0x65, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x49, 0x6e, 0x73, + 0x65, 0x72, 0x74, 0x53, 0x70, 0x6c, 0x69, 0x74, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x52, 0x0b, + 0x73, 0x70, 0x6c, 0x69, 0x74, 0x50, 0x65, 0x6f, 0x70, 0x6c, 0x65, 0x4a, 0x04, 0x08, 0x01, 0x10, + 0x02, 0x4a, 0x04, 0x08, 0x08, 0x10, 0x09, 0x22, 0x35, 0x0a, 0x18, 0x47, 0x65, 0x74, 0x53, 0x65, + 0x6c, 0x66, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x53, 0x70, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x22, 0x33, + 0x0a, 0x19, 0x47, 0x65, 0x74, 0x53, 0x65, 0x6c, 0x66, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x53, 0x70, + 0x65, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x61, + 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x01, 0x52, 0x06, 0x61, 0x6d, 0x6f, + 0x75, 0x6e, 0x74, 0x22, 0x36, 0x0a, 0x19, 0x47, 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x54, + 0x6f, 0x74, 0x61, 0x6c, 0x53, 0x70, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x19, 0x0a, 0x08, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x22, 0x34, 0x0a, 0x1a, 0x47, + 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x53, 0x70, 0x65, 0x6e, + 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, + 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x01, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, + 0x74, 0x22, 0x31, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x42, 0x69, 0x6c, + 0x6c, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x72, 0x6f, + 0x75, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x67, 0x72, 0x6f, + 0x75, 0x70, 0x49, 0x64, 0x22, 0x4b, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, + 0x42, 0x69, 0x6c, 0x6c, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, 0x0a, + 0x0b, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x62, 0x69, 0x6c, 0x6c, 0x73, 0x18, 0x01, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x47, 0x72, 0x6f, 0x75, + 0x70, 0x42, 0x69, 0x6c, 0x6c, 0x52, 0x0a, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x42, 0x69, 0x6c, 0x6c, + 0x73, 0x22, 0x87, 0x02, 0x0a, 0x10, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x47, 0x72, 0x6f, + 0x75, 0x70, 0x42, 0x69, 0x6c, 0x6c, 0x12, 0x17, 0x0a, 0x07, 0x62, 0x69, 0x6c, 0x6c, 0x5f, 0x69, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x62, 0x69, 0x6c, 0x6c, 0x49, 0x64, 0x12, + 0x19, 0x0a, 0x08, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x07, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x6f, + 0x74, 0x61, 0x6c, 0x5f, 0x6d, 0x6f, 0x6e, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x01, 0x52, + 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x4d, 0x6f, 0x6e, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x74, + 0x69, 0x74, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, + 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x12, 0x35, 0x0a, 0x0e, 0x70, 0x72, 0x65, 0x70, 0x61, 0x69, 0x64, 0x5f, 0x70, + 0x65, 0x6f, 0x70, 0x6c, 0x65, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x50, 0x72, + 0x65, 0x70, 0x61, 0x69, 0x64, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x52, 0x0d, 0x70, 0x72, 0x65, + 0x70, 0x61, 0x69, 0x64, 0x50, 0x65, 0x6f, 0x70, 0x6c, 0x65, 0x12, 0x2f, 0x0a, 0x0c, 0x73, 0x70, + 0x6c, 0x69, 0x74, 0x5f, 0x70, 0x65, 0x6f, 0x70, 0x6c, 0x65, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x0c, 0x2e, 0x53, 0x70, 0x6c, 0x69, 0x74, 0x50, 0x65, 0x72, 0x73, 0x6f, 0x6e, 0x52, 0x0b, + 0x73, 0x70, 0x6c, 0x69, 0x74, 0x50, 0x65, 0x6f, 0x70, 0x6c, 0x65, 0x22, 0x58, 0x0a, 0x11, 0x47, + 0x65, 0x74, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x12, 0x0a, 0x04, 0x73, 0x6b, 0x69, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, + 0x73, 0x6b, 0x69, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x67, 0x72, + 0x6f, 0x75, 0x70, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x67, 0x72, + 0x6f, 0x75, 0x70, 0x49, 0x64, 0x22, 0x45, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x48, 0x69, 0x73, 0x74, + 0x6f, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2f, 0x0a, 0x09, 0x68, + 0x69, 0x73, 0x74, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, + 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x42, 0x69, 0x6c, 0x6c, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, + 0x79, 0x52, 0x09, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x22, 0xb2, 0x01, 0x0a, + 0x10, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x42, 0x69, 0x6c, 0x6c, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, + 0x79, 0x12, 0x29, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, + 0x15, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x42, 0x69, 0x6c, 0x6c, 0x48, 0x69, 0x73, 0x74, 0x6f, + 0x72, 0x79, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x23, 0x0a, 0x0d, + 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0c, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x6f, 0x72, 0x4e, 0x61, 0x6d, + 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x38, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, + 0x74, 0x61, 0x6d, 0x70, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, + 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, + 0x70, 0x2a, 0x3a, 0x0a, 0x14, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x42, 0x69, 0x6c, 0x6c, 0x48, 0x69, + 0x73, 0x74, 0x6f, 0x72, 0x79, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0a, 0x0a, 0x06, 0x63, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x10, + 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x10, 0x02, 0x32, 0x97, 0x04, + 0x0a, 0x11, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x42, 0x69, 0x6c, 0x6c, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x12, 0x60, 0x0a, 0x0f, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x47, 0x72, 0x6f, + 0x75, 0x70, 0x42, 0x69, 0x6c, 0x6c, 0x12, 0x17, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x47, + 0x72, 0x6f, 0x75, 0x70, 0x42, 0x69, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x18, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x42, 0x69, 0x6c, + 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1a, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x14, 0x3a, 0x01, 0x2a, 0x22, 0x0f, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, + 0x5f, 0x62, 0x69, 0x6c, 0x6c, 0x12, 0x62, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75, + 0x70, 0x42, 0x69, 0x6c, 0x6c, 0x73, 0x12, 0x15, 0x2e, 0x47, 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75, + 0x70, 0x42, 0x69, 0x6c, 0x6c, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, + 0x47, 0x65, 0x74, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x42, 0x69, 0x6c, 0x6c, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x22, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1c, 0x12, 0x1a, 0x2f, + 0x76, 0x31, 0x2f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x5f, 0x62, 0x69, 0x6c, 0x6c, 0x2f, 0x7b, + 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x69, 0x64, 0x7d, 0x12, 0x63, 0x0a, 0x0f, 0x44, 0x65, 0x6c, + 0x65, 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x42, 0x69, 0x6c, 0x6c, 0x12, 0x17, 0x2e, 0x44, + 0x65, 0x6c, 0x65, 0x74, 0x65, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x42, 0x69, 0x6c, 0x6c, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x47, 0x72, 0x6f, + 0x75, 0x70, 0x42, 0x69, 0x6c, 0x6c, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x21, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x1b, 0x2a, 0x19, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x5f, + 0x62, 0x69, 0x6c, 0x6c, 0x2f, 0x7b, 0x62, 0x69, 0x6c, 0x6c, 0x5f, 0x69, 0x64, 0x7d, 0x12, 0x66, + 0x0a, 0x0f, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x42, 0x69, 0x6c, + 0x6c, 0x12, 0x17, 0x2e, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x42, + 0x69, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x47, 0x72, 0x6f, + 0x75, 0x70, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x42, 0x69, 0x6c, 0x6c, 0x45, 0x6d, 0x70, 0x74, 0x79, + 0x22, 0x24, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1e, 0x3a, 0x01, 0x2a, 0x1a, 0x19, 0x2f, 0x76, 0x31, + 0x2f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x5f, 0x62, 0x69, 0x6c, 0x6c, 0x2f, 0x7b, 0x62, 0x69, + 0x6c, 0x6c, 0x5f, 0x69, 0x64, 0x7d, 0x12, 0x6f, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x48, 0x69, 0x73, + 0x74, 0x6f, 0x72, 0x79, 0x12, 0x12, 0x2e, 0x47, 0x65, 0x74, 0x48, 0x69, 0x73, 0x74, 0x6f, 0x72, + 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x47, 0x65, 0x74, 0x48, 0x69, + 0x73, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x38, 0x82, + 0xd3, 0xe4, 0x93, 0x02, 0x32, 0x12, 0x30, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x72, 0x6f, 0x75, 0x70, + 0x5f, 0x62, 0x69, 0x6c, 0x6c, 0x2f, 0x68, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x79, 0x2f, 0x7b, 0x67, + 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x7b, 0x73, 0x6b, 0x69, 0x70, 0x7d, 0x2f, + 0x7b, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x7d, 0x42, 0x1e, 0x5a, 0x1c, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x53, 0x70, 0x65, 0x65, 0x64, 0x52, 0x65, 0x61, 0x63, 0x68, + 0x2f, 0x6d, 0x6f, 0x6e, 0x69, 0x66, 0x79, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( - file_groups_bill_proto_rawDescOnce sync.Once - file_groups_bill_proto_rawDescData = file_groups_bill_proto_rawDesc + file_group_bill_proto_rawDescOnce sync.Once + file_group_bill_proto_rawDescData = file_group_bill_proto_rawDesc ) -func file_groups_bill_proto_rawDescGZIP() []byte { - file_groups_bill_proto_rawDescOnce.Do(func() { - file_groups_bill_proto_rawDescData = protoimpl.X.CompressGZIP(file_groups_bill_proto_rawDescData) +func file_group_bill_proto_rawDescGZIP() []byte { + file_group_bill_proto_rawDescOnce.Do(func() { + file_group_bill_proto_rawDescData = protoimpl.X.CompressGZIP(file_group_bill_proto_rawDescData) }) - return file_groups_bill_proto_rawDescData + return file_group_bill_proto_rawDescData } -var file_groups_bill_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_groups_bill_proto_msgTypes = make([]protoimpl.MessageInfo, 19) -var file_groups_bill_proto_goTypes = []interface{}{ +var file_group_bill_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_group_bill_proto_msgTypes = make([]protoimpl.MessageInfo, 19) +var file_group_bill_proto_goTypes = []interface{}{ (GroupBillHistoryType)(0), // 0: GroupBillHistoryType (*GroupGroupBillEmpty)(nil), // 1: GroupGroupBillEmpty (*CreateGroupBillRequest)(nil), // 2: CreateGroupBillRequest @@ -1381,7 +1381,7 @@ var file_groups_bill_proto_goTypes = []interface{}{ (*GroupBillHistory)(nil), // 19: GroupBillHistory (*timestamppb.Timestamp)(nil), // 20: google.protobuf.Timestamp } -var file_groups_bill_proto_depIdxs = []int32{ +var file_group_bill_proto_depIdxs = []int32{ 3, // 0: CreateGroupBillRequest.prepaid_people:type_name -> InsertPrepaidPerson 4, // 1: CreateGroupBillRequest.split_people:type_name -> InsertSplitPerson 3, // 2: ModifyGroupBillRequest.prepaid_people:type_name -> InsertPrepaidPerson @@ -1409,13 +1409,13 @@ var file_groups_bill_proto_depIdxs = []int32{ 0, // [0:10] is the sub-list for field type_name } -func init() { file_groups_bill_proto_init() } -func file_groups_bill_proto_init() { - if File_groups_bill_proto != nil { +func init() { file_group_bill_proto_init() } +func file_group_bill_proto_init() { + if File_group_bill_proto != nil { return } if !protoimpl.UnsafeEnabled { - file_groups_bill_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_group_bill_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GroupGroupBillEmpty); i { case 0: return &v.state @@ -1427,7 +1427,7 @@ func file_groups_bill_proto_init() { return nil } } - file_groups_bill_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_group_bill_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CreateGroupBillRequest); i { case 0: return &v.state @@ -1439,7 +1439,7 @@ func file_groups_bill_proto_init() { return nil } } - file_groups_bill_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + file_group_bill_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*InsertPrepaidPerson); i { case 0: return &v.state @@ -1451,7 +1451,7 @@ func file_groups_bill_proto_init() { return nil } } - file_groups_bill_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + file_group_bill_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*InsertSplitPerson); i { case 0: return &v.state @@ -1463,7 +1463,7 @@ func file_groups_bill_proto_init() { return nil } } - file_groups_bill_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + file_group_bill_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*PrepaidPerson); i { case 0: return &v.state @@ -1475,7 +1475,7 @@ func file_groups_bill_proto_init() { return nil } } - file_groups_bill_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + file_group_bill_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SplitPerson); i { case 0: return &v.state @@ -1487,7 +1487,7 @@ func file_groups_bill_proto_init() { return nil } } - file_groups_bill_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + file_group_bill_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CreateGroupBillResponse); i { case 0: return &v.state @@ -1499,7 +1499,7 @@ func file_groups_bill_proto_init() { return nil } } - file_groups_bill_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + file_group_bill_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*DeleteGroupBillRequest); i { case 0: return &v.state @@ -1511,7 +1511,7 @@ func file_groups_bill_proto_init() { return nil } } - file_groups_bill_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + file_group_bill_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ModifyGroupBillRequest); i { case 0: return &v.state @@ -1523,7 +1523,7 @@ func file_groups_bill_proto_init() { return nil } } - file_groups_bill_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + file_group_bill_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetSelfTotalSpendRequest); i { case 0: return &v.state @@ -1535,7 +1535,7 @@ func file_groups_bill_proto_init() { return nil } } - file_groups_bill_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + file_group_bill_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetSelfTotalSpendResponse); i { case 0: return &v.state @@ -1547,7 +1547,7 @@ func file_groups_bill_proto_init() { return nil } } - file_groups_bill_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + file_group_bill_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetGroupTotalSpendRequest); i { case 0: return &v.state @@ -1559,7 +1559,7 @@ func file_groups_bill_proto_init() { return nil } } - file_groups_bill_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + file_group_bill_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetGroupTotalSpendResponse); i { case 0: return &v.state @@ -1571,7 +1571,7 @@ func file_groups_bill_proto_init() { return nil } } - file_groups_bill_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + file_group_bill_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetGroupBillsRequest); i { case 0: return &v.state @@ -1583,7 +1583,7 @@ func file_groups_bill_proto_init() { return nil } } - file_groups_bill_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + file_group_bill_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetGroupBillsResponse); i { case 0: return &v.state @@ -1595,7 +1595,7 @@ func file_groups_bill_proto_init() { return nil } } - file_groups_bill_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + file_group_bill_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CreatedGroupBill); i { case 0: return &v.state @@ -1607,7 +1607,7 @@ func file_groups_bill_proto_init() { return nil } } - file_groups_bill_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + file_group_bill_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetHistoryRequest); i { case 0: return &v.state @@ -1619,7 +1619,7 @@ func file_groups_bill_proto_init() { return nil } } - file_groups_bill_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + file_group_bill_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetHistoryResponse); i { case 0: return &v.state @@ -1631,7 +1631,7 @@ func file_groups_bill_proto_init() { return nil } } - file_groups_bill_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + file_group_bill_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GroupBillHistory); i { case 0: return &v.state @@ -1648,19 +1648,19 @@ func file_groups_bill_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_groups_bill_proto_rawDesc, + RawDescriptor: file_group_bill_proto_rawDesc, NumEnums: 1, NumMessages: 19, NumExtensions: 0, NumServices: 1, }, - GoTypes: file_groups_bill_proto_goTypes, - DependencyIndexes: file_groups_bill_proto_depIdxs, - EnumInfos: file_groups_bill_proto_enumTypes, - MessageInfos: file_groups_bill_proto_msgTypes, + GoTypes: file_group_bill_proto_goTypes, + DependencyIndexes: file_group_bill_proto_depIdxs, + EnumInfos: file_group_bill_proto_enumTypes, + MessageInfos: file_group_bill_proto_msgTypes, }.Build() - File_groups_bill_proto = out.File - file_groups_bill_proto_rawDesc = nil - file_groups_bill_proto_goTypes = nil - file_groups_bill_proto_depIdxs = nil + File_group_bill_proto = out.File + file_group_bill_proto_rawDesc = nil + file_group_bill_proto_goTypes = nil + file_group_bill_proto_depIdxs = nil } diff --git a/protobuf/gen/go/groups_bill.pb.gw.go b/protobuf/gen/go/group_bill.pb.gw.go similarity index 99% rename from protobuf/gen/go/groups_bill.pb.gw.go rename to protobuf/gen/go/group_bill.pb.gw.go index c788243..99aa73f 100644 --- a/protobuf/gen/go/groups_bill.pb.gw.go +++ b/protobuf/gen/go/group_bill.pb.gw.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: groups_bill.proto +// source: group_bill.proto /* Package monify is a reverse proxy. diff --git a/protobuf/gen/go/groups_bill_grpc.pb.go b/protobuf/gen/go/group_bill_grpc.pb.go similarity index 99% rename from protobuf/gen/go/groups_bill_grpc.pb.go rename to protobuf/gen/go/group_bill_grpc.pb.go index 912eb3e..eca62b9 100644 --- a/protobuf/gen/go/groups_bill_grpc.pb.go +++ b/protobuf/gen/go/group_bill_grpc.pb.go @@ -2,7 +2,7 @@ // versions: // - protoc-gen-go-grpc v1.3.0 // - protoc v4.25.2 -// source: groups_bill.proto +// source: group_bill.proto package monify @@ -253,5 +253,5 @@ var GroupsBillService_ServiceDesc = grpc.ServiceDesc{ }, }, Streams: []grpc.StreamDesc{}, - Metadata: "groups_bill.proto", + Metadata: "group_bill.proto", } diff --git a/protobuf/gen/go/media.pb.go b/protobuf/gen/go/media.pb.go new file mode 100644 index 0000000..7487295 --- /dev/null +++ b/protobuf/gen/go/media.pb.go @@ -0,0 +1,268 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.34.1 +// protoc v4.25.2 +// source: media.proto + +package monify + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type Usage int32 + +const ( + Usage_Undefined Usage = 0 + Usage_UserAvatar Usage = 1 + Usage_GroupAvatar Usage = 2 +) + +// Enum value maps for Usage. +var ( + Usage_name = map[int32]string{ + 0: "Undefined", + 1: "UserAvatar", + 2: "GroupAvatar", + } + Usage_value = map[string]int32{ + "Undefined": 0, + "UserAvatar": 1, + "GroupAvatar": 2, + } +) + +func (x Usage) Enum() *Usage { + p := new(Usage) + *p = x + return p +} + +func (x Usage) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Usage) Descriptor() protoreflect.EnumDescriptor { + return file_media_proto_enumTypes[0].Descriptor() +} + +func (Usage) Type() protoreflect.EnumType { + return &file_media_proto_enumTypes[0] +} + +func (x Usage) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Usage.Descriptor instead. +func (Usage) EnumDescriptor() ([]byte, []int) { + return file_media_proto_rawDescGZIP(), []int{0} +} + +type MEmpty struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *MEmpty) Reset() { + *x = MEmpty{} + if protoimpl.UnsafeEnabled { + mi := &file_media_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MEmpty) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MEmpty) ProtoMessage() {} + +func (x *MEmpty) ProtoReflect() protoreflect.Message { + mi := &file_media_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MEmpty.ProtoReflect.Descriptor instead. +func (*MEmpty) Descriptor() ([]byte, []int) { + return file_media_proto_rawDescGZIP(), []int{0} +} + +type ConfirmImageUsageRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ImageId string `protobuf:"bytes,1,opt,name=image_id,json=imageId,proto3" json:"image_id,omitempty"` + Usage Usage `protobuf:"varint,2,opt,name=usage,proto3,enum=Usage" json:"usage,omitempty"` +} + +func (x *ConfirmImageUsageRequest) Reset() { + *x = ConfirmImageUsageRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_media_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ConfirmImageUsageRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ConfirmImageUsageRequest) ProtoMessage() {} + +func (x *ConfirmImageUsageRequest) ProtoReflect() protoreflect.Message { + mi := &file_media_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ConfirmImageUsageRequest.ProtoReflect.Descriptor instead. +func (*ConfirmImageUsageRequest) Descriptor() ([]byte, []int) { + return file_media_proto_rawDescGZIP(), []int{1} +} + +func (x *ConfirmImageUsageRequest) GetImageId() string { + if x != nil { + return x.ImageId + } + return "" +} + +func (x *ConfirmImageUsageRequest) GetUsage() Usage { + if x != nil { + return x.Usage + } + return Usage_Undefined +} + +var File_media_proto protoreflect.FileDescriptor + +var file_media_proto_rawDesc = []byte{ + 0x0a, 0x0b, 0x6d, 0x65, 0x64, 0x69, 0x61, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x08, 0x0a, + 0x06, 0x4d, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x53, 0x0a, 0x18, 0x43, 0x6f, 0x6e, 0x66, 0x69, + 0x72, 0x6d, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x55, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x69, 0x6d, 0x61, 0x67, 0x65, 0x49, 0x64, 0x12, 0x1c, + 0x0a, 0x05, 0x75, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x06, 0x2e, + 0x55, 0x73, 0x61, 0x67, 0x65, 0x52, 0x05, 0x75, 0x73, 0x61, 0x67, 0x65, 0x2a, 0x37, 0x0a, 0x05, + 0x55, 0x73, 0x61, 0x67, 0x65, 0x12, 0x0d, 0x0a, 0x09, 0x55, 0x6e, 0x64, 0x65, 0x66, 0x69, 0x6e, + 0x65, 0x64, 0x10, 0x00, 0x12, 0x0e, 0x0a, 0x0a, 0x55, 0x73, 0x65, 0x72, 0x41, 0x76, 0x61, 0x74, + 0x61, 0x72, 0x10, 0x01, 0x12, 0x0f, 0x0a, 0x0b, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x41, 0x76, 0x61, + 0x74, 0x61, 0x72, 0x10, 0x02, 0x32, 0x47, 0x0a, 0x0c, 0x4d, 0x65, 0x64, 0x69, 0x61, 0x53, 0x65, + 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x37, 0x0a, 0x11, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, + 0x49, 0x6d, 0x61, 0x67, 0x65, 0x55, 0x73, 0x61, 0x67, 0x65, 0x12, 0x19, 0x2e, 0x43, 0x6f, 0x6e, + 0x66, 0x69, 0x72, 0x6d, 0x49, 0x6d, 0x61, 0x67, 0x65, 0x55, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x07, 0x2e, 0x4d, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x42, 0x1e, + 0x5a, 0x1c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x53, 0x70, 0x65, + 0x65, 0x64, 0x52, 0x65, 0x61, 0x63, 0x68, 0x2f, 0x6d, 0x6f, 0x6e, 0x69, 0x66, 0x79, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_media_proto_rawDescOnce sync.Once + file_media_proto_rawDescData = file_media_proto_rawDesc +) + +func file_media_proto_rawDescGZIP() []byte { + file_media_proto_rawDescOnce.Do(func() { + file_media_proto_rawDescData = protoimpl.X.CompressGZIP(file_media_proto_rawDescData) + }) + return file_media_proto_rawDescData +} + +var file_media_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_media_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_media_proto_goTypes = []interface{}{ + (Usage)(0), // 0: Usage + (*MEmpty)(nil), // 1: MEmpty + (*ConfirmImageUsageRequest)(nil), // 2: ConfirmImageUsageRequest +} +var file_media_proto_depIdxs = []int32{ + 0, // 0: ConfirmImageUsageRequest.usage:type_name -> Usage + 2, // 1: MediaService.ConfirmImageUsage:input_type -> ConfirmImageUsageRequest + 1, // 2: MediaService.ConfirmImageUsage:output_type -> MEmpty + 2, // [2:3] is the sub-list for method output_type + 1, // [1:2] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name +} + +func init() { file_media_proto_init() } +func file_media_proto_init() { + if File_media_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_media_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MEmpty); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_media_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ConfirmImageUsageRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_media_proto_rawDesc, + NumEnums: 1, + NumMessages: 2, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_media_proto_goTypes, + DependencyIndexes: file_media_proto_depIdxs, + EnumInfos: file_media_proto_enumTypes, + MessageInfos: file_media_proto_msgTypes, + }.Build() + File_media_proto = out.File + file_media_proto_rawDesc = nil + file_media_proto_goTypes = nil + file_media_proto_depIdxs = nil +} diff --git a/protobuf/gen/go/media.pb.gw.go b/protobuf/gen/go/media.pb.gw.go new file mode 100644 index 0000000..124ffd7 --- /dev/null +++ b/protobuf/gen/go/media.pb.gw.go @@ -0,0 +1,163 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: media.proto + +/* +Package monify is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package monify + +import ( + "context" + "io" + "net/http" + + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" + "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = metadata.Join + +func request_MediaService_ConfirmImageUsage_0(ctx context.Context, marshaler runtime.Marshaler, client MediaServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ConfirmImageUsageRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.ConfirmImageUsage(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_MediaService_ConfirmImageUsage_0(ctx context.Context, marshaler runtime.Marshaler, server MediaServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq ConfirmImageUsageRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.ConfirmImageUsage(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterMediaServiceHandlerServer registers the http handlers for service MediaService to "mux". +// UnaryRPC :call MediaServiceServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterMediaServiceHandlerFromEndpoint instead. +func RegisterMediaServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server MediaServiceServer) error { + + mux.Handle("POST", pattern_MediaService_ConfirmImageUsage_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/.MediaService/ConfirmImageUsage", runtime.WithHTTPPathPattern("/MediaService/ConfirmImageUsage")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_MediaService_ConfirmImageUsage_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_MediaService_ConfirmImageUsage_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterMediaServiceHandlerFromEndpoint is same as RegisterMediaServiceHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterMediaServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.NewClient(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterMediaServiceHandler(ctx, mux, conn) +} + +// RegisterMediaServiceHandler registers the http handlers for service MediaService to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterMediaServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterMediaServiceHandlerClient(ctx, mux, NewMediaServiceClient(conn)) +} + +// RegisterMediaServiceHandlerClient registers the http handlers for service MediaService +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "MediaServiceClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "MediaServiceClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "MediaServiceClient" to call the correct interceptors. +func RegisterMediaServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client MediaServiceClient) error { + + mux.Handle("POST", pattern_MediaService_ConfirmImageUsage_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/.MediaService/ConfirmImageUsage", runtime.WithHTTPPathPattern("/MediaService/ConfirmImageUsage")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_MediaService_ConfirmImageUsage_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_MediaService_ConfirmImageUsage_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_MediaService_ConfirmImageUsage_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"MediaService", "ConfirmImageUsage"}, "")) +) + +var ( + forward_MediaService_ConfirmImageUsage_0 = runtime.ForwardResponseMessage +) diff --git a/protobuf/gen/go/media_grpc.pb.go b/protobuf/gen/go/media_grpc.pb.go new file mode 100644 index 0000000..4d343da --- /dev/null +++ b/protobuf/gen/go/media_grpc.pb.go @@ -0,0 +1,109 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc v4.25.2 +// source: media.proto + +package monify + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + MediaService_ConfirmImageUsage_FullMethodName = "/MediaService/ConfirmImageUsage" +) + +// MediaServiceClient is the client API for MediaService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type MediaServiceClient interface { + ConfirmImageUsage(ctx context.Context, in *ConfirmImageUsageRequest, opts ...grpc.CallOption) (*MEmpty, error) +} + +type mediaServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewMediaServiceClient(cc grpc.ClientConnInterface) MediaServiceClient { + return &mediaServiceClient{cc} +} + +func (c *mediaServiceClient) ConfirmImageUsage(ctx context.Context, in *ConfirmImageUsageRequest, opts ...grpc.CallOption) (*MEmpty, error) { + out := new(MEmpty) + err := c.cc.Invoke(ctx, MediaService_ConfirmImageUsage_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MediaServiceServer is the server API for MediaService service. +// All implementations must embed UnimplementedMediaServiceServer +// for forward compatibility +type MediaServiceServer interface { + ConfirmImageUsage(context.Context, *ConfirmImageUsageRequest) (*MEmpty, error) + mustEmbedUnimplementedMediaServiceServer() +} + +// UnimplementedMediaServiceServer must be embedded to have forward compatible implementations. +type UnimplementedMediaServiceServer struct { +} + +func (UnimplementedMediaServiceServer) ConfirmImageUsage(context.Context, *ConfirmImageUsageRequest) (*MEmpty, error) { + return nil, status.Errorf(codes.Unimplemented, "method ConfirmImageUsage not implemented") +} +func (UnimplementedMediaServiceServer) mustEmbedUnimplementedMediaServiceServer() {} + +// UnsafeMediaServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to MediaServiceServer will +// result in compilation errors. +type UnsafeMediaServiceServer interface { + mustEmbedUnimplementedMediaServiceServer() +} + +func RegisterMediaServiceServer(s grpc.ServiceRegistrar, srv MediaServiceServer) { + s.RegisterService(&MediaService_ServiceDesc, srv) +} + +func _MediaService_ConfirmImageUsage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ConfirmImageUsageRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MediaServiceServer).ConfirmImageUsage(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: MediaService_ConfirmImageUsage_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MediaServiceServer).ConfirmImageUsage(ctx, req.(*ConfirmImageUsageRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// MediaService_ServiceDesc is the grpc.ServiceDesc for MediaService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var MediaService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "MediaService", + HandlerType: (*MediaServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ConfirmImageUsage", + Handler: _MediaService_ConfirmImageUsage_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "media.proto", +} diff --git a/protobuf/gen/go/user.pb.go b/protobuf/gen/go/user.pb.go new file mode 100644 index 0000000..1481c64 --- /dev/null +++ b/protobuf/gen/go/user.pb.go @@ -0,0 +1,339 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.34.1 +// protoc v4.25.2 +// source: user.proto + +package monify + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type UEmpty struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *UEmpty) Reset() { + *x = UEmpty{} + if protoimpl.UnsafeEnabled { + mi := &file_user_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UEmpty) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UEmpty) ProtoMessage() {} + +func (x *UEmpty) ProtoReflect() protoreflect.Message { + mi := &file_user_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UEmpty.ProtoReflect.Descriptor instead. +func (*UEmpty) Descriptor() ([]byte, []int) { + return file_user_proto_rawDescGZIP(), []int{0} +} + +type UpdateUserNameRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` +} + +func (x *UpdateUserNameRequest) Reset() { + *x = UpdateUserNameRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_user_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UpdateUserNameRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UpdateUserNameRequest) ProtoMessage() {} + +func (x *UpdateUserNameRequest) ProtoReflect() protoreflect.Message { + mi := &file_user_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use UpdateUserNameRequest.ProtoReflect.Descriptor instead. +func (*UpdateUserNameRequest) Descriptor() ([]byte, []int) { + return file_user_proto_rawDescGZIP(), []int{1} +} + +func (x *UpdateUserNameRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +type AddDeviceTokenRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + DeviceToken string `protobuf:"bytes,1,opt,name=device_token,json=deviceToken,proto3" json:"device_token,omitempty"` +} + +func (x *AddDeviceTokenRequest) Reset() { + *x = AddDeviceTokenRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_user_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AddDeviceTokenRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AddDeviceTokenRequest) ProtoMessage() {} + +func (x *AddDeviceTokenRequest) ProtoReflect() protoreflect.Message { + mi := &file_user_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use AddDeviceTokenRequest.ProtoReflect.Descriptor instead. +func (*AddDeviceTokenRequest) Descriptor() ([]byte, []int) { + return file_user_proto_rawDescGZIP(), []int{2} +} + +func (x *AddDeviceTokenRequest) GetDeviceToken() string { + if x != nil { + return x.DeviceToken + } + return "" +} + +type RemoveDeviceTokenRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + DeviceToken string `protobuf:"bytes,1,opt,name=device_token,json=deviceToken,proto3" json:"device_token,omitempty"` +} + +func (x *RemoveDeviceTokenRequest) Reset() { + *x = RemoveDeviceTokenRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_user_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RemoveDeviceTokenRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RemoveDeviceTokenRequest) ProtoMessage() {} + +func (x *RemoveDeviceTokenRequest) ProtoReflect() protoreflect.Message { + mi := &file_user_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RemoveDeviceTokenRequest.ProtoReflect.Descriptor instead. +func (*RemoveDeviceTokenRequest) Descriptor() ([]byte, []int) { + return file_user_proto_rawDescGZIP(), []int{3} +} + +func (x *RemoveDeviceTokenRequest) GetDeviceToken() string { + if x != nil { + return x.DeviceToken + } + return "" +} + +var File_user_proto protoreflect.FileDescriptor + +var file_user_proto_rawDesc = []byte{ + 0x0a, 0x0a, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x08, 0x0a, 0x06, + 0x55, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x2b, 0x0a, 0x15, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x55, 0x73, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, + 0x61, 0x6d, 0x65, 0x22, 0x3a, 0x0a, 0x15, 0x41, 0x64, 0x64, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, + 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, + 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, + 0x3d, 0x0a, 0x18, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x54, + 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x64, + 0x65, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0b, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x32, 0xb2, + 0x01, 0x0a, 0x0b, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x33, + 0x0a, 0x0e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, + 0x12, 0x16, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x4e, 0x61, 0x6d, + 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x07, 0x2e, 0x55, 0x45, 0x6d, 0x70, 0x74, + 0x79, 0x22, 0x00, 0x12, 0x33, 0x0a, 0x0e, 0x41, 0x64, 0x64, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, + 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x16, 0x2e, 0x41, 0x64, 0x64, 0x44, 0x65, 0x76, 0x69, 0x63, + 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x07, 0x2e, + 0x55, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x39, 0x0a, 0x11, 0x52, 0x65, 0x6d, 0x6f, + 0x76, 0x65, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x19, 0x2e, + 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x54, 0x6f, 0x6b, 0x65, + 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x07, 0x2e, 0x55, 0x45, 0x6d, 0x70, 0x74, + 0x79, 0x22, 0x00, 0x42, 0x1e, 0x5a, 0x1c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x53, 0x70, 0x65, 0x65, 0x64, 0x52, 0x65, 0x61, 0x63, 0x68, 0x2f, 0x6d, 0x6f, 0x6e, + 0x69, 0x66, 0x79, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_user_proto_rawDescOnce sync.Once + file_user_proto_rawDescData = file_user_proto_rawDesc +) + +func file_user_proto_rawDescGZIP() []byte { + file_user_proto_rawDescOnce.Do(func() { + file_user_proto_rawDescData = protoimpl.X.CompressGZIP(file_user_proto_rawDescData) + }) + return file_user_proto_rawDescData +} + +var file_user_proto_msgTypes = make([]protoimpl.MessageInfo, 4) +var file_user_proto_goTypes = []interface{}{ + (*UEmpty)(nil), // 0: UEmpty + (*UpdateUserNameRequest)(nil), // 1: UpdateUserNameRequest + (*AddDeviceTokenRequest)(nil), // 2: AddDeviceTokenRequest + (*RemoveDeviceTokenRequest)(nil), // 3: RemoveDeviceTokenRequest +} +var file_user_proto_depIdxs = []int32{ + 1, // 0: UserService.UpdateUserName:input_type -> UpdateUserNameRequest + 2, // 1: UserService.AddDeviceToken:input_type -> AddDeviceTokenRequest + 3, // 2: UserService.RemoveDeviceToken:input_type -> RemoveDeviceTokenRequest + 0, // 3: UserService.UpdateUserName:output_type -> UEmpty + 0, // 4: UserService.AddDeviceToken:output_type -> UEmpty + 0, // 5: UserService.RemoveDeviceToken:output_type -> UEmpty + 3, // [3:6] is the sub-list for method output_type + 0, // [0:3] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_user_proto_init() } +func file_user_proto_init() { + if File_user_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_user_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UEmpty); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UpdateUserNameRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AddDeviceTokenRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RemoveDeviceTokenRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_user_proto_rawDesc, + NumEnums: 0, + NumMessages: 4, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_user_proto_goTypes, + DependencyIndexes: file_user_proto_depIdxs, + MessageInfos: file_user_proto_msgTypes, + }.Build() + File_user_proto = out.File + file_user_proto_rawDesc = nil + file_user_proto_goTypes = nil + file_user_proto_depIdxs = nil +} diff --git a/protobuf/gen/go/user.pb.gw.go b/protobuf/gen/go/user.pb.gw.go new file mode 100644 index 0000000..9928398 --- /dev/null +++ b/protobuf/gen/go/user.pb.gw.go @@ -0,0 +1,317 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: user.proto + +/* +Package monify is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package monify + +import ( + "context" + "io" + "net/http" + + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" + "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = metadata.Join + +func request_UserService_UpdateUserName_0(ctx context.Context, marshaler runtime.Marshaler, client UserServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq UpdateUserNameRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.UpdateUserName(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_UserService_UpdateUserName_0(ctx context.Context, marshaler runtime.Marshaler, server UserServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq UpdateUserNameRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.UpdateUserName(ctx, &protoReq) + return msg, metadata, err + +} + +func request_UserService_AddDeviceToken_0(ctx context.Context, marshaler runtime.Marshaler, client UserServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq AddDeviceTokenRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.AddDeviceToken(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_UserService_AddDeviceToken_0(ctx context.Context, marshaler runtime.Marshaler, server UserServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq AddDeviceTokenRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.AddDeviceToken(ctx, &protoReq) + return msg, metadata, err + +} + +func request_UserService_RemoveDeviceToken_0(ctx context.Context, marshaler runtime.Marshaler, client UserServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq RemoveDeviceTokenRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.RemoveDeviceToken(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_UserService_RemoveDeviceToken_0(ctx context.Context, marshaler runtime.Marshaler, server UserServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq RemoveDeviceTokenRequest + var metadata runtime.ServerMetadata + + if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.RemoveDeviceToken(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterUserServiceHandlerServer registers the http handlers for service UserService to "mux". +// UnaryRPC :call UserServiceServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterUserServiceHandlerFromEndpoint instead. +func RegisterUserServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server UserServiceServer) error { + + mux.Handle("POST", pattern_UserService_UpdateUserName_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/.UserService/UpdateUserName", runtime.WithHTTPPathPattern("/UserService/UpdateUserName")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_UserService_UpdateUserName_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_UserService_UpdateUserName_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_UserService_AddDeviceToken_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/.UserService/AddDeviceToken", runtime.WithHTTPPathPattern("/UserService/AddDeviceToken")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_UserService_AddDeviceToken_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_UserService_AddDeviceToken_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_UserService_RemoveDeviceToken_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/.UserService/RemoveDeviceToken", runtime.WithHTTPPathPattern("/UserService/RemoveDeviceToken")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_UserService_RemoveDeviceToken_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_UserService_RemoveDeviceToken_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterUserServiceHandlerFromEndpoint is same as RegisterUserServiceHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterUserServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.NewClient(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Errorf("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterUserServiceHandler(ctx, mux, conn) +} + +// RegisterUserServiceHandler registers the http handlers for service UserService to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterUserServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterUserServiceHandlerClient(ctx, mux, NewUserServiceClient(conn)) +} + +// RegisterUserServiceHandlerClient registers the http handlers for service UserService +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "UserServiceClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "UserServiceClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "UserServiceClient" to call the correct interceptors. +func RegisterUserServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client UserServiceClient) error { + + mux.Handle("POST", pattern_UserService_UpdateUserName_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/.UserService/UpdateUserName", runtime.WithHTTPPathPattern("/UserService/UpdateUserName")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_UserService_UpdateUserName_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_UserService_UpdateUserName_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_UserService_AddDeviceToken_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/.UserService/AddDeviceToken", runtime.WithHTTPPathPattern("/UserService/AddDeviceToken")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_UserService_AddDeviceToken_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_UserService_AddDeviceToken_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("POST", pattern_UserService_RemoveDeviceToken_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/.UserService/RemoveDeviceToken", runtime.WithHTTPPathPattern("/UserService/RemoveDeviceToken")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_UserService_RemoveDeviceToken_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_UserService_RemoveDeviceToken_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_UserService_UpdateUserName_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"UserService", "UpdateUserName"}, "")) + + pattern_UserService_AddDeviceToken_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"UserService", "AddDeviceToken"}, "")) + + pattern_UserService_RemoveDeviceToken_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"UserService", "RemoveDeviceToken"}, "")) +) + +var ( + forward_UserService_UpdateUserName_0 = runtime.ForwardResponseMessage + + forward_UserService_AddDeviceToken_0 = runtime.ForwardResponseMessage + + forward_UserService_RemoveDeviceToken_0 = runtime.ForwardResponseMessage +) diff --git a/protobuf/gen/go/user_grpc.pb.go b/protobuf/gen/go/user_grpc.pb.go new file mode 100644 index 0000000..c758921 --- /dev/null +++ b/protobuf/gen/go/user_grpc.pb.go @@ -0,0 +1,183 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.3.0 +// - protoc v4.25.2 +// source: user.proto + +package monify + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +const ( + UserService_UpdateUserName_FullMethodName = "/UserService/UpdateUserName" + UserService_AddDeviceToken_FullMethodName = "/UserService/AddDeviceToken" + UserService_RemoveDeviceToken_FullMethodName = "/UserService/RemoveDeviceToken" +) + +// UserServiceClient is the client API for UserService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type UserServiceClient interface { + UpdateUserName(ctx context.Context, in *UpdateUserNameRequest, opts ...grpc.CallOption) (*UEmpty, error) + AddDeviceToken(ctx context.Context, in *AddDeviceTokenRequest, opts ...grpc.CallOption) (*UEmpty, error) + RemoveDeviceToken(ctx context.Context, in *RemoveDeviceTokenRequest, opts ...grpc.CallOption) (*UEmpty, error) +} + +type userServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewUserServiceClient(cc grpc.ClientConnInterface) UserServiceClient { + return &userServiceClient{cc} +} + +func (c *userServiceClient) UpdateUserName(ctx context.Context, in *UpdateUserNameRequest, opts ...grpc.CallOption) (*UEmpty, error) { + out := new(UEmpty) + err := c.cc.Invoke(ctx, UserService_UpdateUserName_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userServiceClient) AddDeviceToken(ctx context.Context, in *AddDeviceTokenRequest, opts ...grpc.CallOption) (*UEmpty, error) { + out := new(UEmpty) + err := c.cc.Invoke(ctx, UserService_AddDeviceToken_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *userServiceClient) RemoveDeviceToken(ctx context.Context, in *RemoveDeviceTokenRequest, opts ...grpc.CallOption) (*UEmpty, error) { + out := new(UEmpty) + err := c.cc.Invoke(ctx, UserService_RemoveDeviceToken_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// UserServiceServer is the server API for UserService service. +// All implementations must embed UnimplementedUserServiceServer +// for forward compatibility +type UserServiceServer interface { + UpdateUserName(context.Context, *UpdateUserNameRequest) (*UEmpty, error) + AddDeviceToken(context.Context, *AddDeviceTokenRequest) (*UEmpty, error) + RemoveDeviceToken(context.Context, *RemoveDeviceTokenRequest) (*UEmpty, error) + mustEmbedUnimplementedUserServiceServer() +} + +// UnimplementedUserServiceServer must be embedded to have forward compatible implementations. +type UnimplementedUserServiceServer struct { +} + +func (UnimplementedUserServiceServer) UpdateUserName(context.Context, *UpdateUserNameRequest) (*UEmpty, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateUserName not implemented") +} +func (UnimplementedUserServiceServer) AddDeviceToken(context.Context, *AddDeviceTokenRequest) (*UEmpty, error) { + return nil, status.Errorf(codes.Unimplemented, "method AddDeviceToken not implemented") +} +func (UnimplementedUserServiceServer) RemoveDeviceToken(context.Context, *RemoveDeviceTokenRequest) (*UEmpty, error) { + return nil, status.Errorf(codes.Unimplemented, "method RemoveDeviceToken not implemented") +} +func (UnimplementedUserServiceServer) mustEmbedUnimplementedUserServiceServer() {} + +// UnsafeUserServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to UserServiceServer will +// result in compilation errors. +type UnsafeUserServiceServer interface { + mustEmbedUnimplementedUserServiceServer() +} + +func RegisterUserServiceServer(s grpc.ServiceRegistrar, srv UserServiceServer) { + s.RegisterService(&UserService_ServiceDesc, srv) +} + +func _UserService_UpdateUserName_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(UpdateUserNameRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServiceServer).UpdateUserName(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: UserService_UpdateUserName_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServiceServer).UpdateUserName(ctx, req.(*UpdateUserNameRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _UserService_AddDeviceToken_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AddDeviceTokenRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServiceServer).AddDeviceToken(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: UserService_AddDeviceToken_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServiceServer).AddDeviceToken(ctx, req.(*AddDeviceTokenRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _UserService_RemoveDeviceToken_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RemoveDeviceTokenRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServiceServer).RemoveDeviceToken(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: UserService_RemoveDeviceToken_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServiceServer).RemoveDeviceToken(ctx, req.(*RemoveDeviceTokenRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// UserService_ServiceDesc is the grpc.ServiceDesc for UserService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var UserService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "UserService", + HandlerType: (*UserServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "UpdateUserName", + Handler: _UserService_UpdateUserName_Handler, + }, + { + MethodName: "AddDeviceToken", + Handler: _UserService_AddDeviceToken_Handler, + }, + { + MethodName: "RemoveDeviceToken", + Handler: _UserService_RemoveDeviceToken_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "user.proto", +} diff --git a/protobuf/gen/monify.swagger.json b/protobuf/gen/monify.swagger.json index e422684..785970a 100644 --- a/protobuf/gen/monify.swagger.json +++ b/protobuf/gen/monify.swagger.json @@ -11,6 +11,9 @@ { "name": "GroupService" }, + { + "name": "UserService" + }, { "name": "GroupsBillService" } @@ -842,6 +845,9 @@ "type": "string" } } + }, + "UEmpty": { + "type": "object" } }, "securityDefinitions": { diff --git a/protobuf/groups_bill.proto b/protobuf/group_bill.proto similarity index 95% rename from protobuf/groups_bill.proto rename to protobuf/group_bill.proto index 151a3e6..7cac8e8 100644 --- a/protobuf/groups_bill.proto +++ b/protobuf/group_bill.proto @@ -1,149 +1,149 @@ -syntax = "proto3"; -option go_package = "github.com/SpeedReach/monify"; - -import "google/api/annotations.proto"; -import "google/protobuf/timestamp.proto"; - -message GroupGroupBillEmpty{} - -service GroupsBillService{ - rpc CreateGroupBill(CreateGroupBillRequest) returns (CreateGroupBillResponse){ - option (google.api.http) = { - post: "/v1/groups_bill" - body: "*" - }; - } - - rpc GetGroupBills(GetGroupBillsRequest) returns (GetGroupBillsResponse){ - option (google.api.http) = { - get: "/v1/groups_bill/{group_id}" - }; - } - - rpc DeleteGroupBill(DeleteGroupBillRequest) returns (GroupGroupBillEmpty){ - option (google.api.http) = { - delete: "/v1/groups_bill/{bill_id}" - }; - } - - rpc ModifyGroupBill(ModifyGroupBillRequest) returns (GroupGroupBillEmpty){ - option (google.api.http) = { - put: "/v1/groups_bill/{bill_id}" - body: "*" - }; - } - - rpc GetHistory(GetHistoryRequest) returns (GetHistoryResponse) { - option (google.api.http) = { - get: "/v1/group_bill/history/{group_id}/{skip}/{limit}" - }; - } -} - -message CreateGroupBillRequest{ - string group_id = 1; - double total_money = 2; - string title = 3; - string description = 4; - repeated InsertPrepaidPerson prepaid_people = 5; - repeated InsertSplitPerson split_people = 6; -} - -message InsertPrepaidPerson{ - string member_id = 1; - double amount = 2; -} - -message InsertSplitPerson{ - string member_id = 1; - double amount = 2; -} - -message PrepaidPerson{ - string member_id = 1; - double amount = 2; - string username = 3; -} - -message SplitPerson{ - string member_id = 1; - double amount = 2; - string username = 3; -} - -message CreateGroupBillResponse{ - string bill_id = 1; -} - -message DeleteGroupBillRequest{ - string bill_id = 1; -} - -message ModifyGroupBillRequest{ - reserved 1, 8; - string bill_id = 7; - double total_money = 2; - string title = 3; - string description = 4; - repeated InsertPrepaidPerson prepaid_people = 5; - repeated InsertSplitPerson split_people = 6; -} - -message GetSelfTotalSpendRequest{ - string group_id = 1; -} - -message GetSelfTotalSpendResponse{ - double amount = 1; -} - -message GetGroupTotalSpendRequest{ - string group_id = 1; -} - -message GetGroupTotalSpendResponse{ - double amount = 1; -} - -message GetGroupBillsRequest { - string group_id = 1; -} - - -message GetGroupBillsResponse { - repeated CreatedGroupBill group_bills = 1; -} - -message CreatedGroupBill{ - string bill_id = 1; - string group_id = 2; - double total_money = 3; - string title = 4; - string description = 5; - repeated PrepaidPerson prepaid_people = 6; - repeated SplitPerson split_people = 7; -} - -message GetHistoryRequest{ - int32 skip=1; - int32 limit=2; - string group_id=3; -} - -message GetHistoryResponse{ - repeated GroupBillHistory histories = 1; -} - -message GroupBillHistory{ - GroupBillHistoryType type = 1; - //The member_name who did the operation - string operator_name = 2; - string title = 3; - google.protobuf.Timestamp timestamp = 4; -} - -enum GroupBillHistoryType{ - create=0; - delete=1; - modify=2; +syntax = "proto3"; +option go_package = "github.com/SpeedReach/monify"; + +import "google/api/annotations.proto"; +import "google/protobuf/timestamp.proto"; + +message GroupGroupBillEmpty{} + +service GroupsBillService{ + rpc CreateGroupBill(CreateGroupBillRequest) returns (CreateGroupBillResponse){ + option (google.api.http) = { + post: "/v1/groups_bill" + body: "*" + }; + } + + rpc GetGroupBills(GetGroupBillsRequest) returns (GetGroupBillsResponse){ + option (google.api.http) = { + get: "/v1/groups_bill/{group_id}" + }; + } + + rpc DeleteGroupBill(DeleteGroupBillRequest) returns (GroupGroupBillEmpty){ + option (google.api.http) = { + delete: "/v1/groups_bill/{bill_id}" + }; + } + + rpc ModifyGroupBill(ModifyGroupBillRequest) returns (GroupGroupBillEmpty){ + option (google.api.http) = { + put: "/v1/groups_bill/{bill_id}" + body: "*" + }; + } + + rpc GetHistory(GetHistoryRequest) returns (GetHistoryResponse) { + option (google.api.http) = { + get: "/v1/group_bill/history/{group_id}/{skip}/{limit}" + }; + } +} + +message CreateGroupBillRequest{ + string group_id = 1; + double total_money = 2; + string title = 3; + string description = 4; + repeated InsertPrepaidPerson prepaid_people = 5; + repeated InsertSplitPerson split_people = 6; +} + +message InsertPrepaidPerson{ + string member_id = 1; + double amount = 2; +} + +message InsertSplitPerson{ + string member_id = 1; + double amount = 2; +} + +message PrepaidPerson{ + string member_id = 1; + double amount = 2; + string username = 3; +} + +message SplitPerson{ + string member_id = 1; + double amount = 2; + string username = 3; +} + +message CreateGroupBillResponse{ + string bill_id = 1; +} + +message DeleteGroupBillRequest{ + string bill_id = 1; +} + +message ModifyGroupBillRequest{ + reserved 1, 8; + string bill_id = 7; + double total_money = 2; + string title = 3; + string description = 4; + repeated InsertPrepaidPerson prepaid_people = 5; + repeated InsertSplitPerson split_people = 6; +} + +message GetSelfTotalSpendRequest{ + string group_id = 1; +} + +message GetSelfTotalSpendResponse{ + double amount = 1; +} + +message GetGroupTotalSpendRequest{ + string group_id = 1; +} + +message GetGroupTotalSpendResponse{ + double amount = 1; +} + +message GetGroupBillsRequest { + string group_id = 1; +} + + +message GetGroupBillsResponse { + repeated CreatedGroupBill group_bills = 1; +} + +message CreatedGroupBill{ + string bill_id = 1; + string group_id = 2; + double total_money = 3; + string title = 4; + string description = 5; + repeated PrepaidPerson prepaid_people = 6; + repeated SplitPerson split_people = 7; +} + +message GetHistoryRequest{ + int32 skip=1; + int32 limit=2; + string group_id=3; +} + +message GetHistoryResponse{ + repeated GroupBillHistory histories = 1; +} + +message GroupBillHistory{ + GroupBillHistoryType type = 1; + //The member_name who did the operation + string operator_name = 2; + string title = 3; + google.protobuf.Timestamp timestamp = 4; +} + +enum GroupBillHistoryType{ + create=0; + delete=1; + modify=2; } \ No newline at end of file diff --git a/protobuf/media b/protobuf/media new file mode 100644 index 0000000..e69de29 diff --git a/protobuf/media.proto b/protobuf/media.proto new file mode 100644 index 0000000..d582181 --- /dev/null +++ b/protobuf/media.proto @@ -0,0 +1,21 @@ + +syntax = "proto3"; +option go_package = "github.com/SpeedReach/monify"; + + +message MEmpty{} +service MediaService { + rpc ConfirmImageUsage(ConfirmImageUsageRequest) returns (MEmpty); +} + + +message ConfirmImageUsageRequest { + string image_id = 1; + Usage usage = 2; +} + +enum Usage { + Undefined = 0; + UserAvatar = 1; + GroupAvatar = 2; +} diff --git a/protobuf/user.proto b/protobuf/user.proto index 745a3d8..d4af522 100644 --- a/protobuf/user.proto +++ b/protobuf/user.proto @@ -6,7 +6,9 @@ message UEmpty {} service UserService { rpc UpdateUserName (UpdateUserNameRequest) returns (UEmpty) {} - + + rpc AddDeviceToken (AddDeviceTokenRequest) returns (UEmpty) {} + rpc RemoveDeviceToken (RemoveDeviceTokenRequest) returns (UEmpty) {} } @@ -15,4 +17,10 @@ message UpdateUserNameRequest { string name = 1; } +message AddDeviceTokenRequest { + string device_token = 1; +} +message RemoveDeviceTokenRequest { + string device_token = 1; +} diff --git a/services/api/middlewares/auth_middleware.go b/services/api/middlewares/auth_middleware.go deleted file mode 100644 index ea53a1a..0000000 --- a/services/api/middlewares/auth_middleware.go +++ /dev/null @@ -1,51 +0,0 @@ -package middlewares - -import ( - "context" - "github.com/golang-jwt/jwt/v5" - "github.com/google/uuid" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" - "strings" -) - -type AuthMiddleware struct { - JwtSecret string -} - -func (m AuthMiddleware) ExtractUserId(ctx context.Context, req any, info *grpc.UnaryServerInfo) (uuid.UUID, error) { - md, exists := metadata.FromIncomingContext(ctx) - if !exists { - return uuid.Nil, nil - } - auths := md.Get("authorization") - if len(auths) == 0 { - return uuid.Nil, nil - } - auth := auths[0] - - if strings.HasPrefix(auth, "Bearer ") { - tokenStr := auth[7:] - token, err := jwt.ParseWithClaims(tokenStr, &jwt.RegisteredClaims{}, func(token *jwt.Token) (interface{}, error) { - return []byte(m.JwtSecret), nil - }) - if claims, ok := token.Claims.(*jwt.RegisteredClaims); ok { - userId, err := uuid.Parse(claims.Subject) - if err != nil { - return uuid.Nil, status.Error(codes.Unauthenticated, err.Error()) - } - - return userId, nil - } else { - switch err { - case nil: - return uuid.Nil, status.Error(codes.Unauthenticated, "Unauthenticated") - default: - return uuid.Nil, status.Error(codes.Unauthenticated, err.Error()) - } - } - } - return uuid.Nil, nil -} diff --git a/services/api/server.go b/services/api/server.go index dabd611..87cae53 100644 --- a/services/api/server.go +++ b/services/api/server.go @@ -8,12 +8,12 @@ import ( "go.uber.org/zap" "google.golang.org/grpc" "monify/lib" + authLib "monify/lib/auth" monify "monify/protobuf/gen/go" "monify/services/api/controllers/auth" "monify/services/api/controllers/group" "monify/services/api/controllers/group_bill" "monify/services/api/infra" - "monify/services/api/middlewares" "net" ) @@ -46,9 +46,9 @@ func SetupServices(g *grpc.Server, config ServerConfig) { } func setupInterceptor(resources infra.Resources, config ServerConfig) grpc.ServerOption { - authFn := middlewares.AuthMiddleware{JwtSecret: config.JwtSecret} + authFn := authLib.AuthMiddleware{JwtSecret: config.JwtSecret} interceptor := func(ctx context.Context, req any, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (any, error) { - userId, err := authFn.ExtractUserId(ctx, req, info) + userId, err := authFn.GrpcExtractUserId(ctx, req, info) if err != nil { return nil, err } diff --git a/services/media/config.go b/services/media/config.go new file mode 100644 index 0000000..5a8beae --- /dev/null +++ b/services/media/config.go @@ -0,0 +1,23 @@ +package media + +type Config struct { + PostgresURI string + S3Host string + S3Bucket string + S3KeyId string + S3KeyValue string + S3Region string + JwtSecret string +} + +func NewConfig(secrets map[string]string) Config { + return Config{ + JwtSecret: secrets["JWT_SECRET"], + PostgresURI: secrets["POSTGRES_URI"], + S3Host: secrets["S3_HOST"], + S3Bucket: secrets["S3_BUCKET"], + S3KeyId: secrets["S3_KEY_ID"], + S3KeyValue: secrets["S3_KEY_VALUE"], + S3Region: secrets["S3_REGION"], + } +} diff --git a/services/media/handler.go b/services/media/handler.go new file mode 100644 index 0000000..cd87534 --- /dev/null +++ b/services/media/handler.go @@ -0,0 +1,114 @@ +package media + +import ( + "context" + "database/sql" + "encoding/json" + "fmt" + "github.com/google/uuid" + "io" + "monify/lib" + "monify/lib/media" + "net/http" + "strings" + "time" +) + +type UploadImageResponse struct { + Url string `json:"url"` + ImageId string `json:"image_id"` +} + +func uploadImage(w http.ResponseWriter, r *http.Request) { + // Check if the request is a POST request + if r.Method != http.MethodPost { + http.Error(w, "Method not allowed", http.StatusMethodNotAllowed) + return + } + userId, ok := r.Context().Value(lib.UserIdContextKey{}).(uuid.UUID) + if !ok { + http.Error(w, "Unauthorized", http.StatusUnauthorized) + return + } + + // Parse our multipart form, 10 << 20 specifies a maximum upload of 10 MB files. + parseErr := r.ParseMultipartForm(10 << 20) + if parseErr != nil { + http.Error(w, "Could not parse multipart form", http.StatusBadRequest) + return + } + + // Get the usage of the image + usageId := r.FormValue("usage") + usage := media.Parse(usageId) + if usage == media.Undefined { + http.Error(w, "Invalid image usage.", http.StatusBadRequest) + return + } + + // Get the file from the form data + file, handler, err := r.FormFile("image") + if err != nil { + fmt.Println("Error Retrieving the File") + fmt.Println(err) + } + defer file.Close() + + // Read the image data & type + imageData, err := io.ReadAll(file) + if err != nil { + fmt.Println("Error Reading the File") + fmt.Println(err) + } + + if !strings.Contains(http.DetectContentType(imageData), "image") { + http.Error(w, "該檔案不是圖片", http.StatusBadRequest) + } + + imageStorage := r.Context().Value(lib.ImageStorageContextKey{}).(media.ImageStorage) + config := r.Context().Value(lib.ConfigContextKey{}).(Config) + imgId := uuid.New() + url, err := imageStorage.Store(extractFileNameSuffix(handler.Filename), imageData, imgId.String()) + if err != nil { + http.Error(w, err.Error(), http.StatusInternalServerError) + return + } + + tmpImage := media.TmpImage{ + URL: url, + ExpectedUsage: usage, + Uploader: userId, + Id: imgId, + UploadedAt: time.Now().UTC(), + } + err = StoreTmpImg(r.Context(), tmpImage) + if err != nil { + http.Error(w, err.Error(), http.StatusInternalServerError) + return + } + + //Success Response + res := UploadImageResponse{ + Url: config.S3Host + url, + ImageId: imgId.String(), + } + w.Header().Set("Content-Type", "application/json") + resBody, err := json.Marshal(res) + if err != nil { + http.Error(w, err.Error(), http.StatusInternalServerError) + return + } + w.Write(resBody) + return +} + +func extractFileNameSuffix(fileName string) string { + split := strings.Split(fileName, ".") + return split[len(split)-1] +} + +func StoreTmpImg(ctx context.Context, img media.TmpImage) error { + db := ctx.Value(lib.DatabaseContextKey{}).(*sql.DB) + _, err := db.ExecContext(ctx, "INSERT INTO tmpimage (imgid, url, uploader, expected_usage, uploaded_at) VALUES ($1, $2, $3, $4, $5)", img.Id, img.URL, img.Uploader, img.ExpectedUsage, img.UploadedAt) + return err +} diff --git a/services/media/infra.go b/services/media/infra.go new file mode 100644 index 0000000..1e3c636 --- /dev/null +++ b/services/media/infra.go @@ -0,0 +1,25 @@ +package media + +import ( + "database/sql" + _ "github.com/jackc/pgx/v5/stdlib" +) + +type Infra struct { + db *sql.DB + objStorage S3ImageStorage +} + +func Setup(config Config) (Infra, error) { + db, err := sql.Open("pgx", config.PostgresURI) + if err != nil { + return Infra{}, err + } + if err = db.Ping(); err != nil { + return Infra{}, err + } + + return Infra{ + db: db, + }, nil +} diff --git a/services/media/instance.go b/services/media/instance.go new file mode 100644 index 0000000..170a590 --- /dev/null +++ b/services/media/instance.go @@ -0,0 +1,15 @@ +package media + +import ( + "log" + "monify/lib/auth" + "net/http" +) + +func Start(config Config) { + + authMiddleware := auth.AuthMiddleware{JwtSecret: config.JwtSecret} + http.Handle("/image", authMiddleware.HttpMiddleware(http.HandlerFunc(uploadImage))) + + log.Fatal(http.ListenAndServe(":8080", nil)) +} diff --git a/services/media/s3_image_storage.go b/services/media/s3_image_storage.go new file mode 100644 index 0000000..8b3cf3f --- /dev/null +++ b/services/media/s3_image_storage.go @@ -0,0 +1,62 @@ +package media + +import ( + "bytes" + "errors" + "fmt" + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/credentials" + "github.com/aws/aws-sdk-go/aws/session" + "github.com/aws/aws-sdk-go/service/s3" + "github.com/google/uuid" + "monify/lib/media" + "time" +) + +type S3ImageStorage struct { + svc *s3.S3 + config Config + media.ImageStorage +} + +func (m S3ImageStorage) Store(fileSuffix string, imageData []byte, imageId string) (string, error) { + now := time.Now() + if imageId == "" { + uid, err := uuid.NewRandom() + if err != nil { + return "", nil + } + imageId = uid.String() + } + key := fmt.Sprintf("/images/%d/%d/%d/%s.%s", now.Year(), now.Month(), now.Day(), imageId, fileSuffix) + _, err := m.svc.PutObject(&s3.PutObjectInput{ + Bucket: aws.String(m.config.S3Bucket), + Key: aws.String(key), + Body: bytes.NewReader(imageData), + }) + if err != nil { + return "", errors.Join(errors.New("could not upload to s3"), err) + } + return key, nil +} + +func (m S3ImageStorage) Delete(path string) error { + _, err := m.svc.DeleteObject(&s3.DeleteObjectInput{ + Bucket: aws.String(m.config.S3Bucket), + Key: aws.String(path), + }) + return err +} + +func NewS3ImageStorage(config Config) S3ImageStorage { + sess := session.Must(session.NewSession(&aws.Config{ + Credentials: credentials.NewStaticCredentials(config.S3KeyId, config.S3KeyValue, ""), + CredentialsChainVerboseErrors: aws.Bool(true), + Region: aws.String(config.S3Region), + })) + svc := s3.New(sess) + return S3ImageStorage{ + svc: svc, + config: config, + } +} diff --git a/services/media/usage.go b/services/media/usage.go new file mode 100644 index 0000000..90dec23 --- /dev/null +++ b/services/media/usage.go @@ -0,0 +1 @@ +package media