Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dt_analysis
Project
Project
Details
Activity
Releases
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
haoyanbin
dt_analysis
Commits
4f1d5345
Commit
4f1d5345
authored
Sep 01, 2023
by
haoyanbin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
6da653b4
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
3 deletions
+33
-3
survey.go
api/mobile/survey.go
+1
-0
user.go
api/mobile/user.go
+21
-3
sys_user.go
model/request/sys_user.go
+9
-0
user.go
router/user.go
+2
-0
No files found.
api/mobile/survey.go
View file @
4f1d5345
...
@@ -38,6 +38,7 @@ func CreateSurveyUser(c *gin.Context) {
...
@@ -38,6 +38,7 @@ func CreateSurveyUser(c *gin.Context) {
service
.
CreateSurveyUserData
(
v
)
service
.
CreateSurveyUserData
(
v
)
}
}
response
.
OkWithMessage
(
"创建成功"
,
c
)
return
return
}
}
...
...
api/mobile/user.go
View file @
4f1d5345
...
@@ -16,6 +16,27 @@ import (
...
@@ -16,6 +16,27 @@ import (
"time"
"time"
)
)
func
SendCode
(
c
*
gin
.
Context
)
{
var
r
request
.
SendCodeReq
_
=
c
.
ShouldBindJSON
(
&
r
)
response
.
OkWithMessage
(
"发送成功"
,
c
)
return
}
func
CheckCode
(
c
*
gin
.
Context
)
{
var
r
request
.
CheckCodeReq
_
=
c
.
ShouldBindJSON
(
&
r
)
if
r
.
Code
==
"111111"
{
response
.
OkWithMessage
(
"验证成功"
,
c
)
return
}
response
.
FailWithMessage
(
"验证失败"
,
c
)
return
}
// @Tags mobile
// @Tags mobile
// @Summary 用户登录
// @Summary 用户登录
// @Produce application/json
// @Produce application/json
...
@@ -118,7 +139,6 @@ func Login(c *gin.Context) {
...
@@ -118,7 +139,6 @@ func Login(c *gin.Context) {
}
}
}
}
j
:=
&
middleware
.
JWT
{
SigningKey
:
[]
byte
(
global
.
GVA_CONFIG
.
JWT
.
SigningKey
)}
// 唯一签名
j
:=
&
middleware
.
JWT
{
SigningKey
:
[]
byte
(
global
.
GVA_CONFIG
.
JWT
.
SigningKey
)}
// 唯一签名
claims
:=
request
.
CustomClaims
{
claims
:=
request
.
CustomClaims
{
UUID
:
userData
.
UUID
,
UUID
:
userData
.
UUID
,
...
@@ -382,7 +402,6 @@ func UserAutheInfo(c *gin.Context) {
...
@@ -382,7 +402,6 @@ func UserAutheInfo(c *gin.Context) {
reply
.
ImExpert
=
imExpertReply
.
Data
reply
.
ImExpert
=
imExpertReply
.
Data
}
}
response
.
OkWithData
(
gin
.
H
{
"reply"
:
reply
},
c
)
response
.
OkWithData
(
gin
.
H
{
"reply"
:
reply
},
c
)
return
return
}
}
...
@@ -414,7 +433,6 @@ func CreateUserAuthe(c *gin.Context) {
...
@@ -414,7 +433,6 @@ func CreateUserAuthe(c *gin.Context) {
return
return
}
}
response
.
OkWithMessage
(
"创建成功"
,
c
)
response
.
OkWithMessage
(
"创建成功"
,
c
)
return
return
}
}
...
...
model/request/sys_user.go
View file @
4f1d5345
...
@@ -5,6 +5,15 @@ import (
...
@@ -5,6 +5,15 @@ import (
uuid
"github.com/satori/go.uuid"
uuid
"github.com/satori/go.uuid"
)
)
type
SendCodeReq
struct
{
Mobile
string
`json:"mobile"`
}
type
CheckCodeReq
struct
{
Mobile
string
`json:"mobile"`
Code
string
`json:"code"`
}
type
MobileRegisterReq
struct
{
type
MobileRegisterReq
struct
{
Mobile
string
`json:"mobile"`
//Phone:手机登录 WeChat:微信登录
Mobile
string
`json:"mobile"`
//Phone:手机登录 WeChat:微信登录
HospitalCode
string
`json:"hospitalCode"`
//Phone:手机登录 WeChat:微信登录
HospitalCode
string
`json:"hospitalCode"`
//Phone:手机登录 WeChat:微信登录
...
...
router/user.go
View file @
4f1d5345
...
@@ -14,6 +14,8 @@ func InitMobileUserLoginRouter(Router *gin.RouterGroup) {
...
@@ -14,6 +14,8 @@ func InitMobileUserLoginRouter(Router *gin.RouterGroup) {
UserRouter
.
POST
(
"register"
,
mobile
.
Register
)
// 用户注册账号
UserRouter
.
POST
(
"register"
,
mobile
.
Register
)
// 用户注册账号
UserRouter
.
POST
(
"getOpenid"
,
mobile
.
GetOpenid
)
// 用户注册账号
UserRouter
.
POST
(
"getOpenid"
,
mobile
.
GetOpenid
)
// 用户注册账号
UserRouter
.
POST
(
"getUserName"
,
mobile
.
GetUserName
)
// 用户注册账号
UserRouter
.
POST
(
"getUserName"
,
mobile
.
GetUserName
)
// 用户注册账号
UserRouter
.
POST
(
"sendCode"
,
mobile
.
SendCode
)
// 用户注册账号
UserRouter
.
POST
(
"checkCode"
,
mobile
.
CheckCode
)
// 用户注册账号
}
}
}
}
func
InitMobileUserPublicRouter
(
Router
*
gin
.
RouterGroup
)
{
func
InitMobileUserPublicRouter
(
Router
*
gin
.
RouterGroup
)
{
...
...
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