Documentation
¶
Index ¶
- Constants
- func AuthorityTypeScope(authorityType int) func(db *gorm.DB) *gorm.DB
- func BatcheDelete(ids []uint) error
- func CreateApi(ctx *gin.Context)
- func CreatenInBatches(db *gorm.DB, apis ApiCollection) error
- func Delete(id uint, req DeleteApiReq) error
- func DeleteApi(ctx *gin.Context)
- func DeleteApisByIds(ctx *gin.Context)
- func GetAllApis(ctx *gin.Context)
- func GetApiById(ctx *gin.Context)
- func GetApiList(ctx *gin.Context)
- func GetApisForRole() (map[int][][]string, error)
- func GetMigration() *gormigrate.Migration
- func Group(group *gin.RouterGroup)
- func New(routes []map[string]string, authorityTypes map[string]int) *source
- func UpdateApi(ctx *gin.Context)
- type Api
- type ApiCollection
- type AuthorityType
- type BaseApi
- type DeleteApiReq
- type PageResponse
- type ReqPaginate
- type Response
Constants ¶
View Source
const TableName = "apis"
Variables ¶
This section is empty.
Functions ¶
func AuthorityTypeScope ¶
AuthorityTypeScope 根据 name 查询 - authorityType 权限类型
func BatcheDelete ¶
func CreatenInBatches ¶
func CreatenInBatches(db *gorm.DB, apis ApiCollection) error
CreatenInBatches 批量加入
func Delete ¶
func Delete(id uint, req DeleteApiReq) error
func GetMigration ¶
func GetMigration() *gormigrate.Migration
func Group ¶
func Group(group *gin.RouterGroup)
Types ¶
type ApiCollection ¶
type ApiCollection []Api
type AuthorityType ¶
type AuthorityType struct {
AuthorityType int `json:"authorityType" form:"authorityType"`
}
type BaseApi ¶
type BaseApi struct { Path string `json:"path" gorm:"comment:api路径" binding:"required"` Description string `json:"description" gorm:"comment:api中文描述" binding:"required"` ApiGroup string `json:"apiGroup" gorm:"comment:api组" binding:"required"` Method string `json:"method" gorm:"default:POST;comment:方法" binding:"required"` AuthorityType int `json:"authorityType" gorm:"comment:角色类型"` }
BaseApi 权鉴基础模块
type DeleteApiReq ¶
type PageResponse ¶
type PageResponse struct {
Item []*Response
}
Paginate 分页
type ReqPaginate ¶
type ReqPaginate struct { orm.Paginate Path string `json:"path" form:"path"` Description string `json:"description" form:"description"` ApiGroup string `json:"apiGroup" form:"apiGroup"` Method string `json:"method" form:"method"` OrderKey string `json:"orderKey" form:"orderKey"` Desc bool `json:"desc" form:"desc"` }
Click to show internal directories.
Click to hide internal directories.