get_table_detail_handler.go 839 字节
package table

import (
	"gitlab.fjmaimaimai.com/allied-creation/sumifcc-bchart/pkg/result"
	"net/http"

	"github.com/zeromicro/go-zero/rest/httpx"
	"gitlab.fjmaimaimai.com/allied-creation/sumifcc-bchart/cmd/chart-server/api/internal/logic/table"
	"gitlab.fjmaimaimai.com/allied-creation/sumifcc-bchart/cmd/chart-server/api/internal/svc"
	"gitlab.fjmaimaimai.com/allied-creation/sumifcc-bchart/cmd/chart-server/api/internal/types"
)

func GetTableDetailHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
	return func(w http.ResponseWriter, r *http.Request) {
		var req types.GetTableDetailRequest
		if err := httpx.Parse(r, &req); err != nil {
			httpx.ErrorCtx(r.Context(), w, err)
			return
		}

		l := table.NewGetTableDetailLogic(r.Context(), svcCtx)
		resp, err := l.GetTableDetail(&req)
		result.HttpResult(r, w, resp, err)
	}
}