parent
592dec5cf9
commit
6cb49cfac0
|
@ -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"`
|
||||
|
||||
|
|
|
@ -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"`
|
||||
|
||||
|
|
|
@ -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"`
|
||||
|
||||
|
|
|
@ -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"`
|
||||
|
||||
|
|
|
@ -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"`
|
||||
|
||||
|
|
|
@ -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"`
|
||||
|
||||
|
|
|
@ -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"`
|
||||
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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())
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue