Skip to content

Commit

Permalink
First commit
Browse files Browse the repository at this point in the history
  • Loading branch information
wenerme committed Sep 20, 2017
1 parent 6154999 commit a435ddb
Show file tree
Hide file tree
Showing 6 changed files with 568 additions and 0 deletions.
70 changes: 70 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Created by .ignore support plugin (hsz.mobi)
### Go template
# Binaries for programs and plugins
*.exe
*.dll
*.so
*.dylib

# Test binary, build with `go test -c`
*.test

# Output of the go coverage tool, specifically when used with LiteIDE
*.out

# Project-local glide cache, RE: https://github.com/Masterminds/glide/issues/736
.glide/
### JetBrains template
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# User-specific stuff:
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/dictionaries

# Sensitive or high-churn files:
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.xml
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml

# Gradle:
.idea/**/gradle.xml
.idea/**/libraries

# CMake
cmake-build-debug/

# Mongo Explorer plugin:
.idea/**/mongoSettings.xml

## File-based project format:
*.iws

## Plugin-specific files:

# IntelliJ
out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Cursive Clojure plugin
.idea/replstate.xml

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties

ignored
.idea/
*.dat
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
# telattr
Telephone Attribution

## Dev
```bash
# Generate proto data
go-bindata -pkg data_proto -o data_proto/bindata.go phone.pb
```
235 changes: 235 additions & 0 deletions data_proto/bindata.go

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions data_proto/init.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package data_proto

import "github.com/wenerme/telattr"

// func Asset(name string) ([]byte, error) {
func init() {
b, err := Asset("phone.pb")
if err != nil {
panic(err)
}
telattr.ProtoData = b
telattr.MustInit()
}
207 changes: 207 additions & 0 deletions genproto/v1/phonedata/phone_data.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

37 changes: 37 additions & 0 deletions phone_data.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
syntax = "proto3";
package wener.teleattr.v1;

option go_package = "github.com/wenerme/teleattr/genproto/v1/phonedata;phonedata";
option java_multiple_files = true;
option java_outer_classname = "PhoneDataProto";
option java_package = "com.github.wenerme.teleattr.v1.phonedata";
option objc_class_prefix = "WAPI";

message PhoneData {
string version = 1;
repeated Record records = 2;
repeated Index indexes = 3;
}

message Record {
string province = 1;
string city = 2;
string zip = 3;
string zone = 4;
}

message Index {
int32 prefix = 1;
int32 record_index = 2;
Vendor vendor = 3;
}

enum Vendor {
UNKNOWN = 0;
CMCC = 1; //中国移动
CUCC = 2; //中国联通
CTCC = 3; //中国电信
CTCC_V = 4; //电信虚拟运营商
CUCC_V = 5; //联通虚拟运营商
CMCC_V = 6; //移动虚拟运营商
}

0 comments on commit a435ddb

Please sign in to comment.