added meta
This commit is contained in:
parent
f3cc480c33
commit
0ebafa5185
8
proxy/meta/meta_noauth_probe_status.go
Normal file
8
proxy/meta/meta_noauth_probe_status.go
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
package meta
|
||||||
|
|
||||||
|
import "encoding/json"
|
||||||
|
|
||||||
|
type MetaNoAuthProbeStatus struct {
|
||||||
|
Id json.Number `json:"id,Number,omitempty"`
|
||||||
|
Name string `json:"name,omitempty"`
|
||||||
|
}
|
@ -10,6 +10,7 @@ import (
|
|||||||
"git.loafle.net/overflow/overflow_service/proxy/domain"
|
"git.loafle.net/overflow/overflow_service/proxy/domain"
|
||||||
"errors"
|
"errors"
|
||||||
"git.loafle.net/overflow/overflow_service/proxy/utils"
|
"git.loafle.net/overflow/overflow_service/proxy/utils"
|
||||||
|
"git.loafle.net/overflow/overflow_service/proxy/meta"
|
||||||
)
|
)
|
||||||
|
|
||||||
type NoAuthProbeService struct {
|
type NoAuthProbeService struct {
|
||||||
@ -28,14 +29,14 @@ type NoAuthProbe struct {
|
|||||||
IpAddress int64 `json:"ipAddress,omitempty"`
|
IpAddress int64 `json:"ipAddress,omitempty"`
|
||||||
|
|
||||||
// P rocess, A ccept, D eny
|
// P rocess, A ccept, D eny
|
||||||
Status string `json:"status,omitempty"`
|
Status *meta.MetaNoAuthProbeStatus `json:"status,omitempty"`
|
||||||
|
|
||||||
TempProbeKey string `json:"tempProbeKey,omitempty"`
|
TempProbeKey string `json:"tempProbeKey,omitempty"`
|
||||||
|
|
||||||
CreateDate timestamp.Timestamp`json:"createDate,omitempty"`
|
CreateDate timestamp.Timestamp`json:"createDate,omitempty"`
|
||||||
ApiKey string `json:"apiKey,omitempty"`
|
ApiKey string `json:"apiKey,omitempty"`
|
||||||
Domain domain.Domain `json:"domain,omitempty"`
|
Domain *domain.Domain `json:"domain,omitempty"`
|
||||||
Probe probe.Probe `json:"probe,omitempty"`
|
Probe *probe.Probe `json:"probe,omitempty"`
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -55,17 +56,6 @@ func NewNoAuthProbe(apikey string, ipAddress int64, hostName string, md int64) *
|
|||||||
|
|
||||||
func(as *NoAuthProbeService)Save(na *NoAuthProbe) (string, error) {
|
func(as *NoAuthProbeService)Save(na *NoAuthProbe) (string, error) {
|
||||||
|
|
||||||
|
|
||||||
//bytes, err := json.Marshal(na)
|
|
||||||
//if err != nil {
|
|
||||||
// return "",err
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
//memMap := make(map[string]string)
|
|
||||||
//memMap["com.loafle.overflow.module.noauthprobe.model.NoAuthProbe"] = string(bytes);
|
|
||||||
//
|
|
||||||
//out, err := proxy.InvokeDB("noauthProbe", "save", memMap);
|
|
||||||
|
|
||||||
out, err := utils.InvokeDBByModel("noauthProbe", "save", na, "com.loafle.overflow.module.noauthprobe.model.NoAuthProbe")
|
out, err := utils.InvokeDBByModel("noauthProbe", "save", na, "com.loafle.overflow.module.noauthprobe.model.NoAuthProbe")
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -110,20 +100,6 @@ func(as *NoAuthProbeService)CheckAuth(tempKey string) (string,error) {
|
|||||||
|
|
||||||
func(as *NoAuthProbeService)GetList(d *domain.Domain) (string,error) {
|
func(as *NoAuthProbeService)GetList(d *domain.Domain) (string,error) {
|
||||||
|
|
||||||
//memMap := make(map[string]string)
|
|
||||||
//
|
|
||||||
//na := NewNoAuthProbe("", 0, "", 0)
|
|
||||||
//na.Status = excludeStatus
|
|
||||||
//
|
|
||||||
//bytes, err := json.Marshal(na)
|
|
||||||
//if err != nil {
|
|
||||||
// return "", err;
|
|
||||||
//}
|
|
||||||
//
|
|
||||||
//memMap["com.loafle.overflow.noauthprobe.model.NoAuthProbe"] = string(bytes);
|
|
||||||
//
|
|
||||||
//out, err := proxy.InvokeDB("noauthProbe", "findAllByNoAuth", memMap);
|
|
||||||
|
|
||||||
out, err := utils.InvokeDBByModel("noauthProbe","findAllByDomain", d, "com.loafle.overflow.module.domain.model.Domain");
|
out, err := utils.InvokeDBByModel("noauthProbe","findAllByDomain", d, "com.loafle.overflow.module.domain.model.Domain");
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -7,6 +7,7 @@ import (
|
|||||||
|
|
||||||
"git.loafle.net/overflow/overflow_service/proxy/domain"
|
"git.loafle.net/overflow/overflow_service/proxy/domain"
|
||||||
|
|
||||||
|
"git.loafle.net/overflow/overflow_service/proxy/meta"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@ -22,24 +23,32 @@ func TestCreateUUid(t *testing.T) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
//func TestCreateNoAuthAgent(t *testing.T) {
|
func TestCreateNoAuthAgent(t *testing.T) {
|
||||||
//
|
|
||||||
// na := NewNoAuthProbe("233421390283", 111, "Snoop")
|
na := NewNoAuthProbe("52abd6fd57e511e7ac52080027658d13", 3232235521, "Snoop2222", 8796753988883)
|
||||||
//
|
|
||||||
// na.TempKey = "1111111"
|
|
||||||
// na.AuthStatus = "WAIT"
|
ns := &meta.MetaNoAuthProbeStatus{}
|
||||||
//
|
ns.Id = "3"
|
||||||
// nas := NewNoAuthProbeService()
|
na.Status = ns
|
||||||
//
|
|
||||||
// out, err := nas.Save(na)
|
dd := &domain.Domain{}
|
||||||
//
|
dd.Id = "1"
|
||||||
// if err != nil {
|
|
||||||
// t.Fatal(err)
|
na.Domain = dd
|
||||||
// }
|
na.TempProbeKey = "6641ad705a2a11e7871c080027658d13"
|
||||||
//
|
|
||||||
// t.Log(out)
|
nas := NewNoAuthProbeService()
|
||||||
//
|
|
||||||
//}
|
out, err := nas.Save(na)
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
t.Log(out)
|
||||||
|
|
||||||
|
}
|
||||||
//
|
//
|
||||||
//func TestCheckAuthNoAuthAgent(t *testing.T) {
|
//func TestCheckAuthNoAuthAgent(t *testing.T) {
|
||||||
//
|
//
|
||||||
|
Loading…
x
Reference in New Issue
Block a user