123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- package controllers
- import (
- "rtzh_elec_temperature/rtelec_app_public_lib/service"
- )
- //区域管理相关服务
- type RegionController struct {
- BaseController
- }
- // 获取当前变电站信息
- // @Summary 获取当前变电站信息
- // @Description 获取当前变电站信息。
- // @Tags api
- // @Accept x-www-form-urlencoded
- // @Produce json
- // @Success 200 {object} ApiOK|ApiError 服务访问成功
- // @Failure 401 status 认证未通过,一般是未指定token或token已失效
- // @Failure 500 status 服务器|后台发生错误
- // @router /station [get]
- func (c *RegionController) GetStationInfo() {
- logObject := new(service.RegionService)
- logObject.UserInfo = c.GetCurrentUserInfo_rt()
- List, err := logObject.GetStationInfo()
- if err != nil {
- c.Data["json"] = c.ApiError(err.Error())
- } else {
- c.Data["json"] = c.ApiOK(List)
- }
- c.ServeJSON()
- }
- // 区域列表 godoc
- // @Summary 查询区域记录列表
- // @Description 查询区域记录列表
- // @Tags api
- // @Accept x-www-form-urlencoded
- // @Produce json
- // @Success 200 {object} ApiOK
- // @Failure 500 {object} ApiError
- // @router /list [get]
- func (c *RegionController) List() {
- param := map[string]interface{}{}
- logObject := new(service.RegionService)
- logObject.UserInfo = c.GetCurrentUserInfo_rt()
- List, err := logObject.List(param)
- if err != nil {
- c.Data["json"] = c.ApiError(err.Error())
- } else {
- c.Data["json"] = c.ApiOK(List)
- }
- c.ServeJSON()
- }
|