yinbentan
2024-09-26 2030ec81f18f4ec9ea1800f13046acafff6d50f7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package request
 
type PageInfo struct {
    Page     int `json:"page" form:"page"`         // 页码
    PageSize int `json:"pageSize" form:"pageSize"` // 每页大小
}
 
type GetById struct {
    ID uint `json:"id"` // 主键ID
}
 
type GetByUserId struct {
    UserId string `json:"userId"` // 用户ID
}
 
func (p PageInfo) Check() bool {
    if p.Page <= 0 {
        return false
    }
    if p.PageSize <= 0 || p.PageSize > 500 {
        return false
    }
    return true
}
 
type CommonIds struct {
    Ids []int `json:"ids,omitempty" binding:"required"`
}