添加研究实习项目和乡村政府项目业务层

This commit is contained in:
2025-10-30 09:59:40 +08:00
parent 85d8d6f92e
commit ef04f88e2e
22 changed files with 844 additions and 0 deletions

View File

@@ -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)
}
}
}

View File

@@ -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)
}
}
}

View File

@@ -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)
}
}
}

View File

@@ -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)
}
}
}

View File

@@ -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)
}
}
}

View File

@@ -0,0 +1,33 @@
// Code scaffolded by goctl. Safe to edit.
// goctl 1.9.2
package socialServiceInternship
import (
"context"
"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/core/logx"
)
type CreateSocialServiceInternshipLogic struct {
logx.Logger
ctx context.Context
svcCtx *svc.ServiceContext
}
func NewCreateSocialServiceInternshipLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CreateSocialServiceInternshipLogic {
return &CreateSocialServiceInternshipLogic{
Logger: logx.WithContext(ctx),
ctx: ctx,
svcCtx: svcCtx,
}
}
func (l *CreateSocialServiceInternshipLogic) CreateSocialServiceInternship(req *types.CreateSocialServiceInternshipReq) (resp *types.CreateSocialServiceInternshipResp, err error) {
// todo: add your logic here and delete this line
return
}

View File

@@ -0,0 +1,33 @@
// Code scaffolded by goctl. Safe to edit.
// goctl 1.9.2
package socialServiceInternship
import (
"context"
"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/core/logx"
)
type DeleteSocialServiceInternshipLogic struct {
logx.Logger
ctx context.Context
svcCtx *svc.ServiceContext
}
func NewDeleteSocialServiceInternshipLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeleteSocialServiceInternshipLogic {
return &DeleteSocialServiceInternshipLogic{
Logger: logx.WithContext(ctx),
ctx: ctx,
svcCtx: svcCtx,
}
}
func (l *DeleteSocialServiceInternshipLogic) DeleteSocialServiceInternship(req *types.DeleteSocialServiceInternshipReq) (resp *types.DeleteSocialServiceInternshipResp, err error) {
// todo: add your logic here and delete this line
return
}

View File

@@ -0,0 +1,33 @@
// Code scaffolded by goctl. Safe to edit.
// goctl 1.9.2
package socialServiceInternship
import (
"context"
"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/core/logx"
)
type GetSocialServiceInternshipLogic struct {
logx.Logger
ctx context.Context
svcCtx *svc.ServiceContext
}
func NewGetSocialServiceInternshipLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetSocialServiceInternshipLogic {
return &GetSocialServiceInternshipLogic{
Logger: logx.WithContext(ctx),
ctx: ctx,
svcCtx: svcCtx,
}
}
func (l *GetSocialServiceInternshipLogic) GetSocialServiceInternship(req *types.GetSocialServiceInternshipReq) (resp *types.GetSocialServiceInternshipResp, err error) {
// todo: add your logic here and delete this line
return
}

View File

@@ -0,0 +1,33 @@
// Code scaffolded by goctl. Safe to edit.
// goctl 1.9.2
package socialServiceInternship
import (
"context"
"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/core/logx"
)
type ListSocialServiceInternshipLogic struct {
logx.Logger
ctx context.Context
svcCtx *svc.ServiceContext
}
func NewListSocialServiceInternshipLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ListSocialServiceInternshipLogic {
return &ListSocialServiceInternshipLogic{
Logger: logx.WithContext(ctx),
ctx: ctx,
svcCtx: svcCtx,
}
}
func (l *ListSocialServiceInternshipLogic) ListSocialServiceInternship(req *types.ListSocialServiceInternshipReq) (resp *types.ListSocialServiceInternshipResp, err error) {
// todo: add your logic here and delete this line
return
}

View File

@@ -0,0 +1,33 @@
// Code scaffolded by goctl. Safe to edit.
// goctl 1.9.2
package socialServiceInternship
import (
"context"
"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/core/logx"
)
type UpdateSocialServiceInternshipLogic struct {
logx.Logger
ctx context.Context
svcCtx *svc.ServiceContext
}
func NewUpdateSocialServiceInternshipLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UpdateSocialServiceInternshipLogic {
return &UpdateSocialServiceInternshipLogic{
Logger: logx.WithContext(ctx),
ctx: ctx,
svcCtx: svcCtx,
}
}
func (l *UpdateSocialServiceInternshipLogic) UpdateSocialServiceInternship(req *types.UpdateSocialServiceInternshipReq) (resp *types.UpdateSocialServiceInternshipResp, err error) {
// todo: add your logic here and delete this line
return
}

View File

@@ -0,0 +1,102 @@
// Code generated by goctl. DO NOT EDIT.
// goctl 1.9.2
package types
type BaseResp struct {
Code int `json:"code"` // 状态码0成功非0失败
Msg string `json:"message"` // 提示信息
}
type CreateSocialServiceInternshipData struct {
Id int64 `json:"id"` // 新增记录的ID
}
type CreateSocialServiceInternshipReq struct {
Title string `json:"title" validate:"required"` // 标题(必填)
Subtitle string `json:"subtitle,omitempty"` // 副标题
CoverUrl string `json:"cover_url,omitempty"` // 封面图片URL
Intro string `json:"intro,omitempty"` // 简介(纯文字)
Content string `json:"content,omitempty"` // 内容Markdown格式
ImageEditors string `json:"image_editors,omitempty"` // 图片编辑者名单(逗号分隔)
TextEditors string `json:"text_editors,omitempty"` // 文字编辑者名单(逗号分隔)
ChiefEditor string `json:"chief_editor,omitempty"` // 总编辑
Proofreaders string `json:"proofreaders,omitempty"` // 校对者名单(逗号分隔)
Reviewers string `json:"reviewers,omitempty"` // 审核者名单(逗号分隔)
}
type CreateSocialServiceInternshipResp struct {
Code int `json:"code"`
Msg string `json:"message"`
Data CreateSocialServiceInternshipData `json:"data,omitempty"`
}
type DeleteSocialServiceInternshipReq struct {
Id int64 `json:"id" path:"id" validate:"min=1"` // 社会服务实习ID必填
}
type DeleteSocialServiceInternshipResp struct {
Code int `json:"code"`
Msg string `json:"message"`
}
type GetSocialServiceInternshipReq struct {
Id int64 `json:"id" path:"id" validate:"min=1"` // 社会服务实习ID必填
}
type GetSocialServiceInternshipResp struct {
Code int `json:"code"`
Msg string `json:"message"`
Data SocialServiceInternship `json:"data,omitempty"`
}
type ListSocialServiceInternshipData struct {
Total int64 `json:"total"` // 总条数
List []SocialServiceInternship `json:"list"` // 列表数据
}
type ListSocialServiceInternshipReq struct {
Page int `json:"page" form:"page" validate:"min=1"` // 页码默认1
PageSize int `json:"page_size" form:"page_size" validate:"min=1,max=100"` // 每页条数默认10最大100
}
type ListSocialServiceInternshipResp struct {
Code int `json:"code"`
Msg string `json:"message"`
Data ListSocialServiceInternshipData `json:"data,omitempty"`
}
type SocialServiceInternship struct {
Id int64 `json:"id"` // 主键ID
Title string `json:"title"` // 标题
Subtitle string `json:"subtitle,omitempty"` // 副标题
CoverUrl string `json:"cover_url,omitempty"` // 封面图片URL
Intro string `json:"intro,omitempty"` // 简介(纯文字)
Content string `json:"content,omitempty"` // 内容Markdown格式
ImageEditors string `json:"image_editors,omitempty"` // 图片编辑者名单(逗号分隔)
TextEditors string `json:"text_editors,omitempty"` // 文字编辑者名单(逗号分隔)
ChiefEditor string `json:"chief_editor,omitempty"` // 总编辑
Proofreaders string `json:"proofreaders,omitempty"` // 校对者名单(逗号分隔)
Reviewers string `json:"reviewers,omitempty"` // 审核者名单(逗号分隔)
PublishTime string `json:"publish_time"` // 发布时间格式yyyy-MM-dd HH:mm:ss
UpdateTime string `json:"update_time"` // 最后更改时间格式yyyy-MM-dd HH:mm:ss
}
type UpdateSocialServiceInternshipReq struct {
Id int64 `json:"-" path:"id" validate:"min=1"` // 社会服务实习ID路径参数必填
Title string `json:"title,omitempty"` // 标题
Subtitle string `json:"subtitle,omitempty"` // 副标题
CoverUrl string `json:"cover_url,omitempty"` // 封面图片URL
Intro string `json:"intro,omitempty"` // 简介(纯文字)
Content string `json:"content,omitempty"` // 内容Markdown格式
ImageEditors string `json:"image_editors,omitempty"` // 图片编辑者名单(逗号分隔)
TextEditors string `json:"text_editors,omitempty"` // 文字编辑者名单(逗号分隔)
ChiefEditor string `json:"chief_editor,omitempty"` // 总编辑
Proofreaders string `json:"proofreaders,omitempty"` // 校对者名单(逗号分隔)
Reviewers string `json:"reviewers,omitempty"` // 审核者名单(逗号分隔)
}
type UpdateSocialServiceInternshipResp struct {
Code int `json:"code"`
Msg string `json:"message"`
}