commented utms methods
This commit is contained in:
parent
b898091905
commit
6bd772ee23
36
model/amo.go
36
model/amo.go
@ -141,7 +141,7 @@ type Rule struct {
|
||||
/* - айдишник этапа*/
|
||||
Stepid int32 `json:"StepID"`
|
||||
/* - список UTM для этого опроса*/
|
||||
Utms []int32 `json:"UTMs"`
|
||||
//Utms []int32 `json:"UTMs"`
|
||||
/* - правила заполнения полей сущностей в амо*/
|
||||
Fieldsrule Fieldsrule `json:"FieldsRule"`
|
||||
/* - флаг мягкого удаления*/
|
||||
@ -197,22 +197,22 @@ const (
|
||||
TypeContactAddress ContactQuizConfig = "address"
|
||||
)
|
||||
|
||||
type UTM struct {
|
||||
/* - айдишник в нашей системе Primary Key*/
|
||||
ID int64 `json:"ID"`
|
||||
/* - айдишник кастомного поля в амо*/
|
||||
Amofieldid int32 `json:"AmoFieldID"`
|
||||
/* - айдишник квиза*/
|
||||
Quizid int32 `json:"QuizID"`
|
||||
/* - связь с аккаунтом в интеграции амо id амо*/
|
||||
Accountid int32 `json:"AccountID"`
|
||||
/* - название тега в амо*/
|
||||
Name string `json:"Name"`
|
||||
/* - флаг мягкого удаления*/
|
||||
Deleted bool `json:"Deleted"`
|
||||
/* - таймштамп создания тега в нашей системе*/
|
||||
Createdat int64 `json:"CreatedAt"`
|
||||
}
|
||||
//type UTM struct {
|
||||
// /* - айдишник в нашей системе Primary Key*/
|
||||
// ID int64 `json:"ID"`
|
||||
// /* - айдишник кастомного поля в амо*/
|
||||
// Amofieldid int32 `json:"AmoFieldID"`
|
||||
// /* - айдишник квиза*/
|
||||
// Quizid int32 `json:"QuizID"`
|
||||
// /* - связь с аккаунтом в интеграции амо id амо*/
|
||||
// Accountid int32 `json:"AccountID"`
|
||||
// /* - название тега в амо*/
|
||||
// Name string `json:"Name"`
|
||||
// /* - флаг мягкого удаления*/
|
||||
// Deleted bool `json:"Deleted"`
|
||||
// /* - таймштамп создания тега в нашей системе*/
|
||||
// Createdat int64 `json:"CreatedAt"`
|
||||
//}
|
||||
|
||||
type FieldType string
|
||||
|
||||
@ -268,7 +268,7 @@ type AmoUsersTrueResults struct {
|
||||
Session string
|
||||
AccessToken string
|
||||
AmoAccountID int32
|
||||
UTMs []int32
|
||||
UTMs UTMSavingMap
|
||||
FieldsRule Fieldsrule
|
||||
PerformerID int32
|
||||
StepID int32
|
||||
|
@ -16,11 +16,11 @@ type RulesReq struct {
|
||||
PerformerID int32 // айдишник ответственного за сделку
|
||||
PipelineID int32 // айдишник воронки
|
||||
StepID int32 // айдишник этапа
|
||||
Utms []int32 // список UTM для этого опроса
|
||||
//Utms []int32 // список UTM для этого опроса
|
||||
Fieldsrule Fieldsrule // правила заполнения полей сущностей в амо
|
||||
}
|
||||
|
||||
type SaveUserListUTMReq struct {
|
||||
/* - список utm для сохранения. сохранять только те, которых в этом аккаунте ещё нет*/
|
||||
Utms []UTM `json:"utms"`
|
||||
}
|
||||
//type SaveUserListUTMReq struct {
|
||||
// /* - список utm для сохранения. сохранять только те, которых в этом аккаунте ещё нет*/
|
||||
// Utms []UTM `json:"utms"`
|
||||
//}
|
||||
|
@ -24,12 +24,12 @@ type GetCurrentAccountResp struct {
|
||||
Createdat int64 `json:"CreatedAt"`
|
||||
}
|
||||
|
||||
type GetListUserUTMResp struct {
|
||||
/* - общее количество юзеров, которые у нас закешированы для этого пользователя*/
|
||||
Count int64 `json:"count"`
|
||||
/* - список юзеров, которые были закешированы нашим сервисом*/
|
||||
Items []UTM `json:"items"`
|
||||
}
|
||||
//type GetListUserUTMResp struct {
|
||||
// /* - общее количество юзеров, которые у нас закешированы для этого пользователя*/
|
||||
// Count int64 `json:"count"`
|
||||
// /* - список юзеров, которые были закешированы нашим сервисом*/
|
||||
// Items []UTM `json:"items"`
|
||||
//}
|
||||
|
||||
type ListSavedIDUTMResp struct {
|
||||
/* - список айдишников сохранённых меток*/
|
||||
|
@ -899,7 +899,7 @@ func (r *AmoRepository) DeletingUserUtm(ctx context.Context, request *model.List
|
||||
}
|
||||
|
||||
// todo нужно ли тут ограничивать индексом что то
|
||||
func (r *AmoRepository) SavingUserUtm(ctx context.Context, utms []model.UTM, accountID string) (*model.ListSavedIDUTMResp, error) {
|
||||
//func (r *AmoRepository) SavingUserUtm(ctx context.Context, utms []model.UTM, accountID string) (*model.ListSavedIDUTMResp, error) {
|
||||
// column2, err := json.Marshal(utms)
|
||||
// if err != nil {
|
||||
// return nil, err
|
||||
@ -918,11 +918,11 @@ func (r *AmoRepository) SavingUserUtm(ctx context.Context, utms []model.UTM, acc
|
||||
// return &model.ListSavedIDUTMResp{
|
||||
// Ids: ids,
|
||||
// }, nil
|
||||
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func (r *AmoRepository) GettingUserUtm(ctx context.Context, request *model.PaginationReq, accountID string, quizID int) (*model.GetListUserUTMResp, error) {
|
||||
//
|
||||
// return nil, nil
|
||||
//}
|
||||
//
|
||||
//func (r *AmoRepository) GettingUserUtm(ctx context.Context, request *model.PaginationReq, accountID string, quizID int) (*model.GetListUserUTMResp, error) {
|
||||
// rows, err := r.queries.GetUTMsWithPagination(ctx, sqlcgen.GetUTMsWithPaginationParams{
|
||||
// Accountid: accountID,
|
||||
// Column2: request.Page,
|
||||
@ -956,10 +956,9 @@ func (r *AmoRepository) GettingUserUtm(ctx context.Context, request *model.Pagin
|
||||
// Count: count,
|
||||
// Items: utmS,
|
||||
// }, nil
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func (r *AmoRepository) GetUtmsByID(ctx context.Context, ids []int32) ([]model.UTM, error) {
|
||||
//}
|
||||
//
|
||||
//func (r *AmoRepository) GetUtmsByID(ctx context.Context, ids []int32) ([]model.UTM, error) {
|
||||
// rows, err := r.queries.GetUtmsByID(ctx, ids)
|
||||
// if err != nil {
|
||||
// return nil, err
|
||||
@ -977,11 +976,11 @@ func (r *AmoRepository) GetUtmsByID(ctx context.Context, ids []int32) ([]model.U
|
||||
//
|
||||
// utmS = append(utmS, utm)
|
||||
// }
|
||||
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func (r *AmoRepository) UpdateUTMs(ctx context.Context, utms []model.UTM) error {
|
||||
//
|
||||
// return utmS, nil
|
||||
//}
|
||||
//
|
||||
//func (r *AmoRepository) UpdateUTMs(ctx context.Context, utms []model.UTM) error {
|
||||
// dollar1, err := json.Marshal(utms)
|
||||
// if err != nil {
|
||||
// return err
|
||||
@ -991,18 +990,18 @@ func (r *AmoRepository) UpdateUTMs(ctx context.Context, utms []model.UTM) error
|
||||
// if err != nil {
|
||||
// return err
|
||||
// }
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (r *AmoRepository) UpdateUtmsFields(ctx context.Context, ids []int32) error {
|
||||
//
|
||||
// return nil
|
||||
//}
|
||||
//
|
||||
//func (r *AmoRepository) UpdateUtmsFields(ctx context.Context, ids []int32) error {
|
||||
// err := r.queries.UpdateUtmsFields(ctx, ids)
|
||||
// if err != nil {
|
||||
// return err
|
||||
// }
|
||||
|
||||
return nil
|
||||
}
|
||||
//
|
||||
// return nil
|
||||
//}
|
||||
|
||||
func (r *AmoRepository) GettingAmoUsersTrueResults(ctx context.Context) ([]model.AmoUsersTrueResults, error) {
|
||||
rows, err := r.queries.GettingAmoUsersTrueResults(ctx)
|
||||
@ -1018,6 +1017,13 @@ func (r *AmoRepository) GettingAmoUsersTrueResults(ctx context.Context) ([]model
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var utm model.UTMSavingMap
|
||||
err = json.Unmarshal(row.Utm, &utm)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
result := model.AmoUsersTrueResults{
|
||||
QuizID: row.QuizID,
|
||||
AnswerID: row.ID,
|
||||
@ -1027,7 +1033,7 @@ func (r *AmoRepository) GettingAmoUsersTrueResults(ctx context.Context) ([]model
|
||||
Session: row.Session.String,
|
||||
AccessToken: row.Accesstoken,
|
||||
AmoAccountID: row.Accountid,
|
||||
//UTMs: row.Utms,
|
||||
UTMs: utm,
|
||||
FieldsRule: fieldsRule,
|
||||
PerformerID: row.Performerid,
|
||||
StepID: row.Stepid,
|
||||
|
Loading…
Reference in New Issue
Block a user