...
|
...
|
@@ -717,6 +717,7 @@ func CheckChanceDifferent(header *protocol.RequestHeader, chance *models.Chance, |
|
|
isSaveLog bool = false
|
|
|
chanceReviseLog *models.ChanceReviseLog
|
|
|
message string
|
|
|
changeCount int
|
|
|
)
|
|
|
defer func() {
|
|
|
if p := recover(); p != nil {
|
...
|
...
|
@@ -799,18 +800,25 @@ func CheckChanceDifferent(header *protocol.RequestHeader, chance *models.Chance, |
|
|
diffFormList(chance.SourceContent, request.FormList)
|
|
|
diffChanceData()
|
|
|
checkModifyLog := func() {
|
|
|
changeCount += len(modifyLog.Speechs)
|
|
|
if len(modifyLog.Speechs) == 0 {
|
|
|
modifyLog.Speechs = make([]protocol.Speech, 0)
|
|
|
}
|
|
|
changeCount += len(modifyLog.Pictures)
|
|
|
if len(modifyLog.Pictures) == 0 {
|
|
|
modifyLog.Pictures = make([]protocol.Picture, 0)
|
|
|
}
|
|
|
changeCount += len(modifyLog.Videos)
|
|
|
if len(modifyLog.Videos) == 0 {
|
|
|
modifyLog.Videos = make([]protocol.Video, 0)
|
|
|
}
|
|
|
changeCount += len(modifyLog.DiffContents)
|
|
|
if len(modifyLog.DiffContents) == 0 {
|
|
|
modifyLog.DiffContents = make([]protocol.ReviseContent, 0)
|
|
|
}
|
|
|
}
|
|
|
checkModifyLog()
|
|
|
if isSaveLog {
|
|
|
if isSaveLog && changeCount > 0 {
|
|
|
orm := orm.NewOrm()
|
|
|
orm.Begin()
|
|
|
var logId int64
|
...
|
...
|
@@ -850,7 +858,6 @@ func CheckChanceDifferent(header *protocol.RequestHeader, chance *models.Chance, |
|
|
return
|
|
|
}
|
|
|
|
|
|
//TODO:保存变更日志
|
|
|
orm.Commit()
|
|
|
}
|
|
|
}
|
...
|
...
|
|