fsharp-giraffe-server.ServiceImpl.mustache Maven / Gradle / Ivy
namespace {{packageName}}
{{#imports}}
{{#import}}
open {{.}}
{{/import}}
{{/imports}}
open {{classname}}HandlerParams
open {{classname}}ServiceInterface
open System.Collections.Generic
open System
open Giraffe
module {{classname}}ServiceImplementation =
//#region Service implementation
type {{classname}}ServiceImpl() =
interface I{{classname}}Service with
{{#operations}}
{{#operation}}
member this.{{operationId}} ctx {{#allParams}}{{#-first}}args{{/-first}}{{/allParams}} =
{{#responses}}
{{#-first}}
{{^-last}}
if true then
{{/-last}}
{{/-first}}
{{^-first}}
{{^-last}}
else if true then
{{/-last}}
{{#-last}}
else
{{/-last}}
{{/-first}}
let content = "{{message}}" {{#dataType}}:> obj :?> {{{.}}} // this cast is obviously wrong, and is only intended to allow generated project to compile {{/dataType}}
{{operationId}}{{#isDefault}}Default{{/isDefault}}StatusCode{{^isDefault}}{{code}}{{/isDefault}} { content = content }
{{/responses}}
{{/operation}}
{{/operations}}
//#endregion
let {{classname}}Service = {{classname}}ServiceImpl() :> I{{classname}}Service
© 2015 - 2024 Weber Informatics LLC | Privacy Policy