Beispiel #1
0
        public async Task <IActionResult> CreateSeminarByCourseId([FromRoute] long courseId, [FromBody] Seminar newSeminar)
        {
            var userlogin = await _userService.GetUserByUserIdAsync(User.Id());

            if (userlogin.Type == Type.Teacher)
            {
                var seminarId = await _seminarService.InsertSeminarByCourseIdAsync(courseId, newSeminar);

                return(Created($"/seminar/{seminarId}", new { id = seminarId }));
            }

            return(StatusCode(403, new { msg = "权限不足" }));
        }