- 订单列表使用独立最小 DTO 并分页,号主待办提供独立接口与统计 - 用户 token 增加版本控制,冻结/改密/退出即时撤销会话 - 移除 URL token 传参,SSE 与接口统一使用 HttpOnly Cookie - 私有文件按上传归属与业务关联授权,收款凭证转私有访问并校验归属 - 公开商品接口返回最小字段,隐藏号主身份与内部状态 - 每日清理超过 30 天未关联业务的上传归属,上传归属失败时补偿删除对象
48 lines
1.2 KiB
Go
48 lines
1.2 KiB
Go
package listing
|
|
|
|
import (
|
|
"context"
|
|
)
|
|
|
|
func (s *Service) ListPublic(ctx context.Context, query PublicListQuery) (*PublicListResult, error) {
|
|
if s.repo == nil {
|
|
return nil, ErrDependencyUnavailable
|
|
}
|
|
return s.repo.ListPublic(ctx, query)
|
|
}
|
|
|
|
func (s *Service) ListMine(ctx context.Context, ownerID uint64) ([]ListingDTO, error) {
|
|
if s.repo == nil {
|
|
return nil, ErrDependencyUnavailable
|
|
}
|
|
return s.repo.ListMine(ctx, ownerID)
|
|
}
|
|
|
|
func (s *Service) FindPublic(ctx context.Context, id uint64) (*PublicListingDetailDTO, error) {
|
|
if s.repo == nil {
|
|
return nil, ErrDependencyUnavailable
|
|
}
|
|
return s.repo.FindPublic(ctx, id)
|
|
}
|
|
|
|
func (s *Service) FindPublicCoverKey(ctx context.Context, id uint64) (string, error) {
|
|
if s.repo == nil {
|
|
return "", ErrDependencyUnavailable
|
|
}
|
|
return s.repo.FindPublicCoverKey(ctx, id)
|
|
}
|
|
|
|
func (s *Service) FindPublicScreenshotKey(ctx context.Context, id uint64, index int) (string, error) {
|
|
if s.repo == nil {
|
|
return "", ErrDependencyUnavailable
|
|
}
|
|
return s.repo.FindPublicScreenshotKey(ctx, id, index)
|
|
}
|
|
|
|
func (s *Service) FindMine(ctx context.Context, ownerID uint64, id uint64) (*ListingDTO, error) {
|
|
if s.repo == nil {
|
|
return nil, ErrDependencyUnavailable
|
|
}
|
|
return s.repo.FindMine(ctx, ownerID, id)
|
|
}
|