25 lines
459 B
Go
25 lines
459 B
Go
package service
|
|
|
|
import (
|
|
"yintai-api/app/api/request"
|
|
"yintai-api/app/common/dao"
|
|
err2 "yintai-api/app/common/err"
|
|
)
|
|
|
|
type Config struct{}
|
|
|
|
func (r *Config) List(req request.ConfigList) (any, int64) {
|
|
req.Pagination()
|
|
lists, count, err := dao.NewConfig().List(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
|
|
}
|