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