Documentation
¶
Index ¶
- type ApisController
- func (a *ApisController) ArgsSchema(ctx http.Context) http.Response
- func (a *ApisController) Destroy(ctx http.Context) http.Response
- func (a *ApisController) Index(ctx http.Context) http.Response
- func (a *ApisController) Show(ctx http.Context) http.Response
- func (a *ApisController) Store(ctx http.Context) http.Response
- func (a *ApisController) Templates(ctx http.Context) http.Response
- func (a *ApisController) Update(ctx http.Context) http.Response
- type AuthController
- func (a *AuthController) Captcha(ctx http.Context) http.Response
- func (a *AuthController) CurrentUser(ctx http.Context) http.Response
- func (a *AuthController) Get(key string, default_ any, fresh bool) any
- func (a *AuthController) Login(ctx http.Context) http.Response
- func (a *AuthController) LoginPage(ctx http.Context) http.Response
- func (a *AuthController) Logout(ctx http.Context) http.Response
- func (a *AuthController) Register(ctx http.Context) http.Response
- type Controller
- type ControllerImpl
- func (c *ControllerImpl[T]) ActionOfExport(ctx http.Context) bool
- func (c *ControllerImpl[T]) ActionOfGetData(ctx http.Context) bool
- func (c *ControllerImpl[T]) ActionOfQuickEdit(ctx http.Context) bool
- func (c *ControllerImpl[T]) ActionOfQuickEditItem(ctx http.Context) bool
- func (a *ControllerImpl[T]) BackButton(ctx http.Context) *renderers.OtherAction
- func (c *ControllerImpl[T]) BaseCRUD(ctx http.Context) *renderers.CRUDTable
- func (c *ControllerImpl[T]) BaseDetail(ctx http.Context) *renderers.Form
- func (c *ControllerImpl[T]) BaseFilter() *renderers.Form
- func (c *ControllerImpl[T]) BaseFilterConditionBuilder(ctx http.Context) *renderers.ConditionBuilderControl
- func (c *ControllerImpl[T]) BaseForm(ctx http.Context, back bool) *renderers.Form
- func (c *ControllerImpl[T]) BaseHeaderToolBar() []any
- func (c *ControllerImpl[T]) BaseList(crud any) *renderers.Page
- func (c *ControllerImpl[T]) BasePage() *renderers.Page
- func (c *ControllerImpl[T]) BulkDeleteButton(ctx http.Context) *renderers.DialogAction
- func (c *ControllerImpl[T]) ChunkUpload(ctx http.Context) http.Response
- func (c *ControllerImpl[T]) ChunkUploadFinish(ctx http.Context) http.Response
- func (c *ControllerImpl[T]) ChunkUploadStart(ctx http.Context) http.Response
- func (c *ControllerImpl[T]) CreateButton(ctx http.Context, form *renderers.Form, dialog bool, size string, title string, ...) *renderers.LinkAction
- func (c *ControllerImpl[T]) ExportAction(ctx http.Context, disableSelectedItem bool) *renderers.Service
- func (c *ControllerImpl[T]) ExportRows(ctx http.Context, sheet string, headers []string, rows [][]any) http.Response
- func (c *ControllerImpl[T]) GetBulkDeletePath(ctx http.Context) string
- func (c *ControllerImpl[T]) GetCreatePath(ctx http.Context) string
- func (c *ControllerImpl[T]) GetDeletePath(ctx http.Context, primaryKey ...string) string
- func (c *ControllerImpl[T]) GetEditGetDataPath(ctx http.Context, primaryKey ...string) string
- func (c *ControllerImpl[T]) GetEditPath(ctx http.Context, primaryKey ...string) string
- func (c *ControllerImpl[T]) GetExportPath(ctx http.Context) string
- func (c *ControllerImpl[T]) GetListGetDataPath(ctx http.Context) string
- func (c *ControllerImpl[T]) GetListPath(ctx http.Context) string
- func (c *ControllerImpl[T]) GetQuickEditItemPath(ctx http.Context) string
- func (c *ControllerImpl[T]) GetQuickEditPath(ctx http.Context) string
- func (c *ControllerImpl[T]) GetShowGetDataPath(ctx http.Context) (string, error)
- func (c *ControllerImpl[T]) GetShowPath(ctx http.Context, primaryKey ...string) string
- func (c *ControllerImpl[T]) GetStorePath(ctx http.Context) string
- func (c *ControllerImpl[T]) GetUpdatePath(ctx http.Context, primaryKey ...string) string
- func (c *ControllerImpl[T]) HandleValidationErrors(ctx http.Context, rules map[string]string, messages map[string]string) (bool, http.Response)
- func (c *ControllerImpl[T]) RowActions(ctx http.Context, form *renderers.Form, dialog any, size string) *renderers.Operation
- func (c *ControllerImpl[T]) RowDeleteButton(ctx http.Context, title string) *renderers.DialogAction
- func (c *ControllerImpl[T]) RowEditButton(ctx http.Context, form *renderers.Form, dialog bool, size string, title string, ...) *renderers.LinkAction
- func (c *ControllerImpl[T]) RowShowButton(ctx http.Context, form *renderers.Form, dialog bool, size string, title string, ...) *renderers.LinkAction
- func (c *ControllerImpl[T]) UploadFile(ctx http.Context) http.Response
- func (c *ControllerImpl[T]) UploadFilePath(ctx http.Context) string
- func (c *ControllerImpl[T]) UploadImage(ctx http.Context) http.Response
- func (c *ControllerImpl[T]) UploadImagePath(ctx http.Context) string
- func (c *ControllerImpl[T]) UploadRich(ctx http.Context) http.Response
- func (c *ControllerImpl[T]) UploadRichPath(ctx http.Context) string
- type ExtensionsController
- func (e *ExtensionsController) Destroy(ctx http.Context) http.Response
- func (e *ExtensionsController) Disable(ctx http.Context) http.Response
- func (e *ExtensionsController) Enable(ctx http.Context) http.Response
- func (e *ExtensionsController) Index(ctx http.Context) http.Response
- func (e *ExtensionsController) Show(ctx http.Context) http.Response
- func (e *ExtensionsController) Store(ctx http.Context) http.Response
- func (e *ExtensionsController) Update(ctx http.Context) http.Response
- type Extra
- type HomeController
- func (h *HomeController) Destroy(ctx http.Context) http.Response
- func (h *HomeController) Index(ctx http.Context) http.Response
- func (h *HomeController) Show(ctx http.Context) http.Response
- func (h *HomeController) Store(ctx http.Context) http.Response
- func (h *HomeController) Update(ctx http.Context) http.Response
- type IndexController
- func (i *IndexController) DownloadExport(c http.Context) http.Response
- func (i *IndexController) FileUpload(c http.Context) http.Response
- func (i *IndexController) GetCurrentUser()
- func (i *IndexController) GetDashBoard()
- func (i *IndexController) GetMenus(ctx http.Context) http.Response
- func (i *IndexController) GetSetting(ctx http.Context) http.Response
- func (i *IndexController) GetUserSetting()
- func (i *IndexController) IconifySearch(ctx http.Context) http.Response
- func (i *IndexController) ImageUpload(c http.Context) http.Response
- func (i *IndexController) NoContext(ctx http.Context) http.Response
- func (i *IndexController) PageSchema(ctx http.Context) http.Response
- func (i *IndexController) PutUserSetting()
- func (i *IndexController) RichFileUpload(c http.Context) http.Response
- func (i *IndexController) SaveSetting(ctx http.Context) http.Response
- func (i *IndexController) SearchIcon()
- type MenuController
- func (m *MenuController) Destroy(ctx http.Context) http.Response
- func (m *MenuController) Index(ctx http.Context) http.Response
- func (m *MenuController) SaveOrder(ctx http.Context) http.Response
- func (m *MenuController) Show(ctx http.Context) http.Response
- func (m *MenuController) Store(ctx http.Context) http.Response
- func (m *MenuController) Update(ctx http.Context) http.Response
- type PagesController
- func (p *PagesController) Destroy(ctx http.Context) http.Response
- func (p *PagesController) Index(ctx http.Context) http.Response
- func (p *PagesController) Options(ctx http.Context) http.Response
- func (p *PagesController) Show(ctx http.Context) http.Response
- func (p *PagesController) Store(ctx http.Context) http.Response
- func (p *PagesController) Update(ctx http.Context) http.Response
- type PermissionController
- func (p *PermissionController) AutoGenerate(ctx http.Context) http.Response
- func (p *PermissionController) Destroy(ctx http.Context) http.Response
- func (p *PermissionController) GetHttpMethodOptions(ctx http.Context) http.Response
- func (p *PermissionController) GetHttpPathOptions(ctx http.Context) http.Response
- func (p *PermissionController) GetRolesByPermission(ctx http.Context) http.Response
- func (p *PermissionController) Index(ctx http.Context) http.Response
- func (p *PermissionController) Options(ctx http.Context) http.Response
- func (p *PermissionController) Show(ctx http.Context) http.Response
- func (p *PermissionController) Store(ctx http.Context) http.Response
- func (p *PermissionController) TreeOptions(ctx http.Context) http.Response
- func (p *PermissionController) Update(ctx http.Context) http.Response
- type RelationshipsController
- func (r *RelationshipsController) Destroy(ctx http.Context) http.Response
- func (r *RelationshipsController) Index(ctx http.Context) http.Response
- func (r *RelationshipsController) Show(ctx http.Context) http.Response
- func (r *RelationshipsController) Store(ctx http.Context) http.Response
- func (r *RelationshipsController) Types(ctx http.Context) http.Response
- func (r *RelationshipsController) Update(ctx http.Context) http.Response
- type RoleController
- func (r *RoleController) AssignPermissions(ctx http.Context) http.Response
- func (r *RoleController) Destroy(ctx http.Context) http.Response
- func (r *RoleController) Detail(ctx http.Context) http.Response
- func (r *RoleController) Form(ctx http.Context) *renderers.Form
- func (r *RoleController) GetPermissions(ctx http.Context) http.Response
- func (r *RoleController) Index(ctx http.Context) http.Response
- func (r *RoleController) Options(ctx http.Context) http.Response
- func (r *RoleController) SavePermissions(ctx http.Context) http.Response
- func (r *RoleController) Show(ctx http.Context) http.Response
- func (r *RoleController) Store(ctx http.Context) http.Response
- func (r *RoleController) Update(ctx http.Context) http.Response
- type UserController
- func (r *UserController) Destroy(ctx http.Context) http.Response
- func (a *UserController) GetUserSetting(ctx http.Context) http.Response
- func (r *UserController) Index(ctx http.Context) http.Response
- func (a *UserController) List(ctx http.Context) *renderers.Page
- func (u *UserController) PutUserSetting(c http.Context) http.Response
- func (r *UserController) Show(ctx http.Context) http.Response
- func (r *UserController) Store(ctx http.Context) http.Response
- func (r *UserController) Update(ctx http.Context) http.Response
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ApisController ¶
type ApisController struct {
*ControllerImpl[*services.AdminApiService]
}
ApisController 负责「开发者工具 - 动态 API」。
与 owl-admin 的差异:模板是编译期注册的 handler,不能在后台粘贴代码即时生效, 因此这里只做接口记录(路径 + 模板 + 参数)的维护。
func NewApisController ¶
func NewApisController() *ApisController
func (*ApisController) ArgsSchema ¶
func (a *ApisController) ArgsSchema(ctx http.Context) http.Response
ArgsSchema 返回指定模板的参数 schema。
type AuthController ¶
type AuthController struct {
*Controller
*services.AdminUserService
*services.AdminSettingService
// contains filtered or unexported fields
}
func NewAuthController ¶
func NewAuthController() *AuthController
func (*AuthController) Captcha ¶
func (a *AuthController) Captcha(ctx http.Context) http.Response
Captcha 生成登录验证码。
返回结构对齐 owl-admin:captcha_img 为可直接渲染的 data URI, sys_captcha 是答案在缓存中的键,登录时需要原样回传。
func (*AuthController) CurrentUser ¶
func (a *AuthController) CurrentUser(ctx http.Context) http.Response
type ControllerImpl ¶
type ControllerImpl[T any] struct { Service T *response.ErrorHandler Extra Extra }
func NewAdminController ¶
func NewAdminController[T any](service T, extra ...Extra) *ControllerImpl[T]
func (*ControllerImpl[T]) ActionOfExport ¶
func (c *ControllerImpl[T]) ActionOfExport(ctx http.Context) bool
func (*ControllerImpl[T]) ActionOfGetData ¶
func (c *ControllerImpl[T]) ActionOfGetData(ctx http.Context) bool
func (*ControllerImpl[T]) ActionOfQuickEdit ¶
func (c *ControllerImpl[T]) ActionOfQuickEdit(ctx http.Context) bool
func (*ControllerImpl[T]) ActionOfQuickEditItem ¶
func (c *ControllerImpl[T]) ActionOfQuickEditItem(ctx http.Context) bool
func (*ControllerImpl[T]) BackButton ¶
func (a *ControllerImpl[T]) BackButton(ctx http.Context) *renderers.OtherAction
*
- 返回列表按钮
func (*ControllerImpl[T]) BaseCRUD ¶
func (c *ControllerImpl[T]) BaseCRUD(ctx http.Context) *renderers.CRUDTable
基础 CRUD
func (*ControllerImpl[T]) BaseDetail ¶
func (c *ControllerImpl[T]) BaseDetail(ctx http.Context) *renderers.Form
基础详情
func (*ControllerImpl[T]) BaseFilter ¶
func (c *ControllerImpl[T]) BaseFilter() *renderers.Form
基础筛选器
func (*ControllerImpl[T]) BaseFilterConditionBuilder ¶
func (c *ControllerImpl[T]) BaseFilterConditionBuilder(ctx http.Context) *renderers.ConditionBuilderControl
基础筛选 - 条件构造器
func (*ControllerImpl[T]) BaseHeaderToolBar ¶
func (c *ControllerImpl[T]) BaseHeaderToolBar() []any
基础顶部工具栏
func (*ControllerImpl[T]) BaseList ¶
func (c *ControllerImpl[T]) BaseList(crud any) *renderers.Page
基础列表 #
func (*ControllerImpl[T]) BasePage ¶
func (c *ControllerImpl[T]) BasePage() *renderers.Page
*
- 获取基础页面
func (*ControllerImpl[T]) BulkDeleteButton ¶
func (c *ControllerImpl[T]) BulkDeleteButton(ctx http.Context) *renderers.DialogAction
* * 批量删除按钮
func (*ControllerImpl[T]) ChunkUpload ¶
func (c *ControllerImpl[T]) ChunkUpload(ctx http.Context) http.Response
ChunkUpload 接收单个分片,返回该分片的 md5 供合并时校验。
func (*ControllerImpl[T]) ChunkUploadFinish ¶
func (c *ControllerImpl[T]) ChunkUploadFinish(ctx http.Context) http.Response
ChunkUploadFinish 合并分片并落盘。
partList 按前端给的顺序合并,每片都会与之前返回的 eTag 对比;任一不匹配 直接失败并清理临时目录,避免半成品污染上传目录。
func (*ControllerImpl[T]) ChunkUploadStart ¶
func (c *ControllerImpl[T]) ChunkUploadStart(ctx http.Context) http.Response
ChunkUploadStart 开启一次分块上传,返回会话 id。
func (*ControllerImpl[T]) CreateButton ¶
func (c *ControllerImpl[T]) CreateButton(ctx http.Context, form *renderers.Form, dialog bool, size string, title string, _type string) *renderers.LinkAction
创建按钮
func (*ControllerImpl[T]) ExportAction ¶
func (c *ControllerImpl[T]) ExportAction(ctx http.Context, disableSelectedItem bool) *renderers.Service
导出按钮 ?
结构与 owl-admin 保持一致:一个带 loading 遮罩的下拉按钮,点「导出」时 请求当前列表接口(_action=export)拿到签名后的下载信息,再打开下载地址。
func (*ControllerImpl[T]) ExportRows ¶
func (c *ControllerImpl[T]) ExportRows(ctx http.Context, sheet string, headers []string, rows [][]any) http.Response
ExportRows 是控制器的通用导出入口,子类提供表头与数据行即可。
func (*ControllerImpl[T]) GetBulkDeletePath ¶
func (c *ControllerImpl[T]) GetBulkDeletePath(ctx http.Context) string
批量删除 ?
func (*ControllerImpl[T]) GetCreatePath ¶
func (c *ControllerImpl[T]) GetCreatePath(ctx http.Context) string
新增页面
func (*ControllerImpl[T]) GetDeletePath ¶
func (c *ControllerImpl[T]) GetDeletePath(ctx http.Context, primaryKey ...string) string
删除路径 ?
func (*ControllerImpl[T]) GetEditGetDataPath ¶
func (c *ControllerImpl[T]) GetEditGetDataPath(ctx http.Context, primaryKey ...string) string
获取编辑数据 ?
func (*ControllerImpl[T]) GetEditPath ¶
func (c *ControllerImpl[T]) GetEditPath(ctx http.Context, primaryKey ...string) string
获取编辑页面路径 ?
func (*ControllerImpl[T]) GetExportPath ¶
func (c *ControllerImpl[T]) GetExportPath(ctx http.Context) string
获取导出数据
func (*ControllerImpl[T]) GetListGetDataPath ¶
func (c *ControllerImpl[T]) GetListGetDataPath(ctx http.Context) string
获取列表数据
func (*ControllerImpl[T]) GetListPath ¶
func (c *ControllerImpl[T]) GetListPath(ctx http.Context) string
*
- 获取列表
func (*ControllerImpl[T]) GetQuickEditItemPath ¶
func (c *ControllerImpl[T]) GetQuickEditItemPath(ctx http.Context) string
获取快速编辑项目数据
func (*ControllerImpl[T]) GetQuickEditPath ¶
func (c *ControllerImpl[T]) GetQuickEditPath(ctx http.Context) string
获取快速编辑数据
func (*ControllerImpl[T]) GetShowGetDataPath ¶
func (c *ControllerImpl[T]) GetShowGetDataPath(ctx http.Context) (string, error)
获取详情 ?
func (*ControllerImpl[T]) GetShowPath ¶
func (c *ControllerImpl[T]) GetShowPath(ctx http.Context, primaryKey ...string) string
详情页面 ?
func (*ControllerImpl[T]) GetStorePath ¶
func (c *ControllerImpl[T]) GetStorePath(ctx http.Context) string
获取 新增 保存 的路径
func (*ControllerImpl[T]) GetUpdatePath ¶
func (c *ControllerImpl[T]) GetUpdatePath(ctx http.Context, primaryKey ...string) string
编辑保存 ?
func (*ControllerImpl[T]) HandleValidationErrors ¶
func (c *ControllerImpl[T]) HandleValidationErrors(ctx http.Context, rules map[string]string, messages map[string]string) (bool, http.Response)
HandleValidationErrors 统一处理验证错误
func (*ControllerImpl[T]) RowActions ¶
func (c *ControllerImpl[T]) RowActions(ctx http.Context, form *renderers.Form, dialog any, size string) *renderers.Operation
行操作按钮
func (*ControllerImpl[T]) RowDeleteButton ¶
func (c *ControllerImpl[T]) RowDeleteButton(ctx http.Context, title string) *renderers.DialogAction
行删除按钮
func (*ControllerImpl[T]) RowEditButton ¶
func (c *ControllerImpl[T]) RowEditButton(ctx http.Context, form *renderers.Form, dialog bool, size string, title string, _type string) *renderers.LinkAction
行编辑按钮
func (*ControllerImpl[T]) RowShowButton ¶
func (c *ControllerImpl[T]) RowShowButton(ctx http.Context, form *renderers.Form, dialog bool, size string, title string, _type string) *renderers.LinkAction
行详情按钮
func (*ControllerImpl[T]) UploadFile ¶
func (c *ControllerImpl[T]) UploadFile(ctx http.Context) http.Response
func (*ControllerImpl[T]) UploadFilePath ¶
func (c *ControllerImpl[T]) UploadFilePath(ctx http.Context) string
func (*ControllerImpl[T]) UploadImage ¶
func (c *ControllerImpl[T]) UploadImage(ctx http.Context) http.Response
func (*ControllerImpl[T]) UploadImagePath ¶
func (c *ControllerImpl[T]) UploadImagePath(ctx http.Context) string
图片上传路径
func (*ControllerImpl[T]) UploadRich ¶
func (c *ControllerImpl[T]) UploadRich(ctx http.Context) http.Response
func (*ControllerImpl[T]) UploadRichPath ¶
func (c *ControllerImpl[T]) UploadRichPath(ctx http.Context) string
type ExtensionsController ¶
type ExtensionsController struct {
*ControllerImpl[*services.AdminExtensionService]
}
ExtensionsController 负责「开发者工具 - 扩展」。
Go 版没有运行时加载扩展代码的能力,因此这里只维护扩展名单与启停状态: 扩展本体的控制器、路由、菜单需要在宿主编译期注册,前端能看到的 enabled_extensions 由这张表决定。
func NewExtensionsController ¶
func NewExtensionsController() *ExtensionsController
func (*ExtensionsController) Destroy ¶
func (e *ExtensionsController) Destroy(ctx http.Context) http.Response
func (*ExtensionsController) Disable ¶
func (e *ExtensionsController) Disable(ctx http.Context) http.Response
Disable 停用扩展。
func (*ExtensionsController) Enable ¶
func (e *ExtensionsController) Enable(ctx http.Context) http.Response
Enable 启用扩展。
func (*ExtensionsController) Index ¶
func (e *ExtensionsController) Index(ctx http.Context) http.Response
func (*ExtensionsController) Show ¶
func (e *ExtensionsController) Show(ctx http.Context) http.Response
Show 返回单条扩展记录(Resource 路由要求实现)。
type HomeController ¶
type HomeController struct {
*ControllerImpl[string]
}
func NewHomeController ¶
func NewHomeController() *HomeController
func (*HomeController) Destroy ¶
func (h *HomeController) Destroy(ctx http.Context) http.Response
DELETE /resource/{id}
func (*HomeController) Index ¶
func (h *HomeController) Index(ctx http.Context) http.Response
GET /resource
func (*HomeController) Show ¶
func (h *HomeController) Show(ctx http.Context) http.Response
GET /resource/{id}
type IndexController ¶
type IndexController struct {
*ControllerImpl[*services.AdminSettingService]
}
func NewIndexController ¶
func NewIndexController() *IndexController
func (*IndexController) DownloadExport ¶
func (i *IndexController) DownloadExport(c http.Context) http.Response
DownloadExport 校验签名后返回导出文件。
下载地址是拼接出来的公开链接,不依赖登录态,所以必须校验 HMAC 签名与 有效期,避免被拿来读取任意文件。
func (*IndexController) FileUpload ¶
func (i *IndexController) FileUpload(c http.Context) http.Response
func (*IndexController) GetCurrentUser ¶
func (i *IndexController) GetCurrentUser()
func (*IndexController) GetDashBoard ¶
func (i *IndexController) GetDashBoard()
func (*IndexController) GetMenus ¶
func (i *IndexController) GetMenus(ctx http.Context) http.Response
GetMenus 获取菜单
func (*IndexController) GetSetting ¶
func (i *IndexController) GetSetting(ctx http.Context) http.Response
func (*IndexController) GetUserSetting ¶
func (i *IndexController) GetUserSetting()
func (*IndexController) IconifySearch ¶
func (i *IndexController) IconifySearch(ctx http.Context) http.Response
IconifySearch 按关键字搜索图标名,供后台图标选择器使用。
func (*IndexController) ImageUpload ¶
func (i *IndexController) ImageUpload(c http.Context) http.Response
func (*IndexController) NoContext ¶
func (i *IndexController) NoContext(ctx http.Context) http.Response
func (*IndexController) PageSchema ¶
func (i *IndexController) PageSchema(ctx http.Context) http.Response
PageSchema 返回「页面管理」里登记的自定义页面结构。
前端在菜单命中 url_type=4 时会带上 component 里的 sign 请求这里, 拿到 schema 后直接交给 amis 渲染。
func (*IndexController) PutUserSetting ¶
func (i *IndexController) PutUserSetting()
func (*IndexController) RichFileUpload ¶
func (i *IndexController) RichFileUpload(c http.Context) http.Response
func (*IndexController) SaveSetting ¶
func (i *IndexController) SaveSetting(ctx http.Context) http.Response
func (*IndexController) SearchIcon ¶
func (i *IndexController) SearchIcon()
type MenuController ¶
type MenuController struct {
*ControllerImpl[*services.AdminMenuService]
}
func NewMenuController ¶
func NewMenuController() *MenuController
type PagesController ¶
type PagesController struct {
*ControllerImpl[*services.AdminPageService]
}
PagesController 负责「开发者工具 - 页面管理」。
页面结构保存为 amis JSON,前端通过 page_schema?sign=xxx 拉取后直接渲染, 所以这里的表单只做 JSON 编辑,不需要为每个页面单独写后端。
func NewPagesController ¶
func NewPagesController() *PagesController
type PermissionController ¶
type PermissionController struct {
*ControllerImpl[*services.AdminPermissionService]
}
func NewPermissionController ¶
func NewPermissionController() *PermissionController
func (*PermissionController) AutoGenerate ¶
func (p *PermissionController) AutoGenerate(ctx http.Context) http.Response
func (*PermissionController) Destroy ¶
func (p *PermissionController) Destroy(ctx http.Context) http.Response
func (*PermissionController) GetHttpMethodOptions ¶
func (p *PermissionController) GetHttpMethodOptions(ctx http.Context) http.Response
GetHttpMethodOptions 获取HTTP方法选项
func (*PermissionController) GetHttpPathOptions ¶
func (p *PermissionController) GetHttpPathOptions(ctx http.Context) http.Response
GetHttpPathOptions 获取HTTP路径选项
func (*PermissionController) GetRolesByPermission ¶
func (p *PermissionController) GetRolesByPermission(ctx http.Context) http.Response
GetRolesByPermission 根据权限获取角色
func (*PermissionController) Index ¶
func (p *PermissionController) Index(ctx http.Context) http.Response
func (*PermissionController) Options ¶
func (p *PermissionController) Options(ctx http.Context) http.Response
func (*PermissionController) Show ¶
func (p *PermissionController) Show(ctx http.Context) http.Response
func (*PermissionController) Store ¶
func (p *PermissionController) Store(ctx http.Context) http.Response
func (*PermissionController) TreeOptions ¶
func (p *PermissionController) TreeOptions(ctx http.Context) http.Response
type RelationshipsController ¶
type RelationshipsController struct {
*ControllerImpl[*services.AdminRelationshipService]
}
RelationshipsController 负责「开发者工具 - 动态关联」。
Goravel 的 ORM 关联必须静态声明在模型上,所以这里不改运行时行为, 只负责登记关联元数据并给出可复制的 struct 方法预览。
func NewRelationshipsController ¶
func NewRelationshipsController() *RelationshipsController
func (*RelationshipsController) Destroy ¶
func (r *RelationshipsController) Destroy(ctx http.Context) http.Response
func (*RelationshipsController) Index ¶
func (r *RelationshipsController) Index(ctx http.Context) http.Response
func (*RelationshipsController) Show ¶
func (r *RelationshipsController) Show(ctx http.Context) http.Response
func (*RelationshipsController) Store ¶
func (r *RelationshipsController) Store(ctx http.Context) http.Response
type RoleController ¶
type RoleController struct {
*ControllerImpl[*services.AdminRoleService]
}
func NewRoleController ¶
func NewRoleController() *RoleController
func (*RoleController) AssignPermissions ¶
func (r *RoleController) AssignPermissions(ctx http.Context) http.Response
AssignPermissions 为角色分配权限
func (*RoleController) Detail ¶
func (r *RoleController) Detail(ctx http.Context) http.Response
Detail 详情页面
func (*RoleController) Form ¶
func (r *RoleController) Form(ctx http.Context) *renderers.Form
Form 表单页面
func (*RoleController) GetPermissions ¶
func (r *RoleController) GetPermissions(ctx http.Context) http.Response
GetPermissions 获取角色权限
func (*RoleController) SavePermissions ¶
func (r *RoleController) SavePermissions(ctx http.Context) http.Response
SavePermissions 保存权限设置
type UserController ¶
type UserController struct {
*ControllerImpl[*services.AdminUserService]
}
func NewUserController ¶
func NewUserController() *UserController
func (*UserController) GetUserSetting ¶
func (a *UserController) GetUserSetting(ctx http.Context) http.Response
func (*UserController) PutUserSetting ¶
func (u *UserController) PutUserSetting(c http.Context) http.Response
PutUserSetting 保存当前登录用户的个人资料。