Subversion Repositories SmartDukaan

Rev

Rev 688 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 688 Rev 708
Line 126... Line 126...
126
     * This methods removes the specified quantiry of the specified item from the cart.
126
     * This methods removes the specified quantiry of the specified item from the cart.
127
     * 
127
     * 
128
     * @param cartId
128
     * @param cartId
129
     * @param items
129
     * @param items
130
     */
130
     */
131
    public boolean resetCart(long cartId, Map<Long,Long> items) throws ShoppingCartException, TException;
131
    public boolean resetCart(long cartId, Map<Long,Double> items) throws ShoppingCartException, TException;
132
 
132
 
133
    public void addWidget(Widget widget) throws WidgetException, TException;
133
    public void addWidget(Widget widget) throws WidgetException, TException;
134
 
134
 
135
    public void addItemToWidget(long widget_id, List<Long> items) throws WidgetException, TException;
135
    public void addItemToWidget(long widget_id, List<Long> items) throws WidgetException, TException;
136
 
136
 
Line 1369... Line 1369...
1369
        throw result.scex;
1369
        throw result.scex;
1370
      }
1370
      }
1371
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "checkOut failed: unknown result");
1371
      throw new TApplicationException(TApplicationException.MISSING_RESULT, "checkOut failed: unknown result");
1372
    }
1372
    }
1373
 
1373
 
1374
    public boolean resetCart(long cartId, Map<Long,Long> items) throws ShoppingCartException, TException
1374
    public boolean resetCart(long cartId, Map<Long,Double> items) throws ShoppingCartException, TException
1375
    {
1375
    {
1376
      send_resetCart(cartId, items);
1376
      send_resetCart(cartId, items);
1377
      return recv_resetCart();
1377
      return recv_resetCart();
1378
    }
1378
    }
1379
 
1379
 
1380
    public void send_resetCart(long cartId, Map<Long,Long> items) throws TException
1380
    public void send_resetCart(long cartId, Map<Long,Double> items) throws TException
1381
    {
1381
    {
1382
      oprot_.writeMessageBegin(new TMessage("resetCart", TMessageType.CALL, seqid_));
1382
      oprot_.writeMessageBegin(new TMessage("resetCart", TMessageType.CALL, seqid_));
1383
      resetCart_args args = new resetCart_args();
1383
      resetCart_args args = new resetCart_args();
1384
      args.cartId = cartId;
1384
      args.cartId = cartId;
1385
      args.items = items;
1385
      args.items = items;
Line 25792... Line 25792...
25792
 
25792
 
25793
    private static final TField CART_ID_FIELD_DESC = new TField("cartId", TType.I64, (short)1);
25793
    private static final TField CART_ID_FIELD_DESC = new TField("cartId", TType.I64, (short)1);
25794
    private static final TField ITEMS_FIELD_DESC = new TField("items", TType.MAP, (short)2);
25794
    private static final TField ITEMS_FIELD_DESC = new TField("items", TType.MAP, (short)2);
25795
 
25795
 
25796
    private long cartId;
25796
    private long cartId;
25797
    private Map<Long,Long> items;
25797
    private Map<Long,Double> items;
25798
 
25798
 
25799
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
25799
    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
25800
    public enum _Fields implements TFieldIdEnum {
25800
    public enum _Fields implements TFieldIdEnum {
25801
      CART_ID((short)1, "cartId"),
25801
      CART_ID((short)1, "cartId"),
25802
      ITEMS((short)2, "items");
25802
      ITEMS((short)2, "items");
Line 25860... Line 25860...
25860
      put(_Fields.CART_ID, new FieldMetaData("cartId", TFieldRequirementType.DEFAULT, 
25860
      put(_Fields.CART_ID, new FieldMetaData("cartId", TFieldRequirementType.DEFAULT, 
25861
          new FieldValueMetaData(TType.I64)));
25861
          new FieldValueMetaData(TType.I64)));
25862
      put(_Fields.ITEMS, new FieldMetaData("items", TFieldRequirementType.DEFAULT, 
25862
      put(_Fields.ITEMS, new FieldMetaData("items", TFieldRequirementType.DEFAULT, 
25863
          new MapMetaData(TType.MAP, 
25863
          new MapMetaData(TType.MAP, 
25864
              new FieldValueMetaData(TType.I64), 
25864
              new FieldValueMetaData(TType.I64), 
25865
              new FieldValueMetaData(TType.I64))));
25865
              new FieldValueMetaData(TType.DOUBLE))));
25866
    }});
25866
    }});
25867
 
25867
 
25868
    static {
25868
    static {
25869
      FieldMetaData.addStructMetaDataMap(resetCart_args.class, metaDataMap);
25869
      FieldMetaData.addStructMetaDataMap(resetCart_args.class, metaDataMap);
25870
    }
25870
    }
Line 25872... Line 25872...
25872
    public resetCart_args() {
25872
    public resetCart_args() {
25873
    }
25873
    }
25874
 
25874
 
25875
    public resetCart_args(
25875
    public resetCart_args(
25876
      long cartId,
25876
      long cartId,
25877
      Map<Long,Long> items)
25877
      Map<Long,Double> items)
25878
    {
25878
    {
25879
      this();
25879
      this();
25880
      this.cartId = cartId;
25880
      this.cartId = cartId;
25881
      setCartIdIsSet(true);
25881
      setCartIdIsSet(true);
25882
      this.items = items;
25882
      this.items = items;
Line 25888... Line 25888...
25888
    public resetCart_args(resetCart_args other) {
25888
    public resetCart_args(resetCart_args other) {
25889
      __isset_bit_vector.clear();
25889
      __isset_bit_vector.clear();
25890
      __isset_bit_vector.or(other.__isset_bit_vector);
25890
      __isset_bit_vector.or(other.__isset_bit_vector);
25891
      this.cartId = other.cartId;
25891
      this.cartId = other.cartId;
25892
      if (other.isSetItems()) {
25892
      if (other.isSetItems()) {
25893
        Map<Long,Long> __this__items = new HashMap<Long,Long>();
25893
        Map<Long,Double> __this__items = new HashMap<Long,Double>();
25894
        for (Map.Entry<Long, Long> other_element : other.items.entrySet()) {
25894
        for (Map.Entry<Long, Double> other_element : other.items.entrySet()) {
25895
 
25895
 
25896
          Long other_element_key = other_element.getKey();
25896
          Long other_element_key = other_element.getKey();
25897
          Long other_element_value = other_element.getValue();
25897
          Double other_element_value = other_element.getValue();
25898
 
25898
 
25899
          Long __this__items_copy_key = other_element_key;
25899
          Long __this__items_copy_key = other_element_key;
25900
 
25900
 
25901
          Long __this__items_copy_value = other_element_value;
25901
          Double __this__items_copy_value = other_element_value;
25902
 
25902
 
25903
          __this__items.put(__this__items_copy_key, __this__items_copy_value);
25903
          __this__items.put(__this__items_copy_key, __this__items_copy_value);
25904
        }
25904
        }
25905
        this.items = __this__items;
25905
        this.items = __this__items;
25906
      }
25906
      }
Line 25940... Line 25940...
25940
 
25940
 
25941
    public int getItemsSize() {
25941
    public int getItemsSize() {
25942
      return (this.items == null) ? 0 : this.items.size();
25942
      return (this.items == null) ? 0 : this.items.size();
25943
    }
25943
    }
25944
 
25944
 
25945
    public void putToItems(long key, long val) {
25945
    public void putToItems(long key, double val) {
25946
      if (this.items == null) {
25946
      if (this.items == null) {
25947
        this.items = new HashMap<Long,Long>();
25947
        this.items = new HashMap<Long,Double>();
25948
      }
25948
      }
25949
      this.items.put(key, val);
25949
      this.items.put(key, val);
25950
    }
25950
    }
25951
 
25951
 
25952
    public Map<Long,Long> getItems() {
25952
    public Map<Long,Double> getItems() {
25953
      return this.items;
25953
      return this.items;
25954
    }
25954
    }
25955
 
25955
 
25956
    public resetCart_args setItems(Map<Long,Long> items) {
25956
    public resetCart_args setItems(Map<Long,Double> items) {
25957
      this.items = items;
25957
      this.items = items;
25958
      return this;
25958
      return this;
25959
    }
25959
    }
25960
 
25960
 
25961
    public void unsetItems() {
25961
    public void unsetItems() {
Line 25985... Line 25985...
25985
 
25985
 
25986
      case ITEMS:
25986
      case ITEMS:
25987
        if (value == null) {
25987
        if (value == null) {
25988
          unsetItems();
25988
          unsetItems();
25989
        } else {
25989
        } else {
25990
          setItems((Map<Long,Long>)value);
25990
          setItems((Map<Long,Double>)value);
25991
        }
25991
        }
25992
        break;
25992
        break;
25993
 
25993
 
25994
      }
25994
      }
25995
    }
25995
    }
Line 26092... Line 26092...
26092
              break;
26092
              break;
26093
            case ITEMS:
26093
            case ITEMS:
26094
              if (field.type == TType.MAP) {
26094
              if (field.type == TType.MAP) {
26095
                {
26095
                {
26096
                  TMap _map37 = iprot.readMapBegin();
26096
                  TMap _map37 = iprot.readMapBegin();
26097
                  this.items = new HashMap<Long,Long>(2*_map37.size);
26097
                  this.items = new HashMap<Long,Double>(2*_map37.size);
26098
                  for (int _i38 = 0; _i38 < _map37.size; ++_i38)
26098
                  for (int _i38 = 0; _i38 < _map37.size; ++_i38)
26099
                  {
26099
                  {
26100
                    long _key39;
26100
                    long _key39;
26101
                    long _val40;
26101
                    double _val40;
26102
                    _key39 = iprot.readI64();
26102
                    _key39 = iprot.readI64();
26103
                    _val40 = iprot.readI64();
26103
                    _val40 = iprot.readDouble();
26104
                    this.items.put(_key39, _val40);
26104
                    this.items.put(_key39, _val40);
26105
                  }
26105
                  }
26106
                  iprot.readMapEnd();
26106
                  iprot.readMapEnd();
26107
                }
26107
                }
26108
              } else { 
26108
              } else { 
Line 26125... Line 26125...
26125
      oprot.writeI64(this.cartId);
26125
      oprot.writeI64(this.cartId);
26126
      oprot.writeFieldEnd();
26126
      oprot.writeFieldEnd();
26127
      if (this.items != null) {
26127
      if (this.items != null) {
26128
        oprot.writeFieldBegin(ITEMS_FIELD_DESC);
26128
        oprot.writeFieldBegin(ITEMS_FIELD_DESC);
26129
        {
26129
        {
26130
          oprot.writeMapBegin(new TMap(TType.I64, TType.I64, this.items.size()));
26130
          oprot.writeMapBegin(new TMap(TType.I64, TType.DOUBLE, this.items.size()));
26131
          for (Map.Entry<Long, Long> _iter41 : this.items.entrySet())
26131
          for (Map.Entry<Long, Double> _iter41 : this.items.entrySet())
26132
          {
26132
          {
26133
            oprot.writeI64(_iter41.getKey());
26133
            oprot.writeI64(_iter41.getKey());
26134
            oprot.writeI64(_iter41.getValue());
26134
            oprot.writeDouble(_iter41.getValue());
26135
          }
26135
          }
26136
          oprot.writeMapEnd();
26136
          oprot.writeMapEnd();
26137
        }
26137
        }
26138
        oprot.writeFieldEnd();
26138
        oprot.writeFieldEnd();
26139
      }
26139
      }