chore!(all): update go import path

BREAKING CHANGE: use github.com/mindoc-org/mindoc as import path
pull/661/head
roberChen 2021-03-23 15:09:17 +08:00
parent 886bc8ee51
commit 79f70d830d
54 changed files with 279 additions and 248 deletions

View File

@ -14,7 +14,7 @@ script:
- dep ensure && GO_ENABLED=1 go build -v -x -tags "pam" && go install - dep ensure && GO_ENABLED=1 go build -v -x -tags "pam" && go install
before_deploy: 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 - 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 - cp conf/app.conf.example conf/app.conf
- zip -r mindoc_linux_amd64.zip conf static uploads views lib mindoc_linux_amd64 - zip -r mindoc_linux_amd64.zip conf static uploads views lib mindoc_linux_amd64

View File

@ -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 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 && \ 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 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/ ADD simsun.ttc /usr/share/fonts/win/
FROM alpine:latest 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 /var/linux-installer.py .
COPY --from=build /usr/share/fonts/win/simsun.ttc /usr/share/fonts/win/ 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 /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 && \ RUN apk add glibc-bin.apk glibc.apk && \
/usr/glibc-compat/sbin/ldconfig /lib /usr/glibc-compat/lib && \ /usr/glibc-compat/sbin/ldconfig /lib /usr/glibc-compat/lib && \

View File

@ -25,7 +25,7 @@ MinDoc 的前身是 SmartWiki 文档系统。SmartWiki 是基于 PHP 框架 lara
维护权限需要作者添加有意向者请添加下方QQ群或通过发送邮件(`gsw945#foxmail.com`, 请替换`#`为`@`),私聊我加入作者所在的微信群。 维护权限需要作者添加有意向者请添加下方QQ群或通过发送邮件(`gsw945#foxmail.com`, 请替换`#`为`@`),私聊我加入作者所在的微信群。
</details> </details>
遇到问题请提 [Issues](https://github.com/lifei6671/mindoc/issues )欢迎使用者和贡献者加入QQ群 `1051164153` 遇到问题请提 [Issues](https://github.com/mindoc-org/mindoc/issues )欢迎使用者和贡献者加入QQ群 `1051164153`
<a target="_blank" href="https://qm.qq.com/cgi-bin/qm/qr?k=bHFR7P3Qp1nsSPbsTw4KN_ZpFLUAblIU&jump_from=webapi"><img border="0" src="https://pub.idqqimg.com/wpa/images/group.png" alt="MinDoc使用&amp;开发交流群" title="MinDoc使用&amp;开发交流群"></a> <a target="_blank" href="https://qm.qq.com/cgi-bin/qm/qr?k=bHFR7P3Qp1nsSPbsTw4KN_ZpFLUAblIU&jump_from=webapi"><img border="0" src="https://pub.idqqimg.com/wpa/images/group.png" alt="MinDoc使用&amp;开发交流群" title="MinDoc使用&amp;开发交流群"></a>
--- ---
@ -36,12 +36,12 @@ MinDoc 的前身是 SmartWiki 文档系统。SmartWiki 是基于 PHP 框架 lara
更多信息请查看手册: [MinDoc 使用手册](https://www.iminho.me/wiki/docs/mindoc/mindoc-summary.md) 更多信息请查看手册: [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)。 如果有Golang开发经验建议通过编译安装在此之前您需要先安装Golang官方包管理工具详见[Install dep](https://golang.github.io/dep/docs/installation.html)。
```bash ```bash
git clone https://github.com/lifei6671/mindoc.git git clone https://github.com/mindoc-org/mindoc.git
dep ensure dep ensure

View File

@ -16,17 +16,16 @@ environment:
GOARCH: amd64 GOARCH: amd64
install: install:
- ps: if($env:tbs_tools -eq 'mingw' -and $env:tbs_arch -eq 'x64') - 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; 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; 7z x -oC:\ mingw_x86_64.7z | out-null;
} }
- ps: if($env:tbs_tools -eq 'mingw' -and $env:tbs_arch -eq 'x86') - 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; 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; 7z x -oC:\ mingw_x86.7z | out-null;
} }
- set PATH=%GOPATH%\bin;c:\go\bin;%PATH% - set PATH=%GOPATH%\bin;c:\go\bin;%PATH%
- echo %PATH% - echo %PATH%
- echo %GOPATH% - echo %GOPATH%
@ -40,7 +39,7 @@ build_script:
- for /f "delims=" %%i in ('go version') do (set GO_VERSION=%%i) - for /f "delims=" %%i in ('go version') do (set GO_VERSION=%%i)
- cd c:\gopath\src\github.com\lifei6671\mindoc - cd c:\gopath\src\github.com\lifei6671\mindoc
- go mod tidy - 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/* - 7z a -t7z -r mindoc_windows_%GOARCH%.7z conf/*.conf* static/* mindoc_windows_%GOARCH%.exe views/* uploads/*
test_script: test_script:
- mindoc_windows_%GOARCH%.exe version - mindoc_windows_%GOARCH%.exe version
@ -58,9 +57,9 @@ artifacts:
deploy: deploy:
- provider: GitHub - provider: GitHub
auth_token: auth_token:
secure: "Qkhxloft5lBKti7O+vVS+Vrxh7CBAUVhlfdZ9ptBXjFtjt6jHXnaBA2uv2OYbISB" secure: "Qkhxloft5lBKti7O+vVS+Vrxh7CBAUVhlfdZ9ptBXjFtjt6jHXnaBA2uv2OYbISB"
draft: false draft: false
prerelease: false prerelease: false
artifact: mindoc_windows_%GOARCH%.7z artifact: mindoc_windows_%GOARCH%.7z
on: on:
appveyor_repo_tag: true appveyor_repo_tag: true

View File

@ -13,6 +13,8 @@ import (
"bytes" "bytes"
"encoding/json" "encoding/json"
"net/http"
"github.com/astaxie/beego" "github.com/astaxie/beego"
beegoCache "github.com/astaxie/beego/cache" beegoCache "github.com/astaxie/beego/cache"
_ "github.com/astaxie/beego/cache/memcache" _ "github.com/astaxie/beego/cache/memcache"
@ -22,11 +24,10 @@ import (
"github.com/astaxie/beego/orm" "github.com/astaxie/beego/orm"
"github.com/howeyc/fsnotify" "github.com/howeyc/fsnotify"
"github.com/lifei6671/gocaptcha" "github.com/lifei6671/gocaptcha"
"github.com/lifei6671/mindoc/cache" "github.com/mindoc-org/mindoc/cache"
"github.com/lifei6671/mindoc/conf" "github.com/mindoc-org/mindoc/conf"
"github.com/lifei6671/mindoc/models" "github.com/mindoc-org/mindoc/models"
"github.com/lifei6671/mindoc/utils/filetil" "github.com/mindoc-org/mindoc/utils/filetil"
"net/http"
) )
// RegisterDataBase 注册数据库 // RegisterDataBase 注册数据库

View File

@ -4,12 +4,13 @@ import (
"fmt" "fmt"
"os" "os"
"path/filepath"
"github.com/astaxie/beego" "github.com/astaxie/beego"
"github.com/kardianos/service" "github.com/kardianos/service"
"github.com/lifei6671/mindoc/commands" "github.com/mindoc-org/mindoc/commands"
"github.com/lifei6671/mindoc/conf" "github.com/mindoc-org/mindoc/conf"
"github.com/lifei6671/mindoc/controllers" "github.com/mindoc-org/mindoc/controllers"
"path/filepath"
) )
type Daemon struct { type Daemon struct {

View File

@ -5,12 +5,13 @@ import (
"os" "os"
"time" "time"
"github.com/astaxie/beego/orm"
"github.com/lifei6671/mindoc/conf"
"github.com/lifei6671/mindoc/models"
"flag" "flag"
"github.com/lifei6671/mindoc/utils"
"github.com/astaxie/beego" "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"
) )
//系统安装. //系统安装.

View File

@ -18,10 +18,11 @@ import (
"container/list" "container/list"
"fmt" "fmt"
"log"
"github.com/astaxie/beego" "github.com/astaxie/beego"
"github.com/astaxie/beego/orm" "github.com/astaxie/beego/orm"
"github.com/lifei6671/mindoc/models" "github.com/mindoc-org/mindoc/models"
"log"
) )
var ( var (

View File

@ -3,10 +3,11 @@ package migrate
import ( import (
"errors" "errors"
"fmt" "fmt"
"github.com/astaxie/beego/orm"
"github.com/lifei6671/mindoc/models"
"strings" "strings"
"time" "time"
"github.com/astaxie/beego/orm"
"github.com/mindoc-org/mindoc/models"
) )
type MigrationVersion03 struct { type MigrationVersion03 struct {

View File

@ -8,7 +8,7 @@ import (
"os" "os"
"github.com/astaxie/beego" "github.com/astaxie/beego"
"github.com/lifei6671/mindoc/conf" "github.com/mindoc-org/mindoc/conf"
) )
//检查最新版本. //检查最新版本.

View File

@ -6,13 +6,14 @@ import (
"strings" "strings"
"time" "time"
"html/template"
"github.com/astaxie/beego" "github.com/astaxie/beego"
"github.com/lifei6671/gocaptcha" "github.com/lifei6671/gocaptcha"
"github.com/lifei6671/mindoc/conf" "github.com/mindoc-org/mindoc/conf"
"github.com/lifei6671/mindoc/mail" "github.com/mindoc-org/mindoc/mail"
"github.com/lifei6671/mindoc/models" "github.com/mindoc-org/mindoc/models"
"github.com/lifei6671/mindoc/utils" "github.com/mindoc-org/mindoc/utils"
"html/template"
) )
// AccountController 用户登录与注册 // AccountController 用户登录与注册

View File

@ -8,13 +8,14 @@ import (
"strings" "strings"
"time" "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" "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 { type BaseController struct {

View File

@ -1,22 +1,23 @@
package controllers package controllers
import ( 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" "encoding/json"
"github.com/lifei6671/mindoc/utils" "fmt"
"html/template"
"net/http"
"net/url" "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 { type BlogController struct {

View File

@ -4,7 +4,6 @@ import (
"encoding/json" "encoding/json"
"errors" "errors"
"fmt" "fmt"
"github.com/lifei6671/mindoc/utils/sqltil"
"html/template" "html/template"
"os" "os"
"path/filepath" "path/filepath"
@ -13,16 +12,18 @@ import (
"strings" "strings"
"time" "time"
"github.com/mindoc-org/mindoc/utils/sqltil"
"net/http" "net/http"
"github.com/astaxie/beego" "github.com/astaxie/beego"
"github.com/astaxie/beego/logs" "github.com/astaxie/beego/logs"
"github.com/astaxie/beego/orm" "github.com/astaxie/beego/orm"
"github.com/lifei6671/mindoc/conf" "github.com/mindoc-org/mindoc/conf"
"github.com/lifei6671/mindoc/graphics" "github.com/mindoc-org/mindoc/graphics"
"github.com/lifei6671/mindoc/models" "github.com/mindoc-org/mindoc/models"
"github.com/lifei6671/mindoc/utils" "github.com/mindoc-org/mindoc/utils"
"github.com/lifei6671/mindoc/utils/pagination" "github.com/mindoc-org/mindoc/utils/pagination"
"gopkg.in/russross/blackfriday.v2" "gopkg.in/russross/blackfriday.v2"
) )

View File

@ -3,11 +3,11 @@ package controllers
import ( import (
"errors" "errors"
"github.com/astaxie/beego"
"github.com/astaxie/beego/logs" "github.com/astaxie/beego/logs"
"github.com/astaxie/beego/orm" "github.com/astaxie/beego/orm"
"github.com/lifei6671/mindoc/conf" "github.com/mindoc-org/mindoc/conf"
"github.com/lifei6671/mindoc/models" "github.com/mindoc-org/mindoc/models"
"github.com/astaxie/beego"
) )
type BookMemberController struct { type BookMemberController struct {

View File

@ -3,19 +3,6 @@ package controllers
import ( import (
"encoding/json" "encoding/json"
"fmt" "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" "html/template"
"image/png" "image/png"
"net/http" "net/http"
@ -26,6 +13,20 @@ import (
"strconv" "strconv"
"strings" "strings"
"time" "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 // DocumentController struct

View File

@ -2,11 +2,12 @@ package controllers
import ( import (
"math" "math"
"github.com/astaxie/beego"
"github.com/lifei6671/mindoc/models"
"github.com/lifei6671/mindoc/utils/pagination"
"github.com/lifei6671/mindoc/conf"
"net/url" "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 { type HomeController struct {

View File

@ -1,11 +1,11 @@
package controllers package controllers
import ( 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"
"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 { type ItemsetsController struct {

View File

@ -5,9 +5,9 @@ import (
"github.com/astaxie/beego" "github.com/astaxie/beego"
"github.com/astaxie/beego/orm" "github.com/astaxie/beego/orm"
"github.com/lifei6671/mindoc/conf" "github.com/mindoc-org/mindoc/conf"
"github.com/lifei6671/mindoc/models" "github.com/mindoc-org/mindoc/models"
"github.com/lifei6671/mindoc/utils/pagination" "github.com/mindoc-org/mindoc/utils/pagination"
) )
type LabelController struct { type LabelController struct {

View File

@ -10,17 +10,18 @@ import (
"path/filepath" "path/filepath"
"strconv" "strconv"
"io/ioutil"
"os"
"github.com/astaxie/beego" "github.com/astaxie/beego"
"github.com/astaxie/beego/logs" "github.com/astaxie/beego/logs"
"github.com/astaxie/beego/orm" "github.com/astaxie/beego/orm"
"github.com/lifei6671/mindoc/conf" "github.com/mindoc-org/mindoc/conf"
"github.com/lifei6671/mindoc/models" "github.com/mindoc-org/mindoc/models"
"github.com/lifei6671/mindoc/utils" "github.com/mindoc-org/mindoc/utils"
"github.com/lifei6671/mindoc/utils/filetil" "github.com/mindoc-org/mindoc/utils/filetil"
"github.com/lifei6671/mindoc/utils/pagination" "github.com/mindoc-org/mindoc/utils/pagination"
"gopkg.in/russross/blackfriday.v2" "gopkg.in/russross/blackfriday.v2"
"io/ioutil"
"os"
) )
type ManagerController struct { type ManagerController struct {

View File

@ -1,14 +1,15 @@
package controllers package controllers
import ( 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" "strconv"
"strings" "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 { type SearchController struct {

View File

@ -9,10 +9,10 @@ import (
"time" "time"
"github.com/astaxie/beego/logs" "github.com/astaxie/beego/logs"
"github.com/lifei6671/mindoc/conf" "github.com/mindoc-org/mindoc/conf"
"github.com/lifei6671/mindoc/graphics" "github.com/mindoc-org/mindoc/graphics"
"github.com/lifei6671/mindoc/models" "github.com/mindoc-org/mindoc/models"
"github.com/lifei6671/mindoc/utils" "github.com/mindoc-org/mindoc/utils"
) )
type SettingController struct { type SettingController struct {
@ -34,7 +34,7 @@ func (c *SettingController) Index() {
member.Email = email member.Email = email
member.Phone = phone member.Phone = phone
member.Description = description 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 { if err := member.Update(); err != nil {
c.JsonResult(602, err.Error()) c.JsonResult(602, err.Error())
} }

View File

@ -1,11 +1,12 @@
package controllers package controllers
import ( import (
"github.com/lifei6671/mindoc/models"
"github.com/astaxie/beego/orm"
"errors" "errors"
"strings" "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 { type TemplateController struct {

View File

@ -10,15 +10,16 @@ import (
"path/filepath" "path/filepath"
"strings" "strings"
"time"
"os/exec"
"errors" "errors"
"os/exec"
"time"
"github.com/lifei6671/mindoc/utils/filetil"
"github.com/lifei6671/mindoc/utils/ziptil"
"github.com/lifei6671/mindoc/utils/cryptil"
"sync"
"html" "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 { type Converter struct {

2
go.mod
View File

@ -1,4 +1,4 @@
module github.com/lifei6671/mindoc module github.com/mindoc-org/mindoc
go 1.12 go 1.12

View File

@ -9,10 +9,10 @@ import (
_ "github.com/astaxie/beego/session/mysql" _ "github.com/astaxie/beego/session/mysql"
_ "github.com/astaxie/beego/session/redis" _ "github.com/astaxie/beego/session/redis"
"github.com/kardianos/service" "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/mattn/go-sqlite3"
"github.com/mindoc-org/mindoc/commands"
"github.com/mindoc-org/mindoc/commands/daemon"
_ "github.com/mindoc-org/mindoc/routers"
) )
func main() { func main() {

View File

@ -10,8 +10,8 @@ import (
"github.com/astaxie/beego" "github.com/astaxie/beego"
"github.com/astaxie/beego/orm" "github.com/astaxie/beego/orm"
"github.com/lifei6671/mindoc/conf" "github.com/mindoc-org/mindoc/conf"
"github.com/lifei6671/mindoc/utils/filetil" "github.com/mindoc-org/mindoc/utils/filetil"
) )
// Attachment struct . // Attachment struct .
@ -82,11 +82,12 @@ func (m *Attachment) Find(id int) (*Attachment, error) {
return m, err return m, err
} }
//查询指定文档的附件列表 //查询指定文档的附件列表
func (m *Attachment) FindListByDocumentId(docId int) (attaches []*Attachment, err error) { func (m *Attachment) FindListByDocumentId(docId int) (attaches []*Attachment, err error) {
o := orm.NewOrm() 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 return
} }
@ -109,7 +110,7 @@ func (m *Attachment) FindToPager(pageIndex, pageSize int) (attachList []*Attachm
if err != nil { if err != nil {
if err == orm.ErrNoRows { if err == orm.ErrNoRows {
beego.Info("没有查到附件 ->",err) beego.Info("没有查到附件 ->", err)
err = nil err = nil
} }
return return
@ -122,12 +123,12 @@ func (m *Attachment) FindToPager(pageIndex, pageSize int) (attachList []*Attachm
//当项目ID为0标识是文章的附件 //当项目ID为0标识是文章的附件
if item.BookId == 0 && item.DocumentId > 0 { if item.BookId == 0 && item.DocumentId > 0 {
blog := NewBlog() 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 attach.BookName = blog.BlogTitle
}else{ } else {
attach.BookName = "[文章不存在]" attach.BookName = "[文章不存在]"
} }
}else { } else {
book := NewBook() book := NewBook()
if e := o.QueryTable(book.TableNameWithPrefix()).Filter("book_id", item.BookId).One(book, "book_name"); e == nil { if e := o.QueryTable(book.TableNameWithPrefix()).Filter("book_id", item.BookId).One(book, "book_name"); e == nil {

View File

@ -4,7 +4,7 @@ import (
"strings" "strings"
"github.com/astaxie/beego/orm" "github.com/astaxie/beego/orm"
"github.com/lifei6671/mindoc/utils/filetil" "github.com/mindoc-org/mindoc/utils/filetil"
) )
type AttachmentResult struct { type AttachmentResult struct {
@ -36,9 +36,9 @@ func (m *AttachmentResult) Find(id int) (*AttachmentResult, error) {
if attach.BookId == 0 && attach.DocumentId > 0 { if attach.BookId == 0 && attach.DocumentId > 0 {
blog := NewBlog() 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 m.BookName = blog.BlogTitle
}else{ } else {
m.BookName = "[文章不存在]" m.BookName = "[文章不存在]"
} }
} else { } else {

View File

@ -3,14 +3,15 @@ package models
import ( import (
"bytes" "bytes"
"fmt" "fmt"
"strings"
"time"
"github.com/PuerkitoBio/goquery" "github.com/PuerkitoBio/goquery"
"github.com/astaxie/beego" "github.com/astaxie/beego"
"github.com/astaxie/beego/orm" "github.com/astaxie/beego/orm"
"github.com/lifei6671/mindoc/cache" "github.com/mindoc-org/mindoc/cache"
"github.com/lifei6671/mindoc/conf" "github.com/mindoc-org/mindoc/conf"
"github.com/lifei6671/mindoc/utils" "github.com/mindoc-org/mindoc/utils"
"strings"
"time"
) )
//博文表 //博文表

View File

@ -15,15 +15,16 @@ import (
"time" "time"
"encoding/json" "encoding/json"
"github.com/astaxie/beego" "github.com/astaxie/beego"
"github.com/astaxie/beego/logs" "github.com/astaxie/beego/logs"
"github.com/astaxie/beego/orm" "github.com/astaxie/beego/orm"
"github.com/lifei6671/mindoc/conf" "github.com/mindoc-org/mindoc/conf"
"github.com/lifei6671/mindoc/utils" "github.com/mindoc-org/mindoc/utils"
"github.com/lifei6671/mindoc/utils/cryptil" "github.com/mindoc-org/mindoc/utils/cryptil"
"github.com/lifei6671/mindoc/utils/filetil" "github.com/mindoc-org/mindoc/utils/filetil"
"github.com/lifei6671/mindoc/utils/requests" "github.com/mindoc-org/mindoc/utils/requests"
"github.com/lifei6671/mindoc/utils/ziptil" "github.com/mindoc-org/mindoc/utils/ziptil"
"gopkg.in/russross/blackfriday.v2" "gopkg.in/russross/blackfriday.v2"
) )

View File

@ -9,21 +9,22 @@ import (
"strings" "strings"
"time" "time"
"encoding/json"
"net/http"
"regexp"
"github.com/PuerkitoBio/goquery" "github.com/PuerkitoBio/goquery"
"github.com/astaxie/beego" "github.com/astaxie/beego"
"github.com/astaxie/beego/logs" "github.com/astaxie/beego/logs"
"github.com/astaxie/beego/orm" "github.com/astaxie/beego/orm"
"github.com/lifei6671/mindoc/conf" "github.com/mindoc-org/mindoc/conf"
"github.com/lifei6671/mindoc/converter" "github.com/mindoc-org/mindoc/converter"
"github.com/lifei6671/mindoc/utils/filetil" "github.com/mindoc-org/mindoc/utils/cryptil"
"github.com/lifei6671/mindoc/utils/ziptil" "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" "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 ( var (

View File

@ -3,9 +3,9 @@ package models
import ( import (
"time" "time"
"github.com/astaxie/beego/orm"
"github.com/lifei6671/mindoc/conf"
"github.com/astaxie/beego" "github.com/astaxie/beego"
"github.com/astaxie/beego/orm"
"github.com/mindoc-org/mindoc/conf"
) )
type DocumentHistory struct { type DocumentHistory struct {

View File

@ -7,15 +7,16 @@ import (
"strconv" "strconv"
"bytes" "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" "os"
"path/filepath" "path/filepath"
"strings" "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. // Document struct.

View File

@ -3,10 +3,11 @@ package models
import ( import (
"bytes" "bytes"
"fmt" "fmt"
"github.com/astaxie/beego/orm"
"github.com/lifei6671/mindoc/conf"
"html/template" "html/template"
"math" "math"
"github.com/astaxie/beego/orm"
"github.com/mindoc-org/mindoc/conf"
) )
type DocumentTree struct { type DocumentTree struct {

View File

@ -1,14 +1,15 @@
package models package models
import ( import (
"time"
"github.com/lifei6671/mindoc/conf"
"github.com/astaxie/beego/orm"
"github.com/astaxie/beego"
"errors" "errors"
"github.com/lifei6671/mindoc/utils/cryptil"
"github.com/lifei6671/mindoc/utils"
"strings" "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"
) )
//项目空间 //项目空间

View File

@ -1,10 +1,11 @@
package models package models
import ( import (
"github.com/astaxie/beego/orm"
"github.com/lifei6671/mindoc/conf"
"strings" "strings"
"github.com/astaxie/beego" "github.com/astaxie/beego"
"github.com/astaxie/beego/orm"
"github.com/mindoc-org/mindoc/conf"
) )
type Label struct { type Label struct {

View File

@ -2,10 +2,11 @@ package models
import ( import (
"errors" "errors"
"github.com/astaxie/beego/orm"
"github.com/lifei6671/mindoc/conf"
"sync/atomic" "sync/atomic"
"time" "time"
"github.com/astaxie/beego/orm"
"github.com/mindoc-org/mindoc/conf"
) )
var loggerQueue = &logQueue{channel: make(chan *Logger, 100), isRuning: 0} var loggerQueue = &logQueue{channel: make(chan *Logger, 100), isRuning: 0}

View File

@ -17,12 +17,13 @@ import (
"gopkg.in/ldap.v2" "gopkg.in/ldap.v2"
"math"
"github.com/astaxie/beego" "github.com/astaxie/beego"
"github.com/astaxie/beego/logs" "github.com/astaxie/beego/logs"
"github.com/astaxie/beego/orm" "github.com/astaxie/beego/orm"
"github.com/lifei6671/mindoc/conf" "github.com/mindoc-org/mindoc/conf"
"github.com/lifei6671/mindoc/utils" "github.com/mindoc-org/mindoc/utils"
"math"
) )
type Member struct { type Member struct {

View File

@ -1,9 +1,10 @@
package models package models
import ( import (
"github.com/astaxie/beego/orm"
"github.com/lifei6671/mindoc/conf"
"time" "time"
"github.com/astaxie/beego/orm"
"github.com/mindoc-org/mindoc/conf"
) )
type MemberRelationshipResult struct { type MemberRelationshipResult struct {

View File

@ -1,9 +1,10 @@
package models package models
import ( import (
"github.com/astaxie/beego/orm"
"github.com/lifei6671/mindoc/conf"
"time" "time"
"github.com/astaxie/beego/orm"
"github.com/mindoc-org/mindoc/conf"
) )
type MemberToken struct { type MemberToken struct {

View File

@ -1,9 +1,10 @@
package models package models
import ( import (
"github.com/astaxie/beego/orm"
"github.com/lifei6671/mindoc/conf"
"time" "time"
"github.com/astaxie/beego/orm"
"github.com/mindoc-org/mindoc/conf"
) )
type Migration struct { type Migration struct {

View File

@ -2,7 +2,7 @@ package models
import ( import (
"github.com/astaxie/beego/orm" "github.com/astaxie/beego/orm"
"github.com/lifei6671/mindoc/conf" "github.com/mindoc-org/mindoc/conf"
) )
// Option struct . // Option struct .

View File

@ -2,9 +2,10 @@ package models
import ( import (
"errors" "errors"
"github.com/astaxie/beego/logs" "github.com/astaxie/beego/logs"
"github.com/astaxie/beego/orm" "github.com/astaxie/beego/orm"
"github.com/lifei6671/mindoc/conf" "github.com/mindoc-org/mindoc/conf"
) )
type Relationship struct { type Relationship struct {

View File

@ -1,11 +1,12 @@
package models package models
import ( import (
"time"
"github.com/lifei6671/mindoc/conf"
"github.com/astaxie/beego/orm"
"errors" "errors"
"time"
"github.com/astaxie/beego" "github.com/astaxie/beego"
"github.com/astaxie/beego/orm"
"github.com/mindoc-org/mindoc/conf"
) )
//团队. //团队.

View File

@ -1,10 +1,11 @@
package models package models
import ( import (
"github.com/lifei6671/mindoc/conf"
"errors" "errors"
"github.com/astaxie/beego/orm"
"github.com/astaxie/beego" "github.com/astaxie/beego"
"github.com/astaxie/beego/orm"
"github.com/mindoc-org/mindoc/conf"
) )
type TeamMember struct { type TeamMember struct {

View File

@ -1,11 +1,12 @@
package models package models
import ( import (
"github.com/lifei6671/mindoc/conf"
"time"
"github.com/astaxie/beego/orm"
"github.com/astaxie/beego"
"errors" "errors"
"time"
"github.com/astaxie/beego"
"github.com/astaxie/beego/orm"
"github.com/mindoc-org/mindoc/conf"
) )
type TeamRelationship struct { type TeamRelationship struct {

View File

@ -1,12 +1,13 @@
package models package models
import ( import (
"time"
"github.com/lifei6671/mindoc/conf"
"github.com/astaxie/beego/orm"
"github.com/astaxie/beego/logs"
"github.com/astaxie/beego"
"errors" "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 { type Template struct {

View File

@ -2,9 +2,10 @@ package models
import ( import (
"errors" "errors"
"github.com/astaxie/beego/orm"
"github.com/lifei6671/mindoc/conf"
"time" "time"
"github.com/astaxie/beego/orm"
"github.com/mindoc-org/mindoc/conf"
) )
//Comment struct //Comment struct

View File

@ -1,9 +1,10 @@
package models package models
import ( import (
"github.com/astaxie/beego/orm"
"github.com/lifei6671/mindoc/conf"
"time" "time"
"github.com/astaxie/beego/orm"
"github.com/mindoc-org/mindoc/conf"
) )
type CommentVote struct { type CommentVote struct {

View File

@ -2,12 +2,13 @@ package routers
import ( import (
"encoding/json" "encoding/json"
"github.com/astaxie/beego"
"github.com/astaxie/beego/context"
"github.com/lifei6671/mindoc/conf"
"github.com/lifei6671/mindoc/models"
"net/url" "net/url"
"regexp" "regexp"
"github.com/astaxie/beego"
"github.com/astaxie/beego/context"
"github.com/mindoc-org/mindoc/conf"
"github.com/mindoc-org/mindoc/models"
) )
func init() { func init() {

View File

@ -2,7 +2,7 @@ package routers
import ( import (
"github.com/astaxie/beego" "github.com/astaxie/beego"
"github.com/lifei6671/mindoc/controllers" "github.com/mindoc-org/mindoc/controllers"
) )
func init() { func init() {
@ -35,8 +35,8 @@ func init() {
beego.Router("/manager/attach/list", &controllers.ManagerController{}, "*:AttachList") beego.Router("/manager/attach/list", &controllers.ManagerController{}, "*:AttachList")
beego.Router("/manager/attach/detailed/:id", &controllers.ManagerController{}, "*:AttachDetailed") beego.Router("/manager/attach/detailed/:id", &controllers.ManagerController{}, "*:AttachDetailed")
beego.Router("/manager/attach/delete", &controllers.ManagerController{}, "post:AttachDelete") beego.Router("/manager/attach/delete", &controllers.ManagerController{}, "post:AttachDelete")
beego.Router("/manager/label/list", &controllers.ManagerController{},"get:LabelList") beego.Router("/manager/label/list", &controllers.ManagerController{}, "get:LabelList")
beego.Router("/manager/label/delete/:id", &controllers.ManagerController{},"post:LabelDelete") beego.Router("/manager/label/delete/:id", &controllers.ManagerController{}, "post:LabelDelete")
//beego.Router("/manager/config", &controllers.ManagerController{}, "*:Config") //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/change_role", &controllers.ManagerController{}, "POST:TeamChangeMemberRole")
beego.Router("/manager/team/member/search", &controllers.ManagerController{}, "*:TeamSearchMember") beego.Router("/manager/team/member/search", &controllers.ManagerController{}, "*:TeamSearchMember")
beego.Router("/manager/team/book/list/:id", &controllers.ManagerController{}, "*:TeamBookList") 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/add", &controllers.ManagerController{}, "POST:TeamBookAdd")
beego.Router("/manager/team/book/delete", &controllers.ManagerController{}, "POST:TeamBookDelete") beego.Router("/manager/team/book/delete", &controllers.ManagerController{}, "POST:TeamBookDelete")
beego.Router("/manager/team/book/search", &controllers.ManagerController{}, "*:TeamSearchBook") beego.Router("/manager/team/book/search", &controllers.ManagerController{}, "*:TeamSearchBook")
beego.Router("/manager/itemsets", &controllers.ManagerController{},"*:Itemsets") beego.Router("/manager/itemsets", &controllers.ManagerController{}, "*:Itemsets")
beego.Router("/manager/itemsets/edit", &controllers.ManagerController{},"post:ItemsetsEdit") beego.Router("/manager/itemsets/edit", &controllers.ManagerController{}, "post:ItemsetsEdit")
beego.Router("/manager/itemsets/delete", &controllers.ManagerController{},"post:ItemsetsDelete") beego.Router("/manager/itemsets/delete", &controllers.ManagerController{}, "post:ItemsetsDelete")
beego.Router("/setting", &controllers.SettingController{}, "*:Index") beego.Router("/setting", &controllers.SettingController{}, "*:Index")
beego.Router("/setting/password", &controllers.SettingController{}, "*:Password") 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/sort", &controllers.BookController{}, "post:SaveSort")
beego.Router("/book/:key/teams", &controllers.BookController{}, "*:Team") beego.Router("/book/:key/teams", &controllers.BookController{}, "*:Team")
beego.Router("/book/create", &controllers.BookController{}, "*:Create") beego.Router("/book/create", &controllers.BookController{}, "*:Create")
beego.Router("/book/itemsets/search", &controllers.BookController{}, "*:ItemsetsSearch") beego.Router("/book/itemsets/search", &controllers.BookController{}, "*:ItemsetsSearch")
beego.Router("/book/users/create", &controllers.BookMemberController{}, "post:AddMember") beego.Router("/book/users/create", &controllers.BookMemberController{}, "post:AddMember")
beego.Router("/book/users/change", &controllers.BookMemberController{}, "post:ChangeRole") beego.Router("/book/users/change", &controllers.BookMemberController{}, "post:ChangeRole")
beego.Router("/book/users/delete", &controllers.BookMemberController{}, "post:RemoveMember") beego.Router("/book/users/delete", &controllers.BookMemberController{}, "post:RemoveMember")
beego.Router("/book/users/import", &controllers.BookController{},"post:Import") beego.Router("/book/users/import", &controllers.BookController{}, "post:Import")
beego.Router("/book/users/copy", &controllers.BookController{},"post:Copy") beego.Router("/book/users/copy", &controllers.BookController{}, "post:Copy")
beego.Router("/book/setting/save", &controllers.BookController{}, "post:SaveBook") beego.Router("/book/setting/save", &controllers.BookController{}, "post:SaveBook")
beego.Router("/book/setting/open", &controllers.BookController{}, "post:PrivatelyOwned") 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/delete", &controllers.BookController{}, "POST:TeamDelete")
beego.Router("/book/team/search", &controllers.BookController{}, "*:TeamSearch") 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/setting/?:id", &controllers.BlogController{}, "*:ManageSetting")
beego.Router("/manage/blogs/edit/?:id",&controllers.BlogController{}, "*:ManageEdit") beego.Router("/manage/blogs/edit/?:id", &controllers.BlogController{}, "*:ManageEdit")
beego.Router("/manage/blogs/delete",&controllers.BlogController{}, "post:ManageDelete") beego.Router("/manage/blogs/delete", &controllers.BlogController{}, "post:ManageDelete")
beego.Router("/manage/blogs/upload",&controllers.BlogController{}, "post:Upload") beego.Router("/manage/blogs/upload", &controllers.BlogController{}, "post:Upload")
beego.Router("/manage/blogs/attach/:id",&controllers.BlogController{}, "post:RemoveAttachment") beego.Router("/manage/blogs/attach/:id", &controllers.BlogController{}, "post:RemoveAttachment")
//读文章的路由 //读文章的路由
beego.Router("/blogs", &controllers.BlogController{}, "*:List") beego.Router("/blogs", &controllers.BlogController{}, "*:List")
beego.Router("/blog-attach/:id:int/:attach_id:int", &controllers.BlogController{},"get:Download") 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-:id([0-9]+).html", &controllers.BlogController{}, "*:Index")
//模板相关接口 //模板相关接口
beego.Router("/api/template/get", &controllers.TemplateController{},"get:Get") beego.Router("/api/template/get", &controllers.TemplateController{}, "get:Get")
beego.Router("/api/template/list", &controllers.TemplateController{},"post:List") beego.Router("/api/template/list", &controllers.TemplateController{}, "post:List")
beego.Router("/api/template/add", &controllers.TemplateController{},"post:Add") beego.Router("/api/template/add", &controllers.TemplateController{}, "post:Add")
beego.Router("/api/template/remove", &controllers.TemplateController{},"post:Delete") beego.Router("/api/template/remove", &controllers.TemplateController{}, "post:Delete")
beego.Router("/api/attach/remove/", &controllers.DocumentController{}, "post:RemoveAttachment") beego.Router("/api/attach/remove/", &controllers.DocumentController{}, "post:RemoveAttachment")
beego.Router("/api/:key/edit/?:id", &controllers.DocumentController{}, "*:Edit") 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("/tag/:key", &controllers.LabelController{}, "get:Index")
beego.Router("/tags", &controllers.LabelController{}, "get:List") beego.Router("/tags", &controllers.LabelController{}, "get:List")
beego.Router("/items", &controllers.ItemsetsController{},"get:Index") beego.Router("/items", &controllers.ItemsetsController{}, "get:Index")
beego.Router("/items/:key", &controllers.ItemsetsController{},"get:List") beego.Router("/items/:key", &controllers.ItemsetsController{}, "get:List")
} }

View File

@ -1,11 +1,12 @@
package utils package utils
import ( import (
"bytes"
"regexp" "regexp"
"strings" "strings"
"github.com/PuerkitoBio/goquery" "github.com/PuerkitoBio/goquery"
"bytes" "github.com/mindoc-org/mindoc/conf"
"github.com/lifei6671/mindoc/conf"
) )
func StripTags(s string) string { func StripTags(s string) string {

View File

@ -16,18 +16,18 @@ MinDoc 的前身是 SmartWiki 文档系统。SmartWiki 是基于 PHP 框架 lara
**如果你的服务器上没有安装golang程序请手动设置一个环境变量如下键名为 ZONEINFO值为MinDoc跟目录下的/lib/time/zoneinfo.zip 。** **如果你的服务器上没有安装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开发经验建议通过编译安装。 如果有Golang开发经验建议通过编译安装。
```bash ```bash
git clone https://github.com/lifei6671/mindoc.git git clone https://github.com/mindoc-org/mindoc.git
go get -d ./... go get -d ./...

View File

@ -3,9 +3,9 @@
<div class="row text-center border-top"> <div class="row text-center border-top">
<span><a href="https://www.iminho.me" target="_blank">官方网站</a></span> <span><a href="https://www.iminho.me" target="_blank">官方网站</a></span>
<span>&nbsp;·&nbsp;</span> <span>&nbsp;·&nbsp;</span>
<span><a href="https://github.com/lifei6671/mindoc/issues" target="_blank">意见反馈</a></span> <span><a href="https://github.com/mindoc-org/mindoc/issues" target="_blank">意见反馈</a></span>
<span>&nbsp;·&nbsp;</span> <span>&nbsp;·&nbsp;</span>
<span><a href="https://github.com/lifei6671/mindoc" target="_blank">项目源码</a></span> <span><a href="https://github.com/mindoc-org/mindoc" target="_blank">项目源码</a></span>
<span>&nbsp;·&nbsp;</span> <span>&nbsp;·&nbsp;</span>
<span><a href="https://www.iminho.me/wiki/docs/mindoc/" target="_blank">使用手册</a></span> <span><a href="https://www.iminho.me/wiki/docs/mindoc/" target="_blank">使用手册</a></span>
</div> </div>