You've already forked crud_generator
mirror of
https://github.com/ManyakRus/crud_generator.git
synced 2025-07-05 14:09:20 +02:00
сделал PREFIX_OBJECT_MODEL="Object"
This commit is contained in:
@ -32,7 +32,7 @@ func (m LawsuitStatusType) TableNameDB() string {
|
||||
return "lawsuit_status_types"
|
||||
}
|
||||
|
||||
// NewLawsuitStatusType - возвращает новый объект
|
||||
// NewLawsuitStatusType - возвращает новый объект
|
||||
func NewLawsuitStatusType() LawsuitStatusType {
|
||||
return LawsuitStatusType{}
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ package object_lawsuit_status_types
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"github.com/vmihailenco/msgpack/v5"
|
||||
"gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/db/calc_struct_version"
|
||||
"gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/db/db_constants"
|
||||
"reflect"
|
||||
@ -53,6 +54,31 @@ func (m ObjectLawsuitStatusType) GetJSON() (string, error) {
|
||||
return Result, err
|
||||
}
|
||||
|
||||
// NewLawsuitStatusType - возвращает новый объект
|
||||
func NewLawsuitStatusType() LawsuitStatusType {
|
||||
return LawsuitStatusType{}
|
||||
}
|
||||
|
||||
// AsLawsuitStatusType - создаёт объект из упакованного объекта в массиве байтов
|
||||
func AsLawsuitStatusType(b []byte) (LawsuitStatusType, error) {
|
||||
c := NewLawsuitStatusType()
|
||||
err := msgpack.Unmarshal(b, &c)
|
||||
if err != nil {
|
||||
return NewLawsuitStatusType(), err
|
||||
}
|
||||
return c, nil
|
||||
}
|
||||
|
||||
// LawsuitStatusTypeAsBytes - упаковывает объект в массив байтов
|
||||
func LawsuitStatusTypeAsBytes(m *LawsuitStatusType) ([]byte, error) {
|
||||
b, err := msgpack.Marshal(m)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return b, nil
|
||||
}
|
||||
|
||||
|
||||
// ---------------------------- CRUD операции ------------------------------------------------------------
|
||||
|
||||
// ReadObject - находит запись в БД по ID, и заполняет в объект, а также заполняет все поля у которых есть foreign key
|
||||
|
Reference in New Issue
Block a user