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,52 @@
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",
)
proto_library(
name = "version_proto",
srcs = ["version.proto"],
tags = ["automanaged"],
)
go_proto_library(
name = "version_go_proto",
compilers = ["@io_bazel_rules_go//proto:go_proto"],
importpath = "go-common/app/interface/main/app-resource/model/version",
proto = ":version_proto",
tags = ["automanaged"],
)
go_library(
name = "go_default_library",
srcs = ["version.go"],
embed = [":version_go_proto"],
importpath = "go-common/app/interface/main/app-resource/model/version",
tags = ["automanaged"],
visibility = ["//visibility:public"],
deps = [
"//library/time: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"],
)

View File

@@ -0,0 +1,123 @@
package version
import (
xtime "go-common/library/time"
"strings"
)
const (
PlatAndroid = int8(0)
PlatIPhone = int8(1)
PlatIPad = int8(2)
PlatWinPhone = int8(3)
)
type Version struct {
Id int `json:"-"`
Plat int8 `json:"plat"`
Desc string `json:"desc"`
Version string `json:"version"`
Build int `json:"build"`
PTime xtime.Time `json:"ptime"`
}
type VersionUpdate struct {
Id int `json:"-"`
Channel string `json:"-"`
Coverage int `json:"-"`
Version string `json:"ver"`
Build int `json:"build"`
Desc string `json:"info"`
State int `json:"-"`
Size string `json:"size"`
Url string `json:"url"`
MD5 string `json:"hash"`
SdkInts string `json:"-"`
SdkIntList map[string]struct{} `json:"-"`
Model string `json:"-"`
Policy int `json:"policy"`
Plat int8 `json:"-"`
IsForce int `json:"is_force"`
IsPush int `json:"is_push"`
PolicyName string `json:"-"`
IsGray int `json:"is_gray"`
PolicyURL string `json:"policy_url,omitempty"`
BuvidStart int `json:"-"`
BuvidEnd int `json:"-"`
Mtime xtime.Time `json:"mtime"`
Incre *Incremental `json:"patch,omitempty"`
}
type UpdateLimit struct {
ID int `json:"-"`
BuildLimit int `json:"-"`
Conditions string `json:"-"`
}
type VersionSo struct {
Id int `json:"-"`
Package string `json:"-"`
Name string `json:"-"`
Description string `json:"-"`
Clear int `json:"-"`
Ver_code int `json:"ver_code"`
Ver_name string `json:"ver_name"`
Url string `json:"url"`
Size int `json:"size"`
Enable_state int `json:"enable"`
Force_state int `json:"force"`
Md5 string `json:"md5"`
Min_build int `json:"min_build"`
Coverage int `json:"-"`
Sdkint int `json:"-"`
Model string `json:"-"`
}
type VersionSoDesc struct {
Package string `json:"package"`
Name string `json:"name"`
Description string `json:"desc"`
Clear int `json:"clear"`
Versions []*VersionSo `json:"versions"`
}
// Incremental version Incremental
type Incremental struct {
ID int `json:"-"`
TargetVersion string `json:"-"`
TargetBuild int `json:"-"`
TargetID string `json:"new_id"`
SourceVersion string `json:"-"`
SourceBuild int `json:"-"`
SourceID string `json:"old_id"`
TaskID string `json:"-"`
FilePath string `json:"-"`
URL string `json:"url"`
Md5 string `json:"md5"`
Size int `json:"size"`
Policy int `json:"-"`
Plat int8 `json:"-"`
Build int `json:"-"`
}
// Rn
type Rn struct {
ID int `json:"-"`
DeploymentKey string `json:"-"`
BundleID string `json:"bundle_id"`
URL string `json:"url"`
Md5 string `json:"md5"`
Size int `json:"size"`
Version string `json:"-"`
}
// VersionUpdateChange version update change
func (v *VersionUpdate) VersionUpdateChange() {
if v.SdkInts != "" {
v.SdkIntList = map[string]struct{}{}
tmp := strings.Split(v.SdkInts, ",")
for _, sdkint := range tmp {
v.SdkIntList[sdkint] = struct{}{}
}
}
}

View File

@@ -0,0 +1,70 @@
// Code generated by protoc-gen-go.
// source: version.proto
// DO NOT EDIT!
/*
Package version is a generated protocol buffer package.
It is generated from these files:
version.proto
It has these top-level messages:
VerUpdate
*/
package version
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
type VerUpdate struct {
Ver string `protobuf:"bytes,1,opt,name=ver" json:"ver,omitempty"`
Build int32 `protobuf:"varint,2,opt,name=build" json:"build,omitempty"`
Info string `protobuf:"bytes,3,opt,name=info" json:"info,omitempty"`
Size int32 `protobuf:"varint,4,opt,name=size" json:"size,omitempty"`
Url string `protobuf:"bytes,5,opt,name=url" json:"url,omitempty"`
Hash string `protobuf:"bytes,6,opt,name=hash" json:"hash,omitempty"`
Policy int32 `protobuf:"varint,7,opt,name=policy" json:"policy,omitempty"`
IsForce int32 `protobuf:"varint,8,opt,name=isForce" json:"isForce,omitempty"`
IsGray int32 `protobuf:"varint,9,opt,name=isGray" json:"isGray,omitempty"`
Mtime int64 `protobuf:"varint,10,opt,name=mtime" json:"mtime,omitempty"`
}
func (m *VerUpdate) Reset() { *m = VerUpdate{} }
func (m *VerUpdate) String() string { return proto.CompactTextString(m) }
func (*VerUpdate) ProtoMessage() {}
func (*VerUpdate) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
func init() {
proto.RegisterType((*VerUpdate)(nil), "version.VerUpdate")
}
func init() { proto.RegisterFile("version.proto", fileDescriptor0) }
var fileDescriptor0 = []byte{
// 196 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x34, 0x8f, 0xcb, 0x8a, 0xc3, 0x30,
0x0c, 0x45, 0xc9, 0xe4, 0x35, 0x11, 0x0c, 0x0c, 0x66, 0x18, 0xb4, 0x2c, 0x5d, 0x75, 0xd5, 0x4d,
0xff, 0xa1, 0xdd, 0x07, 0xda, 0x7d, 0x1e, 0x2e, 0x11, 0x24, 0x71, 0xb0, 0x93, 0x42, 0xfa, 0xb7,
0xfd, 0x93, 0x5a, 0x72, 0xba, 0x3b, 0x47, 0xba, 0x57, 0xd8, 0xf0, 0xf3, 0xd0, 0xd6, 0x91, 0x19,
0x8f, 0x93, 0x35, 0xb3, 0x51, 0xf9, 0xa6, 0xfb, 0x57, 0x04, 0xc5, 0x4d, 0xdb, 0xeb, 0xd4, 0x56,
0xb3, 0x56, 0xbf, 0x10, 0xfb, 0x05, 0x46, 0xbb, 0xe8, 0x50, 0x94, 0x8c, 0xea, 0x0f, 0xd2, 0x7a,
0xa1, 0xbe, 0xc5, 0x2f, 0x3f, 0x4b, 0xcb, 0x20, 0x4a, 0x41, 0x42, 0xe3, 0xdd, 0x60, 0x2c, 0x41,
0x61, 0x9e, 0x39, 0x7a, 0x6a, 0x4c, 0x24, 0x28, 0xcc, 0xf7, 0x16, 0xdb, 0x63, 0x1a, 0xee, 0x79,
0xe4, 0x54, 0x57, 0xb9, 0x0e, 0xb3, 0xd0, 0x64, 0x56, 0xff, 0x90, 0x4d, 0xa6, 0xa7, 0x66, 0xc5,
0x5c, 0xba, 0x9b, 0x29, 0x84, 0x9c, 0xdc, 0xd9, 0xd8, 0x46, 0xe3, 0xb7, 0x2c, 0x3e, 0xca, 0x0d,
0x72, 0x17, 0x5b, 0xad, 0x58, 0x84, 0x46, 0x30, 0x7e, 0xed, 0x30, 0xd3, 0xa0, 0x11, 0xfc, 0x38,
0x2e, 0x83, 0xd4, 0x99, 0xfc, 0xf9, 0xf4, 0x0e, 0x00, 0x00, 0xff, 0xff, 0x5a, 0x56, 0x88, 0xe5,
0x04, 0x01, 0x00, 0x00,
}

View File

@@ -0,0 +1,15 @@
syntax = "proto3";
package version;
message VerUpdate{
string ver=1;
int32 build=2;
string info=3;
int32 size=4;
string url=5;
string hash=6;
int32 policy=7;
int32 isForce=8;
int32 isGray=9;
int64 mtime=10;
}