Browse Source

字典详情命名修改

master
hupeng 4 years ago
parent
commit
5bed9161cd
  1. 10
      controllers/admin/DictDetailController.go

10
controllers/admin/DictDetailController.go

@ -28,8 +28,8 @@ func (c *DictDetailController) URLMapping() {
func (c *DictDetailController) GetAll() { func (c *DictDetailController) GetAll() {
dictId, _ := c.GetInt64("dictId") dictId, _ := c.GetInt64("dictId")
dictName := c.GetString("dictName") dictName := c.GetString("dictName")
total,list := models.GetAllDictDetail(c.GetParams(),dictId,dictName) total, list := models.GetAllDictDetail(c.GetParams(), dictId, dictName)
c.Data["json"] = controllers.SuccessData(vo.ResultList{Content: list,TotalElements: total}) c.Data["json"] = controllers.SuccessData(vo.ResultList{Content: list, TotalElements: total})
c.ServeJSON() c.ServeJSON()
} }
@ -37,7 +37,7 @@ func (c *DictDetailController) GetAll() {
// @Description 添加字典详情 // @Description 添加字典详情
// @Success 200 {object} controllers.Result // @Success 200 {object} controllers.Result
// @router / [post] // @router / [post]
func (c *DictDetailController) Post() { func (c *DictDetailController) Post() {
var model models.SysDictDetail var model models.SysDictDetail
valid := validation.Validation{} valid := validation.Validation{}
json.Unmarshal(c.Ctx.Input.RequestBody, &model) json.Unmarshal(c.Ctx.Input.RequestBody, &model)
@ -60,7 +60,7 @@ func (c *DictDetailController) Post() {
// @Description 修改字典详情 // @Description 修改字典详情
// @Success 200 {object} controllers.Result // @Success 200 {object} controllers.Result
// @router / [put] // @router / [put]
func (c *DictDetailController) Put() { func (c *DictDetailController) Put() {
var model models.SysDictDetail var model models.SysDictDetail
valid := validation.Validation{} valid := validation.Validation{}
json.Unmarshal(c.Ctx.Input.RequestBody, &model) json.Unmarshal(c.Ctx.Input.RequestBody, &model)
@ -83,7 +83,7 @@ func (c *DictDetailController) Put() {
// @Success 200 {object} controllers.Result // @Success 200 {object} controllers.Result
// @router /:id [delete] // @router /:id [delete]
func (c *DictDetailController) Delete() { func (c *DictDetailController) Delete() {
id, _ := c.GetInt64(":id",1) id, _ := c.GetInt64(":id", 1)
e := models.DelByDictDetail(id) e := models.DelByDictDetail(id)
if e != nil { if e != nil {
c.Data["json"] = controllers.ErrMsg(e.Error()) c.Data["json"] = controllers.ErrMsg(e.Error())

Loading…
Cancel
Save