Merge pull request 'feature/responses-v2' (#38) from feature/responses-v2 into dev
Reviewed-on: winter-access/backend_nam#38
This commit is contained in:
commit
860dac95f6
|
|
@ -455,6 +455,7 @@ func (c *DeviceDetailsController) updateDeviceDetails(ctx *gin.Context) {
|
|||
if city := ctx.PostForm("city"); city != "" {
|
||||
deviceUpdateDTO.City = &city
|
||||
}
|
||||
|
||||
if district := ctx.PostForm("district"); district != "" {
|
||||
deviceUpdateDTO.District = &district
|
||||
}
|
||||
|
|
@ -469,6 +470,17 @@ func (c *DeviceDetailsController) updateDeviceDetails(ctx *gin.Context) {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
if oltIDStr := ctx.PostForm("olt_id"); oltIDStr != "" {
|
||||
if oltID, err := uuid.Parse(oltIDStr); err == nil {
|
||||
deviceUpdateDTO.OLTID = &oltID
|
||||
} else {
|
||||
common.ErrorResponses(ctx, http.StatusBadRequest, "Invalid OLT ID format")
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Get multiple image files
|
||||
form := ctx.Request.MultipartForm
|
||||
imageFiles := form.File["images"] // Support multiple images
|
||||
|
|
|
|||
|
|
@ -39,8 +39,8 @@ type DeviceDetailsResponse struct {
|
|||
}
|
||||
|
||||
type OLTInfo struct {
|
||||
OLTID uuid.UUID `json:"olt_id"`
|
||||
OLTName string `json:"olt_name"`
|
||||
OLTID uuid.UUID `json:"id"`
|
||||
OLTName string `json:"name"`
|
||||
}
|
||||
|
||||
type TowerConnectionDetail struct {
|
||||
|
|
|
|||
|
|
@ -7,14 +7,14 @@ import (
|
|||
|
||||
type OLTResponse struct {
|
||||
ID uuid.UUID `json:"id"`
|
||||
OLTName string `json:"olt_name"`
|
||||
OLTName string `json:"name"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
}
|
||||
|
||||
type OLTDetailResponse struct {
|
||||
ID uuid.UUID `json:"id"`
|
||||
OLTName string `json:"olt_name"`
|
||||
OLTName string `json:"name"`
|
||||
DeviceCount int `json:"device_count"`
|
||||
Devices []DeviceDetailsResponse `json:"devices"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
|
|
|
|||
Loading…
Reference in New Issue