orm

package
v1.2.15 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2023 License: Apache-2.0 Imports: 8 Imported by: 13

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrParamValidate      = errors.New("参数验证失败")
	ErrPaginateParam      = errors.New("分页查询参数缺失")
	ErrUnSupportFramework = errors.New("不支持的框架")
)

Functions

This section is empty.

Types

type ErrMsg

type ErrMsg struct {
	Code int64  `json:"code"`
	Msg  string `json:"message"`
}

type Model

type Model struct {
	Id        uint   `json:"id" uri:"id" form:"id" param:"id"`
	UpdatedAt string `json:"updatedAt" uri:"updatedAt" form:"updatedAt" param:"updatedAt"`
	CreatedAt string `json:"createdAt" uri:"createdAt" form:"createdAt" param:"createdAt"`
	DeletedAt string `json:"deletedAt" uri:"deletedAt" form:"deletedAt" param:"deletedAt"`
}

Model

type Paginate

type Paginate struct {
	Page     int    `json:"page" form:"page"`
	PageSize int    `json:"pageSize" form:"pageSize"`
	OrderBy  string `json:"orderBy" form:"orderBy"`
	Sort     string `json:"sort" form:"sort"`
}

Paginate param for paginate query

func (*Paginate) PaginateScope

func (req *Paginate) PaginateScope() func(db *gorm.DB) *gorm.DB

PaginateScope paginate scope

func (*Paginate) Request

func (req *Paginate) Request(ctx interface{}) error

Request

type ReqId

type ReqId struct {
	Id uint `json:"id" uri:"id" form:"id" param:"id"`
}

ReqId the struct has used to get id form the context of every query

func (*ReqId) Request

func (req *ReqId) Request(ctx interface{}) error

Request get id data form the context of every query

type Response

type Response struct {
	Status int64       `json:"status"`
	Msg    string      `json:"message"`
	Data   interface{} `json:"data"`
}

Response

Jump to

Keyboard shortcuts

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