base

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func Error

func Error(r *ghttp.Request, msg string)

func Fail

func Fail(r *ghttp.Request, msg string)

func GetUser

func GetUser(r *ghttp.Request) bean.SessionUser

func Resp

func Resp(r *ghttp.Request, code int, msg string, data interface{})

func Succ

func Succ(r *ghttp.Request, data interface{})

Types

type BaseForm

type BaseForm struct {
	Page      int    `form:"page",json:"page"`           // 当前页码
	Rows      int    `form:"rows",json:"rows"`           // 每页多少条
	TotalPage int    `form:"totalPage",json:"totalPage"` // 总页数
	TotalSize int    `form:"totalSize",json:"totalSize"` // 总共数据条数
	OrderBy   string `form:"orderBy",json:"orderBy"`     // 排序
	Params    map[string]string
	Object    interface{}
}

func NewForm

func NewForm(params map[string]interface{}) BaseForm

func (*BaseForm) SetObject

func (form *BaseForm) SetObject(object interface{})

func (*BaseForm) SetParam

func (form *BaseForm) SetParam(key string, value string)

func (*BaseForm) SetParams

func (form *BaseForm) SetParams(params map[string]string)

type BaseModel

type BaseModel struct {
	Enable     int    `json:"enable" gconv:"enable,omitempty"`
	UpdateTime string `json:"updateTime" gconv:"update_time,omitempty"`
	UpdateId   int    `json:"updateId" gconv:"update_id,omitempty"`
	UpdateName string `json:"updateName,omitempty" gconv:"updateName,omitempty"`
	CreateTime string `json:"createTime" gconv:"create_time,omitempty"`
	CreateId   int    `json:"createId" gconv:"create_id,omitempty"`
	CreateName string `json:"createName,omitempty" gconv:"createName,omitempty"`
}

type BaseRouter

type BaseRouter struct {
}

baseRouter implemented global settings for all other routers.

type IModel

type IModel interface {
	// 获取表明
	TableName() string
	// 获取主键值
	PkVal() int
}

定义model interface

Jump to

Keyboard shortcuts

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