// public HttpResponseMessage DeleteTopic(int groupId, int topicId) // { // HttpResponseMessage response = new HttpResponseMessage(HttpStatusCode.NoContent); // response.Content = new StringContent("成功", Encoding.UTF8); // return response; // } public ActionResult DeleteTopicById(long groupId, long topicId) { try { _topicService.DeleteTopicById(groupId, topicId); return(NoContent()); } catch (TopicNotFoundException) { return(StatusCode(404, new { msg = "未选择该话题" })); } catch (ArgumentException) { return(StatusCode(400, new { msg = "错误的ID格式或话题已满" })); } }