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

Method getStoreThingInfo

plugin/mcfish/main.go:670–693  ·  view source on GitHub ↗

获取商店物品信息

(thing string)

Source from the content-addressed store, hash-verified

668
669// 获取商店物品信息
670func (sql *fishdb) getStoreThingInfo(thing string) (thingInfos []store, err error) {
671 sql.Lock()
672 defer sql.Unlock()
673 thingInfo := store{}
674 err = sql.db.Create("store", &thingInfo)
675 if err != nil {
676 return
677 }
678 count, err := sql.db.Count("store")
679 if err != nil {
680 return
681 }
682 if count == 0 {
683 return
684 }
685 if !sql.db.CanFind("store", "WHERE Name = ?", thing) {
686 return
687 }
688 err = sql.db.FindFor("store", &thingInfo, "WHERE Name = ?", func() error {
689 thingInfos = append(thingInfos, thingInfo)
690 return nil
691 }, thing)
692 return
693}
694
695// 获取商店物品信息
696func (sql *fishdb) checkStoreFor(thing store, number int) (ok bool, err error) {

Callers 1

initFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected