thread-master/internal/logic/threads_account/get_threads_account_logic.go

31 lines
735 B
Go
Raw Permalink Normal View History

2026-06-26 08:37:04 +00:00
package threads_account
import (
"context"
"haixun-backend/internal/svc"
"haixun-backend/internal/types"
)
type GetThreadsAccountLogic struct {
ctx context.Context
svcCtx *svc.ServiceContext
}
func NewGetThreadsAccountLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetThreadsAccountLogic {
return &GetThreadsAccountLogic{ctx: ctx, svcCtx: svcCtx}
}
func (l *GetThreadsAccountLogic) GetThreadsAccount(req *types.ThreadsAccountPath) (*types.ThreadsAccountData, error) {
tenantID, uid, err := actorFrom(l.ctx)
if err != nil {
return nil, err
}
item, err := l.svcCtx.ThreadsAccount.Get(l.ctx, tenantID, uid, req.ID)
if err != nil {
return nil, err
}
out := toThreadsAccountData(*item)
return &out, nil
}