123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- package controllers
- import (
- "eta/eta_mini_api/models"
- "eta/eta_mini_api/services"
- )
- type ChartPermissionController struct {
- BaseAuthController
- }
- // List
- // @Title 系统品种列表
- // @Description 系统品种列表
- // @Param UserId query int true "角色ID"
- // @Success 200 {object} models.LoginResp
- // @router /list [get]
- func (this *ChartPermissionController) List() {
- br := new(models.BaseResponse).Init()
- defer func() {
- this.Data["json"] = br
- this.ServeJSON()
- }()
- id, _ := this.GetInt("chartPermissonId", 0)
- var resp *services.ChartPermissionResp
- var err error
- if id == 0 {
- resp, err = services.GetChartPermissionList()
- } else if id > 0 {
- resp, err = services.GetChartPermissionSecondList(id)
- }
- if err != nil {
- br.Msg = "权限列表获取失败"
- br.ErrMsg = "权限列表获取失败,系统错误,Err:" + err.Error()
- return
- }
- if resp.Ret != 200 {
- br.Msg = resp.Msg
- br.ErrMsg = resp.ErrMsg
- return
- }
- br.Ret = 200
- br.Data = resp.Data
- br.Msg = "列表获取成功"
- br.Success = true
- }
|