parameter range error (#606)

* message for your changes

Signed-off-by: ‘hanzhixiao’ <‘709674996@qq.com’>

* debug

Signed-off-by: ‘hanzhixiao’ <‘709674996@qq.com’>

* Delete start.bat

* Delete build.cmd

* fix: parameter check

Signed-off-by: hanzhixiao <709674996@qq.com>

* fix: parameter check

Signed-off-by: hanzhixiao <709674996@qq.com>

---------

Signed-off-by: ‘hanzhixiao’ <‘709674996@qq.com’>
Signed-off-by: hanzhixiao <709674996@qq.com>
Co-authored-by: ‘hanzhixiao’ <‘709674996@qq.com’>
This commit is contained in:
Alan 2023-07-20 16:31:41 +08:00 committed by GitHub
parent 7ee40bd485
commit 6de9995354
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 495 additions and 505 deletions

View File

@ -14,13 +14,16 @@
package auth
import "github.com/OpenIMSDK/Open-IM-Server/pkg/errs"
import (
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/constant"
"github.com/OpenIMSDK/Open-IM-Server/pkg/errs"
)
func (x *UserTokenReq) Check() error {
if x.UserID == "" {
return errs.ErrArgs.Wrap("userID is empty")
}
if x.PlatformID > 9 || x.PlatformID < 1 {
if x.PlatformID > constant.AdminPlatformID || x.PlatformID < constant.IOSPlatformID {
return errs.ErrArgs.Wrap("platform is invalidate")
}
return nil
@ -30,7 +33,7 @@ func (x *ForceLogoutReq) Check() error {
if x.UserID == "" {
return errs.ErrArgs.Wrap("userID is empty")
}
if x.PlatformID > 9 || x.PlatformID < 1 {
if x.PlatformID > constant.AdminPlatformID || x.PlatformID < constant.IOSPlatformID {
return errs.ErrArgs.Wrap("platformID is invalidate")
}
return nil

View File

@ -22,14 +22,13 @@ package auth
import (
context "context"
reflect "reflect"
sync "sync"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (

View File

@ -22,16 +22,14 @@ package conversation
import (
context "context"
reflect "reflect"
sync "sync"
wrapperspb "github.com/OpenIMSDK/Open-IM-Server/pkg/proto/wrapperspb"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
wrapperspb "github.com/OpenIMSDK/Open-IM-Server/pkg/proto/wrapperspb"
reflect "reflect"
sync "sync"
)
const (

View File

@ -21,11 +21,10 @@
package errinfo
import (
reflect "reflect"
sync "sync"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (

View File

@ -22,16 +22,14 @@ package friend
import (
context "context"
reflect "reflect"
sync "sync"
sdkws "github.com/OpenIMSDK/Open-IM-Server/pkg/proto/sdkws"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
sdkws "github.com/OpenIMSDK/Open-IM-Server/pkg/proto/sdkws"
reflect "reflect"
sync "sync"
)
const (

View File

@ -22,17 +22,15 @@ package group
import (
context "context"
reflect "reflect"
sync "sync"
sdkws "github.com/OpenIMSDK/Open-IM-Server/pkg/proto/sdkws"
wrapperspb "github.com/OpenIMSDK/Open-IM-Server/pkg/proto/wrapperspb"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
sdkws "github.com/OpenIMSDK/Open-IM-Server/pkg/proto/sdkws"
wrapperspb "github.com/OpenIMSDK/Open-IM-Server/pkg/proto/wrapperspb"
reflect "reflect"
sync "sync"
)
const (

View File

@ -22,16 +22,14 @@ package msg
import (
context "context"
reflect "reflect"
sync "sync"
sdkws "github.com/OpenIMSDK/Open-IM-Server/pkg/proto/sdkws"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
sdkws "github.com/OpenIMSDK/Open-IM-Server/pkg/proto/sdkws"
reflect "reflect"
sync "sync"
)
const (

View File

@ -22,16 +22,14 @@ package msggateway
import (
context "context"
reflect "reflect"
sync "sync"
sdkws "github.com/OpenIMSDK/Open-IM-Server/pkg/proto/sdkws"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
sdkws "github.com/OpenIMSDK/Open-IM-Server/pkg/proto/sdkws"
reflect "reflect"
sync "sync"
)
const (

View File

@ -22,16 +22,14 @@ package push
import (
context "context"
reflect "reflect"
sync "sync"
sdkws "github.com/OpenIMSDK/Open-IM-Server/pkg/proto/sdkws"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
sdkws "github.com/OpenIMSDK/Open-IM-Server/pkg/proto/sdkws"
reflect "reflect"
sync "sync"
)
const (

View File

@ -21,13 +21,11 @@
package sdkws
import (
reflect "reflect"
sync "sync"
wrapperspb "github.com/OpenIMSDK/Open-IM-Server/pkg/proto/wrapperspb"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
wrapperspb "github.com/OpenIMSDK/Open-IM-Server/pkg/proto/wrapperspb"
reflect "reflect"
sync "sync"
)
const (

View File

@ -21,10 +21,9 @@
package statistics
import (
reflect "reflect"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
)
const (

View File

@ -22,14 +22,13 @@ package third
import (
context "context"
reflect "reflect"
sync "sync"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (

View File

@ -137,9 +137,6 @@ func (x *GetPaginationUsersReq) Check() error {
}
func (x *UserRegisterReq) Check() error {
if x.Secret == "" {
return errs.ErrArgs.Wrap("Secret is empty")
}
if x.Users == nil {
return errs.ErrArgs.Wrap("Users is empty")
}

View File

@ -22,17 +22,15 @@ package user
import (
context "context"
reflect "reflect"
sync "sync"
conversation "github.com/OpenIMSDK/Open-IM-Server/pkg/proto/conversation"
sdkws "github.com/OpenIMSDK/Open-IM-Server/pkg/proto/sdkws"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
conversation "github.com/OpenIMSDK/Open-IM-Server/pkg/proto/conversation"
sdkws "github.com/OpenIMSDK/Open-IM-Server/pkg/proto/sdkws"
reflect "reflect"
sync "sync"
)
const (

View File

@ -21,11 +21,10 @@
package wrapperspb
import (
reflect "reflect"
sync "sync"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (

11
scripts/build.cmd Normal file
View File

@ -0,0 +1,11 @@
go build -o api.exe ../cmd/openim-api/main.go
go build -o auth.exe ../cmd/openim-rpc/openim-rpc-auth/main.go
go build -o conversation.exe ../cmd/openim-rpc/openim-rpc-conversation/main.go
go build -o friend.exe ../cmd/openim-rpc/openim-rpc-friend/main.go
go build -o group.exe ../cmd/openim-rpc/openim-rpc-group/main.go
go build -o msg.exe ../cmd/openim-rpc/openim-rpc-msg/main.go
go build -o third.exe ../cmd/openim-rpc/openim-rpc-third/main.go
go build -o user.exe ../cmd/openim-rpc/openim-rpc-user/main.go
go build -o push.exe ../cmd/openim-push/main.go
go build -o msgtransfer.exe ../cmd/openim-msgtransfer/main.go
go build -o msggateway.exe ../cmd/openim-msggateway/main.go