优化架构

This commit is contained in:
huangxiaolei
2022-11-23 18:05:11 +08:00
parent 3efed3defe
commit 43403202b5
6760 changed files with 33748 additions and 554768 deletions

View File

@@ -0,0 +1,38 @@
package controller
import (
"github.com/gin-gonic/gin"
"hk4e/logger"
"net/http"
"os"
)
func (c *Controller) headDataVersions(context *gin.Context) {
context.Header("Content-Type", "application/octet-stream")
context.Header("Content-Length", "514")
context.Status(http.StatusOK)
}
func (c *Controller) getDataVersions(context *gin.Context) {
dataVersions, err := os.ReadFile("static/data_versions")
if err != nil {
logger.LOG.Error("open data_versions error")
return
}
context.Data(http.StatusOK, "application/octet-stream", dataVersions)
}
func (c *Controller) headBlk(context *gin.Context) {
context.Header("Content-Type", "application/octet-stream")
context.Header("Content-Length", "14103")
context.Status(http.StatusOK)
}
func (c *Controller) getBlk(context *gin.Context) {
blk, err := os.ReadFile("static/29342328.blk")
if err != nil {
logger.LOG.Error("open 29342328.blk error")
return
}
context.Data(http.StatusOK, "application/octet-stream", blk)
}