Authored by zhaojun2

bug fix

... ... @@ -77,15 +77,15 @@ public class ProductController {
@IgnoreSession
@RequestMapping(params = "method=ufo.product.storage.leastprice")
//@Cachable(expire=600)
public StorageLeastPriceResp queryStorageLeastprice(
public ApiResponse queryStorageLeastprice(
@RequestParam(value = "storage_id", required = true) Integer storageId) {
return queryStorageLeastprice();
return new ApiResponse.ApiResponseBuilder().data(queryStorageLeastprice()).code(200).message("storage.leastprice").build();
}
private StorageLeastPriceResp queryStorageLeastprice(){
String mockJson = "{\"storage_least_price\":{\"storage_id\":2,\"least_price\":124.3}}";
String mockJson = "{\"storage_least_price\":[{\"storage_id\":2,\"least_price\":124.3}]}";
StorageLeastPriceResp resp = UfoJsonUtil.safelyParseObject(mockJson, StorageLeastPriceResp.class);
return resp;
}
... ... @@ -95,10 +95,10 @@ public class ProductController {
@IgnoreSession
@RequestMapping(params = "method=ufo.product.storage.data")
//@Cachable(expire=600)
public StorageDataResp queryStorageInfo(
public ApiResponse queryStorageInfo(
@RequestParam(value = "storage_id", required = true) Integer storageId) {
return queryStorageData();
return new ApiResponse.ApiResponseBuilder().data(queryStorageData()).code(200).message("storage.data").build();
}
... ...
... ... @@ -3,12 +3,20 @@ package com.yohoufo.product.response;
import com.alibaba.fastjson.annotation.JSONField;
import java.math.BigDecimal;
import java.util.List;
public class StorageLeastPriceResp {
@JSONField(name = "storage_least_price")
private StorageLeastPrice storageLeastPrice;
private List<StorageLeastPrice> storageLeastPrice;
public List<StorageLeastPrice> getStorageLeastPrice() {
return storageLeastPrice;
}
public void setStorageLeastPrice(List<StorageLeastPrice> storageLeastPrice) {
this.storageLeastPrice = storageLeastPrice;
}
public static class StorageLeastPrice{
@JSONField(name = "storage_id")
... ...