Documentation ¶
Index ¶
- Constants
- Variables
- type CacheDao
- func (cacheDao *CacheDao) Count(obj interface{}, name string, params *SortMap) (int64, error)
- func (cacheDao *CacheDao) DelKeyFromCache(key string) (bool, error)
- func (cacheDao *CacheDao) Delete(obj interface{}) (int64, error)
- func (cacheDao *CacheDao) GetIdList(obj interface{}, res interface{}, name string, params *SortMap, ...) ([]int64, error)
- func (cacheDao *CacheDao) GetIdListPage(obj interface{}, res interface{}, name string, params *SortMap, ...) ([]int64, error)
- func (cacheDao *CacheDao) GetList(obj interface{}, res interface{}, name string, params *SortMap, ...) ([]interface{}, error)
- func (cacheDao *CacheDao) GetListByIds(obj interface{}, ids []int64) ([]interface{}, error)
- func (cacheDao *CacheDao) GetListPage(obj interface{}, res interface{}, name string, params *SortMap, ...) ([]interface{}, error)
- func (cacheDao *CacheDao) GetMaping(obj interface{}, name string, params *SortMap) (interface{}, error)
- func (cacheDao *CacheDao) GetMapingId(obj interface{}, name string, params *SortMap) (int64, error)
- func (cacheDao *CacheDao) Insert(obj interface{}) (int64, error)
- func (cacheDao *CacheDao) IsExistInCache(key string) (bool, error)
- func (cacheDao *CacheDao) MRead(obj interface{}, ids []int64) ([]interface{}, error)
- func (cacheDao *CacheDao) Read(obj interface{}, id int64) error
- func (cacheDao *CacheDao) Update(obj interface{}) (int64, error)
- type DBDao
- func (dao *DBDao) Count(obj interface{}, name string, params *SortMap) (int64, error)
- func (dao *DBDao) DelKeyFromCache(key string) (bool, error)
- func (dao *DBDao) Delete(obj interface{}) (int64, error)
- func (dao *DBDao) GetIdList(obj interface{}, res interface{}, name string, params *SortMap, ...) ([]int64, error)
- func (dao *DBDao) GetIdListPage(obj interface{}, res interface{}, name string, params *SortMap, ...) ([]int64, error)
- func (dao *DBDao) GetList(obj interface{}, res interface{}, name string, params *SortMap, ...) ([]interface{}, error)
- func (dao *DBDao) GetListByIds(obj interface{}, ids []int64) ([]interface{}, error)
- func (dao *DBDao) GetListPage(obj interface{}, res interface{}, name string, params *SortMap, ...) ([]interface{}, error)
- func (dao *DBDao) GetMaping(obj interface{}, name string, params *SortMap) (interface{}, error)
- func (dao *DBDao) GetMapingId(obj interface{}, name string, params *SortMap) (int64, error)
- func (dao *DBDao) Insert(obj interface{}) (int64, error)
- func (dao *DBDao) IsExistInCache(key string) (bool, error)
- func (dao *DBDao) Read(obj interface{}, id int64) error
- func (dao *DBDao) Update(obj interface{}) (int64, error)
- type Dao
- type SortMap
Constants ¶
View Source
const ( DEFUALT = "default" PHEONIX = "pheonix" )
Variables ¶
View Source
var MONTH_SECOND_TIME = int64(30 * 24 * 60 * 60)
Functions ¶
This section is empty.
Types ¶
type CacheDao ¶
func GetCacheDao ¶
func GetCacheDao(v interface{}) *CacheDao
func (*CacheDao) DelKeyFromCache ¶
func (*CacheDao) GetIdListPage ¶
func (*CacheDao) GetListByIds ¶
func (*CacheDao) GetListPage ¶
func (cacheDao *CacheDao) GetListPage(obj interface{}, res interface{}, name string, params *SortMap, orderby []string, start int64, count int64) ([]interface{}, error)
分页根据查询条件获取对象列表 返回具体对象
func (*CacheDao) GetMaping ¶
func (cacheDao *CacheDao) GetMaping(obj interface{}, name string, params *SortMap) (interface{}, error)
此方法适用于多个条件对应于数据库唯一一条记录场景,即map映射 返回唯一对象s
func (*CacheDao) GetMapingId ¶
func (*CacheDao) IsExistInCache ¶
查询cache中是否存在某个key
type DBDao ¶
type DBDao struct {
// contains filtered or unexported fields
}
func (*DBDao) GetIdListPage ¶
func (*DBDao) GetListByIds ¶
func (*DBDao) GetListPage ¶
func (dao *DBDao) GetListPage(obj interface{}, res interface{}, name string, params *SortMap, orderby []string, start int64, count int64) ([]interface{}, error)
分页根据查询条件获取对象列表 返回具体对象
func (*DBDao) GetMapingId ¶
func (*DBDao) IsExistInCache ¶
查询cache中是否存在某个key
type Dao ¶
type Dao interface { // 插入对象 // 返回对象Id,Id在数据为此对象对应的表的主键 Insert(obj interface{}) (int64, error) // 更新对象 // 返回对象Id Update(obj interface{}) (int64, error) // 查询对象,注意:查询前需要设置对象Id字段值 Read(obj interface{}, id int64) error // 删除对象,注意:查询前需要设置对象Id字段值 // 返回删除对象Id Delete(obj interface{}) (int64, error) //计算记录数量 Count(obj interface{}, name string, params *SortMap) (int64, error) //查询cache中是否存在某个key IsExistInCache(key string) (bool, error) //从cache中删除key DelKeyFromCache(key string) (bool, error) // 获取查询条件对应的对象Id列表 // 返回满足查询条件的Id列表 GetIdList(obj interface{}, res interface{}, name string, params *SortMap, orderby []string) ([]int64, error) // 分页获取查询条件对应的对象Id列表 // 分页返回满足查询条件的Id列表 GetIdListPage(obj interface{}, res interface{}, name string, params *SortMap, orderby []string, start int64, count int64) ([]int64, error) // 根据查询条件获取对象列表 // 返回具体对象 GetList(obj interface{}, res interface{}, name string, params *SortMap, orderby []string) ([]interface{}, error) // 根据现有的ids列表,查询对象 // 返回为对象列表 GetListByIds(obj interface{}, ids int64) ([]interface{}, error) // 分页根据查询条件获取对象列表 // 返回具体对象 GetListPage(name string, params *SortMap, orderby []string, start int64, count int64) ([]interface{}, error) // 此方法适用于多个条件对应于数据库唯一一条记录场景,即map映射 // 返回唯一对象的Id GetMapingId(obj interface{}, name string, params *SortMap) (int64, error) // 此方法适用于多个条件对应于数据库唯一一条记录场景,即map映射 // 返回唯一对象 GetMaping(obj interface{}, name string, params *SortMap) (interface{}, error) }
Click to show internal directories.
Click to hide internal directories.