response

package
v0.0.0-...-0dfa492 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 25, 2025 License: MulanPSL-2.0 Imports: 4 Imported by: 5

Documentation

Overview

* Copyright (c) KylinSoft Co., Ltd. 2024.All rights reserved. * PilotGo licensed under the Mulan Permissive Software License, Version 2. * See LICENSE file for more details. * Author: zhanghan2021 <zhanghan@kylinos.cn> * Date: Wed Sep 27 17:35:12 2023 +0800

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DataPagination

func DataPagination(c *gin.Context, list interface{}, total int, query *PaginationQ)

拼装json 分页数据

func DataPaging

func DataPaging(p *PaginationQ, list interface{}, total int) (interface{}, error)

结构体分页查询方法

func Fail

func Fail(c *gin.Context, data interface{}, msg string)

func Success

func Success(c *gin.Context, data interface{}, msg string)

func Unavailable

func Unavailable(c *gin.Context, data interface{}, msg string)

Types

type PaginationQ

type PaginationQ struct {
	Ok        bool        `json:"ok"`
	PageSize  int         `form:"size" json:"size"`
	Page      int         `form:"page" json:"page"`
	Data      interface{} `json:"data" comment:"muster be a pointer of slice gorm.Model"`
	TotalSize int         `json:"total"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL