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,63 @@
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 = [
"achievement.go",
"params.go",
"point.go",
"user.go",
],
embed = [":bws_go_proto"],
importpath = "go-common/app/interface/main/activity/model/bws",
tags = ["automanaged"],
visibility = ["//visibility:public"],
deps = [
"//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 = "bws_proto",
srcs = ["bws.proto"],
tags = ["automanaged"],
deps = ["@gogo_special_proto//github.com/gogo/protobuf/gogoproto"],
)
go_proto_library(
name = "bws_go_proto",
compilers = ["@io_bazel_rules_go//proto:gogofast_proto"],
importpath = "go-common/app/interface/main/activity/model/bws",
proto = ":bws_proto",
tags = ["automanaged"],
deps = [
"//library/time:go_default_library",
"@com_github_gogo_protobuf//gogoproto:go_default_library",
],
)

View File

@@ -0,0 +1,32 @@
package bws
import "go-common/library/time"
// UserAchieve .
type UserAchieve struct {
ID int64 `json:"id"`
Aid int64 `json:"aid"`
Award int64 `json:"award"`
Ctime time.Time `json:"ctime"`
}
// UserAchieveDetail .
type UserAchieveDetail struct {
*UserAchieve
Name string `json:"name"`
Icon string `json:"icon"`
Dic string `json:"dic"`
LockType int64 `json:"lockType"`
Unlock int64 `json:"unlock"`
Bid int64 `json:"bid"`
IconBig string `json:"icon_big"`
IconActive string `json:"icon_active"`
IconActiveBig string `json:"icon_active_big"`
SuitID int64 `json:"suit_id"`
}
// CountAchieves count achieve
type CountAchieves struct {
Aid int64 `json:"aid"`
Count int64 `json:"count"`
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,65 @@
syntax = "proto3";
package activity.service;
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
option go_package = "bws";
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 Users {
int64 ID = 1 [(gogoproto.jsontag) = "id"];
int64 Mid = 2 [(gogoproto.jsontag) = "mid"];
string Key = 3 [(gogoproto.jsontag) = "key"];
int64 Ctime = 4 [(gogoproto.jsontag) = "ctime", (gogoproto.casttype) = "go-common/library/time.Time"];
int64 Mtime = 5 [(gogoproto.jsontag) = "mtime", (gogoproto.casttype) = "go-common/library/time.Time"];
int64 Bid = 6 [(gogoproto.jsontag) = "bid"];
}
message Point {
int64 ID = 1 [(gogoproto.jsontag) = "id"];
string Name = 2 [(gogoproto.jsontag) = "name"];
string Icon = 3 [(gogoproto.jsontag) = "icon"];
int64 Fid = 4 [(gogoproto.jsontag) = "fid"];
string Image = 5 [(gogoproto.jsontag) = "image"];
int64 Unlocked = 6 [(gogoproto.jsontag) = "unlocked"];
int64 LockType = 7 [(gogoproto.jsontag) = "lockType"];
string Dic = 8 [(gogoproto.jsontag) = "dic"];
string Rule = 9 [(gogoproto.jsontag) = "rule"];
int64 Bid = 10 [(gogoproto.jsontag) = "bid"];
int64 LoseUnlocked = 11 [(gogoproto.jsontag) = "lose_unlocked"];
string OtherIp = 12 [(gogoproto.jsontag) = "other_ip"];
int64 Ower = 13 [(gogoproto.jsontag) = "ower"];
int64 Ctime = 14 [(gogoproto.jsontag) = "ctime", (gogoproto.casttype) = "go-common/library/time.Time"];
int64 Mtime = 15 [(gogoproto.jsontag) = "mtime", (gogoproto.casttype) = "go-common/library/time.Time"];
}
message Points {
repeated Point points = 1;
}
message Achievement {
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 LockType = 5 [(gogoproto.jsontag) = "lockType"];
int64 Unlock = 6 [(gogoproto.jsontag) = "unlock"];
int64 Bid = 7 [(gogoproto.jsontag) = "bid"];
string IconBig = 8 [(gogoproto.jsontag) = "icon_big"];
string IconActive = 9 [(gogoproto.jsontag) = "icon_active"];
string IconActiveBig = 10 [(gogoproto.jsontag) = "icon_active_big"];
int64 Award = 11 [(gogoproto.jsontag) = "award"];
int64 UserCount = 12 [(gogoproto.jsontag) = "user_count"];
int64 Ctime = 13 [(gogoproto.jsontag) = "ctime", (gogoproto.casttype) = "go-common/library/time.Time"];
int64 Mtime = 14 [(gogoproto.jsontag) = "mtime", (gogoproto.casttype) = "go-common/library/time.Time"];
string Image = 15 [(gogoproto.jsontag) = "image"];
int64 SuitID = 16 [(gogoproto.jsontag) = "suit_id"];
}
message Achievements {
repeated Achievement achievements = 1;
}

View File

@@ -0,0 +1,43 @@
package bws
// GameRes .
const (
GameResWin = 1
GameResFail = 2
)
// ParamPoints points param
type ParamPoints struct {
Bid int64 `form:"bid" validate:"required"`
Tp int64 `form:"tp"`
}
// ParamID point or achievements id param
type ParamID struct {
Bid int64 `form:"bid" validate:"required"`
ID int64 `form:"id"`
Day string `form:"day"`
}
// ParamAward point or achievements id param
type ParamAward struct {
Bid int64 `form:"bid" validate:"required"`
Aid int64 `form:"aid" validate:"required"`
Key string `form:"key"`
Mid int64 `form:"mid"`
}
// ParamBinding binding param
type ParamBinding struct {
Bid int64 `form:"bid" validate:"required"`
Key string `form:"key" validate:"required"`
}
// ParamUnlock .
type ParamUnlock struct {
Bid int64 `form:"bid" validate:"required"`
Pid int64 `form:"pid" validate:"required"`
Key string `form:"key"`
Mid int64 `form:"mid"`
GameResult int `form:"game_result"`
}

View File

@@ -0,0 +1,26 @@
package bws
import "go-common/library/time"
// UserPoint .
type UserPoint struct {
ID int64 `json:"id"`
Pid int64 `json:"pid"`
Points int64 `json:"points"`
Ctime time.Time `json:"ctime"`
}
// UserPointDetail .
type UserPointDetail struct {
*UserPoint
Name string `json:"name"`
Icon string `json:"icon"`
Fid int64 `json:"fid"`
Image string `json:"image"`
Unlocked int64 `json:"unlocked"`
LoseUnlocked int64 `json:"lose_unlocked"`
LockType int64 `json:"lockType"`
Dic string `json:"dic"`
Rule string `json:"rule"`
Bid int64 `json:"bid"`
}

View File

@@ -0,0 +1,30 @@
package bws
// User .
type User struct {
User *UserInfo `json:"user"`
Achievements []*UserAchieveDetail `json:"achievements"`
Items map[string][]*UserPointDetail `json:"items"`
}
// UserInfo .
type UserInfo struct {
Mid int64 `json:"mid"`
Name string `json:"name"`
Key string `json:"key"`
Face string `json:"face"`
Hp int64 `json:"hp"`
}
// LotteryUser .
type LotteryUser struct {
Mid int64 `json:"mid"`
Name string `json:"name"`
Face string `json:"face"`
}
// AdminInfo .
type AdminInfo struct {
IsAdmin bool `json:"is_admin"`
Point interface{} `json:"point"`
}