beedoc icon indicating copy to clipboard operation
beedoc copied to clipboard

URLMapping

Open gd-liuzhihua opened this issue 6 years ago • 2 comments

URLMapping 路由没有效果。

package controllers

import ( "github.com/astaxie/beego" )

// AdminController operations for Admin type AdminController struct { beego.Controller }

// URLMapping ... func (c *AdminController) URLMapping() { c.Mapping("Post", c.Post) c.Mapping("GetOne", c.GetOne) c.Mapping("GetAll", c.GetAll) c.Mapping("Put", c.Put) c.Mapping("Delete", c.Delete) }

// Post ... // @Title Create // @Description create Admin // @Param body body models.Admin true "body for Admin content" // @Success 201 {object} models.Admin // @Failure 403 body is empty // @router / [post] func (c *AdminController) Post() {

}

// GetOne ... // @Title GetOne // @Description get Admin by id // @Param id path string true "The key for staticblock" // @Success 200 {object} models.Admin // @Failure 403 :id is empty // @router /:id [get] func (c *AdminController) GetOne() {

}

// GetAll ... // @Title GetAll // @Description get Admin // @Param query query string false "Filter. e.g. col1:v1,col2:v2 ..." // @Param fields query string false "Fields returned. e.g. col1,col2 ..." // @Param sortby query string false "Sorted-by fields. e.g. col1,col2 ..." // @Param order query string false "Order corresponding to each sortby field, if single value, apply to all sortby fields. e.g. desc,asc ..." // @Param limit query string false "Limit the size of result set. Must be an integer" // @Param offset query string false "Start position of result set. Must be an integer" // @Success 200 {object} models.Admin // @Failure 403 // @router / [get] func (c *AdminController) GetAll() {

}

// Put ... // @Title Put // @Description update the Admin // @Param id path string true "The id you want to update" // @Param body body models.Admin true "body for Admin content" // @Success 200 {object} models.Admin // @Failure 403 :id is not int // @router /:id [put] func (c *AdminController) Put() {

}

// Delete ... // @Title Delete // @Description delete the Admin // @Param id path string true "The id you want to delete" // @Success 200 {string} delete success! // @Failure 403 id is empty // @router /:id [delete] func (c *AdminController) Delete() {

}

gd-liuzhihua avatar Dec 21 '17 02:12 gd-liuzhihua

全部提示404,找不到路由

gd-liuzhihua avatar Dec 21 '17 02:12 gd-liuzhihua

URLMapping conflict with // @router /:id [delete]

astaxie avatar Jan 04 '18 09:01 astaxie