package handler import ( "net/http" "github.com/zeromicro/go-zero/rest/httpx" "jyInfo/api/internal/logic" "jyInfo/api/internal/svc" ) func getProvinceHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { l := logic.NewGetProvinceLogic(r.Context(), svcCtx) resp, err := l.GetProvince() if err != nil { httpx.Error(w, err) } else { httpx.OkJson(w, resp) } } }