Create & Init Project...
This commit is contained in:
35
app/job/main/activity/model/like/BUILD
Normal file
35
app/job/main/activity/model/like/BUILD
Normal file
@ -0,0 +1,35 @@
|
||||
package(default_visibility = ["//visibility:public"])
|
||||
|
||||
load(
|
||||
"@io_bazel_rules_go//go:def.bzl",
|
||||
"go_library",
|
||||
)
|
||||
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
srcs = [
|
||||
"like.go",
|
||||
"subject.go",
|
||||
],
|
||||
importpath = "go-common/app/job/main/activity/model/like",
|
||||
tags = ["automanaged"],
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [
|
||||
"//app/service/main/archive/api:go_default_library",
|
||||
"//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"],
|
||||
)
|
93
app/job/main/activity/model/like/like.go
Normal file
93
app/job/main/activity/model/like/like.go
Normal file
@ -0,0 +1,93 @@
|
||||
package like
|
||||
|
||||
import (
|
||||
"database/sql/driver"
|
||||
"go-common/app/service/main/archive/api"
|
||||
"time"
|
||||
)
|
||||
|
||||
// Like like
|
||||
type Like struct {
|
||||
ID int64 `json:"id"`
|
||||
Wid int64 `json:"wid"`
|
||||
Archive *api.Arc `json:"archive,omitempty"`
|
||||
}
|
||||
|
||||
// Item like item struct.
|
||||
type Item struct {
|
||||
ID int64 `json:"id"`
|
||||
Wid int64 `json:"wid"`
|
||||
Ctime wocaoTime `json:"ctime"`
|
||||
Sid int64 `json:"sid"`
|
||||
Type int `json:"type"`
|
||||
Mid int64 `json:"mid"`
|
||||
State int `json:"state"`
|
||||
StickTop int `json:"stick_top"`
|
||||
Mtime wocaoTime `json:"mtime"`
|
||||
}
|
||||
|
||||
// Content like_content.
|
||||
type Content struct {
|
||||
ID int64 `json:"id"`
|
||||
Message string `json:"message"`
|
||||
IP int64 `json:"ip"`
|
||||
Plat int `json:"plat"`
|
||||
Device int `json:"device"`
|
||||
Ctime wocaoTime `json:"ctime"`
|
||||
Mtime wocaoTime `json:"mtime"`
|
||||
Image string `json:"image"`
|
||||
Reply string `json:"reply"`
|
||||
Link string `json:"link"`
|
||||
ExName string `json:"ex_name"`
|
||||
}
|
||||
|
||||
// WebData act web data.
|
||||
type WebData struct {
|
||||
ID int64 `json:"id"`
|
||||
Vid int64 `json:"vid"`
|
||||
Data string `json:"data"`
|
||||
}
|
||||
|
||||
// Action like_action .
|
||||
type Action struct {
|
||||
ID int64 `json:"id"`
|
||||
Lid int64 `json:"lid"`
|
||||
Mid int64 `json:"mid"`
|
||||
Action int64 `json:"action"`
|
||||
Ctime wocaoTime `json:"ctime"`
|
||||
Mtime wocaoTime `json:"mtime"`
|
||||
Sid int64 `json:"sid"`
|
||||
IP int64 `json:"ip"`
|
||||
}
|
||||
|
||||
// Extend .
|
||||
type Extend struct {
|
||||
ID int64 `json:"id"`
|
||||
Lid int64 `json:"lid"`
|
||||
Like int64 `json:"like"`
|
||||
Ctime wocaoTime `json:"ctime"`
|
||||
Mtime wocaoTime `json:"mtime"`
|
||||
}
|
||||
|
||||
// LastTmStat .
|
||||
type LastTmStat struct {
|
||||
Last int64
|
||||
}
|
||||
|
||||
type wocaoTime string
|
||||
|
||||
// Scan scan time.
|
||||
func (jt *wocaoTime) Scan(src interface{}) (err error) {
|
||||
switch sc := src.(type) {
|
||||
case time.Time:
|
||||
*jt = wocaoTime(sc.Format("2006-01-02 15:04:05"))
|
||||
case string:
|
||||
*jt = wocaoTime(sc)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// Value get time value.
|
||||
func (jt wocaoTime) Value() (driver.Value, error) {
|
||||
return time.Parse("2006-01-02 15:04:05", string(jt))
|
||||
}
|
65
app/job/main/activity/model/like/subject.go
Normal file
65
app/job/main/activity/model/like/subject.go
Normal file
@ -0,0 +1,65 @@
|
||||
package like
|
||||
|
||||
import xtime "go-common/library/time"
|
||||
|
||||
// Subject subject
|
||||
type Subject struct {
|
||||
ID int64 `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Dic string `json:"dic"`
|
||||
Cover string `json:"cover"`
|
||||
Stime xtime.Time `json:"stime"`
|
||||
Etime xtime.Time `json:"etime"`
|
||||
Interval int64 `json:"interval"`
|
||||
Tlimit int64 `json:"tlimit"`
|
||||
Ltime int64 `json:"ltime"`
|
||||
List []*Like `json:"list"`
|
||||
}
|
||||
|
||||
// ActSubject .
|
||||
type ActSubject struct {
|
||||
ID int64 `json:"id"`
|
||||
Oid int64 `json:"oid"`
|
||||
Type int `json:"type"`
|
||||
State int `json:"state"`
|
||||
Stime wocaoTime `json:"stime"`
|
||||
Etime wocaoTime `json:"etime"`
|
||||
Ctime wocaoTime `json:"ctime"`
|
||||
Mtime wocaoTime `json:"mtime"`
|
||||
Name string `json:"name"`
|
||||
Author string `json:"author"`
|
||||
ActURL string `json:"act_url"`
|
||||
Lstime wocaoTime `json:"lstime"`
|
||||
Letime wocaoTime `json:"letime"`
|
||||
Cover string `json:"cover" `
|
||||
Dic string `json:"dic"`
|
||||
Flag int64 `json:"flag"`
|
||||
Uetime wocaoTime `json:"uetime"`
|
||||
Ustime wocaoTime `json:"ustime"`
|
||||
Level int `json:"level"`
|
||||
H5Cover string `json:"h5_cover"`
|
||||
Rank int64 `json:"rank"`
|
||||
LikeLimit int `json:"like_limit"`
|
||||
}
|
||||
|
||||
// SubjectTotalStat .
|
||||
type SubjectTotalStat struct {
|
||||
SumCoin int64 `json:"sum_coin"`
|
||||
SumFav int64 `json:"sum_fav"`
|
||||
SumLike int64 `json:"sum_like"`
|
||||
SumView int64 `json:"sum_view"`
|
||||
Count int `json:"count"`
|
||||
}
|
||||
|
||||
// VipActOrder .
|
||||
type VipActOrder struct {
|
||||
ID int64 `json:"id"`
|
||||
Mid int64 `json:"mid"`
|
||||
OrderNo string `json:"order_no"`
|
||||
ProductID string `json:"product_id"`
|
||||
Ctime wocaoTime `json:"ctime"`
|
||||
Mtime wocaoTime `json:"mtime"`
|
||||
PanelType string `json:"panel_type"`
|
||||
Months int `json:"months"`
|
||||
AssociateState int `json:"associate_state"`
|
||||
}
|
Reference in New Issue
Block a user