chore: 项目基线(基于 WeKnora 定制版,整理文件忽略规则)

This commit is contained in:
runny committed 2026-11-13 17:54:56 +08:00
commit 9097ee699d
5769 files changed
+1446466

No files matched your search

+36
View File
@@ -0,0 +1,36 @@
package handler
// Response envelopes for Swagger annotations. Handlers write these shapes
// with gin.H; the types only exist so the documented body matches. Compose
// the payload in the annotation, e.g.
//
// @Success 200 {object} handler.DataResponse{data=types.Knowledge}
// @Success 200 {object} handler.PageResponse{data=[]types.Knowledge}
// DataResponse is the {"success": true, "data": ...} body.
type DataResponse struct {
Success bool `json:"success" example:"true"`
Data any `json:"data"`
}
// PageResponse is a page of a list with the total match count.
type PageResponse struct {
Success bool `json:"success" example:"true"`
Data any `json:"data"`
Total int64 `json:"total" extensions:"x-agent"`
Page int `json:"page" extensions:"x-agent"`
PageSize int `json:"page_size" extensions:"x-agent"`
}
// DataMessageResponse is DataResponse with a human-readable message.
type DataMessageResponse struct {
Success bool `json:"success" example:"true"`
Message string `json:"message"`
Data any `json:"data"`
}
// MessageResponse is the {"success": true, "message": ...} body.
type MessageResponse struct {
Success bool `json:"success" example:"true" extensions:"x-agent"`
Message string `json:"message"`
}