added
Agent Service return method not found
This commit is contained in:
parent
8c8aa1069a
commit
973877454a
|
@ -20,6 +20,7 @@ import (
|
||||||
"git.loafle.net/overflow/overflow_proxy_service/proxy/sensorItemCategory"
|
"git.loafle.net/overflow/overflow_proxy_service/proxy/sensorItemCategory"
|
||||||
"git.loafle.net/overflow/overflow_proxy_service/proxy/sensorItemMapping"
|
"git.loafle.net/overflow/overflow_proxy_service/proxy/sensorItemMapping"
|
||||||
"log"
|
"log"
|
||||||
|
"git.loafle.net/overflow/overflow_proxy_service/proxy/agent"
|
||||||
)
|
)
|
||||||
|
|
||||||
var g_services map[string]interface{}
|
var g_services map[string]interface{}
|
||||||
|
@ -43,6 +44,7 @@ func InitServices() {
|
||||||
//AddServices("Agent", agent.NewAgentService())
|
//AddServices("Agent", agent.NewAgentService())
|
||||||
AddServices("Member", member.NewMemberService())
|
AddServices("Member", member.NewMemberService())
|
||||||
AddServices("NoAuthAgent", noauthagent.NewNoAuthAgentService())
|
AddServices("NoAuthAgent", noauthagent.NewNoAuthAgentService())
|
||||||
|
AddServices("Agent", agent.NewAgentService())
|
||||||
AddServices("Target", target.NewTargetService())
|
AddServices("Target", target.NewTargetService())
|
||||||
AddServices("Crawler", crawler.NewCrawlerService())
|
AddServices("Crawler", crawler.NewCrawlerService())
|
||||||
AddServices("CrawlerInputItem", crawlerInputItem.NewCrawlerInputItemService())
|
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")
|
return nil, errors.New("Not Exist Service Name")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
pbs := &pb.ServiceOutput{}
|
pbs := &pb.ServiceOutput{}
|
||||||
methodName := reflect.ValueOf(serviceName).MethodByName(in.MethodName)
|
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())
|
params := make([]reflect.Value, methodName.Type().NumIn())
|
||||||
var NewObj reflect.Value
|
var NewObj reflect.Value
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user