初始
This commit is contained in:
24
api/video_hat/location.go
Normal file
24
api/video_hat/location.go
Normal file
@ -0,0 +1,24 @@
|
||||
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
|
||||
}
|
Reference in New Issue
Block a user