Files
SharedClassManager/backend-go/Makefile
canglan d6dec878bd feat: 多班级版 v2.0 - Go后端重写 + 43轮代码审查
- 后端从 Python FastAPI 重写为 Go Gin(端口 56789)
- 多班级完全隔离
- 超级管理员独立登录
- 课代表作业管理、排行榜分项排行
- 角色加减分上下限可配置
- 家长改密功能(可开关)
- 周度/月度重置功能
- MySQL 5.7 兼容
- 43轮代码审查+全部修复
- Apache 2.0 许可证
2026-06-22 10:06:10 +08:00

64 lines
1.2 KiB
Makefile
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
.PHONY: build run clean test lint fmt vet tidy
# 应用名称
APP_NAME=scm-server
# 入口目录
CMD_DIR=./cmd/server
# 输出目录
BUILD_DIR=./build
# 默认目标
all: build
# 编译
build:
@echo "==> 编译 $(APP_NAME)..."
@mkdir -p $(BUILD_DIR)
go build -o $(BUILD_DIR)/$(APP_NAME) $(CMD_DIR)
# 运行
run:
go run $(CMD_DIR)/main.go
# 清理
clean:
@echo "==> 清理构建产物..."
@rm -rf $(BUILD_DIR)
# 测试
test:
go test -v -count=1 ./...
# 代码检查
lint: fmt vet
# 格式化
fmt:
go fmt ./...
# 静态分析
vet:
go vet ./...
# 整理依赖
tidy:
go mod tidy
# 开发模式(热重载需要安装 air
dev:
@which air > /dev/null 2>&1 || (echo "请先安装 air: go install github.com/air-verse/air@latest" && exit 1)
air
# 帮助
help:
@echo "可用命令:"
@echo " make build - 编译项目"
@echo " make run - 直接运行"
@echo " make clean - 清理构建产物"
@echo " make test - 运行测试"
@echo " make lint - 代码检查 (fmt + vet)"
@echo " make fmt - 格式化代码"
@echo " make vet - 静态分析"
@echo " make tidy - 整理依赖"
@echo " make dev - 开发模式(需要 air"