xtype

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2023 License: BSD-3-Clause-Clear Imports: 9 Imported by: 0

Documentation

Overview

分类模块,高德POI分类

Index

Constants

This section is empty.

Variables

View Source
var AmapCsv embed.FS

Functions

func Regedit

func Regedit(c *Config)

入口配置

Types

type Config

type Config struct {
	DB       *gorm.DB
	TypeName string // 省市区存储的表名
}

type Types

type Types struct {
	TypeCode uint   `gorm:"column:type_code;primaryKey;type:INT UNSIGNED;comment:分类的New Type;not null" json:"type_code" form:"type_code"` // 省市区的ADCode
	Name     string `gorm:"column:name;type:VARCHAR(100);comment:分类的中文名" json:"name" form:"name"`                                         // 中文名
	NameEn   string `gorm:"column:name_en;type:VARCHAR(100);comment:分类的英文名" json:"name_en" form:"name_en"`                                // 中文名
}

城市的表结构信息

func Code2info

func Code2info(type_code uint) (*Types, error)

Adcode换取分类的详细信息

type_code	分类的TypeCode值【五~六位数字】

func FirstList

func FirstList() ([]Types, error)

获取顶级分类信息

func SecondList

func SecondList(type_code uint) ([]Types, error)

获取二级分类信息

type_code	一级分类code

func ThirdList

func ThirdList(type_code uint) ([]Types, error)

获取三级分类信息

type_code	二级分类code

func (*Types) TableName

func (c *Types) TableName() string

获取表名

Jump to

Keyboard shortcuts

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