29 lines
851 B
Go
29 lines
851 B
Go
package handler
|
|||
|
|
|
||
|
|
import (
|
||
|
|
"github.com/gin-gonic/gin"
|
||
|
|
|
||
|
|
"apskel-pos-be/internal/appcontext"
|
||
|
|
"apskel-pos-be/internal/service"
|
||
|
|
"apskel-pos-be/internal/util"
|
||
|
|
)
|
||
|
|
|
||
|
|
// PointPaymentHandler serves GET /orders/:id/point-payment/preview
|
||
|
|
// (docs/prd-point-coin.md F9).
|
||
|
|
type PointPaymentHandler struct {
|
||
|
|
pointPaymentService service.PointPaymentService
|
||
|
|
}
|
||
|
|
|
||
|
|
func NewPointPaymentHandler(pointPaymentService service.PointPaymentService) *PointPaymentHandler {
|
||
|
|
return &PointPaymentHandler{pointPaymentService: pointPaymentService}
|
||
|
|
}
|
||
|
|
|
||
|
|
func (h *PointPaymentHandler) Preview(c *gin.Context) {
|
||
|
|
orderID, ok := parseUUIDParam(c, "id", "PointPaymentHandler::Preview")
|
||
|
|
if !ok {
|
||
|
|
return
|
||
|
|
}
|
||
|
|
ctx := c.Request.Context()
|
||
|
|
util.HandleResponse(c.Writer, c.Request, h.pointPaymentService.Preview(ctx, appcontext.FromGinContext(ctx), orderID), "PointPaymentHandler::Preview")
|
||
|
|
}
|