go_dreamfactory/modules/caravan/api_refreshcity.go
2023-09-25 17:19:47 +08:00

35 lines
971 B
Go

package caravan
import (
"go_dreamfactory/comm"
"go_dreamfactory/pb"
)
//参数校验
func (this *apiComp) RefreshCityCheck(session comm.IUserSession, req *pb.CaravanRefreshCityReq) (errdata *pb.ErrorData) {
return
}
// 此协议不用
// 刷新城市信息
func (this *apiComp) RefreshCity(session comm.IUserSession, req *pb.CaravanRefreshCityReq) (errdata *pb.ErrorData) {
var (
resp *pb.CaravanRefreshCityResp
)
resp = &pb.CaravanRefreshCityResp{}
if errdata = this.RefreshCityCheck(session, req); errdata != nil {
return // 参数校验失败直接返回
}
list, _ := this.module.modelCaravan.getCaravanList(session.GetUserId())
//resp.Oldprice = list.Oldprice
// 刷新城市货物信息
//this.module.refreshCaravanCityInfo(session.GetUserId(), list)
//resp.Goods = list.Goods
resp.City = list.City
resp.Citytime = list.Citystime
//resp.Itemtime = list.Itemtime
session.SendMsg(string(this.module.GetType()), "refreshcity", resp)
return
}