1Panel/backend/app/api/v1/operation_log.go
2022-08-11 18:36:05 +08:00

27 lines
719 B
Go

package v1
import (
"github.com/1Panel-dev/1Panel/app/api/v1/helper"
"github.com/1Panel-dev/1Panel/app/dto"
"github.com/1Panel-dev/1Panel/constant"
"github.com/gin-gonic/gin"
)
func (b *BaseApi) GetOperationList(c *gin.Context) {
pagenation, isOK := helper.GeneratePaginationFromReq(c)
if !isOK {
helper.ErrorWithDetail(c, constant.CodeErrBadRequest, constant.ErrTypeInvalidParams, constant.ErrPageGenerate)
return
}
total, list, err := operationService.Page(pagenation.Page, pagenation.PageSize)
if err != nil {
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
return
}
helper.SuccessWithData(c, dto.PageResult{
Items: list,
Total: total,
})
}