changed
pacaget
agent -> probe
This commit is contained in:
@@ -10,15 +10,15 @@ import (
|
||||
"errors"
|
||||
)
|
||||
|
||||
type NoAuthAgentService struct {
|
||||
type NoAuthProbeService struct {
|
||||
}
|
||||
|
||||
func NewNoAuthAgentService() *NoAuthAgentService {
|
||||
return &NoAuthAgentService{}
|
||||
func NewNoAuthAgentService() *NoAuthProbeService {
|
||||
return &NoAuthProbeService{}
|
||||
}
|
||||
|
||||
|
||||
type NoAuthAgent struct {
|
||||
type NoAuthProbe struct {
|
||||
Id json.Number `json:"id,Number,omitempty"`
|
||||
TempKey string `json:"tempKey,omitempty"`
|
||||
Date timestamp.Timestamp`json:"date,omitempty"`
|
||||
@@ -29,9 +29,9 @@ type NoAuthAgent struct {
|
||||
}
|
||||
|
||||
|
||||
func NewNoAuthAgent(apikey string, localIp int64, hostName string) *NoAuthAgent {
|
||||
func NewNoAuthAgent(apikey string, localIp int64, hostName string) *NoAuthProbe {
|
||||
|
||||
na := &NoAuthAgent{
|
||||
na := &NoAuthProbe{
|
||||
Date:timestamp.Now(),
|
||||
ApiKey:apikey,
|
||||
LocalIP:localIp,
|
||||
@@ -41,7 +41,7 @@ func NewNoAuthAgent(apikey string, localIp int64, hostName string) *NoAuthAgent
|
||||
}
|
||||
|
||||
|
||||
func(as *NoAuthAgentService)SaveNoAuthAgent(na *NoAuthAgent) (string, error) {
|
||||
func(as *NoAuthProbeService)SaveNoAuthAgent(na *NoAuthProbe) (string, error) {
|
||||
|
||||
|
||||
bytes, err := json.Marshal(na)
|
||||
@@ -50,7 +50,7 @@ func(as *NoAuthAgentService)SaveNoAuthAgent(na *NoAuthAgent) (string, error) {
|
||||
}
|
||||
|
||||
memMap := make(map[string]string)
|
||||
memMap["com.loafle.overflow.noauthprobe.model.NoAuthAgent"] = string(bytes);
|
||||
memMap["com.loafle.overflow.noauthprobe.model.NoAuthProbe"] = string(bytes);
|
||||
|
||||
out, err := proxy.InvokeDB("noauthAgent", "create", memMap);
|
||||
|
||||
@@ -61,7 +61,7 @@ func(as *NoAuthAgentService)SaveNoAuthAgent(na *NoAuthAgent) (string, error) {
|
||||
return out, nil;
|
||||
}
|
||||
|
||||
func(as *NoAuthAgentService)CheckAuth(tempKey string) (string,error) {
|
||||
func(as *NoAuthProbeService)CheckAuth(tempKey string) (string,error) {
|
||||
|
||||
memMap := make(map[string]string)
|
||||
|
||||
@@ -73,7 +73,7 @@ func(as *NoAuthAgentService)CheckAuth(tempKey string) (string,error) {
|
||||
return "", err;
|
||||
}
|
||||
|
||||
memMap["com.loafle.overflow.noauthprobe.model.NoAuthAgent"] = string(bytes);
|
||||
memMap["com.loafle.overflow.noauthprobe.model.NoAuthProbe"] = string(bytes);
|
||||
|
||||
out, err := proxy.InvokeDB("noauthAgent", "findByTempKey", memMap);
|
||||
|
||||
@@ -81,7 +81,7 @@ func(as *NoAuthAgentService)CheckAuth(tempKey string) (string,error) {
|
||||
return "", err
|
||||
}
|
||||
|
||||
nn := NoAuthAgent{}
|
||||
nn := NoAuthProbe{}
|
||||
err = json.Unmarshal([]byte(out), &nn)
|
||||
|
||||
if err != nil {
|
||||
@@ -92,7 +92,7 @@ func(as *NoAuthAgentService)CheckAuth(tempKey string) (string,error) {
|
||||
}
|
||||
|
||||
|
||||
func(as *NoAuthAgentService)GetNoAuthList(excludeStatus string) (string,error) {
|
||||
func(as *NoAuthProbeService)GetNoAuthList(excludeStatus string) (string,error) {
|
||||
|
||||
memMap := make(map[string]string)
|
||||
|
||||
@@ -104,7 +104,7 @@ func(as *NoAuthAgentService)GetNoAuthList(excludeStatus string) (string,error) {
|
||||
return "", err;
|
||||
}
|
||||
|
||||
memMap["com.loafle.overflow.noauthprobe.model.NoAuthAgent"] = string(bytes);
|
||||
memMap["com.loafle.overflow.noauthprobe.model.NoAuthProbe"] = string(bytes);
|
||||
|
||||
out, err := proxy.InvokeDB("noauthAgent", "findAllByNoAuth", memMap);
|
||||
|
||||
@@ -118,7 +118,7 @@ func(as *NoAuthAgentService)GetNoAuthList(excludeStatus string) (string,error) {
|
||||
|
||||
|
||||
|
||||
func (as *NoAuthAgentService)RequestAuth(noauthAgt NoAuthAgent, memberId, desc string) (string, error) {
|
||||
func (as *NoAuthProbeService)RequestAuth(noauthAgt NoAuthProbe, memberId, desc string) (string, error) {
|
||||
paramMap := make(map[string]string)
|
||||
noauthAgt.AuthStatus = "ACCEPT"
|
||||
|
||||
@@ -126,7 +126,7 @@ func (as *NoAuthAgentService)RequestAuth(noauthAgt NoAuthAgent, memberId, desc s
|
||||
if err != nil {
|
||||
return "", err;
|
||||
}
|
||||
paramMap["com.loafle.overflow.noauthprobe.model.NoAuthAgent"] = string(bytes)
|
||||
paramMap["com.loafle.overflow.noauthprobe.model.NoAuthProbe"] = string(bytes)
|
||||
out, err := proxy.InvokeDB("noauthAgent", "update", paramMap)
|
||||
|
||||
if err != nil {
|
||||
@@ -134,7 +134,7 @@ func (as *NoAuthAgentService)RequestAuth(noauthAgt NoAuthAgent, memberId, desc s
|
||||
}
|
||||
|
||||
if len(out) == 0 {
|
||||
return "", errors.New("Cannot update Agent. ")
|
||||
return "", errors.New("Cannot update Probe. ")
|
||||
}
|
||||
m := member.Member{}
|
||||
m.Id = json.Number(memberId)
|
||||
@@ -147,7 +147,7 @@ func (as *NoAuthAgentService)RequestAuth(noauthAgt NoAuthAgent, memberId, desc s
|
||||
return newone, nil
|
||||
}
|
||||
|
||||
func (as *NoAuthAgentService)ReadNoAuthAgent(id string) (string, error){
|
||||
func (as *NoAuthProbeService)ReadNoAuthAgent(id string) (string, error){
|
||||
mm := make(map[string]string)
|
||||
mm["id"] = id
|
||||
out, err := proxy.InvokeDB("noauthAgent", "find", mm)
|
||||
|
||||
Reference in New Issue
Block a user