package do import ( "encoding/json" "strconv" "trasfer_middleware/cmd/rpc/internal/logic/vo" "trasfer_middleware/genModel" ) func MarketKeyDataSet(order *genModel.ServerOrderMarket, resq string, resp string) (err error) { var ( orderInfoReq map[string]interface{} orderInfoRes map[string]interface{} ) err = json.Unmarshal([]byte(resp), &orderInfoRes) if orderInfoRes["errCode"].(string) != vo.MARKET_SUCCESS { return err } err = json.Unmarshal([]byte(resq), &orderInfoReq) if err != nil { return err } order.Num, err = strconv.ParseInt(orderInfoReq["voucher_num"].(string), 16, 64) if err != nil { return err } order.ProductId = orderInfoReq["voucher_id"].(string) if err != nil { return err } order.VoucherNum = orderInfoReq["mem_id"].(string) order.OutBizNo = orderInfoReq["req_serial_no"].(string) order.OrderNum = orderInfoRes["data"].(map[string]interface{})["voucher_code"].(string) return nil }