Categorygithub.com/fbs-io/core
modulepackage
1.1.1
Repository: https://github.com/fbs-io/core.git
Documentation: pkg.go.dev

# README

FBS 系统内核

基于Gin的二次封装, 对常用模块进行封装, 开发仅着重于业务层开发, 从而实现项目的快速开发和部署.

模块

  • 日志模块
  • 缓存模块
  • 数据库模块
  • 定时作业模块
  • HTTP服务模块
  • 系统管理中心模块
  • 系统资源管理模块
  • 接口调试模块

特性

  • 支持从Web页面进行系统配置, 包括数据库, 缓存, 端口, 超管用户等.
  • 系统配置中心模块集成了服务器资源一栏, 后台服务管理, 方便管理员对系统进行操作
  • 基于gin的路由封装, 可以自动完成简单的查询构造
  • 自动生成接口一览, 及调试画面(开发中)
  • 自动生成资源一览, 用于权限分配(开发中)
  • 支持本地缓存和redis(待开发)
  • 支持sqlite, mysql, postgresql 三款数据库

启动

package main

import (
	"fmt"
	"os"

	"github.com/fbs-io/core"
)

func main() {
    c, err := core.New()
    if err != nil {
        fmt.Println("初始化失败, 错误:", err)
        os.Exit(2)
    }

    ajax := c.Group("ajax")

    dim := ajax.Group("dim", "字典数据")

    pkl := dim.Group("picklist", "码值表")

    pkl.GET("list", "获取码值列表", params{}, func(ctx core.Context) {
        ctx.JSON(errno.ERRNO_OK.ToMapWithData("请求成功"))

    })

    c.Run()

}

# Packages

* @Author: reel * @Date: 2023-06-18 10:32:27 * @LastEditors: reel * @LastEditTime: 2023-09-09 19:36:56 * @Description: 入口函数, 用于测试和示例, 不作为项目使用 */.
* @Author: reel * @Date: 2023-05-16 20:44:40 * @LastEditors: reel * @LastEditTime: 2023-09-12 06:04:50 * @Description: 配置定时任务 */.
* @Author: reel * @Date: 2023-05-11 22:27:38 * @LastEditors: reel * @LastEditTime: 2023-08-14 21:13:47 * @Description: 请填写简介 */.
* @Author: reel * @Date: 2023-09-08 06:52:29 * @LastEditors: reel * @LastEditTime: 2023-09-08 07:14:30 * @Description: 请填写简介 */.
No description provided by the author
* @Author: reel * @Date: 2023-05-16 21:09:14 * @LastEditors: reel * @LastEditTime: 2023-09-09 20:55:19 * @Description: 请填写简介 */.
* @Author: reel * @Date: 2023-06-06 19:21:05 * @LastEditors: reel * @LastEditTime: 2024-03-27 04:45:16 * @Description: session 模块 */.
No description provided by the author

# Functions

请使用 method:path 的方式定义资源 比如 POST:/ajax/login.
跨域处理中间件.
No description provided by the author
限流器.
日志中间件.
No description provided by the author
新建一个上下文.
参数自动生成中间件 会生成参数结构体以及gorm.DB 同时根据约束, 自动完成参数校验.
No description provided by the author
设置每秒令牌生成个数.
设置令牌桶大小.
No description provided by the author
No description provided by the author
设置查询方式 TX_QRY_MODE_SUBID 表示带id的子查询, 注意: 使用TX_QRY_MODE_SUBID, 必须配合使用 SetTxSubTable 设置表名.
设置子查询表明.
校验签名中间件 如果没有登陆, 则会给一个默认的签名 Singular: 默认 token 模式, 同时可以选择cookie,sid, csrftoken方式.

# Constants

No description provided by the author
No description provided by the author
No description provided by the author
上下文的操作用户.
上下文的数据权限.
上下文的参数.
上下文中的反射值,用于自动校验并生成参数.
上下文的数据分区.
上下文的数据库信息.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
返回路由, 默认菜单返回路由, 也可以单独设置按钮作为路由返回.
不返回路由.
受限, 前端不可访问.
菜单权限.
按钮/接口权限.
不受限菜单或按钮/接口.
不受限菜单.
不受限按钮/接口.
No description provided by the author
通过ctx生成查询tx的方式 适用于表中有id的查询, 通过子查询优化分页性能.

# Variables

No description provided by the author

# Structs

数据库字段 对SourcesBase进行的封装.
系统资源表 用于API文档, 菜单, 权限控制等 当使用core中的路由接口生成路由时, 系统资源会自动注册到这张表中.

# Interfaces

No description provided by the author
No description provided by the author
IRoutes 包装gin的IRoutes.
RouterGroup 包装gin的RouterGroup 传入相对路由路径和名称, 用于在菜单中进行注册.
用于设置路由和资源的关系.

# Type aliases

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author