schema

package
v0.0.1-alpha.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 17, 2020 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrorItem

type ErrorItem struct {
	Code    int    `json:"code"`    // 错误码
	Message string `json:"message"` // 错误信息
}

ErrorItem 响应错误项

type ErrorResult

type ErrorResult struct {
	Error ErrorItem `json:"error"` // 错误项
}

ErrorResult 响应错误

type GridLevelColor

type GridLevelColor struct {
	Value [2]float64 `json:"value" binding:"required,unique"  example:"0,15"`             // 值区间 [0, 15]
	Color [4]uint8   `json:"rgba" binding:"dive,gte=0,lte=255" example:"255,128,169,255"` // RGBA颜色 [255, 255, 255, 255]
}

type IDResult

type IDResult struct {
	ID string `json:"id"`
}

IDResult 响应唯一标识

func NewIDResult

func NewIDResult(id string) *IDResult

NewIDResult 创建响应唯一标识实例

type ListResult

type ListResult struct {
	List       interface{}       `json:"list"`
	Pagination *PaginationResult `json:"pagination,omitempty"`
}

ListResult 响应列表数据

type OrderDirection

type OrderDirection int

OrderDirection 排序方向

const (
	// OrderByASC 升序排序
	OrderByASC OrderDirection = 1
	// OrderByDESC 降序排序
	OrderByDESC OrderDirection = 2
)

type OrderField

type OrderField struct {
	Key       string         // 字段名(字段名约束为小写蛇形)
	Direction OrderDirection // 排序方向
}

OrderField 排序字段

func NewOrderField

func NewOrderField(key string, d OrderDirection) *OrderField

NewOrderField 创建排序字段

func NewOrderFieldWithKeys

func NewOrderFieldWithKeys(keys []string, directions ...map[int]OrderDirection) []*OrderField

NewOrderFieldWithKeys 创建排序字段(默认升序排序),可指定不同key的排序规则 keys 需要排序的key directions 排序规则,按照key的索引指定,索引默认从0开始

func NewOrderFields

func NewOrderFields(orderFields ...*OrderField) []*OrderField

NewOrderFields 创建排序字段列表

type OrdinaryGridInfo

type OrdinaryGridInfo struct {
	GridMatrices *ordinarykriging.GridMatrices `json:"grid"`
	Variogram    *ordinarykriging.Variogram    `json:"-"`
	TimeCost     string                        `json:"timeCost"` // 耗时
}

OrdinaryGridInfo 插值的网格数据

type OrdinaryGridParam

type OrdinaryGridParam struct {
	Polygon string `` // Polygon Geometry String
	/* 182-byte string literal not displayed */
	PolygonGeometry ordinarykriging.PolygonGeometry `json:"-"`                                                      // Polygon Geometry
	Width           float64                         `json:"width" binding:"required" example:"0.01" example:"0.01"` // 网格单元宽度
}

OrdinaryGridParam 插值网格参数

type OrdinaryPlotPngParam

type OrdinaryPlotPngParam struct {
	Width  int              `json:"width" binding:"required,gte=1" example:"100"`            // 图片宽度
	Height int              `json:"height" binding:"required,gte=1" example:"100"`           // 图片高度
	Xlim   [2]float64       `json:"xlim" binding:"required" example:"103.614373,104.356163"` // Xlim
	Ylim   [2]float64       `json:"Ylim" binding:"required" example:"26.635252,28.018448"`   // Ylim
	Colors []GridLevelColor `json:"colors" binding:"required,dive,required"`                 // colors
}

OrdinaryPlotPngParam 插值图片参数

type OrdinaryQueryGridParam

type OrdinaryQueryGridParam struct {
	TrainParam OrdinaryTrainParam `json:"train"`
	GridParam  OrdinaryGridParam  `json:"grid"`
}

OrdinaryQueryGridParam 生成插值网格参数

type OrdinaryQueryGridPngParam

type OrdinaryQueryGridPngParam struct {
	TrainParam   OrdinaryTrainParam   `json:"train"`
	GridParam    OrdinaryGridParam    `json:"grid"`
	PlotPngParam OrdinaryPlotPngParam `json:"plotPng"`
}

OrdinaryQueryGridPngParam 生成插值图片参数

type OrdinaryTrainParam

type OrdinaryTrainParam struct {
	Values    []float64                 `json:"values" binding:"required" example:"9.6,10.2,5.4"`      // 权重值数组
	Lons      []float64                 `json:"lons" binding:"required" example:"102.68,99.36,101.23"` // 经度数组
	Lats      []float64                 `json:"lats" binding:"required" example:"25.95,25.81,25.95"`   // 纬度数组
	Sigma2    float64                   `json:"sigma2" binding:"" default:"0" example:"0"`             // sigma2
	Alpha     float64                   `json:"alpha" binding:""  default:"0" example:"100"`           // alpha
	Model     uint16                    `json:"model" binding:"required,oneof=1 2 3" example:"1"`      // 函数模型(1:"spherical" 2:"exponential" 3:"gaussian")
	ModelType ordinarykriging.ModelType `json:"-"`
}

OrdinaryTrainParam 训练模型参数

type PaginationParam

type PaginationParam struct {
	Pagination bool `form:"-"`                                     // 是否使用分页查询
	OnlyCount  bool `form:"-"`                                     // 是否仅查询count
	Current    uint `form:"current,default=1"`                     // 当前页
	PageSize   uint `form:"pageSize,default=10" binding:"max=100"` // 页大小
}

PaginationParam 分页查询条件

func (PaginationParam) GetCurrent

func (a PaginationParam) GetCurrent() uint

GetCurrent 获取当前页

func (PaginationParam) GetPageSize

func (a PaginationParam) GetPageSize() uint

GetPageSize 获取页大小

type PaginationResult

type PaginationResult struct {
	Total    int  `json:"total"`    //总数量
	Current  uint `json:"current"`  // 页索引
	PageSize uint `json:"pageSize"` // 页大小
}

PaginationResult 分页查询结果

type StatusResult

type StatusResult struct {
	Status StatusText `json:"status"` // 状态(OK)
}

StatusResult 响应状态

type StatusText

type StatusText string

StatusText 定义状态文本

const (
	OKStatus    StatusText = "OK"
	ErrorStatus StatusText = "ERROR"
	FailStatus  StatusText = "FAIL"
)

定义HTTP状态文本常量

func (StatusText) String

func (t StatusText) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL