35 lines
676 B
Go
35 lines
676 B
Go
package domain
|
|
|
|
import (
|
|
"encoding/json"
|
|
"git.loafle.net/overflow/commons_go/model/timestamp"
|
|
"git.loafle.net/overflow/overflow_service/proxy/utils"
|
|
)
|
|
|
|
type Domain struct {
|
|
Id json.Number `json:"id,Number,omitempty"`
|
|
Name string `json:"name,omitempty"`
|
|
CreateDate timestamp.Timestamp `json:"createDate,omitempty"`
|
|
}
|
|
|
|
|
|
type DomainService struct {
|
|
|
|
}
|
|
|
|
func NewDomainService() *DomainService {
|
|
return &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 str, nil
|
|
}
|