Esempio n. 1
0
        public async Task <IActionResult> DeselectTopic([FromRoute] long groupId, [FromRoute] long topicId)
        {
            try
            {
                if (User.Type() != Type.Student)
                {
                    return(StatusCode(403, new { msg = "权限不足" }));
                }

                await _topicService.DeleteSeminarGroupTopicByIdAsync(groupId, topicId);

                return(NoContent());
            }
            catch (GroupNotFoundException)
            {
                return(StatusCode(404, new { msg = "没有找到该课程" }));
            }
            catch (ArgumentException)
            {
                return(StatusCode(400, new { msg = "组号格式错误" }));
            }
        }