public async Task <OldResponseMessage <string> > OldGetUserHighOrStandardParam([FromQuery] string szUserToken, [FromQuery] int nFlag)//nFlag:0为标清,1为高清 { OldResponseMessage <string> Res = new OldResponseMessage <string>(); try { int nCaptureParamID = -1; ResponseMessage <etparam> res = await _GlobalManager.GetHighOrStandardParamAsync <etparam>(szUserToken); if (res.Code == ResponseCodeDefines.SuccessCode) { nCaptureParamID = Convert.ToInt32(res.Ext.paramvalue); GetParamTemplateByID_out ret = await OldGetParamTemplateByID(nCaptureParamID, nFlag); Res.extention = ret.strCaptureParam; Res.message = "OK"; Res.nCode = 1; } else { Res.extention = null; Res.message = res.Msg; Res.nCode = 0; } } catch (System.Exception ex) { Res.nCode = 0; Res.message = ex.Message; Logger.Error("OldGetUserHighOrStandardParam : " + ex.ToString()); } return(Res); }
public async Task <GetParamTemplateByID_out> OldGetParamTemplateByID(int nCaptureParamID, int nFlag) { GetParamTemplateByID_out p = new GetParamTemplateByID_out(); p.errStr = no_err; p.strCaptureParam = string.Empty; try { //读取采集参数模板 string temp = await _GlobalManager.GetParamTemplateByIDAsync(nCaptureParamID, nFlag); if (string.IsNullOrEmpty(temp)) { p.errStr = "There's no CaptureParam!"; p.bRet = false; return(p); } p.strCaptureParam = temp; p.bRet = true; } catch (Exception ex)//其他未知的异常,写异常日志 { Logger.Error("OldGetParamTemplateByID : " + ex.ToString()); p.errStr = ex.Message; p.bRet = false; } return(p); }