package video_hat import ( "context" "github.com/gogf/gf/v2/frame/g" ) // 查询某个设备的当前定位 type GetNowLocationReq struct { g.Meta `path:"/video/location" method:"post" tags:"视频安全帽相关" summary:"获取某个设备的当前定位"` DevNum string `json:"devNum" dc:"设备号"` } type GetNowLocationRes struct { DevNum string `json:"devNum"` Longitude string `json:"longitude"` Latitude string `json:"latitude"` } func (v VideoHat) GetAllVideodata(ctx context.Context, req *GetNowLocationReq) (res *GetNowLocationRes, err error) { res = new(GetNowLocationRes) g.Model("device_video_hat").Fields("dev_num AS devNum,longitude,latitude").Where("dev_num", req.DevNum).Scan(&res) return res, nil }