批量美团logo

This commit is contained in:
richboo111
2023-03-23 10:49:38 +08:00
parent a28f4545c8
commit 1b9c857a14
2 changed files with 18 additions and 3 deletions

View File

@@ -6166,10 +6166,11 @@ type MtRelInfo struct {
PicUrl string `json:"pic_url"`
}
//[]{PoiCode:"16594433",PicUrl:"http://p0.meituan.net/business/e23d337029fcf74f5a7bcea4e01dac98219292.jpg"}
//批量获取美团门店logos
func BatchGetMTStoreLogos(vendorOrgCode string, mtStoreIDs []string) (storeLogos []MtRelInfo) {
for _, v := range mtStoreIDs {
if storeInfos, err1 := mtwm.GetAPI(vendorOrgCode, 0, "").PoiGet(v); err1 == nil {
if storeInfos, err1 := mtwm.GetAPI(vendorOrgCode, 0, "").PoiGet(v); err1 != nil {
storeLogos = append(storeLogos, MtRelInfo{
PoiCode: v,
PicUrl: " ",
@@ -6192,7 +6193,11 @@ func BatchUpdateMTStoreLogos(vendorOrgCode string, relInfo []MtRelInfo) (hint st
param := map[string]interface{}{
"pic_url": v.PicUrl,
}
if err := mtwm.GetAPI(vendorOrgCode, 0, "").PoiSave(v.PoiCode, param); err != nil {
storeDetail, err1 := dao.GetStoreDetailForDD(dao.GetDB(), 0, model.VendorIDMTWM, v.PoiCode, "")
if err1 != nil {
hint += fmt.Sprintf("%s:%v\n", v.PoiCode, err1)
}
if err := mtwm.GetAPI(vendorOrgCode, storeDetail.Store.ID, "").PoiSave(v.PoiCode, param); err != nil {
hint += fmt.Sprintf("%s:%v\n", v.PoiCode, err)
}
}