bitrix/internal/models/getListFields.go

47 lines
1.7 KiB
Go

package models
import (
"github.com/rs/xid"
"penahub.gitlab.yandexcloud.net/backend/quiz/common.git/model"
)
type FieldsResponse struct {
Result []Fields `json:"result"`
Total int `json:"total"`
}
type Fields struct {
ID string `json:"ID"`
EntityID model.FieldsType `json:"ENTITY_ID"`
FieldName string `json:"FIELD_NAME"`
UserTypeID model.CustomFieldsType `json:"USER_TYPE_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"`
}
type AddFields struct {
FieldName string `json:"FIELD_NAME"`
EditFormLabel string `json:"EDIT_FORM_LABEL"`
ListColumnLabel string `json:"LIST_COLUMN_LABEL"`
UserTypeID model.CustomFieldsType `json:"USER_TYPE_ID"` // Тип поля
XMLID string `json:"XML_ID"`
Settings map[string]interface{} `json:"SETTINGS"`
}
func (a *AddFields) GenFieldName() {
guid := xid.New()
guidGen := guid.String()
a.FieldName = guidGen
a.XMLID = guidGen
}