go-common/app/interface/main/creative/dao/danmu/assist.go
2019-04-22 18:49:16 +08:00

38 lines
992 B
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package danmu
import (
"context"
"net/url"
"strconv"
"go-common/library/ecode"
"go-common/library/log"
)
const (
// api
_setDmBannedURI = "/x/internal/dm/assist/banned/upt"
)
// ResetUpBanned pool 0cancel move1cancel ignore
func (d *Dao) ResetUpBanned(c context.Context, mid int64, state int8, hash, ip string) (err error) {
params := url.Values{}
params.Set("mid", strconv.FormatInt(mid, 10))
params.Set("hash", hash)
params.Set("stat", strconv.FormatInt(mid, 10)) //0撤销添加屏蔽1撤销删除屏蔽
var res struct {
Code int `json:"code"`
}
if err = d.client.Post(c, d.assistDmBannedURL, ip, params, &res); err != nil {
err = ecode.CreativeDanmuErr
log.Error("d.SetDmStat.Post(%s,%s,%s) err(%v)", d.assistDmBannedURL, ip, params.Encode(), err)
return
}
if res.Code != 0 {
err = ecode.Int(res.Code)
log.Error("d.SetDmStat.Post(%s,%s,%s) err(%v)|code(%d)", d.assistDmBannedURL, ip, params.Encode(), err, res.Code)
return
}
return
}