Add Mapfix Description Field #125
@ -629,6 +629,7 @@ components:
|
|||||||
- AssetID
|
- AssetID
|
||||||
- AssetVersion
|
- AssetVersion
|
||||||
- TargetAssetID
|
- TargetAssetID
|
||||||
|
- Description
|
||||||
type: object
|
type: object
|
||||||
properties:
|
properties:
|
||||||
OperationID:
|
OperationID:
|
||||||
@ -661,6 +662,9 @@ components:
|
|||||||
type: integer
|
type: integer
|
||||||
format: int64
|
format: int64
|
||||||
minimum: 0
|
minimum: 0
|
||||||
|
Description:
|
||||||
|
type: string
|
||||||
|
maxLength: 256
|
||||||
SubmissionCreate:
|
SubmissionCreate:
|
||||||
required:
|
required:
|
||||||
- OperationID
|
- OperationID
|
||||||
|
12
openapi.yaml
12
openapi.yaml
@ -1440,7 +1440,7 @@ components:
|
|||||||
- Completed
|
- Completed
|
||||||
- TargetAssetID
|
- TargetAssetID
|
||||||
- StatusID
|
- StatusID
|
||||||
- StatusMessage
|
- Description
|
||||||
type: object
|
type: object
|
||||||
properties:
|
properties:
|
||||||
ID:
|
ID:
|
||||||
@ -1487,7 +1487,7 @@ components:
|
|||||||
type: integer
|
type: integer
|
||||||
format: int32
|
format: int32
|
||||||
minimum: 0
|
minimum: 0
|
||||||
StatusMessage:
|
Description:
|
||||||
type: string
|
type: string
|
||||||
maxLength: 256
|
maxLength: 256
|
||||||
Mapfixes:
|
Mapfixes:
|
||||||
@ -1508,6 +1508,7 @@ components:
|
|||||||
required:
|
required:
|
||||||
- AssetID
|
- AssetID
|
||||||
- TargetAssetID
|
- TargetAssetID
|
||||||
|
- Description
|
||||||
type: object
|
type: object
|
||||||
properties:
|
properties:
|
||||||
AssetID:
|
AssetID:
|
||||||
@ -1518,6 +1519,9 @@ components:
|
|||||||
type: integer
|
type: integer
|
||||||
format: int64
|
format: int64
|
||||||
minimum: 0
|
minimum: 0
|
||||||
|
Description:
|
||||||
|
type: string
|
||||||
|
maxLength: 256
|
||||||
Operation:
|
Operation:
|
||||||
required:
|
required:
|
||||||
- OperationID
|
- OperationID
|
||||||
@ -1566,7 +1570,6 @@ components:
|
|||||||
- Completed
|
- Completed
|
||||||
# - UploadedAssetID
|
# - UploadedAssetID
|
||||||
- StatusID
|
- StatusID
|
||||||
- StatusMessage
|
|
||||||
type: object
|
type: object
|
||||||
properties:
|
properties:
|
||||||
ID:
|
ID:
|
||||||
@ -1621,9 +1624,6 @@ components:
|
|||||||
type: integer
|
type: integer
|
||||||
format: int32
|
format: int32
|
||||||
minimum: 0
|
minimum: 0
|
||||||
StatusMessage:
|
|
||||||
type: string
|
|
||||||
maxLength: 256
|
|
||||||
Submissions:
|
Submissions:
|
||||||
required:
|
required:
|
||||||
- Total
|
- Total
|
||||||
|
@ -602,8 +602,8 @@ func (s *Mapfix) encodeFields(e *jx.Encoder) {
|
|||||||
e.Int32(s.StatusID)
|
e.Int32(s.StatusID)
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
e.FieldStart("StatusMessage")
|
e.FieldStart("Description")
|
||||||
e.Str(s.StatusMessage)
|
e.Str(s.Description)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -620,7 +620,7 @@ var jsonFieldsNameOfMapfix = [13]string{
|
|||||||
9: "Completed",
|
9: "Completed",
|
||||||
10: "TargetAssetID",
|
10: "TargetAssetID",
|
||||||
11: "StatusID",
|
11: "StatusID",
|
||||||
12: "StatusMessage",
|
12: "Description",
|
||||||
}
|
}
|
||||||
|
|
||||||
// Decode decodes Mapfix from json.
|
// Decode decodes Mapfix from json.
|
||||||
@ -776,17 +776,17 @@ func (s *Mapfix) Decode(d *jx.Decoder) error {
|
|||||||
}(); err != nil {
|
}(); err != nil {
|
||||||
return errors.Wrap(err, "decode field \"StatusID\"")
|
return errors.Wrap(err, "decode field \"StatusID\"")
|
||||||
}
|
}
|
||||||
case "StatusMessage":
|
case "Description":
|
||||||
requiredBitSet[1] |= 1 << 4
|
requiredBitSet[1] |= 1 << 4
|
||||||
if err := func() error {
|
if err := func() error {
|
||||||
v, err := d.Str()
|
v, err := d.Str()
|
||||||
s.StatusMessage = string(v)
|
s.Description = string(v)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}(); err != nil {
|
}(); err != nil {
|
||||||
return errors.Wrap(err, "decode field \"StatusMessage\"")
|
return errors.Wrap(err, "decode field \"Description\"")
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
return d.Skip()
|
return d.Skip()
|
||||||
@ -862,11 +862,16 @@ func (s *MapfixTriggerCreate) encodeFields(e *jx.Encoder) {
|
|||||||
e.FieldStart("TargetAssetID")
|
e.FieldStart("TargetAssetID")
|
||||||
e.Int64(s.TargetAssetID)
|
e.Int64(s.TargetAssetID)
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
e.FieldStart("Description")
|
||||||
|
e.Str(s.Description)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var jsonFieldsNameOfMapfixTriggerCreate = [2]string{
|
var jsonFieldsNameOfMapfixTriggerCreate = [3]string{
|
||||||
0: "AssetID",
|
0: "AssetID",
|
||||||
1: "TargetAssetID",
|
1: "TargetAssetID",
|
||||||
|
2: "Description",
|
||||||
}
|
}
|
||||||
|
|
||||||
// Decode decodes MapfixTriggerCreate from json.
|
// Decode decodes MapfixTriggerCreate from json.
|
||||||
@ -902,6 +907,18 @@ func (s *MapfixTriggerCreate) Decode(d *jx.Decoder) error {
|
|||||||
}(); err != nil {
|
}(); err != nil {
|
||||||
return errors.Wrap(err, "decode field \"TargetAssetID\"")
|
return errors.Wrap(err, "decode field \"TargetAssetID\"")
|
||||||
}
|
}
|
||||||
|
case "Description":
|
||||||
|
requiredBitSet[0] |= 1 << 2
|
||||||
|
if err := func() error {
|
||||||
|
v, err := d.Str()
|
||||||
|
s.Description = string(v)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}(); err != nil {
|
||||||
|
return errors.Wrap(err, "decode field \"Description\"")
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
return d.Skip()
|
return d.Skip()
|
||||||
}
|
}
|
||||||
@ -912,7 +929,7 @@ func (s *MapfixTriggerCreate) Decode(d *jx.Decoder) error {
|
|||||||
// Validate required fields.
|
// Validate required fields.
|
||||||
var failures []validate.FieldError
|
var failures []validate.FieldError
|
||||||
for i, mask := range [1]uint8{
|
for i, mask := range [1]uint8{
|
||||||
0b00000011,
|
0b00000111,
|
||||||
} {
|
} {
|
||||||
if result := (requiredBitSet[i] & mask) ^ mask; result != 0 {
|
if result := (requiredBitSet[i] & mask) ^ mask; result != 0 {
|
||||||
// Mask only required fields and check equality to mask using XOR.
|
// Mask only required fields and check equality to mask using XOR.
|
||||||
@ -2851,13 +2868,9 @@ func (s *Submission) encodeFields(e *jx.Encoder) {
|
|||||||
e.FieldStart("StatusID")
|
e.FieldStart("StatusID")
|
||||||
e.Int32(s.StatusID)
|
e.Int32(s.StatusID)
|
||||||
}
|
}
|
||||||
{
|
|
||||||
e.FieldStart("StatusMessage")
|
|
||||||
e.Str(s.StatusMessage)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var jsonFieldsNameOfSubmission = [15]string{
|
var jsonFieldsNameOfSubmission = [14]string{
|
||||||
0: "ID",
|
0: "ID",
|
||||||
1: "DisplayName",
|
1: "DisplayName",
|
||||||
2: "Creator",
|
2: "Creator",
|
||||||
@ -2872,7 +2885,6 @@ var jsonFieldsNameOfSubmission = [15]string{
|
|||||||
11: "Completed",
|
11: "Completed",
|
||||||
12: "UploadedAssetID",
|
12: "UploadedAssetID",
|
||||||
13: "StatusID",
|
13: "StatusID",
|
||||||
14: "StatusMessage",
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Decode decodes Submission from json.
|
// Decode decodes Submission from json.
|
||||||
@ -3046,18 +3058,6 @@ func (s *Submission) Decode(d *jx.Decoder) error {
|
|||||||
}(); err != nil {
|
}(); err != nil {
|
||||||
return errors.Wrap(err, "decode field \"StatusID\"")
|
return errors.Wrap(err, "decode field \"StatusID\"")
|
||||||
}
|
}
|
||||||
case "StatusMessage":
|
|
||||||
requiredBitSet[1] |= 1 << 6
|
|
||||||
if err := func() error {
|
|
||||||
v, err := d.Str()
|
|
||||||
s.StatusMessage = string(v)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}(); err != nil {
|
|
||||||
return errors.Wrap(err, "decode field \"StatusMessage\"")
|
|
||||||
}
|
|
||||||
default:
|
default:
|
||||||
return d.Skip()
|
return d.Skip()
|
||||||
}
|
}
|
||||||
@ -3069,7 +3069,7 @@ func (s *Submission) Decode(d *jx.Decoder) error {
|
|||||||
var failures []validate.FieldError
|
var failures []validate.FieldError
|
||||||
for i, mask := range [2]uint8{
|
for i, mask := range [2]uint8{
|
||||||
0b11111111,
|
0b11111111,
|
||||||
0b01101001,
|
0b00101001,
|
||||||
} {
|
} {
|
||||||
if result := (requiredBitSet[i] & mask) ^ mask; result != 0 {
|
if result := (requiredBitSet[i] & mask) ^ mask; result != 0 {
|
||||||
// Mask only required fields and check equality to mask using XOR.
|
// Mask only required fields and check equality to mask using XOR.
|
||||||
|
@ -349,7 +349,7 @@ type Mapfix struct {
|
|||||||
Completed bool `json:"Completed"`
|
Completed bool `json:"Completed"`
|
||||||
TargetAssetID int64 `json:"TargetAssetID"`
|
TargetAssetID int64 `json:"TargetAssetID"`
|
||||||
StatusID int32 `json:"StatusID"`
|
StatusID int32 `json:"StatusID"`
|
||||||
StatusMessage string `json:"StatusMessage"`
|
Description string `json:"Description"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetID returns the value of ID.
|
// GetID returns the value of ID.
|
||||||
@ -412,9 +412,9 @@ func (s *Mapfix) GetStatusID() int32 {
|
|||||||
return s.StatusID
|
return s.StatusID
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetStatusMessage returns the value of StatusMessage.
|
// GetDescription returns the value of Description.
|
||||||
func (s *Mapfix) GetStatusMessage() string {
|
func (s *Mapfix) GetDescription() string {
|
||||||
return s.StatusMessage
|
return s.Description
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetID sets the value of ID.
|
// SetID sets the value of ID.
|
||||||
@ -477,15 +477,16 @@ func (s *Mapfix) SetStatusID(val int32) {
|
|||||||
s.StatusID = val
|
s.StatusID = val
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetStatusMessage sets the value of StatusMessage.
|
// SetDescription sets the value of Description.
|
||||||
func (s *Mapfix) SetStatusMessage(val string) {
|
func (s *Mapfix) SetDescription(val string) {
|
||||||
s.StatusMessage = val
|
s.Description = val
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ref: #/components/schemas/MapfixTriggerCreate
|
// Ref: #/components/schemas/MapfixTriggerCreate
|
||||||
type MapfixTriggerCreate struct {
|
type MapfixTriggerCreate struct {
|
||||||
AssetID int64 `json:"AssetID"`
|
AssetID int64 `json:"AssetID"`
|
||||||
TargetAssetID int64 `json:"TargetAssetID"`
|
TargetAssetID int64 `json:"TargetAssetID"`
|
||||||
|
Description string `json:"Description"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetAssetID returns the value of AssetID.
|
// GetAssetID returns the value of AssetID.
|
||||||
@ -498,6 +499,11 @@ func (s *MapfixTriggerCreate) GetTargetAssetID() int64 {
|
|||||||
return s.TargetAssetID
|
return s.TargetAssetID
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetDescription returns the value of Description.
|
||||||
|
func (s *MapfixTriggerCreate) GetDescription() string {
|
||||||
|
return s.Description
|
||||||
|
}
|
||||||
|
|
||||||
// SetAssetID sets the value of AssetID.
|
// SetAssetID sets the value of AssetID.
|
||||||
func (s *MapfixTriggerCreate) SetAssetID(val int64) {
|
func (s *MapfixTriggerCreate) SetAssetID(val int64) {
|
||||||
s.AssetID = val
|
s.AssetID = val
|
||||||
@ -508,6 +514,11 @@ func (s *MapfixTriggerCreate) SetTargetAssetID(val int64) {
|
|||||||
s.TargetAssetID = val
|
s.TargetAssetID = val
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SetDescription sets the value of Description.
|
||||||
|
func (s *MapfixTriggerCreate) SetDescription(val string) {
|
||||||
|
s.Description = val
|
||||||
|
}
|
||||||
|
|
||||||
// Ref: #/components/schemas/Mapfixes
|
// Ref: #/components/schemas/Mapfixes
|
||||||
type Mapfixes struct {
|
type Mapfixes struct {
|
||||||
Total int64 `json:"Total"`
|
Total int64 `json:"Total"`
|
||||||
@ -1163,7 +1174,6 @@ type Submission struct {
|
|||||||
Completed bool `json:"Completed"`
|
Completed bool `json:"Completed"`
|
||||||
UploadedAssetID OptInt64 `json:"UploadedAssetID"`
|
UploadedAssetID OptInt64 `json:"UploadedAssetID"`
|
||||||
StatusID int32 `json:"StatusID"`
|
StatusID int32 `json:"StatusID"`
|
||||||
StatusMessage string `json:"StatusMessage"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetID returns the value of ID.
|
// GetID returns the value of ID.
|
||||||
@ -1236,11 +1246,6 @@ func (s *Submission) GetStatusID() int32 {
|
|||||||
return s.StatusID
|
return s.StatusID
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetStatusMessage returns the value of StatusMessage.
|
|
||||||
func (s *Submission) GetStatusMessage() string {
|
|
||||||
return s.StatusMessage
|
|
||||||
}
|
|
||||||
|
|
||||||
// SetID sets the value of ID.
|
// SetID sets the value of ID.
|
||||||
func (s *Submission) SetID(val int64) {
|
func (s *Submission) SetID(val int64) {
|
||||||
s.ID = val
|
s.ID = val
|
||||||
@ -1311,11 +1316,6 @@ func (s *Submission) SetStatusID(val int32) {
|
|||||||
s.StatusID = val
|
s.StatusID = val
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetStatusMessage sets the value of StatusMessage.
|
|
||||||
func (s *Submission) SetStatusMessage(val string) {
|
|
||||||
s.StatusMessage = val
|
|
||||||
}
|
|
||||||
|
|
||||||
// Ref: #/components/schemas/SubmissionTriggerCreate
|
// Ref: #/components/schemas/SubmissionTriggerCreate
|
||||||
type SubmissionTriggerCreate struct {
|
type SubmissionTriggerCreate struct {
|
||||||
AssetID int64 `json:"AssetID"`
|
AssetID int64 `json:"AssetID"`
|
||||||
|
@ -408,13 +408,13 @@ func (s *Mapfix) Validate() error {
|
|||||||
Email: false,
|
Email: false,
|
||||||
Hostname: false,
|
Hostname: false,
|
||||||
Regex: nil,
|
Regex: nil,
|
||||||
}).Validate(string(s.StatusMessage)); err != nil {
|
}).Validate(string(s.Description)); err != nil {
|
||||||
return errors.Wrap(err, "string")
|
return errors.Wrap(err, "string")
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}(); err != nil {
|
}(); err != nil {
|
||||||
failures = append(failures, validate.FieldError{
|
failures = append(failures, validate.FieldError{
|
||||||
Name: "StatusMessage",
|
Name: "Description",
|
||||||
Error: err,
|
Error: err,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -470,6 +470,25 @@ func (s *MapfixTriggerCreate) Validate() error {
|
|||||||
Error: err,
|
Error: err,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
if err := func() error {
|
||||||
|
if err := (validate.String{
|
||||||
|
MinLength: 0,
|
||||||
|
MinLengthSet: false,
|
||||||
|
MaxLength: 256,
|
||||||
|
MaxLengthSet: true,
|
||||||
|
Email: false,
|
||||||
|
Hostname: false,
|
||||||
|
Regex: nil,
|
||||||
|
}).Validate(string(s.Description)); err != nil {
|
||||||
|
return errors.Wrap(err, "string")
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}(); err != nil {
|
||||||
|
failures = append(failures, validate.FieldError{
|
||||||
|
Name: "Description",
|
||||||
|
Error: err,
|
||||||
|
})
|
||||||
|
}
|
||||||
if len(failures) > 0 {
|
if len(failures) > 0 {
|
||||||
return &validate.Error{Fields: failures}
|
return &validate.Error{Fields: failures}
|
||||||
}
|
}
|
||||||
@ -1751,25 +1770,6 @@ func (s *Submission) Validate() error {
|
|||||||
Error: err,
|
Error: err,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
if err := func() error {
|
|
||||||
if err := (validate.String{
|
|
||||||
MinLength: 0,
|
|
||||||
MinLengthSet: false,
|
|
||||||
MaxLength: 256,
|
|
||||||
MaxLengthSet: true,
|
|
||||||
Email: false,
|
|
||||||
Hostname: false,
|
|
||||||
Regex: nil,
|
|
||||||
}).Validate(string(s.StatusMessage)); err != nil {
|
|
||||||
return errors.Wrap(err, "string")
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}(); err != nil {
|
|
||||||
failures = append(failures, validate.FieldError{
|
|
||||||
Name: "StatusMessage",
|
|
||||||
Error: err,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
if len(failures) > 0 {
|
if len(failures) > 0 {
|
||||||
return &validate.Error{Fields: failures}
|
return &validate.Error{Fields: failures}
|
||||||
}
|
}
|
||||||
|
@ -166,9 +166,13 @@ func (s *MapfixCreate) encodeFields(e *jx.Encoder) {
|
|||||||
e.FieldStart("TargetAssetID")
|
e.FieldStart("TargetAssetID")
|
||||||
e.Int64(s.TargetAssetID)
|
e.Int64(s.TargetAssetID)
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
e.FieldStart("Description")
|
||||||
|
e.Str(s.Description)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var jsonFieldsNameOfMapfixCreate = [8]string{
|
var jsonFieldsNameOfMapfixCreate = [9]string{
|
||||||
0: "OperationID",
|
0: "OperationID",
|
||||||
1: "AssetOwner",
|
1: "AssetOwner",
|
||||||
2: "DisplayName",
|
2: "DisplayName",
|
||||||
@ -177,6 +181,7 @@ var jsonFieldsNameOfMapfixCreate = [8]string{
|
|||||||
5: "AssetID",
|
5: "AssetID",
|
||||||
6: "AssetVersion",
|
6: "AssetVersion",
|
||||||
7: "TargetAssetID",
|
7: "TargetAssetID",
|
||||||
|
8: "Description",
|
||||||
}
|
}
|
||||||
|
|
||||||
// Decode decodes MapfixCreate from json.
|
// Decode decodes MapfixCreate from json.
|
||||||
@ -184,7 +189,7 @@ func (s *MapfixCreate) Decode(d *jx.Decoder) error {
|
|||||||
if s == nil {
|
if s == nil {
|
||||||
return errors.New("invalid: unable to decode MapfixCreate to nil")
|
return errors.New("invalid: unable to decode MapfixCreate to nil")
|
||||||
}
|
}
|
||||||
var requiredBitSet [1]uint8
|
var requiredBitSet [2]uint8
|
||||||
|
|
||||||
if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
|
if err := d.ObjBytes(func(d *jx.Decoder, k []byte) error {
|
||||||
switch string(k) {
|
switch string(k) {
|
||||||
@ -284,6 +289,18 @@ func (s *MapfixCreate) Decode(d *jx.Decoder) error {
|
|||||||
}(); err != nil {
|
}(); err != nil {
|
||||||
return errors.Wrap(err, "decode field \"TargetAssetID\"")
|
return errors.Wrap(err, "decode field \"TargetAssetID\"")
|
||||||
}
|
}
|
||||||
|
case "Description":
|
||||||
|
requiredBitSet[1] |= 1 << 0
|
||||||
|
if err := func() error {
|
||||||
|
v, err := d.Str()
|
||||||
|
s.Description = string(v)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}(); err != nil {
|
||||||
|
return errors.Wrap(err, "decode field \"Description\"")
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
return d.Skip()
|
return d.Skip()
|
||||||
}
|
}
|
||||||
@ -293,8 +310,9 @@ func (s *MapfixCreate) Decode(d *jx.Decoder) error {
|
|||||||
}
|
}
|
||||||
// Validate required fields.
|
// Validate required fields.
|
||||||
var failures []validate.FieldError
|
var failures []validate.FieldError
|
||||||
for i, mask := range [1]uint8{
|
for i, mask := range [2]uint8{
|
||||||
0b11111111,
|
0b11111111,
|
||||||
|
0b00000001,
|
||||||
} {
|
} {
|
||||||
if result := (requiredBitSet[i] & mask) ^ mask; result != 0 {
|
if result := (requiredBitSet[i] & mask) ^ mask; result != 0 {
|
||||||
// Mask only required fields and check equality to mask using XOR.
|
// Mask only required fields and check equality to mask using XOR.
|
||||||
|
@ -106,6 +106,7 @@ type MapfixCreate struct {
|
|||||||
AssetID int64 `json:"AssetID"`
|
AssetID int64 `json:"AssetID"`
|
||||||
AssetVersion int64 `json:"AssetVersion"`
|
AssetVersion int64 `json:"AssetVersion"`
|
||||||
TargetAssetID int64 `json:"TargetAssetID"`
|
TargetAssetID int64 `json:"TargetAssetID"`
|
||||||
|
Description string `json:"Description"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetOperationID returns the value of OperationID.
|
// GetOperationID returns the value of OperationID.
|
||||||
@ -148,6 +149,11 @@ func (s *MapfixCreate) GetTargetAssetID() int64 {
|
|||||||
return s.TargetAssetID
|
return s.TargetAssetID
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetDescription returns the value of Description.
|
||||||
|
func (s *MapfixCreate) GetDescription() string {
|
||||||
|
return s.Description
|
||||||
|
}
|
||||||
|
|
||||||
// SetOperationID sets the value of OperationID.
|
// SetOperationID sets the value of OperationID.
|
||||||
func (s *MapfixCreate) SetOperationID(val int32) {
|
func (s *MapfixCreate) SetOperationID(val int32) {
|
||||||
s.OperationID = val
|
s.OperationID = val
|
||||||
@ -188,6 +194,11 @@ func (s *MapfixCreate) SetTargetAssetID(val int64) {
|
|||||||
s.TargetAssetID = val
|
s.TargetAssetID = val
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SetDescription sets the value of Description.
|
||||||
|
func (s *MapfixCreate) SetDescription(val string) {
|
||||||
|
s.Description = val
|
||||||
|
}
|
||||||
|
|
||||||
// Ref: #/components/schemas/MapfixID
|
// Ref: #/components/schemas/MapfixID
|
||||||
type MapfixID struct {
|
type MapfixID struct {
|
||||||
MapfixID int64 `json:"MapfixID"`
|
MapfixID int64 `json:"MapfixID"`
|
||||||
|
@ -227,6 +227,25 @@ func (s *MapfixCreate) Validate() error {
|
|||||||
Error: err,
|
Error: err,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
if err := func() error {
|
||||||
|
if err := (validate.String{
|
||||||
|
MinLength: 0,
|
||||||
|
MinLengthSet: false,
|
||||||
|
MaxLength: 256,
|
||||||
|
MaxLengthSet: true,
|
||||||
|
Email: false,
|
||||||
|
Hostname: false,
|
||||||
|
Regex: nil,
|
||||||
|
}).Validate(string(s.Description)); err != nil {
|
||||||
|
return errors.Wrap(err, "string")
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}(); err != nil {
|
||||||
|
failures = append(failures, validate.FieldError{
|
||||||
|
Name: "Description",
|
||||||
|
Error: err,
|
||||||
|
})
|
||||||
|
}
|
||||||
if len(failures) > 0 {
|
if len(failures) > 0 {
|
||||||
return &validate.Error{Fields: failures}
|
return &validate.Error{Fields: failures}
|
||||||
}
|
}
|
||||||
|
@ -39,4 +39,5 @@ type Mapfix struct {
|
|||||||
Completed bool // Has this version of the map been completed at least once on maptest
|
Completed bool // Has this version of the map been completed at least once on maptest
|
||||||
TargetAssetID uint64 // where to upload map fix. if the TargetAssetID is 0, it's a new map.
|
TargetAssetID uint64 // where to upload map fix. if the TargetAssetID is 0, it's a new map.
|
||||||
StatusID MapfixStatus
|
StatusID MapfixStatus
|
||||||
|
Description string // mapfix description
|
||||||
}
|
}
|
||||||
|
@ -15,6 +15,7 @@ type CreateMapfixRequest struct {
|
|||||||
OperationID int32
|
OperationID int32
|
||||||
ModelID uint64
|
ModelID uint64
|
||||||
TargetAssetID uint64
|
TargetAssetID uint64
|
||||||
|
Description string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -114,6 +114,7 @@ func (svc *Service) CreateMapfix(ctx context.Context, request *api.MapfixTrigger
|
|||||||
OperationID: operation.ID,
|
OperationID: operation.ID,
|
||||||
ModelID: ModelID,
|
ModelID: ModelID,
|
||||||
TargetAssetID: TargetAssetID,
|
TargetAssetID: TargetAssetID,
|
||||||
|
Description: request.Description,
|
||||||
}
|
}
|
||||||
|
|
||||||
j, err := json.Marshal(create_request)
|
j, err := json.Marshal(create_request)
|
||||||
@ -154,6 +155,7 @@ func (svc *Service) GetMapfix(ctx context.Context, params api.GetMapfixParams) (
|
|||||||
Completed: mapfix.Completed,
|
Completed: mapfix.Completed,
|
||||||
TargetAssetID: int64(mapfix.TargetAssetID),
|
TargetAssetID: int64(mapfix.TargetAssetID),
|
||||||
StatusID: int32(mapfix.StatusID),
|
StatusID: int32(mapfix.StatusID),
|
||||||
|
Description: mapfix.Description,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -213,6 +215,7 @@ func (svc *Service) ListMapfixes(ctx context.Context, params api.ListMapfixesPar
|
|||||||
Completed: item.Completed,
|
Completed: item.Completed,
|
||||||
TargetAssetID: int64(item.TargetAssetID),
|
TargetAssetID: int64(item.TargetAssetID),
|
||||||
StatusID: int32(item.StatusID),
|
StatusID: int32(item.StatusID),
|
||||||
|
Description: item.Description,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -347,6 +347,7 @@ func (svc *Service) CreateMapfix(ctx context.Context, request *internal.MapfixCr
|
|||||||
Completed: false,
|
Completed: false,
|
||||||
TargetAssetID: TargetAssetID,
|
TargetAssetID: TargetAssetID,
|
||||||
StatusID: model.MapfixStatusUnderConstruction,
|
StatusID: model.MapfixStatusUnderConstruction,
|
||||||
|
Description: request.Description,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
@ -73,6 +73,7 @@ pub struct CreateMapfixRequest<'a>{
|
|||||||
pub AssetID:u64,
|
pub AssetID:u64,
|
||||||
pub AssetVersion:u64,
|
pub AssetVersion:u64,
|
||||||
pub TargetAssetID:u64,
|
pub TargetAssetID:u64,
|
||||||
|
pub Description:&'a str,
|
||||||
}
|
}
|
||||||
#[allow(nonstandard_style)]
|
#[allow(nonstandard_style)]
|
||||||
#[derive(Clone,Debug,serde::Deserialize)]
|
#[derive(Clone,Debug,serde::Deserialize)]
|
||||||
|
@ -31,6 +31,7 @@ impl crate::message_handler::MessageHandler{
|
|||||||
AssetID:create_info.ModelID,
|
AssetID:create_info.ModelID,
|
||||||
AssetVersion:create_request.AssetVersion,
|
AssetVersion:create_request.AssetVersion,
|
||||||
TargetAssetID:create_info.TargetAssetID,
|
TargetAssetID:create_info.TargetAssetID,
|
||||||
|
Description:create_info.Description.as_str(),
|
||||||
}).await.map_err(Error::ApiActionMapfixCreate)?;
|
}).await.map_err(Error::ApiActionMapfixCreate)?;
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
|
@ -18,6 +18,7 @@ pub struct CreateMapfixRequest{
|
|||||||
pub OperationID:i32,
|
pub OperationID:i32,
|
||||||
pub ModelID:u64,
|
pub ModelID:u64,
|
||||||
pub TargetAssetID:u64,
|
pub TargetAssetID:u64,
|
||||||
|
pub Description:String,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(nonstandard_style)]
|
#[allow(nonstandard_style)]
|
||||||
|
@ -14,6 +14,7 @@ interface CreatorAndReviewStatus {
|
|||||||
review: MapfixInfo["StatusID"],
|
review: MapfixInfo["StatusID"],
|
||||||
submitter: MapfixInfo["Submitter"],
|
submitter: MapfixInfo["Submitter"],
|
||||||
target_asset_id: MapfixInfo["TargetAssetID"],
|
target_asset_id: MapfixInfo["TargetAssetID"],
|
||||||
|
description: MapfixInfo["Description"],
|
||||||
comments: Comment[],
|
comments: Comment[],
|
||||||
name: string
|
name: string
|
||||||
}
|
}
|
||||||
|
@ -54,6 +54,7 @@ function TitleAndComments(stats: CreatorAndReviewStatus) {
|
|||||||
<p className="submitter">Submitter {stats.submitter}</p>
|
<p className="submitter">Submitter {stats.submitter}</p>
|
||||||
<p className="asset-id">Model Asset ID {stats.asset_id}</p>
|
<p className="asset-id">Model Asset ID {stats.asset_id}</p>
|
||||||
<p className="target-asset-id">Target Asset ID {stats.target_asset_id}</p>
|
<p className="target-asset-id">Target Asset ID {stats.target_asset_id}</p>
|
||||||
|
<p className="description">Description: {stats.description}</p>
|
||||||
<span className="spacer"></span>
|
<span className="spacer"></span>
|
||||||
<Comments comments_data={stats}/>
|
<Comments comments_data={stats}/>
|
||||||
</main>
|
</main>
|
||||||
@ -85,7 +86,16 @@ export default function MapfixInfoPage() {
|
|||||||
<main className="map-page-main">
|
<main className="map-page-main">
|
||||||
<section className="review-section">
|
<section className="review-section">
|
||||||
<RatingArea mapfixId={dynamicId.mapfixId} mapfixStatus={mapfix.StatusID} mapfixSubmitter={mapfix.Submitter} mapfixAssetId={mapfix.AssetID} mapfixTargetAssetId={mapfix.TargetAssetID} />
|
<RatingArea mapfixId={dynamicId.mapfixId} mapfixStatus={mapfix.StatusID} mapfixSubmitter={mapfix.Submitter} mapfixAssetId={mapfix.AssetID} mapfixTargetAssetId={mapfix.TargetAssetID} />
|
||||||
<TitleAndComments name={mapfix.DisplayName} creator={mapfix.Creator} review={mapfix.StatusID} asset_id={mapfix.AssetID} submitter={mapfix.Submitter} target_asset_id={mapfix.TargetAssetID} comments={[]}/>
|
<TitleAndComments
|
||||||
|
name={mapfix.DisplayName}
|
||||||
|
creator={mapfix.Creator}
|
||||||
|
review={mapfix.StatusID}
|
||||||
|
asset_id={mapfix.AssetID}
|
||||||
|
submitter={mapfix.Submitter}
|
||||||
|
target_asset_id={mapfix.TargetAssetID}
|
||||||
|
description={mapfix.Description}
|
||||||
|
comments={[]}
|
||||||
|
/>
|
||||||
</section>
|
</section>
|
||||||
</main>
|
</main>
|
||||||
</Webpage>
|
</Webpage>
|
||||||
|
@ -11,6 +11,7 @@ import "./(styles)/page.scss"
|
|||||||
interface MapfixPayload {
|
interface MapfixPayload {
|
||||||
AssetID: number;
|
AssetID: number;
|
||||||
TargetAssetID: number;
|
TargetAssetID: number;
|
||||||
|
Description: string;
|
||||||
}
|
}
|
||||||
interface IdResponse {
|
interface IdResponse {
|
||||||
OperationID: number;
|
OperationID: number;
|
||||||
@ -28,6 +29,7 @@ export default function MapfixInfoPage() {
|
|||||||
const payload: MapfixPayload = {
|
const payload: MapfixPayload = {
|
||||||
AssetID: Number((formData.get("asset-id") as string) ?? "0"),
|
AssetID: Number((formData.get("asset-id") as string) ?? "0"),
|
||||||
TargetAssetID: Number(dynamicId.mapId),
|
TargetAssetID: Number(dynamicId.mapId),
|
||||||
|
Description: (formData.get("description") as string) ?? "unknown", // TEMPORARY! TODO: Change
|
||||||
};
|
};
|
||||||
|
|
||||||
console.log(payload)
|
console.log(payload)
|
||||||
@ -70,6 +72,7 @@ export default function MapfixInfoPage() {
|
|||||||
<form onSubmit={handleSubmit}>
|
<form onSubmit={handleSubmit}>
|
||||||
{/* TODO: Add form data for mapfixes, such as changes they did, and any times that need to be deleted & what styles */}
|
{/* TODO: Add form data for mapfixes, such as changes they did, and any times that need to be deleted & what styles */}
|
||||||
<TextField className="form-field" id="asset-id" name="asset-id" label="Asset ID" variant="outlined"/>
|
<TextField className="form-field" id="asset-id" name="asset-id" label="Asset ID" variant="outlined"/>
|
||||||
|
<TextField className="form-field" id="description" name="description" label="Describe the Mapfix" variant="outlined"/>
|
||||||
<span className="spacer form-spacer"></span>
|
<span className="spacer form-spacer"></span>
|
||||||
<Button type="submit" variant="contained" startIcon={<SendIcon/>} sx={{
|
<Button type="submit" variant="contained" startIcon={<SendIcon/>} sx={{
|
||||||
width: "400px",
|
width: "400px",
|
||||||
|
@ -26,6 +26,7 @@ interface MapfixInfo {
|
|||||||
readonly Completed: boolean,
|
readonly Completed: boolean,
|
||||||
readonly TargetAssetID: number,
|
readonly TargetAssetID: number,
|
||||||
readonly StatusID: MapfixStatus,
|
readonly StatusID: MapfixStatus,
|
||||||
|
readonly Description: string,
|
||||||
}
|
}
|
||||||
|
|
||||||
interface MapfixList {
|
interface MapfixList {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user