Pull latest changes from upstream/main (GitHub) including: - Purchase RPC service (proto, server, logic, models) - Gateway route updates for purchase endpoints - SQL migration and config updates Excludes deploy/bin/ pre-compiled arm64 binaries (builds use multi-stage Dockerfiles targeting amd64).
22 lines
534 B
Go
22 lines
534 B
Go
package receipt
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"github.com/zeromicro/go-zero/rest/httpx"
|
|
"muyu-apiserver/gateway/internal/logic/purchase/receipt"
|
|
"muyu-apiserver/gateway/internal/svc"
|
|
)
|
|
|
|
func GetPurchaseReceiptHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
|
return func(w http.ResponseWriter, r *http.Request) {
|
|
l := receipt.NewGetPurchaseReceiptLogic(r.Context(), svcCtx)
|
|
resp, err := l.GetPurchaseReceipt()
|
|
if err != nil {
|
|
httpx.ErrorCtx(r.Context(), w, err)
|
|
} else {
|
|
httpx.OkJsonCtx(r.Context(), w, resp)
|
|
}
|
|
}
|
|
}
|