dto

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EncodeRegionItem added in v1.0.2

func EncodeRegionItem(d RegionItem) string

Types

type AccountLoginParams

type AccountLoginParams struct {
	Account  string `json:"account" example:"13488886666"` //账户
	Password string `json:"password" example:"123456"`     //密码
}

type AuthDataPacket

type AuthDataPacket struct {
	Auth      AuthInfo `json:"auth"`
	ExpiredAt int64    `json:"expired_at"` //到期时间的时间戳,单位:秒
	Token     string   `json:"token"`

	Extends map[string]string `json:"extends"` //额外信息
}

AuthDataPacket 授权数据包

func (AuthDataPacket) Valid

func (c AuthDataPacket) Valid() error

type AuthInfo

type AuthInfo struct {
	Id       int64  `json:"id,omitempty"`
	Nickname string `json:"nickname,omitempty"`
	Account  string `json:"account,omitempty"`
	Avatar   string `json:"avatar,omitempty"`
	Status   int    `json:"status"`
	SaasId   int64  `json:"saas_id,omitempty"`   // saas模式下用到的归属租户id
	SaasName string `json:"saas_name,omitempty"` // saas模式下用到的归属租户的名称

	//额外的信息
	// 如:
	//	is_root:1
	//  email      //邮箱,user服务下使用
	//  phone      //手机号,user服务下使用
	//  last_ip     //上次登录ip
	//  last_login  //上次登录时间,yyyy-mm-dd hh:mm:ss 格式
	Extends map[string]string `json:"extends"` //额外信息
}

AuthInfo 授权信息

type AuthParams

type AuthParams struct {
	Token string `json:"token" example:"xxx"` //授权码
}

type CleanMetricDataDto added in v1.0.2

type CleanMetricDataDto struct {
	MetricId   int64  `json:"metric_id"` //指定测点
	StartTime  int64  `json:"start_time"`
	EndTime    int64  `json:"end_time"`
	ExpireTime int64  `json:"expire_time"` //制定过期时间
	Table      string `json:"table"`       //指定table
	MaxRow     int64  `json:"max_row"`     //清理最大行数
}

type CommonResult

type CommonResult struct {
	Code  int64       `json:"code"`
	Msg   string      `json:"msg"`
	Error error       `json:"error"`
	Data  interface{} `json:"data"`
}

CommonResult 通用的执行结果

type JobRunningData added in v1.0.4

type JobRunningData struct {
	Interval string `json:"interval"`           //运行间隔
	Count    int64  `json:"count"`              //已运行次数
	StartAt  int64  `json:"start_at,omitempty"` //运行开始时间
	LastAt   int64  `json:"last_at,omitempty"`  //最后运行时间
}

type JobWorkerItem added in v1.0.4

type JobWorkerItem struct {
	Worker  string          `json:"worker"` //worker名称
	Action  string          `json:"action"` //支持的操作action名
	Running *JobRunningData `json:"running,omitempty"`
}

type LoginInfoParam

type LoginInfoParam struct {
	Time   time.Time //登录时间
	Ip     string    //ip
	Device string    //登陆设备名
}

LoginInfoParam 登陆记录信息

type OrganizeDto added in v1.0.2

type OrganizeDto struct {
	Id int64 `json:"id,omitempty"  gorm:"primaryKey"`

	Name string `json:"name"`
	Type string `json:"type"` //组织类型,自行定义
	Pid  int64  `json:"pid"`

	Status int `json:"status,omitempty" ` //组织状态,0:无,1:正常,2:禁用,其他自行定义

	Children []*OrganizeDto `json:"children,omitempty" gorm:"-"` //子节点列表
}

func FindOrganizeTreeNode

func FindOrganizeTreeNode(list []*OrganizeDto, id int64) *OrganizeDto

FindOrganizeTreeNode 查找树的指定节点

func OrganizeDtoConvertTree added in v1.0.2

func OrganizeDtoConvertTree(list []*OrganizeDto) []*OrganizeDto

OrganizeDtoConvertTree 转为树型结构

type PermissionItem added in v1.0.1

type PermissionItem struct {
	Id int64 `json:"id"`

	Name     string   `json:"name"`
	Path     string   `json:"path"` //对应权限路径:页面路径/api路径
	Type     string   `json:"type"` //类型, 枚举: menu/action/api,可参考下面的 PermissionType前缀的常量
	Describe string   `json:"describe"`
	Icon     string   `json:"icon"`
	Sort     int      `json:"sort"`
	Pid      int64    `json:"pid"`
	Remark   string   `json:"remark"`
	Status   int      `json:"status"`
	Paths    []string `json:"paths"` //对应的权限路径集合
}

PermissionItem 权限节点数据

type QueryMetricStatDto added in v1.0.2

type QueryMetricStatDto struct {
	MetricId  int64  `json:"metric_id"` //指定测点
	StatType  string `json:"stat_type"` //统计类型,类似:1m,1h,1d
	DataType  string `json:"data_type"` //数据类型,last/avg/min/max/sum/add(增量)
	Timestamp int64  `json:"timestamp"`
	StartTime int64  `json:"start_time"`
	EndTime   int64  `json:"end_time"`
}

type RbacPermissionSimple

type RbacPermissionSimple struct {
	Id int64 `json:"id"`

	Name   string `json:"name"`
	Path   string `json:"path"` //对应权限路径:页面路径/api路径
	Type   string `json:"type"` //类型, 枚举: menu/action/api,可参考下面的 PermissionType前缀的常量
	Icon   string `json:"icon"`
	Sort   int    `json:"sort"`
	Pid    int64  `json:"pid"`
	Status int    `json:"status"`

	Children []*RbacPermissionSimple `json:"children,omitempty" gorm:"-"` //子权限节点列表
}

RbacPermissionSimple 简单返回的permission信息

func (*RbacPermissionSimple) NodeId added in v1.0.2

func (node *RbacPermissionSimple) NodeId() string

func (*RbacPermissionSimple) NodeName added in v1.0.2

func (node *RbacPermissionSimple) NodeName() string

func (*RbacPermissionSimple) NodePid added in v1.0.2

func (node *RbacPermissionSimple) NodePid() string

type RbacRoleSimple

type RbacRoleSimple struct {
	Id int64 `json:"id"`

	Domain string `json:"domain,omitempty"` //所在域(命名空间)
	Name   string `json:"name"`
	Sort   int    `json:"sort"`

	Status int `json:"status"` //0:未知,1:可用,2:禁用
}

RbacRoleSimple 简单返回的role信息

type RegionItem added in v1.0.2

type RegionItem struct {
	Name       string `json:"name"`
	Code       string `json:"code"`        // 行政区域代码
	ParentCode string `json:"parent_code"` //上级行政区域码
	Level      int    `json:"level"`       //行政等级,从1开始
	LevelName  string `json:"level_name"`  //等级名称
}

func DecodeRegionItem added in v1.0.2

func DecodeRegionItem(s string) RegionItem

type RequestInfo added in v1.0.4

type RequestInfo struct {
	Time    time.Time //登录时间
	Ip      string    //ip
	Device  string    //登陆设备名
	Request *http.Request
}

RequestInfo 浏览器访问信息

type SearchAdminLogParams

type SearchAdminLogParams struct {
	Keywords string //查询关键字
	Uid      int64  //指定用户id
	Username string `json:"username"` //查询用户名
}

type SearchAdminParams

type SearchAdminParams struct {
	Keywords string `json:"keywords"`
	Status   int    `json:"status"`
	IsRoot   int    //是否root,-1:全部
}

type SearchBlockContentParams

type SearchBlockContentParams struct {
	Code     string `json:"code"`     //对应块代码
	Type     string `json:"type"`     //块类型
	Keywords string `json:"keywords"` //关键字
	Status   int    `json:"status" example:"0"`
}

SearchBlockContentParams 用户通用记录搜索参数

type SearchCmsArticleParams added in v1.0.4

type SearchCmsArticleParams struct {
	CmsColumn int64  `json:"cms_column"` //指定专栏
	Keywords  string `json:"keywords"`   //关键字
	Status    int    `json:"status" example:"0"`
}

SearchCmsArticleParams cms文章搜索参数

type SearchCmsColumnParams added in v1.0.4

type SearchCmsColumnParams struct {
	Pid      int64  `json:"pid"`      //指定上级专栏id
	Keywords string `json:"keywords"` //关键字
	Status   int    `json:"status" example:"0"`
	Model    string `json:"model"` //指定模型
	All      bool   `json:"all"`   //是否查询全部
}

SearchCmsColumnParams cms专栏搜索参数

type SearchCmsProductParams added in v1.0.4

type SearchCmsProductParams struct {
	CmsColumn int64  `json:"cms_column"` //指定专栏
	Keywords  string `json:"keywords"`   //关键字
	Status    int    `json:"status" example:"0"`
}

SearchCmsProductParams cms文章搜索参数

type SearchGameSaveParams added in v1.0.5

type SearchGameSaveParams struct {
	Uid      int64  `json:"uid"` //指定用户
	Keywords string `json:"keywords"`
}

SearchGameSaveParams 存档记录搜索

type SearchGenericRecordParams

type SearchGenericRecordParams struct {
	Uid      int64  `json:"uid" `
	Type     string `json:"type"`
	Keywords string `json:"keywords"`
}

SearchGenericRecordParams 用户通用记录搜索参数

type SearchIotDeviceParams added in v1.0.4

type SearchIotDeviceParams struct {
	ProductId int64  `json:"product_id"` //指定产品
	Keywords  string `json:"keywords"`   //关键字
	Status    int    `json:"status" example:"0"`
}

SearchIotDeviceParams iot设备搜索参数

type SearchIotProductParams added in v1.0.4

type SearchIotProductParams struct {
	Keywords string `json:"keywords"` //关键字
	Status   int    `json:"status" example:"0"`
}

SearchIotProductParams iot产品搜索参数

type SearchLoginRecordParams

type SearchLoginRecordParams struct {
	Uid      int64
	Keywords string
}

SearchLoginRecordParams 用户登录记录搜索参数

type SearchMetricDataDto added in v1.0.2

type SearchMetricDataDto struct {
	MetricId  int64 `json:"metric_id"` //指定测点
	StartTime int64 `json:"start_time"`
	EndTime   int64 `json:"end_time"`
}

type SearchMetricMetaDto added in v1.0.2

type SearchMetricMetaDto struct {
	Keywords string `json:"keywords"` //关键字搜索
}

type SearchMetricStatDto added in v1.0.2

type SearchMetricStatDto struct {
	MetricId  int64  `json:"metric_id"` //指定测点
	StatType  string `json:"stat_type"` //统计类型,类似:1m,1h,1d
	DataType  string `json:"data_type"` //数据类型,last/avg/min/max/sum/add(增量)
	Timestamp int64  `json:"timestamp"`
	StartTime int64  `json:"start_time"`
	EndTime   int64  `json:"end_time"`
}

type SearchOrganizeParams

type SearchOrganizeParams struct {
	Keywords string `json:"keywords"`
	OrgType  string `json:"org_type"`
	Pid      int64  `json:"pid"`
	PType    int    `json:"pid_type"`  //pid查询类型,0:所有子child,1:只查一级
	Status   int    `json:"status"`    //状态,0:全部
	IsAll    bool   `json:"is_all"`    //是否查询全部
	IsSimple bool   `json:"is_simple"` //是否简易查询
}

SearchOrganizeParams 搜索组织参数

type SearchRbacRoleParams

type SearchRbacRoleParams struct {
	Domain   string `json:"domain"`
	Keywords string `json:"keywords"`
	Status   int    `json:"status"`
	IsAll    bool   `json:"is_all"`    //是否全部
	IsSimple bool   `json:"is_simple"` //是否简单返回
}

type SearchRichContentParams added in v1.0.4

type SearchRichContentParams struct {
	Render string `json:"render"` //指定渲染方式
}

SearchRichContentParams cms文章搜索参数

type SearchRssContentReq added in v1.0.3

type SearchRssContentReq struct {
	Rss string `json:"rss"  extensions:"x-nullable" example:""` //指定rss地址
}

type SearchStatisticalParams

type SearchStatisticalParams struct {
	Date string `json:"date"` //统计日期,如 2024-03-01、2024-05、2024、2024-Q1 各类指定日期
	Name string `json:"name"` //统计名称,如 alarm_count,user_count等
}

SearchStatisticalParams 搜索统计类参数

type SearchUserParams

type SearchUserParams struct {
	Keywords string
	Status   int
}

SearchUserParams 搜索user列表参数集

type SearchUserThirdParams

type SearchUserThirdParams struct {
	ThirdType string `json:"third_type"` //第三方类型
	Uid       int64  // 指定用户id
}

SearchUserThirdParams 搜索第三方用户参数

type SwaggerTreeNode added in v1.0.2

type SwaggerTreeNode struct {
	Id       string             `json:"id"`
	Name     string             `json:"name"`
	Pid      string             `json:"pid"`      //pid
	Children []*SwaggerTreeNode `json:"children"` //子节点
	Data     interface{}        `json:"data"`     //节点数据
}

SwaggerTreeNode 用于swagger生成api数据结构用

type TimeDim added in v1.0.2

type TimeDim struct {
	Value int64  `json:"value"`
	Unit  string `json:"unit"` // m:分钟级别,h:小时级,d:日级别,mo: 月级别,y:年级别

	TimeZone string `json:"timeZone"` //时区
}

TimeDim (TimeDimension) 统计时间维度

func ParseTimeDim added in v1.0.2

func ParseTimeDim(s string) TimeDim

func (TimeDim) String added in v1.0.2

func (dim TimeDim) String() string

func (TimeDim) TimeFormat added in v1.0.2

func (dim TimeDim) TimeFormat(timestamp int64) int64

TimeFormat 时间对齐

type TreeCmsColumnParams added in v1.0.5

type TreeCmsColumnParams struct {
	Pid      int64  `json:"pid"`      //指定上级专栏id
	Keywords string `json:"keywords"` //关键字
	Status   int    `json:"status" example:"0"`
}

TreeCmsColumnParams cms专栏搜索参数

type TreeNode added in v1.0.2

type TreeNode[T interface{}] struct {
	Id       string         `json:"id"`
	Name     string         `json:"name"`
	Pid      string         `json:"pid"`                       //pid
	Children []*TreeNode[T] `json:"children"`                  //子节点
	Data     T              `json:"data" swaggertype:"string"` //节点数据
}

func (*TreeNode[T]) NodeId added in v1.0.2

func (node *TreeNode[T]) NodeId() string

func (*TreeNode[T]) NodeName added in v1.0.2

func (node *TreeNode[T]) NodeName() string

func (*TreeNode[T]) NodePid added in v1.0.2

func (node *TreeNode[T]) NodePid() string

type TreeOrganizeParams added in v1.0.2

type TreeOrganizeParams struct {
	OrgType string `json:"org_type"`
	Pid     int64  `json:"pid"`
	PType   int    `json:"pid_type"` //pid查询类型,0:所有子child,1:只查一级
}

TreeOrganizeParams 搜索组织参数

type UpdateProfileParams added in v1.0.2

type UpdateProfileParams struct {
	Nickname string `json:"nickname"` //昵称
	Avatar   string `json:"avatar"`   //头像
	Email    string `json:"email"`    //邮箱
	Phone    string `json:"phone"`    //手机号
}

type UserRegisterParams

type UserRegisterParams struct {
	//账户密码
	Account  string `json:"account" example:"13488886666"` //账户
	Password string `json:"password" example:"123456"`     //密码
	Nickname string `json:"nickname" example:"demo"`       //昵称
	Avatar   string `json:"avatar" example:"xxx"`          //头像
	Sex      int    `json:"sex" example:"0"`               //性别,0:未知,1:男,2:女

	Phone string `json:"phone" example:"13488886666"` //手机号,都传的情况下优先手机号
	Email string `json:"email" example:"123@qq.com"`  //邮箱
}

type WeatherInfo added in v1.0.2

type WeatherInfo struct {
	Text string `json:"text"` //文本描述
	Temp string `json:"temp"` //温度
	Icon string `json:"icon"` //图标
}

type WeatherRequest added in v1.0.2

type WeatherRequest struct {
	Longitude float64 `json:"longitude"` //经度
	Latitude  float64 `json:"latitude"`  //纬度
	Lang      string  `json:"lang"`      //语言
}

WeatherRequest 天气请求

Directories

Path Synopsis
高德地图接入-行政区域相关
高德地图接入-行政区域相关

Jump to

Keyboard shortcuts

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