Files
Message-Push-Nest/routers/api/v1/send_tasks_logs.go
T

43 lines
953 B
Go
Raw Normal View History

2023-12-30 17:40:20 +08:00
package v1
import (
"github.com/gin-gonic/gin"
"message-nest/pkg/app"
"message-nest/pkg/util"
"message-nest/service/send_logs_service"
"net/http"
)
// GetMsgSendWayList 获取消息渠道列表
func GetTaskSendLogsList(c *gin.Context) {
appG := app.Gin{C: c}
name := c.Query("name")
taskId := c.Query("taskid")
2024-01-25 15:08:00 +08:00
query := c.Query("query")
2023-12-30 17:40:20 +08:00
offset, limit := util.GetPageSize(c)
logsService := send_logs_service.SendTaskLogsService{
TaskId: taskId,
Name: name,
PageNum: offset,
PageSize: limit,
2024-01-25 15:08:00 +08:00
Query: query,
2023-12-30 17:40:20 +08:00
}
ways, err := logsService.GetAll()
if err != nil {
appG.CResponse(http.StatusInternalServerError, "获取日志失败!", nil)
return
}
count, err := logsService.Count()
if err != nil {
appG.CResponse(http.StatusInternalServerError, "获取日志总数失败!", nil)
return
}
appG.CResponse(http.StatusOK, "获取日志成功", map[string]interface{}{
"lists": ways,
"total": count,
})
}