Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
teamgramio committed Mar 1, 2022
1 parent 98062d2 commit 4a6a195
Show file tree
Hide file tree
Showing 44 changed files with 1,330 additions and 3,134 deletions.
1 change: 0 additions & 1 deletion app/bff/bff/internal/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,6 @@ func (s *Server) Initialize() error {
MessageClient: c.BizServiceClient,
MediaClient: c.MediaClient,
UsernameClient: c.BizServiceClient,
WebpageClient: c.BizServiceClient,
SyncClient: c.SyncClient,
}))

Expand Down
1 change: 0 additions & 1 deletion app/bff/messages/internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,5 @@ type Config struct {
MessageClient zrpc.RpcClientConf
MediaClient zrpc.RpcClientConf
UsernameClient zrpc.RpcClientConf
WebpageClient zrpc.RpcClientConf
SyncClient *kafka.KafkaProducerConf
}
21 changes: 10 additions & 11 deletions app/bff/messages/internal/core/core_messages_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import (
"github.com/teamgram/proto/mtproto"
userpb "github.com/teamgram/teamgram-server/app/service/biz/user/user"
"github.com/teamgram/teamgram-server/app/service/biz/username/username"
webpagepb "github.com/teamgram/teamgram-server/app/service/biz/webpage/webpage"
mediapb "github.com/teamgram/teamgram-server/app/service/media/media"
"github.com/teamgram/teamgram-server/pkg/mention"
"github.com/teamgram/teamgram-server/pkg/phonenumber"
Expand Down Expand Up @@ -388,16 +387,16 @@ func (c *MessagesCore) fixMessageEntities(fromId int64, peer *mtproto.PeerUtil,
}

if canEmbedLink {
// TODO(@benqi): disable
if webpage, err := c.svcCtx.Dao.WebpageClient.WebpageGetWebPagePreview(c.ctx, &webpagepb.TLWebpageGetWebPagePreview{
Message: firstUrl,
}); err != nil {
// nil
} else {
message.Media = mtproto.MakeTLMessageMediaWebPage(&mtproto.MessageMedia{
Webpage: webpage,
}).To_MessageMedia()
}
//// TODO(@benqi): disable
//if webpage, err := c.svcCtx.Dao.WebpageClient.WebpageGetWebPagePreview(c.ctx, &webpagepb.TLWebpageGetWebPagePreview{
// Message: firstUrl,
//}); err != nil {
// // nil
//} else {
// message.Media = mtproto.MakeTLMessageMediaWebPage(&mtproto.MessageMedia{
// Webpage: webpage,
// }).To_MessageMedia()
//}
}
}

Expand Down
3 changes: 0 additions & 3 deletions app/bff/messages/internal/dao/dao.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import (
message_client "github.com/teamgram/teamgram-server/app/service/biz/message/client"
user_client "github.com/teamgram/teamgram-server/app/service/biz/user/client"
username_client "github.com/teamgram/teamgram-server/app/service/biz/username/client"
webpage_client "github.com/teamgram/teamgram-server/app/service/biz/webpage/client"
idgen_client "github.com/teamgram/teamgram-server/app/service/idgen/client"
media_client "github.com/teamgram/teamgram-server/app/service/media/client"
)
Expand All @@ -39,7 +38,6 @@ type Dao struct {
user_client.UserClient
chat_client.ChatClient
media_client.MediaClient
webpage_client.WebpageClient
username_client.UsernameClient
message_client.MessageClient
idgen_client.IDGenClient2
Expand All @@ -53,7 +51,6 @@ func New(c config.Config) *Dao {
UserClient: user_client.NewUserClient(rpcx.GetCachedRpcClient(c.UserClient)),
ChatClient: chat_client.NewChatClient(rpcx.GetCachedRpcClient(c.ChatClient)),
MediaClient: media_client.NewMediaClient(rpcx.GetCachedRpcClient(c.MediaClient)),
WebpageClient: webpage_client.NewWebpageClient(rpcx.GetCachedRpcClient(c.WebpageClient)),
DialogClient: dialog_client.NewDialogClient(rpcx.GetCachedRpcClient(c.DialogClient)),
IDGenClient2: idgen_client.NewIDGenClient2(rpcx.GetCachedRpcClient(c.IdgenClient)),
MessageClient: message_client.NewMessageClient(rpcx.GetCachedRpcClient(c.MessageClient)),
Expand Down
11 changes: 1 addition & 10 deletions app/service/biz/biz/internal/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ import (
"github.com/teamgram/teamgram-server/app/service/biz/user/user"
username_helper "github.com/teamgram/teamgram-server/app/service/biz/username"
"github.com/teamgram/teamgram-server/app/service/biz/username/username"
webpage_helper "github.com/teamgram/teamgram-server/app/service/biz/webpage"
"github.com/teamgram/teamgram-server/app/service/biz/webpage/webpage"

"github.com/zeromicro/go-zero/core/conf"
"github.com/zeromicro/go-zero/core/logx"
"github.com/zeromicro/go-zero/zrpc"
Expand Down Expand Up @@ -141,14 +140,6 @@ func (s *Server) Initialize() error {
Mysql: c.Mysql,
Cache: c.Cache,
}))

// webpage_helper
webpage.RegisterRPCWebpageServer(
grpcServer,
webpage_helper.New(webpage_helper.Config{
RpcServerConf: c.RpcServerConf,
Mysql: c.Mysql,
}))
})

// logx.Must(err)
Expand Down
29 changes: 0 additions & 29 deletions app/service/biz/search/cmd/search/main.go

This file was deleted.

10 changes: 0 additions & 10 deletions app/service/biz/search/etc/search.yaml

This file was deleted.

25 changes: 0 additions & 25 deletions app/service/biz/search/helper.go

This file was deleted.

27 changes: 0 additions & 27 deletions app/service/biz/search/internal/config/config.go

This file was deleted.

37 changes: 0 additions & 37 deletions app/service/biz/search/internal/core/core.go

This file was deleted.

26 changes: 0 additions & 26 deletions app/service/biz/search/internal/dao/dao.go

This file was deleted.

38 changes: 0 additions & 38 deletions app/service/biz/search/internal/server/grpc/grpc.go

This file was deleted.

33 changes: 0 additions & 33 deletions app/service/biz/search/internal/server/grpc/service/service.go

This file was deleted.

62 changes: 0 additions & 62 deletions app/service/biz/search/internal/server/server.go

This file was deleted.

Loading

0 comments on commit 4a6a195

Please sign in to comment.