From 79f70d830d2f78d7faf9c72d2206165558ba612f Mon Sep 17 00:00:00 2001 From: roberChen Date: Tue, 23 Mar 2021 15:09:17 +0800 Subject: [PATCH] chore!(all): update go import path BREAKING CHANGE: use github.com/mindoc-org/mindoc as import path --- .travis.yml | 2 +- Dockerfile | 12 ++++---- README.md | 6 ++-- appveyor.yml | 23 +++++++------- commands/command.go | 11 ++++--- commands/daemon/daemon.go | 9 +++--- commands/install.go | 9 +++--- commands/migrate/migrate.go | 5 +-- commands/migrate/migrate_v03.go | 5 +-- commands/update.go | 2 +- controllers/AccountController.go | 11 ++++--- controllers/BaseController.go | 13 ++++---- controllers/BlogController.go | 29 +++++++++--------- controllers/BookController.go | 13 ++++---- controllers/BookMemberController.go | 6 ++-- controllers/DocumentController.go | 27 +++++++++-------- controllers/HomeController.go | 9 +++--- controllers/ItemsetsController.go | 8 ++--- controllers/LabelController.go | 6 ++-- controllers/ManagerController.go | 15 ++++----- controllers/SearchController.go | 13 ++++---- controllers/SettingController.go | 10 +++--- controllers/TemplateController.go | 7 +++-- converter/converter.go | 13 ++++---- go.mod | 2 +- main.go | 6 ++-- models/AttachmentModel.go | 15 ++++----- models/AttachmentResult.go | 6 ++-- models/Blog.go | 11 ++++--- models/BookModel.go | 13 ++++---- models/BookResult.go | 21 +++++++------ models/DocumentHistory.go | 4 +-- models/DocumentModel.go | 13 ++++---- models/DocumentTree.go | 5 +-- models/Itemsets.go | 13 ++++---- models/LabelModel.go | 5 +-- models/Logs.go | 5 +-- models/Member.go | 7 +++-- models/MemberResult.go | 5 +-- models/MemberToken.go | 5 +-- models/Migrations.go | 5 +-- models/Options.go | 2 +- models/Relationship.go | 3 +- models/Team.go | 7 +++-- models/TeamMember.go | 5 +-- models/TeamRelationship.go | 9 +++--- models/Template.go | 11 ++++--- models/comment.go | 5 +-- models/comment_vote.go | 5 +-- routers/filter.go | 9 +++--- routers/router.go | 47 +++++++++++++---------------- utils/html.go | 5 +-- views/document/template_normal.tpl | 10 +++--- views/widgets/footer.tpl | 4 +-- 54 files changed, 279 insertions(+), 248 deletions(-) diff --git a/.travis.yml b/.travis.yml index 13f323c1..532dcc49 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,7 +14,7 @@ script: - dep ensure && GO_ENABLED=1 go build -v -x -tags "pam" && go install before_deploy: - - dep ensure -v && CGO_ENABLED=1 GOARCH=amd64 GOOS=linux go build -o mindoc_linux_amd64 -ldflags="-w -X github.com/lifei6671/mindoc/conf.VERSION=$TRAVIS_TAG -X 'github.com/lifei6671/mindoc/conf.BUILD_TIME=`date`' -X 'conf.GO_VERSION=`github.com/lifei6671/mindoc/go version`'" + - dep ensure -v && CGO_ENABLED=1 GOARCH=amd64 GOOS=linux go build -o mindoc_linux_amd64 -ldflags="-w -X github.com/mindoc-org/mindoc/conf.VERSION=$TRAVIS_TAG -X 'github.com/mindoc-org/mindoc/conf.BUILD_TIME=`date`' -X 'conf.GO_VERSION=`github.com/mindoc-org/mindoc/go version`'" - rm -rf simsun.ttc start.sh commands controllers models modules data routers tasks vendor docs search utils graphics .git Godeps uploads/* .gitignore .travis.yml Dockerfile Gopkg.toml LICENSE main.go README.md conf/enumerate.go conf/mail.go install.lock *.md - cp conf/app.conf.example conf/app.conf - zip -r mindoc_linux_amd64.zip conf static uploads views lib mindoc_linux_amd64 diff --git a/Dockerfile b/Dockerfile index 70ea79c9..b2587f8e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -27,17 +27,17 @@ ENV PATH $PATH:/opt/calibre/bin RUN curl -Lo /var/linux-installer.py https://download.calibre-ebook.com/linux-installer.py -#RUN mkdir -p /go/src/github.com/lifei6671/ && cd /go/src/github.com/lifei6671/ && git clone https://github.com/lifei6671/mindoc.git && cd mindoc +#RUN mkdir -p /go/src/github.com/lifei6671/ && cd /go/src/github.com/lifei6671/ && git clone https://github.com/mindoc-org/mindoc.git && cd mindoc -ADD . /go/src/github.com/lifei6671/mindoc +ADD . /go/src/github.com/mindoc-org/mindoc -WORKDIR /go/src/github.com/lifei6671/mindoc +WORKDIR /go/src/github.com/mindoc-org/mindoc RUN go get -u github.com/golang/dep/cmd/dep && dep ensure && \ - CGO_ENABLE=1 go build -v -a -o mindoc_linux_amd64 -ldflags="-w -s -X main.VERSION=$TAG -X 'main.BUILD_TIME=`date`' -X 'main.GO_VERSION=`go version`'" && \ + CGO_ENABLE=1 go build -v -a -o mindoc_linux_amd64 -ldflags="-w -s -X main.VERSION=$TAG -X 'main.BUILD_TIME=`date`' -X 'main.GO_VERSION=`go version`'" && \ rm -rf commands controllers models modules routers tasks vendor docs search data utils graphics .git Godeps uploads/* .gitignore .travis.yml Dockerfile gide.yaml LICENSE main.go README.md conf/enumerate.go conf/mail.go install.lock simsun.ttc -ADD start.sh /go/src/github.com/lifei6671/mindoc +ADD start.sh /go/src/github.com/mindoc-org/mindoc ADD simsun.ttc /usr/share/fonts/win/ FROM alpine:latest @@ -67,7 +67,7 @@ COPY --from=build /etc/apk/keys/sgerrand.rsa.pub /etc/apk/keys/sgerrand.rsa.pub COPY --from=build /var/linux-installer.py . COPY --from=build /usr/share/fonts/win/simsun.ttc /usr/share/fonts/win/ COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt -COPY --from=build /go/src/github.com/lifei6671/mindoc /mindoc +COPY --from=build /go/src/github.com/mindoc-org/mindoc /mindoc RUN apk add glibc-bin.apk glibc.apk && \ /usr/glibc-compat/sbin/ldconfig /lib /usr/glibc-compat/lib && \ diff --git a/README.md b/README.md index 3c5ba312..23153ecc 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ MinDoc 的前身是 SmartWiki 文档系统。SmartWiki 是基于 PHP 框架 lara 维护权限需要作者添加,有意向者请添加下方QQ群,或通过发送邮件(`gsw945#foxmail.com`, 请替换`#`为`@`),私聊我加入作者所在的微信群。 -遇到问题请提 [Issues](https://github.com/lifei6671/mindoc/issues ),欢迎使用者和贡献者加入QQ群 `1051164153` +遇到问题请提 [Issues](https://github.com/mindoc-org/mindoc/issues ),欢迎使用者和贡献者加入QQ群 `1051164153` MinDoc使用&开发交流群 --- @@ -36,12 +36,12 @@ MinDoc 的前身是 SmartWiki 文档系统。SmartWiki 是基于 PHP 框架 lara 更多信息请查看手册: [MinDoc 使用手册](https://www.iminho.me/wiki/docs/mindoc/mindoc-summary.md) -对于没有Golang使用经验的用户,可以从 [https://github.com/lifei6671/mindoc/releases](https://github.com/lifei6671/mindoc/releases) 这里下载编译完的程序。 +对于没有Golang使用经验的用户,可以从 [https://github.com/mindoc-org/mindoc/releases](https://github.com/mindoc-org/mindoc/releases) 这里下载编译完的程序。 如果有Golang开发经验,建议通过编译安装,在此之前,您需要先安装Golang官方包管理工具,详见[Install dep](https://golang.github.io/dep/docs/installation.html)。 ```bash -git clone https://github.com/lifei6671/mindoc.git +git clone https://github.com/mindoc-org/mindoc.git dep ensure diff --git a/appveyor.yml b/appveyor.yml index 57efca58..c97eac4d 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -16,17 +16,16 @@ environment: GOARCH: amd64 install: - - ps: if($env:tbs_tools -eq 'mingw' -and $env:tbs_arch -eq 'x64') - { - Start-FileDownload "http://libgd.blob.core.windows.net/mingw/x86_64-4.9.1-release-posix-seh-rt_v3-rev1.7z" -FileName mingw_x86_64.7z; - 7z x -oC:\ mingw_x86_64.7z | out-null; - } + { + Start-FileDownload "http://libgd.blob.core.windows.net/mingw/x86_64-4.9.1-release-posix-seh-rt_v3-rev1.7z" -FileName mingw_x86_64.7z; + 7z x -oC:\ mingw_x86_64.7z | out-null; + } - ps: if($env:tbs_tools -eq 'mingw' -and $env:tbs_arch -eq 'x86') - { - Start-FileDownload "http://libgd.blob.core.windows.net/mingw/i686-4.9.1-release-posix-dwarf-rt_v3-rev1.7z" -FileName mingw_x86.7z; - 7z x -oC:\ mingw_x86.7z | out-null; - } + { + Start-FileDownload "http://libgd.blob.core.windows.net/mingw/i686-4.9.1-release-posix-dwarf-rt_v3-rev1.7z" -FileName mingw_x86.7z; + 7z x -oC:\ mingw_x86.7z | out-null; + } - set PATH=%GOPATH%\bin;c:\go\bin;%PATH% - echo %PATH% - echo %GOPATH% @@ -40,7 +39,7 @@ build_script: - for /f "delims=" %%i in ('go version') do (set GO_VERSION=%%i) - cd c:\gopath\src\github.com\lifei6671\mindoc - go mod tidy - - go build -v -o "mindoc_windows_%GOARCH%.exe" -ldflags="-w -X github.com/lifei6671/mindoc/conf.VERSION=%APPVEYOR_REPO_TAG_NAME% -X 'github.com/lifei6671/mindoc/conf.BUILD_TIME=%date% %time%' -X 'conf.GO_VERSION=%GO_VERSION%'" + - go build -v -o "mindoc_windows_%GOARCH%.exe" -ldflags="-w -X github.com/mindoc-org/mindoc/conf.VERSION=%APPVEYOR_REPO_TAG_NAME% -X 'github.com/mindoc-org/mindoc/conf.BUILD_TIME=%date% %time%' -X 'conf.GO_VERSION=%GO_VERSION%'" - 7z a -t7z -r mindoc_windows_%GOARCH%.7z conf/*.conf* static/* mindoc_windows_%GOARCH%.exe views/* uploads/* test_script: - mindoc_windows_%GOARCH%.exe version @@ -58,9 +57,9 @@ artifacts: deploy: - provider: GitHub auth_token: - secure: "Qkhxloft5lBKti7O+vVS+Vrxh7CBAUVhlfdZ9ptBXjFtjt6jHXnaBA2uv2OYbISB" + secure: "Qkhxloft5lBKti7O+vVS+Vrxh7CBAUVhlfdZ9ptBXjFtjt6jHXnaBA2uv2OYbISB" draft: false prerelease: false - artifact: mindoc_windows_%GOARCH%.7z + artifact: mindoc_windows_%GOARCH%.7z on: appveyor_repo_tag: true diff --git a/commands/command.go b/commands/command.go index 3e82dde7..e57fe014 100644 --- a/commands/command.go +++ b/commands/command.go @@ -13,6 +13,8 @@ import ( "bytes" "encoding/json" + "net/http" + "github.com/astaxie/beego" beegoCache "github.com/astaxie/beego/cache" _ "github.com/astaxie/beego/cache/memcache" @@ -22,11 +24,10 @@ import ( "github.com/astaxie/beego/orm" "github.com/howeyc/fsnotify" "github.com/lifei6671/gocaptcha" - "github.com/lifei6671/mindoc/cache" - "github.com/lifei6671/mindoc/conf" - "github.com/lifei6671/mindoc/models" - "github.com/lifei6671/mindoc/utils/filetil" - "net/http" + "github.com/mindoc-org/mindoc/cache" + "github.com/mindoc-org/mindoc/conf" + "github.com/mindoc-org/mindoc/models" + "github.com/mindoc-org/mindoc/utils/filetil" ) // RegisterDataBase 注册数据库 diff --git a/commands/daemon/daemon.go b/commands/daemon/daemon.go index 21d0509f..f9123b7e 100644 --- a/commands/daemon/daemon.go +++ b/commands/daemon/daemon.go @@ -4,12 +4,13 @@ import ( "fmt" "os" + "path/filepath" + "github.com/astaxie/beego" "github.com/kardianos/service" - "github.com/lifei6671/mindoc/commands" - "github.com/lifei6671/mindoc/conf" - "github.com/lifei6671/mindoc/controllers" - "path/filepath" + "github.com/mindoc-org/mindoc/commands" + "github.com/mindoc-org/mindoc/conf" + "github.com/mindoc-org/mindoc/controllers" ) type Daemon struct { diff --git a/commands/install.go b/commands/install.go index d688f033..4f462bad 100644 --- a/commands/install.go +++ b/commands/install.go @@ -5,12 +5,13 @@ import ( "os" "time" - "github.com/astaxie/beego/orm" - "github.com/lifei6671/mindoc/conf" - "github.com/lifei6671/mindoc/models" "flag" - "github.com/lifei6671/mindoc/utils" + "github.com/astaxie/beego" + "github.com/astaxie/beego/orm" + "github.com/mindoc-org/mindoc/conf" + "github.com/mindoc-org/mindoc/models" + "github.com/mindoc-org/mindoc/utils" ) //系统安装. diff --git a/commands/migrate/migrate.go b/commands/migrate/migrate.go index 2cd0f960..3a09d25e 100644 --- a/commands/migrate/migrate.go +++ b/commands/migrate/migrate.go @@ -18,10 +18,11 @@ import ( "container/list" "fmt" + "log" + "github.com/astaxie/beego" "github.com/astaxie/beego/orm" - "github.com/lifei6671/mindoc/models" - "log" + "github.com/mindoc-org/mindoc/models" ) var ( diff --git a/commands/migrate/migrate_v03.go b/commands/migrate/migrate_v03.go index d73e9e78..0ebfb62b 100644 --- a/commands/migrate/migrate_v03.go +++ b/commands/migrate/migrate_v03.go @@ -3,10 +3,11 @@ package migrate import ( "errors" "fmt" - "github.com/astaxie/beego/orm" - "github.com/lifei6671/mindoc/models" "strings" "time" + + "github.com/astaxie/beego/orm" + "github.com/mindoc-org/mindoc/models" ) type MigrationVersion03 struct { diff --git a/commands/update.go b/commands/update.go index 08ec450a..396816b9 100644 --- a/commands/update.go +++ b/commands/update.go @@ -8,7 +8,7 @@ import ( "os" "github.com/astaxie/beego" - "github.com/lifei6671/mindoc/conf" + "github.com/mindoc-org/mindoc/conf" ) //检查最新版本. diff --git a/controllers/AccountController.go b/controllers/AccountController.go index a9153bde..eaf894e3 100644 --- a/controllers/AccountController.go +++ b/controllers/AccountController.go @@ -6,13 +6,14 @@ import ( "strings" "time" + "html/template" + "github.com/astaxie/beego" "github.com/lifei6671/gocaptcha" - "github.com/lifei6671/mindoc/conf" - "github.com/lifei6671/mindoc/mail" - "github.com/lifei6671/mindoc/models" - "github.com/lifei6671/mindoc/utils" - "html/template" + "github.com/mindoc-org/mindoc/conf" + "github.com/mindoc-org/mindoc/mail" + "github.com/mindoc-org/mindoc/models" + "github.com/mindoc-org/mindoc/utils" ) // AccountController 用户登录与注册 diff --git a/controllers/BaseController.go b/controllers/BaseController.go index b3d6a8d1..046188aa 100644 --- a/controllers/BaseController.go +++ b/controllers/BaseController.go @@ -8,13 +8,14 @@ import ( "strings" "time" - "github.com/astaxie/beego" - "github.com/lifei6671/mindoc/conf" - "github.com/lifei6671/mindoc/models" - "github.com/lifei6671/mindoc/utils" - "path/filepath" - "io/ioutil" "html/template" + "io/ioutil" + "path/filepath" + + "github.com/astaxie/beego" + "github.com/mindoc-org/mindoc/conf" + "github.com/mindoc-org/mindoc/models" + "github.com/mindoc-org/mindoc/utils" ) type BaseController struct { diff --git a/controllers/BlogController.go b/controllers/BlogController.go index cbb22946..055ffae0 100644 --- a/controllers/BlogController.go +++ b/controllers/BlogController.go @@ -1,22 +1,23 @@ package controllers import ( - "strings" - "github.com/lifei6671/mindoc/models" - "time" - "github.com/astaxie/beego" - "github.com/lifei6671/mindoc/conf" - "github.com/lifei6671/mindoc/utils/pagination" - "strconv" - "fmt" - "os" - "net/http" - "path/filepath" - "github.com/astaxie/beego/orm" - "html/template" "encoding/json" - "github.com/lifei6671/mindoc/utils" + "fmt" + "html/template" + "net/http" "net/url" + "os" + "path/filepath" + "strconv" + "strings" + "time" + + "github.com/astaxie/beego" + "github.com/astaxie/beego/orm" + "github.com/mindoc-org/mindoc/conf" + "github.com/mindoc-org/mindoc/models" + "github.com/mindoc-org/mindoc/utils" + "github.com/mindoc-org/mindoc/utils/pagination" ) type BlogController struct { diff --git a/controllers/BookController.go b/controllers/BookController.go index 3262f4c5..30e6a916 100644 --- a/controllers/BookController.go +++ b/controllers/BookController.go @@ -4,7 +4,6 @@ import ( "encoding/json" "errors" "fmt" - "github.com/lifei6671/mindoc/utils/sqltil" "html/template" "os" "path/filepath" @@ -13,16 +12,18 @@ import ( "strings" "time" + "github.com/mindoc-org/mindoc/utils/sqltil" + "net/http" "github.com/astaxie/beego" "github.com/astaxie/beego/logs" "github.com/astaxie/beego/orm" - "github.com/lifei6671/mindoc/conf" - "github.com/lifei6671/mindoc/graphics" - "github.com/lifei6671/mindoc/models" - "github.com/lifei6671/mindoc/utils" - "github.com/lifei6671/mindoc/utils/pagination" + "github.com/mindoc-org/mindoc/conf" + "github.com/mindoc-org/mindoc/graphics" + "github.com/mindoc-org/mindoc/models" + "github.com/mindoc-org/mindoc/utils" + "github.com/mindoc-org/mindoc/utils/pagination" "gopkg.in/russross/blackfriday.v2" ) diff --git a/controllers/BookMemberController.go b/controllers/BookMemberController.go index c4a5972e..1706b0b3 100644 --- a/controllers/BookMemberController.go +++ b/controllers/BookMemberController.go @@ -3,11 +3,11 @@ package controllers import ( "errors" + "github.com/astaxie/beego" "github.com/astaxie/beego/logs" "github.com/astaxie/beego/orm" - "github.com/lifei6671/mindoc/conf" - "github.com/lifei6671/mindoc/models" - "github.com/astaxie/beego" + "github.com/mindoc-org/mindoc/conf" + "github.com/mindoc-org/mindoc/models" ) type BookMemberController struct { diff --git a/controllers/DocumentController.go b/controllers/DocumentController.go index 1c79cb41..3eadcc09 100644 --- a/controllers/DocumentController.go +++ b/controllers/DocumentController.go @@ -3,19 +3,6 @@ package controllers import ( "encoding/json" "fmt" - "github.com/astaxie/beego" - "github.com/astaxie/beego/logs" - "github.com/astaxie/beego/orm" - "github.com/boombuler/barcode" - "github.com/boombuler/barcode/qr" - "github.com/lifei6671/mindoc/conf" - "github.com/lifei6671/mindoc/models" - "github.com/lifei6671/mindoc/utils" - "github.com/lifei6671/mindoc/utils/cryptil" - "github.com/lifei6671/mindoc/utils/filetil" - "github.com/lifei6671/mindoc/utils/gopool" - "github.com/lifei6671/mindoc/utils/pagination" - "gopkg.in/russross/blackfriday.v2" "html/template" "image/png" "net/http" @@ -26,6 +13,20 @@ import ( "strconv" "strings" "time" + + "github.com/astaxie/beego" + "github.com/astaxie/beego/logs" + "github.com/astaxie/beego/orm" + "github.com/boombuler/barcode" + "github.com/boombuler/barcode/qr" + "github.com/mindoc-org/mindoc/conf" + "github.com/mindoc-org/mindoc/models" + "github.com/mindoc-org/mindoc/utils" + "github.com/mindoc-org/mindoc/utils/cryptil" + "github.com/mindoc-org/mindoc/utils/filetil" + "github.com/mindoc-org/mindoc/utils/gopool" + "github.com/mindoc-org/mindoc/utils/pagination" + "gopkg.in/russross/blackfriday.v2" ) // DocumentController struct diff --git a/controllers/HomeController.go b/controllers/HomeController.go index 8d63717f..683c67b1 100644 --- a/controllers/HomeController.go +++ b/controllers/HomeController.go @@ -2,11 +2,12 @@ package controllers import ( "math" - "github.com/astaxie/beego" - "github.com/lifei6671/mindoc/models" - "github.com/lifei6671/mindoc/utils/pagination" - "github.com/lifei6671/mindoc/conf" "net/url" + + "github.com/astaxie/beego" + "github.com/mindoc-org/mindoc/conf" + "github.com/mindoc-org/mindoc/models" + "github.com/mindoc-org/mindoc/utils/pagination" ) type HomeController struct { diff --git a/controllers/ItemsetsController.go b/controllers/ItemsetsController.go index 5b88dc25..935868b4 100644 --- a/controllers/ItemsetsController.go +++ b/controllers/ItemsetsController.go @@ -1,11 +1,11 @@ package controllers import ( - "github.com/lifei6671/mindoc/conf" - "github.com/lifei6671/mindoc/models" - "github.com/astaxie/beego/orm" - "github.com/lifei6671/mindoc/utils/pagination" "github.com/astaxie/beego" + "github.com/astaxie/beego/orm" + "github.com/mindoc-org/mindoc/conf" + "github.com/mindoc-org/mindoc/models" + "github.com/mindoc-org/mindoc/utils/pagination" ) type ItemsetsController struct { diff --git a/controllers/LabelController.go b/controllers/LabelController.go index b87fc381..9ed2501e 100644 --- a/controllers/LabelController.go +++ b/controllers/LabelController.go @@ -5,9 +5,9 @@ import ( "github.com/astaxie/beego" "github.com/astaxie/beego/orm" - "github.com/lifei6671/mindoc/conf" - "github.com/lifei6671/mindoc/models" - "github.com/lifei6671/mindoc/utils/pagination" + "github.com/mindoc-org/mindoc/conf" + "github.com/mindoc-org/mindoc/models" + "github.com/mindoc-org/mindoc/utils/pagination" ) type LabelController struct { diff --git a/controllers/ManagerController.go b/controllers/ManagerController.go index 0d8104a1..991d4cec 100644 --- a/controllers/ManagerController.go +++ b/controllers/ManagerController.go @@ -10,17 +10,18 @@ import ( "path/filepath" "strconv" + "io/ioutil" + "os" + "github.com/astaxie/beego" "github.com/astaxie/beego/logs" "github.com/astaxie/beego/orm" - "github.com/lifei6671/mindoc/conf" - "github.com/lifei6671/mindoc/models" - "github.com/lifei6671/mindoc/utils" - "github.com/lifei6671/mindoc/utils/filetil" - "github.com/lifei6671/mindoc/utils/pagination" + "github.com/mindoc-org/mindoc/conf" + "github.com/mindoc-org/mindoc/models" + "github.com/mindoc-org/mindoc/utils" + "github.com/mindoc-org/mindoc/utils/filetil" + "github.com/mindoc-org/mindoc/utils/pagination" "gopkg.in/russross/blackfriday.v2" - "io/ioutil" - "os" ) type ManagerController struct { diff --git a/controllers/SearchController.go b/controllers/SearchController.go index f8a73294..f9868957 100644 --- a/controllers/SearchController.go +++ b/controllers/SearchController.go @@ -1,14 +1,15 @@ package controllers import ( - "github.com/astaxie/beego" - "github.com/lifei6671/mindoc/conf" - "github.com/lifei6671/mindoc/models" - "github.com/lifei6671/mindoc/utils" - "github.com/lifei6671/mindoc/utils/pagination" - "github.com/lifei6671/mindoc/utils/sqltil" "strconv" "strings" + + "github.com/astaxie/beego" + "github.com/mindoc-org/mindoc/conf" + "github.com/mindoc-org/mindoc/models" + "github.com/mindoc-org/mindoc/utils" + "github.com/mindoc-org/mindoc/utils/pagination" + "github.com/mindoc-org/mindoc/utils/sqltil" ) type SearchController struct { diff --git a/controllers/SettingController.go b/controllers/SettingController.go index 0bb75f6a..2f7992c3 100644 --- a/controllers/SettingController.go +++ b/controllers/SettingController.go @@ -9,10 +9,10 @@ import ( "time" "github.com/astaxie/beego/logs" - "github.com/lifei6671/mindoc/conf" - "github.com/lifei6671/mindoc/graphics" - "github.com/lifei6671/mindoc/models" - "github.com/lifei6671/mindoc/utils" + "github.com/mindoc-org/mindoc/conf" + "github.com/mindoc-org/mindoc/graphics" + "github.com/mindoc-org/mindoc/models" + "github.com/mindoc-org/mindoc/utils" ) type SettingController struct { @@ -34,7 +34,7 @@ func (c *SettingController) Index() { member.Email = email member.Phone = phone member.Description = description - member.RealName = strings.TrimSpace(c.GetString("real_name","")) + member.RealName = strings.TrimSpace(c.GetString("real_name", "")) if err := member.Update(); err != nil { c.JsonResult(602, err.Error()) } diff --git a/controllers/TemplateController.go b/controllers/TemplateController.go index bd76438f..a51319bc 100644 --- a/controllers/TemplateController.go +++ b/controllers/TemplateController.go @@ -1,11 +1,12 @@ package controllers import ( - "github.com/lifei6671/mindoc/models" - "github.com/astaxie/beego/orm" "errors" "strings" - "github.com/lifei6671/mindoc/conf" + + "github.com/astaxie/beego/orm" + "github.com/mindoc-org/mindoc/conf" + "github.com/mindoc-org/mindoc/models" ) type TemplateController struct { diff --git a/converter/converter.go b/converter/converter.go index b4d32dc4..9b7419e0 100644 --- a/converter/converter.go +++ b/converter/converter.go @@ -10,15 +10,16 @@ import ( "path/filepath" "strings" - "time" - "os/exec" "errors" + "os/exec" + "time" - "github.com/lifei6671/mindoc/utils/filetil" - "github.com/lifei6671/mindoc/utils/ziptil" - "github.com/lifei6671/mindoc/utils/cryptil" - "sync" "html" + "sync" + + "github.com/mindoc-org/mindoc/utils/cryptil" + "github.com/mindoc-org/mindoc/utils/filetil" + "github.com/mindoc-org/mindoc/utils/ziptil" ) type Converter struct { diff --git a/go.mod b/go.mod index 58423ad1..a87ea67d 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/lifei6671/mindoc +module github.com/mindoc-org/mindoc go 1.12 diff --git a/main.go b/main.go index 9160e648..a8ff125b 100644 --- a/main.go +++ b/main.go @@ -9,10 +9,10 @@ import ( _ "github.com/astaxie/beego/session/mysql" _ "github.com/astaxie/beego/session/redis" "github.com/kardianos/service" - "github.com/lifei6671/mindoc/commands" - "github.com/lifei6671/mindoc/commands/daemon" - _ "github.com/lifei6671/mindoc/routers" _ "github.com/mattn/go-sqlite3" + "github.com/mindoc-org/mindoc/commands" + "github.com/mindoc-org/mindoc/commands/daemon" + _ "github.com/mindoc-org/mindoc/routers" ) func main() { diff --git a/models/AttachmentModel.go b/models/AttachmentModel.go index fe4c9583..1eaa7295 100644 --- a/models/AttachmentModel.go +++ b/models/AttachmentModel.go @@ -10,8 +10,8 @@ import ( "github.com/astaxie/beego" "github.com/astaxie/beego/orm" - "github.com/lifei6671/mindoc/conf" - "github.com/lifei6671/mindoc/utils/filetil" + "github.com/mindoc-org/mindoc/conf" + "github.com/mindoc-org/mindoc/utils/filetil" ) // Attachment struct . @@ -82,11 +82,12 @@ func (m *Attachment) Find(id int) (*Attachment, error) { return m, err } + //查询指定文档的附件列表 func (m *Attachment) FindListByDocumentId(docId int) (attaches []*Attachment, err error) { o := orm.NewOrm() - _, err = o.QueryTable(m.TableNameWithPrefix()).Filter("document_id", docId).Filter("book_id__gt",0).OrderBy("-attachment_id").All(&attaches) + _, err = o.QueryTable(m.TableNameWithPrefix()).Filter("document_id", docId).Filter("book_id__gt", 0).OrderBy("-attachment_id").All(&attaches) return } @@ -109,7 +110,7 @@ func (m *Attachment) FindToPager(pageIndex, pageSize int) (attachList []*Attachm if err != nil { if err == orm.ErrNoRows { - beego.Info("没有查到附件 ->",err) + beego.Info("没有查到附件 ->", err) err = nil } return @@ -122,12 +123,12 @@ func (m *Attachment) FindToPager(pageIndex, pageSize int) (attachList []*Attachm //当项目ID为0标识是文章的附件 if item.BookId == 0 && item.DocumentId > 0 { blog := NewBlog() - if err := o.QueryTable(blog.TableNameWithPrefix()).Filter("blog_id",item.DocumentId).One(blog,"blog_title");err == nil { + if err := o.QueryTable(blog.TableNameWithPrefix()).Filter("blog_id", item.DocumentId).One(blog, "blog_title"); err == nil { attach.BookName = blog.BlogTitle - }else{ + } else { attach.BookName = "[文章不存在]" } - }else { + } else { book := NewBook() if e := o.QueryTable(book.TableNameWithPrefix()).Filter("book_id", item.BookId).One(book, "book_name"); e == nil { diff --git a/models/AttachmentResult.go b/models/AttachmentResult.go index dd8409dc..0ea363fb 100644 --- a/models/AttachmentResult.go +++ b/models/AttachmentResult.go @@ -4,7 +4,7 @@ import ( "strings" "github.com/astaxie/beego/orm" - "github.com/lifei6671/mindoc/utils/filetil" + "github.com/mindoc-org/mindoc/utils/filetil" ) type AttachmentResult struct { @@ -36,9 +36,9 @@ func (m *AttachmentResult) Find(id int) (*AttachmentResult, error) { if attach.BookId == 0 && attach.DocumentId > 0 { blog := NewBlog() - if err := o.QueryTable(blog.TableNameWithPrefix()).Filter("blog_id",attach.DocumentId).One(blog,"blog_title");err == nil { + if err := o.QueryTable(blog.TableNameWithPrefix()).Filter("blog_id", attach.DocumentId).One(blog, "blog_title"); err == nil { m.BookName = blog.BlogTitle - }else{ + } else { m.BookName = "[文章不存在]" } } else { diff --git a/models/Blog.go b/models/Blog.go index 3c58c943..9fc45465 100644 --- a/models/Blog.go +++ b/models/Blog.go @@ -3,14 +3,15 @@ package models import ( "bytes" "fmt" + "strings" + "time" + "github.com/PuerkitoBio/goquery" "github.com/astaxie/beego" "github.com/astaxie/beego/orm" - "github.com/lifei6671/mindoc/cache" - "github.com/lifei6671/mindoc/conf" - "github.com/lifei6671/mindoc/utils" - "strings" - "time" + "github.com/mindoc-org/mindoc/cache" + "github.com/mindoc-org/mindoc/conf" + "github.com/mindoc-org/mindoc/utils" ) //博文表 diff --git a/models/BookModel.go b/models/BookModel.go index 7fdffb14..4b6766a4 100644 --- a/models/BookModel.go +++ b/models/BookModel.go @@ -15,15 +15,16 @@ import ( "time" "encoding/json" + "github.com/astaxie/beego" "github.com/astaxie/beego/logs" "github.com/astaxie/beego/orm" - "github.com/lifei6671/mindoc/conf" - "github.com/lifei6671/mindoc/utils" - "github.com/lifei6671/mindoc/utils/cryptil" - "github.com/lifei6671/mindoc/utils/filetil" - "github.com/lifei6671/mindoc/utils/requests" - "github.com/lifei6671/mindoc/utils/ziptil" + "github.com/mindoc-org/mindoc/conf" + "github.com/mindoc-org/mindoc/utils" + "github.com/mindoc-org/mindoc/utils/cryptil" + "github.com/mindoc-org/mindoc/utils/filetil" + "github.com/mindoc-org/mindoc/utils/requests" + "github.com/mindoc-org/mindoc/utils/ziptil" "gopkg.in/russross/blackfriday.v2" ) diff --git a/models/BookResult.go b/models/BookResult.go index f782b526..619aa14f 100644 --- a/models/BookResult.go +++ b/models/BookResult.go @@ -9,21 +9,22 @@ import ( "strings" "time" + "encoding/json" + "net/http" + "regexp" + "github.com/PuerkitoBio/goquery" "github.com/astaxie/beego" "github.com/astaxie/beego/logs" "github.com/astaxie/beego/orm" - "github.com/lifei6671/mindoc/conf" - "github.com/lifei6671/mindoc/converter" - "github.com/lifei6671/mindoc/utils/filetil" - "github.com/lifei6671/mindoc/utils/ziptil" + "github.com/mindoc-org/mindoc/conf" + "github.com/mindoc-org/mindoc/converter" + "github.com/mindoc-org/mindoc/utils/cryptil" + "github.com/mindoc-org/mindoc/utils/filetil" + "github.com/mindoc-org/mindoc/utils/gopool" + "github.com/mindoc-org/mindoc/utils/requests" + "github.com/mindoc-org/mindoc/utils/ziptil" "gopkg.in/russross/blackfriday.v2" - "regexp" - "github.com/lifei6671/mindoc/utils/cryptil" - "github.com/lifei6671/mindoc/utils/requests" - "github.com/lifei6671/mindoc/utils/gopool" - "net/http" - "encoding/json" ) var ( diff --git a/models/DocumentHistory.go b/models/DocumentHistory.go index 0e9973ed..3490f709 100644 --- a/models/DocumentHistory.go +++ b/models/DocumentHistory.go @@ -3,9 +3,9 @@ package models import ( "time" - "github.com/astaxie/beego/orm" - "github.com/lifei6671/mindoc/conf" "github.com/astaxie/beego" + "github.com/astaxie/beego/orm" + "github.com/mindoc-org/mindoc/conf" ) type DocumentHistory struct { diff --git a/models/DocumentModel.go b/models/DocumentModel.go index 24eece15..44eebf52 100644 --- a/models/DocumentModel.go +++ b/models/DocumentModel.go @@ -7,15 +7,16 @@ import ( "strconv" "bytes" - "github.com/PuerkitoBio/goquery" - "github.com/astaxie/beego" - "github.com/astaxie/beego/orm" - "github.com/lifei6671/mindoc/cache" - "github.com/lifei6671/mindoc/conf" - "github.com/lifei6671/mindoc/utils" "os" "path/filepath" "strings" + + "github.com/PuerkitoBio/goquery" + "github.com/astaxie/beego" + "github.com/astaxie/beego/orm" + "github.com/mindoc-org/mindoc/cache" + "github.com/mindoc-org/mindoc/conf" + "github.com/mindoc-org/mindoc/utils" ) // Document struct. diff --git a/models/DocumentTree.go b/models/DocumentTree.go index e742ea6c..4e61593c 100644 --- a/models/DocumentTree.go +++ b/models/DocumentTree.go @@ -3,10 +3,11 @@ package models import ( "bytes" "fmt" - "github.com/astaxie/beego/orm" - "github.com/lifei6671/mindoc/conf" "html/template" "math" + + "github.com/astaxie/beego/orm" + "github.com/mindoc-org/mindoc/conf" ) type DocumentTree struct { diff --git a/models/Itemsets.go b/models/Itemsets.go index 8978d198..0cd5038b 100644 --- a/models/Itemsets.go +++ b/models/Itemsets.go @@ -1,14 +1,15 @@ package models import ( - "time" - "github.com/lifei6671/mindoc/conf" - "github.com/astaxie/beego/orm" - "github.com/astaxie/beego" "errors" - "github.com/lifei6671/mindoc/utils/cryptil" - "github.com/lifei6671/mindoc/utils" "strings" + "time" + + "github.com/astaxie/beego" + "github.com/astaxie/beego/orm" + "github.com/mindoc-org/mindoc/conf" + "github.com/mindoc-org/mindoc/utils" + "github.com/mindoc-org/mindoc/utils/cryptil" ) //项目空间 diff --git a/models/LabelModel.go b/models/LabelModel.go index 8bbb6cb1..772e7fa1 100644 --- a/models/LabelModel.go +++ b/models/LabelModel.go @@ -1,10 +1,11 @@ package models import ( - "github.com/astaxie/beego/orm" - "github.com/lifei6671/mindoc/conf" "strings" + "github.com/astaxie/beego" + "github.com/astaxie/beego/orm" + "github.com/mindoc-org/mindoc/conf" ) type Label struct { diff --git a/models/Logs.go b/models/Logs.go index 5dcadb41..5a46796d 100644 --- a/models/Logs.go +++ b/models/Logs.go @@ -2,10 +2,11 @@ package models import ( "errors" - "github.com/astaxie/beego/orm" - "github.com/lifei6671/mindoc/conf" "sync/atomic" "time" + + "github.com/astaxie/beego/orm" + "github.com/mindoc-org/mindoc/conf" ) var loggerQueue = &logQueue{channel: make(chan *Logger, 100), isRuning: 0} diff --git a/models/Member.go b/models/Member.go index 6d4fccf0..45ccd57d 100644 --- a/models/Member.go +++ b/models/Member.go @@ -17,12 +17,13 @@ import ( "gopkg.in/ldap.v2" + "math" + "github.com/astaxie/beego" "github.com/astaxie/beego/logs" "github.com/astaxie/beego/orm" - "github.com/lifei6671/mindoc/conf" - "github.com/lifei6671/mindoc/utils" - "math" + "github.com/mindoc-org/mindoc/conf" + "github.com/mindoc-org/mindoc/utils" ) type Member struct { diff --git a/models/MemberResult.go b/models/MemberResult.go index 64eb072c..84e97efd 100644 --- a/models/MemberResult.go +++ b/models/MemberResult.go @@ -1,9 +1,10 @@ package models import ( - "github.com/astaxie/beego/orm" - "github.com/lifei6671/mindoc/conf" "time" + + "github.com/astaxie/beego/orm" + "github.com/mindoc-org/mindoc/conf" ) type MemberRelationshipResult struct { diff --git a/models/MemberToken.go b/models/MemberToken.go index 7e612c58..478dbcfd 100644 --- a/models/MemberToken.go +++ b/models/MemberToken.go @@ -1,9 +1,10 @@ package models import ( - "github.com/astaxie/beego/orm" - "github.com/lifei6671/mindoc/conf" "time" + + "github.com/astaxie/beego/orm" + "github.com/mindoc-org/mindoc/conf" ) type MemberToken struct { diff --git a/models/Migrations.go b/models/Migrations.go index d06cf60e..9faa4d30 100644 --- a/models/Migrations.go +++ b/models/Migrations.go @@ -1,9 +1,10 @@ package models import ( - "github.com/astaxie/beego/orm" - "github.com/lifei6671/mindoc/conf" "time" + + "github.com/astaxie/beego/orm" + "github.com/mindoc-org/mindoc/conf" ) type Migration struct { diff --git a/models/Options.go b/models/Options.go index d02cd735..b3b39ab4 100644 --- a/models/Options.go +++ b/models/Options.go @@ -2,7 +2,7 @@ package models import ( "github.com/astaxie/beego/orm" - "github.com/lifei6671/mindoc/conf" + "github.com/mindoc-org/mindoc/conf" ) // Option struct . diff --git a/models/Relationship.go b/models/Relationship.go index 21e0409d..8adcc538 100644 --- a/models/Relationship.go +++ b/models/Relationship.go @@ -2,9 +2,10 @@ package models import ( "errors" + "github.com/astaxie/beego/logs" "github.com/astaxie/beego/orm" - "github.com/lifei6671/mindoc/conf" + "github.com/mindoc-org/mindoc/conf" ) type Relationship struct { diff --git a/models/Team.go b/models/Team.go index 0febd9f0..cc9a5fa0 100644 --- a/models/Team.go +++ b/models/Team.go @@ -1,11 +1,12 @@ package models import ( - "time" - "github.com/lifei6671/mindoc/conf" - "github.com/astaxie/beego/orm" "errors" + "time" + "github.com/astaxie/beego" + "github.com/astaxie/beego/orm" + "github.com/mindoc-org/mindoc/conf" ) //团队. diff --git a/models/TeamMember.go b/models/TeamMember.go index e7944304..477f7062 100644 --- a/models/TeamMember.go +++ b/models/TeamMember.go @@ -1,10 +1,11 @@ package models import ( - "github.com/lifei6671/mindoc/conf" "errors" - "github.com/astaxie/beego/orm" + "github.com/astaxie/beego" + "github.com/astaxie/beego/orm" + "github.com/mindoc-org/mindoc/conf" ) type TeamMember struct { diff --git a/models/TeamRelationship.go b/models/TeamRelationship.go index 5ff0cd4a..4b6fd6db 100644 --- a/models/TeamRelationship.go +++ b/models/TeamRelationship.go @@ -1,11 +1,12 @@ package models import ( - "github.com/lifei6671/mindoc/conf" - "time" - "github.com/astaxie/beego/orm" - "github.com/astaxie/beego" "errors" + "time" + + "github.com/astaxie/beego" + "github.com/astaxie/beego/orm" + "github.com/mindoc-org/mindoc/conf" ) type TeamRelationship struct { diff --git a/models/Template.go b/models/Template.go index 49a5325b..48625f0e 100644 --- a/models/Template.go +++ b/models/Template.go @@ -1,12 +1,13 @@ package models import ( - "time" - "github.com/lifei6671/mindoc/conf" - "github.com/astaxie/beego/orm" - "github.com/astaxie/beego/logs" - "github.com/astaxie/beego" "errors" + "time" + + "github.com/astaxie/beego" + "github.com/astaxie/beego/logs" + "github.com/astaxie/beego/orm" + "github.com/mindoc-org/mindoc/conf" ) type Template struct { diff --git a/models/comment.go b/models/comment.go index 4057260f..e99f8379 100644 --- a/models/comment.go +++ b/models/comment.go @@ -2,9 +2,10 @@ package models import ( "errors" - "github.com/astaxie/beego/orm" - "github.com/lifei6671/mindoc/conf" "time" + + "github.com/astaxie/beego/orm" + "github.com/mindoc-org/mindoc/conf" ) //Comment struct diff --git a/models/comment_vote.go b/models/comment_vote.go index f55638de..69789c81 100644 --- a/models/comment_vote.go +++ b/models/comment_vote.go @@ -1,9 +1,10 @@ package models import ( - "github.com/astaxie/beego/orm" - "github.com/lifei6671/mindoc/conf" "time" + + "github.com/astaxie/beego/orm" + "github.com/mindoc-org/mindoc/conf" ) type CommentVote struct { diff --git a/routers/filter.go b/routers/filter.go index c946d552..81e6d43d 100644 --- a/routers/filter.go +++ b/routers/filter.go @@ -2,12 +2,13 @@ package routers import ( "encoding/json" - "github.com/astaxie/beego" - "github.com/astaxie/beego/context" - "github.com/lifei6671/mindoc/conf" - "github.com/lifei6671/mindoc/models" "net/url" "regexp" + + "github.com/astaxie/beego" + "github.com/astaxie/beego/context" + "github.com/mindoc-org/mindoc/conf" + "github.com/mindoc-org/mindoc/models" ) func init() { diff --git a/routers/router.go b/routers/router.go index 95a83836..d4c497f5 100644 --- a/routers/router.go +++ b/routers/router.go @@ -2,7 +2,7 @@ package routers import ( "github.com/astaxie/beego" - "github.com/lifei6671/mindoc/controllers" + "github.com/mindoc-org/mindoc/controllers" ) func init() { @@ -35,8 +35,8 @@ func init() { beego.Router("/manager/attach/list", &controllers.ManagerController{}, "*:AttachList") beego.Router("/manager/attach/detailed/:id", &controllers.ManagerController{}, "*:AttachDetailed") beego.Router("/manager/attach/delete", &controllers.ManagerController{}, "post:AttachDelete") - beego.Router("/manager/label/list", &controllers.ManagerController{},"get:LabelList") - beego.Router("/manager/label/delete/:id", &controllers.ManagerController{},"post:LabelDelete") + beego.Router("/manager/label/list", &controllers.ManagerController{}, "get:LabelList") + beego.Router("/manager/label/delete/:id", &controllers.ManagerController{}, "post:LabelDelete") //beego.Router("/manager/config", &controllers.ManagerController{}, "*:Config") @@ -51,16 +51,14 @@ func init() { beego.Router("/manager/team/member/change_role", &controllers.ManagerController{}, "POST:TeamChangeMemberRole") beego.Router("/manager/team/member/search", &controllers.ManagerController{}, "*:TeamSearchMember") - beego.Router("/manager/team/book/list/:id", &controllers.ManagerController{}, "*:TeamBookList") beego.Router("/manager/team/book/add", &controllers.ManagerController{}, "POST:TeamBookAdd") beego.Router("/manager/team/book/delete", &controllers.ManagerController{}, "POST:TeamBookDelete") beego.Router("/manager/team/book/search", &controllers.ManagerController{}, "*:TeamSearchBook") - beego.Router("/manager/itemsets", &controllers.ManagerController{},"*:Itemsets") - beego.Router("/manager/itemsets/edit", &controllers.ManagerController{},"post:ItemsetsEdit") - beego.Router("/manager/itemsets/delete", &controllers.ManagerController{},"post:ItemsetsDelete") - + beego.Router("/manager/itemsets", &controllers.ManagerController{}, "*:Itemsets") + beego.Router("/manager/itemsets/edit", &controllers.ManagerController{}, "post:ItemsetsEdit") + beego.Router("/manager/itemsets/delete", &controllers.ManagerController{}, "post:ItemsetsDelete") beego.Router("/setting", &controllers.SettingController{}, "*:Index") beego.Router("/setting/password", &controllers.SettingController{}, "*:Password") @@ -74,15 +72,14 @@ func init() { beego.Router("/book/:key/sort", &controllers.BookController{}, "post:SaveSort") beego.Router("/book/:key/teams", &controllers.BookController{}, "*:Team") - beego.Router("/book/create", &controllers.BookController{}, "*:Create") beego.Router("/book/itemsets/search", &controllers.BookController{}, "*:ItemsetsSearch") beego.Router("/book/users/create", &controllers.BookMemberController{}, "post:AddMember") beego.Router("/book/users/change", &controllers.BookMemberController{}, "post:ChangeRole") beego.Router("/book/users/delete", &controllers.BookMemberController{}, "post:RemoveMember") - beego.Router("/book/users/import", &controllers.BookController{},"post:Import") - beego.Router("/book/users/copy", &controllers.BookController{},"post:Copy") + beego.Router("/book/users/import", &controllers.BookController{}, "post:Import") + beego.Router("/book/users/copy", &controllers.BookController{}, "post:Copy") beego.Router("/book/setting/save", &controllers.BookController{}, "post:SaveBook") beego.Router("/book/setting/open", &controllers.BookController{}, "post:PrivatelyOwned") @@ -94,26 +91,24 @@ func init() { beego.Router("/book/team/delete", &controllers.BookController{}, "POST:TeamDelete") beego.Router("/book/team/search", &controllers.BookController{}, "*:TeamSearch") - //管理文章的路由 - beego.Router("/manage/blogs", &controllers.BlogController{},"*:ManageList") + beego.Router("/manage/blogs", &controllers.BlogController{}, "*:ManageList") beego.Router("/manage/blogs/setting/?:id", &controllers.BlogController{}, "*:ManageSetting") - beego.Router("/manage/blogs/edit/?:id",&controllers.BlogController{}, "*:ManageEdit") - beego.Router("/manage/blogs/delete",&controllers.BlogController{}, "post:ManageDelete") - beego.Router("/manage/blogs/upload",&controllers.BlogController{}, "post:Upload") - beego.Router("/manage/blogs/attach/:id",&controllers.BlogController{}, "post:RemoveAttachment") - + beego.Router("/manage/blogs/edit/?:id", &controllers.BlogController{}, "*:ManageEdit") + beego.Router("/manage/blogs/delete", &controllers.BlogController{}, "post:ManageDelete") + beego.Router("/manage/blogs/upload", &controllers.BlogController{}, "post:Upload") + beego.Router("/manage/blogs/attach/:id", &controllers.BlogController{}, "post:RemoveAttachment") //读文章的路由 beego.Router("/blogs", &controllers.BlogController{}, "*:List") - beego.Router("/blog-attach/:id:int/:attach_id:int", &controllers.BlogController{},"get:Download") - beego.Router("/blog-:id([0-9]+).html",&controllers.BlogController{}, "*:Index") + beego.Router("/blog-attach/:id:int/:attach_id:int", &controllers.BlogController{}, "get:Download") + beego.Router("/blog-:id([0-9]+).html", &controllers.BlogController{}, "*:Index") //模板相关接口 - beego.Router("/api/template/get", &controllers.TemplateController{},"get:Get") - beego.Router("/api/template/list", &controllers.TemplateController{},"post:List") - beego.Router("/api/template/add", &controllers.TemplateController{},"post:Add") - beego.Router("/api/template/remove", &controllers.TemplateController{},"post:Delete") + beego.Router("/api/template/get", &controllers.TemplateController{}, "get:Get") + beego.Router("/api/template/list", &controllers.TemplateController{}, "post:List") + beego.Router("/api/template/add", &controllers.TemplateController{}, "post:Add") + beego.Router("/api/template/remove", &controllers.TemplateController{}, "post:Delete") beego.Router("/api/attach/remove/", &controllers.DocumentController{}, "post:RemoveAttachment") beego.Router("/api/:key/edit/?:id", &controllers.DocumentController{}, "*:Edit") @@ -145,7 +140,7 @@ func init() { beego.Router("/tag/:key", &controllers.LabelController{}, "get:Index") beego.Router("/tags", &controllers.LabelController{}, "get:List") - beego.Router("/items", &controllers.ItemsetsController{},"get:Index") - beego.Router("/items/:key", &controllers.ItemsetsController{},"get:List") + beego.Router("/items", &controllers.ItemsetsController{}, "get:Index") + beego.Router("/items/:key", &controllers.ItemsetsController{}, "get:List") } diff --git a/utils/html.go b/utils/html.go index 7ab91c6d..c9bb137b 100644 --- a/utils/html.go +++ b/utils/html.go @@ -1,11 +1,12 @@ package utils import ( + "bytes" "regexp" "strings" + "github.com/PuerkitoBio/goquery" - "bytes" - "github.com/lifei6671/mindoc/conf" + "github.com/mindoc-org/mindoc/conf" ) func StripTags(s string) string { diff --git a/views/document/template_normal.tpl b/views/document/template_normal.tpl index efeb5b24..3db84992 100644 --- a/views/document/template_normal.tpl +++ b/views/document/template_normal.tpl @@ -16,18 +16,18 @@ MinDoc 的前身是 SmartWiki 文档系统。SmartWiki 是基于 PHP 框架 lara **如果你的服务器上没有安装golang程序请手动设置一个环境变量如下:键名为 ZONEINFO,值为MinDoc跟目录下的/lib/time/zoneinfo.zip 。** -**Windows 教程:** [https://github.com/lifei6671/mindoc/blob/master/README_WIN.md](docs/README_WIN.md) +**Windows 教程:** [https://github.com/mindoc-org/mindoc/blob/master/README_WIN.md](docs/README_WIN.md) -**Linux 教程:**  [https://github.com/lifei6671/mindoc/blob/master/README_LINUX.md](docs/README_LINUX.md) +**Linux 教程:**  [https://github.com/mindoc-org/mindoc/blob/master/README_LINUX.md](docs/README_LINUX.md) -**PDF 导出配置教程**  [https://github.com/lifei6671/mindoc/blob/master/docs/README_LINUX.md](docs/WKHTMLTOPDF.md) +**PDF 导出配置教程**  [https://github.com/mindoc-org/mindoc/blob/master/docs/README_LINUX.md](docs/WKHTMLTOPDF.md) -对于没有Golang使用经验的用户,可以从 [https://github.com/lifei6671/mindoc/releases](https://github.com/lifei6671/mindoc/releases) 这里下载编译完的程序。 +对于没有Golang使用经验的用户,可以从 [https://github.com/mindoc-org/mindoc/releases](https://github.com/mindoc-org/mindoc/releases) 这里下载编译完的程序。 如果有Golang开发经验,建议通过编译安装。 ```bash -git clone https://github.com/lifei6671/mindoc.git +git clone https://github.com/mindoc-org/mindoc.git go get -d ./... diff --git a/views/widgets/footer.tpl b/views/widgets/footer.tpl index 026d764b..6c638b73 100644 --- a/views/widgets/footer.tpl +++ b/views/widgets/footer.tpl @@ -3,9 +3,9 @@
官方网站  ·  - 意见反馈 + 意见反馈  ·  - 项目源码 + 项目源码  ·  使用手册