cubebase

package module
v1.0.26 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

README

cubebase

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CubeResponse

func CubeResponse(c *gin.Context, code int, message string, data any)

CubeResponse 统一返回结构

func CubeResponseError

func CubeResponseError(c *gin.Context, code int, message string)

func CubeResponseErrorForServerErr

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

func CubeResponseSuccess

func CubeResponseSuccess(c *gin.Context, obj any)

Types

type CubeContext added in v1.0.3

type CubeContext struct {
	Db  *sqlx.DB
	Rdb *redis.Client
	Ctx context.Context
}

type CubeError

type CubeError struct {
	Msg string
}

func (*CubeError) Error

func (e *CubeError) Error() string

type PageForm added in v1.0.4

type PageForm struct {
	PageIndex int64       `json:"pageIndex" binding:"required" label:"分页页码"`
	PageSize  int64       `json:"pageSize" binding:"required" label:"每页大小"`
	Draw      interface{} `json:"draw"`
}

func (*PageForm) GetPageIndex added in v1.0.4

func (p *PageForm) GetPageIndex() int64

func (*PageForm) GetPageSize added in v1.0.4

func (p *PageForm) GetPageSize() int64

func (*PageForm) GetStartRow added in v1.0.4

func (p *PageForm) GetStartRow() int64

type PageVO added in v1.0.6

type PageVO struct {
	Rows  []interface{} `json:"rows"`
	Draw  interface{}   `json:"draw"`
	Total int64         `json:"total"`
}

type Response

type Response struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
	Data    any    `json:"data"`
}

Response 统一返回结构

type UserInfo added in v1.0.3

type UserInfo struct {
	ID              int64          `json:"id"`
	AccountName     string         `json:"account_name"`
	AccountNickname *string        `json:"account_nickname"`
	EmployeeName    string         `json:"employee_name"`
	EmployeeCode    string         `json:"employee_code"`
	RoleIds         pg.Int64Array  `json:"role_ids"`
	Remark          sql.NullString `json:"remark"`
	IsDelete        sql.NullBool   `json:"is_delete"`
	IsCreate        sql.NullBool   `json:"is_create"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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