Documentation
¶
Index ¶
- Constants
- Variables
- func AddDone(db *sqlx.DB, taskID int, by string) (err error)
- func AddTask(db *sqlx.DB, task string, enrollCnt int, chatID int64, createBy int) (tID int, err error)
- func CreateUser(db *sqlx.DB, u User) (err error)
- func DelTask(db *sqlx.DB, taskID int) (err error)
- func DeletePhraseByUUID(db *sqlx.DB, UUID string) (err error)
- func FinishATI(db *sqlx.DB, uuid string) (err error)
- func FinishCountByTaskID(db *sqlx.DB, taskID int) (cnt int, err error)
- func IncWanderTimes(db *sqlx.DB, uuid string) (err error)
- func InsertATI(db *sqlx.DB, ati ActiveTaskInstance) (err error)
- func InsertPhrase(db *sqlx.DB, p Phrase) (err error)
- func IsDone(db *sqlx.DB, taskID int, by string) (done bool, err error)
- func TaskCountByChat(db *sqlx.DB, chatID int64) (cnt int, err error)
- func TaskExist(db *sqlx.DB, taskID int) (ok bool, err error)
- func TaskRealID(db *sqlx.DB, taskID int, chatID int64) (tID int, err error)
- func UpdateATICooldown(db *sqlx.DB, ati ActiveTaskInstance) (err error)
- func UpdateATIStateByUUID(db *sqlx.DB, UUID string, state int) (err error)
- func UpdateUser(db *sqlx.DB, u User) (err error)
- type ActiveTaskInstance
- func SelectATIByTaskIDAndState(db *sqlx.DB, tid int, state int) (atil []ActiveTaskInstance, err error)
- func SelectATIByUUID(db *sqlx.DB, UUID string) (atil []ActiveTaskInstance, err error)
- func SelectATIByUserIDAndChatIDAndState(db *sqlx.DB, uid int, cid int64, state int) (atil []ActiveTaskInstance, err error)
- func SelectATIByUserIDAndChatIDAndStateForUpdate(db *sqlx.DB, uid int, cid int64, state int) (atil []ActiveTaskInstance, err error)
- func SelectATIByUserIDAndState(db *sqlx.DB, uid int, state int) (atil []ActiveTaskInstance, err error)
- func SelectATIByUserIDAndStateForUpdate(db *sqlx.DB, uid int, state int) (atil []ActiveTaskInstance, err error)
- type Phrase
- type RankingObj
- type Task
- type User
Constants ¶
View Source
const ( ATI_STATE_WORKING = 1 // user explicitly working on this model ATI_STATE_FINISHED = 2 // user finished the model ATI_STATE_INACTIVE = 3 // user worked on it before but now he asked to give up for now ATI_STATE_IMMUTABLE = 4 // user set a reminder, the task is immutable, will keep repeated every cron expression ATI_STATE_INVALID = -1 // the task no longer exist )
Variables ¶
View Source
var DB *sqlx.DB
Functions ¶
func UpdateATICooldown ¶
func UpdateATICooldown(db *sqlx.DB, ati ActiveTaskInstance) (err error)
func UpdateATIStateByUUID ¶
Types ¶
type ActiveTaskInstance ¶
type ActiveTaskInstance struct { InstanceUUID string `db:"instance_uuid"` TaskID int `db:"task_id"` UserID int `db:"user_id"` InstanceState int `db:"instance_state"` ReminderState int `db:"reminder_state"` ReminderExpression string `db:"reminder_expression"` WanderTimes int `db:"wander_times"` NotifyID int64 `db:"notify_to_id"` Cooldown int `db:"cooldown"` StartAt mysql.NullTime `db:"start_at"` EndAt mysql.NullTime `db:"end_at"` PhraseGroupUUID string `db:"phrase_group_uuid"` }
func SelectATIByUUID ¶
func SelectATIByUUID(db *sqlx.DB, UUID string) (atil []ActiveTaskInstance, err error)
type Phrase ¶
type Phrase struct { UUID string `db:"uuid" json:"uuid"` Phrase string `db:"phrase" json:"phrase"` CreateBy int `db:"create_by" json:"create_by"` CreateAt mysql.NullTime `db:"create_at" json:"create_at"` UpdateAt mysql.NullTime `db:"update_at" json:"update_at"` Show string `db:"show" json:"show"` GroupUUID string `db:"group_uuid" json:"group_uuid"` }
type RankingObj ¶
type Task ¶
type User ¶
type User struct { UUID string `db:"uuid" json:"uuid"` ID int `db:"id" json:"id"` UserName string `db:"user_name" json:"user_name"` DispName string `db:"disp_name" json:"disp_name"` CreateAt mysql.NullTime `db:"create_at" json:"-"` UpdateAt mysql.NullTime `db:"update_at" json:"-"` Exist bool `db:"exist" json:"exist"` // if Exist = false, the object is treated as nil DontTrack string `db:"dont_track" json:"dont_track"` MoyuPhraseUUID string `db:"moyu_phrase_uuid" json:"-"` PhraseUUID string `db:"phrase_uuid" json:"-"` }
Click to show internal directories.
Click to hide internal directories.