initial commit
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
package handlers
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/gorilla/mux"
|
||||
)
|
||||
|
||||
func CreateGroupHandler(w http.ResponseWriter, r *http.Request) {
|
||||
w.WriteHeader(http.StatusCreated)
|
||||
w.Write([]byte("Group Created"))
|
||||
}
|
||||
|
||||
func RemoveGroupHandler(w http.ResponseWriter, r *http.Request) {
|
||||
vars := mux.Vars(r)
|
||||
groupID := vars["groupId"]
|
||||
w.WriteHeader(http.StatusOK)
|
||||
w.Write([]byte("Group ID " + groupID + " Removed"))
|
||||
}
|
||||
|
||||
func GetGroupHandler(w http.ResponseWriter, r *http.Request) {
|
||||
vars := mux.Vars(r)
|
||||
groupID := vars["groupId"]
|
||||
w.WriteHeader(http.StatusOK)
|
||||
w.Write([]byte("Displaying Group ID: " + groupID))
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package handlers
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/gorilla/mux"
|
||||
)
|
||||
|
||||
func CreateTaskHandler(w http.ResponseWriter, r *http.Request) {
|
||||
w.WriteHeader(http.StatusCreated)
|
||||
w.Write([]byte("Task Created"))
|
||||
}
|
||||
|
||||
func DisplayTasksHandler(w http.ResponseWriter, r *http.Request) {
|
||||
w.WriteHeader(http.StatusOK)
|
||||
w.Write([]byte("Displaying All Tasks"))
|
||||
}
|
||||
|
||||
func DisplayTasksByGroupHandler(w http.ResponseWriter, r *http.Request) {
|
||||
vars := mux.Vars(r)
|
||||
groupID := vars["groupId"]
|
||||
|
||||
w.WriteHeader(http.StatusOK)
|
||||
w.Write([]byte("Displaying Tasks for Group ID: " + groupID))
|
||||
}
|
||||
|
||||
func GetTaskHandler(w http.ResponseWriter, r *http.Request) {
|
||||
vars := mux.Vars(r)
|
||||
taskID := vars["taskId"]
|
||||
|
||||
w.WriteHeader(http.StatusOK)
|
||||
w.Write([]byte("Displaying Task ID: " + taskID))
|
||||
}
|
||||
|
||||
func MarkTaskDoneHandler(w http.ResponseWriter, r *http.Request) {
|
||||
vars := mux.Vars(r)
|
||||
taskID := vars["taskId"]
|
||||
|
||||
w.WriteHeader(http.StatusOK)
|
||||
w.Write([]byte("Task ID " + taskID + " Marked as Done"))
|
||||
}
|
||||
|
||||
func RemoveTaskHandler(w http.ResponseWriter, r *http.Request) {
|
||||
vars := mux.Vars(r)
|
||||
taskID := vars["taskId"]
|
||||
|
||||
w.WriteHeader(http.StatusOK)
|
||||
w.Write([]byte("Task ID " + taskID + " Removed"))
|
||||
}
|
||||
|
||||
func UpdateTaskHandler(w http.ResponseWriter, r *http.Request) {
|
||||
vars := mux.Vars(r)
|
||||
taskID := vars["taskId"]
|
||||
|
||||
w.WriteHeader(http.StatusOK)
|
||||
w.Write([]byte("Task ID " + taskID + " Updated"))
|
||||
}
|
||||
Reference in New Issue
Block a user