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

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 socialServiceGovernmentProgram
import (
"net/http"
"github.com/JACKYMYPERSON/hldrCenter/internal/social_service_governmentprogram/internal/logic/socialServiceGovernmentProgram"
"github.com/JACKYMYPERSON/hldrCenter/internal/social_service_governmentprogram/internal/svc"
"github.com/JACKYMYPERSON/hldrCenter/internal/social_service_governmentprogram/internal/types"
"github.com/zeromicro/go-zero/rest/httpx"
)
func CreateSocialServiceGovernmentProgramHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.CreateSocialServiceGovernmentProgramReq
if err := httpx.Parse(r, &req); err != nil {
httpx.ErrorCtx(r.Context(), w, err)
return
}
l := socialServiceGovernmentProgram.NewCreateSocialServiceGovernmentProgramLogic(r.Context(), svcCtx)
resp, err := l.CreateSocialServiceGovernmentProgram(&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 socialServiceGovernmentProgram
import (
"net/http"
"github.com/JACKYMYPERSON/hldrCenter/internal/social_service_governmentprogram/internal/logic/socialServiceGovernmentProgram"
"github.com/JACKYMYPERSON/hldrCenter/internal/social_service_governmentprogram/internal/svc"
"github.com/JACKYMYPERSON/hldrCenter/internal/social_service_governmentprogram/internal/types"
"github.com/zeromicro/go-zero/rest/httpx"
)
func DeleteSocialServiceGovernmentProgramHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.DeleteSocialServiceGovernmentProgramReq
if err := httpx.Parse(r, &req); err != nil {
httpx.ErrorCtx(r.Context(), w, err)
return
}
l := socialServiceGovernmentProgram.NewDeleteSocialServiceGovernmentProgramLogic(r.Context(), svcCtx)
resp, err := l.DeleteSocialServiceGovernmentProgram(&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 socialServiceGovernmentProgram
import (
"net/http"
"github.com/JACKYMYPERSON/hldrCenter/internal/social_service_governmentprogram/internal/logic/socialServiceGovernmentProgram"
"github.com/JACKYMYPERSON/hldrCenter/internal/social_service_governmentprogram/internal/svc"
"github.com/JACKYMYPERSON/hldrCenter/internal/social_service_governmentprogram/internal/types"
"github.com/zeromicro/go-zero/rest/httpx"
)
func GetSocialServiceGovernmentProgramHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.GetSocialServiceGovernmentProgramReq
if err := httpx.Parse(r, &req); err != nil {
httpx.ErrorCtx(r.Context(), w, err)
return
}
l := socialServiceGovernmentProgram.NewGetSocialServiceGovernmentProgramLogic(r.Context(), svcCtx)
resp, err := l.GetSocialServiceGovernmentProgram(&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 socialServiceGovernmentProgram
import (
"net/http"
"github.com/JACKYMYPERSON/hldrCenter/internal/social_service_governmentprogram/internal/logic/socialServiceGovernmentProgram"
"github.com/JACKYMYPERSON/hldrCenter/internal/social_service_governmentprogram/internal/svc"
"github.com/JACKYMYPERSON/hldrCenter/internal/social_service_governmentprogram/internal/types"
"github.com/zeromicro/go-zero/rest/httpx"
)
func ListSocialServiceGovernmentProgramHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.ListSocialServiceGovernmentProgramReq
if err := httpx.Parse(r, &req); err != nil {
httpx.ErrorCtx(r.Context(), w, err)
return
}
l := socialServiceGovernmentProgram.NewListSocialServiceGovernmentProgramLogic(r.Context(), svcCtx)
resp, err := l.ListSocialServiceGovernmentProgram(&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 socialServiceGovernmentProgram
import (
"net/http"
"github.com/JACKYMYPERSON/hldrCenter/internal/social_service_governmentprogram/internal/logic/socialServiceGovernmentProgram"
"github.com/JACKYMYPERSON/hldrCenter/internal/social_service_governmentprogram/internal/svc"
"github.com/JACKYMYPERSON/hldrCenter/internal/social_service_governmentprogram/internal/types"
"github.com/zeromicro/go-zero/rest/httpx"
)
func UpdateSocialServiceGovernmentProgramHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.UpdateSocialServiceGovernmentProgramReq
if err := httpx.Parse(r, &req); err != nil {
httpx.ErrorCtx(r.Context(), w, err)
return
}
l := socialServiceGovernmentProgram.NewUpdateSocialServiceGovernmentProgramLogic(r.Context(), svcCtx)
resp, err := l.UpdateSocialServiceGovernmentProgram(&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 socialServiceGovernmentProgram
import (
"context"
"github.com/JACKYMYPERSON/hldrCenter/internal/social_service_governmentprogram/internal/svc"
"github.com/JACKYMYPERSON/hldrCenter/internal/social_service_governmentprogram/internal/types"
"github.com/zeromicro/go-zero/core/logx"
)
type CreateSocialServiceGovernmentProgramLogic struct {
logx.Logger
ctx context.Context
svcCtx *svc.ServiceContext
}
func NewCreateSocialServiceGovernmentProgramLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CreateSocialServiceGovernmentProgramLogic {
return &CreateSocialServiceGovernmentProgramLogic{
Logger: logx.WithContext(ctx),
ctx: ctx,
svcCtx: svcCtx,
}
}
func (l *CreateSocialServiceGovernmentProgramLogic) CreateSocialServiceGovernmentProgram(req *types.CreateSocialServiceGovernmentProgramReq) (resp *types.CreateSocialServiceGovernmentProgramResp, 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 socialServiceGovernmentProgram
import (
"context"
"github.com/JACKYMYPERSON/hldrCenter/internal/social_service_governmentprogram/internal/svc"
"github.com/JACKYMYPERSON/hldrCenter/internal/social_service_governmentprogram/internal/types"
"github.com/zeromicro/go-zero/core/logx"
)
type DeleteSocialServiceGovernmentProgramLogic struct {
logx.Logger
ctx context.Context
svcCtx *svc.ServiceContext
}
func NewDeleteSocialServiceGovernmentProgramLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeleteSocialServiceGovernmentProgramLogic {
return &DeleteSocialServiceGovernmentProgramLogic{
Logger: logx.WithContext(ctx),
ctx: ctx,
svcCtx: svcCtx,
}
}
func (l *DeleteSocialServiceGovernmentProgramLogic) DeleteSocialServiceGovernmentProgram(req *types.DeleteSocialServiceGovernmentProgramReq) (resp *types.DeleteSocialServiceGovernmentProgramResp, 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 socialServiceGovernmentProgram
import (
"context"
"github.com/JACKYMYPERSON/hldrCenter/internal/social_service_governmentprogram/internal/svc"
"github.com/JACKYMYPERSON/hldrCenter/internal/social_service_governmentprogram/internal/types"
"github.com/zeromicro/go-zero/core/logx"
)
type GetSocialServiceGovernmentProgramLogic struct {
logx.Logger
ctx context.Context
svcCtx *svc.ServiceContext
}
func NewGetSocialServiceGovernmentProgramLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetSocialServiceGovernmentProgramLogic {
return &GetSocialServiceGovernmentProgramLogic{
Logger: logx.WithContext(ctx),
ctx: ctx,
svcCtx: svcCtx,
}
}
func (l *GetSocialServiceGovernmentProgramLogic) GetSocialServiceGovernmentProgram(req *types.GetSocialServiceGovernmentProgramReq) (resp *types.GetSocialServiceGovernmentProgramResp, 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 socialServiceGovernmentProgram
import (
"context"
"github.com/JACKYMYPERSON/hldrCenter/internal/social_service_governmentprogram/internal/svc"
"github.com/JACKYMYPERSON/hldrCenter/internal/social_service_governmentprogram/internal/types"
"github.com/zeromicro/go-zero/core/logx"
)
type ListSocialServiceGovernmentProgramLogic struct {
logx.Logger
ctx context.Context
svcCtx *svc.ServiceContext
}
func NewListSocialServiceGovernmentProgramLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ListSocialServiceGovernmentProgramLogic {
return &ListSocialServiceGovernmentProgramLogic{
Logger: logx.WithContext(ctx),
ctx: ctx,
svcCtx: svcCtx,
}
}
func (l *ListSocialServiceGovernmentProgramLogic) ListSocialServiceGovernmentProgram(req *types.ListSocialServiceGovernmentProgramReq) (resp *types.ListSocialServiceGovernmentProgramResp, 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 socialServiceGovernmentProgram
import (
"context"
"github.com/JACKYMYPERSON/hldrCenter/internal/social_service_governmentprogram/internal/svc"
"github.com/JACKYMYPERSON/hldrCenter/internal/social_service_governmentprogram/internal/types"
"github.com/zeromicro/go-zero/core/logx"
)
type UpdateSocialServiceGovernmentProgramLogic struct {
logx.Logger
ctx context.Context
svcCtx *svc.ServiceContext
}
func NewUpdateSocialServiceGovernmentProgramLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UpdateSocialServiceGovernmentProgramLogic {
return &UpdateSocialServiceGovernmentProgramLogic{
Logger: logx.WithContext(ctx),
ctx: ctx,
svcCtx: svcCtx,
}
}
func (l *UpdateSocialServiceGovernmentProgramLogic) UpdateSocialServiceGovernmentProgram(req *types.UpdateSocialServiceGovernmentProgramReq) (resp *types.UpdateSocialServiceGovernmentProgramResp, 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 CreateSocialServiceGovernmentProgramData struct {
Id int64 `json:"id"` // 新增记录的ID
}
type CreateSocialServiceGovernmentProgramReq 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 CreateSocialServiceGovernmentProgramResp struct {
Code int `json:"code"`
Msg string `json:"message"`
Data CreateSocialServiceGovernmentProgramData `json:"data,omitempty"`
}
type DeleteSocialServiceGovernmentProgramReq struct {
Id int64 `json:"id" path:"id" validate:"min=1"` // 社会服务政府项目ID必填
}
type DeleteSocialServiceGovernmentProgramResp struct {
Code int `json:"code"`
Msg string `json:"message"`
}
type GetSocialServiceGovernmentProgramReq struct {
Id int64 `json:"id" path:"id" validate:"min=1"` // 社会服务政府项目ID必填
}
type GetSocialServiceGovernmentProgramResp struct {
Code int `json:"code"`
Msg string `json:"message"`
Data SocialServiceGovernmentProgram `json:"data,omitempty"`
}
type ListSocialServiceGovernmentProgramData struct {
Total int64 `json:"total"` // 总条数
List []SocialServiceGovernmentProgram `json:"list"` // 列表数据
}
type ListSocialServiceGovernmentProgramReq 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 ListSocialServiceGovernmentProgramResp struct {
Code int `json:"code"`
Msg string `json:"message"`
Data ListSocialServiceGovernmentProgramData `json:"data,omitempty"`
}
type SocialServiceGovernmentProgram 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 UpdateSocialServiceGovernmentProgramReq 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 UpdateSocialServiceGovernmentProgramResp struct {
Code int `json:"code"`
Msg string `json:"message"`
}