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