added
domain
This commit is contained in:
parent
d9cb144cea
commit
9f1f96a269
@ -3,6 +3,7 @@ package domain
|
|||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"loafle.com/overflow/commons_go/model/timestamp"
|
"loafle.com/overflow/commons_go/model/timestamp"
|
||||||
|
"git.loafle.net/overflow/overflow_service/proxy/utils"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Domain struct {
|
type Domain struct {
|
||||||
@ -23,8 +24,11 @@ func NewDomainService() *DomainService {
|
|||||||
|
|
||||||
func (d *DomainService)Create(dm *Domain) (string, error) {
|
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 str, nil
|
||||||
return "", nil
|
}
|
||||||
}
|
|
||||||
|
@ -1 +1,19 @@
|
|||||||
package domain
|
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)
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user