system

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2025 License: MIT Imports: 12 Imported by: 0

README

系统请求记录

用于对系统请求进行记录,记录的内容包括

Documentation

Index

Constants

View Source
const (
	ViewMenu      = "menu"      // 菜单
	ViewPage      = "page"      // 页面
	ViewComponent = "component" // 组件
)

Variables

This section is empty.

Functions

func GetDocDtail

func GetDocDtail(resource *embed.FS) gweb.HandlerFunc

func GetDocs

func GetDocs(resource *embed.FS) gweb.HandlerFunc

func GetIssue

func GetIssue(c *gweb.Context)

func GetLatestVersion

func GetLatestVersion(c *gweb.Context)

func GetSysDictMaps

func GetSysDictMaps(c *gweb.Context)

func GetSysDictOptions added in v1.0.3

func GetSysDictOptions(c *gweb.Context)

func GetSysDicts

func GetSysDicts(c *gweb.Context)

func GetSysDocContent added in v1.0.3

func GetSysDocContent(c *gweb.Context)

func GetSysDocs

func GetSysDocs(c *gweb.Context)

func GetSysIssues

func GetSysIssues(c *gweb.Context)

func GetVersions

func GetVersions(c *gweb.Context)

func LogAppRequest

func LogAppRequest(app *gweb.WebApp)

记录系统请求

func ReplyIssue

func ReplyIssue(c *gweb.Context)

func ReportIssue

func ReportIssue(c *gweb.Context)

func SaveSysRequest added in v1.0.4

func SaveSysRequest(c *gweb.Context, name string)

保存请求数据

func SaveVersion

func SaveVersion(c *gweb.Context)

func UseAuthView

func UseAuthView(app *gweb.WebApp)

func UseDataDict

func UseDataDict(app *gweb.WebApp)

func UseDoc

func UseDoc(app *gweb.WebApp)

UseStaticDoc 集成静态文档功能

func UseIssue

func UseIssue(app *gweb.WebApp)

func UseStaticDoc

func UseStaticDoc(app *gweb.WebApp, resource *embed.FS)

UseStaticDoc 集成静态文档功能

func UseVersion

func UseVersion(app *gweb.WebApp)

Types

type DocInfo

type DocInfo struct {
}

type IssueStatus

type IssueStatus int
const (
	IssueStatusTodo     IssueStatus = iota // 待处理
	IssueStatusHandling                    // 处理中
	IssueStatusDone                        // 已处理
	IssueStatusClosed                      // 已关闭
)

type JSONTags

type JSONTags []string

type SysDict

type SysDict struct {
	base.Model
	Name string `json:"name" gorm:"not null;unique;size:50;comment:名称"`
	Code string `json:"code" gorm:"not null;unique;size:50;comment:标识"`
}

系统数据键

type SysDictOption added in v1.0.3

type SysDictOption struct {
	base.Model
	Value  string `json:"value" gorm:"size:255;comment:值"`
	Sort   int    `json:"sort,omitempty" gorm:"not null;comment:排序"`
	Tags   string `json:"tags,omitempty" gorm:"comment:标签"` // 可以像struct tags一样标记额外信息
	DictID uint   `json:"dict_id,omitempty" gorm:"not null;comment:数据字典"`

	Dict *SysDict `json:"dict,omitempty" gorm:"foreignKey:dict_id"`
}

系统数据值

type SysDoc

type SysDoc struct {
	base.Model

	Name       string                      `json:"title" gorm:"not null;size:100;comment:名称"`
	FilePath   string                      `json:"file_path" gorm:"size:255;comment:文件路径"`
	Usage      string                      `json:"usage" gorm:"size:20;comment:用途"`
	Tags       datatypes.JSONSlice[string] `json:"tags" gorm:"default:'[]'"`
	Size       float64                     `json:"size" gorm:"comment:文件大小"`
	UploaderID uint                        `json:"uploader_id" gorm:"comment:上传人"`

	Uploader *auth.User `json:"uploader" gorm:"foreignKey:uploader_id"`
}

type SysIssue

type SysIssue struct {
	base.Model
	Title        string      `json:"title" gorm:"not null;size:255;comment:标题"`
	Content      string      `json:"content" gorm:"not null;size:2000;comment:内容"`
	ReplyContent string      `json:"reply_content" gorm:"size:2000;comment:回复"`
	CategoryID   uint        `json:"category_id" gorm:"comment:问题类型"`
	ReporterID   uint        `json:"reporter_id" gorm:"not null;comment:报告人"`
	Status       IssueStatus `json:"status" gorm:"not null;comment:状态"`

	Category *SysDictOption `json:"category,omitempty" gorm:"foreignKey:category_id"`
	Reporter *auth.User     `json:"reporter,omitempty" gorm:"foreignKey:reporter_id"`
}

系统问题

type SysRequest added in v1.0.3

type SysRequest struct {
	ID          string         `json:"id" gorm:"primaryKey"`
	Host        string         `json:"host" gorm:"size:20;not null"`
	Method      string         `json:"method" gorm:"size:4;not null"`
	RoutePath   string         `json:"route_path" gorm:"size:50;not null"`
	RouteName   string         `json:"route_name" gorm:"size:100;comment:路由名称"`
	Data        datatypes.JSON `json:"data"`
	RequestTime time.Time      `json:"request_time" gorm:"not null"`
	UserID      uint           `json:"user"`
}

type SysVersion

type SysVersion struct {
	base.Model
	Version string `json:"version" gorm:"not null;size:10;comment:版本"`
	Summary string `json:"summary" gorm:"size:50;comment:名称"`
	Detail  string `json:"detail" gorm:"size:500;comment:更新内容"`
	IsMajor bool   `json:"is_major" gorm:"default:false;comment:是否主版本"`
}

系统版本

type SysViewAuth

type SysViewAuth struct {
	ElementKey   string `json:"element_key" gorm:"primaryKey;comment:元素key"`
	RoleID       uint   `json:"role_id" gorm:"primaryKey;comment:角色ID"`
	AuthorizerID uint   `json:"authorizer_id" gorm:"not null;comment:授权人ID"`

	Authorizer *auth.User      `json:"authorizer,omitempty" gorm:"foreignKey:authorizer_id"`
	Role       *auth.Role      `json:"role,omitempty" gorm:"foreignKey:role_id"`
	Element    *SysViewElement `json:"element,omitempty" gorm:"foreignKey:element_key"`
}

type SysViewElement

type SysViewElement struct {
	Key        string     `json:"key" gorm:"primaryKey;size:255;comment:组件Key"`
	Name       string     `json:"name" gorm:"not null;size:50;comment:名称"`
	RouteName  string     `json:"route_name" gorm:"not null;index;size:50;comment:前端路由名称"`
	ParentKey  string     `json:"parent_key,omitempty" gorm:"comment:父元素ID"`
	Desc       string     `json:"desc" gorm:"size:500;comment:描述"`
	Type       string     `json:"type" gorm:"not null;comment:类型ID"`
	Tooltip    string     `json:"tooltip" gorm:"comment:系统提示帮助"`
	CreateTime *time.Time `gorm:"not null;default:CURRENT_TIMESTAMP(3);comment:创建时间" json:"create_time,omitempty"`
	UpdateTime *time.Time `gorm:"default:NULL on update CURRENT_TIMESTAMP(3);comment:更新时间" json:"update_time,omitempty"`

	Parent *SysViewElement `json:"parent,omitempty" gorm:"foreignKey:parent_key"`
}

视图元素

Jump to

Keyboard shortcuts

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