12345678910111213141516171819202122232425262728293031323334353637383940 |
- package controller
- import (
- "github.com/gin-gonic/gin"
- "iot_manager_service/app/device/service"
- "iot_manager_service/app/middleware"
- "iot_manager_service/util"
- "net/http"
- "strconv"
- )
- // 一键报警服务表管理对象
- var HandleHistory = new(handleHistoryCtl)
- type handleHistoryCtl struct{}
- func (c *handleHistoryCtl) List(ctx *gin.Context) {
- value, _ := ctx.Get(middleware.Authorization)
- claims := value.(*middleware.Claims)
- handleContent := ctx.Query("handleContent")
- operationType := ctx.Query("operationType")
- moduleType := ctx.Query("moduleType")
- current, _ := strconv.Atoi(ctx.Query("current"))
- size, _ := strconv.Atoi(ctx.Query("size"))
- if current == 0 {
- current = 1
- }
- if size <= 0 || size > 100 {
- size = 10
- }
- list, err := service.OperationHisService.List(claims.TenantId, handleContent, operationType, moduleType, current,
- size)
- if err != nil {
- ctx.JSON(http.StatusOK, err)
- return
- }
- ctx.JSON(http.StatusOK, util.SuccessResponse(util.Succeeded, list))
- }
|