thread-master/internal/logic/threads_account/get_threads_account_connect...

40 lines
966 B
Go
Raw Normal View History

2026-06-26 08:37:04 +00:00
// Code scaffolded by goctl. Safe to edit.
// goctl 1.10.1
package threads_account
import (
"context"
"haixun-backend/internal/svc"
"haixun-backend/internal/types"
"github.com/zeromicro/go-zero/core/logx"
)
type GetThreadsAccountConnectionLogic struct {
logx.Logger
ctx context.Context
svcCtx *svc.ServiceContext
}
func NewGetThreadsAccountConnectionLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetThreadsAccountConnectionLogic {
return &GetThreadsAccountConnectionLogic{
Logger: logx.WithContext(ctx),
ctx: ctx,
svcCtx: svcCtx,
}
}
func (l *GetThreadsAccountConnectionLogic) GetThreadsAccountConnection(req *types.ThreadsAccountPath) (resp *types.ThreadsAccountConnectionData, err error) {
tenantID, uid, err := actorFrom(l.ctx)
if err != nil {
return nil, err
}
data, err := l.svcCtx.ThreadsAccount.GetConnection(l.ctx, tenantID, uid, req.ID)
if err != nil {
return nil, err
}
return toConnectionData(data), nil
}