package admin import ( "github.com/gofiber/fiber/v2" "github.com/break/junhong_cmp_fiber/internal/model/dto" iotCardService "github.com/break/junhong_cmp_fiber/internal/service/iot_card" "github.com/break/junhong_cmp_fiber/pkg/errors" "github.com/break/junhong_cmp_fiber/pkg/response" ) type IotCardHandler struct { service *iotCardService.Service } func NewIotCardHandler(service *iotCardService.Service) *IotCardHandler { return &IotCardHandler{service: service} } func (h *IotCardHandler) ListStandalone(c *fiber.Ctx) error { var req dto.ListStandaloneIotCardRequest if err := c.QueryParser(&req); err != nil { return errors.New(errors.CodeInvalidParam, "请求参数解析失败") } result, err := h.service.ListStandalone(c.UserContext(), &req) if err != nil { return err } return response.SuccessWithPagination(c, result.List, result.Total, result.Page, result.PageSize) }