Authored by zhaojun2

bug fix

@@ -77,15 +77,15 @@ public class ProductController { @@ -77,15 +77,15 @@ public class ProductController {
77 @IgnoreSession 77 @IgnoreSession
78 @RequestMapping(params = "method=ufo.product.storage.leastprice") 78 @RequestMapping(params = "method=ufo.product.storage.leastprice")
79 //@Cachable(expire=600) 79 //@Cachable(expire=600)
80 - public StorageLeastPriceResp queryStorageLeastprice( 80 + public ApiResponse queryStorageLeastprice(
81 @RequestParam(value = "storage_id", required = true) Integer storageId) { 81 @RequestParam(value = "storage_id", required = true) Integer storageId) {
82 82
83 - return queryStorageLeastprice(); 83 + return new ApiResponse.ApiResponseBuilder().data(queryStorageLeastprice()).code(200).message("storage.leastprice").build();
84 } 84 }
85 85
86 86
87 private StorageLeastPriceResp queryStorageLeastprice(){ 87 private StorageLeastPriceResp queryStorageLeastprice(){
88 - String mockJson = "{\"storage_least_price\":{\"storage_id\":2,\"least_price\":124.3}}"; 88 + String mockJson = "{\"storage_least_price\":[{\"storage_id\":2,\"least_price\":124.3}]}";
89 StorageLeastPriceResp resp = UfoJsonUtil.safelyParseObject(mockJson, StorageLeastPriceResp.class); 89 StorageLeastPriceResp resp = UfoJsonUtil.safelyParseObject(mockJson, StorageLeastPriceResp.class);
90 return resp; 90 return resp;
91 } 91 }
@@ -95,10 +95,10 @@ public class ProductController { @@ -95,10 +95,10 @@ public class ProductController {
95 @IgnoreSession 95 @IgnoreSession
96 @RequestMapping(params = "method=ufo.product.storage.data") 96 @RequestMapping(params = "method=ufo.product.storage.data")
97 //@Cachable(expire=600) 97 //@Cachable(expire=600)
98 - public StorageDataResp queryStorageInfo( 98 + public ApiResponse queryStorageInfo(
99 @RequestParam(value = "storage_id", required = true) Integer storageId) { 99 @RequestParam(value = "storage_id", required = true) Integer storageId) {
100 100
101 - return queryStorageData(); 101 + return new ApiResponse.ApiResponseBuilder().data(queryStorageData()).code(200).message("storage.data").build();
102 } 102 }
103 103
104 104
@@ -3,12 +3,20 @@ package com.yohoufo.product.response; @@ -3,12 +3,20 @@ package com.yohoufo.product.response;
3 import com.alibaba.fastjson.annotation.JSONField; 3 import com.alibaba.fastjson.annotation.JSONField;
4 4
5 import java.math.BigDecimal; 5 import java.math.BigDecimal;
  6 +import java.util.List;
6 7
7 public class StorageLeastPriceResp { 8 public class StorageLeastPriceResp {
8 9
9 @JSONField(name = "storage_least_price") 10 @JSONField(name = "storage_least_price")
10 - private StorageLeastPrice storageLeastPrice; 11 + private List<StorageLeastPrice> storageLeastPrice;
11 12
  13 + public List<StorageLeastPrice> getStorageLeastPrice() {
  14 + return storageLeastPrice;
  15 + }
  16 +
  17 + public void setStorageLeastPrice(List<StorageLeastPrice> storageLeastPrice) {
  18 + this.storageLeastPrice = storageLeastPrice;
  19 + }
12 20
13 public static class StorageLeastPrice{ 21 public static class StorageLeastPrice{
14 @JSONField(name = "storage_id") 22 @JSONField(name = "storage_id")