Commit fec0a92b by dliangx

api model 修改

parent 53704006
...@@ -2,27 +2,67 @@ package geo ...@@ -2,27 +2,67 @@ package geo
import "com.dliangx.xplot/appserver/model" import "com.dliangx.xplot/appserver/model"
func SaveRoute(line model.GeoJson, opt_type int) (model.GeoJson, error) { func SaveRoute(line model.GeoJson, opt_type int) (model.OptRoute, error) {
return model.GeoJson{}, nil return model.OptRoute{}, nil
} }
func SaveOptArea(optArea model.GeoJson) (model.GeoJson, error) { func SaveOptArea(optArea model.GeoJson) (model.OptArea, error) {
return model.GeoJson{}, nil return model.OptArea{}, nil
} }
func GetRouteRelatedArea(agriMach model.GeoJson) ([]model.GeoJson, error) { func UpdateRoute(line model.GeoJson, opt_type int) (model.OptRoute, error) {
return []model.GeoJson{}, nil return model.OptRoute{}, nil
}
func UpdateOptArea(optArea model.GeoJson) (model.OptArea, error) {
return model.OptArea{}, nil
}
func GetRoute(id int, opt_type int) (model.OptRoute, error) {
return model.OptRoute{}, nil
}
func GetOptArea(id int, opt_type int) (model.OptArea, error) {
return model.OptArea{}, nil
}
func DeleteRoute(id int, opt_type int) (bool, error) {
return false, nil
} }
func GetOptAreaRelatedAdmArea(optArea model.GeoJson) ([]model.GeoJson, error) { func DeleteOptArea(id int, opt_type int) (bool, error) {
return false, nil
}
func GetRelatedRoute(obj model.GeoJson) ([]model.OptArea, error) {
return []model.OptArea{}, nil
}
func GetRelatedOptArea(obj model.GeoJson) ([]model.OptArea, error) {
return []model.OptArea{}, nil
}
func GetRelatedAdmArea(obj model.GeoJson) ([]model.GeoJson, error) {
return []model.GeoJson{}, nil return []model.GeoJson{}, nil
} }
func CheckOptAreasCross(flyDefenseArea, agriMachArea model.GeoJson) (bool, error) { func CheckOptAreasCrossById(id1, id2 string) (bool, error) {
return false, nil
}
func CheckAreasCross(obj1, obj2 model.GeoJson) (bool, error) {
return false, nil return false, nil
} }
...@@ -4,6 +4,7 @@ import ( ...@@ -4,6 +4,7 @@ import (
"context" "context"
"fmt" "fmt"
"com.dliangx.xplot/appserver/model"
"github.com/cloudwego/hertz/pkg/app" "github.com/cloudwego/hertz/pkg/app"
"github.com/twpayne/go-geom" "github.com/twpayne/go-geom"
"github.com/twpayne/go-geom/encoding/geojson" "github.com/twpayne/go-geom/encoding/geojson"
...@@ -11,10 +12,34 @@ import ( ...@@ -11,10 +12,34 @@ import (
) )
func SaveGeometry(ctx context.Context, c *app.RequestContext) { func SaveGeometry(ctx context.Context, c *app.RequestContext) {
var resp model.GeoJson
c.BindAndValidate(&resp)
switch resp.Opt {
case 1:
break
case 2:
break
case 3:
break
default:
break
}
} }
func UpdateGeometry(ctx context.Context, c *app.RequestContext) { func UpdateGeometry(ctx context.Context, c *app.RequestContext) {
var resp model.GeoJson
c.BindAndValidate(&resp)
switch resp.Opt {
case 1:
break
case 2:
break
case 3:
break
default:
break
}
} }
...@@ -29,10 +54,24 @@ func DeleteGeometry(ctx context.Context, c *app.RequestContext) { ...@@ -29,10 +54,24 @@ func DeleteGeometry(ctx context.Context, c *app.RequestContext) {
} }
func FindRelatedGeometry(ctx context.Context, c *app.RequestContext) { func FindRelatedGeometry(ctx context.Context, c *app.RequestContext) {
var resp model.GeoJson
c.BindAndValidate(&resp)
switch resp.Opt {
case 1:
break
case 2:
break
case 3:
break
default:
break
}
} }
func CheckTwoOptAreaIsCross(ctx context.Context, c *app.RequestContext) { func CheckTwoOptAreaIsCross(ctx context.Context, c *app.RequestContext) {
var resp []model.GeoJson
c.BindAndValidate(&resp)
} }
......
...@@ -14,13 +14,7 @@ type OptRoute struct { ...@@ -14,13 +14,7 @@ type OptRoute struct {
Geometry *geojson.Geometry `json:"route_line"` Geometry *geojson.Geometry `json:"route_line"`
} }
type OptFlyRoute struct { type OptFlyRoute OptRoute
ID int `json:"id"` // 路线ID
Type string `json:"type"`
Properties map[string]interface{} `json:"properties"`
OptTime time.Time `json:"opt_time"`
Geometry *geojson.Geometry `json:"route_line"`
}
// OptArea 作业区域 // OptArea 作业区域
type OptArea struct { type OptArea struct {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment