...
|
...
|
@@ -1436,8 +1436,9 @@ func MyCollectChance(header *protocol.RequestHeader, request *protocol.MyCollect |
|
|
rsp = &protocol.MyCollectChanceResponse{Total: total}
|
|
|
for i := 0; i < len(myChances); i++ {
|
|
|
chance := myChances[i]
|
|
|
commItem := protocol.CommonListItem{}
|
|
|
commItem := &protocol.CommonListItem{}
|
|
|
commItem.ReviewStatus = chance.ReviewStatus
|
|
|
commItem.ChanceId = chance.ChanceId
|
|
|
if len(chance.SourceContent) == 0 { //机会删除
|
|
|
commItem.ChanceStatus = protocol.ChanceStatusDelete
|
|
|
} else if chance.ChanceEnableStatus == 0 { //机会关闭
|
...
|
...
|
@@ -1452,6 +1453,7 @@ func MyCollectChance(header *protocol.RequestHeader, request *protocol.MyCollect |
|
|
Id: chance.ChanceId,
|
|
|
Provider: provider,
|
|
|
//CreateTime: chance.CreateTime.Unix() * 1000,
|
|
|
PublicStatus: chance.PublishStatus,
|
|
|
}
|
|
|
jsonUnmarshal(chance.SourceContent, &item.FormList)
|
|
|
item.FormList = clearEmptyForm(item.FormList)
|
...
|
...
|
@@ -1486,6 +1488,7 @@ func MyCollectChance(header *protocol.RequestHeader, request *protocol.MyCollect |
|
|
}
|
|
|
rsp.List = append(rsp.List, commItem)
|
|
|
}
|
|
|
agg.ValidChancePermission(header.UserId, header.CompanyId, rsp.List)
|
|
|
return
|
|
|
}
|
|
|
|
...
|
...
|
@@ -1507,8 +1510,9 @@ func MyThumbUpChance(header *protocol.RequestHeader, request *protocol.MyThumbUp |
|
|
rsp = &protocol.MyThumbUpChanceResponse{Total: total}
|
|
|
for i := 0; i < len(myChances); i++ {
|
|
|
chance := myChances[i]
|
|
|
commItem := protocol.CommonListItem{}
|
|
|
commItem := &protocol.CommonListItem{}
|
|
|
commItem.ReviewStatus = chance.ReviewStatus
|
|
|
commItem.ChanceId = chance.ChanceId
|
|
|
if len(chance.SourceContent) == 0 { //机会删除
|
|
|
commItem.ChanceStatus = protocol.ChanceStatusDelete
|
|
|
} else if chance.ChanceEnableStatus == 0 { //机会关闭
|
...
|
...
|
@@ -1520,9 +1524,10 @@ func MyThumbUpChance(header *protocol.RequestHeader, request *protocol.MyThumbUp |
|
|
//return
|
|
|
} else {
|
|
|
item := protocol.ChanceItem{
|
|
|
Id: chance.ChanceId,
|
|
|
Provider: provider,
|
|
|
CreateTime: chance.CreateTime.Unix() * 1000,
|
|
|
Id: chance.ChanceId,
|
|
|
Provider: provider,
|
|
|
CreateTime: chance.CreateTime.Unix() * 1000,
|
|
|
PublicStatus: chance.PublishStatus,
|
|
|
}
|
|
|
jsonUnmarshal(chance.SourceContent, &item.FormList)
|
|
|
item.FormList = clearEmptyForm(item.FormList)
|
...
|
...
|
@@ -1556,6 +1561,7 @@ func MyThumbUpChance(header *protocol.RequestHeader, request *protocol.MyThumbUp |
|
|
}
|
|
|
rsp.List = append(rsp.List, commItem)
|
|
|
}
|
|
|
agg.ValidChancePermission(header.UserId, header.CompanyId, rsp.List)
|
|
|
return
|
|
|
}
|
|
|
|
...
|
...
|
@@ -1577,31 +1583,34 @@ func MyComment(header *protocol.RequestHeader, request *protocol.MyCommentReques |
|
|
rsp = &protocol.MyCommentResponse{Total: total}
|
|
|
for i := 0; i < len(myChances); i++ {
|
|
|
chance := myChances[i]
|
|
|
commItem := protocol.CommonListItem{}
|
|
|
commItem := &protocol.CommonListItem{}
|
|
|
commItem.ChanceId = chance.SourceId
|
|
|
if chance.SourceType == protocol.SourceTypeChance {
|
|
|
commItem.ReviewStatus = chance.ReviewStatus
|
|
|
if len(chance.SourceContent) == 0 { //机会删除
|
|
|
commItem.ChanceStatus = protocol.ChanceStatusDelete
|
|
|
} else if chance.ChanceEnableStatus == 0 { //机会关闭
|
|
|
commItem.ChanceStatus = protocol.ChanceStatusClose
|
|
|
}
|
|
|
if provider, err = agg.GetUserBaseInfo(chance.Uid, header.CompanyId); err != nil {
|
|
|
commItem.ChanceStatus = protocol.ChanceStatusDelete
|
|
|
err = nil
|
|
|
log.Error(err)
|
|
|
commItem.Chance = protocol.ChanceItem{}
|
|
|
//return
|
|
|
} else {
|
|
|
if provider, err = agg.GetUserBaseInfo(chance.Uid, header.CompanyId); err != nil {
|
|
|
commItem.ChanceStatus = protocol.ChanceStatusDelete
|
|
|
log.Error(err)
|
|
|
//return
|
|
|
} else {
|
|
|
item := protocol.ChanceItem{
|
|
|
Id: chance.SourceId,
|
|
|
Provider: provider,
|
|
|
CreateTime: chance.CreateTime.Unix() * 1000,
|
|
|
}
|
|
|
jsonUnmarshal(chance.SourceContent, &item.FormList)
|
|
|
item.FormList = clearEmptyForm(item.FormList)
|
|
|
jsonUnmarshal(chance.Images, &item.Pictures)
|
|
|
jsonUnmarshal(chance.Voices, &item.Speechs)
|
|
|
jsonUnmarshal(chance.Videos, &item.Videos)
|
|
|
commItem.Chance = item
|
|
|
item := protocol.ChanceItem{
|
|
|
Id: chance.SourceId,
|
|
|
Provider: provider,
|
|
|
CreateTime: chance.CreateTime.Unix() * 1000,
|
|
|
PublicStatus: chance.PublishStatus,
|
|
|
}
|
|
|
jsonUnmarshal(chance.SourceContent, &item.FormList)
|
|
|
item.FormList = clearEmptyForm(item.FormList)
|
|
|
jsonUnmarshal(chance.Images, &item.Pictures)
|
|
|
jsonUnmarshal(chance.Voices, &item.Speechs)
|
|
|
jsonUnmarshal(chance.Videos, &item.Videos)
|
|
|
commItem.Chance = item
|
|
|
}
|
|
|
commItem.ReviewStatus = chance.ReviewStatus
|
|
|
//{
|
...
|
...
|
@@ -1634,6 +1643,7 @@ func MyComment(header *protocol.RequestHeader, request *protocol.MyCommentReques |
|
|
commItem.SourceType = chance.SourceType
|
|
|
rsp.List = append(rsp.List, commItem)
|
|
|
}
|
|
|
agg.ValidChancePermission(header.UserId, header.CompanyId, rsp.List)
|
|
|
return
|
|
|
}
|
|
|
|
...
|
...
|
|