123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337 |
- package model
- import (
- "fmt"
- "time"
- )
- const (
-
- StatUpperInit = int8(0)
- StatUpperIgnore = int8(1)
- StatUpperDelete = int8(2)
-
- StatFirstInit = int8(0)
- StatFirstDelete = int8(1)
- StatSecondInit = int8(2)
- StatSecondDelete = int8(3)
- StatSecondIgnore = int8(4)
- StatFirstIgnore = int8(5)
- StatSecondAutoDelete = int8(6)
- StatJudgeInit = int8(7)
- StatJudgeDelete = int8(8)
- StatJudgeIgnore = int8(9)
-
- NoticeUnsend = int8(0)
- NoticeSend = int8(1)
-
- NoticeReporter = int8(1)
- NoticePoster = int8(2)
- NoticeAll = int8(3)
-
- ReportReasonProhibited = int8(1)
- ReportReasonPorn = int8(2)
- RptReasonFraud = int8(3)
- ReportReasonAttack = int8(4)
- ReportReasonPrivate = int8(5)
- ReportReasonAd = int8(6)
- ReportReasonWar = int8(7)
- ReportReasonSpoiler = int8(8)
- ReportReasonMeaningless = int8(9)
- ReportReasonUnrelated = int8(10)
- ReportReasonOther = int8(11)
- ReportReasonTeenagers = int8(12)
- )
- var (
- RptTemplate = map[string]string{
- "del": `您好,您在视频#{%s}{"http://www.bilibili.com/av%d"}中举报的弹幕『%s』已被删除%s,原因是『%s』,感谢您对bilibili社区秩序的维护,哔哩哔哩 (゜-゜)つロ 干杯~`,
- "ignore": `您好,非常感谢您的举报,您在视频#{%s}{"http://www.bilibili.com/av%d"}中举报的弹幕『%s』暂未认定为违规内容,具体弹幕规范烦请参阅 #{《弹幕礼仪》}{"http://www.bilibili.com/blackboard/help.html#d5"},哔哩哔哩 (゜-゜)つロ 干杯~`,
- }
- PostTemplate = map[int8]string{
- 1: `您好,根据用户举报,您在视频#{%s}{"http://www.bilibili.com/av%d"}中的弹幕『%s』已被删除%s,原因是『%s』,请自觉遵守国家相关法律法规,具体弹幕规范烦请参阅#{《弹幕礼仪》}{"http://www.bilibili.com/blackboard/help.html#d5"},bilibili良好的社区氛围需要大家一起维护!`,
- 2: `您好,根据用户举报,您在视频#{%s}{"http://www.bilibili.com/av%d"}中的弹幕『%s』已被删除%s,原因是『%s』,bilibili倡导平等友善的交流,具体弹幕规范烦请参阅#{《弹幕礼仪》}{"http://www.bilibili.com/blackboard/help.html#d5"},良好的社区氛围需要大家一起维护!`,
- 3: `您好,根据用户举报,您在视频#{%s}{"http://www.bilibili.com/av%d"}中的弹幕『%s』已被删除%s,原因是『%s』,弹幕是公众场所而非私人场所,具体弹幕规范烦请参阅#{《弹幕礼仪》}{"http://www.bilibili.com/blackboard/help.html#d5"},良好的社区氛围需要大家一起维护!`,
- 4: `您好,根据用户举报,您在视频#{%s}{"http://www.bilibili.com/av%d"}中的弹幕『%s』已被删除%s,原因是『%s』,bilibili倡导发送与视频相关、有用的弹幕,具体弹幕规范烦请参阅#{《弹幕礼仪》}{"http://www.bilibili.com/blackboard/help.html#d5"},良好的社区氛围需要大家一起维护!`,
- }
- AdminRptReason = map[int8]string{
- 1: "内容涉及传播不实信息",
- 2: "内容涉及非法网站信息",
- 3: "内容涉及怂恿教唆信息",
- 4: "内容涉及低俗信息",
- 5: "内容涉及色情",
- 6: "内容涉及赌博诈骗信息",
- 7: "内容涉及人身攻击",
- 8: "内容涉及侵犯他人隐私",
- 9: "内容涉及垃圾广告",
- 10: "内容涉及引战",
- 11: "内容涉及视频剧透",
- 12: "恶意刷屏",
- 13: "视频不相关",
- 14: "其他",
- 15: "内容涉及违禁相关",
- 16: "内容不适宜",
- 17: "内容涉及青少年不良信息",
- }
- BlockReason = map[int8]string{
- 4: "发布赌博诈骗信息",
- 5: "发布违禁相关信息",
- 6: "发布垃圾广告信息",
- 7: "发布人身攻击言论",
- 8: "发布侵犯他人隐私信息",
- 9: "发布引战言论",
- 10: "发布剧透信息",
- 13: "发布色情信息",
- 14: "发布低俗信息",
- 17: "发布非法网站信息",
- 18: "发布传播不实信息",
- 19: "发布怂恿教唆信息",
- 20: "恶意刷屏",
- 24: "发布青少年不良内容",
- }
- )
- type ReportListParams struct {
- States []int64 `form:"state,split"`
- UpOps []int64 `form:"upop,split"`
- Tids []int64 `form:"tid,split"`
- Aid int64 `form:"aid"`
- Cid int64 `form:"cid"`
- UID int64 `form:"uid"`
- RpUID int64 `form:"rp_user"`
- RpTypes []int64 `form:"rp_type,split"`
- Start string `form:"start"`
- End string `form:"end"`
- Sort string `form:"sort"`
- Order string `form:"order"`
- Keyword string `form:"keyword"`
- Page int32 `form:"page" default:"1"`
- PageSize int32 `form:"page_size" default:"100" validate:"max=1000"`
- }
- type Report struct {
- DidStr string `json:"dmid_str"`
- ID int64 `json:"id"`
- Did int64 `json:"dmid"`
- Cid int64 `json:"cid"`
- Aid int64 `json:"arc_aid"`
- Tid int64 `json:"arc_typeid"`
- UID int64 `json:"dm_owner_uid"`
- Msg string `json:"dm_msg"`
- Count int64 `json:"count"`
- Content string `json:"content"`
- UpOP int8 `json:"up_op"`
- State int8 `json:"state"`
- RpUID int64 `json:"uid"`
- RpTime string `json:"rp_time"`
- RpType int64 `json:"reason"`
- Title string `json:"arc_title"`
- Deleted int64 `json:"dm_deleted"`
- UPUid int64 `json:"arc_mid"`
- PoolID int64 `json:"pool_id"`
- Model int64 `json:"model"`
- Score int32 `json:"score"`
- SendTime string `json:"dm_ctime"`
- Ctime string `json:"ctime"`
- Mtime string `json:"mtime"`
- RptUsers []*ReportUser `json:"user"`
- }
- type ReportMsg struct {
- Aid int64
- Uids string
- Did int64
- Title string
- Msg string
- State int8
- RptReason int8
- BlockReason int8
- Block int64
- }
- type ReportJudge struct {
- AID int64 `json:"aid"`
- MID int64 `json:"mid"`
- Operator string `json:"operator"`
- OperID int64 `json:"oper_id"`
- OContent string `json:"origin_content"`
- OTitle string `json:"origin_title"`
- OType int64 `json:"origin_type"`
- OURL string `json:"origin_url"`
- ReasonType int64 `json:"reason_type"`
- OID int64 `json:"oid"`
- RPID int64 `json:"rp_id"`
- TagID int64 `json:"tag_id"`
- Type int64 `json:"type"`
- Page int64 `json:"page"`
- BTime int64 `json:"business_time"`
- }
- type SearchReportResult struct {
- Code int64 `json:"code"`
- Order string `json:"order"`
- Sort string `json:"sort"`
- Page *struct {
- Num int64 `json:"num"`
- Size int64 `json:"size"`
- Total int64 `json:"total"`
- } `json:"page"`
- Result []*Report `json:"result"`
- }
- type UptSearchReport struct {
- DMid int64 `json:"dmid"`
- State int8 `json:"state"`
- Ctime string `json:"ctime"`
- Mtime string `json:"mtime"`
- }
- type ReportList struct {
- Code int64 `json:"code"`
- Order string `json:"order"`
- Page int64 `json:"page"`
- PageSize int64 `json:"pagesize"`
- PageCount int64 `json:"pagecount"`
- Total int64 `json:"total"`
- Result []*Report `json:"result"`
- }
- type ReduceMoral struct {
- UID int64
- Moral int64
- Origin int8
- Reason int8
- ReasonType int8
- Operator string
- IsNotify int8
- Remark string
- }
- type BlockUser struct {
- UID int64
- BlockForever int64
- BlockTimeLength int64
- BlockRemark string
- Operator string
- OriginType int64
- Moral int64
- ReasonType int64
- OriginTitle string
- OriginContent string
- OriginURL string
- IsNotify int64
- }
- type ReportUser struct {
- ID int64 `json:"id"`
- Did int64 `json:"dmid"`
- UID int64 `json:"uid"`
- Reason int64 `json:"reason"`
- State int8 `json:"state"`
- Ctime time.Time `json:"ctime"`
- Mtime time.Time `json:"mtime"`
- }
- type ReportLog struct {
- ID int64 `json:"id"`
- Did int64 `json:"dmid"`
- AdminID int64 `json:"admin_id"`
- Reason int8 `json:"reason"`
- Result int8 `json:"result"`
- Remark string `json:"remark"`
- Elapsed int64 `json:"elapsed"`
- Ctime time.Time `json:"ctime"`
- Mtime time.Time `json:"mtime"`
- }
- func PosterBlockMsg(reason int8) (str string, err error) {
- var (
- tmplKey int8
- )
- switch reason {
- case 4, 5, 13, 14, 17, 18, 19, 20, 24:
- tmplKey = 1
- case 6, 9:
- tmplKey = 2
- case 7, 8, 10, 12:
- tmplKey = 3
- default:
- err = fmt.Errorf("BlockReason %d not exist", reason)
- return
- }
- str = PostTemplate[tmplKey]
- return
- }
- func PosterAdminRptMsg(reason int8) (str string, err error) {
- var (
- tmplKey int8
- )
- switch reason {
- case 1, 2, 3, 4, 5, 6, 15, 17:
- tmplKey = 1
- case 7, 10:
- tmplKey = 2
- case 8, 9, 11, 12:
- tmplKey = 3
- case 13, 14, 16:
- tmplKey = 4
- default:
- err = fmt.Errorf("adminRptReason %d not exist", reason)
- return
- }
- str = PostTemplate[tmplKey]
- return
- }
- func RpReasonToJudgeReason(r int8) (j int8) {
- switch r {
- case ReportReasonProhibited:
- j = 5
- case ReportReasonPorn:
- j = 13
- case RptReasonFraud:
- j = 4
- case ReportReasonAttack:
- j = 7
- case ReportReasonPrivate:
- j = 8
- case ReportReasonAd:
- j = 6
- case ReportReasonWar:
- j = 9
- case ReportReasonSpoiler:
- j = 10
- case ReportReasonMeaningless:
- j = 20
- }
- return
- }
- func CheckStateBelong(state int8) string {
- if state == StatFirstInit || state == StatFirstDelete || state == StatFirstIgnore {
- return "弹幕举报一审"
- }
- return "弹幕举报二审"
- }
|