Commit 79dee922 by Li Feifei

add protobuf file

parent 7b3f643c
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: u-proto/im_chat_room_user.proto
package pb
import (
fmt "fmt"
math "math"
proto "github.com/golang/protobuf/proto"
_ "github.com/mwitkow/go-proto-validators"
github_com_mwitkow_go_proto_validators "github.com/mwitkow/go-proto-validators"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
func (this *RoomUserAddOpeRequest) Validate() error {
if this.Common != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Common); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Common", err)
}
}
if !(this.RoomId > 0) {
return github_com_mwitkow_go_proto_validators.FieldError("RoomId", fmt.Errorf(`value '%v' must be greater than '0'`, this.RoomId))
}
if this.Operator == "" {
return github_com_mwitkow_go_proto_validators.FieldError("Operator", fmt.Errorf(`value '%v' must not be an empty string`, this.Operator))
}
return nil
}
func (this *RoomUserAddRequest) Validate() error {
if this.Common != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Common); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Common", err)
}
}
if !(this.RoomId > 0) {
return github_com_mwitkow_go_proto_validators.FieldError("RoomId", fmt.Errorf(`value '%v' must be greater than '0'`, this.RoomId))
}
if this.Accid == "" {
return github_com_mwitkow_go_proto_validators.FieldError("Accid", fmt.Errorf(`value '%v' must not be an empty string`, this.Accid))
}
return nil
}
func (this *RoomUserSetRoleRequest) Validate() error {
if this.Common != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Common); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Common", err)
}
}
if !(this.RoomId > 0) {
return github_com_mwitkow_go_proto_validators.FieldError("RoomId", fmt.Errorf(`value '%v' must be greater than '0'`, this.RoomId))
}
if this.Operator == "" {
return github_com_mwitkow_go_proto_validators.FieldError("Operator", fmt.Errorf(`value '%v' must not be an empty string`, this.Operator))
}
if this.Accid == "" {
return github_com_mwitkow_go_proto_validators.FieldError("Accid", fmt.Errorf(`value '%v' must not be an empty string`, this.Accid))
}
if !(this.Role > 0) {
return github_com_mwitkow_go_proto_validators.FieldError("Role", fmt.Errorf(`value '%v' must be greater than '0'`, this.Role))
}
if !(this.Role < 5) {
return github_com_mwitkow_go_proto_validators.FieldError("Role", fmt.Errorf(`value '%v' must be less than '5'`, this.Role))
}
return nil
}
func (this *RoomUserReply) Validate() error {
return nil
}
func (this *RoomUserOneRequest) Validate() error {
if this.Common != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Common); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Common", err)
}
}
if !(this.RoomId > 0) {
return github_com_mwitkow_go_proto_validators.FieldError("RoomId", fmt.Errorf(`value '%v' must be greater than '0'`, this.RoomId))
}
if this.Accid == "" {
return github_com_mwitkow_go_proto_validators.FieldError("Accid", fmt.Errorf(`value '%v' must not be an empty string`, this.Accid))
}
return nil
}
func (this *RoomUserOneReply) Validate() error {
return nil
}
func (this *RoomUserListRequest) Validate() error {
if this.Common != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Common); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Common", err)
}
}
return nil
}
func (this *RoomUserListReply) Validate() error {
for _, item := range this.List {
if item != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(item); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("List", err)
}
}
}
if this.Paginate != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Paginate); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Paginate", err)
}
}
return nil
}
func (this *RoomUserDelReply) Validate() error {
return nil
}
...@@ -22,9 +22,6 @@ func (this *ImUserRequest) Validate() error { ...@@ -22,9 +22,6 @@ func (this *ImUserRequest) Validate() error {
return github_com_mwitkow_go_proto_validators.FieldError("Common", err) return github_com_mwitkow_go_proto_validators.FieldError("Common", err)
} }
} }
if this.Name == "" {
return github_com_mwitkow_go_proto_validators.FieldError("Name", fmt.Errorf(`value '%v' must not be an empty string`, this.Name))
}
if this.Mobile == "" { if this.Mobile == "" {
return github_com_mwitkow_go_proto_validators.FieldError("Mobile", fmt.Errorf(`value '%v' must not be an empty string`, this.Mobile)) return github_com_mwitkow_go_proto_validators.FieldError("Mobile", fmt.Errorf(`value '%v' must not be an empty string`, this.Mobile))
} }
......
syntax = "proto3";
package pb;
import "u-proto/common.proto";
import "github.com/mwitkow/go-proto-validators/validator.proto";
//添加操作者(创建者)
message RoomUserAddOpeRequest {
Common Common = 1;
int64 RoomId = 2[(validator.field) = {int_gt: 0}];
string Operator = 3[(validator.field) = {string_not_empty: true}];
}
//添加用户
message RoomUserAddRequest{
Common Common = 1;
int64 RoomId = 2[(validator.field) = {int_gt: 0}];
string Accid = 4[(validator.field) = {string_not_empty: true}];
}
//设置权限
message RoomUserSetRoleRequest {
Common Common = 1;
int64 RoomId = 2[(validator.field) = {int_gt: 0}];
string Operator = 3[(validator.field) = {string_not_empty: true}];
string Accid = 4[(validator.field) = {string_not_empty: true}];
int64 Role = 5[(validator.field) = {int_gt: 0, int_lt: 5}];
}
//设置用户返回
message RoomUserReply {
int64 RoomId = 1;
string Operator = 2;
string Accid = 3;
int64 Role = 4;
}
//获取房间单个用户属性
message RoomUserOneRequest {
Common Common = 1;
int64 RoomId = 2[(validator.field) = {int_gt: 0}];
string Accid = 3[(validator.field) = {string_not_empty: true}];
}
//返回房间单个用户属性
message RoomUserOneReply {
int64 Id = 1;
int64 RoomId = 2;
string Operator = 3;
string Accid = 4;
int64 Role = 5;
string Createtime = 6;
string Updatetime = 7;
}
//获取房间用户列表
message RoomUserListRequest {
Common Common = 1;
int64 Page = 2;
int64 RoomId = 3;
int64 Role = 4;
string Accid = 5;
}
//返回房间用户列表
message RoomUserListReply {
repeated RoomUserOneReply List = 1;
Page Paginate = 2;
}
//删除房间用户
message RoomUserDelReply {}
service ChatRoomUser {
rpc AddOperator(RoomUserAddOpeRequest) returns(RoomUserReply) {}
rpc ChatRoomUserAdd(RoomUserAddRequest) returns(RoomUserReply) {}
rpc ChatRoomUserSetRole(RoomUserSetRoleRequest) returns(RoomUserReply) {}
rpc ChatRoomUserOne(RoomUserOneRequest) returns(RoomUserOneReply) {}
rpc ChatRoomUserList(RoomUserListRequest) returns(RoomUserListReply) {}
rpc ChatRoomUserDel(RoomUserOneRequest) returns(RoomUserDelReply){}
}
\ No newline at end of file
...@@ -8,7 +8,7 @@ import "github.com/mwitkow/go-proto-validators/validator.proto"; ...@@ -8,7 +8,7 @@ import "github.com/mwitkow/go-proto-validators/validator.proto";
//注册登录 //注册登录
message ImUserRequest { message ImUserRequest {
Common Common = 1; Common Common = 1;
string Name = 2[(validator.field) = {string_not_empty: true}]; string Name = 2;
string Mobile = 3[(validator.field) = {string_not_empty: true, length_eq: 11}]; string Mobile = 3[(validator.field) = {string_not_empty: true, length_eq: 11}];
string Code = 4[(validator.field) = {string_not_empty: true}]; string Code = 4[(validator.field) = {string_not_empty: true}];
string Platform = 5[(validator.field) = {string_not_empty: true}]; string Platform = 5[(validator.field) = {string_not_empty: true}];
......
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