56 lines
1.5 KiB
Go
56 lines
1.5 KiB
Go
package response
|
|
|
|
import (
|
|
"psi/models"
|
|
)
|
|
|
|
type LocationResponse struct {
|
|
ID int64 `json:"id"`
|
|
WarehouseID int64 `json:"warehouse_id"`
|
|
Code string `json:"code"`
|
|
Type int8 `json:"type"`
|
|
Capacity int64 `json:"capacity"`
|
|
Status int8 `json:"status"`
|
|
Sort int `json:"sort"`
|
|
CreatedAt int64 `json:"created_at"`
|
|
UpdatedAt int64 `json:"updated_at"`
|
|
}
|
|
|
|
func ConvertLocationToResponse(location models.Location) LocationResponse {
|
|
return LocationResponse{
|
|
ID: location.ID,
|
|
WarehouseID: location.WarehouseID,
|
|
Code: location.Code,
|
|
Type: location.Type,
|
|
Capacity: location.Capacity,
|
|
Status: location.Status,
|
|
Sort: location.Sort,
|
|
CreatedAt: location.CreatedAt,
|
|
UpdatedAt: location.UpdatedAt,
|
|
}
|
|
}
|
|
|
|
type BatchGenerateResult struct {
|
|
TotalCount int `json:"total_count"`
|
|
SuccessCount int `json:"success_count"`
|
|
FailCount int `json:"fail_count"`
|
|
SuccessIDs []int64 `json:"success_ids"`
|
|
FailCodes []string `json:"fail_codes"`
|
|
Message string `json:"message"`
|
|
GeneratedCode []string `json:"generated_codes,omitempty"`
|
|
}
|
|
|
|
type SyncLocationResponse struct {
|
|
SuccessCount int `json:"success_count"`
|
|
FailCount int `json:"fail_count"`
|
|
SuccessCodes []string `json:"success_codes"`
|
|
FailCodes []string `json:"fail_codes"`
|
|
Message string `json:"message"`
|
|
}
|
|
|
|
type SyncGoodsResponse struct {
|
|
SuccessCount int `json:"success_count"`
|
|
FailCount int `json:"fail_count"`
|
|
Message string `json:"message"`
|
|
}
|