批量美团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

@@ -1,6 +1,8 @@
package controllers
import (
"bytes"
"encoding/json"
"errors"
"git.rosy.net.cn/baseapi/utils"
@@ -1647,9 +1649,17 @@ func (c *StoreController) BatchGetMTStoreLogos() {
func (c *StoreController) BatchUpdateMTStoreLogos() {
c.callBatchUpdateMTStoreLogos(func(params *tStoreBatchUpdateMTStoreLogosParams) (retVal interface{}, hint string, err error) {
mtRelInfos := make([]cms.MtRelInfo, 0)
if err := utils.UnmarshalUseNumber([]byte(params.RelInfos), &mtRelInfos); err == nil {
b := bytes.NewBufferString(params.RelInfos)
decoder := json.NewDecoder(b)
if err = decoder.Decode(&mtRelInfos); err == nil {
hint = cms.BatchUpdateMTStoreLogos(params.VendorOrgCode, mtRelInfos)
}
//if err = mapstructure.Decode(params.RelInfos, &mtRelInfos); err == nil {
// hint = cms.BatchUpdateMTStoreLogos(params.VendorOrgCode, mtRelInfos)
//}
//if err := utils.UnmarshalUseNumber([]byte(params.RelInfos), &mtRelInfos); err == nil {
// hint = cms.BatchUpdateMTStoreLogos(params.VendorOrgCode, mtRelInfos)
//}
return nil, hint, nil
})
}