Documentation ¶
Index ¶
- Variables
- func GormErrorAs(gorm *gorm.DB) error
- func MakeCondition(params any, gorm *gorm.DB) *gorm.DB
- type Api
- func (e *Api) Errors(err error) types.IApiResult
- func (e *Api) Failure(data ...any) types.IApiResult
- func (e *Api) HttpCode(code int) types.IApiResult
- func (e *Api) Json(data ...any) types.IApiResult
- func (e *Api) Jsonp(data ...any) types.IApiResult
- func (e *Api) Null() types.IApiResult
- func (e *Api) Redirect() types.IApiResult
- func (e *Api) Result(api types.IApiResult, data ...any) types.IApiResult
- func (e *Api) String(data ...any) types.IApiResult
- func (e *Api) Success(data ...any) types.IApiResult
- func (e *Api) View(name string, data fiber.Map) types.IApiResult
- func (e *Api) Xml(data ...any) types.IApiResult
- type IRouter
- type Router
- func (r *Router) DELETE(relativePath string, handlers any)
- func (r *Router) Exec(c *fiber.Ctx, method string, handlers any) error
- func (r *Router) GET(relativePath string, handlers any)
- func (r *Router) Group(relativePath string) *Router
- func (r *Router) Options(relativePath string, handlers any)
- func (r *Router) POST(relativePath string, handlers any)
- func (r *Router) Put(relativePath string, handlers any)
- type Service
- func (s *Service[T, R]) Cache(ttl int64) *Service[T, R]
- func (s *Service[T, R]) Create(data *T, omits ...string) *errors.Message
- func (s *Service[T, R]) DB() *gorm.DB
- func (s *Service[T, R]) Delete(id uint, omits ...string) *errors.Message
- func (s *Service[T, R]) Destroy(id uint, omits ...string) *errors.Message
- func (s *Service[T, R]) FindByField(field string, value any) (result *R, err *errors.Message)
- func (s *Service[T, R]) FindByFields(fields any) (result *R, err *errors.Message)
- func (s *Service[T, R]) FindById(id uint) (result *R, err *errors.Message)
- func (s *Service[T, R]) GetCacheDb(ttl int64) *gorm.DB
- func (s *Service[T, R]) GetDb(dbName string) *gorm.DB
- func (s *Service[T, R]) GetReadDb() *gorm.DB
- func (s *Service[T, R]) GetWriteDb() *gorm.DB
- func (s *Service[T, R]) Search(page int, pageSize int, params any) (*TPage[R], *errors.Message)
- func (s *Service[T, R]) Update(id uint, data *T, omits ...string) *errors.Message
- func (s *Service[T, R]) WithContext(c *fiber.Ctx) *errors.Message
- type TPage
Constants ¶
This section is empty.
Variables ¶
View Source
var Runtime runtime.Runtime = runtime.NewConfig()
Functions ¶
Types ¶
type Api ¶
type Api struct { }
func (*Api) Null ¶
func (e *Api) Null() types.IApiResult
func (*Api) Redirect ¶
func (e *Api) Redirect() types.IApiResult
func (*Api) Result ¶
func (e *Api) Result(api types.IApiResult, data ...any) types.IApiResult
type Service ¶
type Service[T any, R any] struct { Data T Ctx *fiber.Ctx // contains filtered or unexported fields }
Service 服务
func (*Service[T, R]) FindByField ¶
FindByField 获取信息
func (*Service[T, R]) FindByFields ¶
FindByFields 获取信息
func (*Service[T, R]) WithContext ¶
WithContext 绑定上下文
Click to show internal directories.
Click to hide internal directories.