Documentation ¶
Index ¶
- Variables
- func GinRun(port string, fnRouter ...RouterFun) (*http.Server, error)
- func Http(engine *gin.Engine, port string) *http.Server
- func NewConfig(configList ...ConfigFn) error
- func NewMysql(opt ...gorm.Option) (*gorm.DB, error)
- func NewRedis() (*redis.Client, error)
- func Order(dbs *gorm.DB, order map[string]interface{}, orderString string) *gorm.DB
- func Where(dbs *gorm.DB, i interface{}) *gorm.DB
- type Buffer
- type CommonRequest
- func (c *CommonRequest) Action()
- func (c *CommonRequest) GetDB() *gorm.DB
- func (c *CommonRequest) Init(db *gorm.DB, i interface{}) (tx *gorm.DB)
- func (c *CommonRequest) OrderWhere(i interface{})
- func (c *CommonRequest) PageLimitOffset() int
- func (c *CommonRequest) Paginate()
- func (c *CommonRequest) SetDB(db *gorm.DB)
- type Config
- type ConfigFn
- type FileNameChange
- type GormExt
- type RouterFun
Constants ¶
This section is empty.
Variables ¶
View Source
var ( MysqlConn *gorm.DB RedisConn *redis.Client )
View Source
var ResgterWhereHooks []where.ResiterHooksOption
Functions ¶
Types ¶
type CommonRequest ¶
type CommonRequest struct { Page int `form:"page" ` //当前页码 IsPaginate bool `form:"isPaginate"` //当前页码 PageSize int `form:"pageSize" ` //分页大小 ReturnType int `form:"returnType"` //1 列表 2 map 列表 3 详情 OrderMap map[string]interface{} OrderString string `form:"orderString"` Actions int `form:"action"` //默认 1 修改 2 列表 3 单条数据 4删除 5添加 Delete int `form:"delete"` //是否包含删除数据 Data interface{} Error error // contains filtered or unexported fields }
func (*CommonRequest) Action ¶
func (c *CommonRequest) Action()
func (*CommonRequest) GetDB ¶
func (c *CommonRequest) GetDB() *gorm.DB
func (*CommonRequest) OrderWhere ¶
func (c *CommonRequest) OrderWhere(i interface{})
func (*CommonRequest) PageLimitOffset ¶
func (c *CommonRequest) PageLimitOffset() int
func (*CommonRequest) Paginate ¶
func (c *CommonRequest) Paginate()
func (*CommonRequest) SetDB ¶
func (c *CommonRequest) SetDB(db *gorm.DB)
type Config ¶
func (*Config) InitConfig ¶
type FileNameChange ¶
type FileNameChange struct { }
func (*FileNameChange) Camel2Case ¶
func (f *FileNameChange) Camel2Case(name string) string
驼峰式写法转为下划线写法
func (*FileNameChange) Case2Camel ¶
func (f *FileNameChange) Case2Camel(name string) string
下划线写法转为驼峰写法
Click to show internal directories.
Click to hide internal directories.