Skip to content

Instantly share code, notes, and snippets.

@calippo
Last active January 14, 2020 09:12
Show Gist options
  • Save calippo/958889a4f302f6ae0c1288ffb4a74c04 to your computer and use it in GitHub Desktop.
Save calippo/958889a4f302f6ae0c1288ffb4a74c04 to your computer and use it in GitHub Desktop.
tapiro models
import scala.annotation.StaticAnnotation
class query extends StaticAnnotation
class command extends StaticAnnotation
import io.circe.generic.JsonCodec
@JsonCodec case class GenericError(
message: String = "",
code: Int = 500
)
trait Controller[F[_]] {
@query
def getSomething(arg: String): F[Either[GenericError, Result]]
@command
def doSomething(arg: Content): F[Either[GenericError, Result]]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment