30 lines
647 B
Go
30 lines
647 B
Go
package transfer
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"github.com/zeromicro/go-zero/rest/httpx"
|
|
"rs/cmd/api/internal/logic/transfer"
|
|
"rs/cmd/api/internal/svc"
|
|
"rs/cmd/api/internal/types"
|
|
)
|
|
|
|
// 荣数立减金发放
|
|
func MarketHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
|
return func(w http.ResponseWriter, r *http.Request) {
|
|
var req types.Req
|
|
if err := httpx.Parse(r, &req); err != nil {
|
|
httpx.ErrorCtx(r.Context(), w, err)
|
|
return
|
|
}
|
|
|
|
l := transfer.NewMarketLogic(r.Context(), svcCtx)
|
|
resp, err := l.Market(&req)
|
|
if err != nil {
|
|
httpx.ErrorCtx(r.Context(), w, err)
|
|
} else {
|
|
httpx.OkJsonCtx(r.Context(), w, resp)
|
|
}
|
|
}
|
|
}
|