Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
im-microservice
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Li Feifei
im-microservice
Commits
9b3c1fbf
Commit
9b3c1fbf
authored
Jul 06, 2020
by
Li Feifei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add im_user proto file
parent
3695817c
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
118 additions
and
7 deletions
+118
-7
im_user.pb.go
pb/im_user.pb.go
+0
-0
im_user.validator.pb.go
pb/im_user.validator.pb.go
+109
-0
im_user.proto
u-proto/im_user.proto
+9
-7
No files found.
pb/im_user.pb.go
View file @
9b3c1fbf
This diff is collapsed.
Click to expand it.
pb/im_user.validator.pb.go
0 → 100644
View file @
9b3c1fbf
// 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
}
u-proto/im_user.proto
View file @
9b3c1fbf
...
...
@@ -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
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment