Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
da53b1a913 |
@@ -25,7 +25,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
echo "Creating version"
|
echo "Creating version"
|
||||||
|
|
||||||
VERSION="0.0.10"
|
VERSION="0.0.11"
|
||||||
PROJECT_COMMIT_HASH=$(git rev-parse HEAD | cut -c 1-10)
|
PROJECT_COMMIT_HASH=$(git rev-parse HEAD | cut -c 1-10)
|
||||||
BRANCH_REF="${{ gitea.ref }}"
|
BRANCH_REF="${{ gitea.ref }}"
|
||||||
BRANCH_NAME=$(echo "$BRANCH_REF" | cut -d '/' -f 3)
|
BRANCH_NAME=$(echo "$BRANCH_REF" | cut -d '/' -f 3)
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
package message
|
||||||
|
|
||||||
|
import (
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/google/uuid"
|
||||||
|
|
||||||
|
"git.kundeng.us/phoenix/textsender-models/tx0/types"
|
||||||
|
)
|
||||||
|
|
||||||
|
type MessageEventResponse struct {
|
||||||
|
Id uuid.UUID `json:"id,omitempty"`
|
||||||
|
ScheduledMessageEventId uuid.UUID `json:"scheduled_message_event_id,omitempty"`
|
||||||
|
Response types.JSONB `json:"response"`
|
||||||
|
UserId uuid.UUID `json:"user_id,omitempty"`
|
||||||
|
Sent time.Time `json:"sent"`
|
||||||
|
}
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
package types
|
||||||
|
|
||||||
|
import (
|
||||||
|
"database/sql/driver"
|
||||||
|
"encoding/json"
|
||||||
|
"fmt"
|
||||||
|
)
|
||||||
|
|
||||||
|
type JSONB json.RawMessage
|
||||||
|
|
||||||
|
// Scan implements sql.Scanner
|
||||||
|
func (j *JSONB) Scan(value interface{}) error {
|
||||||
|
if value == nil {
|
||||||
|
*j = nil
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
var data []byte
|
||||||
|
switch v := value.(type) {
|
||||||
|
case []byte:
|
||||||
|
// pgx may pass data as []byte in binary format
|
||||||
|
data = v
|
||||||
|
case string:
|
||||||
|
// pgx may pass data as string in text format
|
||||||
|
data = []byte(v)
|
||||||
|
default:
|
||||||
|
return fmt.Errorf("unsupported type: %T", v)
|
||||||
|
}
|
||||||
|
|
||||||
|
*j = JSONB(data)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// Value implements driver.Valuer
|
||||||
|
func (j JSONB) Value() (driver.Value, error) {
|
||||||
|
if j == nil {
|
||||||
|
return nil, nil
|
||||||
|
} else {
|
||||||
|
return []byte(j), nil
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user