diff --git a/controllers/threads_controller.go b/controllers/threads_controller.go new file mode 100644 index 0000000..3c180b9 --- /dev/null +++ b/controllers/threads_controller.go @@ -0,0 +1,23 @@ +package controlers + +import ( + "net/http" + + "github.com/gin-gonic/gin" +) + +func GetThreads(c *gin.Context) { + c.JSON(http.StatusOK, gin.H{"route": "get threads"}) +} + +func GetThread(c *gin.Context) { + c.JSON(http.StatusOK, gin.H{"route": "get thread"}) +} + +func CreateThread(c *gin.Context) { + c.JSON(http.StatusOK, gin.H{"route": "create thread"}) +} + +func UpdateThread(c *gin.Context) { + c.JSON(http.StatusOK, gin.H{"route": "update thread"}) +} diff --git a/main.go b/main.go index fc5d641..5125422 100644 --- a/main.go +++ b/main.go @@ -8,7 +8,7 @@ import ( _ "github.com/joho/godotenv/autoload" Config "micrach/config" - // Controllers "micrach/controllers" + Controllers "micrach/controllers" Db "micrach/db" // Utils "micrach/utils" ) @@ -20,10 +20,10 @@ func main() { gin.SetMode(Config.App.Env) router := gin.Default() - // router.GET("/boards", Controllers.GetAllBoards) - // router.GET("/threads/:boardId", Controllers.GetThreads) - // router.POST("/threads/:boardId", Controllers.CreateThread) - // router.POST("/posts/:boardId/:threadId", Controllers.CreatePost) + router.GET("/", Controllers.GetThreads) + router.POST("/", Controllers.CreateThread) + router.GET("/:threadId", Controllers.GetThread) + router.POST("/:threadId", Controllers.UpdateThread) log.Println("all systems nominal")