Skip to content

Commit 6b162be

Browse files
committed
init
0 parents  commit 6b162be

File tree

520 files changed

+57279
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

520 files changed

+57279
-0
lines changed

.ci.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
trigger:
2+
branches:
3+
include:
4+
- '**'
5+
6+
mr:
7+
branches:
8+
include:
9+
- '**'
10+
11+
stages:
12+
- stage:
13+
- job:
14+
steps:
15+
- taskType: marketBuild@latest
16+
displayName: 腾讯代码分析(最新)
17+
inputs:
18+
atomCode: CodeccCheckAtomDebug
19+
version: 4.*
20+
data:
21+
input:
22+
languages:
23+
- GOLANG
24+
- JS
25+
checkerSetType: openScan
26+
toolScanType: 0
27+
languageRuleSetMap:
28+
GOLANG_RULE:
29+
- standard_go
30+
- standard_js
31+
- standard_js_preferable
32+
- job:
33+
pool:
34+
container: mirrors.tencent.com/dbpaas/tlinux-2.2-golang-1.15:latest
35+
steps:
36+
- taskType: bash@latest
37+
inputs:
38+
scriptType: SHELL
39+
content: |
40+
#!/bin/bash
41+
go test -gcflags "all=-N -l" --tags=json1 -covermode=atomic ./... -bench . -benchmem --args omit_gorm_debug
42+
- taskType: bash@latest
43+
inputs:
44+
scriptType: SHELL
45+
content: |
46+
#!/bin/bash
47+
go vet -httpresponse -assign -nilfunc -printf -unreachable -atomic ./...

.github/workflows/go.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Go
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
tags: [ v* ]
7+
pull_request:
8+
branches: [ main ]
9+
10+
jobs:
11+
12+
build:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v2
16+
17+
- name: Set up Go
18+
uses: actions/setup-go@v2
19+
with:
20+
go-version: 1.15
21+
22+
- name: Build
23+
run: go build -v ./...
24+
25+
- name: Test
26+
run: |
27+
go test -gcflags "all=-N -l" --tags=json1 -covermode=atomic ./... -bench . -benchmem --args omit_gorm_debug
28+
go vet -httpresponse -assign -nilfunc -printf -unreachable -atomic ./...

.github/workflows/vuepress.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Vuepress
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
7+
jobs:
8+
9+
build-and-deploy:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@master
14+
15+
- name: Vuepress deploy
16+
uses: jenkey2011/[email protected]
17+
env:
18+
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
19+
BUILD_SCRIPT: cd docs && yarn && yarn martech
20+
BUILD_DIR: dist

.gitignore

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
.idea
2+
.DS_Store
3+
node_modules
4+
ignore
5+
datacube/*/target
6+
datacube/datacube-common/datacube-common.iml
7+
datacube/datacube-flatten/datacube-flatten.iml
8+
datacube/datacube-join/datacube-join.iml
9+
datacube/datacube-proto/datacube-proto.iml
10+
datacube/datacube-service/datacube-service.iml
11+
datacube/ug-datacube.iml
12+
cmd/web/sqlite.db
13+
cmd/web/dist
14+
cmd/web/docs

Dockerfile

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
FROM node:alpine3.12 as builder1
2+
WORKDIR /app
3+
ADD . .
4+
RUN cd web && yarn && yarn build
5+
6+
FROM golang:alpine as builder2
7+
RUN apk add --no-cache git make build-base ffmpeg
8+
WORKDIR /app
9+
ADD . .
10+
RUN go install -v cmd/web/web.go && \
11+
go install -v cmd/rta/server/rta_server.go
12+
13+
ENTRYPOINT ["./web"]
14+
15+
FROM alpine:latest
16+
ENV TZ "PRC"
17+
RUN apk add --no-cache ffmpeg
18+
WORKDIR /app
19+
COPY --from=builder1 /app/web/dist dist
20+
COPY --from=builder2 /go/bin/. .
21+
COPY --from=builder2 /app/configs/. .
22+
COPY --from=builder2 /app/docs docs
23+
ENTRYPOINT ["./web"]

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2021 腾讯广告开放平台
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

api/proto/README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
## Proto
2+
3+
proto编译出来的.pb.go文件会一并放到代码库,这里说明对应工具的安装和使用
4+
5+
## 编译
6+
7+
### step 1
8+
9+
安装protoc工具,推荐使用版本[3.7.1](https://github.com/protocolbuffers/protobuf/releases/tag/v3.7.1)
10+
11+
### step 2
12+
安装protoc golang插件
13+
14+
```bash
15+
GIT_TAG="v1.3.2"
16+
go get -d -u github.com/golang/protobuf/protoc-gen-go
17+
cd "$(go env GOPATH)"/src/github.com/golang/protobuf && git fetch --tag && git checkout "$GIT_TAG"
18+
go install github.com/golang/protobuf/protoc-gen-go
19+
```
20+
21+
### step 3
22+
编译proto文件,在项目根目录上级
23+
24+
```bash
25+
protoc --go_out=. --go_opt=paths=source_relative --go_opt=plugins=grpc ug/api/proto/targeting/targeting_be.proto
26+
```
27+
28+
具体使用方法参考 [https://github.com/golang/protobuf](https://github.com/golang/protobuf)

api/proto/novelty/novelty.pb.go

Lines changed: 150 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/proto/novelty/novelty.proto

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
syntax = "proto3";
2+
3+
package novelty;
4+
5+
option go_package = "github.com/tencentad/martech/api/proto/novelty";
6+
option java_package = "com.tencent.ug.proto.novelty";
7+
8+
message Novelty {
9+
Click click = 1;
10+
}
11+
12+
message Click {
13+
uint64 day_click_count = 1; // 当天点击次数
14+
int64 last_click_day = 2; // 上次点击发生的天,timestamp % 86400
15+
uint64 accumulate_click_count = 3; // 累计点击次数
16+
int64 last_click_timestamp = 4; // 上次点击时间
17+
}

0 commit comments

Comments
 (0)