Redmage/converts/converts.go

25 lines
584 B
Go
Raw Normal View History

2024-08-04 20:18:54 +07:00
package main
import (
device "github.com/tigorlazuardi/redmage/gen/proto/device/v1"
"github.com/tigorlazuardi/redmage/models"
)
// goverter:converter
// goverter:extend BoolToInt32
type Converter interface {
// goverter:map Nsfw NSFW
// goverter:ignore CreatedAt UpdatedAt R
CreateDeviceRequestToModelsDevice(source *device.CreateDeviceRequest) *models.Device
// goverter:ignore state sizeCache unknownFields
ModelsDeviceToCreateDeviceResponse(source *models.Device) *device.CreateDeviceResponse
2024-08-04 20:18:54 +07:00
}
func BoolToInt32(input bool) int32 {
if input {
return 1
}
return 0
}