request

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	Lang string `json:"lang"`
	Name string `json:"name"`
	// 任意类型
	UUID any `json:"uuid"`
	Team any `json:"team"`
	Corp any `json:"corp"`
}

func NewAccount

func NewAccount(user map[string]any) *Account

func ParseLogin

func ParseLogin(login string) *Account

type Order

type Order struct {
	Field string `json:"field"` // 排序字段
	Order string `json:"order"` // 排序方式
}

type Record

type Record struct {
	// base info
	Model string `json:"model"` // 模型名称
	UUKey string `json:"uukey"` // 模型标示
	LogID string `json:"logid"` // logid
	// debug
	Debug  string `json:"debug,omitempty"`  // 调试数据
	Using  string `json:"using,omitempty"`  // 使用配置
	Scene  string `json:"scene,omitempty"`  // 兼容旧字段,与 OpType 同步
	Action string `json:"action,omitempty"` // 业务操作:load | depart | submit ...

	Value object `json:"value,omitempty"` // 请求数据
	Batch []any  `json:"batch,omitempty"` // 批量处理
	Extra object `json:"extra,omitempty"` // 额外参数
	// 登录用户
	Login *Account `json:"-"`
}

func (*Record) AsSearch

func (self *Record) AsSearch() *Search

AsSearch 将 Record 中与加载元数据、插件、bundle 相关的字段投影为 Search,供 GetSource 等仍基于 Search 的路径使用;不携带 Value/Batch。

func (*Record) GetBase

func (self *Record) GetBase() string

func (*Record) IsInner

func (self *Record) IsInner() bool
type Search struct {
	// base info
	Model string `json:"model"` // 模型名称
	UUKey string `json:"uukey"` // 模型标示
	Scene string `json:"scene"` // 请求场景
	LogID string `json:"logid"` // logid
	// debug
	Debug string `json:"debug,omitempty"` // 调试数据

	// page info
	Page uint16 `json:"page,omitempty"` // 分页索引
	Size uint16 `json:"size,omitempty"` // 分页大小

	// omit if empty
	Using string `json:"using,omitempty"` // 查询字段
	Order *Order `json:"order,omitempty"` // 排序条件
	Query object `json:"query,omitempty"` // 查询条件
	// Value object `json:"value,omitempty"` // 请求数据
	// Batch []any  `json:"batch,omitempty"` // 批量处理
	Extra object `json:"extra,omitempty"` // 额外参数
	// 登录用户
	Login *Account `json:"-"`
}

func NewRequest

func NewRequest(model string, uukey string) *Search

func (*Search) GetBase

func (self *Search) GetBase() string

func (*Search) IsInner

func (self *Search) IsInner() bool

Jump to

Keyboard shortcuts

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