This commit is contained in:
Timur Kh.
2025-12-15 22:28:01 +03:00
parent 4a17c75d6f
commit f7a7b19275
25 changed files with 1383 additions and 3 deletions
+33 -2
View File
@@ -10,10 +10,10 @@ BINARY_DIR=bin
# Protobuf parameters
PROTOC=protoc
PROTO_DIR=api/proto
PROTO_FILE=$(PROTO_DIR)/auth.proto $(PROTO_DIR)/competition.proto $(PROTO_DIR)/task.proto
PROTO_FILE=$(PROTO_DIR)/auth.proto $(PROTO_DIR)/competition.proto $(PROTO_DIR)/results.proto $(PROTO_DIR)/review.proto $(PROTO_DIR)/submission.proto $(PROTO_DIR)/task.proto $(PROTO_DIR)/user.proto
PROTO_OUT=.
.PHONY: install i generate gen generate-gw test build run migrate lint fmt format clean help
.PHONY: install i generate gen generate-gw test build run migrate lint fmt format clean help codegen examples
install:
$(GODOWNLOAD)
@@ -65,6 +65,33 @@ format: fmt
clean:
rm -rf bin/*
codegen:
@if [ -z "$(SERVICE)" ]; then \
echo "Usage: make codegen SERVICE=<service-name>"; \
echo "Example: make codegen SERVICE=auth"; \
exit 1; \
fi
$(GOBUILD) -o ./$(BINARY_DIR)/codegen ./cmd/codegen
./$(BINARY_DIR)/codegen $(SERVICE) ./
examples:
@echo "📖 Datarush-Go Integration Examples"
@echo ""
@echo "Files:"
@echo " - SQL_BUILDER_ADVANCED.md - Детальные примеры SQL Builder"
@echo " - SQL_BUILDER_CODEGEN.md - Документация Codegen"
@echo " - SQL_EXAMPLES.sql - SQL схемы и примеры"
@echo " - INTEGRATION_EXAMPLES.sh - Интеграционные примеры"
@echo ""
@echo "Быстрый старт:"
@echo " 1. make codegen SERVICE=payment"
@echo " 2. Edit internal/payment/repository/postgres/repo.go"
@echo " 3. Edit internal/payment/service/service.go"
@echo " 4. go test ./internal/payment/..."
@echo ""
@cat INTEGRATION_EXAMPLES.sh
help:
@echo "Available commands:"
@echo " install - Install all deps using go mod download"
@@ -72,6 +99,9 @@ help:
@echo " generate - Generate gRPC code"
@echo " gen"
@echo " protoc"
@echo " codegen - Generate service template"
@echo " Usage: make codegen SERVICE=<name>"
@echo " examples - Show integration examples"
@echo " test - Run tests"
@echo " build - Build the binary"
@echo " run - Run the application"
@@ -80,6 +110,7 @@ help:
@echo " fmt"
@echo " clean - Clean build artifacts"
.DEFAULT_GOAL := help
%: