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
21ffb012
Commit
21ffb012
authored
Jul 01, 2020
by
李洪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改用户退出
parent
e70a663b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
15 deletions
+8
-15
im_user.go
sevice/im_user/im_user.go
+8
-4
im_user_db.go
sevice/im_user/im_user_db.go
+0
-11
No files found.
sevice/im_user/im_user.go
View file @
21ffb012
...
@@ -110,7 +110,13 @@ func (u *ImUserServer) ImUserLoginOut(ctx context.Context, in *pb.ImUserOutReque
...
@@ -110,7 +110,13 @@ func (u *ImUserServer) ImUserLoginOut(ctx context.Context, in *pb.ImUserOutReque
imUserOut
:=
&
ImUserQ
{
imUserOut
:=
&
ImUserQ
{
Accid
:
in
.
GetAccid
(),
Accid
:
in
.
GetAccid
(),
}
}
if
res
,
_
:=
SaveLoginOut
(
imUserOut
.
Accid
);
res
!=
1
{
// 参数验证是否合法
if
err
=
helper
.
Valiator
(
imUserOut
);
err
!=
nil
{
return
}
m
:=
make
(
map
[
string
]
interface
{})
m
[
"login_status"
]
=
0
if
res
,
_
:=
UpdateImUser
(
imUserOut
.
Accid
,
m
);
res
!=
1
{
err
=
errors
.
New
(
"用户更改登录状态信息失败"
)
err
=
errors
.
New
(
"用户更改登录状态信息失败"
)
return
return
}
}
...
@@ -136,11 +142,9 @@ func (u *ImUserServer) ImUserForbiddenWords(ctx context.Context, in *pb.ImUserSe
...
@@ -136,11 +142,9 @@ func (u *ImUserServer) ImUserForbiddenWords(ctx context.Context, in *pb.ImUserSe
//用户禁音视频
//用户禁音视频
func
(
u
*
ImUserServer
)
ImUserForbiddenAV
(
ctx
context
.
Context
,
in
*
pb
.
ImUserSetRequest
)
(
reply
*
pb
.
ImUserSetReply
,
err
error
)
{
func
(
u
*
ImUserServer
)
ImUserForbiddenAV
(
ctx
context
.
Context
,
in
*
pb
.
ImUserSetRequest
)
(
reply
*
pb
.
ImUserSetReply
,
err
error
)
{
var
mute
int64
var
mute
int64
=
0
if
in
.
GetMute
()
==
true
{
if
in
.
GetMute
()
==
true
{
mute
=
1
mute
=
1
}
else
{
mute
=
0
}
}
m
:=
make
(
map
[
string
]
interface
{})
m
:=
make
(
map
[
string
]
interface
{})
m
[
"mute_audio_video"
]
=
mute
m
[
"mute_audio_video"
]
=
mute
...
...
sevice/im_user/im_user_db.go
View file @
21ffb012
...
@@ -65,17 +65,6 @@ func SaveUpdatetime(mobile string, platfrom string) (int64, error) {
...
@@ -65,17 +65,6 @@ func SaveUpdatetime(mobile string, platfrom string) (int64, error) {
return
res
,
nil
return
res
,
nil
}
}
//用户退出
func
SaveLoginOut
(
accid
string
)
(
int64
,
error
)
{
orm_params
:=
make
(
orm
.
Params
)
orm_params
[
"login_status"
]
=
0
res
,
err
:=
db
.
MysqlClient
.
QueryTable
(
u_table_name
)
.
Filter
(
"accid"
,
accid
)
.
Update
(
orm_params
)
if
err
!=
nil
{
return
0
,
err
}
return
res
,
nil
}
//修改用户信息
//修改用户信息
func
UpdateImUser
(
accid
string
,
m
map
[
string
]
interface
{})
(
int64
,
error
)
{
func
UpdateImUser
(
accid
string
,
m
map
[
string
]
interface
{})
(
int64
,
error
)
{
orm_params
:=
make
(
orm
.
Params
)
orm_params
:=
make
(
orm
.
Params
)
...
...
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