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

Method getUserTypeInfo

plugin/mcfish/main.go:524–541  ·  view source on GitHub ↗

获取用户的某类物品信息

(uid int64, thingType string)

Source from the content-addressed store, hash-verified

522
523// 获取用户的某类物品信息
524func (sql *fishdb) getUserTypeInfo(uid int64, thingType string) (thingInfos []article, err error) {
525 name := strconv.FormatInt(uid, 10) + "Pack"
526 sql.Lock()
527 defer sql.Unlock()
528 userInfo := article{}
529 err = sql.db.Create(name, &userInfo)
530 if err != nil {
531 return
532 }
533 if !sql.db.CanFind(name, "WHERE Type = ?", thingType) {
534 return
535 }
536 err = sql.db.FindFor(name, &userInfo, "WHERE Type = ?", func() error {
537 thingInfos = append(thingInfos, userInfo)
538 return nil
539 }, thingType)
540 return
541}
542
543/*********************************************************/
544/************************商店相关函数***********************/

Callers 1

initFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected