model

package
v0.0.0-...-83adff0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 6, 2020 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LangZhCN = "zh-CN"
	LangZhTW = "zh-TW"
	LangZhHK = "zh-HK"
)

answer constants

View Source
const (
	UserInfoRank = 5000
	PenDantDays  = 7 //答题优秀设置挂件的天数
	ExtraAnsA    = "符合规范"
	ExtraAnsB    = "不符合规范"
)

answer constants

View Source
const (
	FullScore = 100
	Score85   = 85
	Score60   = 60
	Score0    = 0
)

Score info.

View Source
const (
	Q                int8 = iota
	BaseExtraNoPassQ      // 1 extra no pass
	BaseExtraPassQ        // 2 extra pass
)

question type.

View Source
const (
	UnKownQ int8 = iota
	ViolationQ
	NormalQ
)

extra question ans.

View Source
const (
	CaptchaNopass int8 = iota
	CaptchaPass
)

answer captcha pass

View Source
const (
	MobileUserAgentFlag = "Mobile"
	ProPassed           = "/v3/result/%d"

	MinType  = 3
	MaxType  = 10
	BlockMsg = "12小时内无法再次答题!"

	DefPageSize = 10
	DefPageNo   = 1
	NoParam     = -1

	OfficialType     = 6
	ShowOfficialRank = 31300

	// ans info.
	AnsSize  = 4 // 题目答案数
	HashSalt = "bilirqeust"

	// platfrom
	PlatH5 = "h5"
	PlatPC = "pc"

	DefBirthday1 = "1930-01-01"
	DefBirthday2 = "1980-01-01"

	// rank
	FlagAll   = "all"
	FlagMonth = "m"
)

const .

View Source
const (
	AnswerLogID  = 15
	AnswerUpdate = "answer_update"

	BasePass       = "basePass"
	ExtraStartTime = "extraStartTime"
	ExtraCheck     = "extraCheck"
	ProQues        = "proQues"
	ProCheck       = "proCheck"
	Captcha        = "captchaPass"
	Level          = "level"
)

const .

View Source
const (
	IdentifyOk     = 0
	IdentifyNoInfo = 1

	PhoneOk    = 0
	Phone17x   = 1
	PhoneEmpty = 2
)

const .

View Source
const (
	PendantNotGet = 0
	PendantGet    = 1
)

const .

View Source
const (
	WaitCheck   = int8(0)
	PassCheck   = int8(1)
	NoPassCheck = int8(2)
)

state

View Source
const (
	MaxQuestion    = 120
	MinQuestion    = 6
	MaxAns         = 100
	MinAns         = 2
	MaxTips        = 100
	MinTips        = 2
	MaxLoadQueSize = 100000
)

size

View Source
const (
	TextMediaType  = int8(1)
	ImageMediaType = int8(2)

	TopRankSize    = 10
	MyQuestionSize = 12

	AttrUnknown = -1
)

media type

View Source
const (
	RankTop int = 122
)

Rank info.

Variables

View Source
var (
	// Geetest captcha_type .
	Geetest     = "gt"
	BiliCaptcha = "bili"
)

var

Functions

This section is empty.

Types

type AnsCheck

type AnsCheck struct {
	QidList   []int64
	HistoryID int64
	Pass      bool
}

AnsCheck .

type AnsCool

type AnsCool struct {
	Hid            int64        `json:"hid,omitempty"`
	URL            string       `json:"url,omitempty"`
	Name           string       `json:"uname"`
	Face           string       `json:"face"`
	Powers         []*CoolPower `json:"power_result"`
	Score          int8         `json:"score"`
	Rank           *CoolRank    `json:"rank"`
	Share          *CoolShare   `json:"share"`
	CanShowRankBtn bool         `json:"can_show_rank_btn"`
	IsSameUser     bool         `json:"is_same_user"`
	ViewMore       string       `json:"view_more"`
	VideoInfo      *CoolVideo   `json:"video_info"`
	IsFirstPass    int8         `json:"is_first_pass"`
	Level          int8         `json:"level"`
	MainTids       []int        `json:"main_tids"`
	SubTids        []int        `json:"sub_tids"`
}

AnsCool .

type AnsHash

type AnsHash struct {
	AnsHashName string
	AnsHashVal  string
}

AnsHash .

type AnsPosition

type AnsPosition struct {
	AnsHash   string
	Height    float64 // height
	PositionY float64 // background-position-y
}

AnsPosition .

type AnsProType

type AnsProType struct {
	List        []*AnsTypeList `json:"list"`
	CurrentTime int64          `json:"current_time"`
	EndTime     int64          `json:"end_time"`
	Repro       string         `json:"repro"`
}

AnsProType .

type AnsQue

type AnsQue struct {
	ID        int64
	Img       string
	Height    float64
	PositionY float64 // background-position-y
	Ans       []*AnsPosition
}

AnsQue .

type AnsQueDetail

type AnsQueDetail struct {
	ID            int64   `json:"qs_id"`
	AnsImg        string  `json:"ans_img"`
	QsHeight      float64 `json:"qs_h"`
	QsPositionY   float64 `json:"qs_y"`
	Ans1Hash      string  `json:"ans1_hash"`
	Ans2Hash      string  `json:"ans2_hash"`
	Ans3Hash      string  `json:"ans3_hash"`
	Ans4Hash      string  `json:"ans4_hash"`
	Ans0Height    float64 `json:"ans0_h"`
	Ans0PositionY float64 `json:"ans0_y"`
	Ans1Height    float64 `json:"ans1_h"`
	Ans1PositionY float64 `json:"ans1_y"`
	Ans2Height    float64 `json:"ans2_h"`
	Ans2PositionY float64 `json:"ans2_y"`
	Ans3Height    float64 `json:"ans3_h"`
	Ans3PositionY float64 `json:"ans3_y"`
}

AnsQueDetail .

type AnsQueDetailList

type AnsQueDetailList struct {
	CurrentTime int64           `json:"current_time"`
	EndTime     int64           `json:"end_time"`
	QuesList    []*AnsQueDetail `json:"items"`
}

AnsQueDetailList .

type AnsQuesList

type AnsQuesList struct {
	CurrentTime, EndTime time.Time
	QuesList             []*AnsQue
}

AnsQuesList .

type AnsType

type AnsType struct {
	ID   int64  `json:"id"`
	Name string `json:"name"`
}

AnsType info.

type AnsTypeList

type AnsTypeList struct {
	Name   string     `json:"name"`
	Fields []*AnsType `json:"fields"`
}

AnsTypeList .

type AnswerHistory

type AnswerHistory struct {
	ID                    int64     `json:"id"`
	Hid                   int64     `json:"hid"`
	Mid                   int64     `json:"mid"`
	StartTime             time.Time `json:"start_time"`
	StepOneErrTimes       int8      `json:"step_one_err_times"`
	StepOneCompleteTime   int64     `json:"step_one_complete_time"`
	StepExtraStartTime    time.Time `json:"step_extra_start_time"`
	StepExtraCompleteTime int64     `json:"step_extra_complete_time"`
	StepExtraScore        int64     `json:"step_extra_score"`
	StepTwoStartTime      time.Time `json:"step_two_start_time"`
	CompleteTime          time.Time `json:"complete_time"`
	CompleteResult        string    `json:"complete_result"`
	Score                 int8      `json:"score"`
	IsFirstPass           int8      `json:"is_first_pass"`
	IsPassCaptcha         int8      `json:"is_pass_captcha"`
	PassedLevel           int8      `json:"passed_level"`
	RankID                int       `json:"rank_id"`
	Ctime                 time.Time `json:"ctime"`
	Mtime                 time.Time `json:"mtime"`
}

AnswerHistory info.

type AnswerTime

type AnswerTime struct {
	Stime  time.Time `json:"stime"`  // answer start time
	Etimes int8      `json:"etimes"` // base answer error times
}

AnswerTime info.

type BaseQues

type BaseQues struct {
	Question string
	Check    int8
	Ctime    time.Time
}

BaseQues question record

type CaptchaCheckReq

type CaptchaCheckReq struct {
	Mid        int64
	IP         string
	Challenge  string
	ClientType string
	Validate   string
	Seccode    string
	Success    int
	Cookie     string
	Comargs    map[string]string
}

CaptchaCheckReq Captcha check request.

type CaptchaReq

type CaptchaReq struct {
	Mid        int64
	IP         string
	ClientType string
	NewCaptcha int
}

CaptchaReq Captcha request.

type CoolPower

type CoolPower struct {
	Num  int64  `json:"num"`
	Name string `json:"name"`
}

CoolPower .

type CoolRank

type CoolRank struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
	Img  string `json:"img"`
}

CoolRank .

type CoolShare

type CoolShare struct {
	Content      string `json:"content"`
	ShortContent string `json:"short_content"`
}

CoolShare .

type CoolVideo

type CoolVideo struct {
	URL      string `json:"url"`
	Name     string `json:"name"`
	Img      string `json:"img"`
	WatchNum string `json:"watch_num"`
	UpNum    string `json:"up_num"`
}

CoolVideo .

type DataBusResult

type DataBusResult struct {
	Mid   int64  `json:"mid"`   // 用户 ID
	Buvid string `json:"buvid"` // 设备标识符 前端传入
	IP    string `json:"ip"`    // 用户 IP 地址
	Ua    string `json:"ua"`    // 客户端 User Agent
	Refer string `json:"refer"` // 页面跳转来源地址 Refer
	Score int8   `json:"score"` // 答题总分数
	Hid   int64  `json:"hid"`   // hid
	Rs    []*Rs
}

DataBusResult databus.

type ExtraBigData

type ExtraBigData struct {
	Done []int64 `json:"done"`
	Pend []int64 `json:"pend"`
}

ExtraBigData ret.

type ExtraQst

type ExtraQst struct {
	ID       int64     `json:"id"`
	Question string    `json:"question"`
	Ans      int8      `json:"ans"`
	Status   int8      `json:"status"`
	OriginID int64     `json:"origin_id"`
	AvID     int64     `json:"av_id"`
	Source   int8      `json:"source"`
	Ctime    time.Time `json:"ctime"`
	Mtime    time.Time `json:"mtime"`
}

ExtraQst etc.

type ExtraScoreReply

type ExtraScoreReply struct {
	Score int64 `json:"score"`
}

ExtraScoreReply .

type Formal

type Formal struct {
	Mid      int64     `json:"mid"`        // 用户 ID
	Hid      int64     `json:"history_id"` // 答题历史 ID
	Cookie   string    `json:"cookie"`     // cookie
	IP       string    `json:"ip"`         // cookie
	PassTime time.Time `json:"pass_time"`  // 通过时间
}

Formal user formal info.

type IdentifyInfo

type IdentifyInfo struct {
	Identify int8 `json:"'identify'"`
	Phone    int8 `json:"phone"`
}

IdentifyInfo .

type ImgPosition

type ImgPosition struct {
	Ans0H float64 `json:"ans_0_h"`
	Ans0Y float64 `json:"ans_0_y"`
	Ans1H float64 `json:"ans_1_h"`
	Ans1Y float64 `json:"ans_1_y"`
	Ans2H float64 `json:"ans_2_h"`
	Ans2Y float64 `json:"ans_2_y"`
	Ans3H float64 `json:"ans_3_h"`
	Ans3Y float64 `json:"ans_3_y"`
	Ans4H float64 `json:"ans_4_h"`
	Ans4Y float64 `json:"ans_4_y"`
	QsH   float64 `json:"qs_h"`
	QsY   float64 `json:"qs_y"`
}

ImgPosition .

type MyQues

type MyQues struct {
	Count int64
	List  []*BaseQues
}

MyQues my question

type NameplateInfo

type NameplateInfo struct {
	Nid        int    `json:"nid"`
	Name       string `json:"name"`
	Image      string `json:"image"`
	ImageSmall string `json:"image_small"`
	Level      string `json:"level"`
	Condition  string `json:"condition"`
}

NameplateInfo .

type Pendant

type Pendant struct {
	Pid  int    `json:"pid"`
	Name string `json:"name"`
}

Pendant .

type ProTypes

type ProTypes struct {
	List                 []*TypeInfo
	CurrentTime, EndTime time.Time
	Repro                bool
}

ProTypes .

type ProcessRes

type ProcessRes struct {
	Success     int8   `json:"success"`
	CaptchaID   string `json:"gt"`
	Challenge   string `json:"challenge"`
	NewCaptcha  int    `json:"new_captcha"`
	CaptchaType string `json:"type,omitempty"`
	Token       string `json:"token,omitempty"`
	URL         string `json:"url,omitempty"`
}

ProcessRes geetest Captcha resp info.

type QueReq

type QueReq struct {
	ID int64
}

QueReq request

type Question

type Question struct {
	ID        int64     `json:"id"`
	Mid       int64     `json:"mid"`
	IP        string    `json:"ip"`
	TypeID    int8      `json:"type"`
	MediaType int8      `json:"media_type"`
	Check     int8      `json:"check"`
	Source    int8      `json:"source"`
	Question  string    `json:"question"`
	Ans1      string    `json:"ans1"`
	Ans2      string    `json:"ans2"`
	Ans3      string    `json:"ans3"`
	Ans4      string    `json:"ans4"`
	Ans       []string  `json:"-"`
	Tips      string    `json:"tips"`
	AvID      int32     `json:"av_id"`
	Ctime     time.Time `json:"ctime"`
	Mtime     time.Time `json:"mtime"`
}

Question question info rpc.

type QuestionRPC

type QuestionRPC struct {
	ID        int64     `json:"id"`
	Mid       int64     `json:"mid"`
	IP        uint32    `json:"ip"`
	TypeID    int8      `json:"type"`
	MediaType int8      `json:"media_type"`
	Check     int8      `json:"check"`
	Source    int8      `json:"source"`
	Question  string    `json:"question"`
	Ans1      string    `json:"ans1"`
	Ans2      string    `json:"ans2"`
	Ans3      string    `json:"ans3"`
	Ans4      string    `json:"ans4"`
	Tips      string    `json:"tips"`
	AvID      int32     `json:"av_id"`
	Ctime     time.Time `json:"ctime"`
}

QuestionRPC stion question info.

type RankInfo

type RankInfo struct {
	Mid       int64          `json:"mid"`
	Face      string         `json:"face"`
	Uname     string         `json:"uname"`
	Num       int64          `json:"num"`
	Nameplate *NameplateInfo `json:"nameplate"`
}

RankInfo rank

type ReqPendant

type ReqPendant struct {
	HID int64 `form:"hid" validate:"required"`
	MID int64
}

ReqPendant .

type Rs

type Rs struct {
	ID       int64     `json:"id"`       // 题目自增 ID
	Question string    `json:"question"` // 问题内容
	Ans      int8      `json:"ans"`      // 用户答案
	TrueAns  int8      `json:"trueAns"`  // 真实答案 答案0:未知 1:违规 2:不违规
	AvID     int64     `json:"av_id"`    // 相关视频id
	Status   int8      `json:"status"`   // 问题状态 1:未申核 2:已审核
	Source   int8      `json:"source"`   // 问题来源 0:未知1:评论 2:弹幕
	Ctime    time.Time `json:"ctime"`    // 创建时间
	Mtime    time.Time `json:"mtime"`    // 修改时间
}

Rs def.

type SubType

type SubType struct {
	ID        int64  `json:"id"`
	Name      string `json:"name"`
	LabelName string `json:"-"`
}

SubType sub type info

type TypeInfo

type TypeInfo struct {
	ID, Parentid int64
	Name         string
	LabelName    string
	Subs         []*SubType
}

TypeInfo type info

type ValidateRes

type ValidateRes struct {
	Seccode string `json:"seccode"`
}

ValidateRes info.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL