Added freely editable description_name field to channel

This commit is contained in:
2023-01-13 12:43:20 +01:00
parent 3343285761
commit e49d9159e4
11 changed files with 217 additions and 12 deletions

View File

@@ -12,6 +12,7 @@ type Channel struct {
OwnerUserID UserID
InternalName string
DisplayName string
DescriptionName *string
SubscribeKey string
SendKey string
TimestampCreated time.Time
@@ -25,6 +26,7 @@ func (c Channel) JSON(includeKey bool) ChannelJSON {
OwnerUserID: c.OwnerUserID,
InternalName: c.InternalName,
DisplayName: c.DisplayName,
DescriptionName: c.DescriptionName,
SubscribeKey: langext.Conditional(includeKey, langext.Ptr(c.SubscribeKey), nil),
SendKey: langext.Conditional(includeKey, langext.Ptr(c.SendKey), nil),
TimestampCreated: c.TimestampCreated.Format(time.RFC3339Nano),
@@ -61,6 +63,7 @@ type ChannelJSON struct {
OwnerUserID UserID `json:"owner_user_id"`
InternalName string `json:"internal_name"`
DisplayName string `json:"display_name"`
DescriptionName *string `json:"description_name"`
SubscribeKey *string `json:"subscribe_key"` // can be nil, depending on endpoint
SendKey *string `json:"send_key"` // can be nil, depending on endpoint
TimestampCreated string `json:"timestamp_created"`
@@ -78,6 +81,7 @@ type ChannelDB struct {
OwnerUserID UserID `db:"owner_user_id"`
InternalName string `db:"internal_name"`
DisplayName string `db:"display_name"`
DescriptionName *string `db:"description_name"`
SubscribeKey string `db:"subscribe_key"`
SendKey string `db:"send_key"`
TimestampCreated int64 `db:"timestamp_created"`
@@ -92,6 +96,7 @@ func (c ChannelDB) Model() Channel {
OwnerUserID: c.OwnerUserID,
InternalName: c.InternalName,
DisplayName: c.DisplayName,
DescriptionName: c.DescriptionName,
SubscribeKey: c.SubscribeKey,
SendKey: c.SendKey,
TimestampCreated: time.UnixMilli(c.TimestampCreated),

View File

@@ -53,7 +53,7 @@ type DeliveryJSON struct {
ReceiverUserID UserID `json:"receiver_user_id"`
ReceiverClientID ClientID `json:"receiver_client_id"`
TimestampCreated string `json:"timestamp_created"`
TimestampFinalized *string `json:"tiestamp_finalized"`
TimestampFinalized *string `json:"timestamp_finalized"`
Status DeliveryStatus `json:"status"`
RetryCount int `json:"retry_count"`
NextDelivery *string `json:"next_delivery"`
@@ -66,7 +66,7 @@ type DeliveryDB struct {
ReceiverUserID UserID `db:"receiver_user_id"`
ReceiverClientID ClientID `db:"receiver_client_id"`
TimestampCreated int64 `db:"timestamp_created"`
TimestampFinalized *int64 `db:"tiestamp_finalized"`
TimestampFinalized *int64 `db:"timestamp_finalized"`
Status DeliveryStatus `db:"status"`
RetryCount int `db:"retry_count"`
NextDelivery *int64 `db:"next_delivery"`

View File

@@ -95,6 +95,10 @@ func (u User) MaxChannelNameLength() int {
return 120
}
func (u User) MaxChannelDescriptionNameLength() int {
return 300
}
func (u User) MaxSenderName() int {
return 120
}