get_notice_personal_list.go
934 字节
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
29
30
31
32
33
34
35
36
37
38
39
package query
import (
"fmt"
"github.com/beego/beego/v2/core/validation"
)
type GetNoticePersonalListQuery struct {
// 接收方用户的id
UserId int64 `json:"userId"`
// 分页偏移量
PageSize int64 `json:"pageSize"`
// 每页限制数量 默认20
PageIndex int64 `json:"pageIndex"`
// 是否是已读
IsRead int64 `json:"isRead"`
CompanyId int64 `json:"companyId"`
OrgId int64 `json:"orgId"`
}
func (getNoticePersonalListQuery *GetNoticePersonalListQuery) Valid(validation *validation.Validation) {
validation.SetError("CustomValid", "未实现的自定义认证")
}
func (getNoticePersonalListQuery *GetNoticePersonalListQuery) ValidateQuery() error {
valid := validation.Validation{}
b, err := valid.Valid(getNoticePersonalListQuery)
if err != nil {
return err
}
if !b {
for _, validErr := range valid.Errors {
return fmt.Errorf("%s %s", validErr.Key, validErr.Message)
}
}
return nil
}