dao

command module
v0.0.0-...-3446103 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 22, 2022 License: MIT Imports: 1 Imported by: 0

README

DAO - 经济数据库

根据公开信息实现的本地指标系统,方便查看和编写指标,追踪经济走势

English | 简体中文

目录

TODOList

Name ⭕ - ✔️
沪深300市盈率 ✔️
中美国债2、5、10、30年收益率 ✔️
社会融资总量 Total social financing ✔️
社会融资存量 Total social Stock ✔️
货币供应 M0 M1 M2(Money Supply) ✔️
社会消费品零售总额 Retail Sales of Consumer Goods ✔️
期货 伦铜:CAD ✔️
PPI ✔️
GDP ✔️
CPI ✔️
国家统计局制造业采购经理人指数 NBS manufacturing PMI ✔️
国家统计局非制造业采购经理人指数 NBS non-manufacturing PMI ✔️
财新制造业采购经理人指数 Caixin manufacturing PMI ✔️
财新服务采购经理人指数 Caixin service PM ✔️
工业生产 Industrial Production ✔️
电力生产与消费 Electricity Production and Consumption ✔️
存贷款 Loan and Deposit ✔️
外汇储备 Foreign Exchange Reseres ✔️
铁路货运 Rail Freight Traffic ✔️
服务贸易 Service Trade
工业利润 Industrial profits
国内生产总值平减指数 GDP Deflator
商品贸易 Merchandise Trade
政府收支及收支平衡 Government Revenue, Expenditure and Balance
国际收支平衡 Balance of Payments
库存房 Home inventory
房屋销售 Home Sales
房屋开工、在建和竣工 Housing Starts, Under Construction and Completion
土地收购、交易和发展 Land Acquisition, Transaction and Development
地价指数 Land Price Indices
房地产开发投资 Investment in Real Estate Development ✔️
固定资产投资 Fixed Asset Investment ✔️
汽车销售 Auto Sales
物业价格指数 Property Price Index
家庭收入调查 Household Income Survey
家庭支出调查 Household Expenditure Survey
国家外债 External Debt ✔️
就业总人数 Total Employment
城镇登记失业率 Urban Registered Unemployment Rate
城镇单位职工平均/总工资 Average/total wage of Employees in Urban Units
农民工平均收入 Average income of migrant workers

开始

要启动本项目,你需要以下步骤

前提条件

chromedp库,需要先安装chrome

### 下载源加入到系统的源列表
sudo wget <http://www.linuxidc.com/files/repo/google-chrome.list> -P /etc/apt/sources.list.d/

# 导入谷歌软件公钥
wget -q -O - <https://dl.google.com/linux/linux_signing_key.pub>  | sudo apt-key add -

### 更新列表
sudo apt-get update

## 安装chrome
sudo apt-get install google-chrome-stable
安装
git clone https://github.com/chenhaonan-eth/dao.git

cd dao

make build
启动
make start
使用
 # HTTP
 curl -X GET http://localhost:50053/v1/macroscopic/futures_foreign_hist/CAD
 // gRPC
 package main

 import (
     "log"

     pb "github.com/chenhaonan-eth/dao/proto/server"
     "golang.org/x/net/context"
     "google.golang.org/grpc"
     "google.golang.org/grpc/credentials/insecure"
 )

 func main() {
     conn, err := grpc.Dial(":50052", grpc.WithTransportCredentials(insecure.NewCredentials()))
     if err != nil {
         log.Fatal(err)
     }
     defer conn.Close()
     c := pb.NewGreeterClient(conn)
     context := context.Background()
     body := &pb.FturesFoewignRequest{
         Symbol: "CAD",
     }

     r, err := c.GetFuturesForeignHist(context, body)
     if err != nil {
         log.Println(err)
     }
     log.Println(r.Results)
 }

目录说明

 ├─ biz            // 业务处理
 ├─ client         // gRPC 客户端演示
 ├─ cmd
 │  ├─ app         //cobra
 │  ├─ gormgen     //生成DB代码
 ├─ config         //zaplog、viper
 ├─ dal
 │  ├─ initialize  //初始化数据库
 │  ├─ model       //存放所有数据模型
 │  ├─ query       //gorm-gen生成的CURD代码
 ├─ economic       //经济指标数据获取
 │  ├─ ftures      //期货
 │  ├─ macroscopic //宏观经济
 ├─ pkg            //外部包
 ├─ proto          //gRPC、grpc-gateway生成的代码
 ├─ server         //gRPC、grpc-gateway服务
 ├─ spider         //定时爬虫更新数据

SwaggerUi

http://0.0.0.0:50053/openapiv2/server.swagger.json

http://0.0.0.0:50053/swagger-ui/

感谢

Akshare

Finance Sina

数据均来自网络公开数据。

License

表示您的支持

如果这个项目带给您一点帮忙,请点个 ⭐️

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
cmd
app
dal
model
定义的数据模型,使用dorm gen可生成model的CURD 已定义好执行脚本 generate_gorm_gen_code.sh
定义的数据模型,使用dorm gen可生成model的CURD 已定义好执行脚本 generate_gorm_gen_code.sh
周期经济指标
周期经济指标
ftures
期货
期货
macroscopic
宏观数据-中国
宏观数据-中国
pkg
ui/data/swagger
Package swagger generated by go-bindata.// sources: third_party/swagger-ui/favicon-16x16.png third_party/swagger-ui/favicon-32x32.png third_party/swagger-ui/index.css third_party/swagger-ui/index.html third_party/swagger-ui/oauth2-redirect.html third_party/swagger-ui/swagger-initializer.js third_party/swagger-ui/swagger-ui-bundle.js third_party/swagger-ui/swagger-ui-bundle.js.map third_party/swagger-ui/swagger-ui-es-bundle-core.js third_party/swagger-ui/swagger-ui-es-bundle-core.js.map third_party/swagger-ui/swagger-ui-es-bundle.js third_party/swagger-ui/swagger-ui-es-bundle.js.map third_party/swagger-ui/swagger-ui-standalone-preset.js third_party/swagger-ui/swagger-ui-standalone-preset.js.map third_party/swagger-ui/swagger-ui.css third_party/swagger-ui/swagger-ui.css.map third_party/swagger-ui/swagger-ui.js third_party/swagger-ui/swagger-ui.js.map
Package swagger generated by go-bindata.// sources: third_party/swagger-ui/favicon-16x16.png third_party/swagger-ui/favicon-32x32.png third_party/swagger-ui/index.css third_party/swagger-ui/index.html third_party/swagger-ui/oauth2-redirect.html third_party/swagger-ui/swagger-initializer.js third_party/swagger-ui/swagger-ui-bundle.js third_party/swagger-ui/swagger-ui-bundle.js.map third_party/swagger-ui/swagger-ui-es-bundle-core.js third_party/swagger-ui/swagger-ui-es-bundle-core.js.map third_party/swagger-ui/swagger-ui-es-bundle.js third_party/swagger-ui/swagger-ui-es-bundle.js.map third_party/swagger-ui/swagger-ui-standalone-preset.js third_party/swagger-ui/swagger-ui-standalone-preset.js.map third_party/swagger-ui/swagger-ui.css third_party/swagger-ui/swagger-ui.css.map third_party/swagger-ui/swagger-ui.js third_party/swagger-ui/swagger-ui.js.map
proto
server
Package server is a reverse proxy.
Package server is a reverse proxy.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL