diff --git a/build.sh b/build.sh index d942aea..24716a2 100755 --- a/build.sh +++ b/build.sh @@ -18,7 +18,7 @@ GitCommitLog=${GitCommitLog//\'/\"} GitStatus=`git status -s` BuildTime=`date +'%Y.%m.%d.%H%M%S'` BuildGoVersion=`go version` -WebUITpl=`cat lal.html` +#WebUITpl=`cat lal.html` LDFlags=" \ -X 'github.com/q191201771/naza/pkg/bininfo.GitTag=${GitTag}' \ @@ -26,9 +26,10 @@ LDFlags=" \ -X 'github.com/q191201771/naza/pkg/bininfo.GitStatus=${GitStatus}' \ -X 'github.com/q191201771/naza/pkg/bininfo.BuildTime=${BuildTime}' \ -X 'github.com/q191201771/naza/pkg/bininfo.BuildGoVersion=${BuildGoVersion}' \ - -X 'github.com/q191201771/lal/pkg/logic.webUITpl=${WebUITpl}' \ " +#-X 'github.com/q191201771/lal/pkg/logic.webUITpl=${WebUITpl}' \ + echo "build" ${ROOT_DIR}/app/lalserver "..." cd ${ROOT_DIR}/app/lalserver && go build -ldflags "$LDFlags" -o ${ROOT_DIR}/${OUT_DIR}/lalserver #cd ${ROOT_DIR}/app/lalserver && go build -race -ldflags "$LDFlags" -o ${ROOT_DIR}/${OUT_DIR}/lalserver.debug diff --git a/go.mod b/go.mod index 5d81c90..2a95f90 100644 --- a/go.mod +++ b/go.mod @@ -1,5 +1,5 @@ module github.com/q191201771/lal -go 1.14 +go 1.16 require github.com/q191201771/naza v0.30.8 diff --git a/pkg/base/t_http_an__api.go b/pkg/base/t_http_an__api.go index 1918cad..63d1dcc 100644 --- a/pkg/base/t_http_an__api.go +++ b/pkg/base/t_http_an__api.go @@ -52,6 +52,9 @@ const ( ErrorCodeSucc = 0 DespSucc = "succ" + ErrorCodePageNotFound = 404 + DespPageNotFound = "page not found, check this document out: https://pengrl.com/lal/#/HTTPAPI" + ErrorCodeGroupNotFound = 1001 DespGroupNotFound = "group not found" ErrorCodeParamMissing = 1002 @@ -63,12 +66,16 @@ const ( ErrorCodeListenUdpPortFail = 2002 ) -// HttpResponseBasic type ApiRespBasic struct { ErrorCode int `json:"error_code"` Desp string `json:"desp"` } +var ApiNotFoundResp = ApiRespBasic{ + ErrorCode: ErrorCodePageNotFound, + Desp: DespPageNotFound, +} + type ApiStatLalInfoResp struct { ApiRespBasic Data LalInfo `json:"data"` diff --git a/lal.html b/pkg/logic/http_an__lal.html similarity index 99% rename from lal.html rename to pkg/logic/http_an__lal.html index c909d1d..73209aa 100644 --- a/lal.html +++ b/pkg/logic/http_an__lal.html @@ -250,7 +250,7 @@