コード例 #1
0
 @Override
 public ItemResponse execute(RequestContext context) throws ItemException {
   ItemResponse response = null;
   ItemRequest request = context.getRequest();
   // 验证DTO是否为空
   if (request.getParam("skuPropertyTmplDTO") == null) {
     return ResponseUtil.getErrorResponse(
         ResponseCode.PARAM_E_MISSING, "skuPropertyTmplDTO is null");
   }
   SkuPropertyTmplDTO skuPropertyTmplDTO =
       (SkuPropertyTmplDTO) request.getParam("skuPropertyTmplDTO");
   try {
     Boolean isSuccessfullyUpdated =
         skuPropertyTmplManager.updateSkuPropertyTmpl(skuPropertyTmplDTO);
     response = ResponseUtil.getSuccessResponse(isSuccessfullyUpdated);
     return response;
   } catch (ItemException e) {
     response = ResponseUtil.getErrorResponse(e.getCode(), e.getMessage());
     log.error("do action:" + request.getCommand() + " occur Exception:" + e.getMessage(), e);
     return response;
   }
 }
コード例 #2
0
 @Override
 public ItemResponse execute(RequestContext context) throws ItemException {
   ItemResponse response = null;
   ItemRequest request = context.getRequest();
   // 验证DTO是否为空
   if (request.getParam("itemPropertyTmplDTO") == null) {
     return ResponseUtil.getErrorResponse(
         ResponseCode.PARAM_E_MISSING, "itemPropertyTmplDTO is null");
   }
   ItemPropertyTmplDTO itemPropertyTmplDTO =
       (ItemPropertyTmplDTO) request.getParam("itemPropertyTmplDTO");
   try {
     Long itemPropertyTmplId =
         itemPropertyTmplManager.addItemPropertyTmpl(
             itemPropertyTmplDTO); // 新增加的itemPropertyTmplDO
     response = ResponseUtil.getSuccessResponse(itemPropertyTmplId);
     return response;
   } catch (ItemException e) {
     response = ResponseUtil.getErrorResponse(e.getCode(), e.getMessage());
     log.error("do action:" + request.getCommand() + " occur Exception:" + e.getMessage(), e);
     return response;
   }
 }