示例#1
0
        /// <inheritdoc />
        public async Task <ApiResponse <string> > CreatePageAsync(Guid userId, Guid groupId, GeneralWebPageCreateRequest createRequest, CancellationToken cancellationToken)
        {
            if (Guid.Empty == userId)
            {
                throw new ArgumentOutOfRangeException(nameof(userId));
            }
            if (Guid.Empty == groupId)
            {
                throw new ArgumentOutOfRangeException(nameof(groupId));
            }

            PageDto page = new()
            {
                PageName     = $"group:{groupId}",
                PageParentId = createRequest?.PageParentId
            };

            return(await _contentCommand.CreatePageAsync(page, cancellationToken));
        }
示例#2
0
        public async Task <IActionResult> CreatePageAsync(Guid userId, Guid groupId, [FromBody] GeneralWebPageCreateRequest createRequest, CancellationToken cancellationToken)
        {
            var pageGuid = await _contentService.CreatePageAsync(userId, groupId, createRequest, cancellationToken);

            return(new JsonResult(pageGuid));
        }