response

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2023 License: Unlicense Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ERROR        = 500
	SUCCESS      = 200
	UNAUTHORIZED = 401
)

Variables

This section is empty.

Functions

func Fail

func Fail(c *gin.Context)

func FailWithDetailed

func FailWithDetailed(data interface{}, message string, c *gin.Context)

func FailWithMessage

func FailWithMessage(message string, c *gin.Context)

func Ok

func Ok(c *gin.Context)

func OkWithData

func OkWithData(data interface{}, c *gin.Context)

func OkWithDetailed

func OkWithDetailed(data interface{}, message string, c *gin.Context)

func OkWithMessage

func OkWithMessage(message string, c *gin.Context)

func Result

func Result(code int, data interface{}, msg string, c *gin.Context)

func UnauthorizedFailDetail

func UnauthorizedFailDetail(data interface{}, message string, c *gin.Context)

Types

type EvBaseModel

type EvBaseModel struct {
	ID        int64      `json:"id"`
	UUID      uuid.UUID  `json:"uuid"`
	CreatedAt time.Time  `json:"created_at"`
	UpdatedAt *time.Time `json:"updated_at"`
	DeletedAt *time.Time `json:"deleted_at"`
}

type EvCategory

type EvCategory struct {
	EvBaseModel
	Name string `json:"name"`
	Slug string `json:"slug"`
}

type EvProduct

type EvProduct struct {
	EvBaseModel
	Name        string     `json:"name"`
	Description string     `json:"description"`
	CategoryID  int64      `json:"category_id"`
	Type        string     `json:"type"`
	Category    EvCategory `json:"category"`
}

type Response

type Response struct {
	Code int         `json:"code"`
	Data interface{} `json:"data"`
	Msg  string      `json:"msg"`
}

Jump to

Keyboard shortcuts

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