academy

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: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (

	//Course 教程级别
	Course
	//Operation 运营标签
	Operation
	//Classify  分类标签
	Classify
	//ArticleClass 专栏分类
	ArticleClass
	//H5 移动端tag分类
	H5
	//RecommendTag 推荐理由
	RecommendTag

	//BusinessForAll //所有类型稿件
	BusinessForAll = 0
	//BusinessForArchive //视频稿件
	BusinessForArchive = 1
	//BusinessForArticle //专栏稿件
	BusinessForArticle = 2
)

Variables

This section is empty.

Functions

func TagClassMap

func TagClassMap(ty int) (s string)

TagClassMap for tag type map.

func TagClassify

func TagClassify() map[int]string

TagClassify map tag type name.

func Trees

func Trees(data interface{}, idFieldStr, pidFieldStr, chFieldStr string) (res []interface{})

Trees for generate tree data set data - db result set idFieldStr - primary key in table map to struct pidFieldStr - top parent id in table map to struct chFieldStr - struct child nodes

Types

type ArcList

type ArcList struct {
	Items []*ArcMeta   `json:"items"`
	Page  *ArchivePage `json:"page"`
}

ArcList for archive list.

type ArcMeta

type ArcMeta struct {
	AID      int64             `json:"aid"`
	MID      int64             `json:"mid"`
	Cover    string            `json:"cover"`
	Title    string            `json:"title"`
	Type     string            `json:"type"`
	Duration int64             `json:"duration,omitempty"`
	PlayTime time.Time         `json:"play_time"` //历史课程上次学习时间
	Watch    int8              `json:"watch"`     //标记是否观看过
	ArcStat  *api.Stat         `json:"arc_stat,omitempty"`
	Skill    *SkillArc         `json:"-"`
	Business int8              `json:"business"`
	Tags     map[string][]*Tag `json:"tags,omitempty"`
}

ArcMeta for skill arc meta.

type Archive

type Archive struct {
	ID       int64     `json:"id"`
	OID      int64     `json:"oid"`
	State    int8      `json:"-"`
	Business int       `json:"business"`
	CTime    time.Time `json:"-"`
	MTime    time.Time `json:"-"`
	TIDs     []int64   `json:"-"`
}

Archive for academy achive & article.

type ArchiveList

type ArchiveList struct {
	Items []*ArchiveMeta `json:"items"`
	Page  *ArchivePage   `json:"page"`
}

ArchiveList for archive list.

type ArchiveMeta

type ArchiveMeta struct {
	OID            int64             `json:"oid"`
	MID            int64             `json:"mid"`
	State          int32             `json:"state"`
	Forbid         int8              `json:"forbid"`
	Cover          string            `json:"cover"`
	Type           string            `json:"type"`
	Title          string            `json:"title"`
	HighLightTitle string            `json:"highlight_title"`
	UName          string            `json:"uname"`
	Face           string            `json:"face"`
	Comment        string            `json:"comment"`
	CTime          time.Time         `json:"-"`
	MTime          time.Time         `json:"-"`
	Tags           map[string][]*Tag `json:"tags"`
	Duration       int64             `json:"duration"`
	ArcStat        *api.Stat         `json:"arc_stat,omitempty"`
	ArtStat        *mdlArt.Stats     `json:"art_stat,omitempty"`
	Business       int               `json:"business"`
	Rights         api.Rights        `json:"rights,omitempty"`
}

ArchiveMeta for archive meta.

type ArchivePage

type ArchivePage struct {
	Pn    int `json:"pn"`
	Ps    int `json:"ps"`
	Total int `json:"total"`
}

ArchivePage for archive pagination.

type ArchiveTag

type ArchiveTag struct {
	ID    int64     `json:"id"`
	OID   int64     `json:"oid"`
	TID   int64     `json:"tid"`
	State int8      `json:"-"`
	CTime time.Time `json:"-"`
	MTime time.Time `json:"-"`
}

ArchiveTag for academy achive & tag relation .

type CourseRec

type CourseRec struct {
	ID    int64 `json:"id"`
	Rank  int64 `json:"rank"`
	Shoot *KV   `json:"shoot"`
	Scene *KV   `json:"scene"`
	Edit  *KV   `json:"edit"`
	Mmd   *KV   `json:"mmd"`
	Sing  *KV   `json:"sing"`
	Bang  *KV   `json:"bang"`
	Other *KV   `json:"other"`
}

CourseRec for course rec

type Drawn

type Drawn struct {
	ID         int64 `json:"id"`
	Rank       int64 `json:"rank"`
	MobilePlan *KV   `json:"mobile_plan"`
	ScreenPlan *KV   `json:"screen_plan"`
	RecordPlan *KV   `json:"record_plan"`
	Other      *KV   `json:"other"`
}

Drawn for Drawn rec

type EsArc

type EsArc struct {
	OID      int64    `json:"oid"`
	TID      []int64  `json:"tid"`
	Business int      `json:"business"`
	Title    []string `json:"title"` //highlight
}

EsArc for search archive.

type EsPage

type EsPage struct {
	Num   int `json:"num"`
	Size  int `json:"size"`
	Total int `json:"total"`
}

EsPage for es page.

type EsParam

type EsParam struct {
	OID      int64
	Tid      []int64
	TidsMap  map[int][]int64
	Business int
	Pn       int
	Ps       int
	Keyword  string
	Order    string
	IP       string
	Seed     int64 //支持h5随机推荐
	Duration int   //支持h5时长筛选
}

EsParam for es page.

type FeedBack

type FeedBack struct {
	// MID      int64     `json:"mid"` //TODO
	Category string    `json:"category"`
	Course   string    `json:"course"`
	Suggest  string    `json:"suggest"`
	CTime    time.Time `json:"ctime"`
	MTime    time.Time `json:"mtime"`
}

FeedBack for user advise.

type H5Conf

type H5Conf struct {
	//OfficialID 官方推荐id
	OfficialID int64
	//EditorChoiceID 编辑精选id
	EditorChoiceID int64
	//NewbCourseID 新人课程id
	NewbCourseID int64
	//ResourceID 资源管理位id 防重复
	ResourceID int64
}

H5Conf for h5 conf.

type KV

type KV struct {
	Key []int64 `json:"key"`
	Val []int64 `json:"val"`
}

KV key for tag ids val for type ids

type LinkTag

type LinkTag struct {
	ID     int64 `json:"id"`
	TID    int64 `json:"tid"`
	LinkID int64 `json:"link_id"`
}

LinkTag for link tag.

type NewbCourseList

type NewbCourseList struct {
	Items []*ArcMeta `json:"items"`
	Title string     `json:"title"`
	TID   int64      `json:"tid"`
}

NewbCourseList for NewbCourse list.

type Occupation

type Occupation struct {
	ID           int64  `json:"id"`
	Rank         int64  `json:"rank"`
	Name         string `json:"name"`
	Desc         string `json:"desc"`
	MainStep     string `json:"main_step"`
	MainSoftWare string `json:"main_software"`
}

Occupation for occupation.

type Person

type Person struct {
	ID    int64 `json:"id"`
	Rank  int64 `json:"rank"`
	Other *KV   `json:"other"`
}

Person for person rec

type Play

type Play struct {
	MID      int64     `json:"mid"`
	AID      int64     `json:"aid"`
	Business int8      `json:"business"`
	Watch    int8      `json:"watch"`
	CTime    time.Time `json:"ctime"`
	MTime    time.Time `json:"mtime"`
}

Play for academy play list.

type RecArcList

type RecArcList struct {
	Items []*RecArchive `json:"items"`
	Name  string        `json:"name"`
	TID   int64         `json:"tid"`
}

RecArcList for recommend archive list.

type RecArchive

type RecArchive struct {
	OID      int64             `json:"oid"`
	MID      int64             `json:"mid"`
	Cover    string            `json:"cover"`
	Title    string            `json:"title"`
	Business int               `json:"business,omitempty"` //只针对标签课程
	Duration int64             `json:"duration,omitempty"`
	ArcStat  *api.Stat         `json:"arc_stat,omitempty"`
	ArtStat  *mdlArt.Stats     `json:"art_stat,omitempty"`
	Tags     map[string][]*Tag `json:"tags,omitempty"`
}

RecArchive for archive.

type RecConf

type RecConf struct {
	TIDs []int64
	PID  int64
}

RecConf for tag conf.

type Recommend

type Recommend struct {
	Course *CourseRec `json:"course"`
	Drawn  *Drawn     `json:"drawn"`
	Video  *Video     `json:"video"`
	Person *Person    `json:"person"`
}

Recommend for all type

type SearchKeywords

type SearchKeywords struct {
	ID       int64             `json:"id"`
	Rank     int64             `json:"rank"`
	ParentID int64             `json:"parent_id"`
	State    int8              `json:"state"`
	Name     string            `json:"name"`
	Comment  string            `json:"comment"`
	CTime    string            `json:"-"`
	MTime    string            `json:"-"`
	Count    int               `json:"count,omitempty"`
	Children []*SearchKeywords `json:"children,omitempty"`
}

SearchKeywords for academy h5 search keywords.

type SearchResult

type SearchResult struct {
	Page   *EsPage  `json:"page"`
	Result []*EsArc `json:"result"`
}

SearchResult archive list from search.

type Skill

type Skill struct {
	ID   int64  `json:"id"`
	OID  int64  `json:"oid"`
	Name string `json:"name"`
	Desc string `json:"desc"`
}

Skill for Skill.

type SkillArc

type SkillArc struct {
	ID   int64 `json:"id"`
	AID  int64 `json:"aid"`
	Type int   `json:"type"`
	PID  int64 `json:"pid"`
	SkID int64 `json:"skid"`
	SID  int64 `json:"sid"`
}

SkillArc for Skill.

type Tag

type Tag struct {
	ID       int64     `json:"id"`
	ParentID int64     `json:"parent_id"`
	Type     int8      `json:"type"`
	State    int8      `json:"-"`
	Business int8      `json:"-"`
	Name     string    `json:"name"`
	Desc     string    `json:"-"`
	CTime    time.Time `json:"-"`
	MTime    time.Time `json:"-"`
	Children []*Tag    `json:"children,omitempty"`
}

Tag for academy tag.

type Video

type Video struct {
	ID          int64 `json:"id"`
	Rank        int64 `json:"rank"`
	MobileMake  *KV   `json:"mobile_make"`
	AudioEdit   *KV   `json:"audio_edit"`
	EditCompose *KV   `json:"edit_compose"`
	Other       *KV   `json:"other"`
}

Video for Video rec

Jump to

Keyboard shortcuts

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