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

Method getStoreInfo

plugin/mcfish/main.go:647–667  ·  view source on GitHub ↗

获取商店信息

()

Source from the content-addressed store, hash-verified

645
646// 获取商店信息
647func (sql *fishdb) getStoreInfo() (thingInfos []store, err error) {
648 sql.Lock()
649 defer sql.Unlock()
650 thingInfo := store{}
651 err = sql.db.Create("store", &thingInfo)
652 if err != nil {
653 return
654 }
655 count, err := sql.db.Count("store")
656 if err != nil {
657 return
658 }
659 if count == 0 {
660 return
661 }
662 err = sql.db.FindFor("store", &thingInfo, "ORDER by Type, Name, Price ASC", func() error {
663 thingInfos = append(thingInfos, thingInfo)
664 return nil
665 })
666 return
667}
668
669// 获取商店物品信息
670func (sql *fishdb) getStoreThingInfo(thing string) (thingInfos []store, err error) {

Callers 1

initFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected