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
18483d9b
Commit
18483d9b
authored
Sep 04, 2023
by
haoyanbin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reference
parent
d3178ac3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
24 deletions
+30
-24
survey.go
api/mobile/survey.go
+11
-9
survey.go
model/request/survey.go
+7
-5
survey.go
model/survey.go
+12
-10
No files found.
api/mobile/survey.go
View file @
18483d9b
...
@@ -26,15 +26,17 @@ func CreateSurveyUser(c *gin.Context) {
...
@@ -26,15 +26,17 @@ func CreateSurveyUser(c *gin.Context) {
ipData
,
_
:=
service
.
GetIpaddr
(
c
.
ClientIP
())
ipData
,
_
:=
service
.
GetIpaddr
(
c
.
ClientIP
())
SurveyUser
:=
model
.
SurveyUser
{
SurveyUser
:=
model
.
SurveyUser
{
SurveyId
:
1
,
SurveyId
:
1
,
UserId
:
req
.
UserId
,
UserId
:
req
.
UserId
,
Contacts
:
req
.
Contacts
,
Contacts
:
req
.
Contacts
,
ContactsMobile
:
req
.
ContactsMobile
,
ContactsMobile
:
req
.
ContactsMobile
,
CreateTime
:
utils
.
NowTime
(),
Reference
:
req
.
Reference
,
Country
:
ipData
.
Country
,
ReferenceMobile
:
req
.
ReferenceMobile
,
Area
:
ipData
.
Area
,
CreateTime
:
utils
.
NowTime
(),
Region
:
ipData
.
Region
,
Country
:
ipData
.
Country
,
City
:
ipData
.
City
,
Area
:
ipData
.
Area
,
Region
:
ipData
.
Region
,
City
:
ipData
.
City
,
}
}
_
,
surveyUserId
:=
service
.
CreateSurveyUser
(
SurveyUser
)
_
,
surveyUserId
:=
service
.
CreateSurveyUser
(
SurveyUser
)
...
...
model/request/survey.go
View file @
18483d9b
...
@@ -3,11 +3,13 @@ package request
...
@@ -3,11 +3,13 @@ package request
import
"gin-vue-admin/model"
import
"gin-vue-admin/model"
type
CreateSurveyUserReq
struct
{
type
CreateSurveyUserReq
struct
{
Data
[]
model
.
SurveyUserData
`json:"data"`
Data
[]
model
.
SurveyUserData
`json:"data"`
SurveyId
int
`gorm:"type:int(255)" json:"survey_id"`
SurveyId
int
`gorm:"type:int(255)" json:"survey_id"`
UserId
int
`gorm:"type:int(255)" json:"user_id"`
UserId
int
`gorm:"type:int(255)" json:"user_id"`
Contacts
string
`gorm:"type:string(255)" json:"contacts"`
Contacts
string
`gorm:"type:string(255)" json:"contacts"`
ContactsMobile
string
`gorm:"type:string(255)" json:"contacts_mobile"`
ContactsMobile
string
`gorm:"type:string(255)" json:"contacts_mobile"`
Reference
string
`gorm:"type:string(255)" json:"reference"`
ReferenceMobile
string
`gorm:"type:string(255)" json:"reference_mobile"`
}
}
type
GetSurveyUserListReq
struct
{
type
GetSurveyUserListReq
struct
{
...
...
model/survey.go
View file @
18483d9b
...
@@ -2,16 +2,18 @@
...
@@ -2,16 +2,18 @@
package
model
package
model
type
SurveyUser
struct
{
type
SurveyUser
struct
{
Id
int
`gorm:"type:int(255)" json:"id"`
Id
int
`gorm:"type:int(255)" json:"id"`
SurveyId
int
`gorm:"type:int(255)" json:"survey_id"`
SurveyId
int
`gorm:"type:int(255)" json:"survey_id"`
UserId
int
`gorm:"type:int(255)" json:"user_id"`
UserId
int
`gorm:"type:int(255)" json:"user_id"`
Contacts
string
`gorm:"type:string(255)" json:"contacts"`
Contacts
string
`gorm:"type:string(255)" json:"contacts"`
ContactsMobile
string
`gorm:"type:string(255)" json:"contacts_mobile"`
ContactsMobile
string
`gorm:"type:string(255)" json:"contacts_mobile"`
CreateTime
string
`gorm:"type:string(255)" json:"create_time"`
Reference
string
`gorm:"type:string(255)" json:"reference"`
Country
string
`gorm:"type:string(255)" json:"country"`
ReferenceMobile
string
`gorm:"type:string(255)" json:"reference_mobile"`
Area
string
`gorm:"type:string(255)" json:"area"`
CreateTime
string
`gorm:"type:string(255)" json:"create_time"`
Region
string
`gorm:"type:string(255)" json:"region"`
Country
string
`gorm:"type:string(255)" json:"country"`
City
string
`gorm:"type:string(255)" json:"city"`
Area
string
`gorm:"type:string(255)" json:"area"`
Region
string
`gorm:"type:string(255)" json:"region"`
City
string
`gorm:"type:string(255)" json:"city"`
}
}
type
SurveyUserData
struct
{
type
SurveyUserData
struct
{
...
...
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