Add Customer Discovery
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
package request
|
||||
|
||||
import (
|
||||
"furtuna-be/internal/entity"
|
||||
)
|
||||
|
||||
type DiscoveryHomeParam struct {
|
||||
Lat float64 `form:"lat" json:"lat" example:"10"`
|
||||
Long float64 `form:"long" json:"long" example:"0"`
|
||||
Name string `form:"name" json:"name" example:"0"`
|
||||
Region string `form:"region" json:"region" example:"0"`
|
||||
Radius int `form:"radius" json:"radius" example:"0"`
|
||||
Limit int `form:"limit" json:"limit" example:"0"`
|
||||
Offset int `form:"offset" json:"offset" example:"0"`
|
||||
Discover string `form:"discover" json:"discover" example:"0"`
|
||||
}
|
||||
|
||||
func (d *DiscoveryHomeParam) ToEntity() *entity.DiscoverySearch {
|
||||
if d.Limit == 0 {
|
||||
d.Limit = 10
|
||||
}
|
||||
|
||||
return &entity.DiscoverySearch{
|
||||
Lat: d.Lat,
|
||||
Long: d.Long,
|
||||
Name: d.Name,
|
||||
Region: d.Region,
|
||||
Radius: d.Radius,
|
||||
Limit: d.Limit,
|
||||
Offset: d.Offset,
|
||||
Discover: d.Discover,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user