backend

package
v0.0.0-...-49cc056 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2024 License: Apache-2.0 Imports: 44 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BindTypeJson = iota
	BindTypeForm

	OpList = iota
	OpAdd
	OpEdit
	OpDel
	OpInfo
)
View Source
const (
	B  = 1
	KB = 1024 * B
	MB = 1024 * KB
	GB = 1024 * MB
)

Variables

This section is empty.

Functions

func ArrayCol

func ArrayCol(arr interface{}, col string) []interface{}

func ArrayColMap

func ArrayColMap(arr interface{}, col string) map[interface{}]interface{}

Types

type AdController

type AdController struct {
	BaseController
}

func (*AdController) Construct

func (c *AdController) Construct()

type AdSpaceController

type AdSpaceController struct {
	BaseController
}

func (*AdSpaceController) Construct

func (c *AdSpaceController) Construct()

type Address

type Address struct {
	Country  string `json:"Country"`
	Province string `json:"Province"`
	City     string `json:"City"`
}

type AdminRoleController

type AdminRoleController struct {
	BaseController
}

func (*AdminRoleController) Construct

func (c *AdminRoleController) Construct()

func (*AdminRoleController) PostAdd

func (c *AdminRoleController) PostAdd()

func (*AdminRoleController) PostEdit

func (c *AdminRoleController) PostEdit()

type AssetsManagerController

type AssetsManagerController struct {
	BaseController
	// contains filtered or unexported fields
}

AssetsManagerController Deprecated: 废弃

func (*AssetsManagerController) Construct

func (c *AssetsManagerController) Construct()

func (*AssetsManagerController) GetInfo

func (c *AssetsManagerController) GetInfo()

func (*AssetsManagerController) GetSelect

func (c *AssetsManagerController) GetSelect()

func (*AssetsManagerController) GetThemes

func (c *AssetsManagerController) GetThemes()

func (*AssetsManagerController) GetThumb

func (c *AssetsManagerController) GetThumb()

func (*AssetsManagerController) PostAdd

func (c *AssetsManagerController) PostAdd(orm *xorm.Engine)

func (*AssetsManagerController) PostEdit

func (c *AssetsManagerController) PostEdit()

func (*AssetsManagerController) PostList

func (c *AssetsManagerController) PostList()

func (*AssetsManagerController) PostTheme

func (c *AssetsManagerController) PostTheme(cache cache.AbstractCache)

type AttachmentController

type AttachmentController struct {
	BaseController
}

func (*AttachmentController) Construct

func (c *AttachmentController) Construct()

func (*AttachmentController) PostAdd

func (c *AttachmentController) PostAdd()

type AttachmentTypeController

type AttachmentTypeController struct {
	BaseController
}

func (*AttachmentTypeController) Construct

func (c *AttachmentTypeController) Construct()

func (*AttachmentTypeController) PostList

func (c *AttachmentTypeController) PostList()

type BaseController

type BaseController struct {
	LastErr error // 最后一次错误对象

	SearchFields   []SearchFieldDsl // 设置可以搜索的字段 接收或匹配params的字段
	BindType       uint             // 表单绑定类型
	KeywordsSearch []SearchFieldDsl // 关键字搜索字段 用于关键字匹配字段
	Table          interface{}      // 传入Table结构体引用
	Entries        interface{}      // 传入Table结构体的切片
	Orm            *xorm.Engine
	P              listParam

	ExceptCols []string // 排除数据表字段不读取
	Cols       []string // 仅读取指定表字段

	TableKey       string // 表主键
	TableStructKey string // 表结构体主键字段 主要用于更新逻辑反射数据

	OpBefore func(int, interface{}) error // 操作前置
	OpAfter  func(int, interface{}) error // 操作后置

	apidoc.Entity
	ApiEntityName string

	SelectOp    func(*xorm.Session)      // select下拉列表条件构建函数, 一般用于过滤指定值的数据
	UniqCheckOp func(int, *xorm.Session) // 唯一性校验构建SQL方法 一般用于删除或关停等校验是否有关联数据使用阻止关闭

	SelectListKV struct {
		Key   string
		Value string
	}

	pine.Controller
	// contains filtered or unexported fields
}

func (*BaseController) BindParse

func (c *BaseController) BindParse() (err error)

func (*BaseController) Construct

func (c *BaseController) Construct()

Construct 默认初始化数据

func (*BaseController) GetInfo

func (c *BaseController) GetInfo()

func (*BaseController) GetSelect

func (c *BaseController) GetSelect()

func (*BaseController) PostAdd

func (c *BaseController) PostAdd()

func (*BaseController) PostDelete

func (c *BaseController) PostDelete()

func (*BaseController) PostEdit

func (c *BaseController) PostEdit()

func (*BaseController) PostList

func (c *BaseController) PostList()

func (*BaseController) PostUpdate

func (c *BaseController) PostUpdate()

type CategoryController

type CategoryController struct {
	BaseController
	// contains filtered or unexported fields
}

func (*CategoryController) Construct

func (c *CategoryController) Construct()

func (*CategoryController) GetSelect

func (c *CategoryController) GetSelect()

type ContentController

type ContentController struct {
	BaseController
}

func (*ContentController) Construct

func (c *ContentController) Construct()

func (*ContentController) GetInfo

func (c *ContentController) GetInfo()

func (*ContentController) GetPage

func (c *ContentController) GetPage()

func (*ContentController) PostDelete

func (c *ContentController) PostDelete()

func (*ContentController) PostEdit

func (c *ContentController) PostEdit()

PostEdit 编辑内容

func (*ContentController) PostList

func (c *ContentController) PostList()

func (*ContentController) PostPage

func (c *ContentController) PostPage()

type Cpu

type Cpu struct {
	Cpus       []float64 `json:"cpus"`
	Cores      int       `json:"cores"`
	CpuPercent []float64 `json:"cpu_percent"`
}

type DatabaseBackupController

type DatabaseBackupController struct {
	BaseController
}

func (*DatabaseBackupController) BackupDelete

func (c *DatabaseBackupController) BackupDelete()

func (*DatabaseBackupController) BackupDownload

func (c *DatabaseBackupController) BackupDownload()

func (*DatabaseBackupController) BackupList

func (c *DatabaseBackupController) BackupList()

func (*DatabaseBackupController) RegisterRoute

func (c *DatabaseBackupController) RegisterRoute(b pine.IRouterWrapper)

type DatabaseController

type DatabaseController struct {
	pine.Controller
}

func (*DatabaseController) Backup

func (c *DatabaseController) Backup()

func (*DatabaseController) Manager

func (c *DatabaseController) Manager(orm *xorm.Engine, cache cache.AbstractCache)

func (*DatabaseController) Optimize

func (c *DatabaseController) Optimize(orm *xorm.Engine)

func (*DatabaseController) RegisterRoute

func (c *DatabaseController) RegisterRoute(b pine.IRouterWrapper)

func (*DatabaseController) Repair

func (c *DatabaseController) Repair(orm *xorm.Engine)

type DepartmentController

type DepartmentController struct {
	BaseController
}

func (*DepartmentController) Construct

func (c *DepartmentController) Construct()

func (*DepartmentController) GetSelect

func (c *DepartmentController) GetSelect()

type DictCategoryController

type DictCategoryController struct {
	BaseController
}

func (*DictCategoryController) Construct

func (c *DictCategoryController) Construct()

func (*DictCategoryController) GetSelect

func (c *DictCategoryController) GetSelect()

type DictController

type DictController struct {
	BaseController
}

func (*DictController) Construct

func (c *DictController) Construct()

func (*DictController) GetSelect

func (c *DictController) GetSelect()

type Disk

type Disk struct {
	UsedMB      int `json:"usedMb"`
	UsedGB      int `json:"usedGb"`
	TotalMB     int `json:"totalMb"`
	TotalGB     int `json:"totalGb"`
	UsedPercent int `json:"usedPercent"`
}

type DistrictController

type DistrictController struct {
	BaseController
}

func (*DistrictController) Construct

func (c *DistrictController) Construct()

func (*DistrictController) GetSelect

func (c *DistrictController) GetSelect()

func (*DistrictController) PostImport

func (c *DistrictController) PostImport()

PostImport 导入外部数据库

func (*DistrictController) PostList

func (c *DistrictController) PostList()

type DocumentController

type DocumentController struct {
	BaseController
	// contains filtered or unexported fields
}

func (*DocumentController) Construct

func (c *DocumentController) Construct()

func (*DocumentController) GetSelect

func (c *DocumentController) GetSelect()

func (*DocumentController) GetSql

func (c *DocumentController) GetSql(orm *xorm.Engine)

func (*DocumentController) GetTable

func (c *DocumentController) GetTable(cacher cache.AbstractCache)

type ErrorLogController

type ErrorLogController struct {
	BaseController
}

func (*ErrorLogController) Construct

func (c *ErrorLogController) Construct()

func (*ErrorLogController) PostClear

func (c *ErrorLogController) PostClear()

type FieldShowInPageList

type FieldShowInPageList struct {
	Forms []KV `json:"forms"`
	List  []KV `json:"list"`
}

type FormControl

type FormControl struct {
	Type             string        `json:"type"`
	Name             string        `json:"name"`
	Label            string        `json:"label"`
	Value            interface{}   `json:"value"`
	Options          []KV          `json:"options"`
	Validations      string        `json:"validations"`
	Required         bool          `json:"required"`
	Description      string        `json:"description"`
	Placeholder      string        `json:"placeholder"`
	ValidationErrors string        `json:"validationErrors"`
	Multiple         bool          `json:"multiple"`
	Precision        int           `json:"precision"`
	Inline           bool          `json:"inline"`
	Buttons          []interface{} `json:"buttons"`
	Limits           []string      `json:"limits"`
	LimitsLogic      string        `json:"limitsLogic"`
}

type FormController

type FormController struct {
	Title    string        `json:"title"`
	Api      string        `json:"api"`
	Type     string        `json:"type"`
	Mode     string        `json:"mode"`
	Controls []FormControl `json:"controls"`
}

type IPLocate

type IPLocate struct {
	Result  bool    `json:"result"`
	IP      string  `json:"IP"`
	Address Address `json:"Address"`
	ISP     string  `json:"ISP"`
}

type ImSessionController

type ImSessionController struct {
	pine.Controller
}

func (*ImSessionController) MessagePage

func (c *ImSessionController) MessagePage()

func (*ImSessionController) RegisterRoute

func (c *ImSessionController) RegisterRoute(b pine.IRouterWrapper)

func (*ImSessionController) SessionPage

func (c *ImSessionController) SessionPage()

func (*ImSessionController) SessionUnreadCount

func (c *ImSessionController) SessionUnreadCount()

type IndexController

type IndexController struct {
	pine.Controller
}

func (*IndexController) Main

func (c *IndexController) Main(orm *xorm.Engine, iCache cache.AbstractCache)

func (*IndexController) RegisterRoute

func (c *IndexController) RegisterRoute(b pine.IRouterWrapper)

type KV

type KV struct {
	Label   string      `json:"label"`
	Value   interface{} `json:"value"`
	Name    string      `json:"-"`
	Checked bool        `json:"-"`
}

type LevelController

type LevelController struct {
	BaseController
}

func (*LevelController) Construct

func (c *LevelController) Construct()

type LinkController

type LinkController struct {
	BaseController
}

func (*LinkController) Construct

func (c *LinkController) Construct()

type LogController

type LogController struct {
	BaseController
}

func (*LogController) Construct

func (c *LogController) Construct()

func (*LogController) PostClear

func (c *LogController) PostClear()

type LoginController

type LoginController struct {
	pine.Controller
}

func (*LoginController) Login

func (c *LoginController) Login()

func (*LoginController) RegisterRoute

func (c *LoginController) RegisterRoute(b pine.IRouterWrapper)

type MemberController

type MemberController struct {
	BaseController
}

func (*MemberController) Construct

func (c *MemberController) Construct()

type MemberGroupController

type MemberGroupController struct {
	BaseController
}

func (*MemberGroupController) Construct

func (c *MemberGroupController) Construct()

func (*MemberGroupController) GetSelect

func (c *MemberGroupController) GetSelect()
type MenuController struct {
	BaseController
}
func (c *MenuController) Construct()
func (c *MenuController) PostList()
type MenuV2 struct {
	Path            string   `json:"path"`
	Label           string   `json:"label"`
	NodePath        string   `json:"nodePath"`
	Exact           bool     `json:"exact"`
	Icon            string   `json:"icon"`
	PathToComponent string   `json:"pathToComponent"`
	SideVisible     bool     `json:"sideVisible"`
	Children        []MenuV2 `json:"children"`
}

type Net

type Net struct {
	BytesRecv uint64 `json:"recv"`
	BytesSent uint64 `json:"send"`
	Name      string `json:"name"`
}

type Os

type Os struct {
	GOOS         string `json:"goos"`
	NumCPU       int    `json:"numCpu"`
	Compiler     string `json:"compiler"`
	GoVersion    string `json:"goVersion"`
	NumGoroutine int    `json:"numGoroutine"`
}

type PluginController

type PluginController struct {
	BaseController
}

func (*PluginController) Construct

func (c *PluginController) Construct()

func (*PluginController) GetConfig

func (c *PluginController) GetConfig()

func (*PluginController) PostConfig

func (c *PluginController) PostConfig()

func (*PluginController) PostEnable

func (c *PluginController) PostEnable()

func (*PluginController) PostInstall

func (c *PluginController) PostInstall()

type PositionController

type PositionController struct {
	BaseController
}

func (*PositionController) Construct

func (c *PositionController) Construct()

type PublicController

type PublicController struct {
	BaseController
}

func (*PublicController) GetApidoc

func (c *PublicController) GetApidoc()

func (*PublicController) GetCaptcha

func (c *PublicController) GetCaptcha()

func (*PublicController) GetMenu

func (c *PublicController) GetMenu()

func (*PublicController) GetPprof

func (c *PublicController) GetPprof()

func (*PublicController) GetStatsviz

func (c *PublicController) GetStatsviz()

func (*PublicController) PostUpload

func (c *PublicController) PostUpload()

type Rrm

type Rrm struct {
	UsedMB      int `json:"usedMb"`
	TotalMB     int `json:"totalMb"`
	UsedPercent int `json:"usedPercent"`
}

type SearchFieldDsl

type SearchFieldDsl struct {
	Field    string                              // 字段
	Op       string                              // 操作字符	默认为 =
	DataExp  string                              // 数据匹配格式 匹配值=$? 如 LIKE %$?% 默认=$?
	SkipFn   func(interface{}) bool              // 校验某些值不作为筛选条件如: 0, false不筛选状态
	CallBack func(*xorm.Session, ...interface{}) // 替换callback 如果设置, 将绝对忽略Field Op DataExp的设置 匹配值=$?
}

type Server

type Server struct {
	Nets           []*Net    `json:"nets"`
	Os             Os        `json:"os"`
	Cpu            Cpu       `json:"cpu"`
	Rrm            Rrm       `json:"ram"`
	Disk           Disk      `json:"disk"`
	RunningTime    int64     `json:"running_time"`
	StartTime      string    `json:"start_time"`
	PineVersion    string    `json:"pine_version"`
	PineCmsVersion string    `json:"pine_cms_version"`
	XormVersion    string    `json:"xorm_version"`
	LocalIp        string    `json:"local_ip"`
	OutIp          *IPLocate `json:"out_ip"`
	MysqlVersion   string    `json:"mysql_version"`
}

type SettingController

type SettingController struct {
	BaseController
}

func (*SettingController) Construct

func (c *SettingController) Construct()

func (*SettingController) PostGroups

func (c *SettingController) PostGroups()

PostGroups 获取新分组

func (*SettingController) PostTest

func (c *SettingController) PostTest()

type StatController

type StatController struct {
	pine.Controller
}

func (*StatController) GetData

func (stat *StatController) GetData(orm *xorm.Engine, cacher cache.AbstractCache)

func (StatController) GetLocalIP

func (_ StatController) GetLocalIP() (ip string, err error)

func (StatController) GetOutIp

func (_ StatController) GetOutIp() (*IPLocate, error)

func (*StatController) InitCPU

func (_ *StatController) InitCPU() (c Cpu, err error)

func (*StatController) InitDisk

func (_ *StatController) InitDisk() (d Disk, err error)

func (*StatController) InitNet

func (_ *StatController) InitNet() (useages []*Net, err error)

func (*StatController) InitOS

func (_ *StatController) InitOS() (o Os)

func (*StatController) InitRAM

func (_ *StatController) InitRAM() (r Rrm, err error)

type TableController

type TableController struct {
	BaseController
}

func (*TableController) Construct

func (c *TableController) Construct()

func (TableController) GetFields

func (c TableController) GetFields()

type TabsSchema

type TabsSchema struct {
	Title string         `json:"title"`
	Hash  string         `json:"hash"`
	Body  FormController `json:"body"`
}

type TagsController

type TagsController struct {
	BaseController
}

func (*TagsController) Construct

func (c *TagsController) Construct()

type ThemeConfig

type ThemeConfig struct {
	Name        string                 `json:"name"`
	Author      string                 `json:"author"`
	Description string                 `json:"description"`
	Extra       map[string]interface{} `json:"extra"`
	IsDefault   bool                   `json:"is_default"`
	Dir         string                 `json:"dir"`
}

type UserController

type UserController struct {
	BaseController
}

func (*UserController) Construct

func (c *UserController) Construct()

func (*UserController) GetAdminInfo

func (c *UserController) GetAdminInfo()

func (*UserController) PostLogout

func (c *UserController) PostLogout()

func (*UserController) PostPersonUpdate

func (c *UserController) PostPersonUpdate()

Jump to

Keyboard shortcuts

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