Files
qitongxue-api/api/user/v1/goods.go
2026-09-30 17:01:18 +08:00

53 lines
2.1 KiB
Go
Raw 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.
package v1
import "github.com/gogf/gf/v2/frame/g"
// ============================================================================
// C 端软件开发服务契约(迭代-2026-09-29):list / detail
//
// 仅上架(is_enabled=1)商品可见;封面 url 由后端按 site.base_url 拼成绝对地址,
// 小程序端拿到即可直接用于 <image>,无需自行拼接域名。
// ============================================================================
// GoodsItem 服务列表项(响应 snake_case)
type GoodsItem struct {
Id int64 `json:"id"`
Category int `json:"category"` // 1网站 2小程序 3App 4桌面
CategoryName string `json:"category_name"` // 分类展示名(服务端映射)
Title string `json:"title"`
Summary string `json:"summary"`
CoverUrl string `json:"cover_url"` // 封面绝对 URL(可能为空 = 无封面)
PriceCents int64 `json:"price_cents"` // 0 = 面议
PriceNote string `json:"price_note"` // 价格备注(如「起」「/项目」)
}
// GoodsListReq 服务列表(C 端,仅上架)
type GoodsListReq struct {
g.Meta `path:"/goods/list" method:"get" tags:"goods" summary:"软件开发服务列表"`
Category int `json:"category"` // 0=全部
Page int `json:"page"`
PageSize int `json:"pageSize"`
}
type GoodsListRes struct {
List []GoodsItem `json:"list"`
Total int `json:"total"`
}
// GoodsDetailReq 服务详情(C 端,仅上架;含 Markdown 原文,由前端解析渲染)
type GoodsDetailReq struct {
g.Meta `path:"/goods/detail" method:"get" tags:"goods" summary:"软件开发服务详情"`
Id int64 `v:"required" json:"id"`
}
type GoodsDetailRes struct {
Id int64 `json:"id"`
Category int `json:"category"`
CategoryName string `json:"category_name"`
Title string `json:"title"`
Summary string `json:"summary"`
ContentMd string `json:"content_md"`
CoverUrl string `json:"cover_url"`
PriceCents int64 `json:"price_cents"`
PriceNote string `json:"price_note"`
UpdatedAt string `json:"updated_at"`
}