示例#1
0
        public async Task <ResponseMessage <string> > GetUserHighOrStandardParam([FromQuery] string szUserToken, [FromQuery] int nFlag)//nFlag:0为标清,1为高清
        {
            ResponseMessage <string> Response = new ResponseMessage <string>();

            try
            {
                int nCaptureParamID = -1;

                ResponseMessage <etparam> res = await _GlobalManager.GetHighOrStandardParamAsync <etparam>(szUserToken);

                if (res.Code == ResponseCodeDefines.SuccessCode)
                {
                    nCaptureParamID = Convert.ToInt32(res.Ext.paramvalue);
                    Response        = await GetParamTemplateByID(nCaptureParamID, nFlag);
                }
                else
                {
                    Response.Ext  = null;
                    Response.Code = ResponseCodeDefines.ServiceError;
                }
            }
            catch (System.Exception e)
            {
                if (e.GetType() == typeof(SobeyRecException))//sobeyexcep会自动打印错误
                {
                    SobeyRecException se = e as SobeyRecException;
                    Response.Code = se.ErrorCode.ToString();
                    Response.Msg  = se.Message;
                }
                else
                {
                    Response.Code = ResponseCodeDefines.ServiceError;
                    Response.Msg  = "error info:" + e.ToString();
                    Logger.Error(Response.Msg);
                }
            }
            return(Response);
        }