package probe import ( "encoding/json" //"fmt" //"git.loafle.net/overflow/overflow_service/proxy" "git.loafle.net/overflow/overflow_service/proxy/utils" "git.loafle.net/overflow/overflow_service/proxy/meta" "git.loafle.net/overflow/commons_go/model/timestamp" "git.loafle.net/overflow/overflow_service/proxy/domain" ) type ProbeService struct { } type Probe struct { Id json.Number `json:"id,Number,omitempty"` Status *meta.MetaNoAuthProbeStatus `json:"status,omitempty"` CreateDate timestamp.Timestamp `json:"createDate,omitempty"` LastPollingDate timestamp.Timestamp `json:"lastPollingDate,omitempty"` NextPollingDate timestamp.Timestamp `json:"nextPollingDate,omitempty"` Domain *domain.Domain `json:"domain,omitempty"` ProbeKey string `json:"probeKey,omitempty"` EncryptionKey string `json:"encryptionKey,omitempty"` } func NewProbeService() *ProbeService { return &ProbeService{} } func NewProbe(probeKey string, encryptionKey string) *Probe { na := &Probe{ Status:meta.NewMetaNoAuthProbeStatus(meta.PROBE_STATUS_PROCESS), ProbeKey:probeKey, EncryptionKey:encryptionKey, } return na } func (as *ProbeService) Save(p *Probe) (string, error) { out, err := utils.InvokeDBByModel("probe", "save", p, "com.loafle.overflow.module.probe.model.Probe") if err != nil { return "", err } return out, nil } func (as *ProbeService) GetList(d *domain.Domain) (string, error) { out, err := utils.InvokeDBByModel("probe", "findAgentListByMemberId", d, "com.loafle.overflow.module.domain.model.Domain") if err != nil { return "", err } return out, nil } func (as *ProbeService) GetModel() interface{} { return &Probe{} }