diff --git a/proxy/noauthprobe/noauth_probe_service.go b/proxy/noauthprobe/noauth_probe_service.go index c88b048..2e66325 100644 --- a/proxy/noauthprobe/noauth_probe_service.go +++ b/proxy/noauthprobe/noauth_probe_service.go @@ -55,7 +55,7 @@ func NewNoAuthProbe(apikey string, ipAddress int64, hostName string, md int64) * } -func(as *NoAuthProbeService)Save(na *NoAuthProbe) (string, error) { +func(as *NoAuthProbeService)Regist(na *NoAuthProbe) (string, error) { out, err := utils.InvokeDBByModel("noauthProbe", "save", na, utils.MODEL_NOAUTHPROBE) @@ -99,7 +99,7 @@ func(as *NoAuthProbeService)CheckAuth(tempKey string) (string,error) { } -func(as *NoAuthProbeService)GetList(d *domain.Domain) (string,error) { +func(as *NoAuthProbeService)ReadAllByDomain(d *domain.Domain) (string,error) { out, err := utils.InvokeDBByModel("noauthProbe","findAllByDomain", d, utils.MODEL_DOMAIN); @@ -145,7 +145,7 @@ func (as *NoAuthProbeService)RequestAuth(np *NoAuthProbe, domainId int, desc str d := domain.Domain{} d.Id = json.Number(domainId) newAgent := probe.NewProbe("", "") - newone, err := probe.NewProbeService().Save(newAgent) + newone, err := probe.NewProbeService().Regist(newAgent) if err!= nil { return "", err } diff --git a/proxy/noauthprobe/noauth_probe_service_test.go b/proxy/noauthprobe/noauth_probe_service_test.go index 0a1673c..8707fcf 100644 --- a/proxy/noauthprobe/noauth_probe_service_test.go +++ b/proxy/noauthprobe/noauth_probe_service_test.go @@ -40,7 +40,7 @@ func TestCreateNoAuthAgent(t *testing.T) { nas := NewNoAuthProbeService() - out, err := nas.Save(na) + out, err := nas.Regist(na) if err != nil { t.Fatal(err) @@ -78,7 +78,7 @@ func TestNoAuthList(t *testing.T) { d := domain.Domain{} d.Id = "1" - out, err := nas.GetList(&d) + out, err := nas.ReadAllByDomain(&d) if err != nil { t.Fatal(err) diff --git a/proxy/probe/probe_service.go b/proxy/probe/probe_service.go index 1cdf742..2be6581 100644 --- a/proxy/probe/probe_service.go +++ b/proxy/probe/probe_service.go @@ -42,7 +42,7 @@ func NewProbe(probeKey string, encryptionKey string) *Probe { return na } -func (as *ProbeService) Save(p *Probe) (string, error) { +func (as *ProbeService) Regist(p *Probe) (string, error) { out, err := utils.InvokeDBByModel("probe", "save", p, utils.MODEL_PROBE) @@ -53,7 +53,7 @@ func (as *ProbeService) Save(p *Probe) (string, error) { return out, nil } -func (as *ProbeService) GetList(d *domain.Domain) (string, error) { +func (as *ProbeService) ReadAllByDomain(d *domain.Domain) (string, error) { out, err := utils.InvokeDBByModel("probe", "findAllByDomain", d, utils.MODEL_DOMAIN) diff --git a/proxy/probe/probe_service_test.go b/proxy/probe/probe_service_test.go index 7db7df5..7770bc0 100644 --- a/proxy/probe/probe_service_test.go +++ b/proxy/probe/probe_service_test.go @@ -20,7 +20,7 @@ func TestSaveProbe(t *testing.T) { ppp.Domain = &domain.Domain{Id:"1"} as := NewProbeService() - res, err := as.Save(ppp) + res, err := as.Regist(ppp) if err != nil { t.Log(res) } @@ -33,7 +33,7 @@ func TestListProbe(t *testing.T) { d := &domain.Domain{Id:"1"} - if res, err := as.GetList(d); err != nil { + if res, err := as.ReadAllByDomain(d); err != nil { t.Fatal(err) }else { t.Log(res) @@ -54,3 +54,8 @@ func TestReadProbeKey(t *testing.T) { t.Log(res) } + + +func TestDDDD(t *testing.T) { + +} \ No newline at end of file