bg

package
v0.0.0-...-ae08ad9 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

README

Beego Helper

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseController

type BaseController struct {
	beego.Controller
}

func (*BaseController) Serve

func (c *BaseController) Serve(v interface{})

func (*BaseController) ServeCreated

func (c *BaseController) ServeCreated(v interface{})

func (*BaseController) ServeError

func (c *BaseController) ServeError(err error)

func (*BaseController) ServeGeneral

func (c *BaseController) ServeGeneral(message string, status int)

func (*BaseController) ServeStatus

func (c *BaseController) ServeStatus(status int)

func (*BaseController) ServeSuccess

func (c *BaseController) ServeSuccess()

type Created

type Created struct {
	ID uint `json:"id"`
}

type Error

type Error struct {
	// HTML 状态码
	Status int `json:"status,omitempty"`
	// 错误码,如果没有则为 Code
	Code int `json:"code,omitempty"`
	// 错误消息
	Message string `json:"message,omitempty"`
	// 请求路径
	Path string `json:"path,omitempty"`
	// contains filtered or unexported fields
}

func CreateError

func CreateError(err interface{}) (e Error)

func CreateErrorBadRequest

func CreateErrorBadRequest(err interface{}) Error

func CreateErrorWithStatus

func CreateErrorWithStatus(status int, err interface{}) (e Error)

func (Error) Cause

func (self Error) Cause() error

func (Error) Error

func (self Error) Error() string

type General

type General struct {
	Code    int    `json:"code"`
	Message string `json:"message,omitempty"`
	Path    string `json:"path,omitempty"`
}

type HealthCheckerFunc

type HealthCheckerFunc func() error

func (HealthCheckerFunc) Check

func (c HealthCheckerFunc) Check() error

type Model

type Model struct {
	ID        uint       `gorm:"primary_key" json:"id,omitempty"`
	CreatedAt time.Time  `json:"created_at,omitempty"`
	UpdatedAt time.Time  `json:"updated_at,omitempty"`
	DeletedAt *time.Time `sql:"index" json:"deleted_at,omitempty"`
}

数据库基本模型

Jump to

Keyboard shortcuts

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