fixed
return error
This commit is contained in:
@@ -52,7 +52,11 @@ func(as *NoAuthAgentService)SaveNoAuthAgent(na *NoAuthAgent) (string, error) {
|
||||
memMap := make(map[string]string)
|
||||
memMap["com.loafle.overflow.noauthagent.model.NoAuthAgent"] = string(bytes);
|
||||
|
||||
out := proxy.InvokeDB("noauthAgent", "create", memMap);
|
||||
out, err := proxy.InvokeDB("noauthAgent", "create", memMap);
|
||||
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
return out, nil;
|
||||
}
|
||||
@@ -71,7 +75,11 @@ func(as *NoAuthAgentService)CheckAuth(tempKey string) (string,error) {
|
||||
|
||||
memMap["com.loafle.overflow.noauthagent.model.NoAuthAgent"] = string(bytes);
|
||||
|
||||
out := proxy.InvokeDB("noauthAgent", "findByTempKey", memMap);
|
||||
out, err := proxy.InvokeDB("noauthAgent", "findByTempKey", memMap);
|
||||
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
nn := NoAuthAgent{}
|
||||
err = json.Unmarshal([]byte(out), &nn)
|
||||
@@ -98,16 +106,17 @@ func(as *NoAuthAgentService)GetNoAuthList(excludeStatus string) (string,error) {
|
||||
|
||||
memMap["com.loafle.overflow.noauthagent.model.NoAuthAgent"] = string(bytes);
|
||||
|
||||
out := proxy.InvokeDB("noauthAgent", "findAllByNoAuth", memMap);
|
||||
out, err := proxy.InvokeDB("noauthAgent", "findAllByNoAuth", memMap);
|
||||
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
|
||||
return out,nil;
|
||||
}
|
||||
|
||||
|
||||
func (as *NoAuthAgentService) GetModel() (interface{}) {
|
||||
return NewNoAuthAgent("", 0, "")
|
||||
}
|
||||
|
||||
func (as *NoAuthAgentService)RequestAuth(noauthAgt NoAuthAgent, memberId, desc string) (string, error) {
|
||||
paramMap := make(map[string]string)
|
||||
@@ -118,7 +127,12 @@ func (as *NoAuthAgentService)RequestAuth(noauthAgt NoAuthAgent, memberId, desc s
|
||||
return "", err;
|
||||
}
|
||||
paramMap["com.loafle.overflow.noauthagent.model.NoAuthAgent"] = string(bytes)
|
||||
out := proxy.InvokeDB("noauthAgent", "update", paramMap)
|
||||
out, err := proxy.InvokeDB("noauthAgent", "update", paramMap)
|
||||
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
if len(out) == 0 {
|
||||
return "", errors.New("Cannot update Agent. ")
|
||||
}
|
||||
@@ -136,7 +150,11 @@ func (as *NoAuthAgentService)RequestAuth(noauthAgt NoAuthAgent, memberId, desc s
|
||||
func (as *NoAuthAgentService)ReadNoAuthAgent(id string) (string, error){
|
||||
mm := make(map[string]string)
|
||||
mm["id"] = id
|
||||
out := proxy.InvokeDB("noauthAgent", "find", mm)
|
||||
out, err := proxy.InvokeDB("noauthAgent", "find", mm)
|
||||
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
return out, nil
|
||||
}
|
||||
Reference in New Issue
Block a user