package app

import (
	"common/net/grpc/service"
	"gateway/config"
	"gateway/internal/grpc_server/server"
)

// ModuleGrpcServer Grpc服务模块
type ModuleGrpcServer struct {
	server service.IService
}

func (m *ModuleGrpcServer) init() error {
	return nil
}

func (m *ModuleGrpcServer) start() error {
	m.server = server.NewServer(config.Get().Serve.Grpc.TTL)
	m.server.Init(config.Get().Serve.Grpc.Address, config.Get().Serve.Grpc.Port)
	return nil
}

func (m *ModuleGrpcServer) stop() error {
	m.server.Close()
	return nil
}
