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,32 @@
package(default_visibility = ["//visibility:public"])
load(
"@io_bazel_rules_go//go:def.bzl",
"go_library",
)
go_library(
name = "go_default_library",
srcs = [
"archive.go",
"occupation.go",
"tag.go",
],
importpath = "go-common/app/admin/main/creative/model/academy",
tags = ["automanaged"],
visibility = ["//visibility:public"],
)
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,147 @@
package academy
const (
//StateRemove 移除状态
StateRemove = -1
//StateNormal 正常状态
StateNormal = 0
//BusinessForArchvie 稿件
BusinessForArchvie = 1
//BusinessForArticle 专栏
BusinessForArticle = 2
//LogClientAcademy 日志服务类型
LogClientAcademy = 181
//DefaultState check search archive state
DefaultState = 2018
)
//TableName get table name
func (a *Archive) TableName() string {
return "academy_archive"
}
//Archive for academy achive & article.
type Archive struct {
ID int64 `gorm:"column:id"`
OID int64 `gorm:"column:oid"`
Title string `gorm:"column:title"`
State int8 `gorm:"column:state"`
Business int8 `gorm:"column:business"`
CTime string `gorm:"column:ctime"`
MTime string `gorm:"column:mtime"`
Comment string `gorm:"column:comment"`
Hot int64 `gorm:"column:hot"`
}
//TableName get table name
func (at *ArchiveTag) TableName() string {
return "academy_archive_tag"
}
//ArchiveTag for academy achive & tag relation .
type ArchiveTag struct {
ID int64 `gorm:"column:id"`
OID int64 `gorm:"column:oid"`
TID int64 `gorm:"column:tid"`
State int8 `gorm:"column:state"`
Business int8 `gorm:"column:business"`
CTime string `gorm:"column:ctime"`
MTime string `gorm:"column:mtime"`
}
//ArchiveOrigin for archive list.
type ArchiveOrigin struct {
OID int64
TIDs []int64
Comment string
Business int8
}
//ArchiveCount get archive count by tid.
type ArchiveCount struct {
TID int64 `gorm:"column:tid"`
Count int `gorm:"column:count"` //当前tag关联的稿件量
}
//ArchiveMeta for archive meta.
type ArchiveMeta struct {
OID int64 `json:"oid"`
State int32 `json:"state"`
Forbid int8 `json:"forbid"`
Cover string `json:"cover"`
Type string `json:"type"`
Title string `json:"title"`
UName string `json:"uname"`
Comment string `json:"comment"`
CTime int64 `json:"ctime"`
MTime int64 `json:"mtime"`
Tags map[int][]*TagMeta `json:"tags"`
Hot int64 `json:"hot"`
}
//ArchiveTags for archive tag relation.
type ArchiveTags struct {
ID int64 `gorm:"column:id"`
TID int64 `gorm:"column:tid"`
OID int64 `gorm:"column:oid"`
Type int8 `gorm:"column:type"`
Business int8 `gorm:"column:business"`
}
//Archives for archive list
type Archives struct {
Pager *Pager `json:"pager"`
Items []*ArchiveMeta `json:"items"`
}
// Pager Pager def.
type Pager struct {
Num int `json:"num"`
Size int `json:"size"`
Total int `json:"total"`
}
// LogParam for manager.
type LogParam struct {
UID int64 `json:"uid"`
UName string `json:"uname"`
Action string `json:"action"`
TID int64 `json:"tid"`
OIDs string `json:"oids"`
OName string `json:"oname"`
OState int8 `json:"ostate"`
}
// EsParam for es param.
type EsParam struct {
OID int64
Business int8
Keyword string
Uname string
TID []int64
Copyright int
State int
Pn int
Ps int
IP string
TidsMap map[int][]int64
}
// EsPage for es page.
type EsPage struct {
Num int `json:"num"`
Size int `json:"size"`
Total int `json:"total"`
}
// EsArc for search archive.
type EsArc struct {
OID int64 `json:"oid"`
TID []int64 `json:"tid"`
}
// SearchResult archive list from search.
type SearchResult struct {
Page *EsPage `json:"page"`
Result []*EsArc `json:"result"`
}

View File

@@ -0,0 +1,118 @@
package academy
//TableName get table name
func (o *Occupation) TableName() string {
return "academy_occupation"
}
//TableName get table name
func (s *Skill) TableName() string {
return "academy_skill"
}
//TableName get table name
func (s *Software) TableName() string {
return "academy_software"
}
//TableName get table name
func (s *ArcSkill) TableName() string {
return "academy_arc_skill"
}
//TableName get table name
func (s *TagLink) TableName() string {
return "academy_tag_link"
}
//Occupation for academy occupation.
type Occupation struct {
ID int64 `gorm:"column:id" form:"id" json:"id"`
Rank int64 `gorm:"column:rank" form:"rank" json:"rank"`
State int `gorm:"column:state" form:"state" json:"state"`
Name string `gorm:"column:name" form:"name" json:"name"`
Desc string `gorm:"column:desc" form:"desc" json:"desc"`
Logo string `gorm:"column:logo" form:"logo" json:"logo"`
MainStep string `gorm:"column:main_step" form:"main_step" json:"main_step"`
MainSoftware string `gorm:"column:main_software" form:"main_software" json:"main_software"`
CTime string `gorm:"column:ctime" form:"ctime" json:"-"`
MTime string `gorm:"column:mtime" form:"mtime" json:"-"`
Skill []*Skill `gorm:"-" form:"-" json:"skill"`
Count int `gorm:"-" form:"-" json:"count"`
}
//Skill for academy skill.
type Skill struct {
ID int64 `gorm:"column:id" form:"id" json:"id"`
OID int64 `gorm:"column:oid" form:"oid" json:"oid"`
State int `gorm:"column:state" form:"state" json:"state"`
Name string `gorm:"column:name" form:"name" json:"name"`
Desc string `gorm:"column:desc" form:"desc" json:"desc"`
CTime string `gorm:"column:ctime" form:"ctime" json:"-"`
MTime string `gorm:"column:mtime" form:"mtime" json:"-"`
Software []*Software `gorm:"-" form:"-" json:"software"`
Count int `gorm:"-" form:"-" json:"count"`
}
//Software for academy software.
type Software struct {
ID int64 `gorm:"column:id" form:"id" json:"id"`
SkID int64 `gorm:"column:skid" form:"skid" json:"skid"`
State int `gorm:"column:state" form:"state" json:"state"`
Name string `gorm:"column:name" form:"name" json:"name"`
Desc string `gorm:"column:desc" form:"desc" json:"desc"`
CTime string `gorm:"column:ctime" form:"ctime" json:"-"`
MTime string `gorm:"column:mtime" form:"mtime" json:"-"`
Count int `gorm:"-" form:"-" json:"count"`
}
//ArcSkill for academy archive relation to occupation & skill & software.
type ArcSkill struct {
ID int64 `gorm:"column:id" form:"id" json:"id"`
AID int64 `gorm:"column:aid" form:"aid" json:"aid"`
PID int64 `gorm:"column:pid" form:"pid" json:"pid"`
SkID int64 `gorm:"column:skid" form:"skid" json:"skid"`
SID int64 `gorm:"column:sid" form:"sid" json:"sid"`
Type int `gorm:"column:type" form:"type" json:"type"`
State int `gorm:"column:state" form:"state" json:"state"`
CTime string `gorm:"column:ctime" form:"ctime" json:"-"`
MTime string `gorm:"column:mtime" form:"mtime" json:"-"`
Title string `gorm:"-" form:"title" json:"title"`
Pic string `gorm:"-" form:"pic" json:"pic"`
Pn int `gorm:"-" form:"pn" json:"-"`
Ps int `gorm:"-" form:"ps" json:"-"`
}
//ArcSkills for archive skill list
type ArcSkills struct {
Pager *Pager `json:"pager"`
Items []*ArcSkill `json:"items"`
}
//TagLink for academy h5 tag relation to web tags.
type TagLink struct {
ID int64 `gorm:"column:id" form:"id" json:"id"`
TID int64 `gorm:"column:tid" form:"tid" json:"tid"`
LinkID int64 `gorm:"column:link_id" form:"link_id" json:"link_id"`
CTime string `gorm:"column:ctime" form:"ctime" json:"-"`
MTime string `gorm:"column:mtime" form:"mtime" json:"-"`
}
//TableName get table name
func (sk *SearchKeywords) TableName() string {
return "academy_search_keywords"
}
//SearchKeywords for academy h5 search keywords.
type SearchKeywords struct {
ID int64 `gorm:"column:id" form:"id" json:"id"`
Rank int64 `gorm:"column:rank" form:"rank" json:"rank"`
ParentID int64 `gorm:"column:parent_id" form:"parent_id" json:"parent_id"`
State int8 `gorm:"column:state" form:"state" json:"state"`
Name string `gorm:"column:name" form:"name" json:"name"`
Comment string `gorm:"column:comment" form:"comment" json:"comment"`
CTime string `gorm:"column:ctime" form:"ctime" json:"-"`
MTime string `gorm:"column:mtime" form:"mtime" json:"-"`
Count int `gorm:"-" form:"-" json:"count,omitempty"`
Children []*SearchKeywords `json:"children,omitempty"`
}

View File

@@ -0,0 +1,71 @@
package academy
const (
_ = iota
//Course 教程级别
Course
//Operation 运营标签
Operation
//Classify 分类标签
Classify
//ArticleClass 专栏分类
ArticleClass
//H5 手机端分类标签
H5
//Recommend 理由标签
Recommend
)
const (
//StateUnBlock 解冻状态
StateUnBlock = 0
//StateBlock 冻结状态
StateBlock = -1
)
//TableName get table name
func (t *Tag) TableName() string {
return "academy_tag"
}
//Tag for academy tag.
type Tag struct {
ID int64 `gorm:"column:id"`
ParentID int64 `gorm:"column:parent_id"`
Type int8 `gorm:"column:type"`
State int8 `gorm:"column:state"`
Business int8 `gorm:"column:business"`
Name string `gorm:"column:name"`
Desc string `gorm:"column:desc"`
CTime string `gorm:"column:ctime"`
MTime string `gorm:"column:mtime"`
Rank int64 `gorm:"column:rank"`
Children []*Tag `json:"children,omitempty"`
}
//TagMeta for academy tag reuslt.
type TagMeta struct {
ID int64 `json:"id"`
ParentID int64 `json:"parent_id"`
Type int8 `json:"type"`
State int8 `json:"state"`
Business int8 `json:"business"`
Count int `json:"count"`
Name string `json:"name"`
Desc string `json:"desc"`
Children []*TagMeta `json:"children,omitempty"`
Rank int64 `gorm:"column:rank"`
LinkID []int64 `json:"link_id,omitempty"`
}
//TagClass for tag type name map.
func TagClass() map[int]string {
return map[int]string{
Course: "教程级别",
Operation: "运营标签",
Classify: "分类标签",
ArticleClass: "专栏分类",
H5: "手机端分类标签",
Recommend: "推荐理由",
}
}

View File

@@ -0,0 +1,28 @@
package(default_visibility = ["//visibility:public"])
load(
"@io_bazel_rules_go//go:def.bzl",
"go_library",
)
go_library(
name = "go_default_library",
srcs = ["app.go"],
importpath = "go-common/app/admin/main/creative/model/app",
tags = ["automanaged"],
visibility = ["//visibility:public"],
)
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,74 @@
package app
var (
// PlatformMap map
PlatformMap = map[int8]string{
0: "全平台",
1: "Android",
2: "iOS",
3: "iPad",
}
)
//Portal for app.
type Portal struct {
ID int64 `form:"id" json:"id" gorm:"primary_key"`
Build int64 `form:"build" json:"build"`
BuildExp string `form:"buildexp" json:"buildexp" gorm:"column:buildexp"`
Platform int8 `form:"platform" json:"platform" gorm:"column:platform"`
Compare int8 `form:"compare" json:"compare"`
State int8 `form:"state" json:"state" gorm:"column:state"`
Pos int16 `form:"pos" json:"pos"`
Mark int8 `form:"mark" json:"mark"`
More int8 `form:"more" json:"more"`
Type int8 `form:"type" json:"type" gorm:"column:type"`
Title string `form:"title" json:"title"`
Icon string `form:"icon" json:"icon"`
URL string `form:"url" json:"url"`
CTime string `form:"ctime" json:"ctime" gorm:"column:ctime"`
MTime string `form:"mtime" json:"mtime" gorm:"column:mtime"`
PTime string `form:"ptime" json:"ptime" gorm:"column:ptime"`
SubTitle string `form:"subtitle" json:"subtitle" gorm:"column:subtitle"`
WhiteExp string `form:"whiteexp" json:"whiteexp" gorm:"column:whiteexp"`
}
// PortalPager def.
type PortalPager struct {
Total int64 `json:"total"`
Pn int `json:"pn"`
Ps int `json:"ps"`
Items []*Item `json:"items"`
}
// WhiteExp str
type WhiteExp struct {
TP int8 `json:"type"`
Value int `json:"value"`
}
//Item for portal list.
type Item struct {
ID int64 `json:"id"`
Build int64 `json:"build"`
BuildExp string `json:"buildexp"`
Platform int8 `json:"platform"`
Compare int8 `json:"compare"`
State int8 `json:"state"`
Pos int16 `json:"pos"`
Mark int8 `json:"mark"`
More int8 `json:"more"`
Type int8 `json:"type"`
Title string `json:"title"`
Icon string `json:"icon"`
URL string `json:"url"`
CTime int64 `json:"ctime"`
MTime int64 `json:"mtime"`
PTime int64 `json:"ptime"`
SubTitle string `json:"subtitle"`
WhiteExps []*WhiteExp `json:"whiteexp"`
}
// TableName fn
func (Portal) TableName() string {
return "app_portal"
}

View File

@@ -0,0 +1,28 @@
package(default_visibility = ["//visibility:public"])
load(
"@io_bazel_rules_go//go:def.bzl",
"go_library",
)
go_library(
name = "go_default_library",
srcs = ["bfs.go"],
importpath = "go-common/app/admin/main/creative/model/bfs",
tags = ["automanaged"],
visibility = ["//visibility:public"],
)
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,10 @@
package bfs
//FileInfo : the uploaded file information
type FileInfo struct {
Name string `json:"name"`
Size int64 `json:"size"`
Type string `json:"type"`
Md5 string `json:"md5"`
URL string `json:"url"`
}

View File

@@ -0,0 +1,28 @@
package(default_visibility = ["//visibility:public"])
load(
"@io_bazel_rules_go//go:def.bzl",
"go_library",
)
go_library(
name = "go_default_library",
srcs = ["logcli.go"],
importpath = "go-common/app/admin/main/creative/model/logcli",
tags = ["automanaged"],
visibility = ["//visibility:public"],
)
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,23 @@
package logcli
// .
const (
//LogClientArchiveMusic 创作中心素材库(bgm+素材库) 审核日志 6
LogClientArchiveMusic = int(6)
//LogClientArchiveMusicTypeMusic 1.bgm相关
LogClientArchiveMusicTypeMusic = int(1)
//LogClientArchiveMusicTypeMaterial bgm 素材
LogClientArchiveMusicTypeMaterial = int(2)
//LogClientArchiveMusicTypeCategory bgm 分类
LogClientArchiveMusicTypeCategory = int(3)
//LogClientArchiveMusicTypeMaterialRelation bgm 关联素材
LogClientArchiveMusicTypeMaterialRelation = int(4)
//LogClientArchiveMusicTypeCategoryRelation bgm 关联分类
LogClientArchiveMusicTypeCategoryRelation = int(5)
//LogClientArchiveMaterialType 素材库 除bgm外
LogClientArchiveMaterialType = int(7)
//LogClientArchiveMaterialTypeCategory 素材库分类 除bgm外
LogClientArchiveMaterialTypeCategory = int(6)
)

View File

@@ -0,0 +1,32 @@
package(default_visibility = ["//visibility:public"])
load(
"@io_bazel_rules_go//go:def.bzl",
"go_library",
)
go_library(
name = "go_default_library",
srcs = [
"category.go",
"material.go",
],
importpath = "go-common/app/admin/main/creative/model/material",
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,68 @@
package material
import (
xtime "go-common/library/time"
)
// consts for workflow event
// Category model is the model for material
type Category struct {
ID int64 `json:"id" gorm:"column:id"`
Name string `json:"name" gorm:"column:name"`
State int8 `json:"state" gorm:"column:state"`
Type int64 `json:"type" gorm:"column:type"`
Rank int64 `json:"rank" gorm:"column:rank"`
New int64 `json:"new" gorm:"column:new"`
CTime xtime.Time `json:"ctime" gorm:"column:ctime"`
MTime xtime.Time `json:"mtime" gorm:"column:mtime"`
}
// TableName is used to identify table name in gorm
func (Category) TableName() string {
return "material_category"
}
// CategoryPager def.
type CategoryPager struct {
Items []*Category `json:"items"`
Pager *Pager `json:"pager"`
}
// WithCategory model is the model for material
type WithCategory struct {
ID int64 `json:"id" gorm:"column:id"`
CategoryID int64 `json:"category_id" gorm:"column:category_id"`
MaterialID int64 `json:"material_id" gorm:"column:material_id"`
State int8 `json:"state" gorm:"column:state"`
Index int64 `json:"index" gorm:"column:index"`
}
// TableName is used to identify table name in gorm
func (WithCategory) TableName() string {
return "material_with_category"
}
// WithCategoryPager def.
type WithCategoryPager struct {
TotalCount int64 `json:"total_count"`
Pn int `json:"pn"`
Ps int `json:"ps"`
Items []*WithCategory `json:"items"`
}
// CategoryParam is used to parse user request
type CategoryParam struct {
ID int64 `form:"id" gorm:"column:id"`
Type int64 `form:"type" gorm:"column:type" validate:"required"`
UID int64 `form:"uid" gorm:"column:uid"`
Name string `form:"name" gorm:"column:name" validate:"required"`
Rank int64 `form:"rank" gorm:"column:rank" validate:"required"`
New int8 `form:"new" gorm:"column:new"`
State int8 `form:"state" gorm:"column:state"`
}
// TableName is used to identify table name in gorm
func (CategoryParam) TableName() string {
return "material_category"
}

View File

@@ -0,0 +1,126 @@
package material
import (
xtime "go-common/library/time"
)
// consts .
const (
StateDelete = 2
StateOff = 1
StateOn = 0
//注意 因为历史原因 bgm 和其他素材没能在bilibili_creative.material一个表集中管理 针对素材类型 为bgm保留了type=3
//字幕库
TypeSubTitle = int8(0)
//字体库
TypeFont = int8(1)
//滤镜库
TypeFilter = int8(2)
//bgm库
TypeBGM = int8(3)
//热词
TypeHotWord = int8(4)
//拍摄贴纸 ext 新增贴纸类型 默认为0 普通贴纸存储格式是bitmask参考属性位 0普通 1人脸 2手势 3画面效果 (不是自然数顺序 服务端不校验)
TypeSticks = int8(5)
//贴纸Icon
TypeSticksIcon = int8(6)
//投稿贴纸
TypeCreativeSticks = int8(7)
//投稿转场
TypeCreativeTransition = int8(8)
//合拍库
TypeCooperate = int8(9)
//主题库
TypeTheme = int8(10)
)
var (
_materialtype = map[int8]string{
TypeSubTitle: "字幕库",
TypeFont: "字体库",
TypeFilter: "滤镜库",
TypeBGM: "bgm库",
TypeHotWord: "热词",
TypeSticks: "贴纸",
TypeSticksIcon: "贴纸Icon",
TypeCreativeSticks: "投稿贴纸",
TypeCreativeTransition: "投稿转场",
TypeCooperate: "合拍库",
TypeTheme: "主题库",
}
)
// InMaterialType in correct materialtype.
func InMaterialType(cate int8) (ok bool) {
_, ok = _materialtype[cate]
return
}
// Material model is the model for Material
type Material struct {
ID int64 `json:"id" form:"id" gorm:"column:id"`
UID int64 `json:"uid" form:"id" gorm:"column:uid"`
Name string `json:"name" form:"name" gorm:"column:name"`
Extra string `json:"extra" form:"extra" gorm:"column:extra"`
Rank int `json:"rank" form:"rank" gorm:"column:rank"`
Type int8 `json:"type" form:"type" gorm:"column:type"`
Platform int `json:"platform" form:"platform" gorm:"column:platform"`
Build string `json:"build" form:"build" gorm:"column:build"`
State int8 `json:"state" form:"state" gorm:"column:state"`
CategoryID int64 `json:"category_id" gorm:"-"`
CategoryIndex int64 `json:"category_index" gorm:"-"`
CategoryName string `json:"category_name" gorm:"-"`
CTime xtime.Time `json:"ctime" form:"ctime" gorm:"column:ctime"`
MTime xtime.Time `json:"mtime" form:"mtime" gorm:"column:mtime"`
}
// TableName is used to identify table name in gorm
func (Material) TableName() string {
return "material"
}
// Result def.
type Result struct {
Items []*Material `json:"items"`
Pager *Pager `json:"pager"`
}
// Pager Pager def.
type Pager struct {
Num int `json:"num"`
Size int `json:"size"`
Total int64 `json:"total"`
}
// Param is used to parse user request
type Param struct {
ID int64 `form:"id" gorm:"column:id" json:"id"`
Name string `form:"name" gorm:"column:name" json:"name"`
Extra string `form:"extra" gorm:"column:extra" json:"extra"`
Rank int `form:"rank" gorm:"column:rank" json:"rank"`
Type int8 `form:"type" gorm:"column:type" json:"type"`
Cover string `form:"cover" json:"cover"`
Platform int `form:"platform" json:"platform"`
Build string `form:"build" json:"build"`
DownloadURL string `form:"download_url" json:"download_url"`
ExtraURL string `form:"extra_url" json:"extra_url"`
ExtraField string `form:"extra_field" json:"extra_field"`
Max int8 `form:"max" json:"max"`
CategoryID int64 `form:"category_id" json:"category_id"`
CategoryIndex int64 `form:"category_index" json:"category_index"`
SubType int8 `form:"sub_type" json:"sub_type"`
Style int8 `form:"style" json:"style"`
Tip string `form:"tip" json:"tip"`
WhilteList int8 `form:"white_list" json:"white_list"`
MaterialAID int64 `form:"material_aid" json:"material_aid"`
MaterialCID int64 `form:"material_cid" json:"material_cid"`
DemoAID int64 `form:"demo_aid" json:"demo_aid"`
DemoCID int64 `form:"demo_cid" json:"demo_cid"`
MissionID int64 `form:"mission_id" json:"mission_id"`
FilterType int8 `form:"filter_type" json:"filter_type"`
}
// TableName is used to identify table name in gorm
func (Param) TableName() string {
return "material"
}

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 = [
"category.go",
"material.go",
"music.go",
],
importpath = "go-common/app/admin/main/creative/model/music",
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,109 @@
package music
import (
xtime "go-common/library/time"
)
// consts for workflow event
// Category model is the model for music
type Category struct {
ID int64 `json:"id" gorm:"column:id"`
Pid int64 `json:"pid" gorm:"column:pid"`
Name string `json:"name" gorm:"column:name"`
Index int64 `json:"index" gorm:"column:index"`
CameraIndex int64 `json:"camera_index" gorm:"column:camera_index"`
State int8 `json:"state" gorm:"column:state"`
CTime xtime.Time `json:"ctime" gorm:"column:ctime"`
MTime xtime.Time `json:"mtime" gorm:"column:mtime"`
}
// TableName is used to identify table name in gorm
func (Category) TableName() string {
return "music_category"
}
// CategoryPager def.
type CategoryPager struct {
Items []*Category `json:"items"`
Pager *Pager `json:"pager"`
}
// Pager Pager def.
type Pager struct {
Num int `json:"num"`
Size int `json:"size"`
Total int64 `json:"total"`
}
// SidNotify model is the model for music
type SidNotify struct {
Sid int64 `json:"sid"`
MidFirst bool `json:"mid_first"`
SidFirst bool `json:"sid_first"`
}
// WithCategory model is the model for music
type WithCategory struct {
ID int64 `json:"id" gorm:"column:id"`
Sid int64 `json:"sid" gorm:"column:sid"`
Tid int64 `json:"tid" gorm:"column:tid"`
State int8 `json:"state" gorm:"column:state"`
Index int64 `json:"index" gorm:"column:index"`
CTime xtime.Time `json:"ctime" gorm:"column:ctime"`
MTime xtime.Time `json:"mtime" gorm:"column:mtime"`
}
// TableName is used to identify table name in gorm
func (WithCategory) TableName() string {
return "music_with_category"
}
// WithCategoryPager def.
type WithCategoryPager struct {
TotalCount int64 `json:"total_count"`
Pn int `json:"pn"`
Ps int `json:"ps"`
Items []*WithCategory `json:"items"`
}
//CategoryList .
type CategoryList struct {
ID int64 `json:"id" gorm:"column:id"`
Sid int64 `json:"sid" gorm:"column:sid"`
Name string `json:"name" gorm:"column:name"`
FrontName string `json:"frontname" gorm:"column:frontname"`
Musicians string `json:"musicians" gorm:"column:musicians"`
Cooperate int8 `json:"cooperate" gorm:"column:cooperate"`
Mid int64 `json:"mid" gorm:"column:mid"`
Tid int64 `json:"tid" gorm:"-"`
Pid int64 `json:"pid" gorm:"-"`
Cover string `json:"cover" gorm:"column:cover"`
MaterialName string `json:"material_name" gorm:"-"`
CategoryName string `json:"category_name" gorm:"-"`
MusicState string `json:"music_state" gorm:"-"`
Stat string `json:"stat" gorm:"column:stat"`
Categorys string `json:"categorys" gorm:"column:categorys"`
Playurl string `json:"playurl" gorm:"column:playurl"`
State int8 `json:"state" gorm:"column:state"`
Index int `json:"index" gorm:"column:index"`
Duration int32 `json:"duration" gorm:"column:duration"`
Filesize int32 `json:"filesize" gorm:"column:filesize"`
PubTime xtime.Time `json:"pubtime" gorm:"column:pubtime"`
SyncTime xtime.Time `json:"synctime" gorm:"column:synctime"`
Tags string `json:"tags" gorm:"-"`
Timeline string `json:"timeline" gorm:"-"`
CTime xtime.Time `json:"ctime" gorm:"column:ctime"`
MTime xtime.Time `json:"mtime" gorm:"column:mtime"`
}
// TableName is used to identify table name in gorm
func (CategoryList) TableName() string {
return "music_with_category"
}
// CategoryListPager def.
type CategoryListPager struct {
Items []*CategoryList `json:"items"`
Pager *Pager `json:"pager"`
}

View File

@@ -0,0 +1,68 @@
package music
import (
xtime "go-common/library/time"
)
// consts for workflow event
// Material model is the model for music
type Material struct {
ID int64 `json:"id" gorm:"column:id"`
Pid int64 `json:"pid" gorm:"column:pid"`
Name string `json:"name" gorm:"column:name"`
Index int64 `json:"index" gorm:"column:index"`
State int8 `json:"state" gorm:"column:state"`
CTime xtime.Time `json:"ctime" gorm:"column:ctime"`
MTime xtime.Time `json:"mtime" gorm:"column:mtime"`
}
// TableName is used to identify table name in gorm
func (Material) TableName() string {
return "music_material"
}
// MaterialPager def.
type MaterialPager struct {
Items []*Material `json:"items"`
Pager *Pager `json:"pager"`
}
// MaterialMixParent model is the model for music
type MaterialMixParent struct {
Material
PName string `json:"p_name" gorm:"column:p_name"`
}
// TableName is used to identify table name in gorm
func (MaterialMixParent) TableName() string {
return "music_material"
}
// MaterialMixParentPager def.
type MaterialMixParentPager struct {
Items []*MaterialMixParent `json:"items"`
Pager *Pager `json:"pager"`
}
// WithMaterial model is the model for music
type WithMaterial struct {
ID int64 `json:"id" gorm:"column:id"`
Sid int64 `json:"sid" gorm:"column:sid"`
Tid int64 `json:"tid" gorm:"column:tid"`
State int8 `json:"state" gorm:"column:state"`
Index int64 `json:"index" gorm:"column:index"`
CTime xtime.Time `json:"ctime" gorm:"column:ctime"`
MTime xtime.Time `json:"mtime" gorm:"column:mtime"`
}
// TableName is used to identify table name in gorm
func (WithMaterial) TableName() string {
return "music_with_material"
}
// WithMaterialPager def.
type WithMaterialPager struct {
Pager *Pager `json:"pager"`
Items []*WithMaterial `json:"items"`
}

View File

@@ -0,0 +1,185 @@
package music
import (
xtime "go-common/library/time"
)
// consts for workflow event
const (
MusicDelete = -100
MusicOpen = 0
)
// Music model is the model for music
type Music struct {
ID int64 `json:"id" gorm:"column:id"`
Sid int64 `json:"sid" gorm:"column:sid"`
Name string `json:"name" gorm:"column:name"`
FrontName string `json:"frontname" gorm:"column:frontname"`
Musicians string `json:"musicians" gorm:"column:musicians"`
Cooperate int8 `json:"cooperate" gorm:"column:cooperate"`
Mid int64 `json:"mid" gorm:"column:mid"`
Tid int64 `json:"tid" gorm:"-"`
Tags string `json:"tags" gorm:"tags"`
Timeline string `json:"timeline" gorm:"timeline"`
Rid int64 `json:"rid" gorm:"-"`
Pid int64 `json:"pid" gorm:"-"`
Cover string `json:"cover" gorm:"column:cover"`
MaterialName string `json:"material_name" gorm:"-"`
CategoryName string `json:"category_name" gorm:"-"`
Stat string `json:"stat" gorm:"column:stat"`
Categorys string `json:"categorys" gorm:"column:categorys"`
Playurl string `json:"playurl" gorm:"column:playurl"`
State int8 `json:"state" gorm:"column:state"`
Duration int32 `json:"duration" gorm:"column:duration"`
Filesize int32 `json:"filesize" gorm:"column:filesize"`
PubTime xtime.Time `json:"pubtime" gorm:"column:pubtime"`
SyncTime xtime.Time `json:"synctime" gorm:"column:synctime"`
CTime xtime.Time `json:"ctime" gorm:"column:ctime"`
MTime xtime.Time `json:"mtime" gorm:"column:mtime"`
}
// TableName is used to identify table name in gorm
func (Music) TableName() string {
return "music"
}
// ResultPager def.
type ResultPager struct {
Items []*Music `json:"items"`
Pager *Pager `json:"pager"`
}
// Param is used to parse user request
type Param struct {
ID int64 `form:"id" gorm:"column:id"`
Sid int64 `form:"sid" validate:"required"`
Name string `form:"name" validate:"required"`
Musicians string `form:"musicians"`
Mid int64 `form:"mid" validate:"required"`
Cover string `form:"cover" validate:"required"`
Stat string `form:"stat" `
Categorys string `form:"categorys" `
Playurl string `form:"playurl" `
State int8 `form:"state"`
Duration int32 `form:"duration" `
Filesize int32 `form:"filesize" `
UID int64 `form:"uid" `
PubTime xtime.Time `form:"pubtime"`
SyncTime xtime.Time `form:"synctime"`
Tags string `form:"tags"`
Timeline string `form:"timeline"`
}
// TableName is used to identify table name in gorm
func (Param) TableName() string {
return "music"
}
// CategoryParam is used to parse user request
type CategoryParam struct {
ID int64 `form:"id" gorm:"column:id"`
Pid int64 `form:"pid" gorm:"column:pid"`
UID int64 `form:"uid" gorm:"column:uid"`
Name string `form:"name" gorm:"column:name" validate:"required"`
Index int64 `form:"index" gorm:"column:index" validate:"required"`
CameraIndex int64 `form:"camera_index" gorm:"column:camera_index" validate:"required"`
State int8 `form:"state" gorm:"column:state"`
}
// TableName is used to identify table name in gorm
func (CategoryParam) TableName() string {
return "music_category"
}
// MaterialParam is used to parse user request
type MaterialParam struct {
ID int64 `form:"id" gorm:"column:id"`
Pid int64 `form:"pid" gorm:"column:pid"`
UID int64 `form:"uid" gorm:"column:uid"`
Name string `form:"name" gorm:"column:name" validate:"required"`
Index int64 `form:"index" gorm:"column:index"`
State int8 `form:"state" gorm:"column:state"`
}
// TableName is used to identify table name in gorm
func (MaterialParam) TableName() string {
return "music_material"
}
// WithMaterialParam is used to parse user request
type WithMaterialParam struct {
ID int64 `form:"id" gorm:"column:id"`
UID int64 `form:"uid" gorm:"column:uid"`
Sid int64 `form:"sid" gorm:"column:sid" validate:"required,min=1"`
Tid int64 `form:"tid" gorm:"column:tid" validate:"required,min=1"`
Index int64 `form:"index" gorm:"column:index"`
State int8 `form:"state" gorm:"column:state"`
}
// IndexParam is used to parse user request
type IndexParam struct {
ID int64 `form:"id" validate:"required"`
Index int64 `form:"index" validate:"required"`
SwitchID int64 `form:"switch_id" validate:"required"`
SwitchIndex int64 `form:"switch_index" validate:"required"`
UID int64 `form:"uid"`
}
// TableName is used to identify table name in gorm
func (WithMaterialParam) TableName() string {
return "music_with_material"
}
// BatchMusicWithMaterialParam is used to parse user request
type BatchMusicWithMaterialParam struct {
UID int64 `form:"uid" gorm:"column:uid"`
SidList string `form:"sid_list" validate:"required"`
Tid int64 `form:"tid" gorm:"column:tid" validate:"required,min=1"`
Index int64 `form:"index" gorm:"column:index"`
State int8 `form:"state" gorm:"column:state"`
}
// TableName is used to identify table name in gorm
func (BatchMusicWithMaterialParam) TableName() string {
return "music_with_material"
}
// WithCategoryParam is used to parse user request
type WithCategoryParam struct {
ID int64 `form:"id" gorm:"column:id"`
UID int64 `form:"uid" gorm:"column:uid"`
Sid int64 `form:"sid" gorm:"column:sid" validate:"required,min=1"`
Tid int64 `form:"tid" gorm:"column:tid" validate:"required,min=1"`
Index int64 `form:"index" gorm:"column:index" default:"1"`
State int8 `form:"state" gorm:"column:state"`
}
// BatchMusicWithCategoryParam is used to parse user request
type BatchMusicWithCategoryParam struct {
UID int64 `form:"uid" gorm:"column:uid"`
SidList string `form:"sid_list" validate:"required"`
SendList string `form:"send_list"`
Tid int64 `form:"tid" gorm:"column:tid" validate:"required,min=1"`
Index int64 `form:"index" gorm:"column:index" default:"1"`
State int8 `form:"state" gorm:"column:state"`
}
// TableName is used to identify table name in gorm
func (BatchMusicWithCategoryParam) TableName() string {
return "music_with_category"
}
// TableName is used to identify table name in gorm
func (WithCategoryParam) TableName() string {
return "music_with_category"
}
// LogParam is used to parse user request
type LogParam struct {
ID int64 `json:"id"`
UID int64 `json:"uid"`
UName string `json:"uname"`
Action string `json:"action"`
Name string `json:"name"`
}

View File

@@ -0,0 +1,28 @@
package(default_visibility = ["//visibility:public"])
load(
"@io_bazel_rules_go//go:def.bzl",
"go_library",
)
go_library(
name = "go_default_library",
srcs = ["operation.go"],
importpath = "go-common/app/admin/main/creative/model/operation",
tags = ["automanaged"],
visibility = ["//visibility:public"],
)
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,58 @@
package operation
// Operation tool.
type Operation struct {
ID int64 `form:"id" json:"id"`
Type string `form:"type" json:"type"`
Ads int8 `form:"ads" json:"ads"`
Platform int8 `form:"platform" json:"platform"`
Rank int8 `form:"rank" json:"rank"`
Pic string `form:"pic" json:"pic"`
Link string `form:"link" json:"link"`
Content string `form:"content" json:"content"`
Username string `form:"username" json:"username"`
Remark string `form:"remark" json:"remark"`
Note string `form:"note" json:"note"`
AppPic string `form:"app_pic" json:"app_pic"`
Stime string `form:"stime" json:"stime" gorm:"column:stime"`
Etime string `form:"etime" json:"etime" gorm:"column:etime"`
Ctime string `form:"ctime" json:"ctime" gorm:"column:ctime"`
Mtime string `form:"mtime" json:"mtime" gorm:"column:mtime"`
Dtime string `form:"dtime" json:"dtime" gorm:"column:dtime"`
}
// TableName fn
func (Operation) TableName() string {
return "operations"
}
// Banner for app index.
type Banner struct {
Ty string `json:"-"`
Rank string `json:"rank"`
Pic string `json:"pic"`
Link string `json:"link"`
Content string `json:"content"`
}
// ViewOperation tool.
type ViewOperation struct {
ID int64 `json:"id"`
Type string `json:"type"`
Ads int8 `json:"ads"`
Platform int8 `json:"platform"`
Rank int8 `json:"rank"`
Pic string `json:"pic"`
Link string `json:"link"`
Content string `json:"content"`
Username string `json:"username"`
Remark string `json:"remark"`
Note string `json:"note"`
AppPic string `json:"app_pic"`
Stime string `json:"stime"`
Etime string `json:"etime"`
Ctime string `json:"ctime"`
Mtime string `json:"mtime"`
Dtime string `json:"dtime"`
Status string `json:"status"`
}

View File

@@ -0,0 +1,28 @@
package(default_visibility = ["//visibility:public"])
load(
"@io_bazel_rules_go//go:def.bzl",
"go_library",
)
go_library(
name = "go_default_library",
srcs = ["task.go"],
importpath = "go-common/app/admin/main/creative/model/task",
tags = ["automanaged"],
visibility = ["//visibility:public"],
)
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,232 @@
package task
const (
//StateDel for normal state
StateDel = int8(-1)
//StateNormal for normal state
StateNormal = int8(0)
//StateHide for hide state
StateHide = int8(1)
//TaskManagement 任务管理
TaskManagement = uint8(1)
//AchievementManagement 成就管理
AchievementManagement = uint8(2)
//LogClientTask 日志服务类型
LogClientTask = 301
)
const (
_ uint8 = iota
//TaskTypeNewcomer 新手任务
TaskTypeNewcomer
//TaskTypeAdvanced 进阶任务
TaskTypeAdvanced
//TaskTypeMonthly 月常任务
TaskTypeMonthly
)
var (
//TaskRootNameMap 管理分类, 1-任务管理、2-成就管理
TaskRootNameMap = map[uint8]string{
TaskManagement: "任务管理",
AchievementManagement: "成就管理",
}
//TaskGroupNameMap 任务分类, 1-新手任务、2-进阶任务、3-月常任务; 4-互动成就、5-投稿成就、6-行为成就、7-高级成就
TaskGroupNameMap = map[uint8]string{
TaskTypeNewcomer: "新手任务",
TaskTypeAdvanced: "进阶任务",
TaskTypeMonthly: "月常任务",
4: "互动成就",
5: "投稿成就",
6: "行为成就",
7: "高级成就",
}
)
//CheckRootType check task root type.
func CheckRootType(ty uint8) bool {
if ty == TaskTypeNewcomer || ty == TaskTypeAdvanced || ty == TaskTypeMonthly {
return true
}
return false
}
var (
//TargetMap for target show
TargetMap = map[int8]string{
1: "开放浏览的稿件",
2: "分享自己视频的次数",
3: "创作学院的观看记录",
4: "所有avid的获得评论数",
5: "所有avid获得分享数",
6: "所有avid的获得收藏数",
7: "所有avid的获得硬币数",
8: "所有avid获得点赞数",
9: "所有avid的获得弹幕数",
10: "粉丝数",
11: "水印开关为打开状态",
12: "关注列表含有“哔哩哔哩创作中心”",
13: "用手机投稿上传视频",
14: "开放浏览的稿件",
15: "任意avid的获得点击量",
16: "任意avid的评论",
17: "任意avid的获得分享数",
18: "任意avid的获得收藏数",
19: "任意avid的获得硬币数",
20: "任意avid的获得点赞数",
21: "任意avid的获得弹幕数",
22: "激励计划状态为已开通",
23: "粉丝勋章为开启状态",
}
)
//TableName get table name
func (tg *TaskGroup) TableName() string {
return "newcomers_task_group"
}
//TableName get table name
func (tgr *TaskGroupReward) TableName() string {
return "newcomers_grouptask_reward"
}
//TaskGroup for task group.
type TaskGroup struct {
ID int64 `gorm:"column:id" form:"id" json:"id"`
Rank int64 `gorm:"column:rank" form:"rank" json:"rank"`
State int8 `gorm:"column:state" form:"state" json:"state"` //-1-删除, 0-正常, 1-隐藏
RootType uint8 `gorm:"column:root_type" form:"root_type" json:"root_type"`
Type int8 `gorm:"column:type" form:"type" json:"type"`
CTime string `gorm:"column:ctime" form:"ctime" json:"-"`
MTime string `gorm:"column:mtime" form:"mtime" json:"-"`
RewardIDs string `gorm:"-" form:"reward_ids" json:"-"`
Comment string `gorm:"-" form:"comment" json:"comment"`
Tasks []*Task `json:"tasks"`
Reward []*RewardResult `json:"reward"`
}
//TaskGroupReward for task group relation reward.
type TaskGroupReward struct {
ID int64 `gorm:"column:id" form:"id" json:"id"`
TaskGroupID int64 `gorm:"column:task_group_id" form:"task_group_id" json:"task_group_id"`
RewardID int64 `gorm:"column:reward_id" form:"reward_id" json:"reward_id"`
State int8 `gorm:"column:state" form:"state" json:"state"`
CTime string `gorm:"column:ctime" form:"ctime" json:"-"`
MTime string `gorm:"column:mtime" form:"mtime" json:"-"`
}
//OrderTask for task or task group order.
type OrderTask struct {
ID int64 `form:"id" validate:"required"`
Rank int64 `form:"rank" validate:"required"`
SwitchID int64 `form:"switch_id" validate:"required"`
SwitchRank int64 `form:"switch_rank" validate:"required"`
}
//RewardResult for task group relation reward result.
type RewardResult struct {
RewardID int64 `json:"reward_id"`
RewardName string `json:"reward_name"`
}
//TableName get table name
func (t *Task) TableName() string {
return "newcomers_task"
}
//TableName get table name
func (tr *TaskReward) TableName() string {
return "newcomers_task_reward"
}
// Task for def task struct.
type Task struct {
ID int64 `gorm:"column:id" form:"id" json:"id"`
GroupID int64 `gorm:"column:group_id" form:"group_id" json:"group_id"`
Title string `gorm:"column:title" form:"title" json:"title"`
Desc string `gorm:"column:desc" form:"desc" json:"desc"`
Comment string `gorm:"column:comment" form:"comment" json:"comment"`
Type int8 `gorm:"column:type" form:"type" json:"type"`
State int8 `gorm:"column:state" form:"state" json:"state"`
TargetType int8 `gorm:"column:target_type" form:"target_type" json:"target_type"`
TargetValue int32 `gorm:"column:target_value" form:"target_value" json:"target_value"`
Rank int64 `gorm:"column:rank" form:"rank" json:"rank"`
Extra string `gorm:"column:extra" form:"extra" json:"extra"` //跳转链接等附加信息,json格式
FanRange string `gorm:"column:fan_range" form:"fan_range" json:"fan_range"` //粉丝范围, json格式
UpTime string `gorm:"column:up_time" form:"up_time" json:"up_time"` //月常活动任务-上线时间
DownTime string `gorm:"column:down_time" form:"down_time" json:"down_time"` //月常活动任务-下线时间
CTime string `gorm:"column:ctime" form:"ctime" json:"-"`
MTime string `gorm:"column:mtime" form:"mtime" json:"-"`
RewardIDs string `gorm:"-" form:"reward_ids" json:"-"`
Reward []*RewardResult `json:"reward"`
}
//TaskReward for task relation reward.
type TaskReward struct {
ID int64 `gorm:"column:id" form:"id" json:"id"`
TaskID int64 `gorm:"column:task_id" form:"task_id" json:"task_id"`
RewardID int64 `gorm:"column:reward_id" form:"reward_id" json:"reward_id"`
State int8 `gorm:"column:state" form:"state" json:"state"`
Comment string `gorm:"column:comment" form:"comment" json:"comment"`
CTime string `gorm:"column:ctime" form:"ctime" json:"-"`
MTime string `gorm:"column:mtime" form:"mtime" json:"-"`
}
//TableName get table name
func (r *Reward) TableName() string {
return "newcomers_reward"
}
//Reward for task reward.
type Reward struct {
ID int64 `gorm:"column:id" form:"id" json:"id"`
ParentID int64 `gorm:"column:parent_id" form:"parent_id" json:"parent_id"`
Type int8 `gorm:"column:type" form:"type" json:"type"`
State int8 `gorm:"column:state" form:"state" json:"state"`
IsActive int8 `gorm:"column:is_active" form:"is_active" json:"is_active"`
Name string `gorm:"column:name" form:"name" json:"name"`
Logo string `gorm:"column:logo" form:"logo" json:"logo"`
Comment string `gorm:"column:comment" form:"comment" json:"comment"`
UnlockLogo string `gorm:"column:unlock_logo" form:"unlock_logo" json:"unlock_logo"` //奖励未解锁, logo url
NameExtra string `gorm:"column:name_extra" form:"name_extra" json:"name_extra"` //支持奖励名称展示,json格式
PrizeID string `gorm:"column:prize_id" form:"prize_id" json:"prize_id"` //业务方奖品id
PrizeUnit int8 `gorm:"column:prize_unit" form:"prize_unit" json:"prize_unit"` //奖品单位
Expire int16 `gorm:"column:expire" form:"expire" json:"expire"` //有效期 单位天
CTime string `gorm:"column:ctime" form:"ctime" json:"-"`
MTime string `gorm:"column:mtime" form:"mtime" json:"-"`
Children []*Reward `json:"children,omitempty"`
}
//TableName get table name
func (gf *GiftReward) TableName() string {
return "newcomers_gift_reward"
}
//GiftReward for task gift reward.
type GiftReward struct {
ID int64 `gorm:"column:id" form:"id" json:"id"`
RootType uint8 `gorm:"column:root_type" form:"root_type" json:"root_type"`
TaskType int64 `gorm:"column:task_type" form:"task_type" json:"task_type"`
RewardID int64 `gorm:"column:reward_id" form:"reward_id" json:"-"`
State int8 `gorm:"column:state" form:"state" json:"state"`
Comment string `gorm:"column:comment" form:"comment" json:"comment"`
CTime string `gorm:"column:ctime" form:"ctime" json:"-"`
MTime string `gorm:"column:mtime" form:"mtime" json:"-"`
RewardIDs string `gorm:"-" form:"reward_ids" json:"-"`
Reward []*RewardResult `json:"reward"`
}
// LogParam for manager.
type LogParam struct {
UID int64 `json:"uid"`
UName string `json:"uname"`
Action string `json:"action"`
OID int64 `json:"oid"`
OIDs string `json:"oids"`
OName string `json:"oname"`
OState int8 `json:"ostate"`
Content interface{} `json:"content"`
}

View File

@@ -0,0 +1,28 @@
package(default_visibility = ["//visibility:public"])
load(
"@io_bazel_rules_go//go:def.bzl",
"go_library",
)
go_library(
name = "go_default_library",
srcs = ["whitelist.go"],
importpath = "go-common/app/admin/main/creative/model/whitelist",
tags = ["automanaged"],
visibility = ["//visibility:public"],
)
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,21 @@
package whitelist
// Whitelist tool.
type Whitelist struct {
ID int64 `form:"id" json:"id"`
MID int64 `form:"mid" json:"mid" gorm:"column:mid"`
AdminMID int64 `form:"admin_mid" json:"admin_mid" gorm:"column:admin_mid"`
Comment string `form:"comment" json:"comment"`
State int8 `form:"state" json:"state"`
Type int8 `form:"type" json:"type"`
Fans int64 `form:"fans" json:"fans" gorm:"-"`
CurrentLevel int32 `form:"current_level" json:"current_level" gorm:"-"`
Name string `form:"name" json:"name" gorm:"-"`
Ctime string `form:"ctime" json:"ctime" gorm:"column:ctime"`
Mtime string `form:"mtime" json:"mtime" gorm:"column:mtime"`
}
// TableName fn
func (Whitelist) TableName() string {
return "whitelist"
}