25 lines
461 B
Go
25 lines
461 B
Go
package service
|
|
|
|
import (
|
|
"yintai-api/app/api/request"
|
|
"yintai-api/app/common/dao"
|
|
err2 "yintai-api/app/common/err"
|
|
)
|
|
|
|
type Page struct{}
|
|
|
|
func (r *Page) List(req request.PageList) (any, int64) {
|
|
req.Pagination()
|
|
lists, count, err := dao.NewPage().List(req.Name, req.Page, req.Size, req.Sort)
|
|
if err != nil {
|
|
err2.DbErr(err)
|
|
}
|
|
|
|
res := make([]map[string]any, 0)
|
|
for _, list := range lists {
|
|
res = append(res, list.Format())
|
|
}
|
|
|
|
return res, count
|
|
}
|