mirror of
https://github.com/beego/bee.git
synced 2025-07-05 18:20:18 +00:00
fix issue with new version
This commit is contained in:
@ -192,7 +192,7 @@ func (c *{{controllerName}}Controller) Post() {
|
||||
// @Failure 403 :id is empty
|
||||
// @router /:id [get]
|
||||
func (c *{{controllerName}}Controller) GetOne() {
|
||||
idStr := c.Ctx.Input.Params[":id"]
|
||||
idStr := c.Ctx.Input.Param(":id")
|
||||
id, _ := strconv.ParseInt(idStr, 0, 64)
|
||||
v, err := models.Get{{controllerName}}ById(id)
|
||||
if err != nil {
|
||||
@ -273,7 +273,7 @@ func (c *{{controllerName}}Controller) GetAll() {
|
||||
// @Failure 403 :id is not int
|
||||
// @router /:id [put]
|
||||
func (c *{{controllerName}}Controller) Put() {
|
||||
idStr := c.Ctx.Input.Params[":id"]
|
||||
idStr := c.Ctx.Input.Param(":id")
|
||||
id, _ := strconv.ParseInt(idStr, 0, 64)
|
||||
v := models.{{controllerName}}{Id: id}
|
||||
json.Unmarshal(c.Ctx.Input.RequestBody, &v)
|
||||
@ -292,7 +292,7 @@ func (c *{{controllerName}}Controller) Put() {
|
||||
// @Failure 403 id is empty
|
||||
// @router /:id [delete]
|
||||
func (c *{{controllerName}}Controller) Delete() {
|
||||
idStr := c.Ctx.Input.Params[":id"]
|
||||
idStr := c.Ctx.Input.Param(":id")
|
||||
id, _ := strconv.ParseInt(idStr, 0, 64)
|
||||
if err := models.Delete{{controllerName}}(id); err == nil {
|
||||
c.Data["json"] = "OK"
|
||||
|
Reference in New Issue
Block a user