Commit 9b3c1fbf by Li Feifei

add im_user proto file

parent 3695817c
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: u-proto/im_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 *ImUserRequest) 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.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 == "" {
return github_com_mwitkow_go_proto_validators.FieldError("Mobile", fmt.Errorf(`value '%v' must not be an empty string`, this.Mobile))
}
if !(len(this.Mobile) == 11) {
return github_com_mwitkow_go_proto_validators.FieldError("Mobile", fmt.Errorf(`value '%v' must have a length equal to '11'`, this.Mobile))
}
if this.Code == "" {
return github_com_mwitkow_go_proto_validators.FieldError("Code", fmt.Errorf(`value '%v' must not be an empty string`, this.Code))
}
if this.Platform == "" {
return github_com_mwitkow_go_proto_validators.FieldError("Platform", fmt.Errorf(`value '%v' must not be an empty string`, this.Platform))
}
return nil
}
func (this *ImUserReply) Validate() error {
return nil
}
func (this *ImUserOutRequest) Validate() error {
if this.Common != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Common); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Common", err)
}
}
if this.Accid == "" {
return github_com_mwitkow_go_proto_validators.FieldError("Accid", fmt.Errorf(`value '%v' must not be an empty string`, this.Accid))
}
if this.Platform == "" {
return github_com_mwitkow_go_proto_validators.FieldError("Platform", fmt.Errorf(`value '%v' must not be an empty string`, this.Platform))
}
return nil
}
func (this *ImUserSetRequest) Validate() error {
if this.Common != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Common); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Common", err)
}
}
if this.Accid == "" {
return github_com_mwitkow_go_proto_validators.FieldError("Accid", fmt.Errorf(`value '%v' must not be an empty string`, this.Accid))
}
return nil
}
func (this *ImUserSetReply) Validate() error {
return nil
}
func (this *ImUserOneRequest) Validate() error {
if this.Common != nil {
if err := github_com_mwitkow_go_proto_validators.CallValidatorIfExists(this.Common); err != nil {
return github_com_mwitkow_go_proto_validators.FieldError("Common", err)
}
}
if this.Accid == "" {
return github_com_mwitkow_go_proto_validators.FieldError("Accid", fmt.Errorf(`value '%v' must not be an empty string`, this.Accid))
}
return nil
}
func (this *ImUserOneReply) Validate() error {
return nil
}
func (this *ImUserListRequest) 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 *ImUserListReply) 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
}
......@@ -3,14 +3,15 @@ syntax = "proto3";
package pb;
import "u-proto/common.proto";
import "github.com/mwitkow/go-proto-validators/validator.proto";
//注册登录
message ImUserRequest {
Common Common = 1;
string Name = 2;
string Mobile = 3;
string Code = 4;
string Platform = 5;
string Name = 2[(validator.field) = {string_not_empty: true}];
string Mobile = 3[(validator.field) = {string_not_empty: true, length_eq: 11}];
string Code = 4[(validator.field) = {string_not_empty: true}];
string Platform = 5[(validator.field) = {string_not_empty: true}];
}
message ImUserReply{
......@@ -21,14 +22,15 @@ message ImUserReply{
//用户退出
message ImUserOutRequest {
Common Common = 1;
string Accid = 2;
string Accid = 2[(validator.field) = {string_not_empty: true}];
string Platform = 3[(validator.field) = {string_not_empty: true}];
}
//用户设置禁言,禁音视频
message ImUserSetRequest {
Common Common = 1;
bool Mute = 2;
string Accid = 3;
string Accid = 3[(validator.field) = {string_not_empty: true}];
}
message ImUserSetReply {}
......@@ -36,7 +38,7 @@ message ImUserSetReply {}
//获取单个用户信息
message ImUserOneRequest {
Common Common = 1;
string Accid = 2;
string Accid = 2[(validator.field) = {string_not_empty: true}];
}
message ImUserOneReply {
......
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