|
|
package com.yohoufo.product.controller;
|
|
|
|
|
|
import com.yoho.error.exception.ServiceException;
|
|
|
import com.yohobuy.ufo.model.BidStoragePriceVo;
|
|
|
import com.yohoufo.common.ApiResponse;
|
|
|
import com.yohoufo.product.service.impl.BidProductService;
|
...
|
...
|
@@ -21,10 +22,9 @@ public class BidProductController { |
|
|
|
|
|
// 创建skup
|
|
|
@RequestMapping(params = "method=ufo.product.bid.createSkup")
|
|
|
public boolean createSkup(@RequestBody BidStoragePriceVo skupVo) {
|
|
|
public void createSkup(@RequestBody BidStoragePriceVo skupVo) {
|
|
|
logger.info("in method=ufo.product.bid.createSkup, skupVo = {}", skupVo);
|
|
|
bidProductService.createSkup(skupVo);
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
|
...
|
...
|
@@ -35,9 +35,16 @@ public class BidProductController { |
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(params = "method=ufo.product.bid.isCanceled")
|
|
|
public boolean isCanceled(@RequestParam(value = "skup") int skup) {
|
|
|
public ApiResponse isCanceled(@RequestParam(value = "skup") int skup) {
|
|
|
logger.info("in method=ufo.product.bid.isCanceled, skup = {}", skup);
|
|
|
return bidProductService.isCanceled(skup);
|
|
|
try {
|
|
|
boolean result = bidProductService.isCanceled(skup);
|
|
|
return new ApiResponse(200, "ok", result);
|
|
|
} catch (ServiceException sex) {
|
|
|
return new ApiResponse(sex.getCode(), sex.getErrorMessage(), false);
|
|
|
} catch (Exception ex) {
|
|
|
return new ApiResponse(500, "操作失败", false);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -47,9 +54,15 @@ public class BidProductController { |
|
|
@RequestMapping(params = "method=ufo.product.bid.cancelSaleByUser")
|
|
|
public ApiResponse cancelSaleByUser(@RequestParam(value = "skup") int skup) {
|
|
|
logger.info("in method=ufo.product.bid.cancelSaleByUser, skup = {}", skup);
|
|
|
bidProductService.cancelSaleByUser(skup);
|
|
|
logger.info("cancelSaleByUser success, skup = {}", skup);
|
|
|
return new ApiResponse(200, "ok", Boolean.TRUE);
|
|
|
try {
|
|
|
bidProductService.cancelSaleByUser(skup);
|
|
|
logger.info("cancelSaleByUser success, skup = {}", skup);
|
|
|
return new ApiResponse(200, "ok", true);
|
|
|
} catch (ServiceException sex) {
|
|
|
return new ApiResponse(sex.getCode(), sex.getErrorMessage(), false);
|
|
|
} catch (Exception ex) {
|
|
|
return new ApiResponse(500, "操作失败", false);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -59,9 +72,15 @@ public class BidProductController { |
|
|
@RequestMapping(params = "method=ufo.product.bid.cancelSaleBySystem")
|
|
|
public ApiResponse cancelSaleBySystem(@RequestParam(value = "skup") int skup) {
|
|
|
logger.info("in method=ufo.product.bid.cancelSaleBySystem, skup = {}", skup);
|
|
|
bidProductService.cancelSaleBySystem(skup);
|
|
|
logger.info("cancelSaleBySystem success, skup = {}", skup);
|
|
|
return new ApiResponse(200, "ok", Boolean.TRUE);
|
|
|
try {
|
|
|
bidProductService.cancelSaleBySystem(skup);
|
|
|
logger.info("cancelSaleBySystem success, skup = {}", skup);
|
|
|
return new ApiResponse(200, "ok", true);
|
|
|
} catch (ServiceException sex) {
|
|
|
return new ApiResponse(sex.getCode(), sex.getErrorMessage(), false);
|
|
|
} catch (Exception ex) {
|
|
|
return new ApiResponse(500, "操作失败", false);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -71,9 +90,15 @@ public class BidProductController { |
|
|
@RequestMapping(params = "method=ufo.product.bid.cancelSaleByCS")
|
|
|
public ApiResponse cancelSaleByCS(@RequestParam(value = "skup") int skup) {
|
|
|
logger.info("in method=ufo.product.bid.cancelSaleByCS, skup = {}", skup);
|
|
|
bidProductService.cancelSaleByPlatform(skup);
|
|
|
logger.info("cancelSaleByCS success, skup = {}", skup);
|
|
|
return new ApiResponse(200, "ok", Boolean.TRUE);
|
|
|
try {
|
|
|
bidProductService.cancelSaleByPlatform(skup);
|
|
|
logger.info("cancelSaleByCS success, skup = {}", skup);
|
|
|
return new ApiResponse(200, "ok", true);
|
|
|
} catch (ServiceException sex) {
|
|
|
return new ApiResponse(sex.getCode(), sex.getErrorMessage(), false);
|
|
|
} catch (Exception ex) {
|
|
|
return new ApiResponse(500, "操作失败", false);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -83,9 +108,15 @@ public class BidProductController { |
|
|
@RequestMapping(params = "method=ufo.product.bid.resetSaleableFromUserCancel")
|
|
|
public ApiResponse resetSaleableFromUserCancel(@RequestParam(value = "skup") int skup) {
|
|
|
logger.info("in method=ufo.product.bid.resetSaleableFromUserCancel, skup = {}", skup);
|
|
|
bidProductService.resetSaleableFromUserCancel(skup);
|
|
|
logger.info("resetSaleable success, skup = {}", skup);
|
|
|
return new ApiResponse(200, "ok", Boolean.TRUE);
|
|
|
try {
|
|
|
bidProductService.resetSaleableFromUserCancel(skup);
|
|
|
logger.info("resetSaleable success, skup = {}", skup);
|
|
|
return new ApiResponse(200, "ok", true);
|
|
|
} catch (ServiceException sex) {
|
|
|
return new ApiResponse(sex.getCode(), sex.getErrorMessage(), false);
|
|
|
} catch (Exception ex) {
|
|
|
return new ApiResponse(500, "操作失败", false);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -95,9 +126,15 @@ public class BidProductController { |
|
|
@RequestMapping(params = "method=ufo.product.bid.resetSaleableFromBidFinished")
|
|
|
public ApiResponse resetSaleableFromBidFinished(@RequestParam(value = "skup") int skup) {
|
|
|
logger.info("in method=ufo.product.bid.resetSaleableFromBidFinished, skup = {}", skup);
|
|
|
bidProductService.resetSaleableFromBidFinished(skup);
|
|
|
logger.info("resetSaleable success, skup = {}", skup);
|
|
|
return new ApiResponse(200, "ok", Boolean.TRUE);
|
|
|
try {
|
|
|
bidProductService.resetSaleableFromBidFinished(skup);
|
|
|
logger.info("resetSaleable success, skup = {}", skup);
|
|
|
return new ApiResponse(200, "ok", true);
|
|
|
} catch (ServiceException sex) {
|
|
|
return new ApiResponse(sex.getCode(), sex.getErrorMessage(), false);
|
|
|
} catch (Exception ex) {
|
|
|
return new ApiResponse(500, "操作失败", false);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -110,9 +147,15 @@ public class BidProductController { |
|
|
public ApiResponse sale(@RequestParam(value = "productId") int productId,
|
|
|
@RequestParam(value = "skup") int skup) {
|
|
|
logger.info("in method=ufo.product.bid.sale,productId = {}, skup = {}", productId, skup);
|
|
|
bidProductService.sale(productId, skup);
|
|
|
logger.info("sale success, skup = {}", skup);
|
|
|
return new ApiResponse(200, "ok", Boolean.TRUE);
|
|
|
try {
|
|
|
bidProductService.sale(productId, skup);
|
|
|
logger.info("sale success, skup = {}", skup);
|
|
|
return new ApiResponse(200, "ok", true);
|
|
|
} catch (ServiceException sex) {
|
|
|
return new ApiResponse(sex.getCode(), sex.getErrorMessage(), false);
|
|
|
} catch (Exception ex) {
|
|
|
return new ApiResponse(500, "操作失败", false);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -122,8 +165,15 @@ public class BidProductController { |
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(params = "method=ufo.product.bid.getSaleable")
|
|
|
public BidStoragePriceVo getSaleable(@RequestParam(value = "skup") int skup) {
|
|
|
public ApiResponse getSaleable(@RequestParam(value = "skup") int skup) {
|
|
|
logger.info("in method=ufo.product.bid.getSaleable, skup = {}", skup);
|
|
|
return bidProductService.getSaleable(skup);
|
|
|
try {
|
|
|
BidStoragePriceVo bidStoragePriceVo = bidProductService.getSaleable(skup);
|
|
|
return new ApiResponse(200, "ok", bidStoragePriceVo);
|
|
|
} catch (ServiceException sex) {
|
|
|
return new ApiResponse(sex.getCode(), sex.getErrorMessage(), null);
|
|
|
} catch (Exception ex) {
|
|
|
return new ApiResponse(500, "操作失败", null);
|
|
|
}
|
|
|
}
|
|
|
} |
...
|
...
|
|