Documentation ¶
Index ¶
- type BaseInterface
- type BaseStruct
- type Delete
- func (delete *Delete) GetCondition() map[string]interface{}
- func (delete *Delete) GetError() error
- func (delete *Delete) GetRawJsonMap() map[string]interface{}
- func (delete *Delete) GetRow() interface{}
- func (delete *Delete) GetRowsAffected() int64
- func (delete *Delete) SetCondition(condition map[string]interface{})
- func (delete *Delete) SetError(err error)
- func (delete *Delete) SetRawJsonMap(rawJsonMap map[string]interface{})
- func (delete *Delete) SetRow(row interface{})
- func (delete *Delete) SetRowsAffected(rowsAffected int64)
- type DeleteInterface
- type IDInterface
- type Insert
- func (insert *Insert) GetError() error
- func (insert *Insert) GetNewID() int
- func (insert *Insert) GetRawJsonMap() map[string]interface{}
- func (insert *Insert) GetRow() interface{}
- func (insert *Insert) GetRowsAffected() int64
- func (insert *Insert) SetError(err error)
- func (insert *Insert) SetNewID(newID int)
- func (insert *Insert) SetRawJsonMap(rawJsonMap map[string]interface{})
- func (insert *Insert) SetRow(row interface{})
- func (insert *Insert) SetRowsAffected(rowsAffected int64)
- type InsertInterface
- type JsonInterface
- type MysqlMng
- func (mysqlMng *MysqlMng) Commit()
- func (mysqlMng *MysqlMng) IsExist(condition map[string]interface{}, tableName string) (err error)
- func (mysqlMng *MysqlMng) IsNotFound(err error) bool
- func (mysqlMng *MysqlMng) NewCommonConn()
- func (mysqlMng *MysqlMng) NewTransConn()
- func (mysqlMng *MysqlMng) Rollback()
- func (mysqlMng *MysqlMng) WhereBuild(condition map[string]interface{}) (whereSQL string, vals []interface{}, err error)
- func (mysqlMng *MysqlMng) WhereOrBuild(condition map[string]interface{}) (whereSQL string, vals []interface{}, err error)
- type NullType
- type OnlyID
- type Read
- func (read *Read) GetCondition() map[string]interface{}
- func (read *Read) GetCount() int64
- func (read *Read) GetError() error
- func (read *Read) GetLimit() int
- func (read *Read) GetOffset() int
- func (read *Read) GetOrder() string
- func (read *Read) GetPageNow() int
- func (read *Read) GetPageSize() int
- func (read *Read) GetPreloads() []string
- func (read *Read) GetRows() interface{}
- func (read *Read) GetRowsAffected() int64
- func (read *Read) SetCondition(condition map[string]interface{})
- func (read *Read) SetCount(count int64)
- func (read *Read) SetError(err error)
- func (read *Read) SetOrder(order string)
- func (read *Read) SetPageNow(pageNow int)
- func (read *Read) SetPageSize(pageSize int)
- func (read *Read) SetRows(rows interface{})
- func (read *Read) SetRowsAffected(rowsAffected int64)
- type ReadInterface
- type Update
- func (update *Update) GetCondition() map[string]interface{}
- func (update *Update) GetError() error
- func (update *Update) GetRawJsonMap() map[string]interface{}
- func (update *Update) GetRowsAffected() int64
- func (update *Update) GetTableName() string
- func (update *Update) GetValue() map[string]interface{}
- func (update *Update) SetCondition(condition map[string]interface{})
- func (update *Update) SetError(err error)
- func (update *Update) SetRawJsonMap(rawJsonMap map[string]interface{})
- func (update *Update) SetRowsAffected(rowsAffected int64)
- func (update *Update) SetTableName(tableName string)
- func (update *Update) SetValue(value map[string]interface{})
- type UpdateInterface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseInterface ¶
type BaseStruct ¶
type Delete ¶
type Delete struct { BaseStruct Condition map[string]interface{} Row interface{} RawJsonMap map[string]interface{} }
删除操作的基本结构体
func (*Delete) GetCondition ¶
func (*Delete) GetRawJsonMap ¶
func (*Delete) GetRowsAffected ¶
func (*Delete) SetCondition ¶
func (*Delete) SetRawJsonMap ¶
func (*Delete) SetRowsAffected ¶
type DeleteInterface ¶
type DeleteInterface interface { JsonInterface BaseInterface // Getter GetCondition() map[string]interface{} GetRow() interface{} //Setter SetCondition(map[string]interface{}) SetRow(interface{}) }
删除接口
type Insert ¶
type Insert struct { BaseStruct NewID int // 没有实际意义,无法实现,只为了区分interface Row interface{} RawJsonMap map[string]interface{} }
插入操作的基本结构体
func (*Insert) GetRawJsonMap ¶
func (*Insert) GetRowsAffected ¶
func (*Insert) SetRawJsonMap ¶
func (*Insert) SetRowsAffected ¶
type InsertInterface ¶
type InsertInterface interface { JsonInterface BaseInterface // Getter GetRow() interface{} GetNewID() int //Setter SetRow(interface{}) SetNewID(int) }
插入接口
type JsonInterface ¶
type JsonInterface interface { // Getter GetRawJsonMap() map[string]interface{} //Setter SetRawJsonMap(map[string]interface{}) }
涉及到json操作的接口
type MysqlMng ¶
func NewMysqlMng ¶
func NewMysqlMng() *MysqlMng
*
- @func: NewMysqlMng mysql管理器工厂模式
- @author: Wiidz
- @date: 2020-04-15
type NullType ¶
type NullType byte
用于判断是否是null值
const ( IsNull NullType // IsNull the same as `is null` IsNotNull // IsNotNull the same as `is not null` )
type OnlyID ¶
type OnlyID struct {
ID int `gorm:"primary_key;column:id;type:int(11);not null" json:"id"` // 编号
}
简单方法种用来获取新插入记录的ID值
type Read ¶
type Read struct { BaseStruct Condition map[string]interface{} PageNow int `json:"page_now" belong:"etc" default:"1"` PageSize int `json:"page_size" belong:"etc" default:"10"` Order string `json:"order" belong:"etc" default:"ids asc"` Single bool Preloads []string Rows interface{} Count int64 }
读取操作的基本结构体
func (*Read) GetCondition ¶
func (*Read) GetPageNow ¶
func (*Read) GetPageSize ¶
func (*Read) GetPreloads ¶
func (*Read) GetRowsAffected ¶
func (*Read) SetCondition ¶
func (*Read) SetPageNow ¶
func (*Read) SetPageSize ¶
func (*Read) SetRowsAffected ¶
type ReadInterface ¶
type ReadInterface interface { BaseInterface // Getter GetPreloads() []string GetCondition() map[string]interface{} GetOrder() string GetOffset() int GetPageSize() int GetPageNow() int GetRows() interface{} GetCount() int64 GetLimit() int //Setter SetRows(interface{}) SetCount(int64) SetCondition(map[string]interface{}) SetOrder(string) SetPageNow(int) SetPageSize(int) }
读接口
type Update ¶
type Update struct { BaseStruct TableName string Condition map[string]interface{} Value map[string]interface{} RawJsonMap map[string]interface{} }
修改操作的基本结构体
func (*Update) GetCondition ¶
func (*Update) GetRawJsonMap ¶
func (*Update) GetRowsAffected ¶
func (*Update) GetTableName ¶
func (*Update) SetCondition ¶
func (*Update) SetRawJsonMap ¶
func (*Update) SetRowsAffected ¶
func (*Update) SetTableName ¶
type UpdateInterface ¶
type UpdateInterface interface { JsonInterface BaseInterface // Getter GetTableName() string GetCondition() map[string]interface{} GetValue() map[string]interface{} //Setter SetTableName(string) SetCondition(map[string]interface{}) SetValue(map[string]interface{}) }
修改接口
Click to show internal directories.
Click to hide internal directories.