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