refactor: migrate legacy API routes to /legacy prefix for backward compatibility
This commit is contained in:
@@ -1,17 +1,18 @@
|
||||
package comm
|
||||
|
||||
import (
|
||||
"html/template"
|
||||
"net/http"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/assimon/luuu/config"
|
||||
"github.com/assimon/luuu/model/response"
|
||||
"github.com/assimon/luuu/model/service"
|
||||
"github.com/labstack/echo/v4"
|
||||
"html/template"
|
||||
"net/http"
|
||||
"path/filepath"
|
||||
)
|
||||
|
||||
// CheckoutCounter 收银台
|
||||
func (c *BaseCommController) CheckoutCounter(ctx echo.Context) (err error) {
|
||||
// LegecyCheckoutCounter 收银台
|
||||
func (c *BaseCommController) LegecyCheckoutCounter(ctx echo.Context) (err error) {
|
||||
tradeId := ctx.Param("trade_id")
|
||||
resp, err := service.GetCheckoutCounterByTradeId(tradeId)
|
||||
if err != nil {
|
||||
@@ -21,11 +22,12 @@ func (c *BaseCommController) CheckoutCounter(ctx echo.Context) (err error) {
|
||||
if err != nil {
|
||||
return ctx.String(http.StatusOK, err.Error())
|
||||
}
|
||||
resp.Token = resp.ReceiveAddress // only for legacy checkout counter, token is the receive address
|
||||
return tmpl.Execute(ctx.Response(), resp)
|
||||
}
|
||||
|
||||
// CheckStatus 支付状态检测
|
||||
func (c *BaseCommController) CheckStatus(ctx echo.Context) (err error) {
|
||||
// LegecyCheckStatus 支付状态检测
|
||||
func (c *BaseCommController) LegecyCheckStatus(ctx echo.Context) (err error) {
|
||||
tradeId := ctx.Param("trade_id")
|
||||
order, err := service.GetOrderInfoByTradeId(tradeId)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user