achievement.go
4.7 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
package protocol
import "time"
const (
Grasper = 1 //把握人
Provider = 2 //提供者
)
//成果项
type AchievementItem struct {
Id int64 `json:"id"`
CreateTime int64 `json:"createTime"`
Provider *BaseUserInfo `json:"provider"`
Content string `json:"content"`
Pictures []Picture `json:"pictures"`
//GraspScore float64 `json:"graspScore"` //把握分
//GraspScorePercent float64 `json:"graspScorePercent"` //把握分百分比
}
type GraspScore struct {
GraspScore float64 `json:"graspScore"` //把握分
GraspScorePercent float64 `json:"graspScorePercent"` //把握分百分比
}
//机会列表 通用项
type AchievementCommonListItem struct {
Achievement AchievementItem `json:"achievement,omitempty"` //成果详情
StatisticData interface{} `json:"statisticData,omitempty"` //统计数据(是否收藏/点赞 浏览数 点赞总数 评论数)ChanceData
//我审核的-通过
Score interface{} `json:"score,omitempty"`
GraspScore interface{} `json:"graspScore,omitempty"` //把握分
//模板
ChanceType interface{} `json:"chanceType,omitempty"` //机会类型
ChanceTemplate interface{} `json:"template,omitempty"` //机会模板
Message interface{} `json:"message,omitempty"` //消息
CommentData interface{} `json:"commentData,omitempty"` //评论
CollectData interface{} `json:"collectData,omitempty"` //收藏数据
ThumbUpData interface{} `json:"thumbUpData,omitempty"` //点赞数据
//我评论的 评论数据
CommentedData interface{} `json:"commentedData,omitempty"`
SourceType int `json:"sourceType,omitempty"` //类型 1:机会 2:评论
Status int `json:"-"` //0:删除 1:开启 2:关闭
}
/*AchievementPool 成果池*/
type AchievementPoolRequest struct {
UserId int64 `json:"userId"`
LastId int64 `json:"lastId"`
PageSize int `json:"pageSize" valid:"Required"`
ChanceTypeId int `json:"chanceTypeId"` //0:所有机会 编号:对应机会类型编号的机会
DepartmentId int `json:"departmentId"`
IncludeSubDepartment bool
}
type AchievementPoolResponse struct {
List []*AchievementCommonListItem `json:"list"`
Total int `json:"total"`
}
//通用 机会orm对象
type CommAchievementItemOrm struct {
AchievementItemOrm
StaticDataOrm
}
type AchievementItemOrm struct {
AchievementId int64 `orm:"column(id)"`
UserId int64 `orm:"column(user_company_id)"`
CreateTime time.Time `orm:"column(create_at)"`
SourceContent string `orm:"column(source_content)"`
Images string `orm:"column(images)"`
GraspScore float64 `orm:"column(grasp_score)"`
UserGraspScore float64 `orm:"column(user_grasp_score)"`
TemplateId int `orm:"column(audit_template_id)"`
ChanceTypeId int `orm:"column(chance_type_id)"`
Status int `orm:"column(status)"`
}
type StaticDataOrm struct {
CommentTotal int `orm:"column(comment_total)"`
ZanTotal int `orm:"column(zan_total)"`
ViewTotal int `orm:"column(view_total)"`
}
//机会池收藏列表项
//type AchievementsOrm struct {
// CommAchievementItemOrm
//}
/*MyGrasp 我把握的*/
type MyGraspRequest struct {
AchievementPoolRequest
}
type MyGraspResponse struct {
AchievementPoolResponse
}
/*AchievementDetail 成果详情*/
type AchievementDetailRequest struct {
Id int64 `json:"id" valid:"Required"`
}
type AchievementDetailResponse struct {
Achievement AchievementItem `json:"achievement,omitempty"` //成果详情
GraspScore interface{} `json:"graspScore,omitempty"` //把握分
StatisticData interface{} `json:"statisticData,omitempty"` //统计数据(是否收藏/点赞 浏览数 点赞总数 评论数
//模板
ChanceType interface{} `json:"chanceType,omitempty"` //机会类型
ChanceTemplate interface{} `json:"template,omitempty"` //机会模板
Status int `json:"-"` //0:删除 1:开启 2:关闭
SourceChance []*CommonListItem `json:"sourceChance"` //机会来源
Participants []UserGraspInfo `json:"participants"` //参与人
}
type UserGraspInfo struct {
Provider *BaseUserInfo `json:"provider"`
GraspScore GraspScore `json:"graspScore"` //把握分
//GraspScorePercent float64 `json:"graspScorePercent"` //把握分百分比
Type int `json:"type"` //1:把握人 2:提供者
}
type SourceChanceItemOrm struct {
CommChanceItemOrm
TemplateId int `orm:"column(audit_template_id)"`
ChanceTypeId int `orm:"column(chance_type_id)"`
}
/*MyGraspStatistic */
type MyGraspStatisticRequest struct {
}
type MyGraspStatisticResponse struct {
GraspStatistic interface{} `json:"list"`
}