添加研究实习项目和乡村政府项目业务层
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
// Code scaffolded by goctl. Safe to edit.
|
||||
// goctl 1.9.2
|
||||
|
||||
package socialServiceInternship
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/JACKYMYPERSON/hldrCenter/internal/social_service_internship/internal/logic/socialServiceInternship"
|
||||
"github.com/JACKYMYPERSON/hldrCenter/internal/social_service_internship/internal/svc"
|
||||
"github.com/JACKYMYPERSON/hldrCenter/internal/social_service_internship/internal/types"
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func CreateSocialServiceInternshipHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.CreateSocialServiceInternshipReq
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
httpx.ErrorCtx(r.Context(), w, err)
|
||||
return
|
||||
}
|
||||
|
||||
l := socialServiceInternship.NewCreateSocialServiceInternshipLogic(r.Context(), svcCtx)
|
||||
resp, err := l.CreateSocialServiceInternship(&req)
|
||||
if err != nil {
|
||||
httpx.ErrorCtx(r.Context(), w, err)
|
||||
} else {
|
||||
httpx.OkJsonCtx(r.Context(), w, resp)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
// Code scaffolded by goctl. Safe to edit.
|
||||
// goctl 1.9.2
|
||||
|
||||
package socialServiceInternship
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/JACKYMYPERSON/hldrCenter/internal/social_service_internship/internal/logic/socialServiceInternship"
|
||||
"github.com/JACKYMYPERSON/hldrCenter/internal/social_service_internship/internal/svc"
|
||||
"github.com/JACKYMYPERSON/hldrCenter/internal/social_service_internship/internal/types"
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func DeleteSocialServiceInternshipHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.DeleteSocialServiceInternshipReq
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
httpx.ErrorCtx(r.Context(), w, err)
|
||||
return
|
||||
}
|
||||
|
||||
l := socialServiceInternship.NewDeleteSocialServiceInternshipLogic(r.Context(), svcCtx)
|
||||
resp, err := l.DeleteSocialServiceInternship(&req)
|
||||
if err != nil {
|
||||
httpx.ErrorCtx(r.Context(), w, err)
|
||||
} else {
|
||||
httpx.OkJsonCtx(r.Context(), w, resp)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
// Code scaffolded by goctl. Safe to edit.
|
||||
// goctl 1.9.2
|
||||
|
||||
package socialServiceInternship
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/JACKYMYPERSON/hldrCenter/internal/social_service_internship/internal/logic/socialServiceInternship"
|
||||
"github.com/JACKYMYPERSON/hldrCenter/internal/social_service_internship/internal/svc"
|
||||
"github.com/JACKYMYPERSON/hldrCenter/internal/social_service_internship/internal/types"
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func GetSocialServiceInternshipHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.GetSocialServiceInternshipReq
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
httpx.ErrorCtx(r.Context(), w, err)
|
||||
return
|
||||
}
|
||||
|
||||
l := socialServiceInternship.NewGetSocialServiceInternshipLogic(r.Context(), svcCtx)
|
||||
resp, err := l.GetSocialServiceInternship(&req)
|
||||
if err != nil {
|
||||
httpx.ErrorCtx(r.Context(), w, err)
|
||||
} else {
|
||||
httpx.OkJsonCtx(r.Context(), w, resp)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
// Code scaffolded by goctl. Safe to edit.
|
||||
// goctl 1.9.2
|
||||
|
||||
package socialServiceInternship
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/JACKYMYPERSON/hldrCenter/internal/social_service_internship/internal/logic/socialServiceInternship"
|
||||
"github.com/JACKYMYPERSON/hldrCenter/internal/social_service_internship/internal/svc"
|
||||
"github.com/JACKYMYPERSON/hldrCenter/internal/social_service_internship/internal/types"
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func ListSocialServiceInternshipHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.ListSocialServiceInternshipReq
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
httpx.ErrorCtx(r.Context(), w, err)
|
||||
return
|
||||
}
|
||||
|
||||
l := socialServiceInternship.NewListSocialServiceInternshipLogic(r.Context(), svcCtx)
|
||||
resp, err := l.ListSocialServiceInternship(&req)
|
||||
if err != nil {
|
||||
httpx.ErrorCtx(r.Context(), w, err)
|
||||
} else {
|
||||
httpx.OkJsonCtx(r.Context(), w, resp)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
// Code scaffolded by goctl. Safe to edit.
|
||||
// goctl 1.9.2
|
||||
|
||||
package socialServiceInternship
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/JACKYMYPERSON/hldrCenter/internal/social_service_internship/internal/logic/socialServiceInternship"
|
||||
"github.com/JACKYMYPERSON/hldrCenter/internal/social_service_internship/internal/svc"
|
||||
"github.com/JACKYMYPERSON/hldrCenter/internal/social_service_internship/internal/types"
|
||||
"github.com/zeromicro/go-zero/rest/httpx"
|
||||
)
|
||||
|
||||
func UpdateSocialServiceInternshipHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req types.UpdateSocialServiceInternshipReq
|
||||
if err := httpx.Parse(r, &req); err != nil {
|
||||
httpx.ErrorCtx(r.Context(), w, err)
|
||||
return
|
||||
}
|
||||
|
||||
l := socialServiceInternship.NewUpdateSocialServiceInternshipLogic(r.Context(), svcCtx)
|
||||
resp, err := l.UpdateSocialServiceInternship(&req)
|
||||
if err != nil {
|
||||
httpx.ErrorCtx(r.Context(), w, err)
|
||||
} else {
|
||||
httpx.OkJsonCtx(r.Context(), w, resp)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user