Client work in Progress..
This commit is contained in:
parent
6d4392c1bc
commit
6d4c36d07b
@ -1,7 +1,7 @@
|
||||
|
||||
//----------------------
|
||||
// <auto-generated>
|
||||
// Generated REST API Client Code Generator v1.7.17.0 on 11.07.2023 17:38:19
|
||||
// Generated REST API Client Code Generator v1.7.17.0 on 13.07.2023 19:39:52
|
||||
// Using the tool OpenAPI Generator v6.6.0
|
||||
// </auto-generated>
|
||||
//----------------------
|
||||
@ -3387,7 +3387,7 @@ namespace BreCalClient.misc.Client
|
||||
{
|
||||
Proxy = null;
|
||||
UserAgent = WebUtility.UrlEncode("OpenAPI-Generator/1.0.0/csharp");
|
||||
BasePath = "https://brecal.bsmd-emswe.eu/";
|
||||
BasePath = "https://puls200.dyn-dns.org:8088/brecal/api";
|
||||
DefaultHeaders = new ConcurrentDictionary<string, string>();
|
||||
ApiKey = new ConcurrentDictionary<string, string>();
|
||||
ApiKeyPrefix = new ConcurrentDictionary<string, string>();
|
||||
@ -3395,7 +3395,7 @@ namespace BreCalClient.misc.Client
|
||||
{
|
||||
{
|
||||
new Dictionary<string, object> {
|
||||
{"url", "https://brecal.bsmd-emswe.eu/"},
|
||||
{"url", "https://puls200.dyn-dns.org:8088/brecal/api"},
|
||||
{"description", "Test server self-hosted by yours truly"},
|
||||
}
|
||||
}
|
||||
@ -3414,7 +3414,7 @@ namespace BreCalClient.misc.Client
|
||||
IDictionary<string, string> defaultHeaders,
|
||||
IDictionary<string, string> apiKey,
|
||||
IDictionary<string, string> apiKeyPrefix,
|
||||
string basePath = "https://brecal.bsmd-emswe.eu/") : this()
|
||||
string basePath = "https://puls200.dyn-dns.org:8088/brecal/api") : this()
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(basePath))
|
||||
throw new ArgumentException("The provided basePath is invalid.", "basePath");
|
||||
@ -3581,7 +3581,7 @@ namespace BreCalClient.misc.Client
|
||||
/// <example>
|
||||
/// ApiKeyPrefix["Authorization"] = "Bearer";
|
||||
/// </example>
|
||||
/// <EFBFBD> where ApiKey["Authorization"] would then be used to set the value of your bearer token.
|
||||
/// … where ApiKey["Authorization"] would then be used to set the value of your bearer token.
|
||||
///
|
||||
/// <remarks>
|
||||
/// OAuth2 workflows should set tokens via AccessToken.
|
||||
@ -5672,16 +5672,18 @@ namespace BreCalClient.misc.Model
|
||||
/// <param name="name">name.</param>
|
||||
/// <param name="imo">imo.</param>
|
||||
/// <param name="callsign">callsign.</param>
|
||||
/// <param name="participantId">participantId.</param>
|
||||
/// <param name="length">length.</param>
|
||||
/// <param name="width">width.</param>
|
||||
/// <param name="created">created.</param>
|
||||
/// <param name="modified">modified.</param>
|
||||
public Ship(int id = default(int), string name = default(string), int imo = default(int), string callsign = default(string), float length = default(float), float width = default(float), DateTime created = default(DateTime), DateTime modified = default(DateTime))
|
||||
public Ship(int id = default(int), string name = default(string), int imo = default(int), string callsign = default(string), int participantId = default(int), float length = default(float), float width = default(float), DateTime created = default(DateTime), DateTime modified = default(DateTime))
|
||||
{
|
||||
this.Id = id;
|
||||
this.Name = name;
|
||||
this.Imo = imo;
|
||||
this.Callsign = callsign;
|
||||
this.ParticipantId = participantId;
|
||||
this.Length = length;
|
||||
this.Width = width;
|
||||
this.Created = created;
|
||||
@ -5708,6 +5710,11 @@ namespace BreCalClient.misc.Model
|
||||
[DataMember(Name = "callsign", EmitDefaultValue = true)]
|
||||
public string Callsign { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or Sets ParticipantId
|
||||
/// </summary>
|
||||
[DataMember(Name = "participant_id", EmitDefaultValue = true)]
|
||||
public int ParticipantId { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or Sets Length
|
||||
/// </summary>
|
||||
[DataMember(Name = "length", EmitDefaultValue = true)]
|
||||
@ -5739,6 +5746,7 @@ namespace BreCalClient.misc.Model
|
||||
sb.Append(" Name: ").Append(Name).Append("\n");
|
||||
sb.Append(" Imo: ").Append(Imo).Append("\n");
|
||||
sb.Append(" Callsign: ").Append(Callsign).Append("\n");
|
||||
sb.Append(" ParticipantId: ").Append(ParticipantId).Append("\n");
|
||||
sb.Append(" Length: ").Append(Length).Append("\n");
|
||||
sb.Append(" Width: ").Append(Width).Append("\n");
|
||||
sb.Append(" Created: ").Append(Created).Append("\n");
|
||||
@ -5793,6 +5801,10 @@ namespace BreCalClient.misc.Model
|
||||
(this.Callsign != null &&
|
||||
this.Callsign.Equals(input.Callsign))
|
||||
) &&
|
||||
(
|
||||
this.ParticipantId == input.ParticipantId ||
|
||||
this.ParticipantId.Equals(input.ParticipantId)
|
||||
) &&
|
||||
(
|
||||
this.Length == input.Length ||
|
||||
this.Length.Equals(input.Length)
|
||||
@ -5831,6 +5843,7 @@ namespace BreCalClient.misc.Model
|
||||
{
|
||||
hashCode = (hashCode * 59) + this.Callsign.GetHashCode();
|
||||
}
|
||||
hashCode = (hashCode * 59) + this.ParticipantId.GetHashCode();
|
||||
hashCode = (hashCode * 59) + this.Length.GetHashCode();
|
||||
hashCode = (hashCode * 59) + this.Width.GetHashCode();
|
||||
if (this.Created != null)
|
||||
@ -5909,13 +5922,54 @@ namespace BreCalClient.misc.Model
|
||||
/// Initializes a new instance of the <see cref="Shipcall" /> class.
|
||||
/// </summary>
|
||||
/// <param name="id">The unique identifier of a ship call (required).</param>
|
||||
/// <param name="shipId">shipId (required).</param>
|
||||
/// <param name="type">type (required).</param>
|
||||
/// <param name="description">description.</param>
|
||||
public Shipcall(int id = default(int), TypeEnum type = default(TypeEnum), string description = default(string))
|
||||
/// <param name="eta">eta (required).</param>
|
||||
/// <param name="voyage">voyage (required).</param>
|
||||
/// <param name="etd">etd (required).</param>
|
||||
/// <param name="arrivalBerthId">arrivalBerthId.</param>
|
||||
/// <param name="departureBerthId">departureBerthId.</param>
|
||||
/// <param name="tugReguired">tugReguired.</param>
|
||||
/// <param name="pilotRequired">pilotRequired.</param>
|
||||
/// <param name="flags">flags.</param>
|
||||
/// <param name="pierSide">pierSide.</param>
|
||||
/// <param name="bunkering">bunkering.</param>
|
||||
/// <param name="replenishing">replenishing.</param>
|
||||
/// <param name="draft">draft.</param>
|
||||
/// <param name="tidalWindowFrom">tidalWindowFrom.</param>
|
||||
/// <param name="tidalWindowTo">tidalWindowTo.</param>
|
||||
/// <param name="rainSensitiveCargo">rainSensitiveCargo.</param>
|
||||
/// <param name="recommendedTugs">recommendedTugs.</param>
|
||||
/// <param name="created">created.</param>
|
||||
/// <param name="modified">modified.</param>
|
||||
public Shipcall(int id = default(int), int shipId = default(int), TypeEnum type = default(TypeEnum), DateTime eta = default(DateTime), string voyage = default(string), DateTime etd = default(DateTime), int arrivalBerthId = default(int), int departureBerthId = default(int), bool tugReguired = default(bool), bool pilotRequired = default(bool), int flags = default(int), bool pierSide = default(bool), bool bunkering = default(bool), bool replenishing = default(bool), float draft = default(float), DateTime tidalWindowFrom = default(DateTime), DateTime tidalWindowTo = default(DateTime), bool rainSensitiveCargo = default(bool), int recommendedTugs = default(int), DateTime created = default(DateTime), string modified = default(string))
|
||||
{
|
||||
this.Id = id;
|
||||
this.ShipId = shipId;
|
||||
this.Type = type;
|
||||
this.Description = description;
|
||||
this.Eta = eta;
|
||||
// to ensure "voyage" is required (not null)
|
||||
if (voyage == null)
|
||||
{
|
||||
throw new ArgumentNullException("voyage is a required property for Shipcall and cannot be null");
|
||||
}
|
||||
this.Voyage = voyage;
|
||||
this.Etd = etd;
|
||||
this.ArrivalBerthId = arrivalBerthId;
|
||||
this.DepartureBerthId = departureBerthId;
|
||||
this.TugReguired = tugReguired;
|
||||
this.PilotRequired = pilotRequired;
|
||||
this.Flags = flags;
|
||||
this.PierSide = pierSide;
|
||||
this.Bunkering = bunkering;
|
||||
this.Replenishing = replenishing;
|
||||
this.Draft = draft;
|
||||
this.TidalWindowFrom = tidalWindowFrom;
|
||||
this.TidalWindowTo = tidalWindowTo;
|
||||
this.RainSensitiveCargo = rainSensitiveCargo;
|
||||
this.RecommendedTugs = recommendedTugs;
|
||||
this.Created = created;
|
||||
this.Modified = modified;
|
||||
}
|
||||
/// <summary>
|
||||
/// The unique identifier of a ship call
|
||||
@ -5924,10 +5978,100 @@ namespace BreCalClient.misc.Model
|
||||
[DataMember(Name = "id", IsRequired = true, EmitDefaultValue = true)]
|
||||
public int Id { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or Sets Description
|
||||
/// Gets or Sets ShipId
|
||||
/// </summary>
|
||||
[DataMember(Name = "description", EmitDefaultValue = true)]
|
||||
public string Description { get; set; }
|
||||
[DataMember(Name = "ship_id", IsRequired = true, EmitDefaultValue = true)]
|
||||
public int ShipId { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or Sets Eta
|
||||
/// </summary>
|
||||
[DataMember(Name = "eta", IsRequired = true, EmitDefaultValue = true)]
|
||||
public DateTime Eta { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or Sets Voyage
|
||||
/// </summary>
|
||||
[DataMember(Name = "voyage", IsRequired = true, EmitDefaultValue = true)]
|
||||
public string Voyage { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or Sets Etd
|
||||
/// </summary>
|
||||
[DataMember(Name = "etd", IsRequired = true, EmitDefaultValue = true)]
|
||||
public DateTime Etd { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or Sets ArrivalBerthId
|
||||
/// </summary>
|
||||
[DataMember(Name = "arrival_berth_id", EmitDefaultValue = true)]
|
||||
public int ArrivalBerthId { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or Sets DepartureBerthId
|
||||
/// </summary>
|
||||
[DataMember(Name = "departure_berth_id", EmitDefaultValue = true)]
|
||||
public int DepartureBerthId { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or Sets TugReguired
|
||||
/// </summary>
|
||||
[DataMember(Name = "tug_reguired", EmitDefaultValue = true)]
|
||||
public bool TugReguired { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or Sets PilotRequired
|
||||
/// </summary>
|
||||
[DataMember(Name = "pilot_required", EmitDefaultValue = true)]
|
||||
public bool PilotRequired { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or Sets Flags
|
||||
/// </summary>
|
||||
[DataMember(Name = "flags", EmitDefaultValue = true)]
|
||||
public int Flags { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or Sets PierSide
|
||||
/// </summary>
|
||||
[DataMember(Name = "pier_side", EmitDefaultValue = true)]
|
||||
public bool PierSide { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or Sets Bunkering
|
||||
/// </summary>
|
||||
[DataMember(Name = "bunkering", EmitDefaultValue = true)]
|
||||
public bool Bunkering { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or Sets Replenishing
|
||||
/// </summary>
|
||||
[DataMember(Name = "replenishing", EmitDefaultValue = true)]
|
||||
public bool Replenishing { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or Sets Draft
|
||||
/// </summary>
|
||||
[DataMember(Name = "draft", EmitDefaultValue = true)]
|
||||
public float Draft { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or Sets TidalWindowFrom
|
||||
/// </summary>
|
||||
[DataMember(Name = "tidal_window_from", EmitDefaultValue = true)]
|
||||
public DateTime TidalWindowFrom { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or Sets TidalWindowTo
|
||||
/// </summary>
|
||||
[DataMember(Name = "tidal_window_to", EmitDefaultValue = true)]
|
||||
public DateTime TidalWindowTo { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or Sets RainSensitiveCargo
|
||||
/// </summary>
|
||||
[DataMember(Name = "rain_sensitive_cargo", EmitDefaultValue = true)]
|
||||
public bool RainSensitiveCargo { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or Sets RecommendedTugs
|
||||
/// </summary>
|
||||
[DataMember(Name = "recommended_tugs", EmitDefaultValue = true)]
|
||||
public int RecommendedTugs { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or Sets Created
|
||||
/// </summary>
|
||||
[DataMember(Name = "created", EmitDefaultValue = true)]
|
||||
public DateTime Created { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or Sets Modified
|
||||
/// </summary>
|
||||
[DataMember(Name = "modified", EmitDefaultValue = true)]
|
||||
public string Modified { get; set; }
|
||||
/// <summary>
|
||||
/// Returns the string presentation of the object
|
||||
/// </summary>
|
||||
@ -5937,8 +6081,26 @@ namespace BreCalClient.misc.Model
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.Append("class Shipcall {\n");
|
||||
sb.Append(" Id: ").Append(Id).Append("\n");
|
||||
sb.Append(" ShipId: ").Append(ShipId).Append("\n");
|
||||
sb.Append(" Type: ").Append(Type).Append("\n");
|
||||
sb.Append(" Description: ").Append(Description).Append("\n");
|
||||
sb.Append(" Eta: ").Append(Eta).Append("\n");
|
||||
sb.Append(" Voyage: ").Append(Voyage).Append("\n");
|
||||
sb.Append(" Etd: ").Append(Etd).Append("\n");
|
||||
sb.Append(" ArrivalBerthId: ").Append(ArrivalBerthId).Append("\n");
|
||||
sb.Append(" DepartureBerthId: ").Append(DepartureBerthId).Append("\n");
|
||||
sb.Append(" TugReguired: ").Append(TugReguired).Append("\n");
|
||||
sb.Append(" PilotRequired: ").Append(PilotRequired).Append("\n");
|
||||
sb.Append(" Flags: ").Append(Flags).Append("\n");
|
||||
sb.Append(" PierSide: ").Append(PierSide).Append("\n");
|
||||
sb.Append(" Bunkering: ").Append(Bunkering).Append("\n");
|
||||
sb.Append(" Replenishing: ").Append(Replenishing).Append("\n");
|
||||
sb.Append(" Draft: ").Append(Draft).Append("\n");
|
||||
sb.Append(" TidalWindowFrom: ").Append(TidalWindowFrom).Append("\n");
|
||||
sb.Append(" TidalWindowTo: ").Append(TidalWindowTo).Append("\n");
|
||||
sb.Append(" RainSensitiveCargo: ").Append(RainSensitiveCargo).Append("\n");
|
||||
sb.Append(" RecommendedTugs: ").Append(RecommendedTugs).Append("\n");
|
||||
sb.Append(" Created: ").Append(Created).Append("\n");
|
||||
sb.Append(" Modified: ").Append(Modified).Append("\n");
|
||||
sb.Append("}\n");
|
||||
return sb.ToString();
|
||||
}
|
||||
@ -5975,14 +6137,92 @@ namespace BreCalClient.misc.Model
|
||||
this.Id == input.Id ||
|
||||
this.Id.Equals(input.Id)
|
||||
) &&
|
||||
(
|
||||
this.ShipId == input.ShipId ||
|
||||
this.ShipId.Equals(input.ShipId)
|
||||
) &&
|
||||
(
|
||||
this.Type == input.Type ||
|
||||
this.Type.Equals(input.Type)
|
||||
) &&
|
||||
(
|
||||
this.Description == input.Description ||
|
||||
(this.Description != null &&
|
||||
this.Description.Equals(input.Description))
|
||||
this.Eta == input.Eta ||
|
||||
(this.Eta != null &&
|
||||
this.Eta.Equals(input.Eta))
|
||||
) &&
|
||||
(
|
||||
this.Voyage == input.Voyage ||
|
||||
(this.Voyage != null &&
|
||||
this.Voyage.Equals(input.Voyage))
|
||||
) &&
|
||||
(
|
||||
this.Etd == input.Etd ||
|
||||
(this.Etd != null &&
|
||||
this.Etd.Equals(input.Etd))
|
||||
) &&
|
||||
(
|
||||
this.ArrivalBerthId == input.ArrivalBerthId ||
|
||||
this.ArrivalBerthId.Equals(input.ArrivalBerthId)
|
||||
) &&
|
||||
(
|
||||
this.DepartureBerthId == input.DepartureBerthId ||
|
||||
this.DepartureBerthId.Equals(input.DepartureBerthId)
|
||||
) &&
|
||||
(
|
||||
this.TugReguired == input.TugReguired ||
|
||||
this.TugReguired.Equals(input.TugReguired)
|
||||
) &&
|
||||
(
|
||||
this.PilotRequired == input.PilotRequired ||
|
||||
this.PilotRequired.Equals(input.PilotRequired)
|
||||
) &&
|
||||
(
|
||||
this.Flags == input.Flags ||
|
||||
this.Flags.Equals(input.Flags)
|
||||
) &&
|
||||
(
|
||||
this.PierSide == input.PierSide ||
|
||||
this.PierSide.Equals(input.PierSide)
|
||||
) &&
|
||||
(
|
||||
this.Bunkering == input.Bunkering ||
|
||||
this.Bunkering.Equals(input.Bunkering)
|
||||
) &&
|
||||
(
|
||||
this.Replenishing == input.Replenishing ||
|
||||
this.Replenishing.Equals(input.Replenishing)
|
||||
) &&
|
||||
(
|
||||
this.Draft == input.Draft ||
|
||||
this.Draft.Equals(input.Draft)
|
||||
) &&
|
||||
(
|
||||
this.TidalWindowFrom == input.TidalWindowFrom ||
|
||||
(this.TidalWindowFrom != null &&
|
||||
this.TidalWindowFrom.Equals(input.TidalWindowFrom))
|
||||
) &&
|
||||
(
|
||||
this.TidalWindowTo == input.TidalWindowTo ||
|
||||
(this.TidalWindowTo != null &&
|
||||
this.TidalWindowTo.Equals(input.TidalWindowTo))
|
||||
) &&
|
||||
(
|
||||
this.RainSensitiveCargo == input.RainSensitiveCargo ||
|
||||
this.RainSensitiveCargo.Equals(input.RainSensitiveCargo)
|
||||
) &&
|
||||
(
|
||||
this.RecommendedTugs == input.RecommendedTugs ||
|
||||
this.RecommendedTugs.Equals(input.RecommendedTugs)
|
||||
) &&
|
||||
(
|
||||
this.Created == input.Created ||
|
||||
(this.Created != null &&
|
||||
this.Created.Equals(input.Created))
|
||||
) &&
|
||||
(
|
||||
this.Modified == input.Modified ||
|
||||
(this.Modified != null &&
|
||||
this.Modified.Equals(input.Modified))
|
||||
);
|
||||
}
|
||||
/// <summary>
|
||||
@ -5995,10 +6235,46 @@ namespace BreCalClient.misc.Model
|
||||
{
|
||||
int hashCode = 41;
|
||||
hashCode = (hashCode * 59) + this.Id.GetHashCode();
|
||||
hashCode = (hashCode * 59) + this.ShipId.GetHashCode();
|
||||
hashCode = (hashCode * 59) + this.Type.GetHashCode();
|
||||
if (this.Description != null)
|
||||
if (this.Eta != null)
|
||||
{
|
||||
hashCode = (hashCode * 59) + this.Description.GetHashCode();
|
||||
hashCode = (hashCode * 59) + this.Eta.GetHashCode();
|
||||
}
|
||||
if (this.Voyage != null)
|
||||
{
|
||||
hashCode = (hashCode * 59) + this.Voyage.GetHashCode();
|
||||
}
|
||||
if (this.Etd != null)
|
||||
{
|
||||
hashCode = (hashCode * 59) + this.Etd.GetHashCode();
|
||||
}
|
||||
hashCode = (hashCode * 59) + this.ArrivalBerthId.GetHashCode();
|
||||
hashCode = (hashCode * 59) + this.DepartureBerthId.GetHashCode();
|
||||
hashCode = (hashCode * 59) + this.TugReguired.GetHashCode();
|
||||
hashCode = (hashCode * 59) + this.PilotRequired.GetHashCode();
|
||||
hashCode = (hashCode * 59) + this.Flags.GetHashCode();
|
||||
hashCode = (hashCode * 59) + this.PierSide.GetHashCode();
|
||||
hashCode = (hashCode * 59) + this.Bunkering.GetHashCode();
|
||||
hashCode = (hashCode * 59) + this.Replenishing.GetHashCode();
|
||||
hashCode = (hashCode * 59) + this.Draft.GetHashCode();
|
||||
if (this.TidalWindowFrom != null)
|
||||
{
|
||||
hashCode = (hashCode * 59) + this.TidalWindowFrom.GetHashCode();
|
||||
}
|
||||
if (this.TidalWindowTo != null)
|
||||
{
|
||||
hashCode = (hashCode * 59) + this.TidalWindowTo.GetHashCode();
|
||||
}
|
||||
hashCode = (hashCode * 59) + this.RainSensitiveCargo.GetHashCode();
|
||||
hashCode = (hashCode * 59) + this.RecommendedTugs.GetHashCode();
|
||||
if (this.Created != null)
|
||||
{
|
||||
hashCode = (hashCode * 59) + this.Created.GetHashCode();
|
||||
}
|
||||
if (this.Modified != null)
|
||||
{
|
||||
hashCode = (hashCode * 59) + this.Modified.GetHashCode();
|
||||
}
|
||||
return hashCode;
|
||||
}
|
||||
|
||||
@ -14,8 +14,8 @@ info:
|
||||
|
||||
servers:
|
||||
# tutorial: https://idratherbewriting.com/learnapidoc/pubapis_openapi_step3_servers_object.html
|
||||
- url : "https://brecal.bsmd-emswe.eu/"
|
||||
description: "Test server hosted on netcup vserver"
|
||||
- url : "https://puls200.dyn-dns.org:8088/brecal/api"
|
||||
description: "Test server self-hosted by yours truly"
|
||||
|
||||
paths:
|
||||
# tutorial: https://idratherbewriting.com/learnapidoc/pubapis_openapi_step4_paths_object.html
|
||||
@ -313,15 +313,55 @@ components:
|
||||
properties:
|
||||
id:
|
||||
$ref: '#/components/schemas/shipcallId'
|
||||
|
||||
ship_id:
|
||||
type: integer
|
||||
type:
|
||||
type: string
|
||||
enum:
|
||||
- incoming
|
||||
- outgoing
|
||||
- shifting
|
||||
|
||||
description:
|
||||
eta:
|
||||
type: string
|
||||
format: date-time
|
||||
voyage:
|
||||
type: string
|
||||
etd:
|
||||
type: string
|
||||
format: date-time
|
||||
arrival_berth_id:
|
||||
type: integer
|
||||
departure_berth_id:
|
||||
type: integer
|
||||
tug_reguired:
|
||||
type: boolean
|
||||
pilot_required:
|
||||
type: boolean
|
||||
flags:
|
||||
type: integer
|
||||
pier_side:
|
||||
type: boolean
|
||||
bunkering:
|
||||
type: boolean
|
||||
replenishing:
|
||||
type: boolean
|
||||
draft:
|
||||
type: number
|
||||
format: float
|
||||
tidal_window_from:
|
||||
type: string
|
||||
format: date-time
|
||||
tidal_window_to:
|
||||
type: string
|
||||
format: date-time
|
||||
rain_sensitive_cargo:
|
||||
type: boolean
|
||||
recommended_tugs:
|
||||
type: integer
|
||||
created:
|
||||
type: string
|
||||
format: date-time
|
||||
modified:
|
||||
type: string
|
||||
|
||||
shipcalls:
|
||||
@ -390,6 +430,8 @@ components:
|
||||
type: integer
|
||||
callsign:
|
||||
type: string
|
||||
participant_id:
|
||||
type: integer
|
||||
length:
|
||||
type: number
|
||||
format: float
|
||||
|
||||
@ -38,7 +38,48 @@
|
||||
</Grid>
|
||||
</xctk:BusyIndicator.BusyContent>
|
||||
<Grid>
|
||||
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="28" />
|
||||
</Grid.RowDefinitions>
|
||||
<ListBox x:Name="listBoxShipCalls" Grid.Row="0" />
|
||||
<StatusBar Grid.Row="1">
|
||||
<StatusBar.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="100" />
|
||||
<ColumnDefinition Width="100" />
|
||||
<ColumnDefinition Width="100" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="100" />
|
||||
</Grid.ColumnDefinitions>
|
||||
</Grid>
|
||||
</ItemsPanelTemplate>
|
||||
</StatusBar.ItemsPanel>
|
||||
<StatusBarItem Grid.Column="0">
|
||||
<TextBlock Name="labelGeneralStatus" FontSize="9"></TextBlock>
|
||||
</StatusBarItem>
|
||||
<StatusBarItem Grid.Column="1">
|
||||
<TextBlock Name="labelVersion"></TextBlock>
|
||||
</StatusBarItem>
|
||||
<StatusBarItem Grid.Column="2">
|
||||
<TextBlock Name="labelUsername"></TextBlock>
|
||||
</StatusBarItem>
|
||||
<Separator Grid.Column="3"/>
|
||||
<StatusBarItem Grid.Column="4">
|
||||
<TextBlock Name="labelStatusBar"></TextBlock>
|
||||
</StatusBarItem>
|
||||
<Separator Grid.Column="5"/>
|
||||
<StatusBarItem Grid.Column="6">
|
||||
<ProgressBar Name="generalProgressStatus" Width="90" Height="16"/>
|
||||
</StatusBarItem>
|
||||
</StatusBar>
|
||||
</Grid>
|
||||
</xctk:BusyIndicator>
|
||||
</Window>
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Immutable;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
@ -25,12 +27,22 @@ namespace BreCalClient
|
||||
public partial class MainWindow : Window
|
||||
{
|
||||
DefaultApi _api;
|
||||
ObservableCollection<ShipcallControlModel> _controlModels = new();
|
||||
List<Ship> _ships = new();
|
||||
Dictionary<int, Ship> _shipLookupDict = new();
|
||||
List<Berth> _berths = new();
|
||||
Dictionary<int, Berth> _berthLookupDict = new();
|
||||
List<Participant> _participants = new();
|
||||
Dictionary<int, Participant> _participantLookupDict = new();
|
||||
|
||||
public MainWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
_api = new DefaultApi();
|
||||
}
|
||||
|
||||
#region event handler
|
||||
|
||||
private void Window_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
|
||||
@ -55,6 +67,7 @@ namespace BreCalClient
|
||||
if(loginResult.Id > 0)
|
||||
{
|
||||
this.busyIndicator.IsBusy = false;
|
||||
this.LoadStaticLists();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -72,5 +85,45 @@ namespace BreCalClient
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region private methods
|
||||
|
||||
private async void LoadStaticLists()
|
||||
{
|
||||
this._berths = await _api.BerthsGetAsync();
|
||||
foreach(var berth in this._berths)
|
||||
_berthLookupDict[berth.Id] = berth;
|
||||
this._ships = await _api.ShipsGetAsync();
|
||||
foreach(var ship in this._ships)
|
||||
_shipLookupDict[ship.Id] = ship;
|
||||
// this._participants = await _api.ParticipantGetAsync();
|
||||
}
|
||||
|
||||
private async void RefreshShipcalls()
|
||||
{
|
||||
List<Shipcall> shipcalls = await _api.ShipcallsGetAsync(0); // TODO: this must return all current calls
|
||||
foreach(Shipcall shipcall in shipcalls)
|
||||
{
|
||||
|
||||
|
||||
// TODO: find out if we already have this thing
|
||||
|
||||
// yes: update values
|
||||
|
||||
// no: create new entry
|
||||
ShipcallControlModel scm = new ShipcallControlModel();
|
||||
scm.Shipcall = shipcall;
|
||||
if(this._shipLookupDict.ContainsKey(shipcall.Id))
|
||||
scm.Ship = this._shipLookupDict[shipcall.Id];
|
||||
_controlModels.Add(scm);
|
||||
|
||||
// TODO: sort this list somehow
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
51
src/BreCalClient/ShipcallControl.xaml
Normal file
51
src/BreCalClient/ShipcallControl.xaml
Normal file
@ -0,0 +1,51 @@
|
||||
<UserControl x:Class="BreCalClient.ShipcallControl"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:BreCalClient"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="100" d:DesignWidth="800">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height=".3*"/>
|
||||
<RowDefinition Height=".3*"/>
|
||||
<RowDefinition Height=".3*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width=".4*" />
|
||||
<ColumnDefinition Width=".1*" />
|
||||
<ColumnDefinition Width=".4*" />
|
||||
<ColumnDefinition Width=".1*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Viewbox Grid.Column="0" Grid.Row="0" Grid.RowSpan="2">
|
||||
<TextBlock x:Name="textBlockShipname" Text="{Binding Ship+Name}" />
|
||||
</Viewbox>
|
||||
<Grid Grid.Row="2" Grid.Column="0">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="0.1*" />
|
||||
<ColumnDefinition Width="0.4*" />
|
||||
<ColumnDefinition Width=".2*" />
|
||||
<ColumnDefinition Width=".3*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Viewbox>
|
||||
<TextBlock Text="IMO" />
|
||||
</Viewbox>
|
||||
<Viewbox Grid.Column="1">
|
||||
<TextBlock Text="{Binding Ship+IMO}" />
|
||||
</Viewbox>
|
||||
<Viewbox Grid.Column="2">
|
||||
<TextBlock Text="Callsign" />
|
||||
</Viewbox>
|
||||
<Viewbox Grid.Column="3">
|
||||
<TextBlock Text="{Binding Ship+Callsign}" />
|
||||
</Viewbox>
|
||||
</Grid>
|
||||
<Viewbox Grid.Column="1" Grid.Row="0">
|
||||
<TextBlock Text="ETA" />
|
||||
</Viewbox>
|
||||
<Viewbox Grid.Column="1" Grid.Row="1">
|
||||
<TextBlock Text="ETD" />
|
||||
</Viewbox>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
28
src/BreCalClient/ShipcallControl.xaml.cs
Normal file
28
src/BreCalClient/ShipcallControl.xaml.cs
Normal file
@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace BreCalClient
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for ShipcallControl.xaml
|
||||
/// </summary>
|
||||
public partial class ShipcallControl : UserControl
|
||||
{
|
||||
public ShipcallControl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
15
src/BreCalClient/ShipcallControlModel.cs
Normal file
15
src/BreCalClient/ShipcallControlModel.cs
Normal file
@ -0,0 +1,15 @@
|
||||
using BreCalClient.misc.Model;
|
||||
|
||||
|
||||
namespace BreCalClient
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Container model to aggregate separate models for the Shipcall control data binding
|
||||
/// </summary>
|
||||
public class ShipcallControlModel
|
||||
{
|
||||
public Shipcall? Shipcall { get; set; }
|
||||
public Ship? Ship { get; set; }
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user