package camel_oil

import (
	"context"

	"github.com/gogf/gf/v2/errors/gcode"
	v1 "kami/api/camel_oil/v1"
	"kami/internal/errHandler"
	"kami/internal/service"
)

func (c *ControllerV1) OrderHistory(ctx context.Context, req *v1.OrderHistoryReq) (res *v1.OrderHistoryRes, err error) {
	_, err = service.SysAuth().LoginOnlyIFrame(ctx)
	if err != nil {
		err = errHandler.WrapError(ctx, gcode.CodeNotAuthorized, err, "权限不足")
		return
	}
	return service.CamelOil().GetOrderHistory(ctx, req)
}
