This commit is contained in:
邹宗楠
2023-01-03 18:08:13 +08:00
parent 61206b6490
commit b49f41acbb

View File

@@ -1,7 +1,6 @@
package dao
import (
"fmt"
"git.rosy.net.cn/baseapi/utils"
"git.rosy.net.cn/jx-callback/business/model"
)
@@ -51,15 +50,9 @@ func UpdateThingMap(thingMap *model.ThingMap) error {
return err
}
var thingMapList = make(map[string][]*model.ThingMap, 1024)
// GetThingToTiktokMapList 抖店获取同步类型
func GetThingToTiktokMapList(db *DaoDB, vendorId int, thingId int64, vendorOrgCode string) (cats []*model.ThingMap, err error) {
if _, ok := thingMapList[fmt.Sprintf("%d_%s_%d", vendorId, vendorOrgCode, thingId)]; ok {
if len(thingMapList[fmt.Sprintf("%d_%s_%d", vendorId, vendorOrgCode, thingId)]) != 0 {
return thingMapList[fmt.Sprintf("%d_%s_%d", vendorId, vendorOrgCode, thingId)], nil
}
}
sql := `
SELECT t1.*
FROM thing_map t1
@@ -73,9 +66,7 @@ func GetThingToTiktokMapList(db *DaoDB, vendorId int, thingId int64, vendorOrgCo
}
err = GetRows(db, &cats, sql, sqlParams...)
if len(cats) != 0 {
thingMapList[fmt.Sprintf("%d_%s_%d", cats[0].VendorID, cats[0].VendorOrgCode, cats[0].ThingID)] = cats
}
return cats, err
}