Ejemplo n.º 1
0
        public object Do_GetStoreInfo(BaseApi baseApi)
        {
            GetStoreInfoParam getStoreInfoParam = JsonConvert.DeserializeObject <GetStoreInfoParam>(baseApi.param.ToString());

            if (getStoreInfoParam == null)
            {
                throw new ApiException(CodeMessage.InvalidParam, "InvalidParam");
            }

            StoreInfo storeInfo = Utils.GetCache <StoreInfo>(getStoreInfoParam);

            if (storeInfo == null)
            {
                MallDao mallDao = new MallDao();
                storeInfo = mallDao.GetStoreInfo(getStoreInfoParam.storeId);
                if (storeInfo == null)
                {
                    throw new ApiException(CodeMessage.InvalidStore, "InvalidStore");
                }
                storeInfo.Unique = getStoreInfoParam.GetUnique();
                Utils.SetCache(storeInfo);
            }
            return(storeInfo);
        }