/// <summary> /// 添加删除是否允许保存响应的method /// </summary> public Task <CmdRS> AddDelSaveResponseEnable(AddDelSaveResponseEnableRQ rq, ServerCallContext context) { return(Task.Run(() => { if (string.IsNullOrWhiteSpace(rq.MethodName)) { return CmdRS.Fail("MethodName is null"); } if (rq.IsDel) { MonitorManager.Instance.DelSaveResponseMethod(rq.MethodName); } else { MonitorManager.Instance.AddSaveResponseMethod(rq.MethodName); } return CmdRS.Success(); })); }
/// <summary> /// 添加删除截流的method /// </summary> public Task <CmdRS> AddDelThrottle(AddDelThrottleRQ rq, ServerCallContext context) { return(Task.Run(() => { if (string.IsNullOrWhiteSpace(rq.MethodName)) { return CmdRS.Fail("MethodName is null"); } if (rq.IsDel) { ThrottleManager.Instance.Del(rq.MethodName); } else { ThrottleManager.Instance.Add(rq.MethodName); } return CmdRS.Success(); })); }