refactor
This commit is contained in:
@@ -6,8 +6,8 @@ import (
|
||||
|
||||
"github.com/jackc/pgx/v5/pgtype"
|
||||
|
||||
"github.com/TelegramExchange/tgex-parser/internal/domain"
|
||||
"github.com/TelegramExchange/tgex-parser/pkg/transaction"
|
||||
"github.com/TelegramExchange/pkg/transaction"
|
||||
"github.com/TelegramExchange/tgex-backend/tg_parser/internal/domain"
|
||||
)
|
||||
|
||||
func (d *Database) CreatePost(ctx context.Context, post domain.Post) error {
|
||||
|
||||
@@ -7,8 +7,8 @@ import (
|
||||
"github.com/google/uuid"
|
||||
"github.com/jackc/pgx/v5/pgtype"
|
||||
|
||||
"github.com/TelegramExchange/tgex-parser/internal/domain"
|
||||
"github.com/TelegramExchange/tgex-parser/pkg/transaction"
|
||||
"github.com/TelegramExchange/pkg/transaction"
|
||||
"github.com/TelegramExchange/tgex-backend/tg_parser/internal/domain"
|
||||
)
|
||||
|
||||
func (d *Database) CreateViewsSnapshot(ctx context.Context, snapshot domain.ViewsSnapshot) error {
|
||||
|
||||
@@ -6,8 +6,8 @@ import (
|
||||
|
||||
"github.com/jackc/pgx/v5/pgtype"
|
||||
|
||||
"github.com/TelegramExchange/tgex-parser/internal/domain"
|
||||
"github.com/TelegramExchange/tgex-parser/pkg/transaction"
|
||||
"github.com/TelegramExchange/pkg/transaction"
|
||||
"github.com/TelegramExchange/tgex-backend/tg_parser/internal/domain"
|
||||
)
|
||||
|
||||
func (d *Database) DeletePost(ctx context.Context, p domain.Post) error {
|
||||
|
||||
@@ -6,8 +6,8 @@ import (
|
||||
"github.com/jackc/pgx/v5/pgtype"
|
||||
"github.com/rs/zerolog/log"
|
||||
|
||||
"github.com/TelegramExchange/tgex-parser/internal/domain"
|
||||
"github.com/TelegramExchange/tgex-parser/pkg/transaction"
|
||||
"github.com/TelegramExchange/pkg/transaction"
|
||||
"github.com/TelegramExchange/tgex-backend/tg_parser/internal/domain"
|
||||
)
|
||||
|
||||
func (d *Database) GetChannels(ctx context.Context) []domain.Channel {
|
||||
|
||||
@@ -6,8 +6,8 @@ import (
|
||||
|
||||
"github.com/jackc/pgx/v5/pgtype"
|
||||
|
||||
"github.com/TelegramExchange/tgex-parser/internal/domain"
|
||||
"github.com/TelegramExchange/tgex-parser/pkg/transaction"
|
||||
"github.com/TelegramExchange/pkg/transaction"
|
||||
"github.com/TelegramExchange/tgex-backend/tg_parser/internal/domain"
|
||||
)
|
||||
|
||||
func (d *Database) GetChannelsWithTrackedPosts(ctx context.Context) ([]domain.Channel, error) {
|
||||
|
||||
@@ -6,8 +6,8 @@ import (
|
||||
|
||||
"github.com/jackc/pgx/v5/pgtype"
|
||||
|
||||
"github.com/TelegramExchange/tgex-parser/internal/domain"
|
||||
"github.com/TelegramExchange/tgex-parser/pkg/transaction"
|
||||
"github.com/TelegramExchange/pkg/transaction"
|
||||
"github.com/TelegramExchange/tgex-backend/tg_parser/internal/domain"
|
||||
)
|
||||
|
||||
func (d *Database) GetTrackedPosts(ctx context.Context, channel domain.Channel) ([]domain.Post, error) {
|
||||
|
||||
@@ -6,8 +6,8 @@ import (
|
||||
|
||||
"github.com/jackc/pgx/v5/pgtype"
|
||||
|
||||
"github.com/TelegramExchange/tgex-parser/internal/domain"
|
||||
"github.com/TelegramExchange/tgex-parser/pkg/transaction"
|
||||
"github.com/TelegramExchange/pkg/transaction"
|
||||
"github.com/TelegramExchange/tgex-backend/tg_parser/internal/domain"
|
||||
)
|
||||
|
||||
func (d *Database) UpdateChannel(ctx context.Context, channel domain.Channel) error {
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/TelegramExchange/tgex-parser/internal/domain"
|
||||
"github.com/TelegramExchange/tgex-backend/tg_parser/internal/domain"
|
||||
"github.com/gotd/td/tg"
|
||||
)
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/TelegramExchange/tgex-parser/internal/domain"
|
||||
"github.com/TelegramExchange/tgex-backend/tg_parser/internal/domain"
|
||||
"github.com/gotd/td/tg"
|
||||
)
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/TelegramExchange/tgex-parser/internal/domain"
|
||||
"github.com/TelegramExchange/tgex-backend/tg_parser/internal/domain"
|
||||
"github.com/gotd/td/tg"
|
||||
"github.com/rs/zerolog/log"
|
||||
)
|
||||
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/TelegramExchange/tgex-parser/internal/domain"
|
||||
"github.com/TelegramExchange/tgex-backend/tg_parser/internal/domain"
|
||||
"github.com/google/uuid"
|
||||
"github.com/gotd/td/tg"
|
||||
)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package telegram
|
||||
|
||||
import (
|
||||
"github.com/TelegramExchange/tgex-parser/pkg/telegram"
|
||||
"github.com/TelegramExchange/pkg/telegram"
|
||||
"github.com/gotd/td/tg"
|
||||
)
|
||||
|
||||
|
||||
@@ -12,15 +12,15 @@ import (
|
||||
|
||||
"github.com/rs/zerolog/log"
|
||||
|
||||
"github.com/TelegramExchange/tgex-parser/config"
|
||||
"github.com/TelegramExchange/tgex-parser/internal/adapter/database"
|
||||
tgadapter "github.com/TelegramExchange/tgex-parser/internal/adapter/telegram"
|
||||
"github.com/TelegramExchange/tgex-parser/internal/controller/httpserver"
|
||||
"github.com/TelegramExchange/tgex-parser/internal/controller/worker"
|
||||
"github.com/TelegramExchange/tgex-parser/internal/usecase"
|
||||
"github.com/TelegramExchange/tgex-parser/pkg/postgres"
|
||||
"github.com/TelegramExchange/tgex-parser/pkg/telegram"
|
||||
"github.com/TelegramExchange/tgex-parser/pkg/transaction"
|
||||
"github.com/TelegramExchange/pkg/postgres"
|
||||
"github.com/TelegramExchange/pkg/telegram"
|
||||
"github.com/TelegramExchange/pkg/transaction"
|
||||
"github.com/TelegramExchange/tgex-backend/tg_parser/config"
|
||||
"github.com/TelegramExchange/tgex-backend/tg_parser/internal/adapter/database"
|
||||
tgadapter "github.com/TelegramExchange/tgex-backend/tg_parser/internal/adapter/telegram"
|
||||
"github.com/TelegramExchange/tgex-backend/tg_parser/internal/controller/httpserver"
|
||||
"github.com/TelegramExchange/tgex-backend/tg_parser/internal/controller/worker"
|
||||
"github.com/TelegramExchange/tgex-backend/tg_parser/internal/usecase"
|
||||
)
|
||||
|
||||
func Run(ctx context.Context, c config.Config) error {
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
"github.com/TelegramExchange/tgex-parser/internal/usecase"
|
||||
"github.com/TelegramExchange/tgex-backend/tg_parser/internal/usecase"
|
||||
"github.com/gotd/td/tgerr"
|
||||
"github.com/rs/zerolog/log"
|
||||
)
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
|
||||
"github.com/rs/zerolog/log"
|
||||
|
||||
"github.com/TelegramExchange/tgex-parser/internal/usecase"
|
||||
"github.com/TelegramExchange/tgex-backend/tg_parser/internal/usecase"
|
||||
)
|
||||
|
||||
type ChannelConfig struct {
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
|
||||
"github.com/rs/zerolog/log"
|
||||
|
||||
"github.com/TelegramExchange/tgex-parser/internal/usecase"
|
||||
"github.com/TelegramExchange/tgex-backend/tg_parser/internal/usecase"
|
||||
)
|
||||
|
||||
type ViewsConfig struct {
|
||||
|
||||
@@ -3,7 +3,7 @@ package usecase
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/TelegramExchange/tgex-parser/internal/domain"
|
||||
"github.com/TelegramExchange/tgex-backend/tg_parser/internal/domain"
|
||||
)
|
||||
|
||||
func (uc *UseCase) FetchChannelMeta(ctx context.Context, username string) (domain.Channel, error) {
|
||||
|
||||
@@ -4,10 +4,10 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/TelegramExchange/tgex-parser/pkg/transaction"
|
||||
"github.com/TelegramExchange/pkg/transaction"
|
||||
"github.com/rs/zerolog/log"
|
||||
|
||||
"github.com/TelegramExchange/tgex-parser/internal/domain"
|
||||
"github.com/TelegramExchange/tgex-backend/tg_parser/internal/domain"
|
||||
)
|
||||
|
||||
func (uc *UseCase) FetchChannels(ctx context.Context) error {
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
|
||||
"github.com/rs/zerolog/log"
|
||||
|
||||
"github.com/TelegramExchange/tgex-parser/internal/domain"
|
||||
"github.com/TelegramExchange/tgex-backend/tg_parser/internal/domain"
|
||||
)
|
||||
|
||||
func (uc *UseCase) FetchViews(ctx context.Context) error {
|
||||
|
||||
@@ -3,7 +3,7 @@ package usecase
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/TelegramExchange/tgex-parser/internal/domain"
|
||||
"github.com/TelegramExchange/tgex-backend/tg_parser/internal/domain"
|
||||
)
|
||||
|
||||
type Telegram interface {
|
||||
|
||||
Reference in New Issue
Block a user