|
|
package com.yohoufo.product.controller;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.yoho.core.config.ConfigReader;
|
|
|
import com.yoho.error.exception.ServiceException;
|
|
|
import com.yoho.tools.docs.ApiOperation;
|
|
|
import com.yohobuy.ufo.model.request.StoragePriceBo;
|
...
|
...
|
@@ -46,6 +47,11 @@ public class ProductController { |
|
|
|
|
|
@Autowired
|
|
|
private ProductBatchService productBatchService;
|
|
|
|
|
|
@Autowired
|
|
|
private ConfigReader configReader;
|
|
|
|
|
|
private static final String LIMIT_PRODUCT_TIP = "很抱歉通知您,您现在还不具备销售此商品的资质。我们需要您提供完整的商品来源凭证,诸如购买单据、发票等,确保您的货源稳定可靠,请将以上资料以及联系手机号和有货账户发送至luyan.qian@yoho.cn,我们的工作人员审核通过后会联系您并为您添加出售资质权限,谢谢";
|
|
|
|
|
|
@ApiOperation(name = "ufo.product.data", desc = "商品详情")
|
|
|
@IgnoreSignature
|
...
|
...
|
@@ -536,6 +542,32 @@ public class ProductController { |
|
|
return result;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@ApiOperation(name = "ufo.product.limitInfo", desc = "商品限制出售信息")
|
|
|
@IgnoreSignature
|
|
|
@IgnoreSession
|
|
|
@RequestMapping(params = "method=ufo.product.limitInfo")
|
|
|
@Cachable(expire = 180)
|
|
|
public ApiResponse queryProductLimitInfo(
|
|
|
@RequestParam(value = "product_id") Integer productId
|
|
|
, @RequestParam(value = "user_id") Integer userId) {
|
|
|
LOG.info("in method=ufo.product.queryProductLimitInfo product_id={}, uerId={}", productId, userId);
|
|
|
if (null == productId) {
|
|
|
LOG.info("in method=ufo.product.queryProductLimitInfo product_id Is Null");
|
|
|
return new ApiResponse(400, "product_id Is Null", null);
|
|
|
}
|
|
|
JSONObject result = new JSONObject();
|
|
|
result.put("", "");
|
|
|
String productIdInfo = configReader.getString("ufo.product.productLimitInfo", "");
|
|
|
LOG.info("in ufo.product.queryProductLimitInfo queryProductLimitInfo Is {}", productIdInfo);
|
|
|
if (StringUtils.contains(productIdInfo, Integer.toString(productId))) {
|
|
|
result.put("isLimit", "1");
|
|
|
result.put("tip", LIMIT_PRODUCT_TIP);
|
|
|
} else {
|
|
|
result.put("isLimit", "0");
|
|
|
}
|
|
|
return new ApiResponse.ApiResponseBuilder().data(result).code(200).message("productLimitInfo").build();
|
|
|
}
|
|
|
|
|
|
|
|
|
} |
|
|
\ No newline at end of file |
...
|
...
|
|