package
This commit is contained in:
snoop 2017-05-30 12:13:26 +09:00
parent 8a85b63562
commit 05400007b2
4 changed files with 15 additions and 12 deletions

3
.gitignore vendored
View File

@ -58,4 +58,5 @@ fabric.properties
# Project-local glide cache, RE: https://github.com/Masterminds/glide/issues/736 # Project-local glide cache, RE: https://github.com/Masterminds/glide/issues/736
.glide/ .glide/
.idea/
*.iml

View File

@ -1,8 +1,9 @@
package proxy package member
import ( import (
"encoding/json" "encoding/json"
"git.loafle.net/overflow/encryption_go" "git.loafle.net/overflow/encryption_go"
"git.loafle.net/overflow/overflow_proxy_service/proxy"
"log" "log"
) )
@ -69,7 +70,7 @@ func (m *MemberService) Regist() string {
m.Digest = digest m.Digest = digest
memMap := m.getMemberMap() memMap := m.getMemberMap()
re := invokeDB(TARGET_DAO, "create", memMap) re := proxy.InvokeDB(TARGET_DAO, "create", memMap)
return re return re
} }
@ -77,7 +78,7 @@ func (m *MemberService) Regist() string {
func (m *MemberService) ReadByEmail() string { func (m *MemberService) ReadByEmail() string {
log.Println("Call ReadByEmail", m.Email) log.Println("Call ReadByEmail", m.Email)
memMap := m.getMemberMap() memMap := m.getMemberMap()
re := invokeDB(TARGET_DAO, "findByEmail", memMap) re := proxy.InvokeDB(TARGET_DAO, "findByEmail", memMap)
return re return re
} }
@ -89,7 +90,7 @@ func (m *MemberService) Read() string {
mm := make(map[string]string) mm := make(map[string]string)
mm["id"] = string(m.Id) mm["id"] = string(m.Id)
log.Println("Read Member", m) log.Println("Read Member", m)
re := invokeDB(TARGET_DAO, "find", mm) re := proxy.InvokeDB(TARGET_DAO, "find", mm)
return re return re
} }
@ -100,7 +101,7 @@ func (m *MemberService) Modify() string {
m.Digest = "read" m.Digest = "read"
memMap := m.getMemberMap() memMap := m.getMemberMap()
re := invokeDB(TARGET_DAO, "update", memMap) re := proxy.InvokeDB(TARGET_DAO, "update", memMap)
return re return re
} }
@ -111,7 +112,7 @@ func (m *MemberService) Remove() string {
m.Digest = "read" m.Digest = "read"
memMap := m.getMemberMap() memMap := m.getMemberMap()
re := invokeDB(TARGET_DAO, "delete", memMap) re := proxy.InvokeDB(TARGET_DAO, "delete", memMap)
return re return re
} }

View File

@ -1,8 +1,9 @@
package proxy package member
import ( import (
"testing" "testing"
"log" "log"
"git.loafle.net/overflow/overflow_proxy_service/proxy"
) )
func TestMemberService_Login(t *testing.T) { func TestMemberService_Login(t *testing.T) {
@ -34,7 +35,7 @@ func TestMemberLogin(t *testing.T) {
func TestMemberService_Read(t *testing.T) { func TestMemberService_Read(t *testing.T) {
mm := make(map[string] string) mm := make(map[string] string)
mm["id"] = "12" mm["id"] = "12"
rr := invokeDB(TARGET_DAO, "find", mm) rr := proxy.InvokeDB(TARGET_DAO, "find", mm)
log.Println(rr) log.Println(rr)
} }
@ -45,7 +46,7 @@ func TestMemberService_ReadByEmail(t *testing.T) {
} }
mm := m.getMemberMap() mm := m.getMemberMap()
rr := invokeDB(TARGET_DAO, "findByEmail", mm) rr := proxy.InvokeDB(TARGET_DAO, "findByEmail", mm)
log.Println(rr) log.Println(rr)
} }
@ -56,6 +57,6 @@ func TestMemberUpdate(t *testing.T) {
} }
mm := m.getMemberMap() mm := m.getMemberMap()
rr := invokeDB(TARGET_DAO, "update", mm) rr := proxy.InvokeDB(TARGET_DAO, "update", mm)
log.Println(rr) log.Println(rr)
} }

View File

@ -7,7 +7,7 @@ import (
"golang.org/x/net/context" "golang.org/x/net/context"
) )
func invokeDB(targetDb, methodName string, param map[string]string) (string) { func InvokeDB(targetDb, methodName string, param map[string]string) (string) {
in := &pb.DBInput{} in := &pb.DBInput{}
in.TargetDao = targetDb in.TargetDao = targetDb