This commit is contained in:
toom1996
2026-08-26 10:45:21 +08:00
parent 3cf1368e68
commit 30c9f21da4
48 changed files with 3442 additions and 0 deletions

30
Makefile Normal file
View File

@ -0,0 +1,30 @@
.PHONY: build run migrate test tidy docker clean
# 编译 server 与 migrate 两个二进制到 bin/
build:
go build -o bin/server ./cmd/server
go build -o bin/migrate ./cmd/migrate
# 构建并启动 API 服务(默认读取 configs/config.yml)
run: build
./bin/server
# 执行一次结构迁移
migrate: build
./bin/migrate
# 跑单测
test:
go test ./...
# 整理依赖(需联网拉取测试依赖,离线环境慎用)
tidy:
go mod tidy
# 构建镜像
docker:
docker build -t fashionapi .
# 清理产物
clean:
rm -rf bin server server.exe migrate migrate.exe