cooperation_application.go
3.5 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
package domain
import "time"
// CooperationApplication 共创申请实体
type CooperationApplication struct {
// 共创申请ID
CooperationApplicationId int64 `json:"cooperationApplicationId,string"`
// 共创申请人
CooperationApplicationApplicant *User `json:"cooperationApplicationApplicant"`
// 共创申请描述附件
CooperationApplicationAttachment []*Attachment `json:"cooperationApplicationAttachment"`
// 共创申请描述
CooperationApplicationDescription string `json:"cooperationApplicationDescription"`
// 共创申请审核状态,1待审核,2已同意,3已拒绝
CooperationApplicationStatus int32 `json:"cooperationApplicationStatus"`
// 共创申请审核人
CooperationApplicationVerifier *User `json:"cooperationApplicationVerifier"`
// 共创申请审核描述
CooperationApplicationVerifyDescription string `json:"cooperationApplicationVerifyDescription"`
// 共创申请审核时间
CooperationApplicationVerifyTime time.Time `json:"cooperationApplicationVerifyTime"`
// 共创申请时间
CooperationApplyTime time.Time `json:"cooperationApplyTime"`
// 共创项目
CooperationProject *CooperationProject `json:"cooperationProject"`
// 数据所属组织机构
Org *Org `json:"org"`
// 是否被取消标志位
IsCanceled bool `json:"isCanceled"`
// 公司
Company *Company `json:"company"`
// 创建时间
CreatedAt time.Time `json:"createdAt"`
// 删除时间
DeletedAt time.Time `json:"deletedAt"`
// 更新时间
UpdatedAt time.Time `json:"updatedAt"`
}
type CooperationApplicationRepository interface {
Save(cooperationApplication *CooperationApplication) (*CooperationApplication, error)
UpdateMany(cooperationApplications []*CooperationApplication) ([]*CooperationApplication, error)
Remove(cooperationApplication *CooperationApplication) (*CooperationApplication, error)
FindOne(queryOptions map[string]interface{}) (*CooperationApplication, error)
Find(queryOptions map[string]interface{}) (int64, []*CooperationApplication, error)
}
func (cooperationApplication *CooperationApplication) Identify() interface{} {
if cooperationApplication.CooperationApplicationId == 0 {
return nil
}
return cooperationApplication.CooperationApplicationId
}
func (cooperationApplication *CooperationApplication) Update(data map[string]interface{}) error {
if isCanceled, ok := data["isCanceled"]; ok {
cooperationApplication.IsCanceled = isCanceled.(bool)
}
if cooperationApplicationAttachment, ok := data["cooperationApplicationAttachment"]; ok {
cooperationApplication.CooperationApplicationAttachment = cooperationApplicationAttachment.([]*Attachment)
}
if cooperationApplicationDescription, ok := data["cooperationApplicationDescription"]; ok {
cooperationApplication.CooperationApplicationDescription = cooperationApplicationDescription.(string)
}
if cooperationApplicationStatus, ok := data["cooperationApplicationStatus"]; ok {
cooperationApplication.CooperationApplicationStatus = cooperationApplicationStatus.(int32)
}
if cooperationApplicationVerifyDescription, ok := data["cooperationApplicationVerifyDescription"]; ok {
cooperationApplication.CooperationApplicationVerifyDescription = cooperationApplicationVerifyDescription.(string)
}
if cooperationApplicationVerifyTime, ok := data["cooperationApplicationVerifyTime"]; ok {
cooperationApplication.CooperationApplicationVerifyTime = cooperationApplicationVerifyTime.(time.Time)
}
if cooperationApplyTime, ok := data["cooperationApplyTime"]; ok {
cooperationApplication.CooperationApplyTime = cooperationApplyTime.(time.Time)
}
return nil
}