Ejemplo n.º 1
0
        private CreateCommitResponse CreateTypedCommit(CreateCommitRequest request, CommitType commitType)
        {
            var options  = request.ToCommitMessageOptions();
            var message  = this.factory.CreateCommitMessage(commitType, options);
            var response = new CreateCommitResponse
            {
                Message = message,
            };
            HttpRequest httpRequest = this.HttpContext.Request;

            response.Links = new[]
            {
                new LinkResponse(href: this.Url.ActionLink(nameof(this.Describe)), rel: "parent", method: "GET"),
                new LinkResponse(
                    href: $"{httpRequest.Scheme}://{httpRequest.Host}{httpRequest.Path}",
                    rel: "self",
                    method: "GET"),
            };
            return(response);
        }
Ejemplo n.º 2
0
        public ActionResult <CreateCommitResponse> CreateChore([FromBody] CreateCommitRequest request)
        {
            CommitType commitType = CommitType.Chore;

            return(this.CreateTypedCommit(request, commitType));
        }
Ejemplo n.º 3
0
        public ActionResult <CreateCommitResponse> CreateDocumentation([FromBody] CreateCommitRequest request)
        {
            CommitType commitType = ExtendedCommitType.Documentation;

            return(this.CreateTypedCommit(request, commitType));
        }