backend api, swagger, tooling, frontend skeleton
This commit is contained in:
@@ -4,6 +4,8 @@ import (
|
||||
"time"
|
||||
|
||||
"entgo.io/ent"
|
||||
"entgo.io/ent/dialect/entsql"
|
||||
"entgo.io/ent/schema"
|
||||
"entgo.io/ent/schema/edge"
|
||||
"entgo.io/ent/schema/field"
|
||||
"github.com/google/uuid"
|
||||
@@ -48,12 +50,20 @@ func (PieceJointe) Fields() []ent.Field {
|
||||
}
|
||||
}
|
||||
|
||||
// Annotations pour le nom de table.
|
||||
func (PieceJointe) Annotations() []schema.Annotation {
|
||||
return []schema.Annotation{
|
||||
entsql.Annotation{Table: "piece_jointe"},
|
||||
}
|
||||
}
|
||||
|
||||
// Edges de l'entite PieceJointe.
|
||||
func (PieceJointe) Edges() []ent.Edge {
|
||||
return []ent.Edge{
|
||||
edge.From("objet", Objet.Type).
|
||||
Ref("pieces_jointes").
|
||||
Unique().
|
||||
Field("objet_id"),
|
||||
Field("objet_id").
|
||||
Required(),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user