修复撤销逻辑问题
This commit is contained in:
parent
378024553a
commit
40ec6763a5
|
|
@ -1,6 +1,7 @@
|
|||
package service
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
"videoplayer/dao"
|
||||
"videoplayer/proto"
|
||||
|
|
@ -69,6 +70,11 @@ func DeleteVideo(id, user int) int {
|
|||
func QuashVideo(user int, data map[string]interface{}) (int, string) {
|
||||
var res int
|
||||
var msg string
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
fmt.Println("error:", r)
|
||||
}
|
||||
}()
|
||||
switch data["method"] {
|
||||
case "delete":
|
||||
case "delay":
|
||||
|
|
@ -81,7 +87,7 @@ func QuashVideo(user int, data map[string]interface{}) (int, string) {
|
|||
msg = "success"
|
||||
}
|
||||
} else if data["option"] == "one" {
|
||||
if dao.QuashOneDelay(user, data["id"].(int), data["delay_day"].(int)) == 0 {
|
||||
if dao.QuashOneDelay(int(data["id"].(float64)), user, int(data["delay_day"].(float64))) == 0 {
|
||||
res = proto.RevokeDelayOperationFailed
|
||||
msg = "quash one video error"
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Reference in New Issue