Skip to content

Commit

Permalink
update host url
Browse files Browse the repository at this point in the history
  • Loading branch information
axiaoxin committed Dec 28, 2023
1 parent aa3d106 commit ea48c92
Show file tree
Hide file tree
Showing 14 changed files with 95 additions and 64 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
[![GitHub release](https://img.shields.io/github/release/axiaoxin-com/investool.svg)](https://gitHub.com/axiaoxin-com/investool/releases/)
[![Github all releases](https://img.shields.io/github/downloads/axiaoxin-com/investool/total.svg)](https://gitHub.com/axiaoxin-com/investool/releases/)

[![](./statics/img/sidenav_icon.png)](http://investool.axiaoxin.com?from=github)
[![](./statics/img/sidenav_icon.png)](http://axiaoxin.com/investool?from=github)

<http://investool.axiaoxin.com?from=github>
<http://axiaoxin.com/investool?from=github>

InvesTool 项目是使用 Golang 实现的个人投资分析工具,主要是为了提高按基本面选股和基金筛选的效率工具。最初是本地的脚本,后来使用 Golang 实现提供命令行版本,目前主要以 Web 网页版为主实现相关功能。数据来源于东方财富网、亿牛网、新浪财经、天天基金。

Expand Down Expand Up @@ -46,7 +46,7 @@ InvesTool 要解决的问题是,在使用东方财富选股器按设置的条
- 完善命令行使用方式,筛选参数和检测参数支持命令行自定义
- 支持负债流动比检测
- 支持现金流检测
- 提供 WEB 界面操作 <http://investool.axiaoxin.com?from=github>
- 提供 WEB 界面操作 <http://axiaoxin.com/investool?from=github>
- 支持基金 4433 筛选
- 自定义基金筛选
- 基金检测
Expand Down Expand Up @@ -149,7 +149,7 @@ InvesTool 要解决的问题是,在使用东方财富选股器按设置的条
- 支持 4433 指标的灵活配置,可以按自定义排名值进行筛选
- 由于基金规模太小有存在清盘风险,规模太大不利于基金经理的灵活调仓,所以筛选 4433 时支持对基金规模进行筛选。建议值为 2-50 亿

当前基金筛选、检测等操作目前只支持 WEB 界面操作<http://investool.axiaoxin.com/fund?from=github>,命令行暂未支持。
当前基金筛选、检测等操作目前只支持 WEB 界面操作<http://axiaoxin.com/investool/fund?from=github>,命令行暂未支持。

# 使用方法

Expand All @@ -165,7 +165,7 @@ NAME:
USAGE:
该程序不构成任何投资建议,程序只是个人辅助工具,具体分析仍然需要自己判断。
官网地址: http://investool.axiaoxin.com
官网地址: http://axiaoxin.com/investool
VERSION:
0.0.7
Expand Down
1 change: 1 addition & 0 deletions config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ env = "localhost"
pprof = true
# 开启 prometheus metrics
metrics = true
host_url = ""



Expand Down
1 change: 1 addition & 0 deletions routes/about.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ func About(c *gin.Context) {
"Env": viper.GetString("env"),
"Version": version.Version,
"PageTitle": "InvesTool | 关于",
"HostURL": viper.GetString("server.host_url"),
}
c.HTML(http.StatusOK, "about.html", data)
return
Expand Down
1 change: 1 addition & 0 deletions routes/comment.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ func Comment(c *gin.Context) {
"Env": viper.GetString("env"),
"Version": version.Version,
"PageTitle": "InvesTool | 留言",
"HostURL": viper.GetString("server.host_url"),
}
c.HTML(http.StatusOK, "comment.html", data)
return
Expand Down
22 changes: 19 additions & 3 deletions routes/fund.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ func FundIndex(c *gin.Context) {
if err := c.ShouldBind(&p); err != nil {
data := gin.H{
"Env": viper.GetString("env"),
"HostURL": viper.GetString("server.host_url"),
"Version": version.Version,
"PageTitle": "InvesTool | 基金",
"Error": err.Error(),
Expand All @@ -57,9 +58,10 @@ func FundIndex(c *gin.Context) {
result := fundList[pagi.StartIndex:pagi.EndIndex]
data := gin.H{
"Env": viper.GetString("env"),
"HostURL": viper.GetString("server.host_url"),
"Version": version.Version,
"PageTitle": "InvesTool | 基金",
"URLPath": "/fund",
"URLPath": viper.GetString("server.host_url") + "/fund",
"FundList": result,
"Pagination": pagi,
"IndexParam": p,
Expand Down Expand Up @@ -100,6 +102,7 @@ func FundFilter(c *gin.Context) {
if err := c.ShouldBind(&p); err != nil {
data := gin.H{
"Env": viper.GetString("env"),
"HostURL": viper.GetString("server.host_url"),
"Version": version.Version,
"PageTitle": "InvesTool | 基金 | 基金严选",
"Error": err.Error(),
Expand All @@ -122,9 +125,10 @@ func FundFilter(c *gin.Context) {
result := fundList[pagi.StartIndex:pagi.EndIndex]
data := gin.H{
"Env": viper.GetString("env"),
"HostURL": viper.GetString("server.host_url"),
"Version": version.Version,
"PageTitle": "InvesTool | 基金 | 基金严选",
"URLPath": "/fund/filter",
"URLPath": viper.GetString("server.host_url") + "/fund/filter",
"FundList": result,
"Pagination": pagi,
"IndexParam": p.ParamFundIndex,
Expand Down Expand Up @@ -183,6 +187,7 @@ func FundCheck(c *gin.Context) {
if err := c.ShouldBind(&p); err != nil {
data := gin.H{
"Env": viper.GetString("env"),
"HostURL": viper.GetString("server.host_url"),
"Version": version.Version,
"PageTitle": "InvesTool | 基金 | 基金检测",
"Error": err.Error(),
Expand All @@ -194,6 +199,7 @@ func FundCheck(c *gin.Context) {
if p.Code == "" {
data := gin.H{
"Env": viper.GetString("env"),
"HostURL": viper.GetString("server.host_url"),
"Version": version.Version,
"PageTitle": "InvesTool | 基金 | 基金检测",
"Error": "请填写基金代码",
Expand All @@ -208,6 +214,7 @@ func FundCheck(c *gin.Context) {
if err != nil {
data := gin.H{
"Env": viper.GetString("env"),
"HostURL": viper.GetString("server.host_url"),
"Version": version.Version,
"PageTitle": "InvesTool | 基金 | 基金检测",
"Error": err.Error(),
Expand All @@ -219,6 +226,7 @@ func FundCheck(c *gin.Context) {
if !p.CheckStocks {
data := gin.H{
"Env": viper.GetString("env"),
"HostURL": viper.GetString("server.host_url"),
"Version": version.Version,
"PageTitle": "InvesTool | 基金 | 基金检测",
"Funds": funds,
Expand All @@ -231,6 +239,7 @@ func FundCheck(c *gin.Context) {
if len(funds) > 50 {
data := gin.H{
"Env": viper.GetString("env"),
"HostURL": viper.GetString("server.host_url"),
"Version": version.Version,
"PageTitle": "InvesTool | 基金 | 基金检测",
"Error": "基金数量超过限制",
Expand Down Expand Up @@ -263,6 +272,7 @@ func FundCheck(c *gin.Context) {
wg.Wait()
data := gin.H{
"Env": viper.GetString("env"),
"HostURL": viper.GetString("server.host_url"),
"Version": version.Version,
"PageTitle": "InvesTool | 基金 | 基金检测",
"Funds": funds,
Expand All @@ -284,6 +294,7 @@ func FundSimilarity(c *gin.Context) {
if err := c.ShouldBind(&p); err != nil {
data := gin.H{
"Env": viper.GetString("env"),
"HostURL": viper.GetString("server.host_url"),
"Version": version.Version,
"PageTitle": "InvesTool | 基金 | 持仓相似度",
"Error": err.Error(),
Expand All @@ -294,6 +305,7 @@ func FundSimilarity(c *gin.Context) {
if p.Codes == "" {
data := gin.H{
"Env": viper.GetString("env"),
"HostURL": viper.GetString("server.host_url"),
"Version": version.Version,
"PageTitle": "InvesTool | 基金 | 持仓相似度",
"Error": "请填写待检测的基金代码",
Expand All @@ -307,6 +319,7 @@ func FundSimilarity(c *gin.Context) {
if err != nil {
data := gin.H{
"Env": viper.GetString("env"),
"HostURL": viper.GetString("server.host_url"),
"Version": version.Version,
"PageTitle": "InvesTool | 基金 | 持仓相似度",
"Error": err.Error(),
Expand All @@ -316,6 +329,7 @@ func FundSimilarity(c *gin.Context) {
}
data := gin.H{
"Env": viper.GetString("env"),
"HostURL": viper.GetString("server.host_url"),
"Version": version.Version,
"PageTitle": "InvesTool | 基金 | 持仓相似度",
"Result": result,
Expand Down Expand Up @@ -358,6 +372,7 @@ func FundManagers(c *gin.Context) {
if err := c.ShouldBind(&p); err != nil {
data := gin.H{
"Env": viper.GetString("env"),
"HostURL": viper.GetString("server.host_url"),
"Version": version.Version,
"PageTitle": "InvesTool | 基金 | 基金经理",
"Error": err.Error(),
Expand Down Expand Up @@ -425,9 +440,10 @@ func FundManagers(c *gin.Context) {

data := gin.H{
"Env": viper.GetString("env"),
"HostURL": viper.GetString("server.host_url"),
"Version": version.Version,
"PageTitle": "InvesTool | 基金 | 基金经理",
"URLPath": "/fund/managers",
"URLPath": viper.GetString("server.host_url") + "/fund/managers",
"Managers": result,
"Pagination": pagi,
"Params": p,
Expand Down
33 changes: 19 additions & 14 deletions routes/materials.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,27 +21,31 @@ type MaterialItem struct {
}

// MaterialSeries 某一个系列的资料
// {
// "飙股在线等": [
// MaterialItem, ...
// ]
// }
//
// {
// "飙股在线等": [
// MaterialItem, ...
// ]
// }
type MaterialSeries map[string][]MaterialItem

// TypedMaterialSeries 对MaterialSeries进行分类,如:视频、电子书等
// {
// "videos": [
// MaterialSeries, ...
// ],
// "ebooks": [
// MaterialSeries, ...
// ]
// }
//
// {
// "videos": [
// MaterialSeries, ...
// ],
// "ebooks": [
// MaterialSeries, ...
// ]
// }
type TypedMaterialSeries map[string][]MaterialSeries

// AllMaterialsList 包含全部资料信息的大JSON列表
// [
// TypedMaterialSeries, ...
//
// TypedMaterialSeries, ...
//
// ]
type AllMaterialsList []TypedMaterialSeries

Expand All @@ -52,6 +56,7 @@ var MaterialsFilename = "materials"
func Materials(c *gin.Context) {
data := gin.H{
"Env": viper.GetString("env"),
"HostURL": viper.GetString("server.host_url"),
"Version": version.Version,
"PageTitle": "InvesTool | 资料",
}
Expand Down
1 change: 1 addition & 0 deletions routes/query_fund_by_stock.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ type ParamQueryFundByStock struct {
func QueryFundByStock(c *gin.Context) {
data := gin.H{
"Env": viper.GetString("env"),
"HostURL": viper.GetString("server.host_url"),
"Version": version.Version,
"PageTitle": "InvesTool | 基金 | 股票选基",
"Error": "",
Expand Down
3 changes: 3 additions & 0 deletions routes/stock.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
func StockIndex(c *gin.Context) {
data := gin.H{
"Env": viper.GetString("env"),
"HostURL": viper.GetString("server.host_url"),
"Version": version.Version,
"PageTitle": "InvesTool | 股票",
"Error": "",
Expand All @@ -41,6 +42,7 @@ type ParamStockSelector struct {
// StockSelector 返回基本面筛选结果json
func StockSelector(c *gin.Context) {
data := gin.H{
"HostURL": viper.GetString("server.host_url"),
"Env": viper.GetString("env"),
"Version": version.Version,
"PageTitle": "InvesTool | 股票 | 基本面筛选",
Expand Down Expand Up @@ -86,6 +88,7 @@ type ParamStockChecker struct {
func StockChecker(c *gin.Context) {
data := gin.H{
"Env": viper.GetString("env"),
"HostURL": viper.GetString("server.host_url"),
"Version": version.Version,
"PageTitle": "InvesTool | 股票 | 个股检测",
"Error": "",
Expand Down
2 changes: 1 addition & 1 deletion statics/html/about.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ <h1 class="header">关于网站</h1>
<br>
<div class="row valign-wrapper">
<div class="col s2">
<img src="/statics/img/sidenav_icon.png" alt="" class="circle responsive-img"> <!-- notice the "circle" class -->
<img src="{{ .HostURL }}/statics/img/sidenav_icon.png" alt="" class="circle responsive-img"> <!-- notice the "circle" class -->
</div>
<div class="col s10">
<p>InvesTool(v{{ .Version }}) 网站数据来源于东方财富网、亿牛网、新浪财经、天天基金,主要用于按财务指标对股票和基金进行检测筛选,快速找到可参考的优质投资标的。</p>
Expand Down
42 changes: 21 additions & 21 deletions statics/html/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1, minimum-scale=1.0, maximum-scale=1, shrink-to-fit=no" />

<link rel="shortcut icon" href="/statics/favicon.ico">
<link rel="shortcut icon" href="{{ .HostURL }}/statics/favicon.ico">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link href="https://cdn.bootcdn.net/ajax/libs/materialize/1.0.0/css/materialize.min.css" rel="stylesheet">
<link rel="stylesheet" href="/statics/css/app.css" />
<link rel="stylesheet" href="{{ .HostURL }}/statics/css/app.css" />
<!-- google auto ads -->
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-3022214826355647" crossorigin="anonymous"></script>
<title>{{ .PageTitle }}</title>
Expand All @@ -23,14 +23,14 @@
<header>
<nav>
<div class="nav-wrapper">
<a href="/" class="brand-logo"><i class="material-icons">local_atm</i>InvesTool</a>
<a href="{{ .HostURL }}/" class="brand-logo"><i class="material-icons">local_atm</i>InvesTool</a>
<a href="#" data-target="mobile-sidenav" class="sidenav-trigger"><i class="material-icons">menu</i></a>
<ul class="right hide-on-med-and-down">
<!-- <li id="nav-stock"><a href="/stock"><i class="material-icons left">trending_up</i><strong>股票</strong></a></li> -->
<li id="nav-fund"><a href="/fund"><i class="material-icons left">timeline</i><strong>基金</strong></a></li>
<li id="nav-about"><a href="/about"><i class="material-icons left">info_outline</i><strong>关于</strong></a></li>
<li id="nav-comment"><a href="/comment"><i class="material-icons left">chat_bubble_outline</i><strong>留言</strong></a></li>
<li id="nav-materials"><a href="/materials"><i class="material-icons left">book</i><strong>资料</strong></a></li>
<!-- <li id="nav-stock"><a href="{{ .HostURL }}/stock"><i class="material-icons left">trending_up</i><strong>股票</strong></a></li> -->
<li id="nav-fund"><a href="{{ .HostURL }}/fund"><i class="material-icons left">timeline</i><strong>基金</strong></a></li>
<li id="nav-about"><a href="{{ .HostURL }}/about"><i class="material-icons left">info_outline</i><strong>关于</strong></a></li>
<li id="nav-comment"><a href="{{ .HostURL }}/comment"><i class="material-icons left">chat_bubble_outline</i><strong>留言</strong></a></li>
<li id="nav-materials"><a href="{{ .HostURL }}/materials"><i class="material-icons left">book</i><strong>资料</strong></a></li>
</ul>
</div>
</nav>
Expand All @@ -39,33 +39,33 @@
<li>
<div class="user-view">
<div class="background">
<img src="/statics/img/sidenav_bg.png">
<img src="{{ .HostURL }}/statics/img/sidenav_bg.png">
</div>
<a href="#!"><img class="circle" src="/statics/img/sidenav_icon.png"></a>
<a href="#!"><img class="circle" src="{{ .HostURL }}/statics/img/sidenav_icon.png"></a>
<a href="#!"><span class="white-text">InvesTool v{{ .Version }}</span></a>
</div>
</li>
<!-- <li><a class="collapsible-header waves-effect waves-red" href="/stock"><i class="material-icons left">trending_up</i>股票</a></li> -->
<!-- <li><a class="collapsible-header waves-effect waves-red" href="{{ .HostURL }}/stock"><i class="material-icons left">trending_up</i>股票</a></li> -->
<li><div class="divider"></div></li>
<li><a class="collapsible-header waves-effect waves-red" href="/fund"><i class="material-icons left">timeline</i>基金</a></li>
<li><a class="collapsible-header waves-effect waves-red" href="{{ .HostURL }}/fund"><i class="material-icons left">timeline</i>基金</a></li>
<li><div class="divider"></div></li>
<li><a class="collapsible-header waves-effect waves-red" href="/about"><i class="material-icons left">info_outline</i>关于</a></li>
<li><a class="collapsible-header waves-effect waves-red" href="{{ .HostURL }}/about"><i class="material-icons left">info_outline</i>关于</a></li>
<li><div class="divider"></div></li>
<li><a class="collapsible-header waves-effect waves-red" href="/comment"><i class="material-icons left">chat_bubble_outline</i>留言</a></li>
<li><a class="collapsible-header waves-effect waves-red" href="{{ .HostURL }}/comment"><i class="material-icons left">chat_bubble_outline</i>留言</a></li>
<li><div class="divider"></div></li>
<li><a class="collapsible-header waves-effect waves-red" href="/materials"><i class="material-icons left">book</i>资料</a></li>
<li><a class="collapsible-header waves-effect waves-red" href="{{ .HostURL }}/materials"><i class="material-icons left">book</i>资料</a></li>
</ul>

<div id="fixed-action-btn" class="fixed-action-btn" style="bottom: 74px; right: 24px;">
<a id="tap-target-btn" class="btn btn-floating btn-large red lighten-2">
<i class="large material-icons">bookmark_border</i>
</a>
<ul>
<!-- <li><a class="btn-floating red tooltipped pulse" data-position="left" data-tooltip="股票" href="/stock"><i class="material-icons">trending_up</i></a></li> -->
<li><a class="btn-floating orange tooltipped pulse" data-position="left" data-tooltip="基金" href="/fund"><i class="material-icons">timeline</i></a></li>
<li><a class="btn-floating blue tooltipped pulse" data-position="left" data-tooltip="关于" href="/about"><i class="material-icons">info_outline</i></a></li>
<li><a class="btn-floating purple tooltipped pulse" data-position="left" data-tooltip="留言" href="/comment"><i class="material-icons">chat_bubble_outline</i></a></li>
<li><a class="btn-floating brown tooltipped pulse" data-position="left" data-tooltip="资料" href="/materials"><i class="material-icons">book</i></a></li>
<!-- <li><a class="btn-floating red tooltipped pulse" data-position="left" data-tooltip="股票" href="{{ .HostURL }}/stock"><i class="material-icons">trending_up</i></a></li> -->
<li><a class="btn-floating orange tooltipped pulse" data-position="left" data-tooltip="基金" href="{{ .HostURL }}/fund"><i class="material-icons">timeline</i></a></li>
<li><a class="btn-floating blue tooltipped pulse" data-position="left" data-tooltip="关于" href="{{ .HostURL }}/about"><i class="material-icons">info_outline</i></a></li>
<li><a class="btn-floating purple tooltipped pulse" data-position="left" data-tooltip="留言" href="{{ .HostURL }}/comment"><i class="material-icons">chat_bubble_outline</i></a></li>
<li><a class="btn-floating brown tooltipped pulse" data-position="left" data-tooltip="资料" href="{{ .HostURL }}/materials"><i class="material-icons">book</i></a></li>
<li><a id="to-top" class="btn-floating green tooltipped pulse" data-position="left" data-tooltip="返回顶部"><i class="material-icons">publish</i></a></li>
</ul>
</div>
Expand Down Expand Up @@ -146,7 +146,7 @@ <h5 class="white-text">东方财富数据中心</h5>
<script src="https://cdn.bootcdn.net/ajax/libs/clipboard.js/2.0.11/clipboard.min.js"></script>
<script src="https://cdn.bootcdn.net/ajax/libs/echarts/5.4.0/echarts.min.js"></script>

<script type="text/javascript" src="/statics/js/app.js" ></script>
<script type="text/javascript" src="{{ .HostURL }}/statics/js/app.js" ></script>

<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-EHXJT6J0DM"></script>
Expand Down
Loading

0 comments on commit ea48c92

Please sign in to comment.