复制项目

This commit is contained in:
kim.dev.6789
2026-01-14 22:35:45 +08:00
parent 305d526110
commit b7f8db7d08
297 changed files with 81784 additions and 0 deletions

32
pkg/protocol/gen.cmd Normal file
View File

@@ -0,0 +1,32 @@
@echo off
setlocal
rem Define array elements
set "PROTO_NAMES=admin chat common bot"
rem Loop through each element in the array
for %%i in (%PROTO_NAMES%) do (
protoc --go_out=./%%i --go_opt=module=git.imall.cloud/openim/chat/pkg/protocol/%%i %%i/%%i.proto
if ERRORLEVEL 1 (
echo error processing %%i.proto
exit /b %ERRORLEVEL%
)
)
rem Generate Go-grpc code
for %%i in (%PROTO_NAMES%) do (
protoc --go-grpc_out=./%%i --go-grpc_opt=module=git.imall.cloud/openim/chat/pkg/protocol/%%i %%i/%%i.proto
if ERRORLEVEL 1 (
echo error processing %%i.proto
exit /b %ERRORLEVEL%
)
)
rem Replace "omitempty" in *.pb.go files with UTF-8 encoding
for /r %%f in (*.pb.go) do (
powershell -Command "(Get-Content -Path '%%f' -Encoding UTF8) -replace ',omitempty', '' | Set-Content -Path '%%f' -Encoding UTF8"
)
endlocal