Commit 18483d9b authored by haoyanbin's avatar haoyanbin

Reference

parent d3178ac3
...@@ -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)
......
...@@ -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 {
......
...@@ -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 {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment