提交 05f344bd 编写于 作者: fantasy_cs's avatar fantasy_cs

feat : add new field( stateShort and stateShor2).

上级 e05c2bc2
......@@ -2,6 +2,7 @@ package main
import (
"fmt"
"github.com/easysoft/zendata/src/test/import/comm"
"github.com/easysoft/zendata/src/test/import/model"
)
......@@ -20,10 +21,12 @@ func main() {
for _, record := range records {
po := model.DataCity{
Name: record["city"].(string),
Code: record["cityCode"].(string),
ZipCode: record["zipCode"].(string),
State: record["state"].(string),
Name: record["city"].(string),
Code: record["cityCode"].(string),
ZipCode: record["zipCode"].(string),
State: record["state"].(string),
StateShort: record["stateShort"].(string),
StateShort2: record["stateShort2"].(string),
}
db.Save(&po)
......
......@@ -54,10 +54,12 @@ func (DataCountry) TableName() string {
type DataCity struct {
BaseModel
Name string `json:"name"`
Code string `json:"code"`
ZipCode string `json:"zipCode"`
State string `json:"state"`
Name string `json:"name"`
Code string `json:"code"`
ZipCode string `json:"zipCode"`
State string `json:"state"`
StateShort string `json:"stateShort"`
StateShort2 string `json:"stateShort2"`
}
func (DataCity) TableName() string {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册