File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,16 @@ gen-api: # Generate API files | 生成 API 的代码
37
37
swagger generate spec --output=./$(PROJECT ) .yml --scan-models
38
38
@echo " Generate API codes successfully"
39
39
40
+ .PHONY : gen-ent
41
+ gen-ent : # Generate Ent codes | 生成 Ent 的代码
42
+ go run -mod=mod entgo.io/ent/cmd/ent generate --template glob=" ./ent/template/*.tmpl" ./ent/schema
43
+ @echo " Generate Ent successfully"
44
+
45
+ .PHONY : gen-api-ent-logic
46
+ gen-api-ent-logic : # Generate CRUD logic from Ent, need to set model and group | 根据 Ent 生成 CRUD 代码,需要设置 model 和 group
47
+ goctls api ent --schema=./ent/schema --api_service_name=$(PROJECT ) --o=./ --model=$(model ) --group=$(group )
48
+ @echo " Generate CRUD codes from Ent successfully"
49
+
40
50
.PHONY : build-win
41
51
build-win : # Build project for Windows | 构建Windows下的可执行文件
42
52
env CGO_ENABLED=0 GOOS=windows go build -ldflags " $( LDFLAGS) " -o $(PROJECT ) .exe $(PROJECT ) .go
You can’t perform that action at this time.
0 commit comments