57 lines
1.3 KiB
Go
57 lines
1.3 KiB
Go
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"))
|
|
} |