mirror of
https://github.com/wgh136/nysoure.git
synced 2025-12-16 07:51:14 +00:00
feat: Enhance low resolution character retrieval with customizable page size
This commit is contained in:
@@ -803,12 +803,16 @@ func UpdateCharacterImage(uid, resourceID, characterID, imageID uint) error {
|
||||
}
|
||||
|
||||
// GetLowResolutionCharacters 获取低清晰度的角色图片
|
||||
func GetLowResolutionCharacters(page int, maxWidth, maxHeight int) ([]model.LowResCharacterView, int, error) {
|
||||
const pageSize = 50 // 每页50个角色
|
||||
|
||||
func GetLowResolutionCharacters(page int, pageSize int, maxWidth, maxHeight int) ([]model.LowResCharacterView, int, error) {
|
||||
if page <= 0 {
|
||||
page = 1
|
||||
}
|
||||
if pageSize <= 0 {
|
||||
pageSize = 50 // 默认每页50个角色
|
||||
}
|
||||
if pageSize > 1000 {
|
||||
pageSize = 1000 // 限制最大页面大小
|
||||
}
|
||||
|
||||
offset := (page - 1) * pageSize
|
||||
|
||||
|
||||
Reference in New Issue
Block a user