Files
hldrCenter/server/api/social/socical_service_internship/social_service_internship.api
2025-11-01 23:38:51 +08:00

137 lines
6.1 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// 通用基础响应结构不含泛型兼容Goctl
type BaseResp {
Code int `json:"code"` // 状态码0成功非0失败
Msg string `json:"message"` // 提示信息
}
// 社会服务实习实体结构(与表字段对应)
type SocialServiceInternship {
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 CreateSocialServiceInternshipReq {
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 {
Code int `json:"code"`
Msg string `json:"message"`
Data CreateSocialServiceInternshipData `json:"data,omitempty"`
}
type CreateSocialServiceInternshipData {
Id int64 `json:"id"` // 新增记录的ID
}
// 获取社会服务实习列表 - 请求参数
type ListSocialServiceInternshipReq {
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 {
Code int `json:"code"`
Msg string `json:"message"`
Data ListSocialServiceInternshipData `json:"data,omitempty"`
}
type ListSocialServiceInternshipData {
Total int64 `json:"total"` // 总条数
List []SocialServiceInternship `json:"list"` // 列表数据
}
// 获取社会服务实习详情 - 请求参数(路径参数)
type GetSocialServiceInternshipReq {
Id int64 `json:"id" path:"id" validate:"min=1"` // 社会服务实习ID必填
}
// 获取社会服务实习详情 - 响应参数(嵌套数据,无泛型)
type GetSocialServiceInternshipResp {
Code int `json:"code"`
Msg string `json:"message"`
Data SocialServiceInternship `json:"data,omitempty"`
}
// 更新社会服务实习 - 请求参数
type UpdateSocialServiceInternshipReq {
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 {
Code int `json:"code"`
Msg string `json:"message"`
}
// 删除社会服务实习 - 请求参数(路径参数)
type DeleteSocialServiceInternshipReq {
Id int64 `json:"id" path:"id" validate:"min=1"` // 社会服务实习ID必填
}
// 删除社会服务实习 - 响应参数(基础响应,无额外数据)
type DeleteSocialServiceInternshipResp {
Code int `json:"code"`
Msg string `json:"message"`
}
@server (
group: socialServiceInternship
prefix: /api/social-service/internship // 统一前缀,区分实习相关接口
)
service social_service_internship_api {
// 创建社会服务实习
@handler CreateSocialServiceInternshipHandler
post / (CreateSocialServiceInternshipReq) returns (CreateSocialServiceInternshipResp)
// 获取社会服务实习列表
@handler ListSocialServiceInternshipHandler
get /list (ListSocialServiceInternshipReq) returns (ListSocialServiceInternshipResp)
// 获取社会服务实习详情
@handler GetSocialServiceInternshipHandler
get /:id (GetSocialServiceInternshipReq) returns (GetSocialServiceInternshipResp)
// 更新社会服务实习
@handler UpdateSocialServiceInternshipHandler
put /:id (UpdateSocialServiceInternshipReq) returns (UpdateSocialServiceInternshipResp)
// 删除社会服务实习
@handler DeleteSocialServiceInternshipHandler
delete /:id (DeleteSocialServiceInternshipReq) returns (DeleteSocialServiceInternshipResp)
}