Initial commit: Эфир мессенджер
This commit is contained in:
41
internal/api/handlers/admin.go
Normal file
41
internal/api/handlers/admin.go
Normal file
@@ -0,0 +1,41 @@
|
||||
package handlers
|
||||
|
||||
import (
|
||||
"messenger/internal/api/responses"
|
||||
"messenger/internal/service"
|
||||
"net/http"
|
||||
|
||||
//"github.com/go-chi/chi/v5"
|
||||
)
|
||||
|
||||
type AdminHandler struct {
|
||||
adminService *service.AdminService
|
||||
}
|
||||
|
||||
func NewAdminHandler(adminService *service.AdminService) *AdminHandler {
|
||||
return &AdminHandler{
|
||||
adminService: adminService,
|
||||
}
|
||||
}
|
||||
|
||||
func (h *AdminHandler) DeleteUser(w http.ResponseWriter, r *http.Request) {
|
||||
// userID, err := strconv.ParseInt(chi.URLParam(r, "id"), 10, 64)
|
||||
// if err != nil {
|
||||
// responses.BadRequest(w, "invalid user id")
|
||||
// return
|
||||
// }
|
||||
|
||||
// TODO: Реализовать удаление пользователя
|
||||
responses.Success(w, http.StatusOK, map[string]string{"message": "user deleted"})
|
||||
}
|
||||
|
||||
func (h *AdminHandler) DeleteMessage(w http.ResponseWriter, r *http.Request) {
|
||||
// messageID, err := strconv.ParseInt(chi.URLParam(r, "id"), 10, 64)
|
||||
// if err != nil {
|
||||
// responses.BadRequest(w, "invalid message id")
|
||||
// return
|
||||
// }
|
||||
|
||||
// TODO: Реализовать удаление сообщения
|
||||
responses.Success(w, http.StatusOK, map[string]string{"message": "message deleted"})
|
||||
}
|
||||
Reference in New Issue
Block a user