From 7a54ea796eace22f3359cbd23c7b72aa2b78ac4f Mon Sep 17 00:00:00 2001 From: qowevisa Date: Fri, 2 Aug 2024 23:36:25 +0300 Subject: [PATCH] Move types to different folder --- cmd/http-server/types.go | 7 ------- types/types.go | 17 +++++++++++++++++ 2 files changed, 17 insertions(+), 7 deletions(-) delete mode 100644 cmd/http-server/types.go create mode 100644 types/types.go diff --git a/cmd/http-server/types.go b/cmd/http-server/types.go deleted file mode 100644 index 4f8e525..0000000 --- a/cmd/http-server/types.go +++ /dev/null @@ -1,7 +0,0 @@ -package main - -type Account struct { -} - -type ErrorResponse struct { -} diff --git a/types/types.go b/types/types.go new file mode 100644 index 0000000..5f186e6 --- /dev/null +++ b/types/types.go @@ -0,0 +1,17 @@ +package types + +// User struct for requests +type User struct { + Username string `json:"username" binding:"required" example:"testUser"` + Password string `json:"password" binding:"required" example:"strongPassLol"` +} + +// User Account +type Account struct { + ID uint `json:"id" example:"1"` + Token string `json:"token" example:"Fvs-MnxiEs5dnqMp2mSDIJigPbiIUs6Snk1xxiqPmUc="` +} + +type ErrorResponse struct { + Message string `json:"message" example:"Error: you stink"` +}