Commit 1dae6eea by Li Feifei

修改grpc参数验证方式

parent 6b062a92
File added
......@@ -14,19 +14,19 @@ require (
github.com/go-playground/universal-translator v0.17.0 // indirect
github.com/go-redis/redis/v8 v8.0.0-beta.5
github.com/go-sql-driver/mysql v1.5.0
github.com/gogo/protobuf v1.3.1 // indirect
github.com/gogo/protobuf v1.3.1
github.com/golang/protobuf v1.4.2
github.com/google/pprof v0.0.0-20200630070148-6609db78bf68 // indirect
github.com/grpc-ecosystem/go-grpc-middleware v1.2.0
github.com/grpc-ecosystem/grpc-health-probe v0.3.2 // indirect
github.com/iancoleman/strcase v0.0.0-20191112232945-16388991a334 // indirect
github.com/ianlancetaylor/demangle v0.0.0-20200703042025-6ce5b4c20f33 // indirect
github.com/ianlancetaylor/demangle v0.0.0-20200705045648-b855e248e31b // indirect
github.com/kisielk/errcheck v1.3.0 // indirect
github.com/kr/pretty v0.2.0 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/leodido/go-urn v1.2.0 // indirect
github.com/lyft/protoc-gen-star v0.4.15 // indirect
github.com/mwitkow/go-proto-validators v0.3.0 // indirect
github.com/mwitkow/go-proto-validators v0.3.0
github.com/pkg/errors v0.9.1 // indirect
github.com/pkg/sftp v1.11.0 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
......
......@@ -173,6 +173,7 @@ github.com/iancoleman/strcase v0.0.0-20180726023541-3605ed457bf7/go.mod h1:SK73t
github.com/iancoleman/strcase v0.0.0-20191112232945-16388991a334/go.mod h1:SK73tn/9oHe+/Y0h39VT4UCxmurVJkR5NA7kMEAOgSE=
github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
github.com/ianlancetaylor/demangle v0.0.0-20200703042025-6ce5b4c20f33/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
github.com/ianlancetaylor/demangle v0.0.0-20200705045648-b855e248e31b/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk=
......
......@@ -11,12 +11,13 @@ import (
"im-microservice/sevice/im_user"
iur "im-microservice/sevice/im_user_relationship"
"google.golang.org/grpc"
"google.golang.org/grpc/keepalive"
"google.golang.org/grpc/reflection"
"github.com/grpc-ecosystem/go-grpc-middleware"
grpc_zap "github.com/grpc-ecosystem/go-grpc-middleware/logging/zap"
grpc_recovery "github.com/grpc-ecosystem/go-grpc-middleware/recovery"
grpc_validator "github.com/grpc-ecosystem/go-grpc-middleware/validator"
"google.golang.org/grpc"
"google.golang.org/grpc/keepalive"
"google.golang.org/grpc/reflection"
)
var (
......@@ -39,11 +40,12 @@ func init() {
rpc_server := grpc.NewServer(grpc.KeepaliveEnforcementPolicy(kaep), grpc.KeepaliveParams(kasp),
grpc.UnaryInterceptor(grpc_middleware.ChainUnaryServer(
middleware.Interceptor,
middleware.Auth,
grpc_recovery.UnaryServerInterceptor(middleware.RecoveryInterceptor()),
grpc_zap.UnaryServerInterceptor(middleware.ZapInterceptor()),
)))
grpc_validator.UnaryServerInterceptor(),
middleware.Interceptor,
middleware.Auth,
grpc_recovery.UnaryServerInterceptor(middleware.RecoveryInterceptor()),
grpc_zap.UnaryServerInterceptor(middleware.ZapInterceptor()),
)))
srv := health.NewServer()
pb.RegisterHealthServer(rpc_server, srv)
pb.RegisterConfigureSeviceServer(rpc_server, &ic.ConfigureSevice{})
......
{"level":"info","ts":"2020-07-03T14:56:45.414+0800","caller":"go-grpc-middleware@v1.2.0/chain.go:25","msg":"finished unary call with code OK","grpc.start_time":"2020-07-03T14:56:45+08:00","grpc.request.deadline":"2020-07-03T14:56:48+08:00","system":"grpc","span.kind":"server","grpc.service":"pb.UserRelationshipService","grpc.method":"ListBlackAndMuteList","grpc.code":"OK","grpc.time_ms":35.28300094604492}
{"level":"info","ts":"2020-07-03T14:56:59.366+0800","caller":"go-grpc-middleware@v1.2.0/chain.go:25","msg":"finished unary call with code OK","grpc.start_time":"2020-07-03T14:56:59+08:00","grpc.request.deadline":"2020-07-03T14:57:02+08:00","system":"grpc","span.kind":"server","grpc.service":"pb.UserRelationshipService","grpc.method":"ListBlackAndMuteList","grpc.code":"OK","grpc.time_ms":11.597999572753906}
{"level":"info","ts":"2020-07-06T11:19:34.115+0800","caller":"go-grpc-middleware@v1.2.0/chain.go:25","msg":"finished unary call with code OK","grpc.start_time":"2020-07-06T11:19:34+08:00","grpc.request.deadline":"2020-07-06T11:19:37+08:00","system":"grpc","span.kind":"server","grpc.service":"pb.UserRelationshipService","grpc.method":"ListBlackAndMuteList","grpc.code":"OK","grpc.time_ms":0.039000000804662704}
{"level":"error","ts":"2020-07-06T11:19:34.118+0800","caller":"grpclog/grpclog.go:51","msg":"grpc: server failed to encode response: rpc error: code = Internal desc = grpc: error while marshaling: proto: Marshal called with nil","system":"grpc","grpc_log":true}
{"level":"info","ts":"2020-07-06T11:20:36.556+0800","caller":"go-grpc-middleware@v1.2.0/chain.go:25","msg":"finished unary call with code OK","grpc.start_time":"2020-07-06T11:20:36+08:00","grpc.request.deadline":"2020-07-06T11:20:39+08:00","system":"grpc","span.kind":"server","grpc.service":"pb.UserRelationshipService","grpc.method":"ListBlackAndMuteList","grpc.code":"OK","grpc.time_ms":0.07500000298023224}
{"level":"error","ts":"2020-07-06T11:20:36.556+0800","caller":"grpclog/grpclog.go:51","msg":"grpc: server failed to encode response: rpc error: code = Internal desc = grpc: error while marshaling: proto: Marshal called with nil","system":"grpc","grpc_log":true}
{"level":"info","ts":"2020-07-06T11:22:08.743+0800","caller":"go-grpc-middleware@v1.2.0/chain.go:25","msg":"finished unary call with code OK","grpc.start_time":"2020-07-06T11:22:08+08:00","grpc.request.deadline":"2020-07-06T11:22:11+08:00","system":"grpc","span.kind":"server","grpc.service":"pb.UserRelationshipService","grpc.method":"ListBlackAndMuteList","grpc.code":"OK","grpc.time_ms":0.032999999821186066}
{"level":"error","ts":"2020-07-06T11:22:08.743+0800","caller":"grpclog/grpclog.go:51","msg":"grpc: server failed to encode response: rpc error: code = Internal desc = grpc: error while marshaling: proto: Marshal called with nil","system":"grpc","grpc_log":true}
{"level":"info","ts":"2020-07-06T11:23:10.498+0800","caller":"go-grpc-middleware@v1.2.0/chain.go:25","msg":"finished unary call with code OK","grpc.start_time":"2020-07-06T11:23:10+08:00","grpc.request.deadline":"2020-07-06T11:23:13+08:00","system":"grpc","span.kind":"server","grpc.service":"pb.UserRelationshipService","grpc.method":"ListBlackAndMuteList","grpc.code":"OK","grpc.time_ms":0.04800000041723251}
{"level":"error","ts":"2020-07-06T11:23:10.499+0800","caller":"grpclog/grpclog.go:51","msg":"grpc: server failed to encode response: rpc error: code = Internal desc = grpc: error while marshaling: proto: Marshal called with nil","system":"grpc","grpc_log":true}
{"level":"info","ts":"2020-07-06T11:24:08.161+0800","caller":"go-grpc-middleware@v1.2.0/chain.go:25","msg":"finished unary call with code OK","grpc.start_time":"2020-07-06T11:24:08+08:00","grpc.request.deadline":"2020-07-06T11:24:11+08:00","system":"grpc","span.kind":"server","grpc.service":"pb.UserRelationshipService","grpc.method":"ListBlackAndMuteList","grpc.code":"OK","grpc.time_ms":0.04899999871850014}
{"level":"error","ts":"2020-07-06T11:24:08.161+0800","caller":"grpclog/grpclog.go:51","msg":"grpc: server failed to encode response: rpc error: code = Internal desc = grpc: error while marshaling: proto: Marshal called with nil","system":"grpc","grpc_log":true}
{"level":"info","ts":"2020-07-06T11:25:42.985+0800","caller":"go-grpc-middleware@v1.2.0/chain.go:25","msg":"finished unary call with code OK","grpc.start_time":"2020-07-06T11:25:42+08:00","grpc.request.deadline":"2020-07-06T11:25:45+08:00","system":"grpc","span.kind":"server","grpc.service":"pb.UserRelationshipService","grpc.method":"ListBlackAndMuteList","grpc.code":"OK","grpc.time_ms":0.04600000008940697}
{"level":"error","ts":"2020-07-06T11:25:42.985+0800","caller":"grpclog/grpclog.go:51","msg":"grpc: server failed to encode response: rpc error: code = Internal desc = grpc: error while marshaling: proto: Marshal called with nil","system":"grpc","grpc_log":true}
{"level":"info","ts":"2020-07-06T11:26:47.197+0800","caller":"go-grpc-middleware@v1.2.0/chain.go:25","msg":"finished unary call with code OK","grpc.start_time":"2020-07-06T11:26:47+08:00","grpc.request.deadline":"2020-07-06T11:26:50+08:00","system":"grpc","span.kind":"server","grpc.service":"pb.UserRelationshipService","grpc.method":"ListBlackAndMuteList","grpc.code":"OK","grpc.time_ms":0.039000000804662704}
{"level":"error","ts":"2020-07-06T11:26:47.197+0800","caller":"grpclog/grpclog.go:51","msg":"grpc: server failed to encode response: rpc error: code = Internal desc = grpc: error while marshaling: proto: Marshal called with nil","system":"grpc","grpc_log":true}
{"level":"info","ts":"2020-07-06T11:27:08.533+0800","caller":"go-grpc-middleware@v1.2.0/chain.go:25","msg":"finished unary call with code OK","grpc.start_time":"2020-07-06T11:27:08+08:00","grpc.request.deadline":"2020-07-06T11:27:11+08:00","system":"grpc","span.kind":"server","grpc.service":"pb.UserRelationshipService","grpc.method":"ListBlackAndMuteList","grpc.code":"OK","grpc.time_ms":0.04800000041723251}
{"level":"error","ts":"2020-07-06T11:27:08.534+0800","caller":"grpclog/grpclog.go:51","msg":"grpc: server failed to encode response: rpc error: code = Internal desc = grpc: error while marshaling: proto: Marshal called with nil","system":"grpc","grpc_log":true}
{"level":"info","ts":"2020-07-06T11:27:33.158+0800","caller":"go-grpc-middleware@v1.2.0/chain.go:25","msg":"finished unary call with code OK","grpc.start_time":"2020-07-06T11:27:33+08:00","grpc.request.deadline":"2020-07-06T11:27:36+08:00","system":"grpc","span.kind":"server","grpc.service":"pb.UserRelationshipService","grpc.method":"ListBlackAndMuteList","grpc.code":"OK","grpc.time_ms":0.0430000014603138}
{"level":"error","ts":"2020-07-06T11:27:33.158+0800","caller":"grpclog/grpclog.go:51","msg":"grpc: server failed to encode response: rpc error: code = Internal desc = grpc: error while marshaling: proto: Marshal called with nil","system":"grpc","grpc_log":true}
{"level":"info","ts":"2020-07-06T11:28:57.627+0800","caller":"go-grpc-middleware@v1.2.0/chain.go:25","msg":"finished unary call with code OK","grpc.start_time":"2020-07-06T11:28:57+08:00","grpc.request.deadline":"2020-07-06T11:29:00+08:00","system":"grpc","span.kind":"server","grpc.service":"pb.UserRelationshipService","grpc.method":"ListBlackAndMuteList","grpc.code":"OK","grpc.time_ms":0.04399999976158142}
{"level":"error","ts":"2020-07-06T11:28:57.628+0800","caller":"grpclog/grpclog.go:51","msg":"grpc: server failed to encode response: rpc error: code = Internal desc = grpc: error while marshaling: proto: Marshal called with nil","system":"grpc","grpc_log":true}
{"level":"info","ts":"2020-07-06T13:42:58.519+0800","caller":"go-grpc-middleware@v1.2.0/chain.go:25","msg":"finished unary call with code OK","grpc.start_time":"2020-07-06T13:42:58+08:00","grpc.request.deadline":"2020-07-06T13:43:01+08:00","system":"grpc","span.kind":"server","grpc.service":"pb.UserRelationshipService","grpc.method":"ListBlackAndMuteList","grpc.code":"OK","grpc.time_ms":33.638999938964844}
{"level":"info","ts":"2020-07-06T13:43:16.098+0800","caller":"go-grpc-middleware@v1.2.0/chain.go:25","msg":"finished unary call with code OK","grpc.start_time":"2020-07-06T13:43:16+08:00","grpc.request.deadline":"2020-07-06T13:43:19+08:00","system":"grpc","span.kind":"server","grpc.service":"pb.UserRelationshipService","grpc.method":"ListBlackAndMuteList","grpc.code":"OK","grpc.time_ms":17.27400016784668}
......@@ -68,18 +68,18 @@ func Auth(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo,
curtime := c_r.FindAllStringSubmatch(s, -1)
check_sum := cs_r.FindAllStringSubmatch(s, -1)
if len(appkey) < 1 {
return nil, permissionError("缺少appkey")
}
if len(nonce) < 1 {
return nil, permissionError("缺少nonce")
}
if len(curtime) < 1 {
return nil, permissionError("缺少curtime")
}
if len(check_sum) < 1 {
return nil, permissionError("缺少checksum")
}
//if len(appkey) < 1 {
// return nil, permissionError("缺少appkey")
//}
//if len(nonce) < 1 {
// return nil, permissionError("缺少nonce")
//}
//if len(curtime) < 1 {
// return nil, permissionError("缺少curtime")
//}
//if len(check_sum) < 1 {
// return nil, permissionError("缺少checksum")
//}
request_map["Appkey"] = appkey[0][1]
request_map["Nonce"] = nonce[0][1]
request_map["Curtime"] = curtime[0][1]
......
......@@ -9,6 +9,6 @@ import (
// RecoveryInterceptor panic时返回Unknown错误吗
func RecoveryInterceptor() grpc_recovery.Option {
return grpc_recovery.WithRecoveryHandler(func(p interface{}) (err error) {
return status.Error(codes.Unknown, "panic triggered: " + err.Error())
return status.Error(codes.Unknown, "panic triggered: "+err.Error())
})
}
\ No newline at end of file
}
......@@ -5,7 +5,7 @@ import (
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
"gopkg.in/natefinch/lumberjack.v2"
)
)
func ZapInterceptor() *zap.Logger {
w := zapcore.AddSync(&lumberjack.Logger{
......@@ -25,4 +25,4 @@ func ZapInterceptor() *zap.Logger {
logger := zap.New(core, zap.AddCaller(), zap.AddCallerSkip(1))
grpc_zap.ReplaceGrpcLoggerV2(logger)
return logger
}
\ No newline at end of file
}
File added
......@@ -7,12 +7,13 @@
package pb
import (
reflect "reflect"
sync "sync"
_ "github.com/gogo/protobuf/gogoproto"
proto "github.com/golang/protobuf/proto"
_ "github.com/mwitkow/go-proto-validators"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
......@@ -172,22 +173,31 @@ var File_u_proto_common_proto protoreflect.FileDescriptor
var file_u_proto_common_proto_rawDesc = []byte{
0x0a, 0x14, 0x75, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e,
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x22, 0x6c, 0x0a, 0x06, 0x43, 0x6f,
0x6d, 0x6d, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x41, 0x70, 0x70, 0x6b, 0x65, 0x79, 0x18, 0x01,
0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x41, 0x70, 0x70, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05,
0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x4e, 0x6f, 0x6e,
0x63, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x43, 0x75, 0x72, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20,
0x01, 0x28, 0x09, 0x52, 0x07, 0x43, 0x75, 0x72, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08,
0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08,
0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x22, 0x7a, 0x0a, 0x04, 0x50, 0x61, 0x67, 0x65,
0x12, 0x18, 0x0a, 0x07, 0x50, 0x61, 0x67, 0x65, 0x74, 0x4e, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28,
0x03, 0x52, 0x07, 0x50, 0x61, 0x67, 0x65, 0x74, 0x4e, 0x6f, 0x12, 0x1a, 0x0a, 0x08, 0x50, 0x61,
0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x50, 0x61,
0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x50,
0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x54, 0x6f, 0x74, 0x61, 0x6c,
0x50, 0x61, 0x67, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x43, 0x6f, 0x75,
0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x43,
0x6f, 0x75, 0x6e, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x1a, 0x2d, 0x67, 0x69, 0x74, 0x68,
0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2f, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x62, 0x75, 0x66, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67,
0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x36, 0x67, 0x69, 0x74, 0x68, 0x75,
0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6d, 0x77, 0x69, 0x74, 0x6b, 0x6f, 0x77, 0x2f, 0x67, 0x6f,
0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2d, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72,
0x73, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x22, 0x8c, 0x01, 0x0a, 0x06, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x12, 0x1e, 0x0a, 0x06,
0x41, 0x70, 0x70, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xe2, 0xdf,
0x1f, 0x02, 0x58, 0x01, 0x52, 0x06, 0x41, 0x70, 0x70, 0x6b, 0x65, 0x79, 0x12, 0x1c, 0x0a, 0x05,
0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xe2, 0xdf, 0x1f,
0x02, 0x58, 0x01, 0x52, 0x05, 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x12, 0x20, 0x0a, 0x07, 0x43, 0x75,
0x72, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xe2, 0xdf, 0x1f,
0x02, 0x58, 0x01, 0x52, 0x07, 0x43, 0x75, 0x72, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x22, 0x0a, 0x08,
0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x06,
0xe2, 0xdf, 0x1f, 0x02, 0x58, 0x01, 0x52, 0x08, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d,
0x22, 0x7a, 0x0a, 0x04, 0x50, 0x61, 0x67, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x50, 0x61, 0x67, 0x65,
0x74, 0x4e, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x50, 0x61, 0x67, 0x65, 0x74,
0x4e, 0x6f, 0x12, 0x1a, 0x0a, 0x08, 0x50, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x18, 0x02,
0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x50, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1c,
0x0a, 0x09, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x50, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28,
0x03, 0x52, 0x09, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x50, 0x61, 0x67, 0x65, 0x12, 0x1e, 0x0a, 0x0a,
0x54, 0x6f, 0x74, 0x61, 0x6c, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03,
0x52, 0x0a, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x62, 0x06, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x33,
}
var (
......
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: u-proto/common.proto
package pb
import (
fmt "fmt"
_ "github.com/gogo/protobuf/gogoproto"
proto "github.com/golang/protobuf/proto"
_ "github.com/mwitkow/go-proto-validators"
github_com_mwitkow_go_proto_validators "github.com/mwitkow/go-proto-validators"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
func (this *Common) Validate() error {
if this.Appkey == "" {
return github_com_mwitkow_go_proto_validators.FieldError("Appkey", fmt.Errorf(`value '%v' must not be an empty string`, this.Appkey))
}
if this.Nonce == "" {
return github_com_mwitkow_go_proto_validators.FieldError("Nonce", fmt.Errorf(`value '%v' must not be an empty string`, this.Nonce))
}
if this.Curtime == "" {
return github_com_mwitkow_go_proto_validators.FieldError("Curtime", fmt.Errorf(`value '%v' must not be an empty string`, this.Curtime))
}
if this.Checksum == "" {
return github_com_mwitkow_go_proto_validators.FieldError("Checksum", fmt.Errorf(`value '%v' must not be an empty string`, this.Checksum))
}
return nil
}
func (this *Page) Validate() error {
return nil
}
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.24.0
// protoc-gen-go v1.25.0
// protoc v3.12.3
// source: u-proto/im_base.proto
......@@ -9,6 +9,7 @@ package pb
import (
context "context"
proto "github.com/golang/protobuf/proto"
_ "github.com/mwitkow/go-proto-validators"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
......@@ -442,24 +443,28 @@ var file_u_proto_im_base_proto_rawDesc = []byte{
0x0a, 0x15, 0x75, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x69, 0x6d, 0x5f, 0x62, 0x61, 0x73,
0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x1a, 0x14, 0x75, 0x2d, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x22, 0x78, 0x0a, 0x06, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x12, 0x24, 0x0a, 0x0d, 0x43,
0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01,
0x28, 0x03, 0x52, 0x0d, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x55, 0x73, 0x65, 0x72, 0x49,
0x64, 0x12, 0x28, 0x0a, 0x0f, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65,
0x54, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0f, 0x4d, 0x75, 0x6c, 0x74,
0x69, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x4d,
0x73, 0x67, 0x48, 0x6f, 0x6f, 0x6b, 0x55, 0x72, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52,
0x0a, 0x4d, 0x73, 0x67, 0x48, 0x6f, 0x6f, 0x6b, 0x55, 0x72, 0x6c, 0x22, 0x5a, 0x0a, 0x10, 0x43,
0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12,
0x22, 0x0a, 0x06, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32,
0x0a, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x06, 0x43, 0x6f, 0x6d,
0x6d, 0x6f, 0x6e, 0x12, 0x22, 0x0a, 0x06, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x18, 0x02, 0x20,
0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x70, 0x62, 0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x52,
0x06, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x22, 0x10, 0x0a, 0x0e, 0x43, 0x6f, 0x6e, 0x66, 0x69,
0x67, 0x75, 0x72, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x5f, 0x0a, 0x13, 0x43, 0x6f, 0x6e,
0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x44, 0x65, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
0x12, 0x24, 0x0a, 0x0d, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x55, 0x73, 0x65, 0x72, 0x49,
0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79,
0x6f, 0x1a, 0x36, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6d, 0x77,
0x69, 0x74, 0x6b, 0x6f, 0x77, 0x2f, 0x67, 0x6f, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2d, 0x76,
0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61,
0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x78, 0x0a, 0x06, 0x50, 0x75, 0x62,
0x6c, 0x69, 0x63, 0x12, 0x24, 0x0a, 0x0d, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79, 0x55, 0x73,
0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x43, 0x6f, 0x6d, 0x70,
0x61, 0x6e, 0x79, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x28, 0x0a, 0x0f, 0x4d, 0x75, 0x6c,
0x74, 0x69, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01,
0x28, 0x03, 0x52, 0x0f, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x54,
0x79, 0x70, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x4d, 0x73, 0x67, 0x48, 0x6f, 0x6f, 0x6b, 0x55, 0x72,
0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x4d, 0x73, 0x67, 0x48, 0x6f, 0x6f, 0x6b,
0x55, 0x72, 0x6c, 0x22, 0x5a, 0x0a, 0x10, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x22, 0x0a, 0x06, 0x43, 0x6f, 0x6d, 0x6d, 0x6f,
0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x6d,
0x6d, 0x6f, 0x6e, 0x52, 0x06, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x12, 0x22, 0x0a, 0x06, 0x50,
0x75, 0x62, 0x6c, 0x69, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x70, 0x62,
0x2e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x52, 0x06, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x22,
0x10, 0x0a, 0x0e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x52, 0x65, 0x70, 0x6c,
0x79, 0x22, 0x67, 0x0a, 0x13, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x44, 0x65,
0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2c, 0x0a, 0x0d, 0x43, 0x6f, 0x6d, 0x70,
0x61, 0x6e, 0x79, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x42,
0x06, 0xe2, 0xdf, 0x1f, 0x02, 0x58, 0x01, 0x52, 0x0d, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x6e, 0x79,
0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x22, 0x0a, 0x06, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e,
0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x6d, 0x6d,
0x6f, 0x6e, 0x52, 0x06, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x22, 0x33, 0x0a, 0x0d, 0x47, 0x65,
......
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: u-proto/im_base.proto
package pb
import (
fmt "fmt"
proto "github.com/golang/protobuf/proto"
_ "github.com/mwitkow/go-proto-validators"
github_com_mwitkow_go_proto_validators "github.com/mwitkow/go-proto-validators"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
func (this *Public) Validate() error {
return nil
}
func (this *ConfigureRequest) Validate() error {
if this.Common != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Common); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Common", err)
}
}
if this.Public != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Public); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Public", err)
}
}
return nil
}
func (this *ConfigureReply) Validate() error {
return nil
}
func (this *ConfigureDelRequest) Validate() error {
if this.Common != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Common); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Common", err)
}
}
return nil
}
func (this *GetAllRequest) Validate() error {
if this.Common != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Common); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Common", err)
}
}
return nil
}
func (this *GetAllOneReply) Validate() error {
if this.Reply != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Reply); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Reply", err)
}
}
return nil
}
func (this *GetAllReply) Validate() error {
for _, item := range this.GetAll {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("GetAll", err)
}
}
}
return nil
}
func (this *UpdateRequest) Validate() error {
if this.Common != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Common); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Common", err)
}
}
if this.Public != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Public); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Public", err)
}
}
return nil
}
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.24.0
// protoc-gen-go v1.25.0
// protoc v3.12.3
// source: u-proto/im_chat_room.proto
......@@ -9,6 +9,7 @@ package pb
import (
context "context"
proto "github.com/golang/protobuf/proto"
_ "github.com/mwitkow/go-proto-validators"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
......@@ -683,98 +684,104 @@ var file_u_proto_im_chat_room_proto_rawDesc = []byte{
0x0a, 0x1a, 0x75, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x69, 0x6d, 0x5f, 0x63, 0x68, 0x61,
0x74, 0x5f, 0x72, 0x6f, 0x6f, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62,
0x1a, 0x14, 0x75, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e,
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x8a, 0x01, 0x0a, 0x12, 0x43, 0x68, 0x61, 0x74, 0x52,
0x6f, 0x6f, 0x6d, 0x41, 0x64, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x22, 0x0a,
0x06, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e,
0x70, 0x62, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x06, 0x43, 0x6f, 0x6d, 0x6d, 0x6f,
0x6e, 0x12, 0x18, 0x0a, 0x07, 0x43, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01,
0x28, 0x09, 0x52, 0x07, 0x43, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x4e,
0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x12,
0x22, 0x0a, 0x0c, 0x41, 0x6e, 0x6e, 0x6f, 0x75, 0x6e, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x18,
0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x41, 0x6e, 0x6e, 0x6f, 0x75, 0x6e, 0x63, 0x65, 0x6d,
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x36, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63,
0x6f, 0x6d, 0x2f, 0x6d, 0x77, 0x69, 0x74, 0x6b, 0x6f, 0x77, 0x2f, 0x67, 0x6f, 0x2d, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x2d, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x2f, 0x76,
0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa2,
0x01, 0x0a, 0x12, 0x43, 0x68, 0x61, 0x74, 0x52, 0x6f, 0x6f, 0x6d, 0x41, 0x64, 0x64, 0x52, 0x65,
0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x22, 0x0a, 0x06, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x18,
0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f,
0x6e, 0x52, 0x06, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x12, 0x20, 0x0a, 0x07, 0x43, 0x72, 0x65,
0x61, 0x74, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xe2, 0xdf, 0x1f, 0x02,
0x58, 0x01, 0x52, 0x07, 0x43, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x1a, 0x0a, 0x04, 0x4e,
0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xe2, 0xdf, 0x1f, 0x02, 0x58,
0x01, 0x52, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x2a, 0x0a, 0x0c, 0x41, 0x6e, 0x6e, 0x6f, 0x75,
0x6e, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xe2,
0xdf, 0x1f, 0x02, 0x58, 0x01, 0x52, 0x0c, 0x41, 0x6e, 0x6e, 0x6f, 0x75, 0x6e, 0x63, 0x65, 0x6d,
0x65, 0x6e, 0x74, 0x22, 0x22, 0x0a, 0x10, 0x43, 0x68, 0x61, 0x74, 0x52, 0x6f, 0x6f, 0x6d, 0x41,
0x64, 0x64, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64, 0x18, 0x01, 0x20,
0x01, 0x28, 0x03, 0x52, 0x02, 0x49, 0x64, 0x22, 0xa3, 0x01, 0x0a, 0x15, 0x43, 0x68, 0x61, 0x74,
0x01, 0x28, 0x03, 0x52, 0x02, 0x49, 0x64, 0x22, 0xab, 0x01, 0x0a, 0x15, 0x43, 0x68, 0x61, 0x74,
0x52, 0x6f, 0x6f, 0x6d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
0x74, 0x12, 0x22, 0x0a, 0x06, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28,
0x0b, 0x32, 0x0a, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x06, 0x43,
0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x52, 0x6f, 0x6f, 0x6d, 0x49, 0x64, 0x18,
0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x52, 0x6f, 0x6f, 0x6d, 0x49, 0x64, 0x12, 0x12, 0x0a,
0x04, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x4e, 0x61, 0x6d,
0x65, 0x12, 0x16, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28,
0x03, 0x52, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x22, 0x0a, 0x0c, 0x41, 0x6e, 0x6e,
0x6f, 0x75, 0x6e, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52,
0x0c, 0x41, 0x6e, 0x6e, 0x6f, 0x75, 0x6e, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x22, 0x15, 0x0a,
0x13, 0x43, 0x68, 0x61, 0x74, 0x52, 0x6f, 0x6f, 0x6d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52,
0x65, 0x70, 0x6c, 0x79, 0x22, 0x50, 0x0a, 0x12, 0x43, 0x68, 0x61, 0x74, 0x52, 0x6f, 0x6f, 0x6d,
0x44, 0x65, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x22, 0x0a, 0x06, 0x43, 0x6f,
0x6d, 0x6d, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x70, 0x62, 0x2e,
0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x06, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x12, 0x16,
0x0a, 0x06, 0x52, 0x6f, 0x6f, 0x6d, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06,
0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x12, 0x1e, 0x0a, 0x06, 0x52, 0x6f, 0x6f, 0x6d, 0x49, 0x64, 0x18,
0x02, 0x20, 0x01, 0x28, 0x03, 0x42, 0x06, 0xe2, 0xdf, 0x1f, 0x02, 0x58, 0x01, 0x52, 0x06, 0x52,
0x6f, 0x6f, 0x6d, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20,
0x01, 0x28, 0x09, 0x52, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x53, 0x74, 0x61,
0x74, 0x75, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75,
0x73, 0x12, 0x22, 0x0a, 0x0c, 0x41, 0x6e, 0x6e, 0x6f, 0x75, 0x6e, 0x63, 0x65, 0x6d, 0x65, 0x6e,
0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x41, 0x6e, 0x6e, 0x6f, 0x75, 0x6e, 0x63,
0x65, 0x6d, 0x65, 0x6e, 0x74, 0x22, 0x15, 0x0a, 0x13, 0x43, 0x68, 0x61, 0x74, 0x52, 0x6f, 0x6f,
0x6d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x58, 0x0a, 0x12,
0x43, 0x68, 0x61, 0x74, 0x52, 0x6f, 0x6f, 0x6d, 0x44, 0x65, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65,
0x73, 0x74, 0x12, 0x22, 0x0a, 0x06, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01,
0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x06,
0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x12, 0x1e, 0x0a, 0x06, 0x52, 0x6f, 0x6f, 0x6d, 0x49, 0x64,
0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x42, 0x06, 0xe2, 0xdf, 0x1f, 0x02, 0x58, 0x01, 0x52, 0x06,
0x52, 0x6f, 0x6f, 0x6d, 0x49, 0x64, 0x22, 0x12, 0x0a, 0x10, 0x43, 0x68, 0x61, 0x74, 0x52, 0x6f,
0x6f, 0x6d, 0x44, 0x65, 0x6c, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x51, 0x0a, 0x13, 0x43, 0x68,
0x6f, 0x6d, 0x44, 0x65, 0x6c, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x59, 0x0a, 0x13, 0x43, 0x68,
0x61, 0x74, 0x52, 0x6f, 0x6f, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
0x74, 0x12, 0x22, 0x0a, 0x06, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28,
0x0b, 0x32, 0x0a, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x06, 0x43,
0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x52, 0x6f, 0x6f, 0x6d, 0x49, 0x64, 0x18,
0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x52, 0x6f, 0x6f, 0x6d, 0x49, 0x64, 0x22, 0xe8, 0x01,
0x0a, 0x11, 0x43, 0x68, 0x61, 0x74, 0x52, 0x6f, 0x6f, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65,
0x70, 0x6c, 0x79, 0x12, 0x17, 0x0a, 0x07, 0x52, 0x6f, 0x6f, 0x6d, 0x5f, 0x69, 0x64, 0x18, 0x01,
0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x52, 0x6f, 0x6f, 0x6d, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07,
0x43, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x43,
0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x03,
0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x22, 0x0a, 0x0c, 0x41, 0x6e,
0x6e, 0x6f, 0x75, 0x6e, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09,
0x52, 0x0c, 0x41, 0x6e, 0x6e, 0x6f, 0x75, 0x6e, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x16,
0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06,
0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x45, 0x78, 0x74, 0x18, 0x06, 0x20,
0x01, 0x28, 0x09, 0x52, 0x03, 0x45, 0x78, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x43, 0x72, 0x65, 0x61,
0x74, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x43, 0x72,
0x65, 0x61, 0x74, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x55, 0x70, 0x64, 0x61,
0x74, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x55, 0x70,
0x64, 0x61, 0x74, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x22, 0xf6, 0x01, 0x0a, 0x12, 0x43, 0x68, 0x61,
0x74, 0x52, 0x6f, 0x6f, 0x6d, 0x41, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12,
0x22, 0x0a, 0x06, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32,
0x0a, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x06, 0x43, 0x6f, 0x6d,
0x6d, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x50, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28,
0x03, 0x52, 0x04, 0x50, 0x61, 0x67, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x43, 0x72, 0x65, 0x61, 0x74,
0x6f, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x43, 0x72, 0x65, 0x61, 0x74, 0x6f,
0x72, 0x12, 0x12, 0x0a, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52,
0x04, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x22, 0x0a, 0x0c, 0x41, 0x6e, 0x6e, 0x6f, 0x75, 0x6e, 0x63,
0x65, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x41, 0x6e, 0x6e,
0x6f, 0x75, 0x6e, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x53, 0x74, 0x61,
0x74, 0x75, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75,
0x73, 0x12, 0x1e, 0x0a, 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x18,
0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x74, 0x69, 0x6d,
0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x18,
0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x74, 0x69, 0x6d,
0x65, 0x22, 0x64, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x43, 0x68, 0x61, 0x74, 0x52, 0x6f, 0x6f, 0x6d,
0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x29, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x01,
0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x61, 0x74, 0x52, 0x6f,
0x6f, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x52, 0x04, 0x4c, 0x69, 0x73,
0x74, 0x12, 0x24, 0x0a, 0x08, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20,
0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x70, 0x62, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x08, 0x50,
0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x65, 0x32, 0xb4, 0x02, 0x0a, 0x0f, 0x43, 0x68, 0x61, 0x74,
0x52, 0x6f, 0x6f, 0x6d, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x35, 0x0a, 0x03, 0x41,
0x64, 0x64, 0x12, 0x16, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x61, 0x74, 0x52, 0x6f, 0x6f, 0x6d,
0x41, 0x64, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x70, 0x62, 0x2e,
0x43, 0x68, 0x61, 0x74, 0x52, 0x6f, 0x6f, 0x6d, 0x41, 0x64, 0x64, 0x52, 0x65, 0x70, 0x6c, 0x79,
0x22, 0x00, 0x12, 0x3e, 0x0a, 0x06, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x19, 0x2e, 0x70,
0x62, 0x2e, 0x43, 0x68, 0x61, 0x74, 0x52, 0x6f, 0x6f, 0x6d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x61,
0x74, 0x52, 0x6f, 0x6f, 0x6d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79,
0x22, 0x00, 0x12, 0x38, 0x0a, 0x06, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x16, 0x2e, 0x70,
0x62, 0x2e, 0x43, 0x68, 0x61, 0x74, 0x52, 0x6f, 0x6f, 0x6d, 0x44, 0x65, 0x6c, 0x52, 0x65, 0x71,
0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x61, 0x74, 0x52, 0x6f,
0x6f, 0x6d, 0x44, 0x65, 0x6c, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x38, 0x0a, 0x04,
0x49, 0x6e, 0x66, 0x6f, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x61, 0x74, 0x52, 0x6f,
0x6f, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e,
0x70, 0x62, 0x2e, 0x43, 0x68, 0x61, 0x74, 0x52, 0x6f, 0x6f, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x52,
0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x36, 0x0a, 0x03, 0x41, 0x6c, 0x6c, 0x12, 0x16, 0x2e,
0x70, 0x62, 0x2e, 0x43, 0x68, 0x61, 0x74, 0x52, 0x6f, 0x6f, 0x6d, 0x41, 0x6c, 0x6c, 0x52, 0x65,
0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x68,
0x61, 0x74, 0x52, 0x6f, 0x6f, 0x6d, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x62, 0x06,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x12, 0x1e, 0x0a, 0x06, 0x52, 0x6f, 0x6f, 0x6d, 0x49, 0x64, 0x18,
0x02, 0x20, 0x01, 0x28, 0x03, 0x42, 0x06, 0xe2, 0xdf, 0x1f, 0x02, 0x58, 0x01, 0x52, 0x06, 0x52,
0x6f, 0x6f, 0x6d, 0x49, 0x64, 0x22, 0xe8, 0x01, 0x0a, 0x11, 0x43, 0x68, 0x61, 0x74, 0x52, 0x6f,
0x6f, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x17, 0x0a, 0x07, 0x52,
0x6f, 0x6f, 0x6d, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x52, 0x6f,
0x6f, 0x6d, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x43, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x18,
0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x43, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x12,
0x0a, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x4e, 0x61,
0x6d, 0x65, 0x12, 0x22, 0x0a, 0x0c, 0x41, 0x6e, 0x6e, 0x6f, 0x75, 0x6e, 0x63, 0x65, 0x6d, 0x65,
0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x41, 0x6e, 0x6e, 0x6f, 0x75, 0x6e,
0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73,
0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x10,
0x0a, 0x03, 0x45, 0x78, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x45, 0x78, 0x74,
0x12, 0x1e, 0x0a, 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x07,
0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x74, 0x69, 0x6d, 0x65,
0x12, 0x1e, 0x0a, 0x0a, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x08,
0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x74, 0x69, 0x6d, 0x65,
0x22, 0xf6, 0x01, 0x0a, 0x12, 0x43, 0x68, 0x61, 0x74, 0x52, 0x6f, 0x6f, 0x6d, 0x41, 0x6c, 0x6c,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x22, 0x0a, 0x06, 0x43, 0x6f, 0x6d, 0x6d, 0x6f,
0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x6d,
0x6d, 0x6f, 0x6e, 0x52, 0x06, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x50,
0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x50, 0x61, 0x67, 0x65, 0x12,
0x18, 0x0a, 0x07, 0x43, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09,
0x52, 0x07, 0x43, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x4e, 0x61, 0x6d,
0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x22, 0x0a,
0x0c, 0x41, 0x6e, 0x6e, 0x6f, 0x75, 0x6e, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x05, 0x20,
0x01, 0x28, 0x09, 0x52, 0x0c, 0x41, 0x6e, 0x6e, 0x6f, 0x75, 0x6e, 0x63, 0x65, 0x6d, 0x65, 0x6e,
0x74, 0x12, 0x16, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28,
0x03, 0x52, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1e, 0x0a, 0x0a, 0x43, 0x72, 0x65,
0x61, 0x74, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x43,
0x72, 0x65, 0x61, 0x74, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x55, 0x70, 0x64,
0x61, 0x74, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x55,
0x70, 0x64, 0x61, 0x74, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x22, 0x64, 0x0a, 0x11, 0x47, 0x65, 0x74,
0x43, 0x68, 0x61, 0x74, 0x52, 0x6f, 0x6f, 0x6d, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x29,
0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70,
0x62, 0x2e, 0x43, 0x68, 0x61, 0x74, 0x52, 0x6f, 0x6f, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65,
0x70, 0x6c, 0x79, 0x52, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x24, 0x0a, 0x08, 0x50, 0x61, 0x67,
0x69, 0x6e, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x70, 0x62,
0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x08, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x65, 0x32,
0xb4, 0x02, 0x0a, 0x0f, 0x43, 0x68, 0x61, 0x74, 0x52, 0x6f, 0x6f, 0x6d, 0x53, 0x65, 0x72, 0x76,
0x69, 0x63, 0x65, 0x12, 0x35, 0x0a, 0x03, 0x41, 0x64, 0x64, 0x12, 0x16, 0x2e, 0x70, 0x62, 0x2e,
0x43, 0x68, 0x61, 0x74, 0x52, 0x6f, 0x6f, 0x6d, 0x41, 0x64, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65,
0x73, 0x74, 0x1a, 0x14, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x61, 0x74, 0x52, 0x6f, 0x6f, 0x6d,
0x41, 0x64, 0x64, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x3e, 0x0a, 0x06, 0x55, 0x70,
0x64, 0x61, 0x74, 0x65, 0x12, 0x19, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x61, 0x74, 0x52, 0x6f,
0x6f, 0x6d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
0x17, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x61, 0x74, 0x52, 0x6f, 0x6f, 0x6d, 0x55, 0x70, 0x64,
0x61, 0x74, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x38, 0x0a, 0x06, 0x44, 0x65,
0x6c, 0x65, 0x74, 0x65, 0x12, 0x16, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x61, 0x74, 0x52, 0x6f,
0x6f, 0x6d, 0x44, 0x65, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x70,
0x62, 0x2e, 0x43, 0x68, 0x61, 0x74, 0x52, 0x6f, 0x6f, 0x6d, 0x44, 0x65, 0x6c, 0x52, 0x65, 0x70,
0x6c, 0x79, 0x22, 0x00, 0x12, 0x38, 0x0a, 0x04, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x17, 0x2e, 0x70,
0x62, 0x2e, 0x43, 0x68, 0x61, 0x74, 0x52, 0x6f, 0x6f, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65,
0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x61, 0x74, 0x52,
0x6f, 0x6f, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x36,
0x0a, 0x03, 0x41, 0x6c, 0x6c, 0x12, 0x16, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x61, 0x74, 0x52,
0x6f, 0x6f, 0x6d, 0x41, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e,
0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x68, 0x61, 0x74, 0x52, 0x6f, 0x6f, 0x6d, 0x73, 0x52,
0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
......
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: u-proto/im_chat_room.proto
package pb
import (
fmt "fmt"
proto "github.com/golang/protobuf/proto"
_ "github.com/mwitkow/go-proto-validators"
github_com_mwitkow_go_proto_validators "github.com/mwitkow/go-proto-validators"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
func (this *ChatRoomAddRequest) Validate() error {
if this.Common != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Common); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Common", err)
}
}
if this.Creator == "" {
return github_com_mwitkow_go_proto_validators.FieldError("Creator", fmt.Errorf(`value '%v' must not be an empty string`, this.Creator))
}
if this.Name == "" {
return github_com_mwitkow_go_proto_validators.FieldError("Name", fmt.Errorf(`value '%v' must not be an empty string`, this.Name))
}
if this.Announcement == "" {
return github_com_mwitkow_go_proto_validators.FieldError("Announcement", fmt.Errorf(`value '%v' must not be an empty string`, this.Announcement))
}
return nil
}
func (this *ChatRoomAddReply) Validate() error {
return nil
}
func (this *ChatRoomUpdateRequest) Validate() error {
if this.Common != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Common); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Common", err)
}
}
return nil
}
func (this *ChatRoomUpdateReply) Validate() error {
return nil
}
func (this *ChatRoomDelRequest) Validate() error {
if this.Common != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Common); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Common", err)
}
}
return nil
}
func (this *ChatRoomDelReply) Validate() error {
return nil
}
func (this *ChatRoomInfoRequest) Validate() error {
if this.Common != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Common); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Common", err)
}
}
return nil
}
func (this *ChatRoomInfoReply) Validate() error {
return nil
}
func (this *ChatRoomAllRequest) Validate() error {
if this.Common != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Common); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Common", err)
}
}
return nil
}
func (this *GetChatRoomsReply) Validate() error {
for _, item := range this.List {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("List", err)
}
}
}
if this.Paginate != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Paginate); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Paginate", err)
}
}
return nil
}
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.24.0
// protoc-gen-go v1.25.0
// protoc v3.12.3
// source: u-proto/im_user_relationship.proto
......@@ -9,6 +9,7 @@ package pb
import (
context "context"
proto "github.com/golang/protobuf/proto"
_ "github.com/mwitkow/go-proto-validators"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
......@@ -573,94 +574,103 @@ var file_u_proto_im_user_relationship_proto_rawDesc = []byte{
0x0a, 0x22, 0x75, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x69, 0x6d, 0x5f, 0x75, 0x73, 0x65,
0x72, 0x5f, 0x72, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, 0x2e, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x1a, 0x14, 0x75, 0x2d, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x94,
0x01, 0x0a, 0x1a, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73,
0x68, 0x69, 0x70, 0x41, 0x64, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x22, 0x0a,
0x06, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e,
0x70, 0x62, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x06, 0x43, 0x6f, 0x6d, 0x6d, 0x6f,
0x6e, 0x12, 0x14, 0x0a, 0x05, 0x41, 0x63, 0x63, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
0x52, 0x05, 0x41, 0x63, 0x63, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x46, 0x61, 0x63, 0x63, 0x69,
0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x46, 0x61, 0x63, 0x63, 0x69, 0x64, 0x12,
0x12, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x54,
0x6f, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x36,
0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6d, 0x77, 0x69, 0x74, 0x6b,
0x6f, 0x77, 0x2f, 0x67, 0x6f, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2d, 0x76, 0x61, 0x6c, 0x69,
0x64, 0x61, 0x74, 0x6f, 0x72, 0x73, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72,
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xac, 0x01, 0x0a, 0x1a, 0x55, 0x73, 0x65, 0x72, 0x52,
0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, 0x41, 0x64, 0x64, 0x52, 0x65,
0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x22, 0x0a, 0x06, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x18,
0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f,
0x6e, 0x52, 0x06, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x12, 0x1c, 0x0a, 0x05, 0x41, 0x63, 0x63,
0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xe2, 0xdf, 0x1f, 0x02, 0x58, 0x01,
0x52, 0x05, 0x41, 0x63, 0x63, 0x69, 0x64, 0x12, 0x1e, 0x0a, 0x06, 0x46, 0x61, 0x63, 0x63, 0x69,
0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xe2, 0xdf, 0x1f, 0x02, 0x58, 0x01, 0x52,
0x06, 0x46, 0x61, 0x63, 0x63, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x18,
0x04, 0x20, 0x01, 0x28, 0x03, 0x42, 0x06, 0xe2, 0xdf, 0x1f, 0x02, 0x58, 0x01, 0x52, 0x04, 0x54,
0x79, 0x70, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09,
0x52, 0x03, 0x4d, 0x73, 0x67, 0x22, 0x1a, 0x0a, 0x18, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x6c,
0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, 0x41, 0x64, 0x64, 0x52, 0x65, 0x70, 0x6c,
0x79, 0x22, 0x6e, 0x0a, 0x1a, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f,
0x79, 0x22, 0x7e, 0x0a, 0x1a, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f,
0x6e, 0x73, 0x68, 0x69, 0x70, 0x44, 0x65, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12,
0x22, 0x0a, 0x06, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32,
0x0a, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x06, 0x43, 0x6f, 0x6d,
0x6d, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x41, 0x63, 0x63, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01,
0x28, 0x09, 0x52, 0x05, 0x41, 0x63, 0x63, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x46, 0x61, 0x63,
0x63, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x46, 0x61, 0x63, 0x63, 0x69,
0x64, 0x22, 0x77, 0x0a, 0x1b, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f,
0x6e, 0x73, 0x68, 0x69, 0x70, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
0x6d, 0x6f, 0x6e, 0x12, 0x1c, 0x0a, 0x05, 0x41, 0x63, 0x63, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01,
0x28, 0x09, 0x42, 0x06, 0xe2, 0xdf, 0x1f, 0x02, 0x58, 0x01, 0x52, 0x05, 0x41, 0x63, 0x63, 0x69,
0x64, 0x12, 0x1e, 0x0a, 0x06, 0x46, 0x61, 0x63, 0x63, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28,
0x09, 0x42, 0x06, 0xe2, 0xdf, 0x1f, 0x02, 0x58, 0x01, 0x52, 0x06, 0x46, 0x61, 0x63, 0x63, 0x69,
0x64, 0x22, 0x87, 0x01, 0x0a, 0x1b, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69,
0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
0x74, 0x12, 0x22, 0x0a, 0x06, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28,
0x0b, 0x32, 0x0a, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x06, 0x43,
0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x12, 0x1c, 0x0a, 0x05, 0x41, 0x63, 0x63, 0x69, 0x64, 0x18, 0x02,
0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xe2, 0xdf, 0x1f, 0x02, 0x58, 0x01, 0x52, 0x05, 0x41, 0x63,
0x63, 0x69, 0x64, 0x12, 0x26, 0x0a, 0x0a, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x74, 0x69, 0x6d,
0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xe2, 0xdf, 0x1f, 0x02, 0x58, 0x01, 0x52,
0x0a, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x22, 0x4e, 0x0a, 0x14, 0x55,
0x73, 0x65, 0x72, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, 0x49,
0x6e, 0x66, 0x6f, 0x12, 0x16, 0x0a, 0x06, 0x46, 0x61, 0x63, 0x63, 0x69, 0x64, 0x18, 0x01, 0x20,
0x01, 0x28, 0x09, 0x52, 0x06, 0x46, 0x61, 0x63, 0x63, 0x69, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x55,
0x70, 0x64, 0x61, 0x74, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52,
0x0a, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x22, 0x49, 0x0a, 0x19, 0x55,
0x73, 0x65, 0x72, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, 0x4c,
0x69, 0x73, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x2c, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74,
0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x73, 0x65, 0x72,
0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, 0x49, 0x6e, 0x66, 0x6f,
0x52, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x22, 0xc9, 0x01, 0x0a, 0x15, 0x53, 0x65, 0x74, 0x53, 0x70,
0x65, 0x63, 0x69, 0x61, 0x6c, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71,
0x12, 0x22, 0x0a, 0x06, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b,
0x32, 0x0a, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x06, 0x43, 0x6f,
0x6d, 0x6d, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x41, 0x63, 0x63, 0x69, 0x64, 0x18, 0x02, 0x20,
0x01, 0x28, 0x09, 0x52, 0x05, 0x41, 0x63, 0x63, 0x69, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x55, 0x70,
0x64, 0x61, 0x74, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a,
0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x22, 0x4e, 0x0a, 0x14, 0x55, 0x73,
0x65, 0x72, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, 0x49, 0x6e,
0x66, 0x6f, 0x12, 0x16, 0x0a, 0x06, 0x46, 0x61, 0x63, 0x63, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01,
0x28, 0x09, 0x52, 0x06, 0x46, 0x61, 0x63, 0x63, 0x69, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x55, 0x70,
0x64, 0x61, 0x74, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a,
0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x22, 0x49, 0x0a, 0x19, 0x55, 0x73,
0x65, 0x72, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, 0x4c, 0x69,
0x73, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x2c, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x18,
0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52,
0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, 0x49, 0x6e, 0x66, 0x6f, 0x52,
0x04, 0x4c, 0x69, 0x73, 0x74, 0x22, 0xa9, 0x01, 0x0a, 0x15, 0x53, 0x65, 0x74, 0x53, 0x70, 0x65,
0x63, 0x69, 0x61, 0x6c, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x12,
0x22, 0x0a, 0x06, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32,
0x0a, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x06, 0x43, 0x6f, 0x6d,
0x6d, 0x6f, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x41, 0x63, 0x63, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01,
0x28, 0x09, 0x52, 0x05, 0x41, 0x63, 0x63, 0x69, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x54, 0x61, 0x72,
0x67, 0x65, 0x74, 0x41, 0x63, 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x54, 0x61,
0x72, 0x67, 0x65, 0x74, 0x41, 0x63, 0x63, 0x12, 0x22, 0x0a, 0x0c, 0x52, 0x65, 0x6c, 0x61, 0x74,
0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x52,
0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x56,
0x61, 0x6c, 0x75, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x56, 0x61, 0x6c, 0x75,
0x65, 0x22, 0x53, 0x0a, 0x17, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x6c, 0x61, 0x63, 0x6b, 0x41, 0x6e,
0x64, 0x4d, 0x75, 0x74, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x12, 0x22, 0x0a, 0x06,
0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x70,
0x62, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x06, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e,
0x12, 0x14, 0x0a, 0x05, 0x41, 0x63, 0x63, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52,
0x05, 0x41, 0x63, 0x63, 0x69, 0x64, 0x22, 0x89, 0x01, 0x0a, 0x19, 0x4c, 0x69, 0x73, 0x74, 0x42,
0x6c, 0x61, 0x63, 0x6b, 0x41, 0x6e, 0x64, 0x4d, 0x75, 0x74, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52,
0x65, 0x70, 0x6c, 0x79, 0x12, 0x34, 0x0a, 0x08, 0x4d, 0x75, 0x74, 0x65, 0x6c, 0x69, 0x73, 0x74,
0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x73, 0x65, 0x72,
0x6d, 0x6d, 0x6f, 0x6e, 0x12, 0x1c, 0x0a, 0x05, 0x41, 0x63, 0x63, 0x69, 0x64, 0x18, 0x02, 0x20,
0x01, 0x28, 0x09, 0x42, 0x06, 0xe2, 0xdf, 0x1f, 0x02, 0x58, 0x01, 0x52, 0x05, 0x41, 0x63, 0x63,
0x69, 0x64, 0x12, 0x24, 0x0a, 0x09, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x41, 0x63, 0x63, 0x18,
0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x06, 0xe2, 0xdf, 0x1f, 0x02, 0x58, 0x01, 0x52, 0x09, 0x54,
0x61, 0x72, 0x67, 0x65, 0x74, 0x41, 0x63, 0x63, 0x12, 0x2a, 0x0a, 0x0c, 0x52, 0x65, 0x6c, 0x61,
0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x42, 0x06,
0xe2, 0xdf, 0x1f, 0x02, 0x58, 0x01, 0x52, 0x0c, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e,
0x54, 0x79, 0x70, 0x65, 0x12, 0x1c, 0x0a, 0x05, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x05, 0x20,
0x01, 0x28, 0x03, 0x42, 0x06, 0xe2, 0xdf, 0x1f, 0x02, 0x58, 0x01, 0x52, 0x05, 0x56, 0x61, 0x6c,
0x75, 0x65, 0x22, 0x5b, 0x0a, 0x17, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x6c, 0x61, 0x63, 0x6b, 0x41,
0x6e, 0x64, 0x4d, 0x75, 0x74, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x12, 0x22, 0x0a,
0x06, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e,
0x70, 0x62, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x06, 0x43, 0x6f, 0x6d, 0x6d, 0x6f,
0x6e, 0x12, 0x1c, 0x0a, 0x05, 0x41, 0x63, 0x63, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
0x42, 0x06, 0xe2, 0xdf, 0x1f, 0x02, 0x58, 0x01, 0x52, 0x05, 0x41, 0x63, 0x63, 0x69, 0x64, 0x22,
0x89, 0x01, 0x0a, 0x19, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x6c, 0x61, 0x63, 0x6b, 0x41, 0x6e, 0x64,
0x4d, 0x75, 0x74, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x34, 0x0a,
0x08, 0x4d, 0x75, 0x74, 0x65, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32,
0x18, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f,
0x6e, 0x73, 0x68, 0x69, 0x70, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x08, 0x4d, 0x75, 0x74, 0x65, 0x6c,
0x69, 0x73, 0x74, 0x12, 0x36, 0x0a, 0x09, 0x42, 0x6c, 0x61, 0x63, 0x6b, 0x6c, 0x69, 0x73, 0x74,
0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x73, 0x65, 0x72,
0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, 0x49, 0x6e, 0x66, 0x6f,
0x52, 0x08, 0x4d, 0x75, 0x74, 0x65, 0x6c, 0x69, 0x73, 0x74, 0x12, 0x36, 0x0a, 0x09, 0x42, 0x6c,
0x61, 0x63, 0x6b, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e,
0x70, 0x62, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73,
0x68, 0x69, 0x70, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x09, 0x42, 0x6c, 0x61, 0x63, 0x6b, 0x6c, 0x69,
0x73, 0x74, 0x32, 0x9a, 0x03, 0x0a, 0x17, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x6c, 0x61, 0x74,
0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x45,
0x0a, 0x03, 0x41, 0x64, 0x64, 0x12, 0x1e, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52,
0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, 0x41, 0x64, 0x64, 0x52, 0x65,
0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52,
0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, 0x41, 0x64, 0x64, 0x52, 0x65,
0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x48, 0x0a, 0x06, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12,
0x1e, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f,
0x6e, 0x73, 0x68, 0x69, 0x70, 0x44, 0x65, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
0x1c, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f,
0x6e, 0x73, 0x68, 0x69, 0x70, 0x41, 0x64, 0x64, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12,
0x47, 0x0a, 0x03, 0x41, 0x6c, 0x6c, 0x12, 0x1f, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x73, 0x65, 0x72,
0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, 0x4c, 0x69, 0x73, 0x74,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x73, 0x65,
0x72, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, 0x4c, 0x69, 0x73,
0x74, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x4f, 0x0a, 0x12, 0x53, 0x65, 0x74, 0x53,
0x70, 0x65, 0x63, 0x69, 0x61, 0x6c, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x19,
0x2e, 0x70, 0x62, 0x2e, 0x53, 0x65, 0x74, 0x53, 0x70, 0x65, 0x63, 0x69, 0x61, 0x6c, 0x52, 0x65,
0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x1c, 0x2e, 0x70, 0x62, 0x2e, 0x55,
0x73, 0x65, 0x72, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, 0x41,
0x64, 0x64, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x54, 0x0a, 0x14, 0x4c, 0x69, 0x73,
0x52, 0x09, 0x42, 0x6c, 0x61, 0x63, 0x6b, 0x6c, 0x69, 0x73, 0x74, 0x32, 0x9a, 0x03, 0x0a, 0x17,
0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70,
0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x45, 0x0a, 0x03, 0x41, 0x64, 0x64, 0x12, 0x1e,
0x2e, 0x70, 0x62, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e,
0x73, 0x68, 0x69, 0x70, 0x41, 0x64, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c,
0x2e, 0x70, 0x62, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e,
0x73, 0x68, 0x69, 0x70, 0x41, 0x64, 0x64, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x48,
0x0a, 0x06, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x1e, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x73,
0x65, 0x72, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, 0x44, 0x65,
0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x73,
0x65, 0x72, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, 0x41, 0x64,
0x64, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x47, 0x0a, 0x03, 0x41, 0x6c, 0x6c, 0x12,
0x1f, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f,
0x6e, 0x73, 0x68, 0x69, 0x70, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
0x1a, 0x1d, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69,
0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22,
0x00, 0x12, 0x4f, 0x0a, 0x12, 0x53, 0x65, 0x74, 0x53, 0x70, 0x65, 0x63, 0x69, 0x61, 0x6c, 0x52,
0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x19, 0x2e, 0x70, 0x62, 0x2e, 0x53, 0x65, 0x74,
0x53, 0x70, 0x65, 0x63, 0x69, 0x61, 0x6c, 0x52, 0x65, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52,
0x65, 0x71, 0x1a, 0x1c, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x6c, 0x61,
0x74, 0x69, 0x6f, 0x6e, 0x73, 0x68, 0x69, 0x70, 0x41, 0x64, 0x64, 0x52, 0x65, 0x70, 0x6c, 0x79,
0x22, 0x00, 0x12, 0x54, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x6c, 0x61, 0x63, 0x6b, 0x41,
0x6e, 0x64, 0x4d, 0x75, 0x74, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x1b, 0x2e, 0x70, 0x62, 0x2e,
0x4c, 0x69, 0x73, 0x74, 0x42, 0x6c, 0x61, 0x63, 0x6b, 0x41, 0x6e, 0x64, 0x4d, 0x75, 0x74, 0x65,
0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x1d, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73,
0x74, 0x42, 0x6c, 0x61, 0x63, 0x6b, 0x41, 0x6e, 0x64, 0x4d, 0x75, 0x74, 0x65, 0x4c, 0x69, 0x73,
0x74, 0x12, 0x1b, 0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x6c, 0x61, 0x63, 0x6b,
0x41, 0x6e, 0x64, 0x4d, 0x75, 0x74, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x1d,
0x2e, 0x70, 0x62, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x6c, 0x61, 0x63, 0x6b, 0x41, 0x6e, 0x64,
0x4d, 0x75, 0x74, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x62,
0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x74, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
......
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: u-proto/im_user_relationship.proto
package pb
import (
fmt "fmt"
proto "github.com/golang/protobuf/proto"
_ "github.com/mwitkow/go-proto-validators"
github_com_mwitkow_go_proto_validators "github.com/mwitkow/go-proto-validators"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
func (this *UserRelationshipAddRequest) Validate() error {
if this.Common != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Common); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Common", err)
}
}
if this.Accid == "" {
return github_com_mwitkow_go_proto_validators.FieldError("Accid", fmt.Errorf(`value '%v' must not be an empty string`, this.Accid))
}
if this.Faccid == "" {
return github_com_mwitkow_go_proto_validators.FieldError("Faccid", fmt.Errorf(`value '%v' must not be an empty string`, this.Faccid))
}
return nil
}
func (this *UserRelationshipAddReply) Validate() error {
return nil
}
func (this *UserRelationshipDelRequest) Validate() error {
if this.Common != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Common); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Common", err)
}
}
if this.Accid == "" {
return github_com_mwitkow_go_proto_validators.FieldError("Accid", fmt.Errorf(`value '%v' must not be an empty string`, this.Accid))
}
if this.Faccid == "" {
return github_com_mwitkow_go_proto_validators.FieldError("Faccid", fmt.Errorf(`value '%v' must not be an empty string`, this.Faccid))
}
return nil
}
func (this *UserRelationshipListRequest) Validate() error {
if this.Common != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Common); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Common", err)
}
}
if this.Accid == "" {
return github_com_mwitkow_go_proto_validators.FieldError("Accid", fmt.Errorf(`value '%v' must not be an empty string`, this.Accid))
}
if this.Updatetime == "" {
return github_com_mwitkow_go_proto_validators.FieldError("Updatetime", fmt.Errorf(`value '%v' must not be an empty string`, this.Updatetime))
}
return nil
}
func (this *UserRelationshipInfo) Validate() error {
return nil
}
func (this *UserRelationshipListReply) Validate() error {
for _, item := range this.List {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("List", err)
}
}
}
return nil
}
func (this *SetSpecialRelationReq) Validate() error {
if this.Common != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Common); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Common", err)
}
}
if this.Accid == "" {
return github_com_mwitkow_go_proto_validators.FieldError("Accid", fmt.Errorf(`value '%v' must not be an empty string`, this.Accid))
}
if this.TargetAcc == "" {
return github_com_mwitkow_go_proto_validators.FieldError("TargetAcc", fmt.Errorf(`value '%v' must not be an empty string`, this.TargetAcc))
}
return nil
}
func (this *ListBlackAndMuteListReq) Validate() error {
if this.Common != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Common); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Common", err)
}
}
if this.Accid == "" {
return github_com_mwitkow_go_proto_validators.FieldError("Accid", fmt.Errorf(`value '%v' must not be an empty string`, this.Accid))
}
return nil
}
func (this *ListBlackAndMuteListReply) Validate() error {
for _, item := range this.Mutelist {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Mutelist", err)
}
}
}
for _, item := range this.Blacklist {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Blacklist", err)
}
}
}
return nil
}
......@@ -4,12 +4,10 @@ import (
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
"github.com/astaxie/beego/orm"
"im-microservice/db"
"im-microservice/helper"
"im-microservice/pb"
"im-microservice/validator_struct"
"github.com/astaxie/beego/orm"
)
const (
......@@ -22,7 +20,7 @@ const (
chat_create_time = "createtime"
)
func AddChatRoom(addStruct *validator_struct.ChatRoomAddStruct) (int64, error) {
func AddChatRoom(addStruct *pb.ChatRoomAddRequest) (int64, error) {
var chat db.ImChatRoom
now := helper.GetNowTime()
chat.Name = addStruct.Name
......@@ -35,7 +33,7 @@ func AddChatRoom(addStruct *validator_struct.ChatRoomAddStruct) (int64, error) {
return room_id, status.Error(codes.Internal, err.Error())
}
func UpdateChatRoom(update *validator_struct.ChatRoomUpdate) error {
func UpdateChatRoom(update *pb.ChatRoomUpdateRequest) error {
orm_params := make(orm.Params)
if update.Status != 0 {
orm_params[chat_status] = update.Status
......@@ -67,7 +65,7 @@ func DeleteChatRoom(room_id int64) error {
}
func ChatRoomInfo(info *validator_struct.ChatRoomInfo) (res db.ImChatRoom, err error) {
func ChatRoomInfo(info *pb.ChatRoomInfoRequest) (res db.ImChatRoom, err error) {
err = db.MysqlClient.QueryTable(chat_table_name).Filter(chat_room_id, info.RoomId).One(&res)
if err != nil {
err = status.Error(codes.Internal, err.Error())
......
......@@ -3,13 +3,10 @@ package im_chat_room
import (
"context"
"im-microservice/db"
"im-microservice/helper"
"im-microservice/pb"
vs "im-microservice/validator_struct"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
"im-microservice/db"
"im-microservice/pb"
)
type ImChatRoomService struct {
......@@ -19,11 +16,7 @@ type ImChatRoomService struct {
func (cr *ImChatRoomService) Add(ctx context.Context,
in *pb.ChatRoomAddRequest) (reply *pb.ChatRoomAddReply, err error) {
chat_room_struct := vs.NewAddChatRoom(in)
if err = helper.Valiator(chat_room_struct); err != nil {
return
}
room_id, err := AddChatRoom(chat_room_struct)
room_id, err := AddChatRoom(in)
if err != nil {
return
}
......@@ -34,11 +27,8 @@ func (cr *ImChatRoomService) Add(ctx context.Context,
func (cr *ImChatRoomService) Update(ctx context.Context,
in *pb.ChatRoomUpdateRequest) (reply *pb.ChatRoomUpdateReply, err error) {
chat_room_struct := vs.NewChatRoomUpdate(in)
if err = helper.Valiator(chat_room_struct); err != nil {
return
}
if err = UpdateChatRoom(chat_room_struct); err != nil {
if err = UpdateChatRoom(in); err != nil {
return
}
reply = &pb.ChatRoomUpdateReply{}
......@@ -48,12 +38,7 @@ func (cr *ImChatRoomService) Update(ctx context.Context,
func (cr *ImChatRoomService) Delete(ctx context.Context,
in *pb.ChatRoomDelRequest) (reply *pb.ChatRoomDelReply, err error) {
chat_room_struct := vs.NewChatRoomDel(in)
if err = helper.Valiator(chat_room_struct); err != nil {
return
}
if err = DeleteChatRoom(chat_room_struct.RoomId); err != nil {
if err = DeleteChatRoom(in.RoomId); err != nil {
return
}
reply = &pb.ChatRoomDelReply{}
......@@ -63,11 +48,7 @@ func (cr *ImChatRoomService) Delete(ctx context.Context,
func (cr *ImChatRoomService) Info(ctx context.Context,
in *pb.ChatRoomInfoRequest) (reply *pb.ChatRoomInfoReply, err error) {
chat_room_struct := vs.NewChatRoomInfo(in)
if err = helper.Valiator(chat_room_struct); err != nil {
return
}
db_chat_room, err := ChatRoomInfo(chat_room_struct)
db_chat_room, err := ChatRoomInfo(in)
if err != nil {
return
}
......
......@@ -38,12 +38,8 @@ func (cs *ConfigureSevice) Add(ctx context.Context,
func (cs *ConfigureSevice) Delete(ctx context.Context,
in *pb.ConfigureDelRequest) (reply *pb.ConfigureReply, err error) {
cds := vs.NewConfigureDelStruct(in)
if err = helper.Valiator(cds); err != nil {
return
}
// 执行删除操作
if err = DelConfigure(cds.CompanyUserId); err != nil {
if err = DelConfigure(in.CompanyUserId); err != nil {
return
}
reply = &pb.ConfigureReply{}
......
......@@ -2,14 +2,13 @@ package im_user_relationship
import (
"errors"
"im-microservice/db"
"im-microservice/helper"
"im-microservice/validator_struct"
"im-microservice/pb"
"github.com/astaxie/beego/orm"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
"im-microservice/db"
"im-microservice/helper"
)
var (
......@@ -33,7 +32,7 @@ func IsUserRelationship(accid, faccid string) bool {
Filter(db_field_faccid, faccid).Exist()
}
func AddUserRelationship(in *validator_struct.UserRelationshipAdd) error {
func AddUserRelationship(in *pb.UserRelationshipAddRequest) error {
var us db.ImUserRelationship
now := helper.GetNowTime()
us.Accid = in.Accid
......@@ -51,7 +50,7 @@ func AddUserRelationship(in *validator_struct.UserRelationshipAdd) error {
return err
}
func DBDelete(in *validator_struct.UserRelationshipDel) error {
func DBDelete(in *pb.UserRelationshipDelRequest) error {
_, err := db.MysqlClient.QueryTable(db_tabel).Filter(db_field_accid, in.Accid).
Filter(db_field_faccid, in.Faccid).Delete()
if err != nil {
......@@ -60,7 +59,7 @@ func DBDelete(in *validator_struct.UserRelationshipDel) error {
return err
}
func DBAll(in *validator_struct.UserRelationshipAll) ([]db.ImUserRelationship, error) {
func DBAll(in *pb.UserRelationshipListRequest) ([]db.ImUserRelationship, error) {
var friends []db.ImUserRelationship
num, err := db.MysqlClient.QueryTable(db_tabel).Filter(db_field_accid, in.Accid).
......@@ -76,7 +75,7 @@ func DBAll(in *validator_struct.UserRelationshipAll) ([]db.ImUserRelationship, e
return friends, nil
}
func SetSpecialRelationDb(in *validator_struct.SetSpecialRelation) error {
func SetSpecialRelationDb(in *pb.SetSpecialRelationReq) error {
if ok := IsUserRelationship(in.Accid, in.TargetAcc); !ok {
return errors.New("被操作用户不是该用户好友")
......@@ -108,7 +107,7 @@ func SetSpecialRelationDb(in *validator_struct.SetSpecialRelation) error {
return err
}
func ListBlackAndMuteListDB(in *validator_struct.ListBlackAndMuteList) (blacklist []db.ImUserRelationship,
func ListBlackAndMuteListDB(in *pb.ListBlackAndMuteListReq) (blacklist []db.ImUserRelationship,
mutelist []db.ImUserRelationship, err error) {
query_db := db.MysqlClient.QueryTable(db_tabel).Filter(db_field_accid, in.Accid)
......
......@@ -9,7 +9,6 @@ import (
"im-microservice/helper"
"im-microservice/pb"
vs "im-microservice/validator_struct"
)
type UserRelationshipService struct {
......@@ -19,28 +18,18 @@ type UserRelationshipService struct {
func (us *UserRelationshipService) Add(ctx context.Context,
in *pb.UserRelationshipAddRequest) (reply *pb.UserRelationshipAddReply, err error) {
m := map[string]interface{}{
"accid": in.GetAccid(),
"faccid": in.GetFaccid(),
"type": in.GetType(),
"msg": in.GetMsg(),
}
request := vs.NewUserRelationshipAdd(m)
if err = helper.Valiator(request); err != nil {
return
}
if ok := IsUserRelationship(request.Accid, request.Faccid); ok {
if ok := IsUserRelationship(in.Accid, in.Faccid); ok {
err = status.Error(codes.AlreadyExists, "已经添加过该好友")
return
}
//添加好友
if err = AddUserRelationship(request); err != nil {
if err = AddUserRelationship(in); err != nil {
return
}
// 更改用户版本信息
u_map := make(map[string]interface{})
u_map["edition"] = helper.GetNowTime()
_, _ = im_user.UpdateImUser(request.Accid, u_map)
_, _ = im_user.UpdateImUser(in.Accid, u_map)
reply = &pb.UserRelationshipAddReply{}
return
......@@ -49,22 +38,14 @@ func (us *UserRelationshipService) Add(ctx context.Context,
func (us *UserRelationshipService) Delete(ctx context.Context,
in *pb.UserRelationshipDelRequest) (reply *pb.UserRelationshipAddReply, err error) {
m := map[string]interface{}{
"accid": in.GetAccid(),
"faccid": in.GetFaccid(),
}
request := vs.NewUserRelationshipDel(m)
if err = helper.Valiator(request); err != nil {
return
}
// 删除好友
if err = DBDelete(request); err != nil {
if err = DBDelete(in); err != nil {
return
}
// 更改用户版本信息
u_map := make(map[string]interface{})
u_map["edition"] = helper.GetNowTime()
_, _ = im_user.UpdateImUser(request.Accid, u_map)
_, _ = im_user.UpdateImUser(in.Accid, u_map)
reply = &pb.UserRelationshipAddReply{}
return
......@@ -73,16 +54,7 @@ func (us *UserRelationshipService) Delete(ctx context.Context,
func (us *UserRelationshipService) All(ctx context.Context,
in *pb.UserRelationshipListRequest) (reply *pb.UserRelationshipListReply, err error) {
m := map[string]interface{}{
"accid": in.GetAccid(),
"updatetime": in.GetUpdatetime(),
}
request := vs.NewUserRelationshipAll(m)
if err = helper.Valiator(request); err != nil {
return
}
results, err := DBAll(request)
results, err := DBAll(in)
if err != nil {
err = status.Error(codes.Internal, err.Error())
return
......@@ -100,17 +72,7 @@ func (us *UserRelationshipService) All(ctx context.Context,
func (us *UserRelationshipService) SetSpecialRelation(ctx context.Context,
in *pb.SetSpecialRelationReq) (reply *pb.UserRelationshipAddReply, err error) {
m := map[string]interface{}{
"accid": in.GetAccid(),
"faccid": in.GetTargetAcc(),
"relation_type": in.GetRelationType(),
"value": in.GetValue(),
}
request := vs.NewSetSpecialRelation(m)
if err = helper.Valiator(request); err != nil {
return
}
if err = SetSpecialRelationDb(request); err != nil {
if err = SetSpecialRelationDb(in); err != nil {
err = status.Error(codes.Internal, err.Error())
return
}
......@@ -121,15 +83,7 @@ func (us *UserRelationshipService) SetSpecialRelation(ctx context.Context,
func (us *UserRelationshipService) ListBlackAndMuteList(ctx context.Context,
in *pb.ListBlackAndMuteListReq) (reply *pb.ListBlackAndMuteListReply, err error) {
m := map[string]interface{}{
"accid": in.GetAccid(),
}
request := vs.NewListBlackAndMuteList(m)
if err = helper.Valiator(request); err != nil {
return
}
blacklist, mutelist, err := ListBlackAndMuteListDB(request)
blacklist, mutelist, err := ListBlackAndMuteListDB(in)
if err != nil {
err = status.Error(codes.Internal, err.Error())
return
......
......@@ -2,11 +2,14 @@ syntax = "proto3";
package pb;
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
import "github.com/mwitkow/go-proto-validators/validator.proto";
message Common {
string Appkey = 1;
string Nonce = 2;
string Curtime = 3;
string Checksum = 4;
string Appkey = 1 [(validator.field) = {string_not_empty: true}];
string Nonce = 2 [(validator.field) = {string_not_empty: true}];
string Curtime = 3 [(validator.field) = {string_not_empty: true}];
string Checksum = 4 [(validator.field) = {string_not_empty: true}];
}
message Page {
......
......@@ -3,6 +3,7 @@ syntax = "proto3";
package pb;
import "u-proto/common.proto";
import "github.com/mwitkow/go-proto-validators/validator.proto";
message Public {
int64 CompanyUserId = 1;
......@@ -18,7 +19,7 @@ message ConfigureRequest {
message ConfigureReply {}
message ConfigureDelRequest {
int64 CompanyUserId = 1;
int64 CompanyUserId = 1 [(validator.field) = {string_not_empty: true}];
Common Common = 2;
}
......@@ -42,5 +43,5 @@ service ConfigureSevice{
rpc Select(GetAllRequest) returns(GetAllReply) {}
rpc Add (ConfigureRequest) returns(ConfigureReply) {}
rpc Delete(ConfigureDelRequest) returns(ConfigureReply) {}
rpc Update(UpdateRequest) returns(GetAllReply) {}
rpc Update(UpdateRequest) returns(ConfigureReply) {}
}
......@@ -3,13 +3,14 @@ syntax = "proto3";
package pb;
import "u-proto/common.proto";
import "github.com/mwitkow/go-proto-validators/validator.proto";
// 添加聊天室
message ChatRoomAddRequest {
Common Common = 1;
string Creator = 2;
string Name = 3;
string Announcement = 4;
string Creator = 2 [(validator.field) = {string_not_empty: true}];
string Name = 3 [(validator.field) = {string_not_empty: true}];
string Announcement = 4 [(validator.field) = {string_not_empty: true}];
}
message ChatRoomAddReply{
......@@ -19,7 +20,7 @@ message ChatRoomAddReply{
// 更新聊天室
message ChatRoomUpdateRequest {
Common Common = 1;
int64 RoomId = 2;
int64 RoomId = 2 [(validator.field) = {string_not_empty: true}];
string Name = 3;
int64 Status = 4;
string Announcement = 5;
......@@ -30,7 +31,7 @@ message ChatRoomUpdateReply {}
// 删除聊天室
message ChatRoomDelRequest {
Common Common = 1;
int64 RoomId = 2;
int64 RoomId = 2 [(validator.field) = {string_not_empty: true}];
}
message ChatRoomDelReply {}
......@@ -38,7 +39,7 @@ message ChatRoomDelReply {}
// 获取单个聊天室信息
message ChatRoomInfoRequest {
Common Common = 1;
int64 RoomId = 2;
int64 RoomId = 2 [(validator.field) = {string_not_empty: true}];
}
message ChatRoomInfoReply {
......
......@@ -3,13 +3,14 @@ syntax = "proto3";
package pb;
import "u-proto/common.proto";
import "github.com/mwitkow/go-proto-validators/validator.proto";
//添加好友
message UserRelationshipAddRequest {
Common Common = 1;
string Accid = 2;
string Faccid = 3;
int64 Type = 4;
string Accid = 2 [(validator.field) = {string_not_empty: true}];
string Faccid = 3 [(validator.field) = {string_not_empty: true}];
int64 Type = 4 [(validator.field) = {string_not_empty: true}];
string Msg = 5;
}
......@@ -19,15 +20,15 @@ message UserRelationshipAddReply {}
//删除好友
message UserRelationshipDelRequest {
Common Common = 1;
string Accid = 2;
string Faccid = 3;
string Accid = 2 [(validator.field) = {string_not_empty: true}];
string Faccid = 3 [(validator.field) = {string_not_empty: true}];
}
// 获取好友关系
message UserRelationshipListRequest {
Common Common = 1;
string Accid = 2;
string Updatetime = 3;
string Accid = 2 [(validator.field) = {string_not_empty: true}];
string Updatetime = 3 [(validator.field) = {string_not_empty: true}];
}
message UserRelationshipInfo {
......@@ -42,17 +43,17 @@ message UserRelationshipListReply {
//设置黑名单/静音
message SetSpecialRelationReq {
Common Common = 1;
string Accid = 2;
string TargetAcc = 3;
int64 RelationType = 4;
int64 Value = 5;
string Accid = 2 [(validator.field) = {string_not_empty: true}];
string TargetAcc = 3 [(validator.field) = {string_not_empty: true}];
int64 RelationType = 4 [(validator.field) = {string_not_empty: true}];
int64 Value = 5 [(validator.field) = {string_not_empty: true}];
}
//查看指定用户的黑名单和静音列表
message ListBlackAndMuteListReq {
Common Common = 1;
string Accid = 2;
string Accid = 2 [(validator.field) = {string_not_empty: true}];
}
message ListBlackAndMuteListReply {
......
......@@ -113,7 +113,7 @@ func NewChatRoomUpdate(in *pb.ChatRoomUpdateRequest) *ChatRoomUpdate {
RoomId: in.GetRoomId(),
Name: in.GetName(),
Announcement: in.GetAnnouncement(),
Status: in.GetStatus(),
Status: int64(in.GetStatus()),
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment