|
|
package com.yohoufo.product.controller;
|
|
|
|
|
|
import com.yoho.tools.docs.ApiOperation;
|
|
|
import com.yohoufo.common.utils.UfoJsonUtil;
|
|
|
import com.yohoufo.product.response.ProductDetailResp;
|
|
|
import com.yohoufo.product.response.ProductSeriesTemplateResp;
|
|
|
import com.yohoufo.product.response.StorageDataResp;
|
|
|
import com.yohoufo.product.response.StorageLeastPriceResp;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
import com.yoho.tools.docs.ApiOperation;
|
|
|
import com.yohoufo.common.ApiResponse;
|
|
|
import com.yohoufo.common.annotation.IgnoreSession;
|
|
|
import com.yohoufo.common.annotation.IgnoreSignature;
|
|
|
import com.yohoufo.common.caller.UfoServiceCaller;
|
|
|
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
import com.yohoufo.common.utils.UfoJsonUtil;
|
|
|
import com.yohoufo.product.request.StoragePriceBo;
|
|
|
import com.yohoufo.product.response.ProductDetailResp;
|
|
|
import com.yohoufo.product.response.ProductSeriesTemplateResp;
|
|
|
import com.yohoufo.product.response.StorageDataResp;
|
|
|
import com.yohoufo.product.response.StorageLeastPriceResp;
|
|
|
|
|
|
|
|
|
@RestController
|
...
|
...
|
@@ -79,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;
|
|
|
}
|
...
|
...
|
@@ -97,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();
|
|
|
}
|
|
|
|
|
|
|
...
|
...
|
@@ -113,11 +111,7 @@ public class ProductController { |
|
|
@IgnoreSignature
|
|
|
@IgnoreSession
|
|
|
@RequestMapping(params = "method=ufo.product.createSkup")
|
|
|
public ApiResponse createSkup(
|
|
|
@RequestParam(value = "skup", required = false) Integer skup,
|
|
|
@RequestParam(value = "seller_uid", required = false) Integer sellerUid,
|
|
|
@RequestParam(value = "price", required = false) String price) {
|
|
|
|
|
|
public ApiResponse createSkup(@RequestBody StoragePriceBo skupBo) {
|
|
|
return new ApiResponse(200, "创建成功!", Boolean.TRUE);
|
|
|
}
|
|
|
|
...
|
...
|
@@ -125,6 +119,7 @@ public class ProductController { |
|
|
@IgnoreSession
|
|
|
@RequestMapping(params = "method=ufo.product.saleSkup")
|
|
|
public ApiResponse saleSkup(
|
|
|
@RequestParam(value = "product_id", required = false) Integer productId,
|
|
|
@RequestParam(value = "skup", required = false) Integer skup) {
|
|
|
return new ApiResponse(200, "卖出成功!", Boolean.TRUE);
|
|
|
}
|
...
|
...
|
@@ -134,8 +129,8 @@ public class ProductController { |
|
|
@RequestMapping(params = "method=ufo.product.cancelSaleSkup")
|
|
|
public ApiResponse cancelSaleSkup(
|
|
|
@RequestParam(value = "skup", required = false) Integer skup) {
|
|
|
serviceCaller.call("ufo.product.data", 99);
|
|
|
return new ApiResponse(200, "取消卖出成功!", Boolean.TRUE);
|
|
|
ApiResponse resp = serviceCaller.call("ufo.product.data", ApiResponse.class ,99);
|
|
|
return new ApiResponse(200, "取消卖出成功!", resp);
|
|
|
}
|
|
|
|
|
|
} |
|
|
\ No newline at end of file |
...
|
...
|
|