All Downloads are FREE. Search and download functionalities are using the official Maven repository.

fsharp-giraffe-server.ServiceImpl.mustache Maven / Gradle / Ivy

There is a newer version: 7.9.0
Show newest version
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