chance.go
8.6 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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
package protocol
import (
"opp/models"
"time"
)
//机会审核
//审核对象
const (
AuditByDepartmentor = iota + 1 //部门长
AuditByUser //指定用户
AuditByRole //指定角色
AuditBySpecailUser //特殊人员
)
const (
ActionTypeOr = 1
ActionTypeAnd = 2
)
//审核类型
const (
FlowTypeNormal = iota + 1 //正常审核流程
FlowTypeSpecail //特殊审核流程
)
//审核人为空
const (
NoApproverPass = 1 //自动通过
NoApproverToAdmin = 2 //转交给公司管理员
)
//机会
//审核状态
const (
ReviewStatusWait = 0 //待处理
ReviewStatusAuditging = 1 //待审核
ReviewStatusReturn = 2 //退回
ReviewStatusPass = 3 //通过
ReviewStatusSubmit = 4 //提交
)
//公开状态
const (
NoPublic = -1 //未公开
PublicToDepartment = 1 //部门公开
PublicToCompany = 2 //公司公开
)
const (
ChanceStatusDelete = 1 //删除
ChanceStatusClose = 2 //关闭
)
/*Favorite */
type FavoriteRequest struct {
ObjectType int `json:"object_type" valid:"Required"` //收藏 点赞
ChanceType int `json:"chance_type" valid:"Required"`
//TagId int `json:"tag_id"` //标签id
LastId int64 `json:"lastId"`
PageSize int `json:"pageSize" valid:"Required"`
}
type FavoriteResponse struct {
Total int `json:"total"`
Lists []*ChanceFavorite `json:"lists"`
}
type ChanceFavorite struct {
Id int64 `json:"id"`
Favorite interface{} `json:"favorite"`
}
type ChanceDetail struct {
Id int64 `json:"id"`
Provider *BaseUserInfo `json:"provider"`
IsCollect bool `json:"is_collect"`
IsZan bool `json:"is_zan"`
Content string `json:"content"`
ChanceType int `json:"chance_type"`
//图片
//视频
//语音
ViewTotal int `json:"view_total"`
CommentTotal int `json:"comment_total"`
ZanTotal int `json:"zan_total"`
}
/*SympathyAction */
type SympathyActionRequest struct {
MarkType int `json:"mark_type" valid:"Required"` // 1.赞 2.收藏
SourceType int `json:"source_type" valid:"Required"` //protocol.SourceType //机会 评论
Id int64 `json:"id" valid:"Required"`
SympathyType int `json:"sympathy_type"` //1:标记 0:取消标记
}
type SympathyActionResponse struct {
}
/*ChanceType 机会一级分类请求*/
type ChanceTypeRequest struct {
}
type ChanceTypeResponse struct {
List []*models.ChanceType `json:"list"`
}
/*Templates 模板列表请求*/
type TemplatesRequest struct {
ChanceTypeId int `json:"chanceTypeId" valid:"Required"`
}
type TemplatesResponse struct {
Templates []*Template `json:"list"`
}
//模板
type Template struct {
Id int64 `json:"id"`
Name string `json:"name"`
Doc string `json:"doc"`
Icon string `json:"icon"`
FormList []*Form `json:"formList"`
Link string `json:"link"` //示例
}
//表单
type Form struct {
Id int `json:"id"`
Label string `json:"label"`
InputType string `json:"inputType"`
SectionType int8 `json:"sectionType"`
Value string `json:"value"`
Required int8 `json:"required"`
}
/*ChanceExample*/
type ChanceExampleRequest struct {
TemplateId int `json:"templateId" valid:"Required"`
}
type ChanceExampleResponse struct {
Content string `json:"content"`
}
type ChanceSubmitRequest struct {
Id int64 `json:"id"` // = 0添加 >0 编辑
AuditTemplateId int64 `json:"auditTemplateId" valid:"Required"`
Content string `json:"content"`
FormList []*Form `json:"formList" valid:"Required"`
Speechs []Speech `json:"speechs"`
Pictures []Picture `json:"pictures"`
Videos []Video `json:"videos"`
RelatedDepartment int64 `json:"relatedDepartments" valid:"Required"`
}
type ChanceSubmitResponse struct {
}
type Speech struct {
Path string `json:"path"`
Duration int `json:"duration"`
}
type Picture struct {
Path string `json:"path"`
W int `json:"w"`
H int `json:"h"`
}
type Video struct {
Path string `json:"path"`
Cover Cover `json:"cover"` //封面
Duration int `json:"duration"`
}
type AuditConfig struct {
NoApprover int8 `json:"no_approver"` //审核人空时:【1:自动通过】【2:转交给管理员】
}
/*ChanceStatistics 首页-机会池统计*/
type ChanceStatisticsRequest struct {
}
type ChanceStatisticsResponse struct {
ChanceTotal int `json:"chanceTotal"`
List []ChanceTotalItem `json:"list"`
}
type ChanceTotalItem struct {
Id int `json:"id"` //类型
Name string `json:"name"` //总数
Total int `json:"total"`
}
/*MyChance 我的机会*/
type MySubmitChanceRequest struct {
LastId int64 `json:"lastId"`
PageSize int `json:"pageSize" valid:"Required"`
ReviewStatus int8 `json:"reviewStatus"` //审核状态
}
type MySubmitChanceResponse struct {
List []ChanceItem `json:"list"`
Total int `json:"total"`
}
/*MyApproveChance 我审核的机会*/
type MyApproveChanceRequest struct {
LastId int64 `json:"lastId"`
PageSize int `json:"pageSize" valid:"Required"`
ReviewStatus int8 `json:"reviewStatus"` //审核状态
}
type MyApproveChanceResponse struct {
List []CommonListItem `json:"list"`
Total int `json:"total"`
}
//机会列表 通用项
type CommonListItem struct {
Chance ChanceItem `json:"chance,omitempty"` //机会详情
ChanceData interface{} `json:"chanceData,omitempty"` //机会数据(是否收藏/点赞 浏览数 点赞总数 评论数)ChanceData
Approve interface{} `json:"approve,omitempty"` //审核人 审核信息(时间) Approve
ApproveData interface{} `json:"approveData,omitempty"` //审核数据(公开状态 评分) ApproveData
Message interface{} `json:"message,omitempty"`
Comment interface{} `json:"comment,omitempty"`
ChanceStatus int `json:"chanceStatus"` //0:正常 1.删除 2.关闭
}
type ChanceData struct {
}
//我的机会列表
type ChanceItemOrm struct {
Id int64 `orm:"column(id)"`
Uid int64 `orm:"column(user_id)"`
CreateTime time.Time `orm:"column(create_at)"`
SourceContent string `orm:"column(source_content)"`
Images string `orm:"column(images)"`
Voices string `orm:"column(speechs)"`
Videos string `orm:"column(videos)"`
}
type ChanceItem struct {
Id int64 `json:"id"`
CreateTime int64 `json:"createTime"`
Provider *BaseUserInfo `json:"provider"`
FormList []*Form `json:"formList" valid:"Required"`
Speechs []Speech `json:"speechs"`
Pictures []Picture `json:"pictures"`
Videos []Video `json:"videos"`
}
//我的审核机会列表
type ChanceApproveItemOrm struct {
ChanceUserId int64 `orm:"column(chance_user_id)"`
SourceContent string `orm:"column(source_content)"`
ChanceEnableStatus int `orm:"column(enable_status)"`
Images string `orm:"column(images)"`
Voices string `orm:"column(speechs)"`
Videos string `orm:"column(videos)"`
Id int64 `orm:"column(id)"` //审核id
ApproveTime time.Time `orm:"column(approve_time)"`
ApproveData string `orm:"column(approve_data)"`
ApproveMessage string `orm:"column(approve_message)"`
ApproveUserId int64 `orm:"column(uid)"`
ProcessCreateTime time.Time `orm:"column(process_create_time)"`
ChanceId int64 `orm:"column(chance_id)"` // 机会id
}
/*ChanceDetail 机会详情*/
type ChanceDetailRequest struct {
Id int64 `json:"id"` //机会编号
}
type ChanceDetailResponse struct {
ChanceDetail ChanceItem `json:"chance"`
ApproveData *ApproveData `json:"publicData"`
ApproveProcess []*ProcessItem `json:"approveProcess"`
ApproveAccess *ApproveAccess `json:"approveAccess"` //
}
/*ChanceDelete 机会删除*/
type ChanceDeleteRequest struct {
Id int64 `json:"id"` //机会编号
}
type ChanceDeleteResponse struct {
}
/*ChanceChangePublish 修改公开状态*/
type ChanceChangePublishRequest struct {
ChanceId int64 `json:"chanceId"` //机会编号
PublicData PublicData `json:"publicData"` // 公开数据
}
type ChanceChangePublishResponse struct {
}
/*ChanceChangeScore 修改评分*/
type ChanceChangeScoreRequest struct {
ChanceId int64 `json:"chanceId"` //机会编号
Score Score `json:"score"`
}
type ChanceChangeScoreResponse struct {
}
/*ChanceCalculateScore 计算发现分*/
type ChanceCalculateScoreRequest struct {
Score Score `json:"score"`
}
type ChanceCalculateScoreResponse struct {
DiscoveryScore float64 `json:"discoveryScore"` //发现分
}