Authored by Lixiaodi

修改内部服务调用代理类

... ... @@ -40,6 +40,13 @@ public class UfoServiceCaller implements ApplicationListener<ContextRefreshedEve
private Map<String, ServiceMethod> serviceMap = new HashMap<>();
/**
* 内部服务调用代理
*
* @param serviceMethod 传mapping里面method=后面的部分
* @param param 方法参数
* @return 返回值
*/
public Object call(String serviceMethod, Object[] param) {
logger.info("call ufo service : {}", serviceMethod);
ServiceMethod sm = serviceMap.get(serviceMethod);
... ...
... ... @@ -70,10 +70,10 @@ public class ProductController {
@IgnoreSession
@RequestMapping(params = "method=ufo.product.storage.leastprice")
//@Cachable(expire=600)
public ApiResponse queryStorageLeastprice(
@RequestParam(value = "storage_id", required = false) String storageId) {
public StorageLeastPriceResp queryStorageLeastprice(
@RequestParam(value = "storage_id", required = true) Integer storageId) {
return new ApiResponse.ApiResponseBuilder().data(queryStorageLeastprice()).code(200).message("storage data").build();
return queryStorageLeastprice();
}
... ... @@ -88,10 +88,10 @@ public class ProductController {
@IgnoreSession
@RequestMapping(params = "method=ufo.product.storage.data")
//@Cachable(expire=600)
public ApiResponse queryStorageInfo(
@RequestParam(value = "storage_id", required = false) String storageId) {
public StorageDataResp queryStorageInfo(
@RequestParam(value = "storage_id", required = true) Integer storageId) {
return new ApiResponse.ApiResponseBuilder().data(queryStorageData()).code(200).message("product data").build();
return queryStorageData();
}
... ... @@ -101,5 +101,31 @@ public class ProductController {
return resp;
}
@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) {
return new ApiResponse(200, "创建成功!", Boolean.TRUE);
}
@IgnoreSignature
@IgnoreSession
@RequestMapping(params = "method=ufo.product.saleSkup")
public ApiResponse saleSkup(
@RequestParam(value = "skup", required = false) Integer skup) {
return new ApiResponse(200, "卖出成功!", Boolean.TRUE);
}
@IgnoreSignature
@IgnoreSession
@RequestMapping(params = "method=ufo.product.cancelSaleSkup")
public ApiResponse cancelSaleSkup(
@RequestParam(value = "skup", required = false) Integer skup) {
return new ApiResponse(200, "取消卖出成功!", Boolean.TRUE);
}
}
\ No newline at end of file
... ...