models

package
v1.2.6 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2025 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

models/field.go

Index

Constants

This section is empty.

Variables

View Source
var DB *gorm.DB
View Source
var DemDB *gorm.DB

Functions

func InitDB

func InitDB()

Types

type AreaType added in v1.1.21

type AreaType string

AreaType 面积计算类型

const (
	AreaTypePlanar    AreaType = "planar"    // 平面面积
	AreaTypeEllipsoid AreaType = "ellipsoid" // 椭球面积
)

type Asset

type Asset struct {
	Version      string `json:"version"`
	Generatetool string `json:"generatetool,omitempty"`
	GltfUpAxis   string `json:"gltfUpAxis,omitempty"`
}

Asset 资产信息

type AttColor

type AttColor struct {
	ID        int64  `gorm:"primary_key"`
	LayerName string `gorm:"type:varchar(255)"`
	AttName   string `gorm:"type:varchar(255)"`
	Property  string `gorm:"type:varchar(255)"`
	Color     string `gorm:"type:varchar(255)"`
}

type BoundingVolume

type BoundingVolume struct {
	Sphere []float64 `json:"sphere,omitempty"`
	Box    []float64 `json:"box,omitempty"`
	Region []float64 `json:"region,omitempty"`
}

BoundingVolume 包围体

type CalcType added in v1.1.21

type CalcType string

CalcType 计算类型

const (
	CalcTypeArea      CalcType = "area"       // 面积
	CalcTypePerimeter CalcType = "perimeter"  // 周长
	CalcTypeCentroidX CalcType = "centroid_x" // 中心点X坐标(经度)
	CalcTypeCentroidY CalcType = "centroid_y" // 中心点Y坐标(纬度)
)

type CalculateExpression added in v1.1.20

type CalculateExpression struct {
	Type      string               `json:"type"`                // 类型: value, field, expression
	Value     interface{}          `json:"value,omitempty"`     // 直接赋值的值
	Field     string               `json:"field,omitempty"`     // 字段名
	Fields    []string             `json:"fields,omitempty"`    // 多字段组合(concat)
	Separator string               `json:"separator,omitempty"` // 字段组合分隔符
	Operator  string               `json:"operator,omitempty"`  // 运算符: +, -, *, /
	Left      *CalculateExpression `json:"left,omitempty"`      // 左操作数
	Right     *CalculateExpression `json:"right,omitempty"`     // 右操作数
}

CalculateExpression 计算表达式

type ChineseProperty

type ChineseProperty struct {
	ID        int64  `gorm:"primary_key"`
	LayerName string `gorm:"type:varchar(255)"`

	CName string `gorm:"type:varchar(255)"`
	EName string `gorm:"type:varchar(255)"`
}

type Content

type Content struct {
	Uri string `json:"uri,omitempty"`
}

Content 内容

type FieldCalculatorRequest added in v1.1.20

type FieldCalculatorRequest struct {
	TableName     string               `json:"table_name" binding:"required"`     // 表名
	TargetField   string               `json:"target_field" binding:"required"`   // 目标字段
	OperationType string               `json:"operation_type" binding:"required"` // 操作类型: assign, copy, concat, calculate
	Expression    *CalculateExpression `json:"expression,omitempty"`              // 计算表达式
	Condition     string               `json:"condition,omitempty"`               // 过滤条件 (WHERE子句)
}

FieldCalculatorRequest 字段计算器请求结构

type FieldCalculatorResponse added in v1.1.20

type FieldCalculatorResponse struct {
	TableName     string `json:"table_name"`
	TargetField   string `json:"target_field"`
	OperationType string `json:"operation_type"`
	AffectedRows  int64  `json:"affected_rows"`
	SQLStatement  string `json:"sql_statement"`
}

FieldCalculatorResponse 字段计算器响应

type FieldInfo

type FieldInfo struct {
	FieldName    string  `json:"field_name"`    // 字段名
	FieldType    string  `json:"field_type"`    // 简化的数据类型:int, float, varchar, bytes
	Length       int     `json:"length"`        // varchar类型的长度
	IsNullable   string  `json:"is_nullable"`   // 是否可为空 YES/NO
	DefaultValue *string `json:"default_value"` // 默认值
	Comment      string  `json:"comment"`       // 注释
	Position     int     `json:"position"`      // 字段位置
}

FieldInfo 字段信息结构

type FieldOperation

type FieldOperation struct {
	TableName    string `json:"table_name" binding:"required"`
	FieldName    string `json:"field_name" binding:"required"`
	FieldType    string `json:"field_type,omitempty"` // int, float, varchar, bytes
	Length       int    `json:"length,omitempty"`     // varchar类型的长度参数
	NewFieldName string `json:"new_field_name,omitempty"`
	DefaultValue string `json:"default_value,omitempty"`
	IsNullable   bool   `json:"is_nullable,omitempty"`
	Comment      string `json:"comment,omitempty"`
}

FieldOperation 字段操作的请求结构

type GeoPic

type GeoPic struct {
	Pic_bsm string `gorm:"primary_key;type:varchar(255)"`
	Url     string `gorm:"type:varchar(255)" json:"url"`
	BSM     string `gorm:"type:varchar(255)"`
	X       string `gorm:"type:varchar(255)"`
	Y       string `gorm:"type:varchar(255)"`
	Angel   string `gorm:"type:varchar(255)"`
	TBID    string `gorm:"type:varchar(255)"`
	Date    string `gorm:"type:varchar(255)"`
}

type GeoRecord

type GeoRecord struct {
	TableName  string `gorm:"type:varchar(255)"`
	Username   string `gorm:"type:varchar(255)"`
	Type       string `gorm:"type:varchar(255)"`
	Date       string `gorm:"type:varchar(255)"`
	BZ         string `gorm:"type:varchar(255)"`
	ID         int64  `gorm:"primary_key"`
	GeoID      int32
	OldGeojson []byte `gorm:"type:bytea"`
	NewGeojson []byte `gorm:"type:bytea"`
}

type GeometryUpdateRequest added in v1.1.21

type GeometryUpdateRequest struct {
	TableName   string   `json:"table_name" binding:"required"`   // 表名
	TargetField string   `json:"target_field" binding:"required"` // 目标字段名
	GeomField   string   `json:"geom_field"`                      // 几何字段名(默认geom)
	CalcType    CalcType `json:"calc_type" binding:"required"`    // 计算类型
	AreaType    AreaType `json:"area_type,omitempty"`             // 面积类型(仅area时需要)
	WhereClause string   `json:"where_clause,omitempty"`          // 可选的WHERE条件
}

GeometryUpdateRequest 几何字段更新请求

type GeometryUpdateResponse added in v1.1.21

type GeometryUpdateResponse struct {
	TableName    string `json:"table_name"`
	TargetField  string `json:"target_field"`
	CalcType     string `json:"calc_type"`
	RowsAffected int64  `json:"rows_affected"` // 影响的行数
	Success      bool   `json:"success"`
	Message      string `json:"message"`
}

GeometryUpdateResponse 几何字段更新响应

type LoginUser

type LoginUser struct {
	ID        int64  `gorm:"primary_key"`
	Username  string `gorm:"type:varchar(255)"`
	Password  string `gorm:"type:varchar(255)"`
	Name      string `gorm:"type:varchar(255)"`
	Phone     string `gorm:"type:varchar(255)"`
	Userunits string `gorm:"type:varchar(255)"`
	Location  string `gorm:"type:varchar(255)"`
	Post      string `gorm:"type:varchar(255)"`
	Token     string `gorm:"type:varchar(255)"`
	Grade     string `gorm:"type:varchar(255)"`
	Mac       string
	Date      string `gorm:"type:varchar(255)"`
	CentX     float64
	CentY     float64
	CentZ     float64
	InitX     float64
	InitY     float64
	InitZ     float64
}

type MySchema

type MySchema struct {
	ID          int64  `gorm:"primary_key;autoIncrement"`
	Main        string `gorm:"type:varchar(255)"`
	CN          string `gorm:"type:varchar(255)"`
	EN          string `gorm:"type:varchar(255)"`
	Type        string `gorm:"type:varchar(255)"`
	Opacity     string `gorm:"type:varchar(254)"`
	Color       string `gorm:"type:varchar(255)"`
	LineWidth   string `gorm:"type:varchar(55)"`
	UpdatedDate string `gorm:"type:varchar(255)"`
	Userunits   string `gorm:"type:varchar(255)"`
}

type Response

type Response struct {
	Code    int         `json:"code"`
	Message string      `json:"message"`
	Data    interface{} `json:"data,omitempty"`
}

Response 通用响应结构

type TableStructure

type TableStructure struct {
	TableName    string      `json:"table_name"`
	TableComment string      `json:"table_comment"`
	Fields       []FieldInfo `json:"fields"`
	FieldCount   int         `json:"field_count"`
}

TableStructure 表结构信息

type TempGeo

type TempGeo struct {
	BSM     string `gorm:"type:varchar(255);primary_key"`
	TBMJ    float64
	TBID    string `gorm:"type:varchar(255)"`
	MAC     string `gorm:"type:varchar(255)"`
	ZT      string `gorm:"type:varchar(255)"`
	Name    string `gorm:"type:varchar(255)"`
	Date    string `gorm:"type:varchar(255)"`
	Geojson []byte `gorm:"type:bytea"`
}

type TempLayHeader

type TempLayHeader struct {
	ID        int64  `gorm:"primary_key"`
	BSM       string `gorm:"type:varchar(255)"`
	Layername string `gorm:"type:varchar(255)"`
	MAC       string `gorm:"type:varchar(255)"`
	Progress  float64
	Date      string `gorm:"type:varchar(255)"`
}

type TempLayer

type TempLayer struct {
	ID        int64  `gorm:"primary_key"`
	TBID      string `gorm:"type:varchar(255)"`
	Layername string `gorm:"type:varchar(255)"`
	BSM       string `gorm:"type:varchar(255)"`
	Name      string `gorm:"type:varchar(255)"`
	ZT        string `gorm:"type:varchar(255)"`
	MAC       string `gorm:"type:varchar(255)"`
	Geojson   []byte `gorm:"type:bytea"`
}

type TempLayerAttribute

type TempLayerAttribute struct {
	ID        int64  `gorm:"primary_key"`
	TBID      string `gorm:"type:varchar(255)"`
	QKSM      string `gorm:"type:varchar(255)"`
	Layername string `gorm:"type:varchar(255)"`
	B         string `gorm:"type:varchar(255)"`
	D         string `gorm:"type:varchar(255)"`
	N         string `gorm:"type:varchar(255)"`
	X         string `gorm:"type:varchar(255)"`
	BZ        string `gorm:"type:varchar(255)"`
	ZJR       []byte
	DCR       []byte
}

type Tile

type Tile struct {
	ZoomLevel  int64
	TileColumn int64
	TileRow    int64
	TileData   []byte
}

type Tile2

type Tile2 struct {
	BoundingVolume BoundingVolume `json:"boundingVolume"`
	Refine         string         `json:"refine,omitempty"`
	GeometricError interface{}    `json:"geometricError"` // 使用interface{}因为可能是int或float64
	Content        Content        `json:"content,omitempty"`
	Children       []Tile2        `json:"children,omitempty"` // 递归引用自身
}

Tile 瓦片节点 - 递归结构

type TileSetJson

type TileSetJson struct {
	Asset struct {
		Version      string `json:"version"`
		Generatetool string `json:"generatetool"`
		GltfUpAxis   string `json:"gltfUpAxis"`
	} `json:"asset"`
	ExtensionsUsed []string `json:"extensionsUsed"`
	GeometricError float64  `json:"geometricError"`
	Refine         string   `json:"refine"`
	Root           struct {
		BoundingVolume struct {
			Sphere []float64 `json:"sphere"`
		} `json:"boundingVolume"`
		GeometricError float64 `json:"geometricError"`
		Children       []struct {
			BoundingVolume struct {
				Sphere []float64 `json:"sphere"`
			} `json:"boundingVolume"`
			GeometricError float64 `json:"geometricError"`
			Children       []struct {
				BoundingVolume struct {
					Sphere []float64 `json:"sphere"`
				} `json:"boundingVolume"`
				GeometricError int `json:"geometricError"`
				Content        struct {
					Uri string `json:"uri"`
				} `json:"content"`
			} `json:"children"`
		} `json:"children"`
	} `json:"root"`
}

type TilesByte

type TilesByte struct {
	Folder   string
	TileName string
	TileData []byte
}

type TilesHeader

type TilesHeader struct {
	Folder   string
	JsonName string
	TileJson []byte
}

type TilesJson

type TilesJson struct {
	Asset          Asset   `json:"asset"`
	GeometricError float64 `json:"geometricError"`
	Root           Tile2   `json:"root"`
}

TilesJson 3D Tiles 主结构

type TilesSet

type TilesSet struct {
	Name   string `gorm:"type:varchar(255);primary_key"`
	UpDown string `gorm:"type:varchar(255)"`
}

type UpdateMessage

type UpdateMessage struct {
	ID          int64  `gorm:"primary_key"`
	LayerNameEN string `gorm:"type:varchar(255)"`
	LayerNameCN string `gorm:"type:varchar(255)"`
	UpdatedUser string `gorm:"type:varchar(255)"`
	Date        string `gorm:"type:varchar(255)"`
	MSG         string `gorm:"type:varchar(255)"`
}

type ZDTPic

type ZDTPic struct {
	TBID string `gorm:"primary_key;type:varchar(255)"`
	Url  string `gorm:"type:varchar(255)" json:"url"`
	BSM  string `gorm:"type:varchar(255)"`
	Date string `gorm:"type:varchar(255)"`
}

Jump to

Keyboard shortcuts

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