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
f0deae1c
Commit
f0deae1c
authored
Jul 07, 2020
by
李洪
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' of
http://gitlab.offcncloud.com/lff58407/im-microservice
into develop
parents
11320ac5
b5af48d0
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
71 additions
and
41 deletions
+71
-41
db_struct.go
db/db_struct.go
+1
-0
app_db.go
helper/app_db.go
+6
-0
im_base.pb.go
pb/im_base.pb.go
+50
-41
im_base.validator.pb.go
pb/im_base.validator.pb.go
+3
-0
db.go
sevice/im_configure/db.go
+1
-0
main.go
sevice/im_configure/main.go
+4
-0
im_base.proto
u-proto/im_base.proto
+1
-0
validator_strucut.go
validator_struct/validator_strucut.go
+5
-0
No files found.
db/db_struct.go
View file @
f0deae1c
...
...
@@ -10,6 +10,7 @@ type CompanyApp struct {
type
ImBase
struct
{
Id
int
AppId
int
CompanyUserId
int64
MultideviceType
int64
MsgHookUrl
string
...
...
helper/app_db.go
View file @
f0deae1c
...
...
@@ -18,3 +18,8 @@ func GetSecretByKey(key string) (error, string) {
}
return
nil
,
u_app
.
Secret
}
func
AppIsExit
(
appid
int64
)
bool
{
return
db
.
MysqlClient
.
QueryTable
(
table_name
)
.
Filter
(
"id"
,
appid
)
.
Exist
()
}
\ No newline at end of file
pb/im_base.pb.go
View file @
f0deae1c
...
...
@@ -100,6 +100,7 @@ type ConfigureRequest struct {
Common
*
Common
`protobuf:"bytes,1,opt,name=Common,proto3" json:"Common,omitempty"`
Public
*
Public
`protobuf:"bytes,2,opt,name=Public,proto3" json:"Public,omitempty"`
AppId
int64
`protobuf:"varint,3,opt,name=AppId,proto3" json:"AppId,omitempty"`
}
func
(
x
*
ConfigureRequest
)
Reset
()
{
...
...
@@ -148,6 +149,13 @@ func (x *ConfigureRequest) GetPublic() *Public {
return
nil
}
func
(
x
*
ConfigureRequest
)
GetAppId
()
int64
{
if
x
!=
nil
{
return
x
.
AppId
}
return
0
}
type
ConfigureReply
struct
{
state
protoimpl
.
MessageState
sizeCache
protoimpl
.
SizeCache
...
...
@@ -454,51 +462,52 @@ var file_u_proto_im_base_proto_rawDesc = []byte{
0x28
,
0x03
,
0x52
,
0x0f
,
0x4d
,
0x75
,
0x6c
,
0x74
,
0x69
,
0x64
,
0x65
,
0x76
,
0x69
,
0x63
,
0x65
,
0x54
,
0x79
,
0x70
,
0x65
,
0x12
,
0x1e
,
0x0a
,
0x0a
,
0x4d
,
0x73
,
0x67
,
0x48
,
0x6f
,
0x6f
,
0x6b
,
0x55
,
0x72
,
0x6c
,
0x18
,
0x03
,
0x20
,
0x01
,
0x28
,
0x09
,
0x52
,
0x0a
,
0x4d
,
0x73
,
0x67
,
0x48
,
0x6f
,
0x6f
,
0x6b
,
0x55
,
0x72
,
0x6c
,
0x22
,
0x
5a
,
0x0a
,
0x10
,
0x43
,
0x6f
,
0x6e
,
0x66
,
0x69
,
0x67
,
0x75
,
0x72
,
0x65
,
0x55
,
0x72
,
0x6c
,
0x22
,
0x
78
,
0x0a
,
0x10
,
0x43
,
0x6f
,
0x6e
,
0x66
,
0x69
,
0x67
,
0x75
,
0x72
,
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
,
0x22
,
0x0a
,
0x06
,
0x50
,
0x75
,
0x62
,
0x6c
,
0x69
,
0x63
,
0x18
,
0x02
,
0x20
,
0x01
,
0x28
,
0x0b
,
0x32
,
0x0a
,
0x2e
,
0x70
,
0x62
,
0x2e
,
0x50
,
0x75
,
0x62
,
0x6c
,
0x69
,
0x63
,
0x52
,
0x06
,
0x50
,
0x75
,
0x62
,
0x6c
,
0x69
,
0x63
,
0x22
,
0x10
,
0x0a
,
0x0e
,
0x43
,
0x6f
,
0x6e
,
0x66
,
0x69
,
0x67
,
0x75
,
0x72
,
0x65
,
0x52
,
0x65
,
0x70
,
0x6c
,
0x79
,
0x22
,
0x67
,
0x0a
,
0x13
,
0x43
,
0x6f
,
0x6e
,
0x66
,
0x69
,
0x67
,
0x75
,
0x72
,
0x65
,
0x44
,
0x65
,
0x6c
,
0x52
,
0x65
,
0x71
,
0x75
,
0x65
,
0x73
,
0x74
,
0x12
,
0x2c
,
0x0a
,
0x0d
,
0x43
,
0x6f
,
0x6d
,
0x70
,
0x61
,
0x6e
,
0x79
,
0x55
,
0x73
,
0x65
,
0x72
,
0x49
,
0x64
,
0x18
,
0x01
,
0x20
,
0x01
,
0x28
,
0x03
,
0x42
,
0x06
,
0xe2
,
0xdf
,
0x1f
,
0x02
,
0x10
,
0x00
,
0x52
,
0x0d
,
0x43
,
0x6f
,
0x6d
,
0x70
,
0x61
,
0x6e
,
0x79
,
0x55
,
0x73
,
0x65
,
0x72
,
0x49
,
0x64
,
0x12
,
0x22
,
0x0a
,
0x06
,
0x43
,
0x6f
,
0x6d
,
0x6d
,
0x6f
,
0x6e
,
0x18
,
0x02
,
0x20
,
0x01
,
0x28
,
0x0b
,
0x32
,
0x0a
,
0x2e
,
0x70
,
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74
,
0x41
,
0x6c
,
0x6c
,
0x4f
,
0x6e
,
0x65
,
0x52
,
0x65
,
0x70
,
0x6c
,
0x79
,
0x52
,
0x06
,
0x47
,
0x65
,
0x74
,
0x41
,
0x6c
,
0x6c
,
0x22
,
0x57
,
0x0a
,
0x0d
,
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
,
0x22
,
0x0a
,
0x06
,
0x50
,
0x75
,
0x62
,
0x6c
,
0x69
,
0x63
,
0x18
,
0x02
,
0x20
,
0x01
,
0x28
,
0x0b
,
0x32
,
0x0a
,
0x2e
,
0x70
,
0x62
,
0x2e
,
0x50
,
0x75
,
0x62
,
0x6c
,
0x69
,
0x63
,
0x52
,
0x06
,
0x50
,
0x75
,
0x62
,
0x6c
,
0x69
,
0x63
,
0x32
,
0xe0
,
0x01
,
0x0a
,
0x0f
,
0x43
,
0x6f
,
0x6e
,
0x66
,
0x69
,
0x67
,
0x75
,
0x72
,
0x65
,
0x53
,
0x65
,
0x76
,
0x69
,
0x63
,
0x65
,
0x12
,
0x2e
,
0x0a
,
0x06
,
0x53
,
0x65
,
0x6c
,
0x65
,
0x63
,
0x74
,
0x12
,
0x11
,
0x2e
,
0x70
,
0x62
,
0x2e
,
0x47
,
0x65
,
0x74
,
0x41
,
0x6c
,
0x6c
,
0x52
,
0x65
,
0x71
,
0x75
,
0x65
,
0x73
,
0x74
,
0x1a
,
0x0f
,
0x2e
,
0x70
,
0x62
,
0x2e
,
0x47
,
0x65
,
0x74
,
0x41
,
0x6c
,
0x6c
,
0x52
,
0x65
,
0x70
,
0x6c
,
0x79
,
0x22
,
0x00
,
0x12
,
0x31
,
0x0a
,
0x03
,
0x41
,
0x64
,
0x64
,
0x12
,
0x14
,
0x2e
,
0x70
,
0x62
,
0x2e
,
0x43
,
0x6f
,
0x6e
,
0x66
,
0x69
,
0x67
,
0x75
,
0x72
,
0x65
,
0x52
,
0x65
,
0x71
,
0x75
,
0x65
,
0x73
,
0x74
,
0x1a
,
0x12
,
0x2e
,
0x70
,
0x62
,
0x2e
,
0x43
,
0x6f
,
0x6e
,
0x66
,
0x69
,
0x67
,
0x75
,
0x72
,
0x65
,
0x52
,
0x65
,
0x70
,
0x6c
,
0x79
,
0x22
,
0x00
,
0x12
,
0x37
,
0x0a
,
0x06
,
0x44
,
0x65
,
0x6c
,
0x65
,
0x74
,
0x65
,
0x12
,
0x17
,
0x2e
,
0x70
,
0x62
,
0x2e
,
0x43
,
0x6f
,
0x6e
,
0x66
,
0x69
,
0x67
,
0x75
,
0x72
,
0x65
,
0x44
,
0x65
,
0x6c
,
0x52
,
0x65
,
0x71
,
0x75
,
0x65
,
0x73
,
0x74
,
0x1a
,
0x12
,
0x2e
,
0x70
,
0x62
,
0x2e
,
0x43
,
0x6f
,
0x6e
,
0x66
,
0x69
,
0x67
,
0x75
,
0x72
,
0x65
,
0x52
,
0x65
,
0x70
,
0x6c
,
0x79
,
0x22
,
0x00
,
0x12
,
0x31
,
0x0a
,
0x06
,
0x55
,
0x70
,
0x64
,
0x61
,
0x74
,
0x65
,
0x12
,
0x11
,
0x2e
,
0x70
,
0x62
,
0x2e
,
0x55
,
0x70
,
0x64
,
0x61
,
0x74
,
0x65
,
0x52
,
0x65
,
0x71
,
0x75
,
0x65
,
0x73
,
0x74
,
0x1a
,
0x12
,
0x2e
,
0x70
,
0x62
,
0x2e
,
0x43
,
0x6f
,
0x6e
,
0x66
,
0x69
,
0x67
,
0x75
,
0x72
,
0x65
,
0x52
,
0x65
,
0x70
,
0x6c
,
0x79
,
0x22
,
0x00
,
0x62
,
0x06
,
0x70
,
0x72
,
0x6f
,
0x74
,
0x6f
,
0x33
,
0x2e
,
0x50
,
0x75
,
0x62
,
0x6c
,
0x69
,
0x63
,
0x52
,
0x06
,
0x50
,
0x75
,
0x62
,
0x6c
,
0x69
,
0x63
,
0x12
,
0x1c
,
0x0a
,
0x05
,
0x41
,
0x70
,
0x70
,
0x49
,
0x64
,
0x18
,
0x03
,
0x20
,
0x01
,
0x28
,
0x03
,
0x42
,
0x06
,
0xe2
,
0xdf
,
0x1f
,
0x02
,
0x10
,
0x00
,
0x52
,
0x05
,
0x41
,
0x70
,
0x70
,
0x49
,
0x64
,
0x22
,
0x10
,
0x0a
,
0x0e
,
0x43
,
0x6f
,
0x6e
,
0x66
,
0x69
,
0x67
,
0x75
,
0x72
,
0x65
,
0x52
,
0x65
,
0x70
,
0x6c
,
0x79
,
0x22
,
0x67
,
0x0a
,
0x13
,
0x43
,
0x6f
,
0x6e
,
0x66
,
0x69
,
0x67
,
0x75
,
0x72
,
0x65
,
0x44
,
0x65
,
0x6c
,
0x52
,
0x65
,
0x71
,
0x75
,
0x65
,
0x73
,
0x74
,
0x12
,
0x2c
,
0x0a
,
0x0d
,
0x43
,
0x6f
,
0x6d
,
0x70
,
0x61
,
0x6e
,
0x79
,
0x55
,
0x73
,
0x65
,
0x72
,
0x49
,
0x64
,
0x18
,
0x01
,
0x20
,
0x01
,
0x28
,
0x03
,
0x42
,
0x06
,
0xe2
,
0xdf
,
0x1f
,
0x02
,
0x10
,
0x00
,
0x52
,
0x0d
,
0x43
,
0x6f
,
0x6d
,
0x70
,
0x61
,
0x6e
,
0x79
,
0x55
,
0x73
,
0x65
,
0x72
,
0x49
,
0x64
,
0x12
,
0x22
,
0x0a
,
0x06
,
0x43
,
0x6f
,
0x6d
,
0x6d
,
0x6f
,
0x6e
,
0x18
,
0x02
,
0x20
,
0x01
,
0x28
,
0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x70
,
0x62
,
0x2e
,
0x47
,
0x65
,
0x74
,
0x41
,
0x6c
,
0x6c
,
0x4f
,
0x6e
,
0x65
,
0x52
,
0x65
,
0x70
,
0x6c
,
0x79
,
0x52
,
0x06
,
0x47
,
0x65
,
0x74
,
0x41
,
0x6c
,
0x6c
,
0x22
,
0x57
,
0x0a
,
0x0d
,
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
,
0x22
,
0x0a
,
0x06
,
0x50
,
0x75
,
0x62
,
0x6c
,
0x69
,
0x63
,
0x18
,
0x02
,
0x20
,
0x01
,
0x28
,
0x0b
,
0x32
,
0x0a
,
0x2e
,
0x70
,
0x62
,
0x2e
,
0x50
,
0x75
,
0x62
,
0x6c
,
0x69
,
0x63
,
0x52
,
0x06
,
0x50
,
0x75
,
0x62
,
0x6c
,
0x69
,
0x63
,
0x32
,
0xe0
,
0x01
,
0x0a
,
0x0f
,
0x43
,
0x6f
,
0x6e
,
0x66
,
0x69
,
0x67
,
0x75
,
0x72
,
0x65
,
0x53
,
0x65
,
0x76
,
0x69
,
0x63
,
0x65
,
0x12
,
0x2e
,
0x0a
,
0x06
,
0x53
,
0x65
,
0x6c
,
0x65
,
0x63
,
0x74
,
0x12
,
0x11
,
0x2e
,
0x70
,
0x62
,
0x2e
,
0x47
,
0x65
,
0x74
,
0x41
,
0x6c
,
0x6c
,
0x52
,
0x65
,
0x71
,
0x75
,
0x65
,
0x73
,
0x74
,
0x1a
,
0x0f
,
0x2e
,
0x70
,
0x62
,
0x2e
,
0x47
,
0x65
,
0x74
,
0x41
,
0x6c
,
0x6c
,
0x52
,
0x65
,
0x70
,
0x6c
,
0x79
,
0x22
,
0x00
,
0x12
,
0x31
,
0x0a
,
0x03
,
0x41
,
0x64
,
0x64
,
0x12
,
0x14
,
0x2e
,
0x70
,
0x62
,
0x2e
,
0x43
,
0x6f
,
0x6e
,
0x66
,
0x69
,
0x67
,
0x75
,
0x72
,
0x65
,
0x52
,
0x65
,
0x71
,
0x75
,
0x65
,
0x73
,
0x74
,
0x1a
,
0x12
,
0x2e
,
0x70
,
0x62
,
0x2e
,
0x43
,
0x6f
,
0x6e
,
0x66
,
0x69
,
0x67
,
0x75
,
0x72
,
0x65
,
0x52
,
0x65
,
0x70
,
0x6c
,
0x79
,
0x22
,
0x00
,
0x12
,
0x37
,
0x0a
,
0x06
,
0x44
,
0x65
,
0x6c
,
0x65
,
0x74
,
0x65
,
0x12
,
0x17
,
0x2e
,
0x70
,
0x62
,
0x2e
,
0x43
,
0x6f
,
0x6e
,
0x66
,
0x69
,
0x67
,
0x75
,
0x72
,
0x65
,
0x44
,
0x65
,
0x6c
,
0x52
,
0x65
,
0x71
,
0x75
,
0x65
,
0x73
,
0x74
,
0x1a
,
0x12
,
0x2e
,
0x70
,
0x62
,
0x2e
,
0x43
,
0x6f
,
0x6e
,
0x66
,
0x69
,
0x67
,
0x75
,
0x72
,
0x65
,
0x52
,
0x65
,
0x70
,
0x6c
,
0x79
,
0x22
,
0x00
,
0x12
,
0x31
,
0x0a
,
0x06
,
0x55
,
0x70
,
0x64
,
0x61
,
0x74
,
0x65
,
0x12
,
0x11
,
0x2e
,
0x70
,
0x62
,
0x2e
,
0x55
,
0x70
,
0x64
,
0x61
,
0x74
,
0x65
,
0x52
,
0x65
,
0x71
,
0x75
,
0x65
,
0x73
,
0x74
,
0x1a
,
0x12
,
0x2e
,
0x70
,
0x62
,
0x2e
,
0x43
,
0x6f
,
0x6e
,
0x66
,
0x69
,
0x67
,
0x75
,
0x72
,
0x65
,
0x52
,
0x65
,
0x70
,
0x6c
,
0x79
,
0x22
,
0x00
,
0x62
,
0x06
,
0x70
,
0x72
,
0x6f
,
0x74
,
0x6f
,
0x33
,
}
var
(
...
...
pb/im_base.validator.pb.go
View file @
f0deae1c
...
...
@@ -30,6 +30,9 @@ func (this *ConfigureRequest) Validate() error {
return
github_com_mwitkow_go_proto_validators
.
FieldError
(
"Public"
,
err
)
}
}
if
!
(
this
.
AppId
>
0
)
{
return
github_com_mwitkow_go_proto_validators
.
FieldError
(
"AppId"
,
fmt
.
Errorf
(
`value '%v' must be greater than '0'`
,
this
.
AppId
))
}
return
nil
}
func
(
this
*
ConfigureReply
)
Validate
()
error
{
...
...
sevice/im_configure/db.go
View file @
f0deae1c
...
...
@@ -33,6 +33,7 @@ func AddImBase(im *validator_struct.ConfigureAddStruct) error {
configure
.
CompanyUserId
=
im
.
CompanyUserId
configure
.
MsgHookUrl
=
im
.
MsgHookUrl
configure
.
MultideviceType
=
im
.
MultideviceType
configure
.
AppId
=
int
(
im
.
AppId
)
_
,
err
:=
db
.
MysqlClient
.
Insert
(
configure
)
if
err
!=
nil
{
err
=
status
.
Error
(
codes
.
Internal
,
err
.
Error
())
...
...
sevice/im_configure/main.go
View file @
f0deae1c
...
...
@@ -27,6 +27,10 @@ func (cs *ConfigureSevice) Add(ctx context.Context,
err
=
errors
.
New
(
"已经添加过配置,无需再添加"
)
return
}
if
ok
:=
helper
.
AppIsExit
(
configure_add_struct
.
AppId
);
!
ok
{
err
=
errors
.
New
(
"appid不存在"
)
return
}
// 添加配置
if
err
=
AddImBase
(
configure_add_struct
);
err
!=
nil
{
return
...
...
u-proto/im_base.proto
View file @
f0deae1c
...
...
@@ -14,6 +14,7 @@ message Public {
message
ConfigureRequest
{
Common
Common
=
1
;
Public
Public
=
2
;
int64
AppId
=
3
[(
validator.field
)
=
{
int_gt
:
0
}];
}
message
ConfigureReply
{}
...
...
validator_struct/validator_strucut.go
View file @
f0deae1c
...
...
@@ -6,6 +6,7 @@ import "im-microservice/pb"
type
ConfigureAddStruct
struct
{
CompanyUserId
int64
`validate:"required,numeric"`
MultideviceType
int64
`validate:"required,numeric"`
AppId
int64
`validate:"required,numeric"`
MsgHookUrl
string
`validate:"required"`
}
...
...
@@ -17,6 +18,7 @@ func NewConfigureAddStruct(inter interface{}) *ConfigureAddStruct {
config
.
CompanyUserId
=
c
.
Public
.
GetCompanyUserId
()
config
.
MultideviceType
=
c
.
Public
.
GetMultideviceType
()
config
.
MsgHookUrl
=
c
.
Public
.
GetMsgHookUrl
()
config
.
AppId
=
c
.
AppId
case
map
[
string
]
interface
{}
:
var
c
=
inter
.
(
map
[
string
]
interface
{})
if
cui
,
ok
:=
c
[
"company_user_id"
]
.
(
int64
);
ok
{
...
...
@@ -28,6 +30,9 @@ func NewConfigureAddStruct(inter interface{}) *ConfigureAddStruct {
if
mhu
,
ok
:=
c
[
"msg_hook_url"
]
.
(
string
);
ok
{
config
.
MsgHookUrl
=
mhu
}
if
app_id
,
ok
:=
c
[
"app_id"
]
.
(
int64
);
ok
{
config
.
AppId
=
app_id
}
}
return
config
}
...
...
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