1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- package controller
- import (
- "github.com/gin-gonic/gin"
- "iot_manager_service/app/model"
- "iot_manager_service/app/service"
- "iot_manager_service/app/utils"
- "net/http"
- "strconv"
- )
- // 灯杆基本信息管理对象
- var LampPole = new(lampPoleCtl)
- type lampPoleCtl struct{}
- func (c *lampPoleCtl) Detail(ctx *gin.Context) {
- id, e := strconv.Atoi(ctx.Query("id"))
- if e != nil {
- ctx.JSON(http.StatusOK, utils.ParamsInvalidResponse(e.Error(), nil))
- return
- }
- device, err := service.LampPoleService.Get(id)
- if err != nil {
- ctx.JSON(http.StatusOK, err)
- return
- }
- ctx.JSON(http.StatusOK, utils.SuccessResponse(utils.Succeeded, device))
- }
- func (c *lampPoleCtl) CreateOrUpdate(ctx *gin.Context) {
- var req *model.ReqLampPoleSubmit
- if err := ctx.ShouldBindJSON(&req); err != nil {
- ctx.JSON(http.StatusOK, utils.ParamsInvalidResponse(err.Error(), nil))
- return
- }
- err := service.LampPoleService.CreateOrUpdate(req)
- ctx.JSON(http.StatusOK, err)
- }
- func (c *lampPoleCtl) List(ctx *gin.Context) {
- }
- func (c *lampPoleCtl) GetRelevanceDetail(ctx *gin.Context) {
- }
- func (c *lampPoleCtl) Remove(ctx *gin.Context) {
- }
- func (c *lampPoleCtl) ImportExcel(ctx *gin.Context) {
- }
- func (c *lampPoleCtl) ExportExcel(ctx *gin.Context) {
- }
- func (c *lampPoleCtl) ExportTemplate(ctx *gin.Context) {
- }
- func (c *lampPoleCtl) GetList(ctx *gin.Context) {
- }
|