From 6cb49cfac041dfd3f0eb715c3e5f1aa64c542634 Mon Sep 17 00:00:00 2001 From: Vernon Keenan Date: Sun, 19 Nov 2023 19:31:26 +0000 Subject: [PATCH] user bio slug --- api/auth/auth_models/user.go | 6 ++++++ api/members/members_models/user.go | 6 ++++++ api/research/research_models/company_product.go | 3 +++ api/research/research_models/company_service.go | 3 +++ api/sfgate/sfgate_models/company_product.go | 3 +++ api/sfgate/sfgate_models/company_service.go | 3 +++ api/sfgate/sfgate_models/user.go | 6 ++++++ app/auth.go | 4 ++-- app/force.go | 4 ++-- app/mysql.go | 3 +-- app/prometheus.go | 4 ++-- app/root.go | 4 ++-- app/user-helpers.go | 2 ++ app/user.go | 2 ++ swagger/auth-work.yaml | 6 ++++++ swagger/defs/company-product.yaml | 4 ++++ swagger/defs/company-service.yaml | 4 ++++ swagger/defs/user.yaml | 8 ++++++++ swagger/external/auth-work.yaml | 6 ++++++ swagger/external/sf-gate-work.yaml | 8 ++++++++ swagger/sf-gate-work.yaml | 8 ++++++++ 21 files changed, 87 insertions(+), 10 deletions(-) diff --git a/api/auth/auth_models/user.go b/api/auth/auth_models/user.go index 09a5256..d11865d 100644 --- a/api/auth/auth_models/user.go +++ b/api/auth/auth_models/user.go @@ -41,6 +41,9 @@ type User struct { // Auth0 User Id Auth0UserID string `json:"Auth0UserID,omitempty"` + // Biography + Biography string `json:"Biography,omitempty"` + // Nickname CommunityNickname string `json:"CommunityNickname,omitempty"` @@ -173,6 +176,9 @@ type User struct { // Email Signature Signature string `json:"Signature,omitempty"` + // Slug + Slug string `json:"Slug,omitempty"` + // Small Photo URL SmallPhotoURL string `json:"SmallPhotoURL,omitempty"` diff --git a/api/members/members_models/user.go b/api/members/members_models/user.go index ca63a40..689f67e 100644 --- a/api/members/members_models/user.go +++ b/api/members/members_models/user.go @@ -47,6 +47,9 @@ type User struct { // Auth0 User Id Auth0UserID *string `json:"Auth0UserID,omitempty"` + // Biography + Biography *string `json:"Biography,omitempty"` + // Nickname CommunityNickname *string `json:"CommunityNickname,omitempty"` @@ -173,6 +176,9 @@ type User struct { // Email Sender Name SenderName *string `json:"SenderName,omitempty"` + // Slug + Slug *string `json:"Slug,omitempty"` + // Small Photo URL SmallPhotoURL *string `json:"SmallPhotoURL,omitempty"` diff --git a/api/research/research_models/company_product.go b/api/research/research_models/company_product.go index f1d32f9..7735a96 100644 --- a/api/research/research_models/company_product.go +++ b/api/research/research_models/company_product.go @@ -89,6 +89,9 @@ type CompanyProduct struct { // Product Name Name *string `json:"Name,omitempty"` + // Owner ID + OwnerID *string `json:"OwnerID,omitempty"` + // Product Video ID ProductVideoID *string `json:"ProductVideoID,omitempty"` diff --git a/api/research/research_models/company_service.go b/api/research/research_models/company_service.go index 1cac380..67c771b 100644 --- a/api/research/research_models/company_service.go +++ b/api/research/research_models/company_service.go @@ -89,6 +89,9 @@ type CompanyService struct { // Service Name Name *string `json:"Name,omitempty"` + // Owner ID + OwnerID *string `json:"OwnerID,omitempty"` + // Published Published *bool `json:"Published,omitempty"` diff --git a/api/sfgate/sfgate_models/company_product.go b/api/sfgate/sfgate_models/company_product.go index ddbff92..545a3d9 100644 --- a/api/sfgate/sfgate_models/company_product.go +++ b/api/sfgate/sfgate_models/company_product.go @@ -89,6 +89,9 @@ type CompanyProduct struct { // Product Name Name *string `json:"Name,omitempty"` + // Owner ID + OwnerID *string `json:"OwnerID,omitempty"` + // Product Video ID ProductVideoID *string `json:"ProductVideoID,omitempty"` diff --git a/api/sfgate/sfgate_models/company_service.go b/api/sfgate/sfgate_models/company_service.go index 24bc95d..9d4dcdd 100644 --- a/api/sfgate/sfgate_models/company_service.go +++ b/api/sfgate/sfgate_models/company_service.go @@ -89,6 +89,9 @@ type CompanyService struct { // Service Name Name *string `json:"Name,omitempty"` + // Owner ID + OwnerID *string `json:"OwnerID,omitempty"` + // Published Published *bool `json:"Published,omitempty"` diff --git a/api/sfgate/sfgate_models/user.go b/api/sfgate/sfgate_models/user.go index dc713cf..5ccbc0b 100644 --- a/api/sfgate/sfgate_models/user.go +++ b/api/sfgate/sfgate_models/user.go @@ -47,6 +47,9 @@ type User struct { // Auth0 User Id Auth0UserID *string `json:"Auth0UserID,omitempty"` + // Biography + Biography *string `json:"Biography,omitempty"` + // Nickname CommunityNickname *string `json:"CommunityNickname,omitempty"` @@ -185,6 +188,9 @@ type User struct { // Email Signature Signature *string `json:"Signature,omitempty"` + // Slug + Slug *string `json:"Slug,omitempty"` + // Small Photo URL SmallPhotoURL *string `json:"SmallPhotoURL,omitempty"` diff --git a/app/auth.go b/app/auth.go index c542cac..011ffad 100644 --- a/app/auth.go +++ b/app/auth.go @@ -11,7 +11,7 @@ import ( // When called, ChechAPIUser assumes there is an "auth" service account in the // app configuration file. func CheckAPIUser(token *string) (*User, error) { - sugar.Debug("app.CheckAPIUser: 📥") + sugar.Debug("app.CheckAPIUser: 👉") if authUser == nil { authUser = &User{ APIKey: GetServiceAccount("auth").APIKey, @@ -33,6 +33,6 @@ func CheckAPIUser(token *string) (*User, error) { for _, itm := range response.Payload.Data { // single iteration execution 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 } diff --git a/app/force.go b/app/force.go index 521af2b..f6920ca 100644 --- a/app/force.go +++ b/app/force.go @@ -6,7 +6,7 @@ import ( // InitForce creates a salesforce connection using serviceAccountName func InitForce(serviceAccountName string) *force.API { - sugar.Infof("app.initForce: 📥 %s", serviceAccountName) + sugar.Infof("app.initForce: 👉 %s", serviceAccountName) acct := GetServiceAccount(serviceAccountName) theForce, err := force.Create( "v45.0", @@ -21,6 +21,6 @@ func InitForce(serviceAccountName string) *force.API { sugar.Errorf("app.InitForce: salesforce error: %s", err.Error()) return nil } - sugar.Info("app.InitForce: 👍 📤") + sugar.Info("app.InitForce: 👍 👈") return theForce } diff --git a/app/mysql.go b/app/mysql.go index 36db634..a8f0f30 100644 --- a/app/mysql.go +++ b/app/mysql.go @@ -11,7 +11,6 @@ import ( var MyDB *sql.DB // InitDB initializes the MySQL database using DSN information from the config file -// func InitDB() { var db *sql.DB var err error @@ -25,5 +24,5 @@ func InitDB() { return } MyDB = db - sugar.Debugf("app.InitDB: 👍 📤 %s", GetDBMS()) + sugar.Debugf("app.InitDB: 👍 👈 %s", GetDBMS()) } diff --git a/app/prometheus.go b/app/prometheus.go index ed6f341..b5eecab 100644 --- a/app/prometheus.go +++ b/app/prometheus.go @@ -41,7 +41,7 @@ func (lrw *metricResponseWriter) WriteHeader(code int) { // SetupPrometheusHandler enable CORS, handler metrics func SetupPrometheusHandler(handler http.Handler, app string) http.Handler { - sugar.Debug("app.SetupPrometheusHandler: 📥") + sugar.Debug("app.SetupPrometheusHandler: 👉") handleCORS := cors.AllowAll().Handler h := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { start := time.Now() @@ -62,6 +62,6 @@ func SetupPrometheusHandler(handler http.Handler, app string) http.Handler { sugar.Errorf("app.SetupPrometheusHandler: 💣 ⛔ %s", err.Error()) return nil } - sugar.Info("app.SetupPrometheusHandler: 👍 📤") + sugar.Info("app.SetupPrometheusHandler: 👍 👈") return handleCORS(h) } diff --git a/app/root.go b/app/root.go index 3072f33..2a3b935 100644 --- a/app/root.go +++ b/app/root.go @@ -29,7 +29,7 @@ func InitConfig(systemName string, initalLogLevel zapcore.Level) { return } sugar = logger.New(initalLogLevel) - sugar.Infof("app.InitConfig: 📥 %s", systemName) + sugar.Infof("app.InitConfig: 👉 %s", systemName) appViper.SetConfigType("yaml") appViper.SetConfigName(systemName) 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 = logger.New(GetLogLevel()) - sugar.Debugf("app.InitConfig: 👍 📤 serviceAccounts: %d", len(config.ServiceAccounts)) + sugar.Debugf("app.InitConfig: 👍 👈 serviceAccounts: %d", len(config.ServiceAccounts)) configured = true } diff --git a/app/user-helpers.go b/app/user-helpers.go index 4bf8b4b..5eb69df 100644 --- a/app/user-helpers.go +++ b/app/user-helpers.go @@ -42,6 +42,7 @@ func MarshalAuthUserToSwagger(obj *auth_models.User) *User { APIKey: obj.APIKey, Auth: httptransport.APIKeyAuth("X-API-Key", "header", obj.APIKey), Auth0UserID: obj.Auth0UserID, + Biography: obj.Biography, CommunityNickname: obj.CommunityNickname, CompanyName: obj.CompanyName, ContactID: obj.ContactID, @@ -85,6 +86,7 @@ func MarshalAuthUserToSwagger(obj *auth_models.User) *User { SenderEmail: obj.SenderEmail, SenderName: obj.SenderName, Signature: obj.Signature, + Slug: obj.Slug, SmallPhotoURL: obj.SmallPhotoURL, StartOfDay: obj.StartOfDay, TenantID: obj.TenantID, diff --git a/app/user.go b/app/user.go index a3b2293..400b978 100644 --- a/app/user.go +++ b/app/user.go @@ -21,6 +21,7 @@ type User struct { APIKey string Auth runtime.ClientAuthInfoWriter Auth0UserID string + Biography string CommunityNickname string CompanyName string ContactID string @@ -64,6 +65,7 @@ type User struct { SenderEmail string SenderName string Signature string + Slug string SmallPhotoURL string StartOfDay string ExternalAccount string diff --git a/swagger/auth-work.yaml b/swagger/auth-work.yaml index 4cc61b3..e7aaf74 100644 --- a/swagger/auth-work.yaml +++ b/swagger/auth-work.yaml @@ -167,6 +167,9 @@ definitions: Auth0UserID: description: Auth0 User Id type: string + Biography: + description: Biography + type: string CommunityNickname: description: Nickname type: string @@ -296,6 +299,9 @@ definitions: Signature: description: Email Signature type: string + Slug: + description: Slug + type: string SmallPhotoURL: description: Small Photo URL type: string diff --git a/swagger/defs/company-product.yaml b/swagger/defs/company-product.yaml index 06f8351..e201b1a 100644 --- a/swagger/defs/company-product.yaml +++ b/swagger/defs/company-product.yaml @@ -90,6 +90,10 @@ CompanyProduct: description: Product Name type: string x-nullable: true + OwnerID: + description: Owner ID + type: string + x-nullable: true ProductVideoID: description: Product Video ID type: string diff --git a/swagger/defs/company-service.yaml b/swagger/defs/company-service.yaml index 1f4b50f..73a13c9 100644 --- a/swagger/defs/company-service.yaml +++ b/swagger/defs/company-service.yaml @@ -89,6 +89,10 @@ CompanyService: description: Service Name type: string x-nullable: true + OwnerID: + description: Owner ID + type: string + x-nullable: true Published: description: Published type: boolean diff --git a/swagger/defs/user.yaml b/swagger/defs/user.yaml index 1f1e288..a3a19ea 100644 --- a/swagger/defs/user.yaml +++ b/swagger/defs/user.yaml @@ -31,6 +31,10 @@ User: description: Auth0 User Id type: string x-nullable: true + Biography: + description: Biography + type: string + x-nullable: true CommunityNickname: description: Nickname type: string @@ -194,6 +198,10 @@ User: description: Email Sender Name type: string x-nullable: true + Slug: + description: Slug + type: string + x-nullable: true SmallPhotoURL: description: Small Photo URL type: string diff --git a/swagger/external/auth-work.yaml b/swagger/external/auth-work.yaml index 208ac93..4f90f9e 100644 --- a/swagger/external/auth-work.yaml +++ b/swagger/external/auth-work.yaml @@ -167,6 +167,9 @@ definitions: Auth0UserID: description: Auth0 User Id type: string + Biography: + description: Biography + type: string CommunityNickname: description: Nickname type: string @@ -296,6 +299,9 @@ definitions: Signature: description: Email Signature type: string + Slug: + description: Slug + type: string SmallPhotoURL: description: Small Photo URL type: string diff --git a/swagger/external/sf-gate-work.yaml b/swagger/external/sf-gate-work.yaml index db7f4a7..e2623f5 100644 --- a/swagger/external/sf-gate-work.yaml +++ b/swagger/external/sf-gate-work.yaml @@ -4808,6 +4808,10 @@ definitions: description: Auth0 User Id type: string x-nullable: true + Biography: + description: Biography + type: string + x-nullable: true CommunityNickname: description: Nickname type: string @@ -4987,6 +4991,10 @@ definitions: description: Email Signature type: string x-nullable: true + Slug: + description: Slug + type: string + x-nullable: true SmallPhotoURL: description: Small Photo URL type: string diff --git a/swagger/sf-gate-work.yaml b/swagger/sf-gate-work.yaml index fc94a34..7418afe 100644 --- a/swagger/sf-gate-work.yaml +++ b/swagger/sf-gate-work.yaml @@ -4808,6 +4808,10 @@ definitions: description: Auth0 User Id type: string x-nullable: true + Biography: + description: Biography + type: string + x-nullable: true CommunityNickname: description: Nickname type: string @@ -4987,6 +4991,10 @@ definitions: description: Email Signature type: string x-nullable: true + Slug: + description: Slug + type: string + x-nullable: true SmallPhotoURL: description: Small Photo URL type: string