Skip to content

Commit 29837d3

Browse files
authored
Merge pull request #10 from zy84338719/main
优化逻辑
2 parents 4be6eba + def22f9 commit 29837d3

File tree

32 files changed

+2792
-484
lines changed

32 files changed

+2792
-484
lines changed

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ GO_VERSION := $(shell go version | awk '{print $$3}')
2424

2525
# 构建标志
2626
LDFLAGS := -ldflags "\
27-
-X 'github.com/zy84338719/filecodebox/internal/models.Version=$(VERSION)' \
28-
-X 'github.com/zy84338719/filecodebox/internal/models.GitCommit=$(COMMIT)' \
29-
-X 'github.com/zy84338719/filecodebox/internal/models.BuildTime=$(DATE)' \
27+
-X 'github.com/zy84338719/filecodebox/internal/models/service.Version=$(VERSION)' \
28+
-X 'github.com/zy84338719/filecodebox/internal/models/service.GitCommit=$(COMMIT)' \
29+
-X 'github.com/zy84338719/filecodebox/internal/models/service.BuildTime=$(DATE)' \
3030
-w -s"
3131

3232
# 默认目标

VERSION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1.8.2

config.yaml

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
base:
22
name: FileCodeBox
33
description: 开箱即用的文件快传系统
4-
keywords: ""
5-
port: 12346
4+
keywords: FileCodeBox, 文件快递柜, 口令传送箱, 匿名口令分享文本, 文件
5+
port: 12345
66
host: 0.0.0.0
77
datapath: /Users/zhangyi/zy/FileCodeBox/data
88
production: false
@@ -44,8 +44,6 @@ mcp:
4444
enablemcpserver: 0
4545
mcpport: ""
4646
mcphost: ""
47-
notifytitle: ""
48-
notifycontent: ""
4947
ui:
5048
themes_select: themes/2025
5149
background: ""
@@ -54,15 +52,9 @@ ui:
5452
User-agent: *
5553
Disallow: /
5654
show_admin_addr: 0
57-
opacity: 0
58-
themes_select: themes/2025
59-
robots_text: |-
60-
User-agent: *
61-
Disallow: /
62-
page_explain: 请勿上传或分享违法内容。根据《中华人民共和国网络安全法》、《中华人民共和国刑法》、《中华人民共和国治安管理处罚法》等相关规定。 传播或存储违法、违规内容,会受到相关处罚,严重者将承担刑事责任。本站坚决配合相关部门,确保网络内容的安全,和谐,打造绿色网络环境。
63-
show_admin_addr: 0
64-
opacity: 0
65-
background: ""
55+
opacity: 1
56+
notify_title: ""
57+
notify_content: ""
6658
sys_start: ""
6759
upload_minute: 0
6860
upload_count: 0

docs/RELEASE_NOTES/v1.8.2.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
## v1.8.2 - 2025-09-22
2+
3+
Release: v1.8.2
4+
5+
Changes:
6+
7+
- 更新版本标识与 API 文档到 `1.8.2`
8+
- 修改文件:`VERSION`, `main.go`, `internal/models/service/system.go`, `internal/handlers/api.go`, `docs/swagger.yaml`, `docs/swagger.json`, `docs/swagger-enhanced.yaml`
9+
10+
Notes:
11+
12+
- 构建与单元测试已在本地通过(`go build ./...`, `go test ./...`)。
13+
- 依赖版本(`go.sum`)未更改。

docs/docs.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
// Package docs Code generated by swaggo/swag. DO NOT EDIT
22
package docs
33

4-
import "github.com/swaggo/swag"
4+
import (
5+
"github.com/swaggo/swag"
6+
"github.com/zy84338719/filecodebox/internal/models/service"
7+
)
58

69
const docTemplate = `{
710
"schemes": {{ marshal .Schemes }},
@@ -618,7 +621,7 @@ const docTemplate = `{
618621

619622
// SwaggerInfo holds exported Swagger Info so clients can modify it
620623
var SwaggerInfo = &swag.Spec{
621-
Version: "1.0",
624+
Version: service.Version,
622625
Host: "localhost:12345",
623626
BasePath: "/",
624627
Schemes: []string{},

docs/swagger-enhanced.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ swagger: "2.0"
22
info:
33
title: "FileCodeBox API"
44
description: "FileCodeBox 是一个用于文件分享和代码片段管理的 Web 应用程序"
5-
version: "1.0"
5+
version: "1.8.2"
66
termsOfService: "http://swagger.io/terms/"
77
contact:
88
name: "API Support"
@@ -69,7 +69,7 @@ paths:
6969
example: "2025-09-11T10:00:00Z"
7070
version:
7171
type: "string"
72-
example: "1.0.0"
72+
example: "1.8.2"
7373
uptime:
7474
type: "string"
7575
example: "2h30m15s"

docs/swagger.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"name": "MIT",
1414
"url": "https://github.com/zy84338719/filecodebox/blob/main/LICENSE"
1515
},
16-
"version": "1.0"
16+
"version": "1.8.2"
1717
},
1818
"host": "localhost:12345",
1919
"basePath": "/",
@@ -553,7 +553,7 @@
553553
},
554554
"version": {
555555
"type": "string",
556-
"example": "1.0.0"
556+
"example": "1.8.2"
557557
}
558558
}
559559
},
@@ -608,4 +608,4 @@
608608
"type": "basic"
609609
}
610610
}
611-
}
611+
}

docs/swagger.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ definitions:
1212
example: 2h30m15s
1313
type: string
1414
version:
15-
example: 1.0.0
15+
example: 1.8.2
1616
type: string
1717
type: object
1818
handlers.SystemConfig:
@@ -57,7 +57,7 @@ info:
5757
url: https://github.com/zy84338719/filecodebox/blob/main/LICENSE
5858
termsOfService: http://swagger.io/terms/
5959
title: FileCodeBox API
60-
version: "1.0"
60+
version: "1.8.2"
6161
paths:
6262
/api/config:
6363
get:

go.mod

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ require (
99
github.com/aws/aws-sdk-go-v2/config v1.27.27
1010
github.com/aws/aws-sdk-go-v2/credentials v1.17.27
1111
github.com/aws/aws-sdk-go-v2/service/s3 v1.58.3
12-
github.com/gin-contrib/cors v1.4.0
13-
github.com/gin-gonic/gin v1.8.2
12+
github.com/gin-contrib/cors v1.6.0
13+
github.com/gin-gonic/gin v1.9.1
1414
github.com/golang-jwt/jwt/v4 v4.5.2
1515
github.com/mattn/go-sqlite3 v1.14.32
1616
github.com/robfig/cron/v3 v3.0.1
@@ -47,6 +47,10 @@ require (
4747
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.26.4 // indirect
4848
github.com/aws/aws-sdk-go-v2/service/sts v1.30.3 // indirect
4949
github.com/aws/smithy-go v1.20.3 // indirect
50+
github.com/bytedance/sonic v1.11.2 // indirect
51+
github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d // indirect
52+
github.com/chenzhuoyu/iasm v0.9.1 // indirect
53+
github.com/gabriel-vasile/mimetype v1.4.3 // indirect
5054
github.com/gin-contrib/sse v1.1.0 // indirect
5155
github.com/go-openapi/jsonpointer v0.22.0 // indirect
5256
github.com/go-openapi/jsonreference v0.21.1 // indirect
@@ -65,30 +69,34 @@ require (
6569
github.com/go-openapi/swag/yamlutils v0.24.0 // indirect
6670
github.com/go-playground/locales v0.14.1 // indirect
6771
github.com/go-playground/universal-translator v0.18.1 // indirect
68-
github.com/go-playground/validator/v10 v10.11.2 // indirect
72+
github.com/go-playground/validator/v10 v10.19.0 // indirect
6973
github.com/go-sql-driver/mysql v1.8.1 // indirect
7074
github.com/goccy/go-json v0.10.5 // indirect
7175
github.com/inconshreveable/mousetrap v1.1.0 // indirect
7276
github.com/jackc/pgpassfile v1.0.0 // indirect
7377
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect
74-
github.com/jackc/pgx/v5 v5.2.0 // indirect
78+
github.com/jackc/pgx/v5 v5.5.4 // indirect
79+
github.com/jackc/puddle/v2 v2.2.1 // indirect
7580
github.com/jinzhu/inflection v1.0.0 // indirect
7681
github.com/jinzhu/now v1.1.5 // indirect
7782
github.com/josharian/intern v1.0.0 // indirect
7883
github.com/json-iterator/go v1.1.12 // indirect
84+
github.com/klauspost/cpuid/v2 v2.2.7 // indirect
7985
github.com/leodido/go-urn v1.4.0 // indirect
8086
github.com/mailru/easyjson v0.9.0 // indirect
8187
github.com/mattn/go-isatty v0.0.20 // indirect
8288
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
8389
github.com/modern-go/reflect2 v1.0.2 // indirect
8490
github.com/pelletier/go-toml/v2 v2.2.4 // indirect
8591
github.com/spf13/pflag v1.0.6 // indirect
92+
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
8693
github.com/ugorji/go/codec v1.3.0 // indirect
94+
golang.org/x/arch v0.7.0 // indirect
8795
golang.org/x/mod v0.12.0 // indirect
8896
golang.org/x/net v0.23.0 // indirect
97+
golang.org/x/sync v0.1.0 // indirect
8998
golang.org/x/sys v0.35.0 // indirect
9099
golang.org/x/text v0.14.0 // indirect
91100
golang.org/x/tools v0.7.0 // indirect
92101
google.golang.org/protobuf v1.36.8 // indirect
93-
gopkg.in/yaml.v2 v2.4.0 // indirect
94102
)

0 commit comments

Comments
 (0)