1 Star 0 Fork 2

aq2.cn / poem-parent

forked from aoe5188 / poem-parent 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

项目介绍

最近沉迷于古诗文的阅读上,细品其中,沉迷其中.
但平时阅读上感觉还是不大方便,故此有这个项目.
项目中尽可能的保留了自己在Java上的一些编码习惯,
如三层结构:model层 service层,controller层,贴近实际工作开发需要.
希望可以对目前为Java开发者有需要转向go的朋友提供一个参考.
如果该项目对您有帮助,请您给一个star吧.

技术选型

项目结构

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

模块依赖

模块名 依赖模块
poem-api
poem-core poem-api
poem-spider poem-api oem-core
poem-web poem-api poem-core poem-spider

实现功能

  • 诗人数据的获取

  • 诗句数据的获取

  • 古籍数据的获取

  • 名句数据的获取

  • http api 分页接口提供

    项目为一次尝试转换练习,主要是将java的编写习惯尝试转换到go的开发上.仅作学习参考使用.

功能计划

  • 完善后台api提供
  • 对接flutter版的poem-app

使用教程

  • 配置环境

    • 安装 go
    • 环境变量
    变量名称=值 说明
    GO111MODULE=on 开启go mod模块支持
    GOPROXY=https://goproxy.cn,direct 依赖包下载代理地址
    GOSUMDB=sum.golang.google.cn 包的哈希值校验地址
  • 导入项目到JetBrains GoLand并启用go mod

  • 下载资源包

      cd ./poem-api && go mod tidy
      cd ../poem-core && go mod tidy
      cd ../poem-spider && go mod tidy
      cd ../poem-web && go mod tidy
  • 手动创建数据库

    数据库名为: poem

  • 配置数据库连接

    • 各模块的conf下的 mysql.ini文件修改配置
      • ./poem-core/conf/mysql.ini
      • ./poem-spider/conf/mysql.ini
      • ./poem-web/conf/mysql.ini
  • 同步数据库表

    运行入口: ./poem-core/PC000Application.go

      注意运行时: working directory需为 ****/poem-parent/poem-core 下

  • 执行爬取数据

    运行入口: ./poem-spider/PS000Application.go

  • 启动http服务

    运行入口: ./poem-web/PW000Application.go

  • 联系作者

MIT License Copyright (c) 2019 monomania Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

对go语言的go orm spider web开发的一次实践. 展开 收起
Go
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
Go
1
https://gitee.com/go2019/poem-parent.git
git@gitee.com:go2019/poem-parent.git
go2019
poem-parent
poem-parent
master

搜索帮助