复制项目

This commit is contained in:
kim.dev.6789
2026-01-14 22:35:45 +08:00
parent 305d526110
commit b7f8db7d08
297 changed files with 81784 additions and 0 deletions

518
pkg/protocol/admin/admin.go Normal file
View File

@@ -0,0 +1,518 @@
// Copyright © 2023 OpenIM open source community. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package admin
import (
"git.imall.cloud/openim/chat/pkg/common/constant"
"github.com/openimsdk/tools/errs"
"github.com/openimsdk/tools/utils/datautil"
)
func (x *LoginReq) Check() error {
if x.Account == "" {
return errs.ErrArgs.WrapMsg("account is empty")
}
if x.Password == "" {
return errs.ErrArgs.WrapMsg("password is empty")
}
return nil
}
func (x *ChangePasswordReq) Check() error {
if x.Password == "" {
return errs.ErrArgs.WrapMsg("password is empty")
}
return nil
}
func (x *AddDefaultFriendReq) Check() error {
if x.UserIDs == nil {
return errs.ErrArgs.WrapMsg("userIDs is empty")
}
if datautil.Duplicate(x.UserIDs) {
return errs.ErrArgs.WrapMsg("userIDs has duplicate")
}
return nil
}
func (x *DelDefaultFriendReq) Check() error {
if x.UserIDs == nil {
return errs.ErrArgs.WrapMsg("userIDs is empty")
}
return nil
}
func (x *SearchDefaultFriendReq) Check() error {
if x.Pagination == nil {
return errs.ErrArgs.WrapMsg("pagination is empty")
}
if x.Pagination.PageNumber < 1 {
return errs.ErrArgs.WrapMsg("pageNumber is invalid")
}
if x.Pagination.ShowNumber < 1 {
return errs.ErrArgs.WrapMsg("showNumber is invalid")
}
return nil
}
func (x *AddDefaultGroupReq) Check() error {
if x.GroupIDs == nil {
return errs.ErrArgs.WrapMsg("GroupIDs is empty")
}
if datautil.Duplicate(x.GroupIDs) {
return errs.ErrArgs.WrapMsg("GroupIDs has duplicate")
}
return nil
}
func (x *DelDefaultGroupReq) Check() error {
if x.GroupIDs == nil {
return errs.ErrArgs.WrapMsg("GroupIDs is empty")
}
return nil
}
func (x *SearchDefaultGroupReq) Check() error {
if x.Pagination == nil {
return errs.ErrArgs.WrapMsg("pagination is empty")
}
if x.Pagination.PageNumber < 1 {
return errs.ErrArgs.WrapMsg("pageNumber is invalid")
}
if x.Pagination.ShowNumber < 1 {
return errs.ErrArgs.WrapMsg("showNumber is invalid")
}
return nil
}
func (x *AddInvitationCodeReq) Check() error {
if x.Codes == nil {
return errs.ErrArgs.WrapMsg("codes is invalid")
}
return nil
}
func (x *GenInvitationCodeReq) Check() error {
if x.Len < 1 {
return errs.ErrArgs.WrapMsg("len is invalid")
}
if x.Num < 1 {
return errs.ErrArgs.WrapMsg("num is invalid")
}
if x.Chars == "" {
return errs.ErrArgs.WrapMsg("chars is in invalid")
}
return nil
}
func (x *FindInvitationCodeReq) Check() error {
if x.Codes == nil {
return errs.ErrArgs.WrapMsg("codes is empty")
}
return nil
}
func (x *UseInvitationCodeReq) Check() error {
if x.Code == "" {
return errs.ErrArgs.WrapMsg("code is empty")
}
if x.UserID == "" {
return errs.ErrArgs.WrapMsg("userID is empty")
}
return nil
}
func (x *DelInvitationCodeReq) Check() error {
if x.Codes == nil {
return errs.ErrArgs.WrapMsg("codes is empty")
}
return nil
}
func (x *SearchInvitationCodeReq) Check() error {
if !datautil.Contain(x.Status, constant.InvitationCodeUnused, constant.InvitationCodeUsed, constant.InvitationCodeAll) {
return errs.ErrArgs.WrapMsg("state invalid")
}
if x.Pagination == nil {
return errs.ErrArgs.WrapMsg("pagination is empty")
}
if x.Pagination.PageNumber < 1 {
return errs.ErrArgs.WrapMsg("pageNumber is invalid")
}
if x.Pagination.ShowNumber < 1 {
return errs.ErrArgs.WrapMsg("showNumber is invalid")
}
return nil
}
func (x *SearchUserIPLimitLoginReq) Check() error {
if x.Pagination == nil {
return errs.ErrArgs.WrapMsg("pagination is empty")
}
if x.Pagination.PageNumber < 1 {
return errs.ErrArgs.WrapMsg("pageNumber is invalid")
}
if x.Pagination.ShowNumber < 1 {
return errs.ErrArgs.WrapMsg("showNumber is invalid")
}
return nil
}
func (x *AddUserIPLimitLoginReq) Check() error {
if x.Limits == nil {
return errs.ErrArgs.WrapMsg("limits is empty")
}
return nil
}
func (x *DelUserIPLimitLoginReq) Check() error {
if x.Limits == nil {
return errs.ErrArgs.WrapMsg("limits is empty")
}
return nil
}
func (x *SearchIPForbiddenReq) Check() error {
if x.Pagination == nil {
return errs.ErrArgs.WrapMsg("pagination is empty")
}
if x.Pagination.PageNumber < 1 {
return errs.ErrArgs.WrapMsg("pageNumber is invalid")
}
if x.Pagination.ShowNumber < 1 {
return errs.ErrArgs.WrapMsg("showNumber is invalid")
}
return nil
}
func (x *AddIPForbiddenReq) Check() error {
if x.Forbiddens == nil {
return errs.ErrArgs.WrapMsg("forbiddens is empty")
}
return nil
}
func (x *DelIPForbiddenReq) Check() error {
if x.Ips == nil {
return errs.ErrArgs.WrapMsg("ips is empty")
}
return nil
}
func (x *CheckRegisterForbiddenReq) Check() error {
if x.Ip == "" {
return errs.ErrArgs.WrapMsg("ip is empty")
}
return nil
}
func (x *CheckLoginForbiddenReq) Check() error {
if x.Ip == "" && x.UserID == "" {
return errs.ErrArgs.WrapMsg("ip and userID is empty")
}
return nil
}
func (x *CancellationUserReq) Check() error {
if x.UserID == "" {
return errs.ErrArgs.WrapMsg("userID is empty")
}
return nil
}
func (x *BlockUserReq) Check() error {
if x.UserID == "" {
return errs.ErrArgs.WrapMsg("userID is empty")
}
return nil
}
func (x *UnblockUserReq) Check() error {
if x.UserIDs == nil {
return errs.ErrArgs.WrapMsg("userIDs is empty")
}
return nil
}
func (x *SearchBlockUserReq) Check() error {
if x.Pagination == nil {
return errs.ErrArgs.WrapMsg("pagination is empty")
}
if x.Pagination.PageNumber < 1 {
return errs.ErrArgs.WrapMsg("pageNumber is invalid")
}
if x.Pagination.ShowNumber < 1 {
return errs.ErrArgs.WrapMsg("showNumber is invalid")
}
return nil
}
func (x *FindUserBlockInfoReq) Check() error {
if x.UserIDs == nil {
return errs.ErrArgs.WrapMsg("userIDs is empty")
}
return nil
}
func (x *CreateTokenReq) Check() error {
if x.UserID == "" {
return errs.ErrArgs.WrapMsg("userID is empty")
}
if x.UserType > constant.AdminUser || x.UserType < constant.NormalUser {
return errs.ErrArgs.WrapMsg("userType is invalid")
}
return nil
}
func (x *ParseTokenReq) Check() error {
if x.Token == "" {
return errs.ErrArgs.WrapMsg("token is empty")
}
return nil
}
func (x *AddAppletReq) Check() error {
if x.Name == "" {
return errs.ErrArgs.WrapMsg("name is empty")
}
if x.AppID == "" {
return errs.ErrArgs.WrapMsg("appID is empty")
}
if x.Icon == "" {
return errs.ErrArgs.WrapMsg("icon is empty")
}
if x.Url == "" {
return errs.ErrArgs.WrapMsg("url is empty")
}
if x.Md5 == "" {
return errs.ErrArgs.WrapMsg("md5 is empty")
}
if x.Size <= 0 {
return errs.ErrArgs.WrapMsg("size is invalid")
}
if x.Version == "" {
return errs.ErrArgs.WrapMsg("version is empty")
}
if x.Status < constant.StatusOnShelf || x.Status > constant.StatusUnShelf {
return errs.ErrArgs.WrapMsg("status is invalid")
}
return nil
}
func (x *DelAppletReq) Check() error {
if x.AppletIds == nil {
return errs.ErrArgs.WrapMsg("appletIds is empty")
}
return nil
}
func (x *UpdateAppletReq) Check() error {
if x.Id == "" {
return errs.ErrArgs.WrapMsg("id is empty")
}
return nil
}
func (x *SearchAppletReq) Check() error {
if x.Pagination == nil {
return errs.ErrArgs.WrapMsg("pagination is empty")
}
if x.Pagination.PageNumber < 1 {
return errs.ErrArgs.WrapMsg("pageNumber is invalid")
}
if x.Pagination.ShowNumber < 1 {
return errs.ErrArgs.WrapMsg("showNumber is invalid")
}
return nil
}
func (x *SetClientConfigReq) Check() error {
if x.Config == nil {
return errs.ErrArgs.WrapMsg("config is empty")
}
return nil
}
func (x *ChangeAdminPasswordReq) Check() error {
if x.UserID == "" {
return errs.ErrArgs.WrapMsg("userID is empty")
}
if x.CurrentPassword == "" {
return errs.ErrArgs.WrapMsg("currentPassword is empty")
}
if x.NewPassword == "" {
return errs.ErrArgs.WrapMsg("newPassword is empty")
}
if x.CurrentPassword == x.NewPassword {
return errs.ErrArgs.WrapMsg("currentPassword is equal to newPassword")
}
return nil
}
func (x *AddAdminAccountReq) Check() error {
if x.Account == "" {
return errs.ErrArgs.WrapMsg("account is empty")
}
if x.Password == "" {
return errs.ErrArgs.WrapMsg("password is empty")
}
return nil
}
func (x *DelAdminAccountReq) Check() error {
if len(x.UserIDs) == 0 {
return errs.ErrArgs.WrapMsg("userIDs is empty")
}
return nil
}
func (x *SearchAdminAccountReq) Check() error {
if x.Pagination.ShowNumber == 0 {
return errs.ErrArgs.WrapMsg("showNumber is empty")
}
if x.Pagination.PageNumber == 0 {
return errs.ErrArgs.WrapMsg("pageNumber is empty")
}
return nil
}
// ==================== 敏感词管理相关 Check() 方法 ====================
func (x *AddSensitiveWordReq) Check() error {
if x.Word == "" {
return errs.ErrArgs.WrapMsg("word is empty")
}
return nil
}
func (x *UpdateSensitiveWordReq) Check() error {
if x.Id == "" {
return errs.ErrArgs.WrapMsg("id is empty")
}
return nil
}
func (x *DeleteSensitiveWordReq) Check() error {
if len(x.Ids) == 0 {
return errs.ErrArgs.WrapMsg("ids is empty")
}
return nil
}
func (x *GetSensitiveWordReq) Check() error {
if x.Id == "" {
return errs.ErrArgs.WrapMsg("id is empty")
}
return nil
}
func (x *SearchSensitiveWordsReq) Check() error {
if x.Pagination.ShowNumber == 0 {
return errs.ErrArgs.WrapMsg("showNumber is empty")
}
if x.Pagination.PageNumber == 0 {
return errs.ErrArgs.WrapMsg("pageNumber is empty")
}
return nil
}
func (x *BatchAddSensitiveWordsReq) Check() error {
if len(x.Words) == 0 {
return errs.ErrArgs.WrapMsg("words is empty")
}
return nil
}
func (x *BatchUpdateSensitiveWordsReq) Check() error {
if len(x.Updates) == 0 {
return errs.ErrArgs.WrapMsg("updates is empty")
}
return nil
}
func (x *BatchDeleteSensitiveWordsReq) Check() error {
if len(x.Ids) == 0 {
return errs.ErrArgs.WrapMsg("ids is empty")
}
return nil
}
func (x *AddSensitiveWordGroupReq) Check() error {
if x.Name == "" {
return errs.ErrArgs.WrapMsg("name is empty")
}
return nil
}
func (x *UpdateSensitiveWordGroupReq) Check() error {
if x.Id == "" {
return errs.ErrArgs.WrapMsg("id is empty")
}
return nil
}
func (x *DeleteSensitiveWordGroupReq) Check() error {
if len(x.Ids) == 0 {
return errs.ErrArgs.WrapMsg("ids is empty")
}
return nil
}
func (x *GetSensitiveWordGroupReq) Check() error {
if x.Id == "" {
return errs.ErrArgs.WrapMsg("id is empty")
}
return nil
}
func (x *GetAllSensitiveWordGroupsReq) Check() error {
return nil
}
func (x *GetSensitiveWordConfigReq) Check() error {
return nil
}
func (x *UpdateSensitiveWordConfigReq) Check() error {
if x.Config == nil {
return errs.ErrArgs.WrapMsg("config is empty")
}
return nil
}
func (x *GetSensitiveWordLogsReq) Check() error {
if x.Pagination.ShowNumber == 0 {
return errs.ErrArgs.WrapMsg("showNumber is empty")
}
if x.Pagination.PageNumber == 0 {
return errs.ErrArgs.WrapMsg("pageNumber is empty")
}
return nil
}
func (x *DeleteSensitiveWordLogsReq) Check() error {
if len(x.Ids) == 0 {
return errs.ErrArgs.WrapMsg("ids is empty")
}
return nil
}
func (x *GetSensitiveWordStatsReq) Check() error {
return nil
}
func (x *GetSensitiveWordLogStatsReq) Check() error {
return nil
}

18377
pkg/protocol/admin/admin.pb.go Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

21
pkg/protocol/admin/api.go Normal file
View File

@@ -0,0 +1,21 @@
// Copyright © 2023 OpenIM open source community. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package admin
import "github.com/openimsdk/tools/utils/datautil"
func (x *GetClientConfigResp) ApiFormat() {
datautil.InitMap(&x.Config)
}

830
pkg/protocol/bot/bot.pb.go Normal file
View File

@@ -0,0 +1,830 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.36.1
// protoc v5.29.0
// source: bot/bot.proto
package bot
import (
reflect "reflect"
sync "sync"
sdkws "git.imall.cloud/openim/protocol/sdkws"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
)
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 Agent struct {
state protoimpl.MessageState `protogen:"open.v1"`
UserID string `protobuf:"bytes,1,opt,name=userID,proto3" json:"userID"`
Nickname string `protobuf:"bytes,2,opt,name=nickname,proto3" json:"nickname"`
FaceURL string `protobuf:"bytes,3,opt,name=faceURL,proto3" json:"faceURL"`
Url string `protobuf:"bytes,4,opt,name=url,proto3" json:"url"`
Key string `protobuf:"bytes,5,opt,name=key,proto3" json:"key"`
Identity string `protobuf:"bytes,6,opt,name=identity,proto3" json:"identity"`
Model string `protobuf:"bytes,7,opt,name=model,proto3" json:"model"`
Prompts string `protobuf:"bytes,8,opt,name=prompts,proto3" json:"prompts"`
CreateTime int64 `protobuf:"varint,9,opt,name=createTime,proto3" json:"createTime"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *Agent) Reset() {
*x = Agent{}
mi := &file_bot_bot_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *Agent) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Agent) ProtoMessage() {}
func (x *Agent) ProtoReflect() protoreflect.Message {
mi := &file_bot_bot_proto_msgTypes[0]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Agent.ProtoReflect.Descriptor instead.
func (*Agent) Descriptor() ([]byte, []int) {
return file_bot_bot_proto_rawDescGZIP(), []int{0}
}
func (x *Agent) GetUserID() string {
if x != nil {
return x.UserID
}
return ""
}
func (x *Agent) GetNickname() string {
if x != nil {
return x.Nickname
}
return ""
}
func (x *Agent) GetFaceURL() string {
if x != nil {
return x.FaceURL
}
return ""
}
func (x *Agent) GetUrl() string {
if x != nil {
return x.Url
}
return ""
}
func (x *Agent) GetKey() string {
if x != nil {
return x.Key
}
return ""
}
func (x *Agent) GetIdentity() string {
if x != nil {
return x.Identity
}
return ""
}
func (x *Agent) GetModel() string {
if x != nil {
return x.Model
}
return ""
}
func (x *Agent) GetPrompts() string {
if x != nil {
return x.Prompts
}
return ""
}
func (x *Agent) GetCreateTime() int64 {
if x != nil {
return x.CreateTime
}
return 0
}
type CreateAgentReq struct {
state protoimpl.MessageState `protogen:"open.v1"`
Agent *Agent `protobuf:"bytes,1,opt,name=agent,proto3" json:"agent"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *CreateAgentReq) Reset() {
*x = CreateAgentReq{}
mi := &file_bot_bot_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *CreateAgentReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CreateAgentReq) ProtoMessage() {}
func (x *CreateAgentReq) ProtoReflect() protoreflect.Message {
mi := &file_bot_bot_proto_msgTypes[1]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use CreateAgentReq.ProtoReflect.Descriptor instead.
func (*CreateAgentReq) Descriptor() ([]byte, []int) {
return file_bot_bot_proto_rawDescGZIP(), []int{1}
}
func (x *CreateAgentReq) GetAgent() *Agent {
if x != nil {
return x.Agent
}
return nil
}
type CreateAgentResp struct {
state protoimpl.MessageState `protogen:"open.v1"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *CreateAgentResp) Reset() {
*x = CreateAgentResp{}
mi := &file_bot_bot_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *CreateAgentResp) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CreateAgentResp) ProtoMessage() {}
func (x *CreateAgentResp) ProtoReflect() protoreflect.Message {
mi := &file_bot_bot_proto_msgTypes[2]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use CreateAgentResp.ProtoReflect.Descriptor instead.
func (*CreateAgentResp) Descriptor() ([]byte, []int) {
return file_bot_bot_proto_rawDescGZIP(), []int{2}
}
type UpdateAgentReq struct {
state protoimpl.MessageState `protogen:"open.v1"`
UserID string `protobuf:"bytes,1,opt,name=userID,proto3" json:"userID"`
Nickname *string `protobuf:"bytes,2,opt,name=nickname,proto3,oneof" json:"nickname"`
FaceURL *string `protobuf:"bytes,3,opt,name=faceURL,proto3,oneof" json:"faceURL"`
Url *string `protobuf:"bytes,4,opt,name=url,proto3,oneof" json:"url"`
Key *string `protobuf:"bytes,5,opt,name=key,proto3,oneof" json:"key"`
Identity *string `protobuf:"bytes,6,opt,name=identity,proto3,oneof" json:"identity"`
Model *string `protobuf:"bytes,7,opt,name=model,proto3,oneof" json:"model"`
Prompts *string `protobuf:"bytes,8,opt,name=prompts,proto3,oneof" json:"prompts"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *UpdateAgentReq) Reset() {
*x = UpdateAgentReq{}
mi := &file_bot_bot_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *UpdateAgentReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*UpdateAgentReq) ProtoMessage() {}
func (x *UpdateAgentReq) ProtoReflect() protoreflect.Message {
mi := &file_bot_bot_proto_msgTypes[3]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use UpdateAgentReq.ProtoReflect.Descriptor instead.
func (*UpdateAgentReq) Descriptor() ([]byte, []int) {
return file_bot_bot_proto_rawDescGZIP(), []int{3}
}
func (x *UpdateAgentReq) GetUserID() string {
if x != nil {
return x.UserID
}
return ""
}
func (x *UpdateAgentReq) GetNickname() string {
if x != nil && x.Nickname != nil {
return *x.Nickname
}
return ""
}
func (x *UpdateAgentReq) GetFaceURL() string {
if x != nil && x.FaceURL != nil {
return *x.FaceURL
}
return ""
}
func (x *UpdateAgentReq) GetUrl() string {
if x != nil && x.Url != nil {
return *x.Url
}
return ""
}
func (x *UpdateAgentReq) GetKey() string {
if x != nil && x.Key != nil {
return *x.Key
}
return ""
}
func (x *UpdateAgentReq) GetIdentity() string {
if x != nil && x.Identity != nil {
return *x.Identity
}
return ""
}
func (x *UpdateAgentReq) GetModel() string {
if x != nil && x.Model != nil {
return *x.Model
}
return ""
}
func (x *UpdateAgentReq) GetPrompts() string {
if x != nil && x.Prompts != nil {
return *x.Prompts
}
return ""
}
type UpdateAgentResp struct {
state protoimpl.MessageState `protogen:"open.v1"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *UpdateAgentResp) Reset() {
*x = UpdateAgentResp{}
mi := &file_bot_bot_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *UpdateAgentResp) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*UpdateAgentResp) ProtoMessage() {}
func (x *UpdateAgentResp) ProtoReflect() protoreflect.Message {
mi := &file_bot_bot_proto_msgTypes[4]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use UpdateAgentResp.ProtoReflect.Descriptor instead.
func (*UpdateAgentResp) Descriptor() ([]byte, []int) {
return file_bot_bot_proto_rawDescGZIP(), []int{4}
}
type PageFindAgentReq struct {
state protoimpl.MessageState `protogen:"open.v1"`
Pagination *sdkws.RequestPagination `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination"`
UserIDs []string `protobuf:"bytes,2,rep,name=userIDs,proto3" json:"userIDs"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *PageFindAgentReq) Reset() {
*x = PageFindAgentReq{}
mi := &file_bot_bot_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *PageFindAgentReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*PageFindAgentReq) ProtoMessage() {}
func (x *PageFindAgentReq) ProtoReflect() protoreflect.Message {
mi := &file_bot_bot_proto_msgTypes[5]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use PageFindAgentReq.ProtoReflect.Descriptor instead.
func (*PageFindAgentReq) Descriptor() ([]byte, []int) {
return file_bot_bot_proto_rawDescGZIP(), []int{5}
}
func (x *PageFindAgentReq) GetPagination() *sdkws.RequestPagination {
if x != nil {
return x.Pagination
}
return nil
}
func (x *PageFindAgentReq) GetUserIDs() []string {
if x != nil {
return x.UserIDs
}
return nil
}
type PageFindAgentResp struct {
state protoimpl.MessageState `protogen:"open.v1"`
Total int64 `protobuf:"varint,1,opt,name=total,proto3" json:"total"`
Agents []*Agent `protobuf:"bytes,2,rep,name=agents,proto3" json:"agents"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *PageFindAgentResp) Reset() {
*x = PageFindAgentResp{}
mi := &file_bot_bot_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *PageFindAgentResp) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*PageFindAgentResp) ProtoMessage() {}
func (x *PageFindAgentResp) ProtoReflect() protoreflect.Message {
mi := &file_bot_bot_proto_msgTypes[6]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use PageFindAgentResp.ProtoReflect.Descriptor instead.
func (*PageFindAgentResp) Descriptor() ([]byte, []int) {
return file_bot_bot_proto_rawDescGZIP(), []int{6}
}
func (x *PageFindAgentResp) GetTotal() int64 {
if x != nil {
return x.Total
}
return 0
}
func (x *PageFindAgentResp) GetAgents() []*Agent {
if x != nil {
return x.Agents
}
return nil
}
type DeleteAgentReq struct {
state protoimpl.MessageState `protogen:"open.v1"`
UserIDs []string `protobuf:"bytes,1,rep,name=userIDs,proto3" json:"userIDs"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *DeleteAgentReq) Reset() {
*x = DeleteAgentReq{}
mi := &file_bot_bot_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *DeleteAgentReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DeleteAgentReq) ProtoMessage() {}
func (x *DeleteAgentReq) ProtoReflect() protoreflect.Message {
mi := &file_bot_bot_proto_msgTypes[7]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use DeleteAgentReq.ProtoReflect.Descriptor instead.
func (*DeleteAgentReq) Descriptor() ([]byte, []int) {
return file_bot_bot_proto_rawDescGZIP(), []int{7}
}
func (x *DeleteAgentReq) GetUserIDs() []string {
if x != nil {
return x.UserIDs
}
return nil
}
type DeleteAgentResp struct {
state protoimpl.MessageState `protogen:"open.v1"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *DeleteAgentResp) Reset() {
*x = DeleteAgentResp{}
mi := &file_bot_bot_proto_msgTypes[8]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *DeleteAgentResp) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DeleteAgentResp) ProtoMessage() {}
func (x *DeleteAgentResp) ProtoReflect() protoreflect.Message {
mi := &file_bot_bot_proto_msgTypes[8]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use DeleteAgentResp.ProtoReflect.Descriptor instead.
func (*DeleteAgentResp) Descriptor() ([]byte, []int) {
return file_bot_bot_proto_rawDescGZIP(), []int{8}
}
type SendBotMessageReq struct {
state protoimpl.MessageState `protogen:"open.v1"`
AgentID string `protobuf:"bytes,1,opt,name=agentID,proto3" json:"agentID"`
ConversationID string `protobuf:"bytes,2,opt,name=conversationID,proto3" json:"conversationID"`
ContentType int32 `protobuf:"varint,3,opt,name=contentType,proto3" json:"contentType"`
Content string `protobuf:"bytes,4,opt,name=content,proto3" json:"content"`
Ex string `protobuf:"bytes,5,opt,name=ex,proto3" json:"ex"`
Key string `protobuf:"bytes,6,opt,name=key,proto3" json:"key"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *SendBotMessageReq) Reset() {
*x = SendBotMessageReq{}
mi := &file_bot_bot_proto_msgTypes[9]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *SendBotMessageReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SendBotMessageReq) ProtoMessage() {}
func (x *SendBotMessageReq) ProtoReflect() protoreflect.Message {
mi := &file_bot_bot_proto_msgTypes[9]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use SendBotMessageReq.ProtoReflect.Descriptor instead.
func (*SendBotMessageReq) Descriptor() ([]byte, []int) {
return file_bot_bot_proto_rawDescGZIP(), []int{9}
}
func (x *SendBotMessageReq) GetAgentID() string {
if x != nil {
return x.AgentID
}
return ""
}
func (x *SendBotMessageReq) GetConversationID() string {
if x != nil {
return x.ConversationID
}
return ""
}
func (x *SendBotMessageReq) GetContentType() int32 {
if x != nil {
return x.ContentType
}
return 0
}
func (x *SendBotMessageReq) GetContent() string {
if x != nil {
return x.Content
}
return ""
}
func (x *SendBotMessageReq) GetEx() string {
if x != nil {
return x.Ex
}
return ""
}
func (x *SendBotMessageReq) GetKey() string {
if x != nil {
return x.Key
}
return ""
}
type SendBotMessageResp struct {
state protoimpl.MessageState `protogen:"open.v1"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *SendBotMessageResp) Reset() {
*x = SendBotMessageResp{}
mi := &file_bot_bot_proto_msgTypes[10]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *SendBotMessageResp) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SendBotMessageResp) ProtoMessage() {}
func (x *SendBotMessageResp) ProtoReflect() protoreflect.Message {
mi := &file_bot_bot_proto_msgTypes[10]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use SendBotMessageResp.ProtoReflect.Descriptor instead.
func (*SendBotMessageResp) Descriptor() ([]byte, []int) {
return file_bot_bot_proto_rawDescGZIP(), []int{10}
}
var File_bot_bot_proto protoreflect.FileDescriptor
var file_bot_bot_proto_rawDesc = []byte{
0x0a, 0x0d, 0x62, 0x6f, 0x74, 0x2f, 0x62, 0x6f, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12,
0x0a, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x62, 0x6f, 0x74, 0x1a, 0x11, 0x73, 0x64, 0x6b,
0x77, 0x73, 0x2f, 0x73, 0x64, 0x6b, 0x77, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xe5,
0x01, 0x0a, 0x05, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72,
0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44,
0x12, 0x1a, 0x0a, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01,
0x28, 0x09, 0x52, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07,
0x66, 0x61, 0x63, 0x65, 0x55, 0x52, 0x4c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x66,
0x61, 0x63, 0x65, 0x55, 0x52, 0x4c, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x04, 0x20,
0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18,
0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x69, 0x64,
0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x69, 0x64,
0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x18,
0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x12, 0x18, 0x0a, 0x07,
0x70, 0x72, 0x6f, 0x6d, 0x70, 0x74, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70,
0x72, 0x6f, 0x6d, 0x70, 0x74, 0x73, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65,
0x54, 0x69, 0x6d, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61,
0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x39, 0x0a, 0x0e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65,
0x41, 0x67, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x12, 0x27, 0x0a, 0x05, 0x61, 0x67, 0x65, 0x6e,
0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d,
0x2e, 0x62, 0x6f, 0x74, 0x2e, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x52, 0x05, 0x61, 0x67, 0x65, 0x6e,
0x74, 0x22, 0x11, 0x0a, 0x0f, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x67, 0x65, 0x6e, 0x74,
0x52, 0x65, 0x73, 0x70, 0x22, 0xbd, 0x02, 0x0a, 0x0e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41,
0x67, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49,
0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x12,
0x1f, 0x0a, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28,
0x09, 0x48, 0x00, 0x52, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x88, 0x01, 0x01,
0x12, 0x1d, 0x0a, 0x07, 0x66, 0x61, 0x63, 0x65, 0x55, 0x52, 0x4c, 0x18, 0x03, 0x20, 0x01, 0x28,
0x09, 0x48, 0x01, 0x52, 0x07, 0x66, 0x61, 0x63, 0x65, 0x55, 0x52, 0x4c, 0x88, 0x01, 0x01, 0x12,
0x15, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x48, 0x02, 0x52, 0x03,
0x75, 0x72, 0x6c, 0x88, 0x01, 0x01, 0x12, 0x15, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x05, 0x20,
0x01, 0x28, 0x09, 0x48, 0x03, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x88, 0x01, 0x01, 0x12, 0x1f, 0x0a,
0x08, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x48,
0x04, 0x52, 0x08, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x88, 0x01, 0x01, 0x12, 0x19,
0x0a, 0x05, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x48, 0x05, 0x52,
0x05, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x88, 0x01, 0x01, 0x12, 0x1d, 0x0a, 0x07, 0x70, 0x72, 0x6f,
0x6d, 0x70, 0x74, 0x73, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x48, 0x06, 0x52, 0x07, 0x70, 0x72,
0x6f, 0x6d, 0x70, 0x74, 0x73, 0x88, 0x01, 0x01, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x6e, 0x69, 0x63,
0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x66, 0x61, 0x63, 0x65, 0x55, 0x52,
0x4c, 0x42, 0x06, 0x0a, 0x04, 0x5f, 0x75, 0x72, 0x6c, 0x42, 0x06, 0x0a, 0x04, 0x5f, 0x6b, 0x65,
0x79, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x42, 0x08,
0x0a, 0x06, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x70, 0x72, 0x6f,
0x6d, 0x70, 0x74, 0x73, 0x22, 0x11, 0x0a, 0x0f, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x67,
0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x22, 0x6d, 0x0a, 0x10, 0x50, 0x61, 0x67, 0x65, 0x46,
0x69, 0x6e, 0x64, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x12, 0x3f, 0x0a, 0x0a, 0x70,
0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32,
0x1f, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x73, 0x64, 0x6b, 0x77, 0x73, 0x2e, 0x52,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e,
0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07,
0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x75,
0x73, 0x65, 0x72, 0x49, 0x44, 0x73, 0x22, 0x54, 0x0a, 0x11, 0x50, 0x61, 0x67, 0x65, 0x46, 0x69,
0x6e, 0x64, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x74,
0x6f, 0x74, 0x61, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61,
0x6c, 0x12, 0x29, 0x0a, 0x06, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28,
0x0b, 0x32, 0x11, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x62, 0x6f, 0x74, 0x2e, 0x41,
0x67, 0x65, 0x6e, 0x74, 0x52, 0x06, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x73, 0x22, 0x2a, 0x0a, 0x0e,
0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x12, 0x18,
0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52,
0x07, 0x75, 0x73, 0x65, 0x72, 0x49, 0x44, 0x73, 0x22, 0x11, 0x0a, 0x0f, 0x44, 0x65, 0x6c, 0x65,
0x74, 0x65, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x22, 0xb3, 0x01, 0x0a, 0x11,
0x53, 0x65, 0x6e, 0x64, 0x42, 0x6f, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x65,
0x71, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01,
0x28, 0x09, 0x52, 0x07, 0x61, 0x67, 0x65, 0x6e, 0x74, 0x49, 0x44, 0x12, 0x26, 0x0a, 0x0e, 0x63,
0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x18, 0x02, 0x20,
0x01, 0x28, 0x09, 0x52, 0x0e, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f,
0x6e, 0x49, 0x44, 0x12, 0x20, 0x0a, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x54, 0x79,
0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e,
0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74,
0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12,
0x0e, 0x0a, 0x02, 0x65, 0x78, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x65, 0x78, 0x12,
0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65,
0x79, 0x22, 0x14, 0x0a, 0x12, 0x53, 0x65, 0x6e, 0x64, 0x42, 0x6f, 0x74, 0x4d, 0x65, 0x73, 0x73,
0x61, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x32, 0xfc, 0x02, 0x0a, 0x03, 0x62, 0x6f, 0x74, 0x12,
0x46, 0x0a, 0x0b, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x12, 0x1a,
0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x62, 0x6f, 0x74, 0x2e, 0x43, 0x72, 0x65, 0x61,
0x74, 0x65, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x1b, 0x2e, 0x6f, 0x70, 0x65,
0x6e, 0x69, 0x6d, 0x2e, 0x62, 0x6f, 0x74, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x67,
0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x46, 0x0a, 0x0b, 0x55, 0x70, 0x64, 0x61, 0x74,
0x65, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x12, 0x1a, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e,
0x62, 0x6f, 0x74, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x52,
0x65, 0x71, 0x1a, 0x1b, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x62, 0x6f, 0x74, 0x2e,
0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12,
0x4c, 0x0a, 0x0d, 0x50, 0x61, 0x67, 0x65, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x67, 0x65, 0x6e, 0x74,
0x12, 0x1c, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x62, 0x6f, 0x74, 0x2e, 0x50, 0x61,
0x67, 0x65, 0x46, 0x69, 0x6e, 0x64, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x1d,
0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x62, 0x6f, 0x74, 0x2e, 0x50, 0x61, 0x67, 0x65,
0x46, 0x69, 0x6e, 0x64, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x46, 0x0a,
0x0b, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x67, 0x65, 0x6e, 0x74, 0x12, 0x1a, 0x2e, 0x6f,
0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x62, 0x6f, 0x74, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65,
0x41, 0x67, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x1b, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69,
0x6d, 0x2e, 0x62, 0x6f, 0x74, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x67, 0x65, 0x6e,
0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x4f, 0x0a, 0x0e, 0x53, 0x65, 0x6e, 0x64, 0x42, 0x6f, 0x74,
0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x1d, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d,
0x2e, 0x62, 0x6f, 0x74, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x42, 0x6f, 0x74, 0x4d, 0x65, 0x73, 0x73,
0x61, 0x67, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x1e, 0x2e, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e,
0x62, 0x6f, 0x74, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x42, 0x6f, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61,
0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x42, 0x2c, 0x5a, 0x2a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62,
0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x73, 0x64, 0x6b, 0x2f, 0x63,
0x68, 0x61, 0x74, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c,
0x2f, 0x62, 0x6f, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_bot_bot_proto_rawDescOnce sync.Once
file_bot_bot_proto_rawDescData = file_bot_bot_proto_rawDesc
)
func file_bot_bot_proto_rawDescGZIP() []byte {
file_bot_bot_proto_rawDescOnce.Do(func() {
file_bot_bot_proto_rawDescData = protoimpl.X.CompressGZIP(file_bot_bot_proto_rawDescData)
})
return file_bot_bot_proto_rawDescData
}
var file_bot_bot_proto_msgTypes = make([]protoimpl.MessageInfo, 11)
var file_bot_bot_proto_goTypes = []any{
(*Agent)(nil), // 0: openim.bot.Agent
(*CreateAgentReq)(nil), // 1: openim.bot.CreateAgentReq
(*CreateAgentResp)(nil), // 2: openim.bot.CreateAgentResp
(*UpdateAgentReq)(nil), // 3: openim.bot.UpdateAgentReq
(*UpdateAgentResp)(nil), // 4: openim.bot.UpdateAgentResp
(*PageFindAgentReq)(nil), // 5: openim.bot.PageFindAgentReq
(*PageFindAgentResp)(nil), // 6: openim.bot.PageFindAgentResp
(*DeleteAgentReq)(nil), // 7: openim.bot.DeleteAgentReq
(*DeleteAgentResp)(nil), // 8: openim.bot.DeleteAgentResp
(*SendBotMessageReq)(nil), // 9: openim.bot.SendBotMessageReq
(*SendBotMessageResp)(nil), // 10: openim.bot.SendBotMessageResp
(*sdkws.RequestPagination)(nil), // 11: openim.sdkws.RequestPagination
}
var file_bot_bot_proto_depIdxs = []int32{
0, // 0: openim.bot.CreateAgentReq.agent:type_name -> openim.bot.Agent
11, // 1: openim.bot.PageFindAgentReq.pagination:type_name -> openim.sdkws.RequestPagination
0, // 2: openim.bot.PageFindAgentResp.agents:type_name -> openim.bot.Agent
1, // 3: openim.bot.bot.CreateAgent:input_type -> openim.bot.CreateAgentReq
3, // 4: openim.bot.bot.UpdateAgent:input_type -> openim.bot.UpdateAgentReq
5, // 5: openim.bot.bot.PageFindAgent:input_type -> openim.bot.PageFindAgentReq
7, // 6: openim.bot.bot.DeleteAgent:input_type -> openim.bot.DeleteAgentReq
9, // 7: openim.bot.bot.SendBotMessage:input_type -> openim.bot.SendBotMessageReq
2, // 8: openim.bot.bot.CreateAgent:output_type -> openim.bot.CreateAgentResp
4, // 9: openim.bot.bot.UpdateAgent:output_type -> openim.bot.UpdateAgentResp
6, // 10: openim.bot.bot.PageFindAgent:output_type -> openim.bot.PageFindAgentResp
8, // 11: openim.bot.bot.DeleteAgent:output_type -> openim.bot.DeleteAgentResp
10, // 12: openim.bot.bot.SendBotMessage:output_type -> openim.bot.SendBotMessageResp
8, // [8:13] is the sub-list for method output_type
3, // [3:8] is the sub-list for method input_type
3, // [3:3] is the sub-list for extension type_name
3, // [3:3] is the sub-list for extension extendee
0, // [0:3] is the sub-list for field type_name
}
func init() { file_bot_bot_proto_init() }
func file_bot_bot_proto_init() {
if File_bot_bot_proto != nil {
return
}
file_bot_bot_proto_msgTypes[3].OneofWrappers = []any{}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_bot_bot_proto_rawDesc,
NumEnums: 0,
NumMessages: 11,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_bot_bot_proto_goTypes,
DependencyIndexes: file_bot_bot_proto_depIdxs,
MessageInfos: file_bot_bot_proto_msgTypes,
}.Build()
File_bot_bot_proto = out.File
file_bot_bot_proto_rawDesc = nil
file_bot_bot_proto_goTypes = nil
file_bot_bot_proto_depIdxs = nil
}

View File

@@ -0,0 +1,73 @@
syntax = "proto3";
package openim.bot;
import "sdkws/sdkws.proto";
option go_package = "git.imall.cloud/openim/chat/pkg/protocol/bot";
message Agent {
string userID = 1;
string nickname = 2;
string faceURL = 3;
string url = 4;
string key = 5;
string identity = 6;
string model = 7;
string prompts = 8;
int64 createTime = 9;
}
message CreateAgentReq {
Agent agent = 1;
}
message CreateAgentResp {
}
message UpdateAgentReq {
string userID = 1;
optional string nickname = 2;
optional string faceURL = 3;
optional string url = 4;
optional string key = 5;
optional string identity = 6;
optional string model = 7;
optional string prompts = 8;
}
message UpdateAgentResp {
}
message PageFindAgentReq {
openim.sdkws.RequestPagination pagination = 1;
repeated string userIDs = 2;
}
message PageFindAgentResp {
int64 total = 1;
repeated Agent agents = 2;
}
message DeleteAgentReq{
repeated string userIDs = 1;
}
message DeleteAgentResp{}
message SendBotMessageReq{
string agentID = 1;
string conversationID = 2;
int32 contentType = 3;
string content = 4;
string ex = 5;
string key = 6;
}
message SendBotMessageResp{}
service bot {
rpc CreateAgent(CreateAgentReq) returns (CreateAgentResp);
rpc UpdateAgent(UpdateAgentReq) returns (UpdateAgentResp);
rpc PageFindAgent(PageFindAgentReq) returns (PageFindAgentResp);
rpc DeleteAgent(DeleteAgentReq) returns (DeleteAgentResp);
rpc SendBotMessage(SendBotMessageReq) returns (SendBotMessageResp);
}

View File

@@ -0,0 +1,273 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.5.1
// - protoc v5.29.0
// source: bot/bot.proto
package bot
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.64.0 or later.
const _ = grpc.SupportPackageIsVersion9
const (
Bot_CreateAgent_FullMethodName = "/openim.bot.bot/CreateAgent"
Bot_UpdateAgent_FullMethodName = "/openim.bot.bot/UpdateAgent"
Bot_PageFindAgent_FullMethodName = "/openim.bot.bot/PageFindAgent"
Bot_DeleteAgent_FullMethodName = "/openim.bot.bot/DeleteAgent"
Bot_SendBotMessage_FullMethodName = "/openim.bot.bot/SendBotMessage"
)
// BotClient is the client API for Bot 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 BotClient interface {
CreateAgent(ctx context.Context, in *CreateAgentReq, opts ...grpc.CallOption) (*CreateAgentResp, error)
UpdateAgent(ctx context.Context, in *UpdateAgentReq, opts ...grpc.CallOption) (*UpdateAgentResp, error)
PageFindAgent(ctx context.Context, in *PageFindAgentReq, opts ...grpc.CallOption) (*PageFindAgentResp, error)
DeleteAgent(ctx context.Context, in *DeleteAgentReq, opts ...grpc.CallOption) (*DeleteAgentResp, error)
SendBotMessage(ctx context.Context, in *SendBotMessageReq, opts ...grpc.CallOption) (*SendBotMessageResp, error)
}
type botClient struct {
cc grpc.ClientConnInterface
}
func NewBotClient(cc grpc.ClientConnInterface) BotClient {
return &botClient{cc}
}
func (c *botClient) CreateAgent(ctx context.Context, in *CreateAgentReq, opts ...grpc.CallOption) (*CreateAgentResp, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(CreateAgentResp)
err := c.cc.Invoke(ctx, Bot_CreateAgent_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *botClient) UpdateAgent(ctx context.Context, in *UpdateAgentReq, opts ...grpc.CallOption) (*UpdateAgentResp, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(UpdateAgentResp)
err := c.cc.Invoke(ctx, Bot_UpdateAgent_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *botClient) PageFindAgent(ctx context.Context, in *PageFindAgentReq, opts ...grpc.CallOption) (*PageFindAgentResp, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(PageFindAgentResp)
err := c.cc.Invoke(ctx, Bot_PageFindAgent_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *botClient) DeleteAgent(ctx context.Context, in *DeleteAgentReq, opts ...grpc.CallOption) (*DeleteAgentResp, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(DeleteAgentResp)
err := c.cc.Invoke(ctx, Bot_DeleteAgent_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *botClient) SendBotMessage(ctx context.Context, in *SendBotMessageReq, opts ...grpc.CallOption) (*SendBotMessageResp, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(SendBotMessageResp)
err := c.cc.Invoke(ctx, Bot_SendBotMessage_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
// BotServer is the server API for Bot service.
// All implementations must embed UnimplementedBotServer
// for forward compatibility.
type BotServer interface {
CreateAgent(context.Context, *CreateAgentReq) (*CreateAgentResp, error)
UpdateAgent(context.Context, *UpdateAgentReq) (*UpdateAgentResp, error)
PageFindAgent(context.Context, *PageFindAgentReq) (*PageFindAgentResp, error)
DeleteAgent(context.Context, *DeleteAgentReq) (*DeleteAgentResp, error)
SendBotMessage(context.Context, *SendBotMessageReq) (*SendBotMessageResp, error)
mustEmbedUnimplementedBotServer()
}
// UnimplementedBotServer must be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedBotServer struct{}
func (UnimplementedBotServer) CreateAgent(context.Context, *CreateAgentReq) (*CreateAgentResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method CreateAgent not implemented")
}
func (UnimplementedBotServer) UpdateAgent(context.Context, *UpdateAgentReq) (*UpdateAgentResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method UpdateAgent not implemented")
}
func (UnimplementedBotServer) PageFindAgent(context.Context, *PageFindAgentReq) (*PageFindAgentResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method PageFindAgent not implemented")
}
func (UnimplementedBotServer) DeleteAgent(context.Context, *DeleteAgentReq) (*DeleteAgentResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method DeleteAgent not implemented")
}
func (UnimplementedBotServer) SendBotMessage(context.Context, *SendBotMessageReq) (*SendBotMessageResp, error) {
return nil, status.Errorf(codes.Unimplemented, "method SendBotMessage not implemented")
}
func (UnimplementedBotServer) mustEmbedUnimplementedBotServer() {}
func (UnimplementedBotServer) testEmbeddedByValue() {}
// UnsafeBotServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to BotServer will
// result in compilation errors.
type UnsafeBotServer interface {
mustEmbedUnimplementedBotServer()
}
func RegisterBotServer(s grpc.ServiceRegistrar, srv BotServer) {
// If the following call pancis, it indicates UnimplementedBotServer was
// embedded by pointer and is nil. This will cause panics if an
// unimplemented method is ever invoked, so we test this at initialization
// time to prevent it from happening at runtime later due to I/O.
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
t.testEmbeddedByValue()
}
s.RegisterService(&Bot_ServiceDesc, srv)
}
func _Bot_CreateAgent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CreateAgentReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(BotServer).CreateAgent(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Bot_CreateAgent_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(BotServer).CreateAgent(ctx, req.(*CreateAgentReq))
}
return interceptor(ctx, in, info, handler)
}
func _Bot_UpdateAgent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(UpdateAgentReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(BotServer).UpdateAgent(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Bot_UpdateAgent_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(BotServer).UpdateAgent(ctx, req.(*UpdateAgentReq))
}
return interceptor(ctx, in, info, handler)
}
func _Bot_PageFindAgent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(PageFindAgentReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(BotServer).PageFindAgent(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Bot_PageFindAgent_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(BotServer).PageFindAgent(ctx, req.(*PageFindAgentReq))
}
return interceptor(ctx, in, info, handler)
}
func _Bot_DeleteAgent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(DeleteAgentReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(BotServer).DeleteAgent(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Bot_DeleteAgent_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(BotServer).DeleteAgent(ctx, req.(*DeleteAgentReq))
}
return interceptor(ctx, in, info, handler)
}
func _Bot_SendBotMessage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(SendBotMessageReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(BotServer).SendBotMessage(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Bot_SendBotMessage_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(BotServer).SendBotMessage(ctx, req.(*SendBotMessageReq))
}
return interceptor(ctx, in, info, handler)
}
// Bot_ServiceDesc is the grpc.ServiceDesc for Bot service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Bot_ServiceDesc = grpc.ServiceDesc{
ServiceName: "openim.bot.bot",
HandlerType: (*BotServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "CreateAgent",
Handler: _Bot_CreateAgent_Handler,
},
{
MethodName: "UpdateAgent",
Handler: _Bot_UpdateAgent_Handler,
},
{
MethodName: "PageFindAgent",
Handler: _Bot_PageFindAgent_Handler,
},
{
MethodName: "DeleteAgent",
Handler: _Bot_DeleteAgent_Handler,
},
{
MethodName: "SendBotMessage",
Handler: _Bot_SendBotMessage_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "bot/bot.proto",
}

519
pkg/protocol/chat/chat.go Normal file
View File

@@ -0,0 +1,519 @@
// Copyright © 2023 OpenIM open source community. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package chat
import (
"regexp"
"strconv"
"git.imall.cloud/openim/chat/pkg/common/constant"
constantpb "git.imall.cloud/openim/protocol/constant"
"github.com/openimsdk/tools/errs"
)
func (x *UpdateUserInfoReq) Check() error {
if x.UserID == "" {
return errs.ErrArgs.WrapMsg("userID is empty")
}
if x.Email != nil && x.Email.Value != "" {
if err := EmailCheck(x.Email.Value); err != nil {
return err
}
}
return nil
}
func (x *FindUserPublicInfoReq) Check() error {
if x.UserIDs == nil {
return errs.ErrArgs.WrapMsg("userIDs is empty")
}
return nil
}
func (x *SearchUserPublicInfoReq) Check() error {
if x.Pagination == nil {
return errs.ErrArgs.WrapMsg("pagination is empty")
}
if x.Pagination.PageNumber < 1 {
return errs.ErrArgs.WrapMsg("pageNumber is invalid")
}
if x.Pagination.ShowNumber < 1 {
return errs.ErrArgs.WrapMsg("showNumber is invalid")
}
return nil
}
func (x *FindUserFullInfoReq) Check() error {
if x.UserIDs == nil {
return errs.ErrArgs.WrapMsg("userIDs is empty")
}
return nil
}
func (x *SendVerifyCodeReq) Check() error {
if x.UsedFor < constant.VerificationCodeForRegister || x.UsedFor > constant.VerificationCodeForH5Register {
return errs.ErrArgs.WrapMsg("usedFor flied is empty")
}
if x.Email == "" {
if x.AreaCode == "" {
return errs.ErrArgs.WrapMsg("AreaCode is empty")
} else if err := AreaCodeCheck(x.AreaCode); err != nil {
return err
}
if x.PhoneNumber == "" {
return errs.ErrArgs.WrapMsg("PhoneNumber is empty")
} else if err := PhoneNumberCheck(x.PhoneNumber); err != nil {
return err
}
} else {
if err := EmailCheck(x.Email); err != nil {
return err
}
}
return nil
}
func (x *VerifyCodeReq) Check() error {
// 如果提供了account验证account格式此时不需要AreaCode和PhoneNumber
if x.Account != "" {
if err := AccountCheck(x.Account); err != nil {
return err
}
// account验证时VerifyCode是必需的
if x.VerifyCode == "" {
return errs.ErrArgs.WrapMsg("VerifyCode is empty")
}
return nil
}
// 如果没有提供account则验证phone或email
if x.Email == "" {
if x.AreaCode == "" {
return errs.ErrArgs.WrapMsg("AreaCode is empty")
} else if err := AreaCodeCheck(x.AreaCode); err != nil {
return err
}
if x.PhoneNumber == "" {
return errs.ErrArgs.WrapMsg("PhoneNumber is empty")
} else if err := PhoneNumberCheck(x.PhoneNumber); err != nil {
return err
}
} else {
if err := EmailCheck(x.Email); err != nil {
return err
}
}
if x.VerifyCode == "" {
return errs.ErrArgs.WrapMsg("VerifyCode is empty")
}
return nil
}
func (x *RegisterUserReq) Check() error {
//if x.VerifyCode == "" {
// return errs.ErrArgs.WrapMsg("VerifyCode is empty")
//}
if x.User.Nickname == "" {
return errs.ErrArgs.WrapMsg("Nickname is nil")
}
if x.Platform < constantpb.IOSPlatformID || x.Platform > constantpb.HarmonyOSPlatformID {
return errs.ErrArgs.WrapMsg("platform is invalid")
}
if x.User == nil {
return errs.ErrArgs.WrapMsg("user is empty")
}
// 如果提供了account验证account格式此时不需要AreaCode和PhoneNumber
if x.User.Account != "" {
if err := AccountCheck(x.User.Account); err != nil {
return err
}
// account注册时不需要验证phone和email
return nil
}
// 如果没有提供account则验证phone或email
if x.User.Email == "" {
if x.User.AreaCode == "" {
return errs.ErrArgs.WrapMsg("AreaCode is empty")
} else if err := AreaCodeCheck(x.User.AreaCode); err != nil {
return err
}
if x.User.PhoneNumber == "" {
return errs.ErrArgs.WrapMsg("PhoneNumber is empty")
} else if err := PhoneNumberCheck(x.User.PhoneNumber); err != nil {
return err
}
} else {
if err := EmailCheck(x.User.Email); err != nil {
return err
}
}
return nil
}
func (x *LoginReq) Check() error {
if x.Platform < constantpb.IOSPlatformID || x.Platform > constantpb.HarmonyOSPlatformID {
return errs.ErrArgs.WrapMsg("platform is invalid")
}
// 支持三种登录方式account、phone、email
if x.Account != "" {
// 使用account登录不需要验证phone和email
return nil
} else if x.Email != "" {
// 使用email登录
if err := EmailCheck(x.Email); err != nil {
return err
}
} else {
// 使用phone登录
if x.AreaCode == "" {
return errs.ErrArgs.WrapMsg("AreaCode is empty")
} else if err := AreaCodeCheck(x.AreaCode); err != nil {
return err
}
if x.PhoneNumber == "" {
return errs.ErrArgs.WrapMsg("PhoneNumber is empty")
} else if err := PhoneNumberCheck(x.PhoneNumber); err != nil {
return err
}
}
return nil
}
func (x *ResetPasswordReq) Check() error {
if x.Password == "" {
return errs.ErrArgs.WrapMsg("password is empty")
}
if x.Email == "" {
if x.AreaCode == "" {
return errs.ErrArgs.WrapMsg("AreaCode is empty")
} else if err := AreaCodeCheck(x.AreaCode); err != nil {
return err
}
if x.PhoneNumber == "" {
return errs.ErrArgs.WrapMsg("PhoneNumber is empty")
} else if err := PhoneNumberCheck(x.PhoneNumber); err != nil {
return err
}
} else {
if err := EmailCheck(x.Email); err != nil {
return err
}
}
if x.VerifyCode == "" {
return errs.ErrArgs.WrapMsg("VerifyCode is empty")
}
return nil
}
func (x *ChangePasswordReq) Check() error {
if x.UserID == "" {
return errs.ErrArgs.WrapMsg("userID is empty")
}
if x.NewPassword == "" {
return errs.ErrArgs.WrapMsg("newPassword is empty")
}
return nil
}
func (x *FindUserAccountReq) Check() error {
if x.UserIDs == nil {
return errs.ErrArgs.WrapMsg("userIDs is empty")
}
return nil
}
func (x *FindAccountUserReq) Check() error {
if x.Accounts == nil {
return errs.ErrArgs.WrapMsg("Accounts is empty")
}
return nil
}
func (x *SearchUserFullInfoReq) Check() error {
if x.Pagination == nil {
return errs.ErrArgs.WrapMsg("pagination is empty")
}
if x.Pagination.PageNumber < 1 {
return errs.ErrArgs.WrapMsg("pageNumber is invalid")
}
if x.Pagination.ShowNumber < 1 {
return errs.ErrArgs.WrapMsg("showNumber is invalid")
}
if x.Normal < constant.FinDAllUser || x.Normal > constant.FindNormalUser {
return errs.ErrArgs.WrapMsg("normal flied is invalid")
}
return nil
}
func (x *GetTokenForVideoMeetingReq) Check() error {
if x.Room == "" {
errs.ErrArgs.WrapMsg("Room is empty")
}
if x.Identity == "" {
errs.ErrArgs.WrapMsg("User Identity is empty")
}
return nil
}
func EmailCheck(email string) error {
pattern := `^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$`
if err := regexMatch(pattern, email); err != nil {
return errs.WrapMsg(err, "Email is invalid")
}
return nil
}
func AreaCodeCheck(areaCode string) error {
//pattern := `\+[1-9][0-9]{1,2}`
//if err := regexMatch(pattern, areaCode); err != nil {
// return errs.WrapMsg(err, "AreaCode is invalid")
//}
return nil
}
func PhoneNumberCheck(phoneNumber string) error {
if phoneNumber == "" {
return errs.ErrArgs.WrapMsg("phoneNumber is empty")
}
_, err := strconv.ParseUint(phoneNumber, 10, 64)
if err != nil {
return errs.ErrArgs.WrapMsg("phoneNumber is invalid")
}
return nil
}
func AccountCheck(account string) error {
if account == "" {
return errs.ErrArgs.WrapMsg("account is empty")
}
// 验证长度6到20位
if len(account) < 6 || len(account) > 20 {
return errs.ErrArgs.WrapMsg("account must be between 6 and 20 characters")
}
// 验证格式:只能包含数字、字母、下划线(_)、横线(-)
pattern := `^[a-zA-Z0-9_-]+$`
if err := regexMatch(pattern, account); err != nil {
return errs.WrapMsg(err, "account must contain only letters, numbers, underscores, and hyphens")
}
return nil
}
func regexMatch(pattern string, target string) error {
reg := regexp.MustCompile(pattern)
ok := reg.MatchString(target)
if !ok {
return errs.ErrArgs
}
return nil
}
func (x *SearchUserInfoReq) Check() error {
if x.Pagination == nil {
return errs.ErrArgs.WrapMsg("Pagination is nil")
}
if x.Pagination.PageNumber < 1 {
return errs.ErrArgs.WrapMsg("pageNumber is invalid")
}
if x.Pagination.ShowNumber < 1 {
return errs.ErrArgs.WrapMsg("showNumber is invalid")
}
return nil
}
func (x *AddUserAccountReq) Check() error {
if x.User == nil {
return errs.ErrArgs.WrapMsg("user is empty")
}
if x.User.Email == "" {
if x.User.AreaCode == "" || x.User.PhoneNumber == "" {
return errs.ErrArgs.WrapMsg("area code or phone number is empty")
}
if x.User.AreaCode[0] != '+' {
x.User.AreaCode = "+" + x.User.AreaCode
}
if _, err := strconv.ParseUint(x.User.AreaCode[1:], 10, 64); err != nil {
return errs.ErrArgs.WrapMsg("area code must be number")
}
if _, err := strconv.ParseUint(x.User.PhoneNumber, 10, 64); err != nil {
return errs.ErrArgs.WrapMsg("phone number must be number")
}
} else {
if err := EmailCheck(x.User.Email); err != nil {
return errs.ErrArgs.WrapMsg("email must be right")
}
}
return nil
}
// 敏感词检测相关 Check() 方法
func (x *GetSensitiveWordsReq) Check() error {
// 获取敏感词列表不需要参数验证
return nil
}
func (x *CheckSensitiveWordsReq) Check() error {
if x.Content == "" {
return errs.ErrArgs.WrapMsg("content is empty")
}
return nil
}
// ==================== 敏感词管理相关 Check() 方法 ====================
func (x *AddSensitiveWordReq) Check() error {
if x.Word == "" {
return errs.ErrArgs.WrapMsg("word is empty")
}
return nil
}
func (x *UpdateSensitiveWordReq) Check() error {
if x.Id == "" {
return errs.ErrArgs.WrapMsg("id is empty")
}
return nil
}
func (x *DeleteSensitiveWordReq) Check() error {
if len(x.Ids) == 0 {
return errs.ErrArgs.WrapMsg("ids is empty")
}
return nil
}
func (x *GetSensitiveWordReq) Check() error {
if x.Id == "" {
return errs.ErrArgs.WrapMsg("id is empty")
}
return nil
}
func (x *SearchSensitiveWordsReq) Check() error {
if x.Pagination == nil {
return errs.ErrArgs.WrapMsg("pagination is nil")
}
if x.Pagination.ShowNumber == 0 {
return errs.ErrArgs.WrapMsg("showNumber is empty")
}
if x.Pagination.PageNumber == 0 {
return errs.ErrArgs.WrapMsg("pageNumber is empty")
}
return nil
}
func (x *BatchAddSensitiveWordsReq) Check() error {
if len(x.Words) == 0 {
return errs.ErrArgs.WrapMsg("words is empty")
}
return nil
}
func (x *BatchUpdateSensitiveWordsReq) Check() error {
if len(x.Updates) == 0 {
return errs.ErrArgs.WrapMsg("updates is empty")
}
return nil
}
func (x *BatchDeleteSensitiveWordsReq) Check() error {
if len(x.Ids) == 0 {
return errs.ErrArgs.WrapMsg("ids is empty")
}
return nil
}
func (x *AddSensitiveWordGroupReq) Check() error {
if x.Name == "" {
return errs.ErrArgs.WrapMsg("name is empty")
}
return nil
}
func (x *UpdateSensitiveWordGroupReq) Check() error {
if x.Id == "" {
return errs.ErrArgs.WrapMsg("id is empty")
}
return nil
}
func (x *DeleteSensitiveWordGroupReq) Check() error {
if len(x.Ids) == 0 {
return errs.ErrArgs.WrapMsg("ids is empty")
}
return nil
}
func (x *GetSensitiveWordGroupReq) Check() error {
if x.Id == "" {
return errs.ErrArgs.WrapMsg("id is empty")
}
return nil
}
func (x *GetAllSensitiveWordGroupsReq) Check() error {
return nil
}
func (x *GetSensitiveWordConfigReq) Check() error {
return nil
}
func (x *UpdateSensitiveWordConfigReq) Check() error {
if x.Config == nil {
return errs.ErrArgs.WrapMsg("config is nil")
}
return nil
}
func (x *GetSensitiveWordLogsReq) Check() error {
if x.Pagination == nil {
return errs.ErrArgs.WrapMsg("pagination is nil")
}
if x.Pagination.ShowNumber == 0 {
return errs.ErrArgs.WrapMsg("showNumber is empty")
}
if x.Pagination.PageNumber == 0 {
return errs.ErrArgs.WrapMsg("pageNumber is empty")
}
return nil
}
func (x *DeleteSensitiveWordLogsReq) Check() error {
if len(x.Ids) == 0 {
return errs.ErrArgs.WrapMsg("ids is empty")
}
return nil
}
func (x *GetSensitiveWordStatsReq) Check() error {
return nil
}
func (x *GetSensitiveWordLogStatsReq) Check() error {
if x.StartTime == 0 || x.EndTime == 0 {
return errs.ErrArgs.WrapMsg("startTime or endTime is empty")
}
if x.StartTime > x.EndTime {
return errs.ErrArgs.WrapMsg("startTime must be less than endTime")
}
return nil
}

13236
pkg/protocol/chat/chat.pb.go Normal file

File diff suppressed because it is too large Load Diff

1118
pkg/protocol/chat/chat.proto Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,930 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.33.0
// protoc v6.33.0
// source: common/common.proto
package common
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 UserFullInfo struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
UserID string `protobuf:"bytes,1,opt,name=userID,proto3" json:"userID"`
Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password"`
Account string `protobuf:"bytes,3,opt,name=account,proto3" json:"account"`
PhoneNumber string `protobuf:"bytes,4,opt,name=phoneNumber,proto3" json:"phoneNumber"`
AreaCode string `protobuf:"bytes,5,opt,name=areaCode,proto3" json:"areaCode"`
Email string `protobuf:"bytes,6,opt,name=email,proto3" json:"email"`
Nickname string `protobuf:"bytes,7,opt,name=nickname,proto3" json:"nickname"`
FaceURL string `protobuf:"bytes,8,opt,name=faceURL,proto3" json:"faceURL"`
Gender int32 `protobuf:"varint,9,opt,name=gender,proto3" json:"gender"`
Level int32 `protobuf:"varint,10,opt,name=level,proto3" json:"level"`
Birth int64 `protobuf:"varint,11,opt,name=birth,proto3" json:"birth"`
AllowAddFriend int32 `protobuf:"varint,12,opt,name=allowAddFriend,proto3" json:"allowAddFriend"`
AllowBeep int32 `protobuf:"varint,13,opt,name=allowBeep,proto3" json:"allowBeep"`
AllowVibration int32 `protobuf:"varint,14,opt,name=allowVibration,proto3" json:"allowVibration"`
GlobalRecvMsgOpt int32 `protobuf:"varint,15,opt,name=globalRecvMsgOpt,proto3" json:"globalRecvMsgOpt"`
RegisterType int32 `protobuf:"varint,16,opt,name=registerType,proto3" json:"registerType"`
UserType int32 `protobuf:"varint,17,opt,name=userType,proto3" json:"userType"` // 用户类型: 0=普通用户, 1=企业用户, 2=机器人, 3=管理员
UserFlag string `protobuf:"bytes,18,opt,name=userFlag,proto3" json:"userFlag"` // 用户标签/标识
CreateTime int64 `protobuf:"varint,19,opt,name=createTime,proto3" json:"createTime"` // 用户创建时间
Ip string `protobuf:"bytes,20,opt,name=ip,proto3" json:"ip"` // 用户最新登录IP
// 实名认证信息
IdCard string `protobuf:"bytes,21,opt,name=idCard,proto3" json:"idCard"` // 身份证号
RealName string `protobuf:"bytes,22,opt,name=realName,proto3" json:"realName"` // 真实姓名
IdCardPhotoFront string `protobuf:"bytes,23,opt,name=idCardPhotoFront,proto3" json:"idCardPhotoFront"` // 身份证正面照片URL
IdCardPhotoBack string `protobuf:"bytes,24,opt,name=idCardPhotoBack,proto3" json:"idCardPhotoBack"` // 身份证反面照片URL
AuditStatus int32 `protobuf:"varint,25,opt,name=auditStatus,proto3" json:"auditStatus"` // 审核状态0-未审核1-审核通过2-审核拒绝
}
func (x *UserFullInfo) Reset() {
*x = UserFullInfo{}
if protoimpl.UnsafeEnabled {
mi := &file_common_common_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *UserFullInfo) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*UserFullInfo) ProtoMessage() {}
func (x *UserFullInfo) ProtoReflect() protoreflect.Message {
mi := &file_common_common_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 UserFullInfo.ProtoReflect.Descriptor instead.
func (*UserFullInfo) Descriptor() ([]byte, []int) {
return file_common_common_proto_rawDescGZIP(), []int{0}
}
func (x *UserFullInfo) GetUserID() string {
if x != nil {
return x.UserID
}
return ""
}
func (x *UserFullInfo) GetPassword() string {
if x != nil {
return x.Password
}
return ""
}
func (x *UserFullInfo) GetAccount() string {
if x != nil {
return x.Account
}
return ""
}
func (x *UserFullInfo) GetPhoneNumber() string {
if x != nil {
return x.PhoneNumber
}
return ""
}
func (x *UserFullInfo) GetAreaCode() string {
if x != nil {
return x.AreaCode
}
return ""
}
func (x *UserFullInfo) GetEmail() string {
if x != nil {
return x.Email
}
return ""
}
func (x *UserFullInfo) GetNickname() string {
if x != nil {
return x.Nickname
}
return ""
}
func (x *UserFullInfo) GetFaceURL() string {
if x != nil {
return x.FaceURL
}
return ""
}
func (x *UserFullInfo) GetGender() int32 {
if x != nil {
return x.Gender
}
return 0
}
func (x *UserFullInfo) GetLevel() int32 {
if x != nil {
return x.Level
}
return 0
}
func (x *UserFullInfo) GetBirth() int64 {
if x != nil {
return x.Birth
}
return 0
}
func (x *UserFullInfo) GetAllowAddFriend() int32 {
if x != nil {
return x.AllowAddFriend
}
return 0
}
func (x *UserFullInfo) GetAllowBeep() int32 {
if x != nil {
return x.AllowBeep
}
return 0
}
func (x *UserFullInfo) GetAllowVibration() int32 {
if x != nil {
return x.AllowVibration
}
return 0
}
func (x *UserFullInfo) GetGlobalRecvMsgOpt() int32 {
if x != nil {
return x.GlobalRecvMsgOpt
}
return 0
}
func (x *UserFullInfo) GetRegisterType() int32 {
if x != nil {
return x.RegisterType
}
return 0
}
func (x *UserFullInfo) GetUserType() int32 {
if x != nil {
return x.UserType
}
return 0
}
func (x *UserFullInfo) GetUserFlag() string {
if x != nil {
return x.UserFlag
}
return ""
}
func (x *UserFullInfo) GetCreateTime() int64 {
if x != nil {
return x.CreateTime
}
return 0
}
func (x *UserFullInfo) GetIp() string {
if x != nil {
return x.Ip
}
return ""
}
func (x *UserFullInfo) GetIdCard() string {
if x != nil {
return x.IdCard
}
return ""
}
func (x *UserFullInfo) GetRealName() string {
if x != nil {
return x.RealName
}
return ""
}
func (x *UserFullInfo) GetIdCardPhotoFront() string {
if x != nil {
return x.IdCardPhotoFront
}
return ""
}
func (x *UserFullInfo) GetIdCardPhotoBack() string {
if x != nil {
return x.IdCardPhotoBack
}
return ""
}
func (x *UserFullInfo) GetAuditStatus() int32 {
if x != nil {
return x.AuditStatus
}
return 0
}
type UserPublicInfo struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
UserID string `protobuf:"bytes,1,opt,name=userID,proto3" json:"userID"`
Account string `protobuf:"bytes,2,opt,name=account,proto3" json:"account"`
Email string `protobuf:"bytes,3,opt,name=email,proto3" json:"email"`
Nickname string `protobuf:"bytes,4,opt,name=nickname,proto3" json:"nickname"`
FaceURL string `protobuf:"bytes,5,opt,name=faceURL,proto3" json:"faceURL"`
Gender int32 `protobuf:"varint,6,opt,name=gender,proto3" json:"gender"`
Level int32 `protobuf:"varint,7,opt,name=level,proto3" json:"level"`
UserType int32 `protobuf:"varint,8,opt,name=userType,proto3" json:"userType"` // 用户类型: 0=普通用户, 1=企业用户, 2=机器人, 3=管理员
}
func (x *UserPublicInfo) Reset() {
*x = UserPublicInfo{}
if protoimpl.UnsafeEnabled {
mi := &file_common_common_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *UserPublicInfo) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*UserPublicInfo) ProtoMessage() {}
func (x *UserPublicInfo) ProtoReflect() protoreflect.Message {
mi := &file_common_common_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 UserPublicInfo.ProtoReflect.Descriptor instead.
func (*UserPublicInfo) Descriptor() ([]byte, []int) {
return file_common_common_proto_rawDescGZIP(), []int{1}
}
func (x *UserPublicInfo) GetUserID() string {
if x != nil {
return x.UserID
}
return ""
}
func (x *UserPublicInfo) GetAccount() string {
if x != nil {
return x.Account
}
return ""
}
func (x *UserPublicInfo) GetEmail() string {
if x != nil {
return x.Email
}
return ""
}
func (x *UserPublicInfo) GetNickname() string {
if x != nil {
return x.Nickname
}
return ""
}
func (x *UserPublicInfo) GetFaceURL() string {
if x != nil {
return x.FaceURL
}
return ""
}
func (x *UserPublicInfo) GetGender() int32 {
if x != nil {
return x.Gender
}
return 0
}
func (x *UserPublicInfo) GetLevel() int32 {
if x != nil {
return x.Level
}
return 0
}
func (x *UserPublicInfo) GetUserType() int32 {
if x != nil {
return x.UserType
}
return 0
}
type UserIdentity struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Email string `protobuf:"bytes,1,opt,name=email,proto3" json:"email"`
AreaCode string `protobuf:"bytes,2,opt,name=areaCode,proto3" json:"areaCode"`
PhoneNumber string `protobuf:"bytes,3,opt,name=phoneNumber,proto3" json:"phoneNumber"`
DeviceID string `protobuf:"bytes,4,opt,name=deviceID,proto3" json:"deviceID"`
Platform int32 `protobuf:"varint,5,opt,name=platform,proto3" json:"platform"`
Account string `protobuf:"bytes,6,opt,name=account,proto3" json:"account"`
}
func (x *UserIdentity) Reset() {
*x = UserIdentity{}
if protoimpl.UnsafeEnabled {
mi := &file_common_common_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *UserIdentity) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*UserIdentity) ProtoMessage() {}
func (x *UserIdentity) ProtoReflect() protoreflect.Message {
mi := &file_common_common_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 UserIdentity.ProtoReflect.Descriptor instead.
func (*UserIdentity) Descriptor() ([]byte, []int) {
return file_common_common_proto_rawDescGZIP(), []int{2}
}
func (x *UserIdentity) GetEmail() string {
if x != nil {
return x.Email
}
return ""
}
func (x *UserIdentity) GetAreaCode() string {
if x != nil {
return x.AreaCode
}
return ""
}
func (x *UserIdentity) GetPhoneNumber() string {
if x != nil {
return x.PhoneNumber
}
return ""
}
func (x *UserIdentity) GetDeviceID() string {
if x != nil {
return x.DeviceID
}
return ""
}
func (x *UserIdentity) GetPlatform() int32 {
if x != nil {
return x.Platform
}
return 0
}
func (x *UserIdentity) GetAccount() string {
if x != nil {
return x.Account
}
return ""
}
type AppletInfo struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id"`
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name"`
AppID string `protobuf:"bytes,3,opt,name=appID,proto3" json:"appID"`
Icon string `protobuf:"bytes,4,opt,name=icon,proto3" json:"icon"`
Url string `protobuf:"bytes,5,opt,name=url,proto3" json:"url"`
Md5 string `protobuf:"bytes,6,opt,name=md5,proto3" json:"md5"`
Size int64 `protobuf:"varint,7,opt,name=size,proto3" json:"size"`
Version string `protobuf:"bytes,8,opt,name=version,proto3" json:"version"`
Priority uint32 `protobuf:"varint,9,opt,name=priority,proto3" json:"priority"`
Status uint32 `protobuf:"varint,10,opt,name=status,proto3" json:"status"`
CreateTime int64 `protobuf:"varint,11,opt,name=createTime,proto3" json:"createTime"`
}
func (x *AppletInfo) Reset() {
*x = AppletInfo{}
if protoimpl.UnsafeEnabled {
mi := &file_common_common_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *AppletInfo) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*AppletInfo) ProtoMessage() {}
func (x *AppletInfo) ProtoReflect() protoreflect.Message {
mi := &file_common_common_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 AppletInfo.ProtoReflect.Descriptor instead.
func (*AppletInfo) Descriptor() ([]byte, []int) {
return file_common_common_proto_rawDescGZIP(), []int{3}
}
func (x *AppletInfo) GetId() string {
if x != nil {
return x.Id
}
return ""
}
func (x *AppletInfo) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *AppletInfo) GetAppID() string {
if x != nil {
return x.AppID
}
return ""
}
func (x *AppletInfo) GetIcon() string {
if x != nil {
return x.Icon
}
return ""
}
func (x *AppletInfo) GetUrl() string {
if x != nil {
return x.Url
}
return ""
}
func (x *AppletInfo) GetMd5() string {
if x != nil {
return x.Md5
}
return ""
}
func (x *AppletInfo) GetSize() int64 {
if x != nil {
return x.Size
}
return 0
}
func (x *AppletInfo) GetVersion() string {
if x != nil {
return x.Version
}
return ""
}
func (x *AppletInfo) GetPriority() uint32 {
if x != nil {
return x.Priority
}
return 0
}
func (x *AppletInfo) GetStatus() uint32 {
if x != nil {
return x.Status
}
return 0
}
func (x *AppletInfo) GetCreateTime() int64 {
if x != nil {
return x.CreateTime
}
return 0
}
type LogInfo struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
UserID string `protobuf:"bytes,1,opt,name=userID,proto3" json:"userID"`
Platform int32 `protobuf:"varint,2,opt,name=platform,proto3" json:"platform"`
Url string `protobuf:"bytes,3,opt,name=url,proto3" json:"url"`
CreateTime int64 `protobuf:"varint,4,opt,name=createTime,proto3" json:"createTime"`
Nickname string `protobuf:"bytes,5,opt,name=nickname,proto3" json:"nickname"`
LogID string `protobuf:"bytes,6,opt,name=logID,proto3" json:"logID"`
Filename string `protobuf:"bytes,7,opt,name=filename,proto3" json:"filename"`
SystemType string `protobuf:"bytes,8,opt,name=systemType,proto3" json:"systemType"`
Ex string `protobuf:"bytes,9,opt,name=ex,proto3" json:"ex"`
Version string `protobuf:"bytes,10,opt,name=version,proto3" json:"version"`
}
func (x *LogInfo) Reset() {
*x = LogInfo{}
if protoimpl.UnsafeEnabled {
mi := &file_common_common_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *LogInfo) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*LogInfo) ProtoMessage() {}
func (x *LogInfo) ProtoReflect() protoreflect.Message {
mi := &file_common_common_proto_msgTypes[4]
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 LogInfo.ProtoReflect.Descriptor instead.
func (*LogInfo) Descriptor() ([]byte, []int) {
return file_common_common_proto_rawDescGZIP(), []int{4}
}
func (x *LogInfo) GetUserID() string {
if x != nil {
return x.UserID
}
return ""
}
func (x *LogInfo) GetPlatform() int32 {
if x != nil {
return x.Platform
}
return 0
}
func (x *LogInfo) GetUrl() string {
if x != nil {
return x.Url
}
return ""
}
func (x *LogInfo) GetCreateTime() int64 {
if x != nil {
return x.CreateTime
}
return 0
}
func (x *LogInfo) GetNickname() string {
if x != nil {
return x.Nickname
}
return ""
}
func (x *LogInfo) GetLogID() string {
if x != nil {
return x.LogID
}
return ""
}
func (x *LogInfo) GetFilename() string {
if x != nil {
return x.Filename
}
return ""
}
func (x *LogInfo) GetSystemType() string {
if x != nil {
return x.SystemType
}
return ""
}
func (x *LogInfo) GetEx() string {
if x != nil {
return x.Ex
}
return ""
}
func (x *LogInfo) GetVersion() string {
if x != nil {
return x.Version
}
return ""
}
var File_common_common_proto protoreflect.FileDescriptor
var file_common_common_proto_rawDesc = []byte{
0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x12, 0x6f, 0x70, 0x65, 0x6e, 0x69, 0x6d, 0x2e, 0x63, 0x68,
0x61, 0x74, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x22, 0xfc, 0x05, 0x0a, 0x0c, 0x55, 0x73,
0x65, 0x72, 0x46, 0x75, 0x6c, 0x6c, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73,
0x65, 0x72, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72,
0x49, 0x44, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x02,
0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x18,
0x0a, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52,
0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x68, 0x6f, 0x6e,
0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70,
0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x61, 0x72,
0x65, 0x61, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x61, 0x72,
0x65, 0x61, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18,
0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x1a, 0x0a, 0x08,
0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08,
0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x66, 0x61, 0x63, 0x65,
0x55, 0x52, 0x4c, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x66, 0x61, 0x63, 0x65, 0x55,
0x52, 0x4c, 0x12, 0x16, 0x0a, 0x06, 0x67, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x09, 0x20, 0x01,
0x28, 0x05, 0x52, 0x06, 0x67, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x65,
0x76, 0x65, 0x6c, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c,
0x12, 0x14, 0x0a, 0x05, 0x62, 0x69, 0x72, 0x74, 0x68, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x03, 0x52,
0x05, 0x62, 0x69, 0x72, 0x74, 0x68, 0x12, 0x26, 0x0a, 0x0e, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x41,
0x64, 0x64, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0e,
0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x41, 0x64, 0x64, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x12, 0x1c,
0x0a, 0x09, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x42, 0x65, 0x65, 0x70, 0x18, 0x0d, 0x20, 0x01, 0x28,
0x05, 0x52, 0x09, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x42, 0x65, 0x65, 0x70, 0x12, 0x26, 0x0a, 0x0e,
0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x56, 0x69, 0x62, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x0e,
0x20, 0x01, 0x28, 0x05, 0x52, 0x0e, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x56, 0x69, 0x62, 0x72, 0x61,
0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2a, 0x0a, 0x10, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x52, 0x65,
0x63, 0x76, 0x4d, 0x73, 0x67, 0x4f, 0x70, 0x74, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x05, 0x52, 0x10,
0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x52, 0x65, 0x63, 0x76, 0x4d, 0x73, 0x67, 0x4f, 0x70, 0x74,
0x12, 0x22, 0x0a, 0x0c, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65,
0x18, 0x10, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72,
0x54, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65,
0x18, 0x11, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65,
0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x46, 0x6c, 0x61, 0x67, 0x18, 0x12, 0x20, 0x01,
0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x46, 0x6c, 0x61, 0x67, 0x12, 0x1e, 0x0a, 0x0a,
0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x13, 0x20, 0x01, 0x28, 0x03,
0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x0e, 0x0a, 0x02,
0x69, 0x70, 0x18, 0x14, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x70, 0x12, 0x16, 0x0a, 0x06,
0x69, 0x64, 0x43, 0x61, 0x72, 0x64, 0x18, 0x15, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x69, 0x64,
0x43, 0x61, 0x72, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x61, 0x6c, 0x4e, 0x61, 0x6d, 0x65,
0x18, 0x16, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x65, 0x61, 0x6c, 0x4e, 0x61, 0x6d, 0x65,
0x12, 0x2a, 0x0a, 0x10, 0x69, 0x64, 0x43, 0x61, 0x72, 0x64, 0x50, 0x68, 0x6f, 0x74, 0x6f, 0x46,
0x72, 0x6f, 0x6e, 0x74, 0x18, 0x17, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x69, 0x64, 0x43, 0x61,
0x72, 0x64, 0x50, 0x68, 0x6f, 0x74, 0x6f, 0x46, 0x72, 0x6f, 0x6e, 0x74, 0x12, 0x28, 0x0a, 0x0f,
0x69, 0x64, 0x43, 0x61, 0x72, 0x64, 0x50, 0x68, 0x6f, 0x74, 0x6f, 0x42, 0x61, 0x63, 0x6b, 0x18,
0x18, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x69, 0x64, 0x43, 0x61, 0x72, 0x64, 0x50, 0x68, 0x6f,
0x74, 0x6f, 0x42, 0x61, 0x63, 0x6b, 0x12, 0x20, 0x0a, 0x0b, 0x61, 0x75, 0x64, 0x69, 0x74, 0x53,
0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x19, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0b, 0x61, 0x75, 0x64,
0x69, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0xd8, 0x01, 0x0a, 0x0e, 0x55, 0x73, 0x65,
0x72, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x16, 0x0a, 0x06, 0x75,
0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65,
0x72, 0x49, 0x44, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02,
0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x14, 0x0a,
0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d,
0x61, 0x69, 0x6c, 0x12, 0x1a, 0x0a, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x18,
0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x12,
0x18, 0x0a, 0x07, 0x66, 0x61, 0x63, 0x65, 0x55, 0x52, 0x4c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09,
0x52, 0x07, 0x66, 0x61, 0x63, 0x65, 0x55, 0x52, 0x4c, 0x12, 0x16, 0x0a, 0x06, 0x67, 0x65, 0x6e,
0x64, 0x65, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x67, 0x65, 0x6e, 0x64, 0x65,
0x72, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05,
0x52, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x54,
0x79, 0x70, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x54,
0x79, 0x70, 0x65, 0x22, 0xb4, 0x01, 0x0a, 0x0c, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x65, 0x6e,
0x74, 0x69, 0x74, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x01, 0x20,
0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x1a, 0x0a, 0x08, 0x61, 0x72,
0x65, 0x61, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x61, 0x72,
0x65, 0x61, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x4e,
0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x68, 0x6f,
0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x65, 0x76, 0x69,
0x63, 0x65, 0x49, 0x44, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x64, 0x65, 0x76, 0x69,
0x63, 0x65, 0x49, 0x44, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d,
0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d,
0x12, 0x18, 0x0a, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28,
0x09, 0x52, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x80, 0x02, 0x0a, 0x0a, 0x41,
0x70, 0x70, 0x6c, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18,
0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d,
0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a,
0x05, 0x61, 0x70, 0x70, 0x49, 0x44, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x70,
0x70, 0x49, 0x44, 0x12, 0x12, 0x0a, 0x04, 0x69, 0x63, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28,
0x09, 0x52, 0x04, 0x69, 0x63, 0x6f, 0x6e, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x05,
0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x64, 0x35,
0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6d, 0x64, 0x35, 0x12, 0x12, 0x0a, 0x04, 0x73,
0x69, 0x7a, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12,
0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09,
0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x69,
0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x70, 0x72, 0x69,
0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18,
0x0a, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1e, 0x0a,
0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28,
0x03, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x22, 0x87, 0x02,
0x0a, 0x07, 0x4c, 0x6f, 0x67, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65,
0x72, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49,
0x44, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x18, 0x02, 0x20,
0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x10, 0x0a,
0x03, 0x75, 0x72, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12,
0x1e, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x04, 0x20,
0x01, 0x28, 0x03, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12,
0x1a, 0x0a, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28,
0x09, 0x52, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x6c,
0x6f, 0x67, 0x49, 0x44, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6c, 0x6f, 0x67, 0x49,
0x44, 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x07, 0x20,
0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1e, 0x0a,
0x0a, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x54, 0x79, 0x70, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28,
0x09, 0x52, 0x0a, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0e, 0x0a,
0x02, 0x65, 0x78, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x65, 0x78, 0x12, 0x18, 0x0a,
0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07,
0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x42, 0x31, 0x5a, 0x2f, 0x67, 0x69, 0x74, 0x2e, 0x69,
0x6d, 0x61, 0x6c, 0x6c, 0x2e, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2f, 0x6f, 0x70, 0x65, 0x6e, 0x69,
0x6d, 0x2f, 0x63, 0x68, 0x61, 0x74, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x63, 0x6f, 0x6c, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x33,
}
var (
file_common_common_proto_rawDescOnce sync.Once
file_common_common_proto_rawDescData = file_common_common_proto_rawDesc
)
func file_common_common_proto_rawDescGZIP() []byte {
file_common_common_proto_rawDescOnce.Do(func() {
file_common_common_proto_rawDescData = protoimpl.X.CompressGZIP(file_common_common_proto_rawDescData)
})
return file_common_common_proto_rawDescData
}
var file_common_common_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
var file_common_common_proto_goTypes = []interface{}{
(*UserFullInfo)(nil), // 0: openim.chat.common.UserFullInfo
(*UserPublicInfo)(nil), // 1: openim.chat.common.UserPublicInfo
(*UserIdentity)(nil), // 2: openim.chat.common.UserIdentity
(*AppletInfo)(nil), // 3: openim.chat.common.AppletInfo
(*LogInfo)(nil), // 4: openim.chat.common.LogInfo
}
var file_common_common_proto_depIdxs = []int32{
0, // [0:0] is the sub-list for method output_type
0, // [0:0] 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_common_common_proto_init() }
func file_common_common_proto_init() {
if File_common_common_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_common_common_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*UserFullInfo); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_common_common_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*UserPublicInfo); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_common_common_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*UserIdentity); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_common_common_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*AppletInfo); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_common_common_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*LogInfo); 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_common_common_proto_rawDesc,
NumEnums: 0,
NumMessages: 5,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_common_common_proto_goTypes,
DependencyIndexes: file_common_common_proto_depIdxs,
MessageInfos: file_common_common_proto_msgTypes,
}.Build()
File_common_common_proto = out.File
file_common_common_proto_rawDesc = nil
file_common_common_proto_goTypes = nil
file_common_common_proto_depIdxs = nil
}

View File

@@ -0,0 +1,81 @@
syntax = "proto3";
package openim.chat.common;
option go_package = "git.imall.cloud/openim/chat/pkg/protocol/common";
message UserFullInfo{
string userID = 1;
string password = 2;
string account = 3;
string phoneNumber = 4;
string areaCode = 5;
string email = 6;
string nickname = 7;
string faceURL = 8;
int32 gender = 9;
int32 level = 10;
int64 birth = 11;
int32 allowAddFriend = 12;
int32 allowBeep = 13;
int32 allowVibration = 14;
int32 globalRecvMsgOpt = 15;
int32 registerType = 16;
int32 userType = 17; // 用户类型: 0=普通用户, 1=企业用户, 2=机器人, 3=管理员
string userFlag = 18; // 用户标签/标识
int64 createTime = 19; // 用户创建时间
string ip = 20; // 用户最新登录IP
// 实名认证信息
string idCard = 21; // 身份证号
string realName = 22; // 真实姓名
string idCardPhotoFront = 23; // 身份证正面照片URL
string idCardPhotoBack = 24; // 身份证反面照片URL
int32 auditStatus = 25; // 审核状态0-未审核1-审核通过2-审核拒绝
}
message UserPublicInfo{
string userID = 1;
string account = 2;
string email = 3;
string nickname = 4;
string faceURL = 5;
int32 gender = 6;
int32 level = 7;
int32 userType = 8; // 用户类型: 0=普通用户, 1=企业用户, 2=机器人, 3=管理员
}
message UserIdentity {
string email = 1;
string areaCode = 2;
string phoneNumber = 3;
string deviceID = 4;
int32 platform = 5;
string account = 6;
}
message AppletInfo {
string id = 1;
string name = 2;
string appID = 3;
string icon = 4;
string url = 5;
string md5 = 6;
int64 size = 7;
string version = 8;
uint32 priority = 9;
uint32 status = 10;
int64 createTime = 11;
}
message LogInfo{
string userID=1;
int32 platform=2;
string url=3;
int64 createTime=4;
string nickname=5;
string logID=6;
string filename=7;
string systemType=8;
string ex=9;
string version=10;
}

32
pkg/protocol/gen.cmd Normal file
View File

@@ -0,0 +1,32 @@
@echo off
setlocal
rem Define array elements
set "PROTO_NAMES=admin chat common bot"
rem Loop through each element in the array
for %%i in (%PROTO_NAMES%) do (
protoc --go_out=./%%i --go_opt=module=git.imall.cloud/openim/chat/pkg/protocol/%%i %%i/%%i.proto
if ERRORLEVEL 1 (
echo error processing %%i.proto
exit /b %ERRORLEVEL%
)
)
rem Generate Go-grpc code
for %%i in (%PROTO_NAMES%) do (
protoc --go-grpc_out=./%%i --go-grpc_opt=module=git.imall.cloud/openim/chat/pkg/protocol/%%i %%i/%%i.proto
if ERRORLEVEL 1 (
echo error processing %%i.proto
exit /b %ERRORLEVEL%
)
)
rem Replace "omitempty" in *.pb.go files with UTF-8 encoding
for /r %%f in (*.pb.go) do (
powershell -Command "(Get-Content -Path '%%f' -Encoding UTF8) -replace ',omitempty', '' | Set-Content -Path '%%f' -Encoding UTF8"
)
endlocal

29
pkg/protocol/gen.sh Executable file
View File

@@ -0,0 +1,29 @@
PROTO_NAMES=(
"admin"
"chat"
"common"
)
for name in "${PROTO_NAMES[@]}"; do
protoc --go_out=./${name} --go_opt=module=git.imall.cloud/openim/chat/pkg/protocol/${name} ${name}/${name}.proto
if [ $? -ne 0 ]; then
echo "error processing ${name}.proto (go_out)"
exit $?
fi
done
# generate go-grpc
for name in "${PROTO_NAMES[@]}"; do
protoc --go-grpc_out=./${name} --go-grpc_opt=module=git.imall.cloud/openim/chat/pkg/protocol/${name} ${name}/${name}.proto
if [ $? -ne 0 ]; then
echo "error processing ${name}.proto (go-grpc_out)"
exit $?
fi
done
if [ "$(uname -s)" == "Darwin" ]; then
find . -type f -name '*.pb.go' -exec sed -i '' 's/,omitempty"`/\"\`/g' {} +
else
find . -type f -name '*.pb.go' -exec sed -i 's/,omitempty"`/\"\`/g' {} +
fi

View File

@@ -0,0 +1,525 @@
syntax = "proto3";
package openim.sdkws;
import "wrapperspb/wrapperspb.proto";
option go_package = "git.imall.cloud/openim/protocol/sdkws";
////////////////////////////////base///////////////////////////////
message GroupInfo {
string groupID = 1;
string groupName = 2;
string notification = 3;
string introduction = 4;
string faceURL = 5;
string ownerUserID = 6;
int64 createTime = 7;
uint32 memberCount = 8;
string ex = 9;
int32 status = 10;
string creatorUserID = 11;
int32 groupType = 12;
int32 needVerification = 13;
int32 lookMemberInfo = 14;
int32 applyMemberFriend = 15;
int64 notificationUpdateTime = 16;
string notificationUserID = 17;
}
message GroupInfoForSet {
string groupID = 1;
string groupName = 2;
string notification = 3;
string introduction = 4;
string faceURL = 5;
openim.protobuf.StringValue ex = 6;
openim.protobuf.Int32Value needVerification = 7;
openim.protobuf.Int32Value lookMemberInfo = 8;
openim.protobuf.Int32Value applyMemberFriend = 9;
}
message GroupMemberFullInfo {
string groupID = 1;
string userID = 2;
int32 roleLevel = 3;
int64 joinTime = 4;
string nickname = 5;
string faceURL = 6;
int32 appMangerLevel = 7; //if >0
int32 joinSource = 8;
string operatorUserID = 9;
string ex = 10;
int64 muteEndTime = 11;
string inviterUserID = 12;
}
message PublicUserInfo {
string userID = 1;
string nickname = 2;
string faceURL = 3;
string ex = 4;
}
message UserInfo {
string userID = 1;
string nickname = 2;
string faceURL = 3;
string ex = 4;
int64 createTime = 5;
int32 appMangerLevel = 6;
int32 globalRecvMsgOpt = 7;
}
message UserInfoWithEx {
string userID = 1;
openim.protobuf.StringValue nickname = 2;
openim.protobuf.StringValue faceURL = 3;
openim.protobuf.StringValue ex = 4;
openim.protobuf.Int32Value globalRecvMsgOpt = 7;
}
message FriendInfo {
string ownerUserID = 1;
string remark = 2;
int64 createTime = 3;
UserInfo friendUser = 4;
int32 addSource = 5;
string operatorUserID = 6;
string ex = 7;
bool isPinned = 8;
}
message BlackInfo {
string ownerUserID = 1;
int64 createTime = 2;
PublicUserInfo blackUserInfo = 3;
int32 addSource = 4;
string operatorUserID = 5;
string ex = 6;
}
message GroupRequest {
PublicUserInfo userInfo = 1;
GroupInfo groupInfo = 2;
int32 handleResult = 3;
string reqMsg = 4;
string handleMsg = 5;
int64 reqTime = 6;
string handleUserID = 7;
int64 handleTime = 8;
string ex = 9;
int32 joinSource = 10;
string inviterUserID = 11;
}
message FriendRequest {
string fromUserID = 1;
string fromNickname = 2;
string fromFaceURL = 3;
string toUserID = 4;
string toNickname = 5;
string toFaceURL = 6;
int32 handleResult = 7;
string reqMsg = 8;
int64 createTime = 9;
string handlerUserID = 10;
string handleMsg = 11;
int64 handleTime = 12;
string ex = 13;
}
///////////////////////////////////base end/////////////////////////////////////
enum PullOrder {
PullOrderAsc = 0;
PullOrderDesc = 1;
}
message PullMessageBySeqsReq {
string userID = 1;
repeated SeqRange seqRanges = 2;
PullOrder order = 3;
}
message SeqRange {
string conversationID = 1;
int64 begin = 2;
int64 end = 3;
int64 num = 4;
}
message PullMsgs {
repeated MsgData Msgs = 1;
bool isEnd = 2;
}
message PullMessageBySeqsResp {
map<string, PullMsgs> msgs = 1;
map<string, PullMsgs> notificationMsgs = 2;
}
message GetMaxSeqReq {
string userID = 1;
}
message GetMaxSeqResp {
map<string, int64> maxSeqs = 1;
map<string, int64> minSeqs = 2;
}
message UserSendMsgResp {
string serverMsgID = 1;
string clientMsgID = 2;
int64 sendTime = 3;
}
message MsgData {
string sendID = 1;
string recvID = 2;
string groupID = 3;
string clientMsgID = 4;
string serverMsgID = 5;
int32 senderPlatformID = 6;
string senderNickname = 7;
string senderFaceURL = 8;
int32 sessionType = 9;
int32 msgFrom = 10;
int32 contentType = 11;
bytes content = 12;
int64 seq = 14;
int64 sendTime = 15;
int64 createTime = 16;
int32 status = 17;
bool isRead = 18;
map<string, bool> options = 19;
OfflinePushInfo offlinePushInfo = 20;
repeated string atUserIDList = 21;
string attachedInfo = 22;
string ex = 23;
}
message PushMessages {
map<string, PullMsgs> msgs = 1;
map<string, PullMsgs> notificationMsgs = 2;
}
message OfflinePushInfo {
string title = 1;
string desc = 2;
string ex = 3;
string iOSPushSound = 4;
bool iOSBadgeCount = 5;
string signalInfo = 6;
}
message TipsComm {
bytes detail = 1;
string defaultTips = 2;
string jsonDetail = 3;
}
//////////////////////group/////////////////////
// OnGroupCreated()
message GroupCreatedTips {
GroupInfo group = 1;
GroupMemberFullInfo opUser = 2;
repeated GroupMemberFullInfo memberList = 3;
int64 operationTime = 4;
GroupMemberFullInfo groupOwnerUser = 5;
}
// OnGroupInfoSet()
message GroupInfoSetTips {
GroupMemberFullInfo opUser = 1; //who do this
int64 muteTime = 2;
GroupInfo group = 3;
}
message GroupInfoSetNameTips {
GroupMemberFullInfo opUser = 1; //who do this
GroupInfo group = 2;
}
message GroupInfoSetAnnouncementTips {
GroupMemberFullInfo opUser = 1; //who do this
GroupInfo group = 2;
}
// OnJoinGroupApplication()
message JoinGroupApplicationTips {
GroupInfo group = 1;
PublicUserInfo applicant = 2;
string reqMsg = 3;
}
// OnQuitGroup()
//Actively leave the group
message MemberQuitTips {
GroupInfo group = 1;
GroupMemberFullInfo quitUser = 2;
int64 operationTime = 3;
}
// OnApplicationGroupAccepted()
message GroupApplicationAcceptedTips {
GroupInfo group = 1;
GroupMemberFullInfo opUser = 2;
string handleMsg = 4;
int32 receiverAs = 5; // admin(==1) or applicant(==0)
}
// OnApplicationGroupRejected()
message GroupApplicationRejectedTips {
GroupInfo group = 1;
GroupMemberFullInfo opUser = 2;
string handleMsg = 4;
int32 receiverAs = 5; // admin(==1) or applicant(==0)
}
// OnTransferGroupOwner()
message GroupOwnerTransferredTips {
GroupInfo group = 1;
GroupMemberFullInfo opUser = 2;
GroupMemberFullInfo newGroupOwner = 3;
string oldGroupOwner = 4;
int64 operationTime = 5;
}
// OnMemberKicked()
message MemberKickedTips {
GroupInfo group = 1;
GroupMemberFullInfo opUser = 2;
repeated GroupMemberFullInfo kickedUserList = 3;
int64 operationTime = 4;
}
// OnMemberInvited()
message MemberInvitedTips {
GroupInfo group = 1;
GroupMemberFullInfo opUser = 2;
repeated GroupMemberFullInfo invitedUserList = 3;
int64 operationTime = 4;
}
//Actively join the group
message MemberEnterTips {
GroupInfo group = 1;
GroupMemberFullInfo entrantUser = 2;
int64 operationTime = 3;
}
message GroupDismissedTips {
GroupInfo group = 1;
GroupMemberFullInfo opUser = 2;
int64 operationTime = 3;
}
message GroupMemberMutedTips {
GroupInfo group = 1;
GroupMemberFullInfo opUser = 2;
int64 operationTime = 3;
GroupMemberFullInfo mutedUser = 4;
uint32 mutedSeconds = 5;
}
message GroupMemberCancelMutedTips {
GroupInfo group = 1;
GroupMemberFullInfo opUser = 2;
int64 operationTime = 3;
GroupMemberFullInfo mutedUser = 4;
}
message GroupMutedTips {
GroupInfo group = 1;
GroupMemberFullInfo opUser = 2;
int64 operationTime = 3;
}
message GroupCancelMutedTips {
GroupInfo group = 1;
GroupMemberFullInfo opUser = 2;
int64 operationTime = 3;
}
message GroupMemberInfoSetTips {
GroupInfo group = 1;
GroupMemberFullInfo opUser = 2;
int64 operationTime = 3;
GroupMemberFullInfo changedUser = 4;
}
//////////////////////friend/////////////////////
message FriendApplication {
int64 addTime = 1;
string addSource = 2;
string addWording = 3;
}
message FromToUserID {
string fromUserID = 1;
string toUserID = 2;
}
//FromUserID apply to add ToUserID
message FriendApplicationTips {
FromToUserID fromToUserID = 1; //fromsender toreceiver
}
//FromUserID accept or reject ToUserID
message FriendApplicationApprovedTips {
FromToUserID fromToUserID = 1; //from: approver; to: requester
string handleMsg = 2;
}
//FromUserID accept or reject ToUserID
message FriendApplicationRejectedTips {
FromToUserID fromToUserID = 1; //from: rejecter; to: requester
string handleMsg = 2;
}
// FromUserID Added a friend ToUserID
message FriendAddedTips {
FriendInfo friend = 1;
int64 operationTime = 2;
PublicUserInfo opUser = 3; //who do this
}
// FromUserID deleted a friend ToUserID
message FriendDeletedTips {
FromToUserID fromToUserID = 1; //fromowner tofriend
}
message BlackAddedTips {
FromToUserID fromToUserID = 1; //fromowner toblack
}
message BlackDeletedTips {
FromToUserID fromToUserID = 1; //fromowner toblack
}
message FriendInfoChangedTips {
FromToUserID fromToUserID = 1; //fromchanged tofriend
}
//////////////////////user/////////////////////
message UserInfoUpdatedTips {
string userID = 1;
}
message UserStatusChangeTips {
string fromUserID = 1;
string toUserID = 2;
int32 status = 3;
int32 platformID = 4;
}
message UserCommandAddTips {
string fromUserID = 1;
string toUserID = 2;
}
message UserCommandUpdateTips {
string fromUserID = 1;
string toUserID = 2;
}
message UserCommandDeleteTips {
string fromUserID = 1;
string toUserID = 2;
}
//////////////////////conversation/////////////////////
message ConversationUpdateTips {
string userID = 1;
repeated string conversationIDList = 2;
}
message ConversationSetPrivateTips {
string recvID = 1;
string sendID = 2;
bool isPrivate = 3;
string conversationID = 4;
}
message ConversationHasReadTips {
string userID = 1;
string conversationID = 2;
int64 hasReadSeq = 3;
int64 unreadCountTime = 4;
}
message NotificationElem {
string detail = 1;
}
////////////////////message///////////////////////
message seqs {
repeated int64 seqs = 1;
}
message DeleteMessageTips {
string opUserID = 1;
string userID = 2;
repeated int64 seqs = 3;
}
message RevokeMsgTips {
string revokerUserID = 1;
string clientMsgID = 2;
int64 revokeTime = 3;
int32 sesstionType = 5;
int64 seq = 6;
string conversationID = 7;
bool isAdminRevoke = 8;
}
message MessageRevokedContent {
string revokerID = 1;
int32 revokerRole = 2;
string clientMsgID = 3;
string revokerNickname = 4;
int64 revokeTime = 5;
int64 sourceMessageSendTime = 6;
string sourceMessageSendID = 7;
string sourceMessageSenderNickname = 8;
int32 sessionType = 10;
int64 seq = 11;
string ex = 12;
}
message ClearConversationTips {
string userID = 1;
repeated string conversationIDs = 2;
}
message DeleteMsgsTips {
string userID = 1;
string conversationID = 2;
repeated int64 seqs = 3;
}
message MarkAsReadTips {
string markAsReadUserID = 1;
string conversationID = 2;
repeated int64 seqs = 3;
int64 hasReadSeq = 4;
}
message SetAppBackgroundStatusReq {
string userID = 1;
bool isBackground = 2;
}
message SetAppBackgroundStatusResp {}
message ProcessUserCommand {
string userID = 1;
int32 type = 2;
int64 createTime = 3;
string uuid = 4;
string value = 5;
}
message RequestPagination {
int32 pageNumber = 1;
int32 showNumber = 2;
}
message FriendsInfoUpdateTips {
FromToUserID fromToUserID = 1;
repeated string friendIDs = 2;
}

View File

@@ -0,0 +1,77 @@
syntax = "proto3";
package openim.protobuf;
option go_package = "git.imall.cloud/openim/protocol/wrapperspb";
// Wrapper message for `double`.
//
// The JSON representation for `DoubleValue` is JSON number.
message DoubleValue {
// The double value.
double value = 1;
}
// Wrapper message for `float`.
//
// The JSON representation for `FloatValue` is JSON number.
message FloatValue {
// The float value.
float value = 1;
}
// Wrapper message for `int64`.
//
// The JSON representation for `Int64Value` is JSON string.
message Int64Value {
// The int64 value.
int64 value = 1;
}
// Wrapper message for `uint64`.
//
// The JSON representation for `UInt64Value` is JSON string.
message UInt64Value {
// The uint64 value.
uint64 value = 1;
}
// Wrapper message for `int32`.
//
// The JSON representation for `Int32Value` is JSON number.
message Int32Value {
// The int32 value.
int32 value = 1;
}
// Wrapper message for `uint32`.
//
// The JSON representation for `UInt32Value` is JSON number.
message UInt32Value {
// The uint32 value.
uint32 value = 1;
}
// Wrapper message for `bool`.
//
// The JSON representation for `BoolValue` is JSON `true` and `false`.
message BoolValue {
// The bool value.
bool value = 1;
}
// Wrapper message for `string`.
//
// The JSON representation for `StringValue` is JSON string.
message StringValue {
// The string value.
string value = 1;
}
// Wrapper message for `bytes`.
//
// The JSON representation for `BytesValue` is JSON string.
message BytesValue {
// The bytes value.
bytes value = 1;
}