Skip to content

Commit

Permalink
搭建框架
Browse files Browse the repository at this point in the history
  • Loading branch information
lifei6671 committed Apr 20, 2017
1 parent 4ebc28a commit d58087f
Show file tree
Hide file tree
Showing 70 changed files with 33,934 additions and 28,325 deletions.
42 changes: 42 additions & 0 deletions controllers/book.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
package controllers

type BookController struct {
BaseController
}

func (p *BookController) Index() {
p.TplName = "book/index.tpl"
}

// Dashboard 项目概要 .
func (p *BookController) Dashboard() {
p.TplName = "book/dashboard.tpl"
}

// Setting 项目设置 .
func (p *BookController) Setting() {
p.TplName = "book/setting.tpl"
}

func (p *BookController) Users() {
p.TplName = "book/users.tpl"
}

func (p *BookController) Create() {
p.TplName = "book/create.tpl"
}

// Edit 编辑项目.
func (p *BookController) Edit() {
p.TplName = "book/edit.tpl"
}

// Delete 删除项目.
func (p *BookController) Delete() {
p.StopRun()
}

// Transfer 转让项目.
func (p *BookController)Transfer() {

}
19 changes: 19 additions & 0 deletions controllers/book_member.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package controllers

type BookMemberController struct {
BaseController
}

func (p *BookMemberController) Create() {
p.TplName = "book/member_create.tpl"
}

func (p *BookMemberController) Change() {

p.StopRun()
}

func (p *BookMemberController) Delete() {

p.StopRun()
}
13 changes: 13 additions & 0 deletions controllers/document.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package controllers

type DocumentController struct {
BaseController
}

func (p *DocumentController) Index() {
p.TplName = "document/index.tpl"
}

func (p *DocumentController) Read() {
p.TplName = "document/kancloud.tpl"
}
13 changes: 13 additions & 0 deletions controllers/setting.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package controllers

type SettingController struct {
BaseController
}

func (p *SettingController) Index() {
p.TplName = "setting/index.tpl"
}

func (p *SettingController) Password() {
p.TplName = "setting/password.tpl"
}
1 change: 1 addition & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Created by .ignore support plugin (hsz.mobi)
1 change: 1 addition & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ import (
)

func main() {
beego.SetStaticPath("uploads","uploads")
beego.Run()
}
6 changes: 6 additions & 0 deletions models/member.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// Package models .
package models

type Member struct {

}
17 changes: 17 additions & 0 deletions routers/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,21 @@ func init() {
beego.Router("/",&controllers.HomeController{},"*:Index")

beego.Router("/manager", &controllers.ManagerController{},"*:Index")

beego.Router("/setting", &controllers.SettingController{},"*:Index")
beego.Router("/setting/password", &controllers.SettingController{},"*:Password")

beego.Router("/book", &controllers.BookController{},"*:Index")
beego.Router("/book/:key/dashboard", &controllers.BookController{},"*:Dashboard")
beego.Router("/book/:key/setting", &controllers.BookController{},"*:Setting")
beego.Router("/book/:key/users", &controllers.BookController{},"*:Users")
beego.Router("/book/:key/edit/:id", &controllers.BookController{},"*:Edit")
beego.Router("/book/create", &controllers.BookController{},"*:Create")

beego.Router("/book/:key/users/create", &controllers.BookMemberController{},"*:Create")
beego.Router("/book/:key/users/change", &controllers.BookMemberController{},"*:Change")
beego.Router("/book/:key/users/delete", &controllers.BookMemberController{},"*:Delete")

beego.Router("/docs/:key", &controllers.DocumentController{},"*:Index")
beego.Router("/docs/:key/:id", &controllers.DocumentController{},"*:Read")
}
Loading

0 comments on commit d58087f

Please sign in to comment.