package controller import ( "github.com/gin-gonic/gin" "iot_manager_service/app/service" "iot_manager_service/app/utils" "net/http" "strconv" ) // 一键报警服务表管理对象 var HandleHistory = new(handleHistoryCtl) type handleHistoryCtl struct{} func (c *handleHistoryCtl) List(ctx *gin.Context) { 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(handleContent, operationType, moduleType, current, size) if err != nil { ctx.JSON(http.StatusOK, err) return } ctx.JSON(http.StatusOK, utils.SuccessResponse(utils.Succeeded, list)) }