コード例 #1
0
  /**
   * 将包含授权信息的Shop转换为ShopVo
   *
   * @param shop
   * @return
   */
  private ShopVo convertShopAndAuth2ShopVo(Shop shop) {
    ShopVo shopVo = null;
    if (shop == null) {
      return shopVo;
    }

    shopVo = new ShopVo();
    shopVo.setId(shop.getId());
    shopVo.setShopId(shop.getOutShopId());
    shopVo.setCatId(shop.getCatId());
    shopVo.setNick(shop.getNick());
    shopVo.setTitle(shop.getTitle());
    shopVo.setDescription(shop.getDescription());
    shopVo.setBulletin(shop.getBulletin());
    shopVo.setPicPath(shop.getPicPath());
    shopVo.setItemScore(shop.getItemScore());
    shopVo.setServiceScore(shop.getServiceScore());
    shopVo.setDeliveryScore(shop.getDeliveryScore());
    shopVo.setDeExpress(shop.getDeExpress());
    shopVo.setEnableMsg(shop.getEnableMsg());
    shopVo.setMsgTemp(shop.getMsgTemp());
    shopVo.setMsgSign(shop.getMsgSign());
    shopVo.setOutPlatformType(shop.getPlatformType().getName());
    shopVo.setOutPlatformTypeValue(
        PlatformType.valueOf(shop.getPlatformType().getName()).getValue());
    shopVo.setCreateTime(shop.getCreateTime());
    shopVo.setUpdateTime(shop.getUpdateTime());
    if (shop.getShopAuth() != null) {
      shopVo.setSessionKey(shop.getShopAuth().getSessionKey());
      shopVo.setRefreshToken(shop.getShopAuth().getRefreshToken());
    }

    return shopVo;
  }
コード例 #2
0
 /**
  * 将店铺及授权信息转换为shopBean
  *
  * @param shop
  * @return
  */
 private ShopBean convertShop2ShopBean(Shop shop) {
   ShopBean shopBean = null;
   if (shop == null) {
     return shopBean;
   }
   shopBean = new ShopBean();
   shopBean.setShopId(shop.getId());
   shopBean.setOutShopId(shop.getOutShopId());
   shopBean.setTitle(shop.getTitle());
   shopBean.setSellerNick(shop.getNick());
   if (shop.getShopAuth() != null) {
     shopBean.setUserId(shop.getShopAuth().getUserId());
     shopBean.setSessionKey(shop.getShopAuth().getSessionKey());
     shopBean.setRefreshToken(shop.getShopAuth().getRefreshToken());
   }
   shopBean.setPlatformType(shop.getPlatformType());
   shopBean.setShopType(shop.getShopType());
   return shopBean;
 }