bitrix/internal/models/getListFields.go

49 lines
1.7 KiB
Go
Raw Normal View History

2024-09-20 14:41:33 +00:00
package models
2024-09-23 09:31:38 +00:00
import (
2024-09-26 08:19:51 +00:00
"penahub.gitlab.yandexcloud.net/backend/quiz/common.git/model"
2024-09-23 09:31:38 +00:00
"strconv"
"time"
)
2024-09-22 08:50:55 +00:00
type FieldsResponse struct {
Result []Fields `json:"result"`
Total int `json:"total"`
2024-09-20 14:41:33 +00:00
}
2024-09-22 08:50:55 +00:00
type Fields struct {
2024-09-26 08:19:51 +00:00
ID string `json:"ID"`
EntityID model.FieldsType `json:"ENTITY_ID"`
FieldName string `json:"FIELD_NAME"`
UserTypeID string `json:"USER_TYPE_ID"`
XMLID string `json:"XML_ID"`
Sort string `json:"SORT"`
Multiple string `json:"MULTIPLE"`
Mandatory string `json:"MANDATORY"`
ShowFilter string `json:"SHOW_FILTER"`
ShowInList string `json:"SHOW_IN_LIST"`
EditInList string `json:"EDIT_IN_LIST"`
IsSearchable string `json:"IS_SEARCHABLE"`
EditFormLabel string `json:"EDIT_FORM_LABEL"`
ListColumnLabel string `json:"LIST_COLUMN_LABEL"`
ListFilterLabel string `json:"LIST_FILTER_LABEL"`
ErrorMessage string `json:"ERROR_MESSAGE"`
HelpMessage string `json:"HELP_MESSAGE"`
2024-09-20 14:41:33 +00:00
}
2024-09-22 09:30:02 +00:00
2024-09-23 09:31:38 +00:00
type AddFields struct {
FieldName string `json:"FIELD_NAME"`
EditFormLabel string `json:"EDIT_FORM_LABEL"`
ListColumnLabel string `json:"LIST_COLUMN_LABEL"`
UserTypeID string `json:"USER_TYPE_ID"` // Тип поля
XMLID string `json:"XML_ID"`
Settings map[string]interface{} `json:"SETTINGS"`
}
func (a *AddFields) GenFieldName() {
currentTime := time.Now().Unix()
currentTimeStr := strconv.FormatInt(currentTime, 10)
a.FieldName = currentTimeStr
a.XMLID = currentTimeStr
}