32 lines
777 B
Go
32 lines
777 B
Go
package response
|
|
|
|
import "psi/models"
|
|
|
|
// ConfigListResponse 配置列表响应
|
|
type ConfigListResponse struct {
|
|
List []ConfigItem `json:"list"`
|
|
Total int64 `json:"total"`
|
|
Page int `json:"page"`
|
|
PageSize int `json:"pageSize"`
|
|
}
|
|
|
|
// ConfigItem 配置列表项
|
|
type ConfigItem struct {
|
|
ID int64 `json:"id"`
|
|
Key string `json:"key"`
|
|
Value string `json:"value"`
|
|
CreatedAt int64 `json:"created_at"`
|
|
UpdatedAt int64 `json:"updated_at"`
|
|
}
|
|
|
|
// ConvertConfigToItem 将配置模型转换为响应项
|
|
func ConvertConfigToItem(config models.Config) ConfigItem {
|
|
return ConfigItem{
|
|
ID: config.ID,
|
|
Key: config.Key,
|
|
Value: config.Value,
|
|
CreatedAt: config.CreatedAt,
|
|
UpdatedAt: config.UpdatedAt,
|
|
}
|
|
}
|