├── static ├── css │ └── style.css ├── bootstrap-3.3.7-dist │ ├── fonts │ │ ├── glyphicons-halflings-regular.eot │ │ ├── glyphicons-halflings-regular.ttf │ │ ├── glyphicons-halflings-regular.woff │ │ └── glyphicons-halflings-regular.woff2 │ ├── js │ │ ├── npm.js │ │ └── bootstrap.min.js │ └── css │ │ ├── bootstrap-theme.min.css │ │ ├── bootstrap-theme.min.css.map │ │ ├── bootstrap-theme.css │ │ └── bootstrap-theme.css.map └── js │ └── reload.min.js ├── shorturl ├── screenshots ├── 1.png └── 2.png ├── main.go ├── README.md ├── conf └── app.conf ├── routers └── router.go ├── views └── index │ ├── jump.tpl │ └── index.tpl ├── models ├── detail.go ├── models.go └── url.go ├── tests └── default_test.go └── controllers └── Index.go /static/css/style.css: -------------------------------------------------------------------------------- 1 | .body { 2 | margin-top:100px; 3 | } -------------------------------------------------------------------------------- /shorturl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tianakong/go-shorturl/HEAD/shorturl -------------------------------------------------------------------------------- /screenshots/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tianakong/go-shorturl/HEAD/screenshots/1.png -------------------------------------------------------------------------------- /screenshots/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tianakong/go-shorturl/HEAD/screenshots/2.png -------------------------------------------------------------------------------- /static/bootstrap-3.3.7-dist/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tianakong/go-shorturl/HEAD/static/bootstrap-3.3.7-dist/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /static/bootstrap-3.3.7-dist/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tianakong/go-shorturl/HEAD/static/bootstrap-3.3.7-dist/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /static/bootstrap-3.3.7-dist/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tianakong/go-shorturl/HEAD/static/bootstrap-3.3.7-dist/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /static/bootstrap-3.3.7-dist/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tianakong/go-shorturl/HEAD/static/bootstrap-3.3.7-dist/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | _ "shorturl/routers" 5 | "github.com/astaxie/beego" 6 | "shorturl/models" 7 | ) 8 | 9 | func main() { 10 | models.Init() 11 | beego.Run() 12 | } 13 | 14 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # beego短网址项目 2 | beego+Bootstrap开发的短网址项目,采用62进制高位算法生成短网址 3 | 4 |  5 | 6 |  7 | -------------------------------------------------------------------------------- /conf/app.conf: -------------------------------------------------------------------------------- 1 | appname = shorturl 2 | httpport = 8080 3 | runmode = dev 4 | sessionon = true 5 | website = http://localhost:8080/ 6 | 7 | 8 | [dev] 9 | db.host = 127.0.0.1 10 | db.user = root 11 | db.password = "root" 12 | db.port = 3306 13 | db.name = go_shorturl 14 | db.prefix = t_ 15 | db.charset = utf8 16 | -------------------------------------------------------------------------------- /static/js/reload.min.js: -------------------------------------------------------------------------------- 1 | function b(a){var c=new WebSocket(a);c.onclose=function(){setTimeout(function(){b(a)},2E3)};c.onmessage=function(){location.reload()}}try{if(window.WebSocket)try{b("ws://localhost:12450/reload")}catch(a){console.error(a)}else console.log("Your browser does not support WebSockets.")}catch(a){console.error("Exception during connecting to Reload:",a)}; 2 | -------------------------------------------------------------------------------- /routers/router.go: -------------------------------------------------------------------------------- 1 | package routers 2 | 3 | import ( 4 | "shorturl/controllers" 5 | "github.com/astaxie/beego" 6 | ) 7 | 8 | func init() { 9 | beego.Router("/", &controllers.IndexController{}, "*:Index") 10 | beego.Router("/qrcode", &controllers.IndexController{}, "*:Qrcodeimg") 11 | beego.Router("/?:url", &controllers.IndexController{}, "*:Jump") 12 | 13 | } 14 | -------------------------------------------------------------------------------- /views/index/jump.tpl: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | 6 | 7 |