コード例 #1
0
        public ServerResponse <NewsModel> GetModel(NewsGetModelRequest request)
        {
            ServerResponse <NewsModel> response = new ServerResponse <NewsModel>();

            try
            {
                var model = dal.GetModel(request);
                response.Data = model;
                if (model != null)
                {
                    response.Code = ServerResponseType.成功;
                }
                else
                {
                    response.Code = ServerResponseType.空数据;
                }
            }
            catch (Exception ex)
            {
                response.Code     = ServerResponseType.调用异常;
                response.ErrorMsg = ex.ToString();
                Log.LogHelper.WriteErrorLog(GetType(), ex);
            }
            return(response);
        }