diff --git a/business/jxstore/cms/cms.go b/business/jxstore/cms/cms.go index 7adc8d93c..c027229fc 100644 --- a/business/jxstore/cms/cms.go +++ b/business/jxstore/cms/cms.go @@ -245,3 +245,7 @@ func UpdateConfig(ctx *jxcontext.Context, key, configType, value string) (hint s func QueryConfigs(key, configType, keyword string) (configList []*model.NewConfig, err error) { return dao.QueryConfigs(dao.GetDB(), key, configType, keyword) } + +func InitStation(ctx *jxcontext.Context) (err error) { + return err +} diff --git a/business/jxstore/event/event.go b/business/jxstore/event/event.go index 4ef5c1a33..30bb61a60 100644 --- a/business/jxstore/event/event.go +++ b/business/jxstore/event/event.go @@ -278,6 +278,8 @@ func GetMessageGroupByUser(ctx *jxcontext.Context, userID string) (messageGroupR if user3, err := dao.GetUserByID(db, "user_id", imMessageRecord.UserID); err == nil { v.LastUserName = user3.Name } + } else { + err = nil } //该用户各组的未读消息数 var unReadCount int diff --git a/business/model/job.go b/business/model/job.go index cb9cfddba..3500600bd 100644 --- a/business/model/job.go +++ b/business/model/job.go @@ -181,3 +181,37 @@ func (v *MtMember) TableIndex() [][]string { []string{"DeletedAt"}, } } + +type StationInfo struct { + ModelIDCUL + + StationID string `orm:"column(station_id)" json:"stationID"` + StationName string `json:"stationName"` + ProvinceName string `json:"provinceName"` + ProvinceID int `orm:"column(province_id)" json:"provinceID"` + CityName string `json:"cityName"` + Latitude string `json:"latitude"` + Longitude string `json:"longitude"` + Location string `json:"location"` + StarNum string `json:"starNum"` + Phone string `json:"phone"` + StationPic string `json:"stationPic"` + StationBannerPic string `json:"stationBannerPic"` + Prices string `orm:"type(text)" json:"prices"` + Adverts string `orm:"type(text)" json:"adverts"` + District string `json:"district"` + CityID int `orm:"column(city_id)" json:"cityID"` + StationType int `json:"stationType"` +} + +func (v *StationInfo) TableUnique() [][]string { + return [][]string{ + []string{"StationID"}, + } +} + +func (v *StationInfo) TableIndex() [][]string { + return [][]string{ + []string{"CityID", "ProvinceID"}, + } +} diff --git a/controllers/cms.go b/controllers/cms.go index 3447cb922..119530fa1 100644 --- a/controllers/cms.go +++ b/controllers/cms.go @@ -145,3 +145,16 @@ func (c *CmsController) UpdatePlace() { return retVal, "", err }) } + +// @Title init station +// @Description init station +// @Param token header string true "认证token" +// @Success 200 {object} controllers.CallResult +// @Failure 200 {object} controllers.CallResult +// @router /InitStation [post] +func (c *CmsController) InitStation() { + c.callInitStation(func(params *tCmsInitStationParams) (retVal interface{}, errCode string, err error) { + err = cms.InitStation(params.Ctx) + return retVal, "", err + }) +} diff --git a/routers/commentsRouter_controllers.go b/routers/commentsRouter_controllers.go index 5f115e5c2..b7449036d 100644 --- a/routers/commentsRouter_controllers.go +++ b/routers/commentsRouter_controllers.go @@ -169,6 +169,15 @@ func init() { Filters: nil, Params: nil}) + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:CmsController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:CmsController"], + beego.ControllerComments{ + Method: "InitStation", + Router: `/InitStation`, + AllowHTTPMethods: []string{"post"}, + MethodParams: param.Make(), + Filters: nil, + Params: nil}) + beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:CmsController"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:CmsController"], beego.ControllerComments{ Method: "NewConfig",