README.md 3.8 KB
Newer Older
M
monomania 已提交
1 2 3 4 5 6 7 8 9
## 项目介绍
    究极足球爱好者,平时也会去体彩店支持一下国足,或是自己喜欢的球队.
    入了门道,就想结合一下所学所专,尝试着分析预测一下足球比赛.最近命中率感觉还可以阿.
    娱乐娱乐!!!

## 技术选型
* [xorm](https://github.com/go-xorm/xorm)
* [go_spider](https://github.com/hu17889/go_spider)
* [beego](https://github.com/astaxie/beego)
M
monomania 已提交
10
* [walk](https://github.com/lxn/walk)
M
monomania 已提交
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89

## 项目结构
~~~
foot-parent
|-- foot-api            实体类模块
|   |-- common          公共工具
|   |   `-- base        基础工具
|   `-- module          业务模块
|       `-- core
|-- foot-core           后台核心模块
|   |-- common          公共工具
|   |   |-- base        基础工具
|   |   |-- log         日志工具
|   |   `-- pinyin      拼音转换工具
|   |-- conf            配置文件
|   |-- module          业务模块            
|   |   `-- core
|   `-- test
|       `-- bson
|-- foot-spider         爬虫模块
|   |-- common          公共工具              
|   |   `-- base        基础工具
|   |-- conf            配置文件
|   |-- launch          爬虫启动类
|   `-- module          业务模块
|       `-- gushiwen
`-- foot-web            http服务模块
|    |-- common         公共工具
|    |   |-- base       基础工具
|    |   |-- fliters    过滤器        
|    |   `-- routers    路由配置
|    |-- conf           配置文件
|    |-- module         业务模块
|    |   |-- core
|    |   |-- index
|    |   `-- spider
|    `-- test
~~~
## 模块依赖
  
  | 模块名    |  依赖模块     |
  | --------    | :----:   |
  | foot-api  |无|
  | foot-core  |foot-api|
  | foot-spider  |foot-api oem-core|
  | foot-web  |foot-api foot-core foot-spider|
   


## 实现功能
* 当前比赛的获取
* 当前亚赔的获取
* 当前欧赔的获取
* 历史欧赔的获取
* 欧赔的分析预测
* 亚欧赔率的分析预测


    ```
    本项目仅作娱乐研究参考所用,请勿使用到非法途径,
    ```

## 使用教程

* 配置环境
  * 安装 go
    * 配置GOPATH
  * 环境变量
    
  | 变量名称=值    |  说明     |
  | --------    | :----:   |
  | GO111MODULE=on  |开启go mod模块支持|
  | GOPROXY=https://goproxy.cn,direct     |依赖包下载代理地址|
  | GOSUMDB=sum.golang.google.cn     |包的哈希值校验地址|
  
* 导入项目到[JetBrains GoLand](https://www.jetbrains.com/go/)并启用go mod
    ![](https://oscimg.oschina.net/oscnet/265bf76794ead3bac4c19a38dc4dbbe8bbb.png "go mod")
* 下载资源包
    ```
90 91 92 93
      cd ./foot-api && go mod tidy
      cd ../foot-core && go mod tidy
      cd ../foot-spider && go mod tidy
      cd ../foot-web && go mod tidy
M
monomania 已提交
94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117
    ```
* 手动创建数据库
  
  数据库名为: foot 
* 配置数据库连接
  
  * 各模块的conf下的 mysql.ini文件修改配置
    * ./foot-core/conf/mysql.ini
    * ./foot-spider/conf/mysql.ini
    * ./foot-web/conf/mysql.ini
* 同步数据库表

  运行入口: ./foot-core/FC000Application.go
  ```
    注意运行时: working directory需为 ****/foot-parent/foot-core 下
  ```  
  ![](https://oscimg.oschina.net/oscnet/6aeea26d87faf8cc37c7a8de61d29f6c1e5.png "working directory")
* 执行爬取数据

   运行入口: ./foot-spider/FS000Application.go
   
* 启动http服务

   运行入口: ./foot-web/FW000Application.go
M
monomania 已提交
118 119 120 121 122 123 124 125 126
* windows gui程序

   运行入口: ./foot-web/gui自行生成

    ```
    exe文件生成命令:go build -ldflags="-H windowsgui" 或者 go build
    ```

   
M
monomania 已提交
127 128 129
  
* 联系作者
<table>
130 131 132
  <tr align="center">
    <td><img height="256" width="200" src="https://oscimg.oschina.net/oscnet/917bee8edddbf16a7645a56d085e887a59f.jpg"/></td> 
    <td><img height="256" width="200" src="https://oscimg.oschina.net/oscnet/aaf253aa4757b62af61036493f6fba683c2.jpg"/></td> 
M
monomania 已提交
133 134 135
  </tr>
</table>