diff --git a/gateway/services.go b/gateway/services.go index 49f29b8..0c8c261 100644 --- a/gateway/services.go +++ b/gateway/services.go @@ -20,6 +20,7 @@ import ( "git.loafle.net/overflow/overflow_proxy_service/proxy/sensorItemCategory" "git.loafle.net/overflow/overflow_proxy_service/proxy/sensorItemMapping" "log" + "git.loafle.net/overflow/overflow_proxy_service/proxy/agent" ) var g_services map[string]interface{} @@ -43,6 +44,7 @@ func InitServices() { //AddServices("Agent", agent.NewAgentService()) AddServices("Member", member.NewMemberService()) AddServices("NoAuthAgent", noauthagent.NewNoAuthAgentService()) + AddServices("Agent", agent.NewAgentService()) AddServices("Target", target.NewTargetService()) AddServices("Crawler", crawler.NewCrawlerService()) AddServices("CrawlerInputItem", crawlerInputItem.NewCrawlerInputItemService()) @@ -67,8 +69,17 @@ func (s *ServiceImpl) ExecServices(c context.Context, in *pb.ServiceInput) (*pb. return nil, errors.New("Not Exist Service Name") } + + + pbs := &pb.ServiceOutput{} methodName := reflect.ValueOf(serviceName).MethodByName(in.MethodName) + + + if methodName.IsValid() == false { + return pbs, errors.New("Not Exist Method Name") + } + params := make([]reflect.Value, methodName.Type().NumIn()) var NewObj reflect.Value