From 9f1f96a2697a1386a44b9f8777a34fa86553dcd4 Mon Sep 17 00:00:00 2001 From: snoop Date: Fri, 23 Jun 2017 17:37:56 +0900 Subject: [PATCH] added domain --- proxy/domain/domain_service.go | 10 +++++++--- proxy/domain/domain_service_test.go | 18 ++++++++++++++++++ 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/proxy/domain/domain_service.go b/proxy/domain/domain_service.go index f9e7b38..b53fd1e 100644 --- a/proxy/domain/domain_service.go +++ b/proxy/domain/domain_service.go @@ -3,6 +3,7 @@ package domain import ( "encoding/json" "loafle.com/overflow/commons_go/model/timestamp" + "git.loafle.net/overflow/overflow_service/proxy/utils" ) type Domain struct { @@ -23,8 +24,11 @@ func NewDomainService() *DomainService { func (d *DomainService)Create(dm *Domain) (string, error) { + str,err :=utils.InvokeDBByModel("domain", "save", dm, "com.loafle.overflow.module.domain.model.Domain") + if err != nil { + return "",err + } - - return "", nil -} \ No newline at end of file + return str, nil +} diff --git a/proxy/domain/domain_service_test.go b/proxy/domain/domain_service_test.go index 4188b5a..8b46501 100644 --- a/proxy/domain/domain_service_test.go +++ b/proxy/domain/domain_service_test.go @@ -1 +1,19 @@ package domain + +import "testing" + +func TestSave(t *testing.T) { + + d := Domain{} + + d.Name = "snoop's domain" + + + str,err := NewDomainService().Create(&d) + + if err != nil{ + t.Fatal(err) + } + + t.Log(str) +} \ No newline at end of file