添加研究实习项目和乡村政府项目业务层
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
@@ -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"`
|
||||
}
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
@@ -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"`
|
||||
}
|
||||
Reference in New Issue
Block a user