fsharp-functions-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
module {{classname}}ServiceImplementation =
//#region Service implementation
type {{classname}}ServiceImpl() =
interface I{{classname}}Service with
{{#operations}}
{{#operation}}
member this.{{operationId}} {{^hasBodyParam}}(){{/hasBodyParam}}{{#hasBodyParam}}(parameters:{{operationId}}BodyParams){{/hasBodyParam}} =
{{#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