package PgTest import ( "net/http" "demo/internal/logic/PgTest" "demo/internal/svc" "github.com/zeromicro/go-zero/rest/httpx" ) func PgInsertTestHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { l := PgTest.NewPgInsertTestLogic(r.Context(), svcCtx) resp, err := l.PgInsertTest() if err != nil { httpx.ErrorCtx(r.Context(), w, err) } else { httpx.OkJsonCtx(r.Context(), w, resp) } } }