初始
This commit is contained in:
48
api/pilot/wayline/wayline.go
Normal file
48
api/pilot/wayline/wayline.go
Normal file
@ -0,0 +1,48 @@
|
||||
package wayline
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/net/ghttp"
|
||||
)
|
||||
|
||||
type WAYLINE struct {
|
||||
}
|
||||
|
||||
type WaylinesReq struct {
|
||||
g.Meta `path:"workspaces/{workspace_id}/waylines" summary:"获取航线列表" method:"get" tags:"无人机遥控器"`
|
||||
Favorited bool `json:"favorited"`
|
||||
Order_by string `json:"order_by"`
|
||||
Page int `json:"page"`
|
||||
PageSize int `json:"page_size"`
|
||||
TemplateType []int `json:"template_type"`
|
||||
}
|
||||
|
||||
type Wayline struct {
|
||||
Id string `json:"id"`
|
||||
DroneModelKey string `json:"drone_model_key"`
|
||||
Favorited bool `json:"favorited"`
|
||||
Name string `json:"name"`
|
||||
PayloadModelKeys []string `json:"payload_model_keys"`
|
||||
TemplateTypes []int `json:"template_types"`
|
||||
UpdateTime int64 `json:"update_time"`
|
||||
UserName string `json:"user_name"`
|
||||
}
|
||||
type WaylinesRes struct {
|
||||
List []Wayline `json:"list"`
|
||||
Pagination struct {
|
||||
Page int `json:"page"`
|
||||
PageSize int `json:"page_size"`
|
||||
Total int `json:"total"`
|
||||
} `json:"pagination"`
|
||||
}
|
||||
|
||||
func (receiver WAYLINE) Waylines(ctx context.Context, req *WaylinesReq) (res *WaylinesRes, err error) {
|
||||
workspace_id := ghttp.RequestFromCtx(ctx).Get("workspace_id")
|
||||
fmt.Println("获取航线列表workspace_id", workspace_id)
|
||||
fmt.Println(req.Order_by, req.TemplateType, req.Page, req.PageSize, req.Favorited)
|
||||
res = &WaylinesRes{}
|
||||
res.List = []Wayline{}
|
||||
return
|
||||
}
|
Reference in New Issue
Block a user