Commit d5cdb5f2 by Li Feifei

实现聊天室的curd

parent c6573c1c
...@@ -54,7 +54,7 @@ func newMysqlClient() { ...@@ -54,7 +54,7 @@ func newMysqlClient() {
log.Println("db connect error => ", err) log.Println("db connect error => ", err)
return return
} }
orm.RegisterModel(new(CompanyApp), new(ImBase)) orm.RegisterModel(new(CompanyApp), new(ImBase), new(ImChatRoom))
MysqlClient = orm.NewOrm() MysqlClient = orm.NewOrm()
log.Println("MySQL connect success") log.Println("MySQL connect success")
} }
...@@ -14,3 +14,14 @@ type ImBase struct { ...@@ -14,3 +14,14 @@ type ImBase struct {
MultideviceType int64 MultideviceType int64
MsgHookUrl string MsgHookUrl string
} }
type ImChatRoom struct {
Id int
Creator string
Name string
Announcement string
Ext string
Status int
Createtime string
Updatetime string
}
package helper
import (
"errors"
"im-microservice/db"
"im-microservice/pb"
"im-microservice/validator_struct"
"github.com/astaxie/beego/orm"
)
const (
chat_table_name = "im_chat_room"
chat_room_id = "id"
chat_creator = "creator"
chat_room = "name"
chat_announcement = "announcement"
chat_status = "status"
chat_create_time = "createtime"
)
func AddChatRoom (addStruct *validator_struct.ChatRoomAddStruct) (int64, error) {
var chat db.ImChatRoom
now := GetNowTime()
chat.Name = addStruct.Name
chat.Announcement = addStruct.Announcement
chat.Creator = addStruct.Creator
chat.Status = 1;
chat.Createtime = now
chat.Updatetime = now
room_id, err := db.MysqlClient.Insert(&chat)
return room_id, err
}
func UpdateChatRoom( update *validator_struct.ChatRoomUpdate) error {
orm_params := make(orm.Params)
if update.Status != 0 {
orm_params[chat_status] = update.Status
}
if update.Announcement != "" {
orm_params[chat_announcement] = update.Announcement
}
if update.Name != "" {
orm_params[chat_room] = update.Name
}
if len(orm_params) == 0 {
return errors.New("修改房间的参数为空")
}
orm_params["updatetime"] = GetNowTime()
_, err := db.MysqlClient.QueryTable(chat_table_name).Filter(chat_room_id, update.RoomId).Update(orm_params)
return err
}
func DeleteChatRoom(room_id int64) error {
_, err := db.MysqlClient.QueryTable(chat_table_name).Filter(chat_room_id, room_id).Delete()
return err
}
func ChatRoomInfo(info *validator_struct.ChatRoomInfo) (res db.ImChatRoom, err error) {
err = db.MysqlClient.QueryTable(chat_table_name).Filter(chat_room_id, info.RoomId).One(&res)
return
}
func GetChatRooms(request *pb.ChatRoomAllRequest) (results map[string]interface{}, err error) {
var (
announcement = request.GetAnnouncement()
name = request.GetName()
status = request.GetStatus()
creator = request.GetCreator()
createtime = request.GetCreatetime()
page = request.GetPage()
)
if page == 0 {
page = 1;
}
count_db := db.MysqlClient.QueryTable(chat_table_name)
if announcement != "" {
count_db = count_db.Filter(chat_announcement + "__icontains", announcement)
}
if name != "" {
count_db = count_db.Filter(chat_room + "__icontains", name)
}
if status != 0 {
count_db = count_db.Filter(chat_status, status)
}
if creator != "" {
count_db = count_db.Filter(chat_creator, creator)
}
if createtime != "" {
count_db = count_db.Filter(chat_create_time + "__age__gte", createtime)
}
ctn, err := count_db.Count()
if err != nil {
return
}
if ctn == 0 {
err = errors.New("没有查询到任何数据")
return
}
// 获取查询条件聊天室的总数
offset, total_page := Paginate(ctn, 20, page)
// 查询数据
var chat_rooms []db.ImChatRoom
if _, err = count_db.Limit(20, offset).All(&chat_rooms); err != nil {
return
}
results = make(map[string]interface{})
results["list"] = chat_rooms
results["total_page"] = total_page
results["total_count"] = ctn
results["page"] = page
results["page_size"] = 20
return
}
\ No newline at end of file
...@@ -5,6 +5,7 @@ import ( ...@@ -5,6 +5,7 @@ import (
"errors" "errors"
"im-microservice/db" "im-microservice/db"
"log" "log"
"math"
"time" "time"
"gopkg.in/go-playground/validator.v9" "gopkg.in/go-playground/validator.v9"
...@@ -37,3 +38,9 @@ func GetCode(mobile string) (string, error) { ...@@ -37,3 +38,9 @@ func GetCode(mobile string) (string, error) {
return val, nil return val, nil
} }
func Paginate(count, step, page int64) (int64, int64) {
offset := step * (page - 1)
total := int64(math.Ceil(float64(count) / float64(step)))
return offset, total
}
...@@ -17,10 +17,7 @@ const ( ...@@ -17,10 +17,7 @@ const (
func GetImBaseByUserId(user_id int64) (db.ImBase, error) { func GetImBaseByUserId(user_id int64) (db.ImBase, error) {
var im_base db.ImBase var im_base db.ImBase
err := db.MysqlClient.QueryTable(b_table_name).Filter(b_user_id, user_id).One(&im_base) err := db.MysqlClient.QueryTable(b_table_name).Filter(b_user_id, user_id).One(&im_base)
if err != nil {
return im_base, err return im_base, err
}
return im_base, nil
} }
func AddImBase(im *validator_struct.ConfigureAddStruct) error { func AddImBase(im *validator_struct.ConfigureAddStruct) error {
...@@ -28,41 +25,34 @@ func AddImBase(im *validator_struct.ConfigureAddStruct) error { ...@@ -28,41 +25,34 @@ func AddImBase(im *validator_struct.ConfigureAddStruct) error {
configure.CompanyUserId = im.CompanyUserId configure.CompanyUserId = im.CompanyUserId
configure.MsgHookUrl = im.MsgHookUrl configure.MsgHookUrl = im.MsgHookUrl
configure.MultideviceType = im.MultideviceType configure.MultideviceType = im.MultideviceType
if _, err := db.MysqlClient.Insert(configure); err != nil { _, err := db.MysqlClient.Insert(configure);
return err return err
}
return nil
} }
func DelConfigure(user_id int64) error { func DelConfigure(user_id int64) error {
configure := new(db.ImBase) configure := new(db.ImBase)
configure.CompanyUserId = user_id configure.CompanyUserId = user_id
if _, err := db.MysqlClient.Delete(configure); err != nil { _, err := db.MysqlClient.Delete(configure);
return err return err
}
return nil
} }
func GetConfigureAll() []*db.ImBase{ func GetConfigureAll() []*db.ImBase {
var configurs []*db.ImBase var configurs []*db.ImBase
_, _ = db.MysqlClient.QueryTable(b_table_name).All(&configurs) _, _ = db.MysqlClient.QueryTable(b_table_name).All(&configurs)
return configurs return configurs
} }
func UpdateConfiguer(im *validator_struct.ConfigureUpdateStruct ) error { func UpdateConfiguer(im *validator_struct.ConfigureUpdateStruct) error {
orm_params := make(orm.Params) orm_params := make(orm.Params)
if im.MsgHookUrl != "" { if im.MsgHookUrl != "" {
orm_params["msg_hook_url"] = im.MsgHookUrl orm_params[b_url] = im.MsgHookUrl
} }
if im.MultideviceType != 0 { if im.MultideviceType != 0 {
orm_params["multidevice_type"] = im.MultideviceType orm_params[b_type] = im.MultideviceType
} }
if len(orm_params) == 0 { if len(orm_params) == 0 {
return errors.New("没有数据更改") return errors.New("没有数据更改")
} }
_, err := db.MysqlClient.QueryTable(b_table_name).Filter(b_user_id, im.CompanyUserId).Update(orm_params) _, err := db.MysqlClient.QueryTable(b_table_name).Filter(b_user_id, im.CompanyUserId).Update(orm_params)
if err != nil {
return err return err
}
return nil
} }
...@@ -13,6 +13,7 @@ import ( ...@@ -13,6 +13,7 @@ import (
"im-microservice/helper" "im-microservice/helper"
"im-microservice/pb" "im-microservice/pb"
"im-microservice/sevice/im_chat_room"
ic "im-microservice/sevice/im_configure" ic "im-microservice/sevice/im_configure"
"golang.org/x/net/context" "golang.org/x/net/context"
...@@ -101,11 +102,12 @@ func main() { ...@@ -101,11 +102,12 @@ func main() {
log.Fatalf("failed to listen: %v", err) log.Fatalf("failed to listen: %v", err)
} }
var opts []grpc.ServerOption //var opts []grpc.ServerOption
opts = append(opts, grpc.UnaryInterceptor(auth)) //opts = append(opts, grpc.UnaryInterceptor(auth))
s := grpc.NewServer(opts...) //s := grpc.NewServer(opts...)
//s := grpc.NewServer() s := grpc.NewServer()
pb.RegisterConfigureSeviceServer(s, &ic.ConfigureSevice{}) pb.RegisterConfigureSeviceServer(s, &ic.ConfigureSevice{})
pb.RegisterChatRoomServiceServer(s, &im_chat_room.ImChatRoomService{})
if err := s.Serve(lis); err != nil { if err := s.Serve(lis); err != nil {
log.Fatalf("failed to serve: %v", err) log.Fatalf("failed to serve: %v", err)
} }
......
...@@ -96,19 +96,97 @@ func (x *Common) GetChecksum() string { ...@@ -96,19 +96,97 @@ func (x *Common) GetChecksum() string {
return "" return ""
} }
type Page struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
PagetNo int64 `protobuf:"varint,1,opt,name=PagetNo,proto3" json:"PagetNo,omitempty"`
PageSize int64 `protobuf:"varint,2,opt,name=PageSize,proto3" json:"PageSize,omitempty"`
TotalPage int64 `protobuf:"varint,3,opt,name=TotalPage,proto3" json:"TotalPage,omitempty"`
TotalCount int64 `protobuf:"varint,4,opt,name=TotalCount,proto3" json:"TotalCount,omitempty"`
}
func (x *Page) Reset() {
*x = Page{}
if protoimpl.UnsafeEnabled {
mi := &file_u_proto_common_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Page) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Page) ProtoMessage() {}
func (x *Page) ProtoReflect() protoreflect.Message {
mi := &file_u_proto_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 Page.ProtoReflect.Descriptor instead.
func (*Page) Descriptor() ([]byte, []int) {
return file_u_proto_common_proto_rawDescGZIP(), []int{1}
}
func (x *Page) GetPagetNo() int64 {
if x != nil {
return x.PagetNo
}
return 0
}
func (x *Page) GetPageSize() int64 {
if x != nil {
return x.PageSize
}
return 0
}
func (x *Page) GetTotalPage() int64 {
if x != nil {
return x.TotalPage
}
return 0
}
func (x *Page) GetTotalCount() int64 {
if x != nil {
return x.TotalCount
}
return 0
}
var File_u_proto_common_proto protoreflect.FileDescriptor var File_u_proto_common_proto protoreflect.FileDescriptor
var file_u_proto_common_proto_rawDesc = []byte{ var file_u_proto_common_proto_rawDesc = []byte{
0x0a, 0x14, 0x75, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x0a, 0x14, 0x75, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e,
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x22, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x22, 0x6c, 0x0a, 0x06, 0x43, 0x6f,
0x0a, 0x06, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x41, 0x70, 0x70, 0x6b, 0x6d, 0x6d, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x41, 0x70, 0x70, 0x6b, 0x65, 0x79, 0x18, 0x01,
0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x41, 0x70, 0x70, 0x6b, 0x65, 0x79, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x41, 0x70, 0x70, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05,
0x12, 0x14, 0x0a, 0x05, 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x4e, 0x6f, 0x6e,
0x05, 0x4e, 0x6f, 0x6e, 0x63, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x43, 0x75, 0x72, 0x74, 0x69, 0x6d, 0x63, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x43, 0x75, 0x72, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x03, 0x20,
0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x43, 0x75, 0x72, 0x74, 0x69, 0x6d, 0x65, 0x01, 0x28, 0x09, 0x52, 0x07, 0x43, 0x75, 0x72, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08,
0x12, 0x1a, 0x0a, 0x08, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08,
0x28, 0x09, 0x52, 0x08, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x62, 0x06, 0x70, 0x72, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x73, 0x75, 0x6d, 0x22, 0x7a, 0x0a, 0x04, 0x50, 0x61, 0x67, 0x65,
0x6f, 0x74, 0x6f, 0x33, 0x12, 0x18, 0x0a, 0x07, 0x50, 0x61, 0x67, 0x65, 0x74, 0x4e, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28,
0x03, 0x52, 0x07, 0x50, 0x61, 0x67, 0x65, 0x74, 0x4e, 0x6f, 0x12, 0x1a, 0x0a, 0x08, 0x50, 0x61,
0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x50, 0x61,
0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x50,
0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x54, 0x6f, 0x74, 0x61, 0x6c,
0x50, 0x61, 0x67, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x43, 0x6f, 0x75,
0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x43,
0x6f, 0x75, 0x6e, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
} }
var ( var (
...@@ -123,9 +201,10 @@ func file_u_proto_common_proto_rawDescGZIP() []byte { ...@@ -123,9 +201,10 @@ func file_u_proto_common_proto_rawDescGZIP() []byte {
return file_u_proto_common_proto_rawDescData return file_u_proto_common_proto_rawDescData
} }
var file_u_proto_common_proto_msgTypes = make([]protoimpl.MessageInfo, 1) var file_u_proto_common_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var file_u_proto_common_proto_goTypes = []interface{}{ var file_u_proto_common_proto_goTypes = []interface{}{
(*Common)(nil), // 0: common.Common (*Common)(nil), // 0: pb.Common
(*Page)(nil), // 1: pb.Page
} }
var file_u_proto_common_proto_depIdxs = []int32{ var file_u_proto_common_proto_depIdxs = []int32{
0, // [0:0] is the sub-list for method output_type 0, // [0:0] is the sub-list for method output_type
...@@ -153,6 +232,18 @@ func file_u_proto_common_proto_init() { ...@@ -153,6 +232,18 @@ func file_u_proto_common_proto_init() {
return nil return nil
} }
} }
file_u_proto_common_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Page); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
} }
type x struct{} type x struct{}
out := protoimpl.TypeBuilder{ out := protoimpl.TypeBuilder{
...@@ -160,7 +251,7 @@ func file_u_proto_common_proto_init() { ...@@ -160,7 +251,7 @@ func file_u_proto_common_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(), GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_u_proto_common_proto_rawDesc, RawDescriptor: file_u_proto_common_proto_rawDesc,
NumEnums: 0, NumEnums: 0,
NumMessages: 1, NumMessages: 2,
NumExtensions: 0, NumExtensions: 0,
NumServices: 0, NumServices: 0,
}, },
......
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.24.0
// protoc v3.12.3
// source: u-proto/im_chat_room.proto
package pb
import (
context "context"
proto "github.com/golang/protobuf/proto"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
// 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)
)
// This is a compile-time assertion that a sufficiently up-to-date version
// of the legacy proto package is being used.
const _ = proto.ProtoPackageIsVersion4
// 添加聊天室
type ChatRoomAddRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Common *Common `protobuf:"bytes,1,opt,name=Common,proto3" json:"Common,omitempty"`
Creator string `protobuf:"bytes,2,opt,name=Creator,proto3" json:"Creator,omitempty"`
Name string `protobuf:"bytes,3,opt,name=Name,proto3" json:"Name,omitempty"`
Announcement string `protobuf:"bytes,4,opt,name=Announcement,proto3" json:"Announcement,omitempty"`
}
func (x *ChatRoomAddRequest) Reset() {
*x = ChatRoomAddRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_u_proto_im_chat_room_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ChatRoomAddRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ChatRoomAddRequest) ProtoMessage() {}
func (x *ChatRoomAddRequest) ProtoReflect() protoreflect.Message {
mi := &file_u_proto_im_chat_room_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 ChatRoomAddRequest.ProtoReflect.Descriptor instead.
func (*ChatRoomAddRequest) Descriptor() ([]byte, []int) {
return file_u_proto_im_chat_room_proto_rawDescGZIP(), []int{0}
}
func (x *ChatRoomAddRequest) GetCommon() *Common {
if x != nil {
return x.Common
}
return nil
}
func (x *ChatRoomAddRequest) GetCreator() string {
if x != nil {
return x.Creator
}
return ""
}
func (x *ChatRoomAddRequest) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *ChatRoomAddRequest) GetAnnouncement() string {
if x != nil {
return x.Announcement
}
return ""
}
type ChatRoomAddReply struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Id int64 `protobuf:"varint,1,opt,name=Id,proto3" json:"Id,omitempty"`
}
func (x *ChatRoomAddReply) Reset() {
*x = ChatRoomAddReply{}
if protoimpl.UnsafeEnabled {
mi := &file_u_proto_im_chat_room_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ChatRoomAddReply) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ChatRoomAddReply) ProtoMessage() {}
func (x *ChatRoomAddReply) ProtoReflect() protoreflect.Message {
mi := &file_u_proto_im_chat_room_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 ChatRoomAddReply.ProtoReflect.Descriptor instead.
func (*ChatRoomAddReply) Descriptor() ([]byte, []int) {
return file_u_proto_im_chat_room_proto_rawDescGZIP(), []int{1}
}
func (x *ChatRoomAddReply) GetId() int64 {
if x != nil {
return x.Id
}
return 0
}
// 更新聊天室
type ChatRoomUpdateRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Common *Common `protobuf:"bytes,1,opt,name=Common,proto3" json:"Common,omitempty"`
RoomId int64 `protobuf:"varint,2,opt,name=RoomId,proto3" json:"RoomId,omitempty"`
Name string `protobuf:"bytes,3,opt,name=Name,proto3" json:"Name,omitempty"`
Status int64 `protobuf:"varint,4,opt,name=Status,proto3" json:"Status,omitempty"`
Announcement string `protobuf:"bytes,5,opt,name=Announcement,proto3" json:"Announcement,omitempty"`
}
func (x *ChatRoomUpdateRequest) Reset() {
*x = ChatRoomUpdateRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_u_proto_im_chat_room_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ChatRoomUpdateRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ChatRoomUpdateRequest) ProtoMessage() {}
func (x *ChatRoomUpdateRequest) ProtoReflect() protoreflect.Message {
mi := &file_u_proto_im_chat_room_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 ChatRoomUpdateRequest.ProtoReflect.Descriptor instead.
func (*ChatRoomUpdateRequest) Descriptor() ([]byte, []int) {
return file_u_proto_im_chat_room_proto_rawDescGZIP(), []int{2}
}
func (x *ChatRoomUpdateRequest) GetCommon() *Common {
if x != nil {
return x.Common
}
return nil
}
func (x *ChatRoomUpdateRequest) GetRoomId() int64 {
if x != nil {
return x.RoomId
}
return 0
}
func (x *ChatRoomUpdateRequest) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *ChatRoomUpdateRequest) GetStatus() int64 {
if x != nil {
return x.Status
}
return 0
}
func (x *ChatRoomUpdateRequest) GetAnnouncement() string {
if x != nil {
return x.Announcement
}
return ""
}
type ChatRoomUpdateReply struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
}
func (x *ChatRoomUpdateReply) Reset() {
*x = ChatRoomUpdateReply{}
if protoimpl.UnsafeEnabled {
mi := &file_u_proto_im_chat_room_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ChatRoomUpdateReply) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ChatRoomUpdateReply) ProtoMessage() {}
func (x *ChatRoomUpdateReply) ProtoReflect() protoreflect.Message {
mi := &file_u_proto_im_chat_room_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 ChatRoomUpdateReply.ProtoReflect.Descriptor instead.
func (*ChatRoomUpdateReply) Descriptor() ([]byte, []int) {
return file_u_proto_im_chat_room_proto_rawDescGZIP(), []int{3}
}
// 删除聊天室
type ChatRoomDelRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Common *Common `protobuf:"bytes,1,opt,name=Common,proto3" json:"Common,omitempty"`
RoomId int64 `protobuf:"varint,2,opt,name=RoomId,proto3" json:"RoomId,omitempty"`
}
func (x *ChatRoomDelRequest) Reset() {
*x = ChatRoomDelRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_u_proto_im_chat_room_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ChatRoomDelRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ChatRoomDelRequest) ProtoMessage() {}
func (x *ChatRoomDelRequest) ProtoReflect() protoreflect.Message {
mi := &file_u_proto_im_chat_room_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 ChatRoomDelRequest.ProtoReflect.Descriptor instead.
func (*ChatRoomDelRequest) Descriptor() ([]byte, []int) {
return file_u_proto_im_chat_room_proto_rawDescGZIP(), []int{4}
}
func (x *ChatRoomDelRequest) GetCommon() *Common {
if x != nil {
return x.Common
}
return nil
}
func (x *ChatRoomDelRequest) GetRoomId() int64 {
if x != nil {
return x.RoomId
}
return 0
}
type ChatRoomDelReply struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
}
func (x *ChatRoomDelReply) Reset() {
*x = ChatRoomDelReply{}
if protoimpl.UnsafeEnabled {
mi := &file_u_proto_im_chat_room_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ChatRoomDelReply) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ChatRoomDelReply) ProtoMessage() {}
func (x *ChatRoomDelReply) ProtoReflect() protoreflect.Message {
mi := &file_u_proto_im_chat_room_proto_msgTypes[5]
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 ChatRoomDelReply.ProtoReflect.Descriptor instead.
func (*ChatRoomDelReply) Descriptor() ([]byte, []int) {
return file_u_proto_im_chat_room_proto_rawDescGZIP(), []int{5}
}
// 获取单个聊天室信息
type ChatRoomInfoRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Common *Common `protobuf:"bytes,1,opt,name=Common,proto3" json:"Common,omitempty"`
RoomId int64 `protobuf:"varint,2,opt,name=RoomId,proto3" json:"RoomId,omitempty"`
}
func (x *ChatRoomInfoRequest) Reset() {
*x = ChatRoomInfoRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_u_proto_im_chat_room_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ChatRoomInfoRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ChatRoomInfoRequest) ProtoMessage() {}
func (x *ChatRoomInfoRequest) ProtoReflect() protoreflect.Message {
mi := &file_u_proto_im_chat_room_proto_msgTypes[6]
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 ChatRoomInfoRequest.ProtoReflect.Descriptor instead.
func (*ChatRoomInfoRequest) Descriptor() ([]byte, []int) {
return file_u_proto_im_chat_room_proto_rawDescGZIP(), []int{6}
}
func (x *ChatRoomInfoRequest) GetCommon() *Common {
if x != nil {
return x.Common
}
return nil
}
func (x *ChatRoomInfoRequest) GetRoomId() int64 {
if x != nil {
return x.RoomId
}
return 0
}
type ChatRoomInfoReply struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
RoomId int64 `protobuf:"varint,1,opt,name=Room_id,json=RoomId,proto3" json:"Room_id,omitempty"`
Creator string `protobuf:"bytes,2,opt,name=Creator,proto3" json:"Creator,omitempty"`
Name string `protobuf:"bytes,3,opt,name=Name,proto3" json:"Name,omitempty"`
Announcement string `protobuf:"bytes,4,opt,name=Announcement,proto3" json:"Announcement,omitempty"`
Status int64 `protobuf:"varint,5,opt,name=Status,proto3" json:"Status,omitempty"`
Ext string `protobuf:"bytes,6,opt,name=Ext,proto3" json:"Ext,omitempty"`
Createtime string `protobuf:"bytes,7,opt,name=Createtime,proto3" json:"Createtime,omitempty"`
Updatetime string `protobuf:"bytes,8,opt,name=Updatetime,proto3" json:"Updatetime,omitempty"`
}
func (x *ChatRoomInfoReply) Reset() {
*x = ChatRoomInfoReply{}
if protoimpl.UnsafeEnabled {
mi := &file_u_proto_im_chat_room_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ChatRoomInfoReply) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ChatRoomInfoReply) ProtoMessage() {}
func (x *ChatRoomInfoReply) ProtoReflect() protoreflect.Message {
mi := &file_u_proto_im_chat_room_proto_msgTypes[7]
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 ChatRoomInfoReply.ProtoReflect.Descriptor instead.
func (*ChatRoomInfoReply) Descriptor() ([]byte, []int) {
return file_u_proto_im_chat_room_proto_rawDescGZIP(), []int{7}
}
func (x *ChatRoomInfoReply) GetRoomId() int64 {
if x != nil {
return x.RoomId
}
return 0
}
func (x *ChatRoomInfoReply) GetCreator() string {
if x != nil {
return x.Creator
}
return ""
}
func (x *ChatRoomInfoReply) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *ChatRoomInfoReply) GetAnnouncement() string {
if x != nil {
return x.Announcement
}
return ""
}
func (x *ChatRoomInfoReply) GetStatus() int64 {
if x != nil {
return x.Status
}
return 0
}
func (x *ChatRoomInfoReply) GetExt() string {
if x != nil {
return x.Ext
}
return ""
}
func (x *ChatRoomInfoReply) GetCreatetime() string {
if x != nil {
return x.Createtime
}
return ""
}
func (x *ChatRoomInfoReply) GetUpdatetime() string {
if x != nil {
return x.Updatetime
}
return ""
}
type ChatRoomAllRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Common *Common `protobuf:"bytes,1,opt,name=Common,proto3" json:"Common,omitempty"`
Page int64 `protobuf:"varint,2,opt,name=Page,proto3" json:"Page,omitempty"`
Creator string `protobuf:"bytes,3,opt,name=Creator,proto3" json:"Creator,omitempty"`
Name string `protobuf:"bytes,4,opt,name=Name,proto3" json:"Name,omitempty"`
Announcement string `protobuf:"bytes,5,opt,name=Announcement,proto3" json:"Announcement,omitempty"`
Status int64 `protobuf:"varint,6,opt,name=Status,proto3" json:"Status,omitempty"`
Createtime string `protobuf:"bytes,7,opt,name=Createtime,proto3" json:"Createtime,omitempty"`
Updatetime string `protobuf:"bytes,8,opt,name=Updatetime,proto3" json:"Updatetime,omitempty"`
}
func (x *ChatRoomAllRequest) Reset() {
*x = ChatRoomAllRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_u_proto_im_chat_room_proto_msgTypes[8]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ChatRoomAllRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ChatRoomAllRequest) ProtoMessage() {}
func (x *ChatRoomAllRequest) ProtoReflect() protoreflect.Message {
mi := &file_u_proto_im_chat_room_proto_msgTypes[8]
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 ChatRoomAllRequest.ProtoReflect.Descriptor instead.
func (*ChatRoomAllRequest) Descriptor() ([]byte, []int) {
return file_u_proto_im_chat_room_proto_rawDescGZIP(), []int{8}
}
func (x *ChatRoomAllRequest) GetCommon() *Common {
if x != nil {
return x.Common
}
return nil
}
func (x *ChatRoomAllRequest) GetPage() int64 {
if x != nil {
return x.Page
}
return 0
}
func (x *ChatRoomAllRequest) GetCreator() string {
if x != nil {
return x.Creator
}
return ""
}
func (x *ChatRoomAllRequest) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *ChatRoomAllRequest) GetAnnouncement() string {
if x != nil {
return x.Announcement
}
return ""
}
func (x *ChatRoomAllRequest) GetStatus() int64 {
if x != nil {
return x.Status
}
return 0
}
func (x *ChatRoomAllRequest) GetCreatetime() string {
if x != nil {
return x.Createtime
}
return ""
}
func (x *ChatRoomAllRequest) GetUpdatetime() string {
if x != nil {
return x.Updatetime
}
return ""
}
type GetChatRoomsReply struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
List []*ChatRoomInfoReply `protobuf:"bytes,1,rep,name=List,proto3" json:"List,omitempty"`
Paginate *Page `protobuf:"bytes,2,opt,name=Paginate,proto3" json:"Paginate,omitempty"`
}
func (x *GetChatRoomsReply) Reset() {
*x = GetChatRoomsReply{}
if protoimpl.UnsafeEnabled {
mi := &file_u_proto_im_chat_room_proto_msgTypes[9]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *GetChatRoomsReply) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*GetChatRoomsReply) ProtoMessage() {}
func (x *GetChatRoomsReply) ProtoReflect() protoreflect.Message {
mi := &file_u_proto_im_chat_room_proto_msgTypes[9]
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 GetChatRoomsReply.ProtoReflect.Descriptor instead.
func (*GetChatRoomsReply) Descriptor() ([]byte, []int) {
return file_u_proto_im_chat_room_proto_rawDescGZIP(), []int{9}
}
func (x *GetChatRoomsReply) GetList() []*ChatRoomInfoReply {
if x != nil {
return x.List
}
return nil
}
func (x *GetChatRoomsReply) GetPaginate() *Page {
if x != nil {
return x.Paginate
}
return nil
}
var File_u_proto_im_chat_room_proto protoreflect.FileDescriptor
var file_u_proto_im_chat_room_proto_rawDesc = []byte{
0x0a, 0x1a, 0x75, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x69, 0x6d, 0x5f, 0x63, 0x68, 0x61,
0x74, 0x5f, 0x72, 0x6f, 0x6f, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62,
0x1a, 0x14, 0x75, 0x2d, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e,
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x8a, 0x01, 0x0a, 0x12, 0x43, 0x68, 0x61, 0x74, 0x52,
0x6f, 0x6f, 0x6d, 0x41, 0x64, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x22, 0x0a,
0x06, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e,
0x70, 0x62, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x06, 0x43, 0x6f, 0x6d, 0x6d, 0x6f,
0x6e, 0x12, 0x18, 0x0a, 0x07, 0x43, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01,
0x28, 0x09, 0x52, 0x07, 0x43, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x4e,
0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x12,
0x22, 0x0a, 0x0c, 0x41, 0x6e, 0x6e, 0x6f, 0x75, 0x6e, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x18,
0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x41, 0x6e, 0x6e, 0x6f, 0x75, 0x6e, 0x63, 0x65, 0x6d,
0x65, 0x6e, 0x74, 0x22, 0x22, 0x0a, 0x10, 0x43, 0x68, 0x61, 0x74, 0x52, 0x6f, 0x6f, 0x6d, 0x41,
0x64, 0x64, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64, 0x18, 0x01, 0x20,
0x01, 0x28, 0x03, 0x52, 0x02, 0x49, 0x64, 0x22, 0xa3, 0x01, 0x0a, 0x15, 0x43, 0x68, 0x61, 0x74,
0x52, 0x6f, 0x6f, 0x6d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
0x74, 0x12, 0x22, 0x0a, 0x06, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28,
0x0b, 0x32, 0x0a, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x06, 0x43,
0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x52, 0x6f, 0x6f, 0x6d, 0x49, 0x64, 0x18,
0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x52, 0x6f, 0x6f, 0x6d, 0x49, 0x64, 0x12, 0x12, 0x0a,
0x04, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x4e, 0x61, 0x6d,
0x65, 0x12, 0x16, 0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28,
0x03, 0x52, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x22, 0x0a, 0x0c, 0x41, 0x6e, 0x6e,
0x6f, 0x75, 0x6e, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52,
0x0c, 0x41, 0x6e, 0x6e, 0x6f, 0x75, 0x6e, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x22, 0x15, 0x0a,
0x13, 0x43, 0x68, 0x61, 0x74, 0x52, 0x6f, 0x6f, 0x6d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52,
0x65, 0x70, 0x6c, 0x79, 0x22, 0x50, 0x0a, 0x12, 0x43, 0x68, 0x61, 0x74, 0x52, 0x6f, 0x6f, 0x6d,
0x44, 0x65, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x22, 0x0a, 0x06, 0x43, 0x6f,
0x6d, 0x6d, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x70, 0x62, 0x2e,
0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x06, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x12, 0x16,
0x0a, 0x06, 0x52, 0x6f, 0x6f, 0x6d, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06,
0x52, 0x6f, 0x6f, 0x6d, 0x49, 0x64, 0x22, 0x12, 0x0a, 0x10, 0x43, 0x68, 0x61, 0x74, 0x52, 0x6f,
0x6f, 0x6d, 0x44, 0x65, 0x6c, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x51, 0x0a, 0x13, 0x43, 0x68,
0x61, 0x74, 0x52, 0x6f, 0x6f, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
0x74, 0x12, 0x22, 0x0a, 0x06, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28,
0x0b, 0x32, 0x0a, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x06, 0x43,
0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x52, 0x6f, 0x6f, 0x6d, 0x49, 0x64, 0x18,
0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x52, 0x6f, 0x6f, 0x6d, 0x49, 0x64, 0x22, 0xe8, 0x01,
0x0a, 0x11, 0x43, 0x68, 0x61, 0x74, 0x52, 0x6f, 0x6f, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65,
0x70, 0x6c, 0x79, 0x12, 0x17, 0x0a, 0x07, 0x52, 0x6f, 0x6f, 0x6d, 0x5f, 0x69, 0x64, 0x18, 0x01,
0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x52, 0x6f, 0x6f, 0x6d, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07,
0x43, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x43,
0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x12, 0x0a, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x03,
0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x22, 0x0a, 0x0c, 0x41, 0x6e,
0x6e, 0x6f, 0x75, 0x6e, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09,
0x52, 0x0c, 0x41, 0x6e, 0x6e, 0x6f, 0x75, 0x6e, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x16,
0x0a, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06,
0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x45, 0x78, 0x74, 0x18, 0x06, 0x20,
0x01, 0x28, 0x09, 0x52, 0x03, 0x45, 0x78, 0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x43, 0x72, 0x65, 0x61,
0x74, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x43, 0x72,
0x65, 0x61, 0x74, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x55, 0x70, 0x64, 0x61,
0x74, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x55, 0x70,
0x64, 0x61, 0x74, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x22, 0xf6, 0x01, 0x0a, 0x12, 0x43, 0x68, 0x61,
0x74, 0x52, 0x6f, 0x6f, 0x6d, 0x41, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12,
0x22, 0x0a, 0x06, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32,
0x0a, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x06, 0x43, 0x6f, 0x6d,
0x6d, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x50, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28,
0x03, 0x52, 0x04, 0x50, 0x61, 0x67, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x43, 0x72, 0x65, 0x61, 0x74,
0x6f, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x43, 0x72, 0x65, 0x61, 0x74, 0x6f,
0x72, 0x12, 0x12, 0x0a, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52,
0x04, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x22, 0x0a, 0x0c, 0x41, 0x6e, 0x6e, 0x6f, 0x75, 0x6e, 0x63,
0x65, 0x6d, 0x65, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x41, 0x6e, 0x6e,
0x6f, 0x75, 0x6e, 0x63, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x53, 0x74, 0x61,
0x74, 0x75, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x53, 0x74, 0x61, 0x74, 0x75,
0x73, 0x12, 0x1e, 0x0a, 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x18,
0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x74, 0x69, 0x6d,
0x65, 0x12, 0x1e, 0x0a, 0x0a, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x74, 0x69, 0x6d, 0x65, 0x18,
0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x74, 0x69, 0x6d,
0x65, 0x22, 0x64, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x43, 0x68, 0x61, 0x74, 0x52, 0x6f, 0x6f, 0x6d,
0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x12, 0x29, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x01,
0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x61, 0x74, 0x52, 0x6f,
0x6f, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x52, 0x04, 0x4c, 0x69, 0x73,
0x74, 0x12, 0x24, 0x0a, 0x08, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20,
0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x70, 0x62, 0x2e, 0x50, 0x61, 0x67, 0x65, 0x52, 0x08, 0x50,
0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x65, 0x32, 0xb4, 0x02, 0x0a, 0x0f, 0x43, 0x68, 0x61, 0x74,
0x52, 0x6f, 0x6f, 0x6d, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x35, 0x0a, 0x03, 0x41,
0x64, 0x64, 0x12, 0x16, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x61, 0x74, 0x52, 0x6f, 0x6f, 0x6d,
0x41, 0x64, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x70, 0x62, 0x2e,
0x43, 0x68, 0x61, 0x74, 0x52, 0x6f, 0x6f, 0x6d, 0x41, 0x64, 0x64, 0x52, 0x65, 0x70, 0x6c, 0x79,
0x22, 0x00, 0x12, 0x3e, 0x0a, 0x06, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x19, 0x2e, 0x70,
0x62, 0x2e, 0x43, 0x68, 0x61, 0x74, 0x52, 0x6f, 0x6f, 0x6d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x61,
0x74, 0x52, 0x6f, 0x6f, 0x6d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x70, 0x6c, 0x79,
0x22, 0x00, 0x12, 0x38, 0x0a, 0x06, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x16, 0x2e, 0x70,
0x62, 0x2e, 0x43, 0x68, 0x61, 0x74, 0x52, 0x6f, 0x6f, 0x6d, 0x44, 0x65, 0x6c, 0x52, 0x65, 0x71,
0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x61, 0x74, 0x52, 0x6f,
0x6f, 0x6d, 0x44, 0x65, 0x6c, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x38, 0x0a, 0x04,
0x49, 0x6e, 0x66, 0x6f, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x68, 0x61, 0x74, 0x52, 0x6f,
0x6f, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e,
0x70, 0x62, 0x2e, 0x43, 0x68, 0x61, 0x74, 0x52, 0x6f, 0x6f, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x52,
0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x12, 0x36, 0x0a, 0x03, 0x41, 0x6c, 0x6c, 0x12, 0x16, 0x2e,
0x70, 0x62, 0x2e, 0x43, 0x68, 0x61, 0x74, 0x52, 0x6f, 0x6f, 0x6d, 0x41, 0x6c, 0x6c, 0x52, 0x65,
0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x43, 0x68,
0x61, 0x74, 0x52, 0x6f, 0x6f, 0x6d, 0x73, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x62, 0x06,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_u_proto_im_chat_room_proto_rawDescOnce sync.Once
file_u_proto_im_chat_room_proto_rawDescData = file_u_proto_im_chat_room_proto_rawDesc
)
func file_u_proto_im_chat_room_proto_rawDescGZIP() []byte {
file_u_proto_im_chat_room_proto_rawDescOnce.Do(func() {
file_u_proto_im_chat_room_proto_rawDescData = protoimpl.X.CompressGZIP(file_u_proto_im_chat_room_proto_rawDescData)
})
return file_u_proto_im_chat_room_proto_rawDescData
}
var file_u_proto_im_chat_room_proto_msgTypes = make([]protoimpl.MessageInfo, 10)
var file_u_proto_im_chat_room_proto_goTypes = []interface{}{
(*ChatRoomAddRequest)(nil), // 0: pb.ChatRoomAddRequest
(*ChatRoomAddReply)(nil), // 1: pb.ChatRoomAddReply
(*ChatRoomUpdateRequest)(nil), // 2: pb.ChatRoomUpdateRequest
(*ChatRoomUpdateReply)(nil), // 3: pb.ChatRoomUpdateReply
(*ChatRoomDelRequest)(nil), // 4: pb.ChatRoomDelRequest
(*ChatRoomDelReply)(nil), // 5: pb.ChatRoomDelReply
(*ChatRoomInfoRequest)(nil), // 6: pb.ChatRoomInfoRequest
(*ChatRoomInfoReply)(nil), // 7: pb.ChatRoomInfoReply
(*ChatRoomAllRequest)(nil), // 8: pb.ChatRoomAllRequest
(*GetChatRoomsReply)(nil), // 9: pb.GetChatRoomsReply
(*Common)(nil), // 10: pb.Common
(*Page)(nil), // 11: pb.Page
}
var file_u_proto_im_chat_room_proto_depIdxs = []int32{
10, // 0: pb.ChatRoomAddRequest.Common:type_name -> pb.Common
10, // 1: pb.ChatRoomUpdateRequest.Common:type_name -> pb.Common
10, // 2: pb.ChatRoomDelRequest.Common:type_name -> pb.Common
10, // 3: pb.ChatRoomInfoRequest.Common:type_name -> pb.Common
10, // 4: pb.ChatRoomAllRequest.Common:type_name -> pb.Common
7, // 5: pb.GetChatRoomsReply.List:type_name -> pb.ChatRoomInfoReply
11, // 6: pb.GetChatRoomsReply.Paginate:type_name -> pb.Page
0, // 7: pb.ChatRoomService.Add:input_type -> pb.ChatRoomAddRequest
2, // 8: pb.ChatRoomService.Update:input_type -> pb.ChatRoomUpdateRequest
4, // 9: pb.ChatRoomService.Delete:input_type -> pb.ChatRoomDelRequest
6, // 10: pb.ChatRoomService.Info:input_type -> pb.ChatRoomInfoRequest
8, // 11: pb.ChatRoomService.All:input_type -> pb.ChatRoomAllRequest
1, // 12: pb.ChatRoomService.Add:output_type -> pb.ChatRoomAddReply
3, // 13: pb.ChatRoomService.Update:output_type -> pb.ChatRoomUpdateReply
5, // 14: pb.ChatRoomService.Delete:output_type -> pb.ChatRoomDelReply
7, // 15: pb.ChatRoomService.Info:output_type -> pb.ChatRoomInfoReply
9, // 16: pb.ChatRoomService.All:output_type -> pb.GetChatRoomsReply
12, // [12:17] is the sub-list for method output_type
7, // [7:12] is the sub-list for method input_type
7, // [7:7] is the sub-list for extension type_name
7, // [7:7] is the sub-list for extension extendee
0, // [0:7] is the sub-list for field type_name
}
func init() { file_u_proto_im_chat_room_proto_init() }
func file_u_proto_im_chat_room_proto_init() {
if File_u_proto_im_chat_room_proto != nil {
return
}
file_u_proto_common_proto_init()
if !protoimpl.UnsafeEnabled {
file_u_proto_im_chat_room_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ChatRoomAddRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_u_proto_im_chat_room_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ChatRoomAddReply); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_u_proto_im_chat_room_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ChatRoomUpdateRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_u_proto_im_chat_room_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ChatRoomUpdateReply); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_u_proto_im_chat_room_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ChatRoomDelRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_u_proto_im_chat_room_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ChatRoomDelReply); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_u_proto_im_chat_room_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ChatRoomInfoRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_u_proto_im_chat_room_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ChatRoomInfoReply); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_u_proto_im_chat_room_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ChatRoomAllRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_u_proto_im_chat_room_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GetChatRoomsReply); 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_u_proto_im_chat_room_proto_rawDesc,
NumEnums: 0,
NumMessages: 10,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_u_proto_im_chat_room_proto_goTypes,
DependencyIndexes: file_u_proto_im_chat_room_proto_depIdxs,
MessageInfos: file_u_proto_im_chat_room_proto_msgTypes,
}.Build()
File_u_proto_im_chat_room_proto = out.File
file_u_proto_im_chat_room_proto_rawDesc = nil
file_u_proto_im_chat_room_proto_goTypes = nil
file_u_proto_im_chat_room_proto_depIdxs = nil
}
// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConnInterface
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion6
// ChatRoomServiceClient is the client API for ChatRoomService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type ChatRoomServiceClient interface {
Add(ctx context.Context, in *ChatRoomAddRequest, opts ...grpc.CallOption) (*ChatRoomAddReply, error)
Update(ctx context.Context, in *ChatRoomUpdateRequest, opts ...grpc.CallOption) (*ChatRoomUpdateReply, error)
Delete(ctx context.Context, in *ChatRoomDelRequest, opts ...grpc.CallOption) (*ChatRoomDelReply, error)
Info(ctx context.Context, in *ChatRoomInfoRequest, opts ...grpc.CallOption) (*ChatRoomInfoReply, error)
All(ctx context.Context, in *ChatRoomAllRequest, opts ...grpc.CallOption) (*GetChatRoomsReply, error)
}
type chatRoomServiceClient struct {
cc grpc.ClientConnInterface
}
func NewChatRoomServiceClient(cc grpc.ClientConnInterface) ChatRoomServiceClient {
return &chatRoomServiceClient{cc}
}
func (c *chatRoomServiceClient) Add(ctx context.Context, in *ChatRoomAddRequest, opts ...grpc.CallOption) (*ChatRoomAddReply, error) {
out := new(ChatRoomAddReply)
err := c.cc.Invoke(ctx, "/pb.ChatRoomService/Add", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *chatRoomServiceClient) Update(ctx context.Context, in *ChatRoomUpdateRequest, opts ...grpc.CallOption) (*ChatRoomUpdateReply, error) {
out := new(ChatRoomUpdateReply)
err := c.cc.Invoke(ctx, "/pb.ChatRoomService/Update", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *chatRoomServiceClient) Delete(ctx context.Context, in *ChatRoomDelRequest, opts ...grpc.CallOption) (*ChatRoomDelReply, error) {
out := new(ChatRoomDelReply)
err := c.cc.Invoke(ctx, "/pb.ChatRoomService/Delete", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *chatRoomServiceClient) Info(ctx context.Context, in *ChatRoomInfoRequest, opts ...grpc.CallOption) (*ChatRoomInfoReply, error) {
out := new(ChatRoomInfoReply)
err := c.cc.Invoke(ctx, "/pb.ChatRoomService/Info", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *chatRoomServiceClient) All(ctx context.Context, in *ChatRoomAllRequest, opts ...grpc.CallOption) (*GetChatRoomsReply, error) {
out := new(GetChatRoomsReply)
err := c.cc.Invoke(ctx, "/pb.ChatRoomService/All", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// ChatRoomServiceServer is the server API for ChatRoomService service.
type ChatRoomServiceServer interface {
Add(context.Context, *ChatRoomAddRequest) (*ChatRoomAddReply, error)
Update(context.Context, *ChatRoomUpdateRequest) (*ChatRoomUpdateReply, error)
Delete(context.Context, *ChatRoomDelRequest) (*ChatRoomDelReply, error)
Info(context.Context, *ChatRoomInfoRequest) (*ChatRoomInfoReply, error)
All(context.Context, *ChatRoomAllRequest) (*GetChatRoomsReply, error)
}
// UnimplementedChatRoomServiceServer can be embedded to have forward compatible implementations.
type UnimplementedChatRoomServiceServer struct {
}
func (*UnimplementedChatRoomServiceServer) Add(context.Context, *ChatRoomAddRequest) (*ChatRoomAddReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method Add not implemented")
}
func (*UnimplementedChatRoomServiceServer) Update(context.Context, *ChatRoomUpdateRequest) (*ChatRoomUpdateReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method Update not implemented")
}
func (*UnimplementedChatRoomServiceServer) Delete(context.Context, *ChatRoomDelRequest) (*ChatRoomDelReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented")
}
func (*UnimplementedChatRoomServiceServer) Info(context.Context, *ChatRoomInfoRequest) (*ChatRoomInfoReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method Info not implemented")
}
func (*UnimplementedChatRoomServiceServer) All(context.Context, *ChatRoomAllRequest) (*GetChatRoomsReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method All not implemented")
}
func RegisterChatRoomServiceServer(s *grpc.Server, srv ChatRoomServiceServer) {
s.RegisterService(&_ChatRoomService_serviceDesc, srv)
}
func _ChatRoomService_Add_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ChatRoomAddRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ChatRoomServiceServer).Add(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/pb.ChatRoomService/Add",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ChatRoomServiceServer).Add(ctx, req.(*ChatRoomAddRequest))
}
return interceptor(ctx, in, info, handler)
}
func _ChatRoomService_Update_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ChatRoomUpdateRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ChatRoomServiceServer).Update(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/pb.ChatRoomService/Update",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ChatRoomServiceServer).Update(ctx, req.(*ChatRoomUpdateRequest))
}
return interceptor(ctx, in, info, handler)
}
func _ChatRoomService_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ChatRoomDelRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ChatRoomServiceServer).Delete(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/pb.ChatRoomService/Delete",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ChatRoomServiceServer).Delete(ctx, req.(*ChatRoomDelRequest))
}
return interceptor(ctx, in, info, handler)
}
func _ChatRoomService_Info_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ChatRoomInfoRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ChatRoomServiceServer).Info(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/pb.ChatRoomService/Info",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ChatRoomServiceServer).Info(ctx, req.(*ChatRoomInfoRequest))
}
return interceptor(ctx, in, info, handler)
}
func _ChatRoomService_All_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ChatRoomAllRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ChatRoomServiceServer).All(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/pb.ChatRoomService/All",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ChatRoomServiceServer).All(ctx, req.(*ChatRoomAllRequest))
}
return interceptor(ctx, in, info, handler)
}
var _ChatRoomService_serviceDesc = grpc.ServiceDesc{
ServiceName: "pb.ChatRoomService",
HandlerType: (*ChatRoomServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "Add",
Handler: _ChatRoomService_Add_Handler,
},
{
MethodName: "Update",
Handler: _ChatRoomService_Update_Handler,
},
{
MethodName: "Delete",
Handler: _ChatRoomService_Delete_Handler,
},
{
MethodName: "Info",
Handler: _ChatRoomService_Info_Handler,
},
{
MethodName: "All",
Handler: _ChatRoomService_All_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "u-proto/im_chat_room.proto",
}
package im_chat_room
import (
"context"
"im-microservice/db"
"im-microservice/helper"
"im-microservice/pb"
vs "im-microservice/validator_struct"
)
type ImChatRoomService struct {
pb.UnimplementedChatRoomServiceServer
}
func (cr *ImChatRoomService) Add(ctx context.Context, in *pb.ChatRoomAddRequest) (reply *pb.ChatRoomAddReply, err error) {
chat_room_struct := vs.NewAddChatRoom(in)
if err = helper.Valiator(chat_room_struct); err != nil {
return
}
room_id, err := helper.AddChatRoom(chat_room_struct)
if err != nil {
return
}
reply = &pb.ChatRoomAddReply{}
reply.Id = room_id
return
}
func (cr *ImChatRoomService) Update(ctx context.Context, in *pb.ChatRoomUpdateRequest) (reply *pb.ChatRoomUpdateReply, err error) {
chat_room_struct := vs.NewChatRoomUpdate(in)
if err = helper.Valiator(chat_room_struct); err != nil {
return
}
if err = helper.UpdateChatRoom(chat_room_struct); err != nil {
return
}
reply = &pb.ChatRoomUpdateReply{}
return
}
func (cr *ImChatRoomService) Delete(ctx context.Context, in *pb.ChatRoomDelRequest) (reply *pb.ChatRoomDelReply, err error) {
chat_room_struct := vs.NewChatRoomDel(in)
if err = helper.Valiator(chat_room_struct); err != nil {
return
}
if err = helper.DeleteChatRoom(chat_room_struct.RoomId); err != nil {
return
}
reply = &pb.ChatRoomDelReply{}
return
}
func (cr *ImChatRoomService) Info(ctx context.Context, in *pb.ChatRoomInfoRequest) (reply *pb.ChatRoomInfoReply, err error) {
chat_room_struct := vs.NewChatRoomInfo(in)
if err = helper.Valiator(chat_room_struct); err != nil {
return
}
db_chat_room, err := helper.ChatRoomInfo(chat_room_struct)
if err != nil {
return
}
reply = getchatroom(db_chat_room)
return
}
func getchatroom(room db.ImChatRoom) *pb.ChatRoomInfoReply {
return &pb.ChatRoomInfoReply{
RoomId: int64(room.Id),
Creator: room.Creator,
Name: room.Name,
Announcement: room.Announcement,
Status: int64(room.Status),
Ext: room.Ext,
Createtime: room.Createtime,
Updatetime: room.Updatetime,
}
}
func (cr *ImChatRoomService) All(ctx context.Context, in *pb.ChatRoomAllRequest) (reply *pb.GetChatRoomsReply, err error) {
results, err := helper.GetChatRooms(in)
if err != nil {
return
}
reply = &pb.GetChatRoomsReply{Paginate: &pb.Page{}}
db_rooms := results["list"].([]db.ImChatRoom)
for _, v := range db_rooms {
reply.List = append(reply.List, getchatroom(v))
}
reply.Paginate.PageSize = int64(results["page_size"].(int))
reply.Paginate.PagetNo = results["page"].(int64)
reply.Paginate.TotalCount = results["total_count"].(int64)
reply.Paginate.TotalPage = results["total_page"].(int64)
return
}
...@@ -55,7 +55,7 @@ func (cs *ConfigureSevice) Select(ctx context.Context, in *pb.GetAllRequest) (re ...@@ -55,7 +55,7 @@ func (cs *ConfigureSevice) Select(ctx context.Context, in *pb.GetAllRequest) (re
for _, v := range configs { for _, v := range configs {
reply.GetAll = append(reply.GetAll, &pb.GetAllOneReply{ reply.GetAll = append(reply.GetAll, &pb.GetAllOneReply{
Reply:&pb.Public{ Reply: &pb.Public{
CompanyUserId: v.CompanyUserId, CompanyUserId: v.CompanyUserId,
MultideviceType: v.MultideviceType, MultideviceType: v.MultideviceType,
MsgHookUrl: v.MsgHookUrl, MsgHookUrl: v.MsgHookUrl,
...@@ -66,7 +66,6 @@ func (cs *ConfigureSevice) Select(ctx context.Context, in *pb.GetAllRequest) (re ...@@ -66,7 +66,6 @@ func (cs *ConfigureSevice) Select(ctx context.Context, in *pb.GetAllRequest) (re
return return
} }
func (cs *ConfigureSevice) Update(ctx context.Context, in *pb.UpdateRequest) (reply *pb.ConfigureReply, err error) { func (cs *ConfigureSevice) Update(ctx context.Context, in *pb.UpdateRequest) (reply *pb.ConfigureReply, err error) {
configure_add_struct := vs.NewConfigureUpdateStruct(in) configure_add_struct := vs.NewConfigureUpdateStruct(in)
...@@ -80,4 +79,3 @@ func (cs *ConfigureSevice) Update(ctx context.Context, in *pb.UpdateRequest) (re ...@@ -80,4 +79,3 @@ func (cs *ConfigureSevice) Update(ctx context.Context, in *pb.UpdateRequest) (re
reply = &pb.ConfigureReply{} reply = &pb.ConfigureReply{}
return return
} }
\ No newline at end of file
...@@ -8,3 +8,10 @@ message Common { ...@@ -8,3 +8,10 @@ message Common {
string Curtime = 3; string Curtime = 3;
string Checksum = 4; string Checksum = 4;
} }
message Page {
int64 PagetNo = 1;
int64 PageSize = 2;
int64 TotalPage = 3;
int64 TotalCount = 4;
}
\ No newline at end of file
...@@ -42,5 +42,5 @@ service ConfigureSevice{ ...@@ -42,5 +42,5 @@ service ConfigureSevice{
rpc Select(GetAllRequest) returns(GetAllReply) {} rpc Select(GetAllRequest) returns(GetAllReply) {}
rpc Add (ConfigureRequest) returns(ConfigureReply) {} rpc Add (ConfigureRequest) returns(ConfigureReply) {}
rpc Delete(ConfigureDelRequest) returns(ConfigureReply) {} rpc Delete(ConfigureDelRequest) returns(ConfigureReply) {}
rpc Update(UpdateRequest) returns(ConfigureReply) {} rpc Update(UpdateRequest) returns(GetAllReply) {}
} }
syntax = "proto3";
package pb;
import "u-proto/common.proto";
// 添加聊天室
message ChatRoomAddRequest {
Common Common = 1;
string Creator = 2;
string Name = 3;
string Announcement = 4;
}
message ChatRoomAddReply{
int64 Id = 1;
}
// 更新聊天室
message ChatRoomUpdateRequest {
Common Common = 1;
int64 RoomId = 2;
string Name = 3;
int64 Status = 4;
string Announcement = 5;
}
message ChatRoomUpdateReply {}
// 删除聊天室
message ChatRoomDelRequest {
Common Common = 1;
int64 RoomId = 2;
}
message ChatRoomDelReply {}
// 获取单个聊天室信息
message ChatRoomInfoRequest {
Common Common = 1;
int64 RoomId = 2;
}
message ChatRoomInfoReply {
int64 Room_id = 1;
string Creator = 2;
string Name = 3;
string Announcement = 4;
int64 Status = 5;
string Ext = 6;
string Createtime = 7;
string Updatetime = 8;
}
// 获取所有房间
message ChatRoomAllRequest {
Common Common = 1;
int64 Page = 2;
string Creator = 3;
string Name = 4;
string Announcement = 5;
int64 Status = 6;
string Createtime = 7;
string Updatetime = 8;
}
message GetChatRoomsReply {
repeated ChatRoomInfoReply List = 1;
Page Paginate = 2;
}
service ChatRoomService {
rpc Add(ChatRoomAddRequest) returns(ChatRoomAddReply) {}
rpc Update(ChatRoomUpdateRequest) returns(ChatRoomUpdateReply) {}
rpc Delete(ChatRoomDelRequest) returns(ChatRoomDelReply) {}
rpc Info(ChatRoomInfoRequest) returns (ChatRoomInfoReply) {}
rpc All(ChatRoomAllRequest) returns (GetChatRoomsReply) {}
}
\ No newline at end of file
...@@ -2,38 +2,102 @@ package validator_struct ...@@ -2,38 +2,102 @@ package validator_struct
import "im-microservice/pb" import "im-microservice/pb"
// 添加配置的参数检测
type ConfigureAddStruct struct { type ConfigureAddStruct struct {
CompanyUserId int64 `validate:"required,numeric"` CompanyUserId int64 `validate:"required,numeric"`
MultideviceType int64 `validate:"required,numeric"` MultideviceType int64 `validate:"required,numeric"`
MsgHookUrl string `validate:"required"` MsgHookUrl string `validate:"required"`
} }
func NewConfigureAddStruct(in *pb.ConfigureRequest) *ConfigureAddStruct {
return &ConfigureAddStruct{
CompanyUserId: in.Public.GetCompanyUserId(),
MultideviceType: in.Public.GetMultideviceType(),
MsgHookUrl: in.Public.GetMsgHookUrl(),
}
}
// 修改配置
type ConfigureUpdateStruct struct { type ConfigureUpdateStruct struct {
CompanyUserId int64 `validate:"required,numeric"` CompanyUserId int64 `validate:"required,numeric"`
MultideviceType int64 MultideviceType int64
MsgHookUrl string MsgHookUrl string
} }
type ConfigureDelStruct struct { func NewConfigureUpdateStruct(in *pb.UpdateRequest) *ConfigureUpdateStruct {
CompanyUserId int64 `validate:"required,numeric"` return &ConfigureUpdateStruct{
}
func NewConfigureAddStruct(in *pb.ConfigureRequest) *ConfigureAddStruct {
return &ConfigureAddStruct{
CompanyUserId: in.Public.GetCompanyUserId(), CompanyUserId: in.Public.GetCompanyUserId(),
MultideviceType: in.Public.GetMultideviceType(), MultideviceType: in.Public.GetMultideviceType(),
MsgHookUrl: in.Public.GetMsgHookUrl(), MsgHookUrl: in.Public.GetMsgHookUrl(),
} }
} }
// 删除配置
type ConfigureDelStruct struct {
CompanyUserId int64 `validate:"required,numeric"`
}
func NewConfigureDelStruct(in *pb.ConfigureDelRequest) *ConfigureDelStruct { func NewConfigureDelStruct(in *pb.ConfigureDelRequest) *ConfigureDelStruct {
return &ConfigureDelStruct{CompanyUserId: in.GetCompanyUserId()} return &ConfigureDelStruct{CompanyUserId: in.GetCompanyUserId()}
} }
func NewConfigureUpdateStruct(in *pb.UpdateRequest) *ConfigureUpdateStruct { // 创建聊天室
return &ConfigureUpdateStruct{
CompanyUserId: in.Public.GetCompanyUserId(), type ChatRoomAddStruct struct {
MultideviceType: in.Public.GetMultideviceType(), Creator string `validate:"required"`
MsgHookUrl: in.Public.GetMsgHookUrl(), Name string `validate:"required"`
Announcement string `validate:"required"`
}
func NewAddChatRoom(in *pb.ChatRoomAddRequest) *ChatRoomAddStruct {
return &ChatRoomAddStruct{
Creator: in.GetCreator(),
Name: in.GetName(),
Announcement: in.GetAnnouncement(),
}
}
// 修改聊天室
type ChatRoomUpdate struct {
RoomId int64 `validate:"required"`
Name string
Announcement string
Status int64
}
func NewChatRoomUpdate(in *pb.ChatRoomUpdateRequest) *ChatRoomUpdate {
return &ChatRoomUpdate{
RoomId: in.GetRoomId(),
Name: in.GetName(),
Announcement: in.GetAnnouncement(),
Status: in.GetStatus(),
} }
} }
// 删除聊天室
type ChatRoomDel struct {
RoomId int64 `validate:"required"`
}
func NewChatRoomDel(in *pb.ChatRoomDelRequest) *ChatRoomDel {
return &ChatRoomDel{RoomId: in.GetRoomId()}
}
// 获取单个聊天室
type ChatRoomInfo struct {
RoomId int64 `validate:"required"`
Creator string
Name string
Announcement string
Status int64
Ext string
Createtime string
Updatetime string
}
func NewChatRoomInfo(in *pb.ChatRoomInfoRequest) *ChatRoomInfo {
return &ChatRoomInfo{RoomId: in.GetRoomId()}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment