Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
hilo-group
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
hujiebin
hilo-group
Commits
cd735ace
Commit
cd735ace
authored
Mar 24, 2023
by
hujiebin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "fix:修复获取用户信息的问题"
This reverts commit
b335e750
.
parent
b335e750
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
5 deletions
+18
-5
request.go
req/request.go
+18
-5
No files found.
req/request.go
View file @
cd735ace
...
@@ -7,7 +7,6 @@ import (
...
@@ -7,7 +7,6 @@ import (
"github.com/gin-gonic/gin"
"github.com/gin-gonic/gin"
"hilo-group/domain/cache/user_c"
"hilo-group/domain/cache/user_c"
"hilo-group/domain/model/res_m"
"hilo-group/domain/model/res_m"
"hilo-group/domain/model/user_m"
"hilo-group/myerr"
"hilo-group/myerr"
"hilo-group/myerr/bizerr"
"hilo-group/myerr/bizerr"
"strconv"
"strconv"
...
@@ -89,11 +88,25 @@ func GetUserIdLang(c *gin.Context, myContext *mycontext.MyContext) (mysql.ID, st
...
@@ -89,11 +88,25 @@ func GetUserIdLang(c *gin.Context, myContext *mycontext.MyContext) (mysql.ID, st
func
GetUserEx
(
c
*
gin
.
Context
,
myContext
*
mycontext
.
MyContext
)
(
mysql
.
ID
,
string
,
string
,
string
,
string
,
error
)
{
func
GetUserEx
(
c
*
gin
.
Context
,
myContext
*
mycontext
.
MyContext
)
(
mysql
.
ID
,
string
,
string
,
string
,
string
,
error
)
{
if
userIdStr
,
ok
:=
c
.
Keys
[
mycontext
.
USERID
];
ok
{
if
userIdStr
,
ok
:=
c
.
Keys
[
mycontext
.
USERID
];
ok
{
userId
:=
userIdStr
.
(
uint64
)
userId
:=
userIdStr
.
(
uint64
)
user
,
err
:=
user_m
.
GetUser
(
domain
.
CreateModelContext
(
myContext
),
userId
)
if
err
!=
nil
{
externalId
,
ok1
:=
c
.
Get
(
mycontext
.
EXTERNAL_ID
)
return
0
,
""
,
""
,
""
,
""
,
bizerr
.
ExternalIdNoExist
nick
,
ok2
:=
c
.
Get
(
mycontext
.
NICK
)
avatar
,
ok3
:=
c
.
Get
(
mycontext
.
AVATAR
)
country
,
ok4
:=
c
.
Get
(
mycontext
.
COUNTRY
)
ok
:=
ok1
&&
ok2
&&
ok3
&&
ok4
if
ok
{
return
userId
,
externalId
.
(
string
),
nick
.
(
string
),
avatar
.
(
string
),
country
.
(
string
),
nil
}
else
{
//var user user_m.User
//if err := mysql.Db.First(&user, userId).Error; err != nil {
// return 0, "", "", "", "", bizerr.ExternalIdNoExist
//}
user
,
err
:=
user_c
.
GetUserTinyById
(
domain
.
CreateModelContext
(
myContext
),
userId
)
if
err
!=
nil
{
return
0
,
""
,
""
,
""
,
""
,
bizerr
.
ExternalIdNoExist
}
return
userId
,
user
.
ExternalId
,
user
.
Nick
,
user
.
Avatar
,
user
.
Country
,
nil
}
}
return
userId
,
user
.
ExternalId
,
user
.
Nick
,
user
.
Avatar
,
user
.
Country
,
nil
}
}
return
0
,
""
,
""
,
""
,
""
,
bizerr
.
ParaMissing
return
0
,
""
,
""
,
""
,
""
,
bizerr
.
ParaMissing
}
}
...
...
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