Documentation ¶
Index ¶
- Constants
- func ChangeDateFormat(dtFormat, timeFormat string)
- func Convert[T any](sourceObj interface{}) T
- type BaseBll
- type BaseDao
- func (dao *BaseDao[T]) CheckExist(id uint64) bool
- func (dao *BaseDao[T]) Create(model *T) error
- func (dao *BaseDao[T]) CreateList(list []T) error
- func (dao *BaseDao[T]) DB() *gorm.DB
- func (dao *BaseDao[T]) Delete(id uint64) error
- func (dao *BaseDao[T]) GetAll() ([]*T, error)
- func (dao *BaseDao[T]) GetCondition(query interface{}, args ...interface{}) (*T, error)
- func (dao *BaseDao[T]) GetConditions(query interface{}, args ...interface{}) ([]*T, error)
- func (dao *BaseDao[T]) GetConditionsLimit(maxCount int, query interface{}, args ...interface{}) ([]*T, error)
- func (dao *BaseDao[T]) GetList(startId uint64, maxCount int) ([]*T, error)
- func (dao *BaseDao[T]) GetModel(id uint64) (*T, error)
- func (dao *BaseDao[T]) Save(model *T) error
- func (dao *BaseDao[T]) Update(model *T) error
- type Date
- type DateTime
- func (d DateTime) Add(duration time.Duration) DateTime
- func (d DateTime) Date() Date
- func (d DateTime) DayFirstSecond() DateTime
- func (d DateTime) DayLastSecond() DateTime
- func (d *DateTime) FromTime(time time.Time)
- func (d DateTime) MarshalJSON() ([]byte, error)
- func (d DateTime) ToString() string
- func (d DateTime) ToTime() time.Time
- func (d *DateTime) UnmarshalJSON(data []byte) error
- type DbFull
- type DbSimple
- type Error
- type File
- type QAdapter
- type QApiHandler
- type QBllSvc
- type QContext
- type QDaoSvc
- type QFail
- type QNoticeHandler
- type Refuse
Constants ¶
View Source
const ( ErrorCodeSubmit = iota + 500 // 提交操作失败(增删改) ErrorCodeTimeOut // 执行超时 ErrorCodeOSError // 系统故障,不可恢复 )
View Source
const ( RefuseCodeParamInvalid = iota + 400 // 传入参数无效 RefuseCodeTokenInvalid // token无效或过期 RefuseCodePermissionDenied // 权限不足,拒绝访问 )
Variables ¶
This section is empty.
Functions ¶
func ChangeDateFormat ¶
func ChangeDateFormat(dtFormat, timeFormat string)
ChangeDateFormat
@Description: 修改系统全局时间格式 @param datef @param timef
Types ¶
type BaseDao ¶
type BaseDao[T any] struct { // contains filtered or unexported fields }
func (*BaseDao[T]) CheckExist ¶
CheckExist
@Description: 验证数据是否存在 @param id @return bool @return error
func (*BaseDao[T]) GetCondition ¶
GetCondition
@Description: 条件查询一条记录 @param query 条件,如 id = ? 或 id IN (?) 等 @param args 条件参数,如 id, ids 等 @return []*T @return error
func (*BaseDao[T]) GetConditions ¶
GetConditions
@Description: 条件查询一组列表 @param query 条件,如 id = ? 或 id IN (?) 等 @param args 条件参数,如 id, ids 等 @return []*T @return error
func (*BaseDao[T]) GetConditionsLimit ¶
func (dao *BaseDao[T]) GetConditionsLimit(maxCount int, query interface{}, args ...interface{}) ([]*T, error)
GetConditions
@Description: 条件查询一组列表 @param maxCount 最大数量 @param query 条件,如 id = ? 或 id IN (?) 等 @param args 条件参数,如 id, ids 等 @return []*T @return error
func (*BaseDao[T]) GetList ¶
GetList
@Description: 查询一组列表 @param startId 起始Id @param maxCount 最大数量 @return []*T @return error
type Date ¶
type Date uint32
type DateTime ¶
type DateTime uint64
type QAdapter ¶
type QAdapter interface { RegApi(name string, handler QApiHandler) RegSubscribe(name string, handler QNoticeHandler) SendNotice(topic string, payload interface{}) Invoke(funcName string, params map[string]interface{}) (interface{}, QFail) }
type QApiHandler ¶
type QNoticeHandler ¶
type QNoticeHandler func(ctx QContext)
Click to show internal directories.
Click to hide internal directories.