fix: 补全 ShopProfile 和 Post 响应中缺失的后端字段

ShopProfile 补上 allowMultiShop/allowIndependentOrders/dispatchMode,Post 补上 pinned/linkedOrderId。这些字段在 RPC proto、数据库和写入逻辑中均已存在,但 API 响应类型和映射函数遗漏了它们。同时补回 community.api 中 CreateCommentReq 的 PostId 字段定义。
This commit is contained in:
zetaloop
2026-04-23 20:36:44 +08:00
parent e061c3f779
commit 198c761063
7 changed files with 82 additions and 66 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
// Code generated by goctl. DO NOT EDIT.
// goctl 1.9.2
// goctl 1.10.1
package handler
@@ -49,6 +49,8 @@ func mapPost(ctx context.Context, svcCtx *svc.ServiceContext, p *communitypb.Pos
Content: p.GetContent(),
Images: append([]string(nil), p.GetImages()...),
Tags: append([]string(nil), p.GetTags()...),
LinkedOrderId: p.GetLinkedOrderId(),
Pinned: p.GetPinned(),
LikeCount: p.GetLikeCount(),
CommentCount: p.GetCommentCount(),
Liked: liked,
+3 -1
View File
@@ -1,5 +1,5 @@
// Code generated by goctl. DO NOT EDIT.
// goctl 1.9.2
// goctl 1.10.1
package types
@@ -59,6 +59,8 @@ type Post struct {
Content string `json:"content"`
Images []string `json:"images"`
Tags []string `json:"tags"`
LinkedOrderId int64 `json:"linkedOrderId,optional"`
Pinned bool `json:"pinned"`
LikeCount int64 `json:"likeCount"`
CommentCount int64 `json:"commentCount"`
Liked bool `json:"liked"`
@@ -44,6 +44,9 @@ func toShopProfile(in *pb.Shops) *types.ShopProfile {
PlayerCount: in.PlayerCount,
CommissionType: in.CommissionType,
CommissionValue: in.CommissionValue,
AllowMultiShop: in.AllowMultiShop,
AllowIndependentOrders: in.AllowIndependentOrders,
DispatchMode: in.DispatchMode,
Announcements: in.Announcements,
TemplateConfig: template,
}
+3
View File
@@ -90,6 +90,9 @@ type ShopProfile struct {
PlayerCount int64 `json:"playerCount"`
CommissionType string `json:"commissionType"`
CommissionValue string `json:"commissionValue"`
AllowMultiShop bool `json:"allowMultiShop"`
AllowIndependentOrders bool `json:"allowIndependentOrders"`
DispatchMode string `json:"dispatchMode"`
Announcements []string `json:"announcements"`
TemplateConfig interface{} `json:"templateConfig"`
}
+3
View File
@@ -12,6 +12,8 @@ type (
Content string `json:"content"`
Images []string `json:"images"`
Tags []string `json:"tags"`
LinkedOrderId int64 `json:"linkedOrderId,optional"`
Pinned bool `json:"pinned"`
LikeCount int64 `json:"likeCount"`
CommentCount int64 `json:"commentCount"`
Liked bool `json:"liked"`
@@ -47,6 +49,7 @@ type (
Meta PageMeta `json:"meta"`
}
CreateCommentReq {
PostId int64 `json:"-"`
Content string `json:"content"`
}
ListCommentsReq {
+3
View File
@@ -14,6 +14,9 @@ type (
PlayerCount int64 `json:"playerCount"`
CommissionType string `json:"commissionType"`
CommissionValue string `json:"commissionValue"`
AllowMultiShop bool `json:"allowMultiShop"`
AllowIndependentOrders bool `json:"allowIndependentOrders"`
DispatchMode string `json:"dispatchMode"`
Announcements []string `json:"announcements"`
TemplateConfig interface{} `json:"templateConfig"`
}