Create & Init Project...

This commit is contained in:
2019-04-22 18:49:16 +08:00
commit fc4fa37393
25440 changed files with 4054998 additions and 0 deletions

View File

@ -0,0 +1,33 @@
package(default_visibility = ["//visibility:public"])
load(
"@io_bazel_rules_go//go:def.bzl",
"go_library",
)
go_library(
name = "go_default_library",
srcs = [
"parameter.go",
"score.go",
"statistics.go",
],
importpath = "go-common/app/admin/main/up-rating/model",
tags = ["automanaged"],
visibility = ["//visibility:public"],
deps = ["//library/time:go_default_library"],
)
filegroup(
name = "package-srcs",
srcs = glob(["**"]),
tags = ["automanaged"],
visibility = ["//visibility:private"],
)
filegroup(
name = "all-srcs",
srcs = [":package-srcs"],
tags = ["automanaged"],
visibility = ["//visibility:public"],
)

View File

@ -0,0 +1,22 @@
package model
// RatingParameter rating weight args
type RatingParameter struct {
WDP int64 // dp weight
WDC int64 // dc weight
WDV int64 // dv weight
WMDV int64 // mdv weight
WCS int64
WCSR int64
WMAAFans int64
WMAHFans int64
WIS int64
WISR int64
// 信用分
HBASE int64
HR int64
HV int64
HVM int64
HL int64
HLM int64
}

View File

@ -0,0 +1,87 @@
package model
import (
"time"
)
// ScoreType .
type ScoreType int8
// ScoreType enums
const (
Magnetic ScoreType = iota
Creativity
Influence
Credit
)
// RatingListArg .
type RatingListArg struct {
ScoreDate string `form:"score_date"` // 年月 "2006-01"
Mid int64 `form:"mid"` // up id
Tags []int64 `form:"tag_ids,split" validate:"required"` // 分区
ScoreType ScoreType `form:"score_type" default:"0"` // 分数段类型
ScoreMin int64 `form:"score_min"` // 左闭右开
ScoreMax int64 `form:"score_max"` // 左闭右开
From int64 `form:"from" default:"0" validate:"min=0"`
Limit int64 `form:"limit" default:"20" validate:"min=1"`
}
// RatingListResp .
type RatingListResp struct {
Result []*RatingInfo `json:"result"`
}
// RatingInfo .
type RatingInfo struct {
Mid int64 `json:"mid"`
TagID int `json:"tag_id"`
ScoreDate time.Time `json:"-"`
Date string `json:"date"`
NickName string `json:"nickname"`
TotalFans int64 `json:"total_fans"`
TotalAvs int64 `json:"total_avs"`
CreativityScore int64 `json:"creativity_score"`
InfluenceScore int64 `json:"influence_score"`
CreditScore int64 `json:"credit_score"`
MagneticScore int64 `json:"magnetic_score"`
}
// Paging .
type Paging struct {
Ps int64 `json:"page_size"`
Total int64 `json:"total"`
}
// UpRatingHistoryArg .
type UpRatingHistoryArg struct {
Mid int64 `form:"mid" validate:"required"`
Month int `form:"month" default:"0" validate:"min=0"`
ScoreType ScoreType `form:"score_type" default:"0"`
}
// UpRatingHistoryResp .
type UpRatingHistoryResp struct {
Data []*UpScoreHistory `json:"score_data"`
}
// UpScoreHistory .
type UpScoreHistory struct {
ScoreType ScoreType `json:"type"`
Date []int64 `json:"date"`
Score []int64 `json:"score"`
}
// ScoreCurrentResp .
type ScoreCurrentResp struct {
Date int64 `json:"date"`
Credit *ScoreCurrent `json:"credit_score"`
Influence *ScoreCurrent `json:"influence_score"`
Creativity *ScoreCurrent `json:"creativity_score"`
}
// ScoreCurrent .
type ScoreCurrent struct {
Current int64 `json:"current"`
Diff int64 `json:"diff"`
}

View File

@ -0,0 +1,40 @@
package model
import (
"go-common/library/time"
)
// RatingStatis rating statitics
type RatingStatis struct {
Ups int64 `json:"ups"`
Section int64 `json:"-"`
Tips string `json:"tips"`
Score int64 `json:"score"`
TotalScore int64 `json:"-"`
CreativityScore int64 `json:"creativity_score"`
InfluenceScore int64 `json:"influence_score"`
CreditScore int64 `json:"credit_score"`
Fans int64 `json:"fans"`
Avs int64 `json:"avs"`
Coin int64 `json:"coin"`
Play int64 `json:"play"`
CDate time.Time `json:"-"`
TagID int64 `json:"-"`
CType int64 `json:"-"`
Proportion string `json:"proportion"`
Compare int64 `json:"compare"`
ComparePropor string `json:"compare_propor"`
}
// Trend rating trend
type Trend struct {
MID int64 `json:"mid"`
Nickname string `json:"nickname"`
DValue int `json:"d_value"`
MagneticScore int64 `json:"magnetic_score"`
CreativityScore int64 `json:"creativity_score"`
InfluenceScore int64 `json:"influence_score"`
CreditScore int64 `json:"credit_score"`
Avs int64 `json:"avs"`
Fans int64 `json:"fans"`
}