organization_translator.go
1019 字节
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package translator
import (
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/domain"
"time"
)
type OrganizationTranslator struct {
}
type OrganizationDetail struct {
OrgId int64 `json:"orgId"`
CompanyId int64 `json:"companyId"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
DeletedAt time.Time `json:"deletedAt"`
OrgCode string `json:"orgCode"`
OrgName string `json:"orgName"`
Ext struct {
} `json:"ext"`
IsOrg int `json:"isOrg"`
OrgStatus int `json:"orgStatus"`
}
func (translator *OrganizationTranslator) ToOrganizationFromRepresentation(organization *OrganizationDetail) (*domain.Org, error) {
return &domain.Org{
OrgId: organization.OrgId,
OrgName: organization.OrgName,
Company: &domain.Company{
CompanyId: organization.CompanyId,
CompanyLogo: "",
CompanyName: "",
},
}, nil
}
func NewOrganizationTranslator() (*OrganizationTranslator, error) {
return &OrganizationTranslator{}, nil
}