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,73 @@
load(
"@io_bazel_rules_go//proto:def.bzl",
"go_proto_library",
)
package(default_visibility = ["//visibility:public"])
load(
"@io_bazel_rules_go//go:def.bzl",
"go_library",
)
go_library(
name = "go_default_library",
srcs = [
"act.go",
"action.go",
"like.go",
"params.go",
"rpc.go",
"subject.go",
"useractievement.go",
],
embed = [":like_go_proto"],
importpath = "go-common/app/interface/main/activity/model/like",
tags = ["automanaged"],
visibility = ["//visibility:public"],
deps = [
"//app/service/main/archive/api:go_default_library",
"//library/time:go_default_library",
"@com_github_gogo_protobuf//gogoproto:go_default_library",
"@com_github_golang_protobuf//proto: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"],
)
proto_library(
name = "like_proto",
srcs = [
"achievements.proto",
"match.proto",
"missiongroup.proto",
"subject.proto",
],
tags = ["automanaged"],
visibility = ["//visibility:public"],
deps = ["@gogo_special_proto//github.com/gogo/protobuf/gogoproto"],
)
go_proto_library(
name = "like_go_proto",
compilers = ["@io_bazel_rules_go//proto:gogofast_proto"],
importpath = "go-common/app/interface/main/activity/model/like",
proto = ":like_proto",
tags = ["automanaged"],
deps = [
"//library/time:go_default_library",
"@com_github_gogo_protobuf//gogoproto:go_default_library",
],
)

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,40 @@
syntax = "proto3";
package activity.service;
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
option go_package = "like";
option (gogoproto.goproto_enum_prefix_all) = false;
option (gogoproto.goproto_getters_all) = false;
option (gogoproto.unmarshaler_all) = true;
option (gogoproto.marshaler_all) = true;
option (gogoproto.sizer_all) = true;
message ActLikeAchievement {
int64 ID = 1 [(gogoproto.jsontag) ="id"];
string Name = 2 [(gogoproto.jsontag) ="name"];
string Icon = 3 [(gogoproto.jsontag) ="icon"];
string Dic = 4 [(gogoproto.jsontag) ="dic"];
int64 Unlock = 5 [(gogoproto.jsontag) ="unlock"];
int64 Ctime = 6 [(gogoproto.jsontag) ="ctime", (gogoproto.casttype) = "go-common/library/time.Time"];
int64 Mtime = 7 [(gogoproto.jsontag) ="mtime", (gogoproto.casttype) = "go-common/library/time.Time"];
int64 Del = 8 [(gogoproto.jsontag) ="del"];
int64 Sid = 9 [(gogoproto.jsontag) ="sid"];
string Image = 10 [(gogoproto.jsontag) ="image"];
int64 Award = 11 [(gogoproto.jsontag) ="award"];
}
message Achievements {
repeated ActLikeAchievement achievements = 1;
}
message ActLikeUserAchievement {
int64 ID = 1 [(gogoproto.jsontag) ="id"];
int64 Aid = 2 [(gogoproto.jsontag) ="aid"];
int64 Ctime = 3 [(gogoproto.jsontag) ="ctime", (gogoproto.casttype) = "go-common/library/time.Time"];
int64 Mtime = 4 [(gogoproto.jsontag) ="mtime", (gogoproto.casttype) = "go-common/library/time.Time"];
int64 Del = 5 [(gogoproto.jsontag) ="del"];
int64 Mid = 6 [(gogoproto.jsontag) ="mid"];
int64 Sid = 7 [(gogoproto.jsontag) ="sid"];
int64 Award = 8 [(gogoproto.jsontag) ="award"];
}

View File

@@ -0,0 +1,6 @@
package like
// RedDot bool
type RedDot struct {
RedDot bool `json:"red_dot"`
}

View File

@@ -0,0 +1,29 @@
package like
import (
xtime "go-common/library/time"
)
// action type
const (
LIKESCORE = 1
)
// Action def.
type Action struct {
ID int64 `json:"id"`
Lid int64 `json:"lid"`
Mid int64 `json:"mid"`
Action int64 `json:"action"`
Ctime xtime.Time `json:"ctime"`
Mtime xtime.Time `json:"mtime"`
Sid int64 `json:"sid"`
IP int64 `json:"ip"`
IPv6 []byte `json:"ipv6"`
}
// LidLikeSum def .
type LidLikeSum struct {
Likes int64
Lid int64
}

View File

@@ -0,0 +1,92 @@
package like
import (
garcmdl "go-common/app/service/main/archive/api"
xtime "go-common/library/time"
)
// Like struct
type Like struct {
*Item
Archive *garcmdl.Arc `json:"archive,omitempty"`
}
// Item like item struct.
type Item struct {
ID int64 `json:"id"`
Wid int64 `json:"wid"`
Ctime xtime.Time `json:"act_ctime"`
Sid int64 `json:"sid"`
Type int `json:"type"`
Mid int64 `json:"mid"`
State int `json:"state"`
StickTop int `json:"stick_top"`
Mtime xtime.Time `json:"mtime"`
}
// GroupItem .
type GroupItem struct {
ID int64 `json:"id"`
Sid int64 `json:"sid"`
State int `json:"state"`
Type int `json:"type"`
Mid int64 `json:"mid"`
Wid int64 `json:"wid"`
Ctime string `json:"ctime"`
Likes int `json:"likes"`
Liked int `json:"liked"`
Message string `json:"message"`
Device string `json:"device"`
Image string `json:"image"`
Plat string `json:"plat"`
Reply string `json:"reply"`
Link string `json:"link"`
}
// List .
type List struct {
*Item
Object interface{} `json:"object"`
Like int64 `json:"like"`
Likes int64 `json:"likes"`
HasLikes int8 `json:"has_likes"`
Click int64 `json:"click"`
Coin int64 `json:"coin"`
Share int64 `json:"share"`
Reply int64 `json:"reply"`
Dm int64 `json:"dm"`
Fav int64 `json:"fav"`
}
// ListInfo .
type ListInfo struct {
List []*List `json:"list"`
*Page
}
// LidLikeRes .
type LidLikeRes struct {
Score int64
Lid int64
}
// Extend like_extend .
type Extend struct {
ID int64 `json:"id"`
Lid int64 `json:"lid"`
Like int64 `json:"like"`
Ctime xtime.Time `json:"ctime"`
Mtime xtime.Time `json:"mtime"`
}
// Tag .
type Tag struct {
ID int64 `json:"tag_id,omitempty"`
Name string `json:"tag_name,omitempty"`
}
// ArgTag .
type ArgTag struct {
Archive *garcmdl.Arc `json:"archive,omitempty"`
Tags []string `json:"tags,omitempty"`
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,69 @@
syntax = "proto3";
package activity.service;
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
option go_package = "like";
option (gogoproto.goproto_enum_prefix_all) = false;
option (gogoproto.goproto_getters_all) = false;
option (gogoproto.unmarshaler_all) = true;
option (gogoproto.marshaler_all) = true;
option (gogoproto.sizer_all) = true;
message Match {
int64 ID = 1 [(gogoproto.jsontag) = "id"];
int64 Sid = 2 [(gogoproto.jsontag) = "sid"];
int64 MaxStake = 3 [(gogoproto.jsontag) = "max_stake"];
int64 Stake = 4 [(gogoproto.jsontag) = "stake"];
string Name = 5 [(gogoproto.jsontag) = "name"];
string Url = 6 [(gogoproto.jsontag) = "url"];
string Cover = 7 [(gogoproto.jsontag) = "cover"];
int64 Ctime = 8 [(gogoproto.jsontag) = "ctime", (gogoproto.casttype) = "go-common/library/time.Time"];
int64 Mtime = 9 [(gogoproto.jsontag) = "mtime", (gogoproto.casttype) = "go-common/library/time.Time"];
}
message MatchList {
repeated Match matchList = 1;
}
message Object {
int64 ID = 1 [(gogoproto.jsontag) = "id"];
int64 MatchId = 2 [(gogoproto.jsontag) = "match_id"];
int64 Sid = 3 [(gogoproto.jsontag) = "sid"];
string HomeName = 4 [(gogoproto.jsontag) = "home_name"];
string HomeLogo = 5 [(gogoproto.jsontag) = "home_logo"];
int64 HomeScore = 6 [(gogoproto.jsontag) = "home_score"];
string AwayName = 7 [(gogoproto.jsontag) = "away_name"];
string AwayLogo = 8 [(gogoproto.jsontag) = "away_logo"];
int64 AwayScore = 9 [(gogoproto.jsontag) = "away_score"];
int64 Result = 10 [(gogoproto.jsontag) = "result"];
int64 Ctime = 11 [(gogoproto.jsontag) = "ctime", (gogoproto.casttype) = "go-common/library/time.Time"];
int64 Mtime = 12 [(gogoproto.jsontag) = "mtime", (gogoproto.casttype) = "go-common/library/time.Time"];
int64 Stime = 13 [(gogoproto.jsontag) = "stime", (gogoproto.casttype) = "go-common/library/time.Time"];
int64 Etime = 14 [(gogoproto.jsontag) = "etime", (gogoproto.casttype) = "go-common/library/time.Time"];
int64 UserResult = 15 [(gogoproto.jsontag) = "user_result"];
int64 GameStime = 16 [(gogoproto.jsontag) = "game_stime", (gogoproto.casttype) = "go-common/library/time.Time"];
string MatchName = 17 [(gogoproto.jsontag) = "match_name,omitempty"];
}
message UserLog {
int64 ID = 1 [(gogoproto.jsontag) = "id"];
int64 MatchId = 2 [(gogoproto.jsontag) = "match_id"];
int64 MOId = 3 [(gogoproto.jsontag) = "m_o_id"];
int64 Sid = 4 [(gogoproto.jsontag) = "sid"];
int64 Mid = 5 [(gogoproto.jsontag) = "mid"];
int64 Result = 6 [(gogoproto.jsontag) = "result"];
int64 Stake = 7 [(gogoproto.jsontag) = "stake"];
int64 Ctime = 8 [(gogoproto.jsontag) = "ctime", (gogoproto.casttype) = "go-common/library/time.Time"];
int64 Mtime = 9 [(gogoproto.jsontag) = "mtime", (gogoproto.casttype) = "go-common/library/time.Time"];
int64 ObjResult = 10 [(gogoproto.jsontag) = "obj_result"];
string HomeName = 11 [(gogoproto.jsontag) = "home_name"];
string AwayName = 12 [(gogoproto.jsontag) = "away_name"];
int64 GameStime = 13 [(gogoproto.jsontag) = "game_stime", (gogoproto.casttype) = "go-common/library/time.Time"];
}
message UserGuess {
int64 Total = 1 [(gogoproto.jsontag) = "total"];
int64 Win = 2 [(gogoproto.jsontag) = "win"];
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,36 @@
syntax = "proto3";
package activity.service;
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
option go_package = "like";
option (gogoproto.goproto_enum_prefix_all) = false;
option (gogoproto.goproto_getters_all) = false;
option (gogoproto.unmarshaler_all) = true;
option (gogoproto.marshaler_all) = true;
option (gogoproto.sizer_all) = true;
message MissionGroup {
int64 ID = 1 [(gogoproto.jsontag) ="id"];
int64 Sid = 2 [(gogoproto.jsontag) ="sid"];
int64 Mid = 3 [(gogoproto.jsontag) ="mid"];
int64 State = 4 [(gogoproto.jsontag) ="state"];
int64 Ctime = 5 [(gogoproto.jsontag) ="ctime", (gogoproto.casttype) = "go-common/library/time.Time"];
int64 Mtime = 6 [(gogoproto.jsontag) ="mtime", (gogoproto.casttype) = "go-common/library/time.Time"];
}
message ActMissionGroup {
int64 ID = 1 [(gogoproto.jsontag) ="id"];
int64 Lid = 2 [(gogoproto.jsontag) ="lid"];
int64 Mid = 3 [(gogoproto.jsontag) ="mid"];
int64 Action = 4 [(gogoproto.jsontag) ="action"];
int64 Ctime = 5 [(gogoproto.jsontag) ="ctime", (gogoproto.casttype) = "go-common/library/time.Time"];
int64 Mtime = 6 [(gogoproto.jsontag) ="mtime", (gogoproto.casttype) = "go-common/library/time.Time"];
int64 Sid = 7 [(gogoproto.jsontag) ="sid"];
int64 IP = 8 [(gogoproto.jsontag) ="ip"];
bytes IPv6 = 9 [(gogoproto.jsontag) ="ipv6"];
}
message ActMissionGroups{
repeated ActMissionGroup actMissionGroups = 1;
}

View File

@@ -0,0 +1,65 @@
package like
// ParamMsg notify param msg.
type ParamMsg struct {
Msg string `form:"msg" validate:"required"`
}
// ParamTeams add follow param teams
type ParamTeams struct {
Teams []string `form:"teams,split" validate:"gt=0,dive,gt=0"`
}
// ParamSid sid param
type ParamSid struct {
Sid int64 `form:"sid" validate:"required,min=1"`
}
// ParamAddGuess add guess param
type ParamAddGuess struct {
ObjID int64 `form:"obj_id" validate:"required,min=1"`
Result int64 `form:"result" validate:"required,min=1"`
Stake int64 `form:"stake" validate:"gt=0"`
}
// ParamObject unstart object param
type ParamObject struct {
Sid int64 `form:"sid" validate:"required,min=1"`
Pn int `form:"pn" validate:"gt=0"`
Ps int `form:"ps" validate:"gt=0,lte=50"`
}
// ParamAddLikeAct add likeAct param
type ParamAddLikeAct struct {
Sid int64 `form:"sid" validate:"required,min=1"`
Lid int64 `form:"lid" validate:"required,min=1"`
Score int64 `form:"score" validate:"min=1,max=5"`
}
// ParamMissionLikeAct add missionAct param
type ParamMissionLikeAct struct {
Sid int64 `form:"sid" validate:"min=1"`
Lid int64 `form:"lid" validate:"min=1"`
}
// ParamMissionFriends get mission friends list
type ParamMissionFriends struct {
Sid int64 `form:"sid" validate:"min=1"`
Lid int64 `form:"lid" validate:"min=1"`
Size int `form:"size" validate:"min=1,max=50"`
}
// ParamStoryKingAct .
type ParamStoryKingAct struct {
Sid int64 `form:"sid" validate:"required,min=1"`
Lid int64 `form:"lid" validate:"required,min=1"`
Score int64 `form:"score" validate:"min=1,max=10"`
}
// ParamList .
type ParamList struct {
Sid int64 `form:"sid" validate:"min=1"`
Type string `form:"type" default:"like"`
Pn int `form:"pn" default:"1" validate:"min=1"`
Ps int `form:"ps" default:"30" validate:"min=1,max=100"`
}

View File

@@ -0,0 +1,33 @@
package like
// ArgMatch arg match
type ArgMatch struct {
Sid int64
}
// ArgSubjectUp .
type ArgSubjectUp struct {
Sid int64
}
// ArgLikeUp .
type ArgLikeUp struct {
Lid int64
}
// ArgLikeItem .
type ArgLikeItem struct {
ID int64
Sid int64
Type int
}
// ArgActSubject .
type ArgActSubject struct {
Sid int64
}
// ArgActProtocol .
type ArgActProtocol struct {
Sid int64
}

View File

@@ -0,0 +1,89 @@
package like
import (
xtime "go-common/library/time"
)
// Subject type.
const (
VIDEO = 1
PICTURE = 2
DRAWYOO = 3
VIDEOLIKE = 4
PICTURELIKE = 5
DRAWYOOLIKE = 6
TEXT = 7
TEXTLIKE = 8
ONLINEVOTE = 9
QUESTION = 10
LOTTERY = 11
ARTICLE = 12
VIDEO2 = 13
MUSIC = 15
PHONEVIDEO = 16
SMALLVIDEO = 17
RESERVATION = 18
MISSIONGROUP = 19
STORYKING = 20
FLAGFIRST = 1
FLAGSPY = 2
FLAGUSTIME = 4
FLAGUETIME = 8
FLAGLEVEL = 16
FLAGIP = 32
FLAGRANKCLOSE = 64
FLAGPHONEBIND = 128
)
// Subject group type
var (
VIDEOALL = []int64{VIDEO, VIDEOLIKE, VIDEO2, PHONEVIDEO, SMALLVIDEO}
LIKETYPE = []int64{VIDEOLIKE, PICTURELIKE, DRAWYOOLIKE, TEXTLIKE}
)
// Subject struct
type Subject struct {
ID int64 `json:"id"`
Name string `json:"name"`
Dic string `json:"dic"`
Cover string `json:"cover"`
Stime xtime.Time `json:"stime"`
Interval int32 `json:"interval"`
Tlimit int32 `json:"tlimit"`
Ltime int32 `json:"ltime"`
List []*Like `json:"list"`
}
// SubItem .
type SubItem struct {
ID int64 `json:"id"`
Ctime xtime.Time `json:"ctime"`
}
// SubjectStat .
type SubjectStat struct {
Sid int64 `json:"sid" form:"sid" validate:"min=1"`
Count int64 `json:"count" form:"count"`
View int64 `form:"view" form:"view"`
Like int64 `form:"like" form:"like"`
Fav int64 `form:"fav" form:"fav"`
Coin int64 `form:"coin" form:"coin"`
}
// SubjectScore .
type SubjectScore struct {
Score int64 `json:"score"`
}
// Page .
type Page struct {
Num int `json:"num"`
Size int `json:"size"`
Total int64 `json:"total"`
}
// SubProtocol .
type SubProtocol struct {
*SubjectItem
*ActSubjectProtocol
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,73 @@
syntax = "proto3";
package activity.service;
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
option go_package = "like";
option (gogoproto.goproto_enum_prefix_all) = false;
option (gogoproto.goproto_getters_all) = false;
option (gogoproto.unmarshaler_all) = true;
option (gogoproto.marshaler_all) = true;
option (gogoproto.sizer_all) = true;
message SubjectItem {
int64 ID = 1 [(gogoproto.jsontag) ="id"];
int64 Oid = 2 [(gogoproto.jsontag) ="oid"];
int64 Type = 3 [(gogoproto.jsontag) ="type"];
int64 State = 4 [(gogoproto.jsontag) ="state"];
int64 Stime = 5 [(gogoproto.jsontag) ="stime", (gogoproto.casttype) = "go-common/library/time.Time"];
int64 Etime = 6 [(gogoproto.jsontag) ="etime", (gogoproto.casttype) = "go-common/library/time.Time"];
int64 Ctime = 7 [(gogoproto.jsontag) ="ctime", (gogoproto.casttype) = "go-common/library/time.Time"];
int64 Mtime = 8 [(gogoproto.jsontag) ="mtime", (gogoproto.casttype) = "go-common/library/time.Time"];
string Name = 9 [(gogoproto.jsontag) ="name"];
string Author = 10 [(gogoproto.jsontag) ="author"];
string ActURL = 11 [(gogoproto.jsontag) ="act_url"];
int64 Lstime = 12 [(gogoproto.jsontag) ="lstime", (gogoproto.casttype) = "go-common/library/time.Time"];
int64 Letime = 13 [(gogoproto.jsontag) ="letime", (gogoproto.casttype) = "go-common/library/time.Time"];
string Cover = 14 [(gogoproto.jsontag) ="cover"];
string Dic = 15 [(gogoproto.jsontag) ="dic"];
int64 Flag = 16 [(gogoproto.jsontag) ="flag"];
int64 Uetime = 17 [(gogoproto.jsontag) ="uetime", (gogoproto.casttype) = "go-common/library/time.Time"];
int64 Ustime = 18 [(gogoproto.jsontag) ="ustime", (gogoproto.casttype) = "go-common/library/time.Time"];
int64 Level = 19 [(gogoproto.jsontag) ="level"];
string H5_cover = 20 [(gogoproto.jsontag) ="h5_cover"];
int64 Rank = 21 [(gogoproto.jsontag) ="rank"];
int64 LikeLimit = 22 [(gogoproto.jsontag) ="like_limit"];
string AndroidURL = 23 [(gogoproto.jsontag) = "android_url"];
string IosURL = 24 [(gogoproto.jsontag) = "ios_url"];
int64 DailyLikeLimit = 25 [(gogoproto.jsontag) ="daily_like_limit"];
int64 DailySingleLikeLimit = 26 [(gogoproto.jsontag) ="daily_single_like_limit"];
}
message LikeContent {
int64 ID = 1 [(gogoproto.jsontag) ="id"];
string Message = 2 [(gogoproto.jsontag) ="message"];
int64 IP = 3 [(gogoproto.jsontag) ="ip"];
int64 Plat = 4 [(gogoproto.jsontag) ="plat"];
int64 Device = 5 [(gogoproto.jsontag) ="device"];
int64 Ctime = 6 [(gogoproto.jsontag) ="ctime", (gogoproto.casttype) = "go-common/library/time.Time"];
int64 Mtime = 7 [(gogoproto.jsontag) ="mtime", (gogoproto.casttype) = "go-common/library/time.Time"];
string Image = 8 [(gogoproto.jsontag) ="image"];
string Reply = 9 [(gogoproto.jsontag) ="reply"];
string Link = 10 [(gogoproto.jsontag) ="link"];
string ExName = 11 [(gogoproto.jsontag) ="ex_name"];
}
message ActSubjectProtocol {
int64 ID = 1 [(gogoproto.jsontag) ="id"];
int64 Sid = 2 [(gogoproto.jsontag) ="sid"];
string Protocol = 3 [(gogoproto.jsontag) ="protocol"];
int64 Mtime = 4 [(gogoproto.jsontag) ="mtime", (gogoproto.casttype) = "go-common/library/time.Time"];
int64 Ctime = 5 [(gogoproto.jsontag) ="ctime", (gogoproto.casttype) = "go-common/library/time.Time"];
string Types = 6 [(gogoproto.jsontag) ="types"];
string Tags = 7 [(gogoproto.jsontag) ="tags"];
int64 Pubtime = 8 [(gogoproto.jsontag) ="pubtime", (gogoproto.casttype) = "go-common/library/time.Time"];
int64 Deltime = 9 [(gogoproto.jsontag) ="deltime", (gogoproto.casttype) = "go-common/library/time.Time"];
int64 Editime = 10 [(gogoproto.jsontag) ="editime", (gogoproto.casttype) = "go-common/library/time.Time"];
int64 Hot = 11 [(gogoproto.jsontag) ="hot"];
int64 BgmID = 12 [(gogoproto.jsontag) ="bgm_id"];
int64 PasterID = 13 [(gogoproto.jsontag) ="paster_id"];
string Oids = 14 [(gogoproto.jsontag) ="oids"];
int64 ScreenSet = 15 [(gogoproto.jsontag) ="screen_set"];
}

View File

@@ -0,0 +1,49 @@
package like
// MissionAward .
type MissionAward struct {
ID int64 `json:"id"`
Award int64 `json:"award"`
Image string `json:"image"`
Name string `json:"name"`
}
// MissionFriends .
type MissionFriends struct {
Mid int64 `json:"mid"`
Name string `json:"name"`
Face string `json:"face"`
}
// MissionRank .
type MissionRank struct {
Lid int64 `json:"lid"`
Score int64 `json:"score"`
Rank int64 `json:"rank"`
}
// MissionLikeAct .
type MissionLikeAct struct {
Mlid int64 `json:"mlid"`
Lottery *Lottery `json:"lottery"`
}
// Lottery .
type Lottery struct {
Code int `json:"code"`
Msg string `json:"msg"`
Data struct {
Name string `json:"name"`
Sponsors string `json:"sponsors"`
SponsorsLogo string `json:"sponsors_logo"`
GiftID int64 `json:"gift_id"`
MessageTitle string `json:"message_title"`
MessageContent string `json:"message_content"`
} `json:"data"`
}
// MissionInfo .
type MissionInfo struct {
HasHelp int64 `json:"has_help"`
HasBuff int64 `json:"has_buff"`
}