4 Commits

Author SHA1 Message Date
孟帅
39f21cec24 Merge pull request #224 from xiaohe4966/v2.0
安装说明更新
2026-01-21 18:04:11 +08:00
Xiaohe
56db503a74 安装说明更新
修改配置文件名和详细的mysql连接说明
2026-01-13 08:16:53 +08:00
孟帅
5618ed3e1e Merge pull request #220 from wangle201210/v2.0
fix pprof
2025-12-09 21:32:38 +08:00
wanna
3165451086 fix pprof 2025-12-09 11:53:43 +08:00
3 changed files with 15 additions and 10 deletions

View File

@@ -27,7 +27,7 @@ git clone https://github.com/bufanyun/hotgo.git && cd hotgo
1、服务端 1、服务端
- 项目数据库文件 `storage/data/hotgo.sql` 创建数据库并导入 - 项目数据库文件 `storage/data/hotgo.sql` 创建数据库并导入
- 将配置文件 `manifest/config/config.yaml.bak` 复制后改为`manifest/config/config.yaml` - 将配置文件 `manifest/config/config.example.yaml` 复制后改为`manifest/config/config.yaml`
-`manifest/config/config.yaml`中的`database.default.link`数据库配置改为你自己的: -`manifest/config/config.yaml`中的`database.default.link`数据库配置改为你自己的:
```yaml ```yaml
# Database. 配置参考https://goframe.org/pages/viewpage.action?pageId=1114245 # Database. 配置参考https://goframe.org/pages/viewpage.action?pageId=1114245
@@ -37,6 +37,7 @@ database:
<<: *defaultLogger <<: *defaultLogger
stdout: true stdout: true
default: default:
# link: "mysql:账号:密码@tcp(127.0.0.1:3306)/数据库名?loc=Local&parseTime=true&charset=utf8mb4"
link: "mysql:hotgo:hg123456.@tcp(127.0.0.1:3306)/hotgo?loc=Local&parseTime=true&charset=utf8mb4" link: "mysql:hotgo:hg123456.@tcp(127.0.0.1:3306)/hotgo?loc=Local&parseTime=true&charset=utf8mb4"
debug: true debug: true
Prefix: "hg_" Prefix: "hg_"

View File

@@ -7,10 +7,11 @@ package consts
import ( import (
"fmt" "fmt"
"github.com/gogf/gf/v2/errors/gcode"
"hotgo/internal/library/dict" "hotgo/internal/library/dict"
"hotgo/internal/model" "hotgo/internal/model"
"net/http" "net/http"
"github.com/gogf/gf/v2/errors/gcode"
) )
func init() { func init() {
@@ -20,10 +21,11 @@ func init() {
} }
const ( const (
HTTPContentTypeXml = "text/xml" HTTPContentTypeXml = "text/xml"
HTTPContentTypeHtml = "text/html" HTTPContentTypeHtml = "text/html"
HTTPContentTypeStream = "text/event-stream" HTTPContentTypeStream = "text/event-stream"
HTTPContentTypeJson = "application/json" HTTPContentTypeJson = "application/json"
HTTPContentTypeOctetStream = "application/octet-stream"
) )
// HTTPMethodOptions HTTP请求方式选项 // HTTPMethodOptions HTTP请求方式选项

View File

@@ -6,15 +6,16 @@
package middleware package middleware
import ( import (
"hotgo/internal/consts"
"hotgo/internal/library/response"
"hotgo/utility/charset"
"hotgo/utility/simple"
"github.com/gogf/gf/v2/errors/gcode" "github.com/gogf/gf/v2/errors/gcode"
"github.com/gogf/gf/v2/errors/gerror" "github.com/gogf/gf/v2/errors/gerror"
"github.com/gogf/gf/v2/frame/g" "github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/net/ghttp" "github.com/gogf/gf/v2/net/ghttp"
"github.com/gogf/gf/v2/util/gmeta" "github.com/gogf/gf/v2/util/gmeta"
"hotgo/internal/consts"
"hotgo/internal/library/response"
"hotgo/utility/charset"
"hotgo/utility/simple"
) )
// ResponseHandler HTTP响应预处理 // ResponseHandler HTTP响应预处理
@@ -45,6 +46,7 @@ func (s *sMiddleware) ResponseHandler(r *ghttp.Request) {
s.responseXml(r) s.responseXml(r)
return return
case consts.HTTPContentTypeStream: case consts.HTTPContentTypeStream:
case consts.HTTPContentTypeOctetStream:
default: default:
responseJson(r) responseJson(r)
} }