PedometerCore

package
v5.1.37 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 16, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckData

func CheckData(args CoreSQLFrom.FieldsFrom) bool

达到max/min时反馈true

func ClearData

func ClearData(args *ArgsClearData) error

func GetCount

func GetCount(args CoreSQLFrom.FieldsFrom) int

检查当前有多少个

func NextData

func NextData(args CoreSQLFrom.FieldsFrom) (int, error)

进一位 自动协调进一步或退一步

func PrevData

func PrevData(args CoreSQLFrom.FieldsFrom) (int, error)

回退一步

func ReturnData

func ReturnData(args CoreSQLFrom.FieldsFrom) (int, error)

归位数据

func SetConfig

func SetConfig(args *ArgsSetConfig) (err error)

func SetData

func SetData(args *ArgsSetData) (int, error)

Types

type ArgsClearData

type ArgsClearData struct {
	//来源系统
	System string `db:"create_info_system"`
}

清理某个系统下所有内容

type ArgsSetConfig

type ArgsSetConfig struct {
	//标识码
	// 对应createInfo.system
	Mark string
	//计数
	Count int
	//默认过期时间
	ExpireAdd string
	//最小数
	MinCount int
	//最大数
	MaxCount int
	//是否增加
	IsAdd bool
}

设置特定模块的默认值 本模块仅识别system,用于匹配

type ArgsSetData

type ArgsSetData struct {
	//创建来源
	CreateInfo CoreSQLFrom.FieldsFrom
	//个数
	Count int
}

更改指定的位数

type FieldsPedometerConfigType

type FieldsPedometerConfigType struct {
	//系统来源
	Mark string `db:"mark" json:"mark"`
	//值
	Count int `db:"count" json:"count"`
	//默认超期时间
	DefaultExpire string `db:"default_expire" json:"defaultExpire"`
	//最小值和最大值
	MinCount int `db:"min_count" json:"minCount"`
	MaxCount int `db:"max_count" json:"maxCount"`
	//递增还是递减
	IsAdd bool `db:"is_add" json:"isAdd"`
}

FieldsPedometerConfigType 默认配置表

type FieldsPedometerType

type FieldsPedometerType struct {
	//ID
	ID int64 `db:"id" json:"id"`
	//创建时间
	CreateAt time.Time `db:"create_at" json:"createAt"`
	//更新时间
	UpdateAt time.Time `db:"update_at" json:"updateAt"`
	//过期时间
	// 超期后将自动删除数据
	ExpireAt time.Time `db:"expire_at" json:"expireAt"`
	//创建来源和创建来源ID
	CreateInfo CoreSQLFrom.FieldsFrom `db:"create_info" json:"createInfo"`
	//值
	Count int `db:"count" json:"count"`
}

FieldsPedometerType 主要结构

func GetData

func GetData(args CoreSQLFrom.FieldsFrom) (data FieldsPedometerType, err error)

获取数据

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL