1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- package controllers
- import (
- "encoding/json"
- "eta/eta_data_init/models"
- "eta/eta_data_init/services"
- beego "github.com/beego/beego/v2/server/web"
- )
- // DataFixController 数据修复
- type DataFixController struct {
- beego.Controller
- }
- // FixTableV1
- // @Title 数据修复
- // @Description 数据修复
- // @Success Ret=200
- // @router /fix/v1 [get]
- func (this *DataFixController) FixTableV1() {
- br := new(models.BaseResponse).Init()
- defer func() {
- this.Data["json"] = br
- this.ServeJSON()
- }()
- method := "fix/v1"
- classifyFirstMap := make(map[string]interface{})
- result, err := services.PostEdbLib(classifyFirstMap, method)
- if err != nil {
- br.Msg = "修复失败"
- br.ErrMsg = "修复失败,ERR:" + err.Error()
- return
- }
- resp := new(models.BaseResp)
- err = json.Unmarshal(result, &resp)
- if err != nil {
- br.Msg = "修复失败," + resp.Msg
- br.ErrMsg = resp.ErrMsg
- return
- }
- br.Ret = 200
- br.Msg = "保存成功"
- }
|