/// <summary> /// 修改题目 /// </summary> /// <param name="problem">题目</param> /// <returns>是否成功</returns> public bool ReworkProblem(problem problem) { if (problem != null && problem.Id != 0) { string token = getToken(); if (token != null) { returnValue value = config.Request.RequestJson <returnValue, problemQuery>(config.Domain + "ajax?n=api.problem.Rework", new problemQuery { token = token, problem = problem }); return(value != null && value.IsValue); } } return(false); }
/// <summary> /// 添加题目 /// </summary> /// <param name="problem">题目</param> /// <returns>题目ID</returns> public int AppendProblem(problem problem) { if (problem != null) { string token = getToken(); if (token != null) { returnValue <int> value = config.Request.RequestJson <returnValue <int>, problemQuery>(config.Domain + "ajax?n=api.problem.Append", new problemQuery { token = token, problem = problem }); if (value != null) { return(value.Value); } } } return(0); }