Commit 18483d9b authored by haoyanbin's avatar haoyanbin

Reference

parent d3178ac3
......@@ -26,15 +26,17 @@ func CreateSurveyUser(c *gin.Context) {
ipData, _ := service.GetIpaddr(c.ClientIP())
SurveyUser := model.SurveyUser{
SurveyId: 1,
UserId: req.UserId,
Contacts: req.Contacts,
ContactsMobile: req.ContactsMobile,
CreateTime: utils.NowTime(),
Country: ipData.Country,
Area: ipData.Area,
Region: ipData.Region,
City: ipData.City,
SurveyId: 1,
UserId: req.UserId,
Contacts: req.Contacts,
ContactsMobile: req.ContactsMobile,
Reference: req.Reference,
ReferenceMobile: req.ReferenceMobile,
CreateTime: utils.NowTime(),
Country: ipData.Country,
Area: ipData.Area,
Region: ipData.Region,
City: ipData.City,
}
_, surveyUserId := service.CreateSurveyUser(SurveyUser)
......
......@@ -3,11 +3,13 @@ package request
import "gin-vue-admin/model"
type CreateSurveyUserReq struct {
Data []model.SurveyUserData `json:"data"`
SurveyId int `gorm:"type:int(255)" json:"survey_id"`
UserId int `gorm:"type:int(255)" json:"user_id"`
Contacts string `gorm:"type:string(255)" json:"contacts"`
ContactsMobile string `gorm:"type:string(255)" json:"contacts_mobile"`
Data []model.SurveyUserData `json:"data"`
SurveyId int `gorm:"type:int(255)" json:"survey_id"`
UserId int `gorm:"type:int(255)" json:"user_id"`
Contacts string `gorm:"type:string(255)" json:"contacts"`
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 {
......
......@@ -2,16 +2,18 @@
package model
type SurveyUser struct {
Id int `gorm:"type:int(255)" json:"id"`
SurveyId int `gorm:"type:int(255)" json:"survey_id"`
UserId int `gorm:"type:int(255)" json:"user_id"`
Contacts string `gorm:"type:string(255)" json:"contacts"`
ContactsMobile string `gorm:"type:string(255)" json:"contacts_mobile"`
CreateTime string `gorm:"type:string(255)" json:"create_time"`
Country string `gorm:"type:string(255)" json:"country"`
Area string `gorm:"type:string(255)" json:"area"`
Region string `gorm:"type:string(255)" json:"region"`
City string `gorm:"type:string(255)" json:"city"`
Id int `gorm:"type:int(255)" json:"id"`
SurveyId int `gorm:"type:int(255)" json:"survey_id"`
UserId int `gorm:"type:int(255)" json:"user_id"`
Contacts string `gorm:"type:string(255)" json:"contacts"`
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"`
CreateTime string `gorm:"type:string(255)" json:"create_time"`
Country string `gorm:"type:string(255)" json:"country"`
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 {
......
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