MCPcopy Index your code
hub / github.com/FloatTech/ZeroBot-Plugin / updateUserThingInfo

Method updateUserThingInfo

plugin/mcfish/main.go:481–493  ·  view source on GitHub ↗

更新用户物品信息

(uid int64, userInfo article)

Source from the content-addressed store, hash-verified

479
480// 更新用户物品信息
481func (sql *fishdb) updateUserThingInfo(uid int64, userInfo article) (err error) {
482 name := strconv.FormatInt(uid, 10) + "Pack"
483 sql.Lock()
484 defer sql.Unlock()
485 err = sql.db.Create(name, &userInfo)
486 if err != nil {
487 return
488 }
489 if userInfo.Number == 0 {
490 return sql.db.Del(name, "WHERE Duration = ?", userInfo.Duration)
491 }
492 return sql.db.Insert(name, &userInfo)
493}
494
495// 获取某关键字的数量
496func (sql *fishdb) getNumberFor(uid int64, thing string) (number int, err error) {

Callers 4

initFunction · 0.80
initFunction · 0.80
initFunction · 0.80
initFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected