parent
54b651765b
commit
1d4b5960d2
@ -1,39 +0,0 @@
|
||||
.PHONY: all build run gotool install clean help
|
||||
|
||||
NAME=open_im_office
|
||||
BIN_DIR=../../../bin/
|
||||
|
||||
OS:= $(or $(os),linux)
|
||||
ARCH:=$(or $(arch),amd64)
|
||||
all: gotool build
|
||||
|
||||
ifeq ($(OS),windows)
|
||||
|
||||
BINARY_NAME=${NAME}.exe
|
||||
|
||||
else
|
||||
|
||||
BINARY_NAME=${NAME}
|
||||
|
||||
endif
|
||||
|
||||
build:
|
||||
CGO_ENABLED=0 GOOS=${OS} GOARCH=${ARCH}; go build -ldflags="-w -s" -o ${BINARY_NAME}
|
||||
|
||||
run:
|
||||
@go run ./
|
||||
|
||||
gotool:
|
||||
go fmt ./
|
||||
go vet ./
|
||||
|
||||
install:build
|
||||
mv ${BINARY_NAME} ${BIN_DIR}
|
||||
|
||||
clean:
|
||||
@if [ -f ${BINARY_NAME} ] ; then rm ${BINARY_NAME} ; fi
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -1,19 +0,0 @@
|
||||
package office
|
||||
|
||||
import (
|
||||
"github.com/OpenIMSDK/Open-IM-Server/internal/rpc/office"
|
||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/cmd"
|
||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
|
||||
)
|
||||
|
||||
func main() {
|
||||
rpcCmd := cmd.NewRpcCmd("office")
|
||||
rpcCmd.AddPortFlag()
|
||||
rpcCmd.AddPrometheusPortFlag()
|
||||
if err := rpcCmd.Exec(); err != nil {
|
||||
panic(err.Error())
|
||||
}
|
||||
if err := rpcCmd.StartSvr(config.Config.RpcRegisterName.OpenImOfficeName, office.Start); err != nil {
|
||||
panic(err.Error())
|
||||
}
|
||||
}
|
@ -1,25 +0,0 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/config"
|
||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/discoveryregistry"
|
||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/proto/office"
|
||||
"google.golang.org/grpc"
|
||||
)
|
||||
|
||||
func NewOffice(c discoveryregistry.SvcDiscoveryRegistry) *Office {
|
||||
conn, err := c.GetConn(context.Background(), config.Config.RpcRegisterName.OpenImOfficeName)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return &Office{conn: conn}
|
||||
}
|
||||
|
||||
type Office struct {
|
||||
conn *grpc.ClientConn
|
||||
}
|
||||
|
||||
func (o *Office) client(ctx context.Context) (office.OfficeClient, error) {
|
||||
return office.NewOfficeClient(o.conn), nil
|
||||
}
|
@ -1,119 +0,0 @@
|
||||
package office
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/controller"
|
||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/unrelation"
|
||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/discoveryregistry"
|
||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/proto/office"
|
||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient"
|
||||
"google.golang.org/grpc"
|
||||
)
|
||||
|
||||
func Start(client discoveryregistry.SvcDiscoveryRegistry, server *grpc.Server) error {
|
||||
mongo, err := unrelation.NewMongo()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
//rdb, err := cache.NewRedis()
|
||||
//if err != nil {
|
||||
// return err
|
||||
//}
|
||||
office.RegisterOfficeServer(server, &officeServer{
|
||||
officeDatabase: controller.NewOfficeDatabase(mongo),
|
||||
msgRpcClient: rpcclient.NewMsgClient(client),
|
||||
user: rpcclient.NewUserClient(client),
|
||||
})
|
||||
return nil
|
||||
}
|
||||
|
||||
type officeServer struct {
|
||||
officeDatabase controller.OfficeDatabase
|
||||
user *rpcclient.UserClient
|
||||
msgRpcClient *rpcclient.MsgClient
|
||||
}
|
||||
|
||||
func (o *officeServer) GetUserTags(ctx context.Context, req *office.GetUserTagsReq) (*office.GetUserTagsResp, error) {
|
||||
//TODO implement me
|
||||
panic("implement me")
|
||||
}
|
||||
|
||||
func (o *officeServer) CreateTag(ctx context.Context, req *office.CreateTagReq) (*office.CreateTagResp, error) {
|
||||
//TODO implement me
|
||||
panic("implement me")
|
||||
}
|
||||
|
||||
func (o *officeServer) DeleteTag(ctx context.Context, req *office.DeleteTagReq) (*office.DeleteTagResp, error) {
|
||||
//TODO implement me
|
||||
panic("implement me")
|
||||
}
|
||||
|
||||
func (o *officeServer) SetTag(ctx context.Context, req *office.SetTagReq) (*office.SetTagResp, error) {
|
||||
//TODO implement me
|
||||
panic("implement me")
|
||||
}
|
||||
|
||||
func (o *officeServer) SendMsg2Tag(ctx context.Context, req *office.SendMsg2TagReq) (*office.SendMsg2TagResp, error) {
|
||||
//TODO implement me
|
||||
panic("implement me")
|
||||
}
|
||||
|
||||
func (o *officeServer) GetTagSendLogs(ctx context.Context, req *office.GetTagSendLogsReq) (*office.GetTagSendLogsResp, error) {
|
||||
//TODO implement me
|
||||
panic("implement me")
|
||||
}
|
||||
|
||||
func (o *officeServer) GetUserTagByID(ctx context.Context, req *office.GetUserTagByIDReq) (*office.GetUserTagByIDResp, error) {
|
||||
//TODO implement me
|
||||
panic("implement me")
|
||||
}
|
||||
|
||||
func (o *officeServer) CreateOneWorkMoment(ctx context.Context, req *office.CreateOneWorkMomentReq) (*office.CreateOneWorkMomentResp, error) {
|
||||
//TODO implement me
|
||||
panic("implement me")
|
||||
}
|
||||
|
||||
func (o *officeServer) DeleteOneWorkMoment(ctx context.Context, req *office.DeleteOneWorkMomentReq) (*office.DeleteOneWorkMomentResp, error) {
|
||||
//TODO implement me
|
||||
panic("implement me")
|
||||
}
|
||||
|
||||
func (o *officeServer) LikeOneWorkMoment(ctx context.Context, req *office.LikeOneWorkMomentReq) (*office.LikeOneWorkMomentResp, error) {
|
||||
//TODO implement me
|
||||
panic("implement me")
|
||||
}
|
||||
|
||||
func (o *officeServer) CommentOneWorkMoment(ctx context.Context, req *office.CommentOneWorkMomentReq) (*office.CommentOneWorkMomentResp, error) {
|
||||
//TODO implement me
|
||||
panic("implement me")
|
||||
}
|
||||
|
||||
func (o *officeServer) DeleteComment(ctx context.Context, req *office.DeleteCommentReq) (*office.DeleteCommentResp, error) {
|
||||
//TODO implement me
|
||||
panic("implement me")
|
||||
}
|
||||
|
||||
func (o *officeServer) GetWorkMomentByID(ctx context.Context, req *office.GetWorkMomentByIDReq) (*office.GetWorkMomentByIDResp, error) {
|
||||
//TODO implement me
|
||||
panic("implement me")
|
||||
}
|
||||
|
||||
func (o *officeServer) ChangeWorkMomentPermission(ctx context.Context, req *office.ChangeWorkMomentPermissionReq) (*office.ChangeWorkMomentPermissionResp, error) {
|
||||
//TODO implement me
|
||||
panic("implement me")
|
||||
}
|
||||
|
||||
func (o *officeServer) GetUserWorkMoments(ctx context.Context, req *office.GetUserWorkMomentsReq) (*office.GetUserWorkMomentsResp, error) {
|
||||
//TODO implement me
|
||||
panic("implement me")
|
||||
}
|
||||
|
||||
func (o *officeServer) GetUserFriendWorkMoments(ctx context.Context, req *office.GetUserFriendWorkMomentsReq) (*office.GetUserFriendWorkMomentsResp, error) {
|
||||
//TODO implement me
|
||||
panic("implement me")
|
||||
}
|
||||
|
||||
func (o *officeServer) SetUserWorkMomentsLevel(ctx context.Context, req *office.SetUserWorkMomentsLevelReq) (*office.SetUserWorkMomentsLevelResp, error) {
|
||||
//TODO implement me
|
||||
panic("implement me")
|
||||
}
|
@ -1,18 +0,0 @@
|
||||
package controller
|
||||
|
||||
import (
|
||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/unrelation"
|
||||
)
|
||||
|
||||
func NewOfficeDatabase(mgo *unrelation.Mongo) OfficeDatabase {
|
||||
return &officeDatabase{mgo: mgo}
|
||||
}
|
||||
|
||||
type OfficeDatabase interface {
|
||||
// table.unrelation.office.go
|
||||
// unrelation.office.go
|
||||
}
|
||||
|
||||
type officeDatabase struct {
|
||||
mgo *unrelation.Mongo
|
||||
}
|
@ -1 +0,0 @@
|
||||
package unrelation
|
@ -1 +0,0 @@
|
||||
package unrelation
|
@ -1,15 +0,0 @@
|
||||
|
||||
all_proto=(
|
||||
wrapperspb/wrapperspb.proto
|
||||
auth/auth.proto
|
||||
friend/friend.proto
|
||||
group/group.proto
|
||||
user/user.proto
|
||||
rtc/rtc.proto
|
||||
msg/msg.proto
|
||||
push/push.proto
|
||||
msggateway/msg_gateway.proto
|
||||
sdkws/ws.proto
|
||||
conversation/conversation.proto
|
||||
third/third.proto
|
||||
)
|
Loading…
Reference in new issue