go_dreamfactory/modules/caravan/api_refreshcity.go
2023-06-06 10:11:23 +08:00

33 lines
911 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 code = 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.Resettime = list.Resettime
session.SendMsg(string(this.module.GetType()), "refreshcity", resp)
return
}