Documentation ¶
Index ¶
- func NewUUID() string
- 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]) DeleteCondition(condition string, args ...any) 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]) GetCount() int64
- 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]) SaveList(list []T) error
- func (dao *BaseDao[T]) Update(model *T) error
- func (dao *BaseDao[T]) UpdateList(list []T) error
- type BrokerConfig
- type Context
- type Date
- func (d Date) AddDays(day int) Date
- func (d Date) AddMonths(month int) Date
- func (d Date) AddYears(year int) Date
- func (d Date) CurrentToWeekday(weekday time.Weekday) Date
- func (d Date) ForTo(endDate Date, interval uint, callback func(curr Date))
- func (d Date) MarshalJSON() ([]byte, error)
- func (d Date) ToString() string
- func (d Date) ToTime() time.Time
- func (d *Date) UnmarshalJSON(data []byte) error
- func (d Date) Week() time.Weekday
- func (d Date) YearWeek() int
- type DateTime
- func (d DateTime) AddDays(day int) Date
- func (d DateTime) AddHours(hour int) Date
- func (d DateTime) AddMinutes(minute int) Date
- func (d DateTime) AddMonths(month int) Date
- func (d DateTime) AddSeconds(second int) Date
- func (d DateTime) AddYears(year int) Date
- func (d DateTime) CurrentToWeekday(weekday time.Weekday) DateTime
- func (d DateTime) ForTo(endDate DateTime, interval uint, callback func(curr DateTime))
- func (d DateTime) MarshalJSON() ([]byte, error)
- func (d DateTime) ToString() string
- func (d DateTime) ToTime() time.Time
- func (d *DateTime) UnmarshalJSON(data []byte) error
- func (d DateTime) Week() time.Weekday
- func (d DateTime) YearWeek() int
- type DbFull
- type DbSimple
- type DetectedHandler
- type DeviceInfo
- type ECommState
- type ELog
- type File
- type InitHandler
- type NoticeHandler
- type ReqHandler
- type SendRequestHandler
- type StateHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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]) DeleteCondition ¶
DeleteCondition
@Description: 自定义条件删除数据 @param condition @param args @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)
GetConditionsLimit
@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
func (*BaseDao[T]) Save ¶
Save
@Description: 修改一条记录(不存在则新增) @param model 对象 @return bool @return error
func (*BaseDao[T]) SaveList ¶ added in v0.0.9
SaveList
@Description: 修改一组记录(不存在则新增) @param list 列表 @return error
func (*BaseDao[T]) UpdateList ¶ added in v0.0.9
UpdateList
@Description: 修改一组记录 @param list 列表 @return error
type BrokerConfig ¶
BrokerConfig 主服务配置
type Context ¶
type Context interface { GetString(key string) string GetInt(key string) int GetUInt(key string) uint64 GetByte(key string) byte GetBool(key string) bool GetDate(key string) Date GetDateTime(key string) DateTime GetFiles(key string) []File GetStruct(key string, refStruct any) Raw() any }
Context 上下文
type Date ¶
type Date uint32
Date 日期
func (Date) CurrentToWeekday ¶ added in v0.0.9
CurrentToWeekday
@Description: 获取当前日期所在本周指定周几的日期 @param weekday 需要返回周几 @return date 周几日期
func (Date) ForTo ¶ added in v0.0.9
ForTo
@Description: 自动循环遍历日期,并按日返回每天日期 @param endDate 结束日期 @param interval 日期间隔 @param callback 回调 @return int YYYY年+WW周,如 202451
type DateTime ¶
type DateTime uint64
DateTime 日期+时间
func (DateTime) AddHours ¶ added in v0.0.8
AddHours
@Description: 增减小时数 @param hour 小时数 @return Date
func (DateTime) AddMinutes ¶ added in v0.0.8
AddMinutes
@Description: 增减分钟数 @param minute 分钟数 @return Date
func (DateTime) AddMonths ¶ added in v0.0.8
AddMonths
@Description: 增减月数 @param month 月数 @return Date
func (DateTime) AddSeconds ¶ added in v0.0.8
AddSeconds
@Description: 增减秒数 @param second 秒数 @return Date
func (DateTime) CurrentToWeekday ¶ added in v0.0.9
CurrentToWeekday
@Description: 获取当前日期所在本周指定周几的日期 @param weekday 需要返回周几 @return date 周几日期
func (DateTime) ForTo ¶ added in v0.0.9
ForTo
@Description: 自动循环遍历日期,并按日返回每天日期 @param endDate 结束日期 @param interval 日期间隔 @param callback 回调 @return int YYYY年+WW周,如 202451
type DetectedHandler ¶ added in v0.0.8
DetectedHandler 检测回调
type DeviceInfo ¶ added in v0.0.3
DeviceInfo 本地设备信息
func (DeviceInfo) IsEmpty ¶ added in v0.0.3
func (dev DeviceInfo) IsEmpty() bool
type ECommState ¶
type ECommState string
const ( ECommStateConnecting ECommState = "Connecting" //连接中 ECommStateLinked ECommState = "Linked" //已连接 ECommStateLinkLost ECommState = "LinkLost" //连接丢失 ECommStateFault ECommState = "Fault" //故障 ECommStateStopped ECommState = "Stopped" //已停止 )
type SendRequestHandler ¶
SendRequestHandler 发送请求方法定义
Click to show internal directories.
Click to hide internal directories.