123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- // Package data_manage
- // @Author gmy 2024/8/12 14:32:00
- package data_manage
- import (
- "eta/eta_api/controllers"
- "eta/eta_api/models"
- "eta/eta_api/services/data"
- )
- type BaseFromLyClassifyController struct {
- controllers.BaseAuthController
- }
- // LyClassifyList
- // @Title 包含分类下的指标名称
- // @Description 包含分类下的指标名称
- // @Success 200 {object} []data_manage.BaseFromLyClassifyAndIndexInfo
- // @router /ly/classify/list [get]
- func (this *BaseFromLyClassifyController) LyClassifyList() {
- br := new(models.BaseResponse).Init()
- // 下面段代码能否统一处理???
- defer func() {
- if br.ErrMsg == "" {
- br.IsSendEmail = false
- }
- this.Data["json"] = br
- this.ServeJSON()
- }()
- sysUser := this.SysUser
- if sysUser == nil {
- br.Msg = "请登录"
- br.ErrMsg = "请登录,SysUser Is Empty"
- br.Ret = 408
- return
- }
- // 获取分类列表
- lyClassifyList, err := data.LyClassifyList()
- if err != nil {
- br.Msg = "获取分类列表失败"
- br.ErrMsg = "获取分类列表失败,Err:" + err.Error()
- return
- }
- br.Data = lyClassifyList
- br.Ret = 200
- br.Success = true
- br.Msg = "获取成功"
- }
|