package handler

import (
	"net/http"

	"petclub/server/internal/ws"
	"petclub/server/pkg/response"

	"github.com/gin-gonic/gin"
	"gorm.io/gorm"
)

type Handler struct {
	DB  *gorm.DB
	Hub *ws.Hub
}

func New(db *gorm.DB, hub *ws.Hub) *Handler {
	return &Handler{DB: db, Hub: hub}
}

// ==================== 小程序 - 认证 ====================
func (h *Handler) Login(c *gin.Context)          { response.Error(c, "not implemented") }

// ==================== 小程序 - 公开接口 ====================
func (h *Handler) GetSeats(c *gin.Context)       { response.Error(c, "not implemented") }
func (h *Handler) GetSeat(c *gin.Context)        { response.Error(c, "not implemented") }
func (h *Handler) Categories(c *gin.Context)      { response.Error(c, "not implemented") }
func (h *Handler) Dishes(c *gin.Context)          { response.Error(c, "not implemented") }
func (h *Handler) DishDetail(c *gin.Context)      { response.Error(c, "not implemented") }
func (h *Handler) RechargePlans(c *gin.Context)   { response.Error(c, "not implemented") }

// ==================== 小程序 - 订单 ====================
func (h *Handler) CreateOrder(c *gin.Context)    { response.Error(c, "not implemented") }
func (h *Handler) MyOrders(c *gin.Context)       { response.Error(c, "not implemented") }
func (h *Handler) OrderDetail(c *gin.Context)    { response.Error(c, "not implemented") }
func (h *Handler) CallWaiter(c *gin.Context)     { response.Error(c, "not implemented") }
func (h *Handler) PayOrder(c *gin.Context)       { response.Error(c, "not implemented") }

// ==================== 小程序 - 会员 ====================
func (h *Handler) Recharge(c *gin.Context)        { response.Error(c, "not implemented") }
func (h *Handler) RechargeRecords(c *gin.Context)  { response.Error(c, "not implemented") }
func (h *Handler) MyCoupons(c *gin.Context)        { response.Error(c, "not implemented") }
func (h *Handler) Profile(c *gin.Context)          { response.Error(c, "not implemented") }
func (h *Handler) UpdateProfile(c *gin.Context)    { response.Error(c, "not implemented") }

// ==================== 小程序 - 宠物 ====================
func (h *Handler) MyPets(c *gin.Context)         { response.Error(c, "not implemented") }
func (h *Handler) CreatePet(c *gin.Context)      { response.Error(c, "not implemented") }
func (h *Handler) UpdatePet(c *gin.Context)      { response.Error(c, "not implemented") }
func (h *Handler) DeletePet(c *gin.Context)      { response.Error(c, "not implemented") }

// ==================== 后台 - 区域管理 ====================
func (h *Handler) AdminAreas(c *gin.Context)      { response.Error(c, "not implemented") }
func (h *Handler) CreateArea(c *gin.Context)      { response.Error(c, "not implemented") }
func (h *Handler) UpdateArea(c *gin.Context)      { response.Error(c, "not implemented") }
func (h *Handler) DeleteArea(c *gin.Context)      { response.Error(c, "not implemented") }

// ==================== 后台 - 座位管理 ====================
func (h *Handler) AdminSeats(c *gin.Context)      { response.Error(c, "not implemented") }
func (h *Handler) CreateSeat(c *gin.Context)      { response.Error(c, "not implemented") }
func (h *Handler) UpdateSeat(c *gin.Context)      { response.Error(c, "not implemented") }
func (h *Handler) DeleteSeat(c *gin.Context)      { response.Error(c, "not implemented") }
func (h *Handler) GenQRCode(c *gin.Context)       { response.Error(c, "not implemented") }

// ==================== 后台 - 分类管理 ====================
func (h *Handler) AdminCategories(c *gin.Context)  { response.Error(c, "not implemented") }
func (h *Handler) CreateCategory(c *gin.Context)   { response.Error(c, "not implemented") }
func (h *Handler) UpdateCategory(c *gin.Context)   { response.Error(c, "not implemented") }
func (h *Handler) DeleteCategory(c *gin.Context)   { response.Error(c, "not implemented") }

// ==================== 后台 - 菜品管理 ====================
func (h *Handler) AdminDishes(c *gin.Context)      { response.Error(c, "not implemented") }
func (h *Handler) CreateDish(c *gin.Context)       { response.Error(c, "not implemented") }
func (h *Handler) UpdateDish(c *gin.Context)       { response.Error(c, "not implemented") }
func (h *Handler) DeleteDish(c *gin.Context)       { response.Error(c, "not implemented") }

// ==================== 后台 - 订单管理 ====================
func (h *Handler) AdminOrders(c *gin.Context)       { response.Error(c, "not implemented") }
func (h *Handler) AdminOrderDetail(c *gin.Context)   { response.Error(c, "not implemented") }
func (h *Handler) UpdateOrderStatus(c *gin.Context)   { response.Error(c, "not implemented") }
func (h *Handler) RefundOrder(c *gin.Context)         { response.Error(c, "not implemented") }
func (h *Handler) AddDish(c *gin.Context)             { response.Error(c, "not implemented") }

// ==================== 后台 - 会员管理 ====================
func (h *Handler) AdminMembers(c *gin.Context)       { response.Error(c, "not implemented") }
func (h *Handler) MemberDetail(c *gin.Context)        { response.Error(c, "not implemented") }
func (h *Handler) AdminRecharge(c *gin.Context)       { response.Error(c, "not implemented") }
func (h *Handler) GrantCoupon(c *gin.Context)         { response.Error(c, "not implemented") }
func (h *Handler) UpdateMemberStatus(c *gin.Context)   { response.Error(c, "not implemented") }

// ==================== 后台 - 充值档位 ====================
func (h *Handler) AdminRechargePlans(c *gin.Context)  { response.Error(c, "not implemented") }
func (h *Handler) CreateRechargePlan(c *gin.Context)  { response.Error(c, "not implemented") }
func (h *Handler) UpdateRechargePlan(c *gin.Context)  { response.Error(c, "not implemented") }

// ==================== 后台 - 优惠券 ====================
func (h *Handler) AdminCoupons(c *gin.Context)   { response.Error(c, "not implemented") }
func (h *Handler) CreateCoupon(c *gin.Context)   { response.Error(c, "not implemented") }

// ==================== 后台 - 活动管理 ====================
func (h *Handler) Activities(c *gin.Context)      { response.Error(c, "not implemented") }
func (h *Handler) CreateActivity(c *gin.Context)   { response.Error(c, "not implemented") }
func (h *Handler) UpdateActivity(c *gin.Context)   { response.Error(c, "not implemented") }

// ==================== 后台 - 数据报表 ====================
func (h *Handler) RevenueStats(c *gin.Context)   { response.Error(c, "not implemented") }
func (h *Handler) DishStats(c *gin.Context)       { response.Error(c, "not implemented") }
func (h *Handler) TrafficStats(c *gin.Context)    { response.Error(c, "not implemented") }
func (h *Handler) MemberStats(c *gin.Context)     { response.Error(c, "not implemented") }
func (h *Handler) SeatStats(c *gin.Context)       { response.Error(c, "not implemented") }

// ==================== 后台 - 文件上传 ====================
func (h *Handler) Upload(c *gin.Context)         { response.Error(c, "not implemented") }

// ==================== 后台 - 系统 ====================
func (h *Handler) AdminLogin(c *gin.Context)     { response.Error(c, "not implemented") }
func (h *Handler) AdminInfo(c *gin.Context)      { response.Error(c, "not implemented") }

// ==================== WebSocket ====================
func (h *Handler) WSOrders(c *gin.Context) {
	h.Hub.ServeWS(c.Writer, c.Request)
}
