user bio slug

0.2.5 v0.2.5
Vernon Keenan 2023-11-19 19:31:26 +00:00
parent 592dec5cf9
commit 6cb49cfac0
21 changed files with 87 additions and 10 deletions

View File

@ -41,6 +41,9 @@ type User struct {
// Auth0 User Id // Auth0 User Id
Auth0UserID string `json:"Auth0UserID,omitempty"` Auth0UserID string `json:"Auth0UserID,omitempty"`
// Biography
Biography string `json:"Biography,omitempty"`
// Nickname // Nickname
CommunityNickname string `json:"CommunityNickname,omitempty"` CommunityNickname string `json:"CommunityNickname,omitempty"`
@ -173,6 +176,9 @@ type User struct {
// Email Signature // Email Signature
Signature string `json:"Signature,omitempty"` Signature string `json:"Signature,omitempty"`
// Slug
Slug string `json:"Slug,omitempty"`
// Small Photo URL // Small Photo URL
SmallPhotoURL string `json:"SmallPhotoURL,omitempty"` SmallPhotoURL string `json:"SmallPhotoURL,omitempty"`

View File

@ -47,6 +47,9 @@ type User struct {
// Auth0 User Id // Auth0 User Id
Auth0UserID *string `json:"Auth0UserID,omitempty"` Auth0UserID *string `json:"Auth0UserID,omitempty"`
// Biography
Biography *string `json:"Biography,omitempty"`
// Nickname // Nickname
CommunityNickname *string `json:"CommunityNickname,omitempty"` CommunityNickname *string `json:"CommunityNickname,omitempty"`
@ -173,6 +176,9 @@ type User struct {
// Email Sender Name // Email Sender Name
SenderName *string `json:"SenderName,omitempty"` SenderName *string `json:"SenderName,omitempty"`
// Slug
Slug *string `json:"Slug,omitempty"`
// Small Photo URL // Small Photo URL
SmallPhotoURL *string `json:"SmallPhotoURL,omitempty"` SmallPhotoURL *string `json:"SmallPhotoURL,omitempty"`

View File

@ -89,6 +89,9 @@ type CompanyProduct struct {
// Product Name // Product Name
Name *string `json:"Name,omitempty"` Name *string `json:"Name,omitempty"`
// Owner ID
OwnerID *string `json:"OwnerID,omitempty"`
// Product Video ID // Product Video ID
ProductVideoID *string `json:"ProductVideoID,omitempty"` ProductVideoID *string `json:"ProductVideoID,omitempty"`

View File

@ -89,6 +89,9 @@ type CompanyService struct {
// Service Name // Service Name
Name *string `json:"Name,omitempty"` Name *string `json:"Name,omitempty"`
// Owner ID
OwnerID *string `json:"OwnerID,omitempty"`
// Published // Published
Published *bool `json:"Published,omitempty"` Published *bool `json:"Published,omitempty"`

View File

@ -89,6 +89,9 @@ type CompanyProduct struct {
// Product Name // Product Name
Name *string `json:"Name,omitempty"` Name *string `json:"Name,omitempty"`
// Owner ID
OwnerID *string `json:"OwnerID,omitempty"`
// Product Video ID // Product Video ID
ProductVideoID *string `json:"ProductVideoID,omitempty"` ProductVideoID *string `json:"ProductVideoID,omitempty"`

View File

@ -89,6 +89,9 @@ type CompanyService struct {
// Service Name // Service Name
Name *string `json:"Name,omitempty"` Name *string `json:"Name,omitempty"`
// Owner ID
OwnerID *string `json:"OwnerID,omitempty"`
// Published // Published
Published *bool `json:"Published,omitempty"` Published *bool `json:"Published,omitempty"`

View File

@ -47,6 +47,9 @@ type User struct {
// Auth0 User Id // Auth0 User Id
Auth0UserID *string `json:"Auth0UserID,omitempty"` Auth0UserID *string `json:"Auth0UserID,omitempty"`
// Biography
Biography *string `json:"Biography,omitempty"`
// Nickname // Nickname
CommunityNickname *string `json:"CommunityNickname,omitempty"` CommunityNickname *string `json:"CommunityNickname,omitempty"`
@ -185,6 +188,9 @@ type User struct {
// Email Signature // Email Signature
Signature *string `json:"Signature,omitempty"` Signature *string `json:"Signature,omitempty"`
// Slug
Slug *string `json:"Slug,omitempty"`
// Small Photo URL // Small Photo URL
SmallPhotoURL *string `json:"SmallPhotoURL,omitempty"` SmallPhotoURL *string `json:"SmallPhotoURL,omitempty"`

View File

@ -11,7 +11,7 @@ import (
// When called, ChechAPIUser assumes there is an "auth" service account in the // When called, ChechAPIUser assumes there is an "auth" service account in the
// app configuration file. // app configuration file.
func CheckAPIUser(token *string) (*User, error) { func CheckAPIUser(token *string) (*User, error) {
sugar.Debug("app.CheckAPIUser: 📥") sugar.Debug("app.CheckAPIUser: 👉")
if authUser == nil { if authUser == nil {
authUser = &User{ authUser = &User{
APIKey: GetServiceAccount("auth").APIKey, APIKey: GetServiceAccount("auth").APIKey,
@ -33,6 +33,6 @@ func CheckAPIUser(token *string) (*User, error) {
for _, itm := range response.Payload.Data { // single iteration execution for _, itm := range response.Payload.Data { // single iteration execution
obj = itm obj = itm
} }
sugar.Debugf("app.CheckAPIUser: 📤 👍 ID = %s, Name = %s", obj.ID, obj.Name) sugar.Debugf("app.CheckAPIUser: 👈 👍 ID = %s, Name = %s", obj.ID, obj.Name)
return MarshalAuthUserToSwagger(obj), nil return MarshalAuthUserToSwagger(obj), nil
} }

View File

@ -6,7 +6,7 @@ import (
// InitForce creates a salesforce connection using serviceAccountName // InitForce creates a salesforce connection using serviceAccountName
func InitForce(serviceAccountName string) *force.API { func InitForce(serviceAccountName string) *force.API {
sugar.Infof("app.initForce: 📥 %s", serviceAccountName) sugar.Infof("app.initForce: 👉 %s", serviceAccountName)
acct := GetServiceAccount(serviceAccountName) acct := GetServiceAccount(serviceAccountName)
theForce, err := force.Create( theForce, err := force.Create(
"v45.0", "v45.0",
@ -21,6 +21,6 @@ func InitForce(serviceAccountName string) *force.API {
sugar.Errorf("app.InitForce: salesforce error: %s", err.Error()) sugar.Errorf("app.InitForce: salesforce error: %s", err.Error())
return nil return nil
} }
sugar.Info("app.InitForce: 👍 📤") sugar.Info("app.InitForce: 👍 👈")
return theForce return theForce
} }

View File

@ -11,7 +11,6 @@ import (
var MyDB *sql.DB var MyDB *sql.DB
// InitDB initializes the MySQL database using DSN information from the config file // InitDB initializes the MySQL database using DSN information from the config file
//
func InitDB() { func InitDB() {
var db *sql.DB var db *sql.DB
var err error var err error
@ -25,5 +24,5 @@ func InitDB() {
return return
} }
MyDB = db MyDB = db
sugar.Debugf("app.InitDB: 👍 📤 %s", GetDBMS()) sugar.Debugf("app.InitDB: 👍 👈 %s", GetDBMS())
} }

View File

@ -41,7 +41,7 @@ func (lrw *metricResponseWriter) WriteHeader(code int) {
// SetupPrometheusHandler enable CORS, handler metrics // SetupPrometheusHandler enable CORS, handler metrics
func SetupPrometheusHandler(handler http.Handler, app string) http.Handler { func SetupPrometheusHandler(handler http.Handler, app string) http.Handler {
sugar.Debug("app.SetupPrometheusHandler: 📥") sugar.Debug("app.SetupPrometheusHandler: 👉")
handleCORS := cors.AllowAll().Handler handleCORS := cors.AllowAll().Handler
h := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { h := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
start := time.Now() start := time.Now()
@ -62,6 +62,6 @@ func SetupPrometheusHandler(handler http.Handler, app string) http.Handler {
sugar.Errorf("app.SetupPrometheusHandler: 💣 ⛔ %s", err.Error()) sugar.Errorf("app.SetupPrometheusHandler: 💣 ⛔ %s", err.Error())
return nil return nil
} }
sugar.Info("app.SetupPrometheusHandler: 👍 📤") sugar.Info("app.SetupPrometheusHandler: 👍 👈")
return handleCORS(h) return handleCORS(h)
} }

View File

@ -29,7 +29,7 @@ func InitConfig(systemName string, initalLogLevel zapcore.Level) {
return return
} }
sugar = logger.New(initalLogLevel) sugar = logger.New(initalLogLevel)
sugar.Infof("app.InitConfig: 📥 %s", systemName) sugar.Infof("app.InitConfig: 👉 %s", systemName)
appViper.SetConfigType("yaml") appViper.SetConfigType("yaml")
appViper.SetConfigName(systemName) appViper.SetConfigName(systemName)
appViper.AddConfigPath("/etc/work") appViper.AddConfigPath("/etc/work")
@ -45,6 +45,6 @@ func InitConfig(systemName string, initalLogLevel zapcore.Level) {
sugar.Fatalf("app.InitConfig: 💣 ⛔ can't unmarshal system config: %w", err) sugar.Fatalf("app.InitConfig: 💣 ⛔ can't unmarshal system config: %w", err)
} }
sugar = logger.New(GetLogLevel()) sugar = logger.New(GetLogLevel())
sugar.Debugf("app.InitConfig: 👍 📤 serviceAccounts: %d", len(config.ServiceAccounts)) sugar.Debugf("app.InitConfig: 👍 👈 serviceAccounts: %d", len(config.ServiceAccounts))
configured = true configured = true
} }

View File

@ -42,6 +42,7 @@ func MarshalAuthUserToSwagger(obj *auth_models.User) *User {
APIKey: obj.APIKey, APIKey: obj.APIKey,
Auth: httptransport.APIKeyAuth("X-API-Key", "header", obj.APIKey), Auth: httptransport.APIKeyAuth("X-API-Key", "header", obj.APIKey),
Auth0UserID: obj.Auth0UserID, Auth0UserID: obj.Auth0UserID,
Biography: obj.Biography,
CommunityNickname: obj.CommunityNickname, CommunityNickname: obj.CommunityNickname,
CompanyName: obj.CompanyName, CompanyName: obj.CompanyName,
ContactID: obj.ContactID, ContactID: obj.ContactID,
@ -85,6 +86,7 @@ func MarshalAuthUserToSwagger(obj *auth_models.User) *User {
SenderEmail: obj.SenderEmail, SenderEmail: obj.SenderEmail,
SenderName: obj.SenderName, SenderName: obj.SenderName,
Signature: obj.Signature, Signature: obj.Signature,
Slug: obj.Slug,
SmallPhotoURL: obj.SmallPhotoURL, SmallPhotoURL: obj.SmallPhotoURL,
StartOfDay: obj.StartOfDay, StartOfDay: obj.StartOfDay,
TenantID: obj.TenantID, TenantID: obj.TenantID,

View File

@ -21,6 +21,7 @@ type User struct {
APIKey string APIKey string
Auth runtime.ClientAuthInfoWriter Auth runtime.ClientAuthInfoWriter
Auth0UserID string Auth0UserID string
Biography string
CommunityNickname string CommunityNickname string
CompanyName string CompanyName string
ContactID string ContactID string
@ -64,6 +65,7 @@ type User struct {
SenderEmail string SenderEmail string
SenderName string SenderName string
Signature string Signature string
Slug string
SmallPhotoURL string SmallPhotoURL string
StartOfDay string StartOfDay string
ExternalAccount string ExternalAccount string

View File

@ -167,6 +167,9 @@ definitions:
Auth0UserID: Auth0UserID:
description: Auth0 User Id description: Auth0 User Id
type: string type: string
Biography:
description: Biography
type: string
CommunityNickname: CommunityNickname:
description: Nickname description: Nickname
type: string type: string
@ -296,6 +299,9 @@ definitions:
Signature: Signature:
description: Email Signature description: Email Signature
type: string type: string
Slug:
description: Slug
type: string
SmallPhotoURL: SmallPhotoURL:
description: Small Photo URL description: Small Photo URL
type: string type: string

View File

@ -90,6 +90,10 @@ CompanyProduct:
description: Product Name description: Product Name
type: string type: string
x-nullable: true x-nullable: true
OwnerID:
description: Owner ID
type: string
x-nullable: true
ProductVideoID: ProductVideoID:
description: Product Video ID description: Product Video ID
type: string type: string

View File

@ -89,6 +89,10 @@ CompanyService:
description: Service Name description: Service Name
type: string type: string
x-nullable: true x-nullable: true
OwnerID:
description: Owner ID
type: string
x-nullable: true
Published: Published:
description: Published description: Published
type: boolean type: boolean

View File

@ -31,6 +31,10 @@ User:
description: Auth0 User Id description: Auth0 User Id
type: string type: string
x-nullable: true x-nullable: true
Biography:
description: Biography
type: string
x-nullable: true
CommunityNickname: CommunityNickname:
description: Nickname description: Nickname
type: string type: string
@ -194,6 +198,10 @@ User:
description: Email Sender Name description: Email Sender Name
type: string type: string
x-nullable: true x-nullable: true
Slug:
description: Slug
type: string
x-nullable: true
SmallPhotoURL: SmallPhotoURL:
description: Small Photo URL description: Small Photo URL
type: string type: string

View File

@ -167,6 +167,9 @@ definitions:
Auth0UserID: Auth0UserID:
description: Auth0 User Id description: Auth0 User Id
type: string type: string
Biography:
description: Biography
type: string
CommunityNickname: CommunityNickname:
description: Nickname description: Nickname
type: string type: string
@ -296,6 +299,9 @@ definitions:
Signature: Signature:
description: Email Signature description: Email Signature
type: string type: string
Slug:
description: Slug
type: string
SmallPhotoURL: SmallPhotoURL:
description: Small Photo URL description: Small Photo URL
type: string type: string

View File

@ -4808,6 +4808,10 @@ definitions:
description: Auth0 User Id description: Auth0 User Id
type: string type: string
x-nullable: true x-nullable: true
Biography:
description: Biography
type: string
x-nullable: true
CommunityNickname: CommunityNickname:
description: Nickname description: Nickname
type: string type: string
@ -4987,6 +4991,10 @@ definitions:
description: Email Signature description: Email Signature
type: string type: string
x-nullable: true x-nullable: true
Slug:
description: Slug
type: string
x-nullable: true
SmallPhotoURL: SmallPhotoURL:
description: Small Photo URL description: Small Photo URL
type: string type: string

View File

@ -4808,6 +4808,10 @@ definitions:
description: Auth0 User Id description: Auth0 User Id
type: string type: string
x-nullable: true x-nullable: true
Biography:
description: Biography
type: string
x-nullable: true
CommunityNickname: CommunityNickname:
description: Nickname description: Nickname
type: string type: string
@ -4987,6 +4991,10 @@ definitions:
description: Email Signature description: Email Signature
type: string type: string
x-nullable: true x-nullable: true
Slug:
description: Slug
type: string
x-nullable: true
SmallPhotoURL: SmallPhotoURL:
description: Small Photo URL description: Small Photo URL
type: string type: string