mirror of
https://github.com/ManyakRus/crud_generator.git
synced 2025-01-03 01:22:21 +02:00
сделал Read_ctx()
This commit is contained in:
parent
4c595428c9
commit
830ea6bba5
@ -5,6 +5,7 @@ import (
|
||||
"github.com/ManyakRus/starter/micro"
|
||||
"gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/network/grpc/grpc_proto"
|
||||
"gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/object_model/entities/lawsuit_status_types"
|
||||
"gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/db/crud/crud_lawsuit_status_types"
|
||||
)
|
||||
|
||||
// LawsuitStatusType_Read - читает и возвращает модель из БД
|
||||
@ -29,7 +30,7 @@ func (s *ServerGRPC) LawsuitStatusType_Read(ctx context.Context, Request *grpc_p
|
||||
//запрос в БД
|
||||
Model := &lawsuit_status_types.LawsuitStatusType{}
|
||||
Model.ID = Request.ID
|
||||
err = Model.Read()
|
||||
err = crud_lawsuit_status_types.Read_ctx(ctx, Model)
|
||||
if err != nil {
|
||||
return &Otvet, err
|
||||
}
|
||||
@ -66,7 +67,7 @@ func (s *ServerGRPC) LawsuitStatusType_Delete(ctx context.Context, Request *grpc
|
||||
//запрос в БД
|
||||
Model := &lawsuit_status_types.LawsuitStatusType{}
|
||||
Model.ID = Request.ID
|
||||
err = Model.Delete()
|
||||
err = crud_lawsuit_status_types.Delete_ctx(ctx, Model)
|
||||
if err != nil {
|
||||
return &Otvet, err
|
||||
}
|
||||
@ -103,7 +104,7 @@ func (s *ServerGRPC) LawsuitStatusType_Restore(ctx context.Context, Request *grp
|
||||
//запрос в БД
|
||||
Model := &lawsuit_status_types.LawsuitStatusType{}
|
||||
Model.ID = Request.ID
|
||||
err = Model.Restore()
|
||||
err = crud_lawsuit_status_types.Restore_ctx(ctx, Model)
|
||||
if err != nil {
|
||||
return &Otvet, err
|
||||
}
|
||||
@ -145,7 +146,7 @@ func (s *ServerGRPC) LawsuitStatusType_Create(ctx context.Context, Request *grpc
|
||||
}
|
||||
|
||||
//запрос в БД
|
||||
err = Model.Create()
|
||||
err = crud_lawsuit_status_types.Create_ctx(ctx, Model)
|
||||
if err != nil {
|
||||
return &Otvet, err
|
||||
}
|
||||
@ -187,7 +188,7 @@ func (s *ServerGRPC) LawsuitStatusType_Update(ctx context.Context, Request *grpc
|
||||
}
|
||||
|
||||
//запрос в БД
|
||||
err = Model.Update()
|
||||
err = crud_lawsuit_status_types.Update_ctx(ctx, Model)
|
||||
if err != nil {
|
||||
return &Otvet, err
|
||||
}
|
||||
@ -229,7 +230,7 @@ func (s *ServerGRPC) LawsuitStatusType_Save(ctx context.Context, Request *grpc_p
|
||||
}
|
||||
|
||||
//запрос в БД
|
||||
err = Model.Save()
|
||||
err = crud_lawsuit_status_types.Save_ctx(ctx, &Model)
|
||||
if err != nil {
|
||||
return &Otvet, err
|
||||
}
|
||||
@ -267,7 +268,7 @@ func (s *ServerGRPC) LawsuitStatusType_FindByExtID(ctx context.Context, Request
|
||||
Model := &lawsuit_status_types.LawsuitStatusType{}
|
||||
Model.ExtID = Request.ExtID
|
||||
Model.ConnectionID = Request.ConnectionId
|
||||
err = Model.Find_ByExtID()
|
||||
err = crud_lawsuit_status_types.Find_ByExtID_ctx(ctx, Model)
|
||||
if err != nil {
|
||||
return &Otvet, err
|
||||
}
|
||||
|
@ -40,7 +40,7 @@ func (crud Crud_DB) ReadFromCache(ID int64) (lawsuit_status_types.LawsuitStatusT
|
||||
defer ctxCancelFunc()
|
||||
|
||||
Otvet.ID = ID
|
||||
err = crud.Read_ctx(ctx, &Otvet)
|
||||
err = Read_ctx(ctx, &Otvet)
|
||||
if err == nil {
|
||||
cache.Add(ID, Otvet)
|
||||
}
|
||||
|
@ -6,12 +6,12 @@ func (crud Crud_DB) Read(m *lawsuit_status_types.LawsuitStatusType) error {
|
||||
ctx, ctxCancelFunc := context.WithTimeout(ctxMain, time.Second*time.Duration(constants.TIMEOUT_DB_SECONDS))
|
||||
defer ctxCancelFunc()
|
||||
|
||||
err = crud.Read_ctx(ctx, m)
|
||||
err = Read_ctx(ctx, m)
|
||||
return err
|
||||
}
|
||||
|
||||
// Read_ctx - изменяет 1 поле ColumnName в базе данных
|
||||
func (crud Crud_DB) Read_ctx(ctx context.Context, m *lawsuit_status_types.LawsuitStatusType) error {
|
||||
func Read_ctx(ctx context.Context, m *lawsuit_status_types.LawsuitStatusType) error {
|
||||
var err error
|
||||
|
||||
if micro.ContextDone(ctx) == true {
|
||||
|
@ -28,12 +28,12 @@ func (crud Crud_DB) Read(m *lawsuit_status_types.LawsuitStatusType) error {
|
||||
ctx, ctxCancelFunc := context.WithTimeout(ctxMain, time.Second*time.Duration(constants.TIMEOUT_DB_SECONDS))
|
||||
defer ctxCancelFunc()
|
||||
|
||||
err = crud.Read_ctx(ctx, m)
|
||||
err = Read_ctx(ctx, m)
|
||||
return err
|
||||
}
|
||||
|
||||
// Read_ctx - находит запись в БД по ID
|
||||
func (crud Crud_DB) Read_ctx(ctx context.Context, m *lawsuit_status_types.LawsuitStatusType) error {
|
||||
func Read_ctx(ctx context.Context, m *lawsuit_status_types.LawsuitStatusType) error {
|
||||
var err error
|
||||
|
||||
if micro.ContextDone(ctx) == true {
|
||||
@ -61,12 +61,12 @@ func (crud Crud_DB) Save(m *lawsuit_status_types.LawsuitStatusType) error {
|
||||
ctx, ctxCancelFunc := context.WithTimeout(ctxMain, time.Second*time.Duration(constants.TIMEOUT_DB_SECONDS))
|
||||
defer ctxCancelFunc()
|
||||
|
||||
err := crud.Save_ctx(ctx, m)
|
||||
err := Save_ctx(ctx, m)
|
||||
return err
|
||||
}
|
||||
|
||||
// Save_ctx - записывает новый или существующий объект в базу данных
|
||||
func (crud Crud_DB) Save_ctx(ctx context.Context, m *lawsuit_status_types.LawsuitStatusType) error {
|
||||
func Save_ctx(ctx context.Context, m *lawsuit_status_types.LawsuitStatusType) error {
|
||||
var err error
|
||||
if micro.ContextDone(ctx) == true {
|
||||
err = context.Canceled
|
||||
@ -74,7 +74,7 @@ func (crud Crud_DB) Save_ctx(ctx context.Context, m *lawsuit_status_types.Lawsui
|
||||
}
|
||||
|
||||
is_create := !micro.BoolFromInt64(int64(m.ID))
|
||||
err = crud.create_update_ctx(ctx, m, is_create)
|
||||
err = create_update_ctx(ctx, m, is_create)
|
||||
return err
|
||||
}
|
||||
|
||||
@ -84,19 +84,19 @@ func (crud Crud_DB) Update(m *lawsuit_status_types.LawsuitStatusType) error {
|
||||
ctx, ctxCancelFunc := context.WithTimeout(ctxMain, time.Second*time.Duration(constants.TIMEOUT_DB_SECONDS))
|
||||
defer ctxCancelFunc()
|
||||
|
||||
err := crud.Update_ctx(ctx, m)
|
||||
err := Update_ctx(ctx, m)
|
||||
return err
|
||||
}
|
||||
|
||||
// Update_ctx - записывает существующий объект в базу данных
|
||||
func (crud Crud_DB) Update_ctx(ctx context.Context, m *lawsuit_status_types.LawsuitStatusType) error {
|
||||
func Update_ctx(ctx context.Context, m *lawsuit_status_types.LawsuitStatusType) error {
|
||||
var err error
|
||||
if micro.ContextDone(ctx) == true {
|
||||
err = context.Canceled
|
||||
return err
|
||||
}
|
||||
|
||||
err = crud.create_update_ctx(ctx, m, false)
|
||||
err = create_update_ctx(ctx, m, false)
|
||||
return err
|
||||
}
|
||||
|
||||
@ -106,19 +106,19 @@ func (crud Crud_DB) Create(m *lawsuit_status_types.LawsuitStatusType) error {
|
||||
ctx, ctxCancelFunc := context.WithTimeout(ctxMain, time.Second*time.Duration(constants.TIMEOUT_DB_SECONDS))
|
||||
defer ctxCancelFunc()
|
||||
|
||||
err := crud.Create_ctx(ctx, m)
|
||||
err := Create_ctx(ctx, m)
|
||||
return err
|
||||
}
|
||||
|
||||
// Create_ctx - записывает новый объект в базу данных
|
||||
func (crud Crud_DB) Create_ctx(ctx context.Context, m *lawsuit_status_types.LawsuitStatusType) error {
|
||||
func Create_ctx(ctx context.Context, m *lawsuit_status_types.LawsuitStatusType) error {
|
||||
var err error
|
||||
if micro.ContextDone(ctx) == true {
|
||||
err = context.Canceled
|
||||
return err
|
||||
}
|
||||
|
||||
err = crud.create_update_ctx(ctx, m, true)
|
||||
err = create_update_ctx(ctx, m, true)
|
||||
return err
|
||||
}
|
||||
|
||||
@ -130,12 +130,12 @@ func (crud Crud_DB) create_update(m *lawsuit_status_types.LawsuitStatusType, is_
|
||||
ctx, ctxCancelFunc := context.WithTimeout(ctxMain, time.Second*time.Duration(constants.TIMEOUT_DB_SECONDS))
|
||||
defer ctxCancelFunc()
|
||||
|
||||
err = crud.create_update_ctx(ctx, m, is_create)
|
||||
err = create_update_ctx(ctx, m, is_create)
|
||||
return err
|
||||
}
|
||||
|
||||
// create_update_ctx - записывает объект в базу данных
|
||||
func (crud Crud_DB) create_update_ctx(ctx context.Context, m *lawsuit_status_types.LawsuitStatusType, is_create bool) error {
|
||||
func create_update_ctx(ctx context.Context, m *lawsuit_status_types.LawsuitStatusType, is_create bool) error {
|
||||
var err error
|
||||
|
||||
// log.Trace("start Save() ", TableName, " id: ", int64(m.ID))
|
||||
@ -208,12 +208,12 @@ func (crud Crud_DB) Restore(m *lawsuit_status_types.LawsuitStatusType) error {
|
||||
ctx, ctxCancelFunc := context.WithTimeout(ctxMain, time.Second*time.Duration(constants.TIMEOUT_DB_SECONDS))
|
||||
defer ctxCancelFunc()
|
||||
|
||||
err = crud.Restore_ctx(ctx, m)
|
||||
err = Restore_ctx(ctx, m)
|
||||
return err
|
||||
}
|
||||
|
||||
// Restore_ctx - записывает is_deleted = true
|
||||
func (crud Crud_DB) Restore_ctx(ctx context.Context, m *lawsuit_status_types.LawsuitStatusType) error {
|
||||
func Restore_ctx(ctx context.Context, m *lawsuit_status_types.LawsuitStatusType) error {
|
||||
var err error
|
||||
|
||||
if micro.ContextDone(ctx) == true {
|
||||
@ -223,7 +223,7 @@ func (crud Crud_DB) Restore_ctx(ctx context.Context, m *lawsuit_status_types.Law
|
||||
|
||||
m2 := lawsuit_status_types.LawsuitStatusType{}
|
||||
m2.ID = m.ID
|
||||
err = crud.Read_ctx(ctx, &m2)
|
||||
err = Read_ctx(ctx, &m2)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@ -231,7 +231,7 @@ func (crud Crud_DB) Restore_ctx(ctx context.Context, m *lawsuit_status_types.Law
|
||||
m2.IsDeleted = false
|
||||
m.IsDeleted = false
|
||||
|
||||
err = crud.Save_ctx(ctx, &m2)
|
||||
err = Save_ctx(ctx, &m2)
|
||||
if err != nil {
|
||||
err = fmt.Errorf(m.TableNameDB()+" Restore() id: %v, error: %v", m.ID, err)
|
||||
}
|
||||
@ -253,13 +253,13 @@ func (crud Crud_DB) Find_ByExtID(m *lawsuit_status_types.LawsuitStatusType) erro
|
||||
ctx, ctxCancelFunc := context.WithTimeout(ctxMain, time.Second*time.Duration(constants.TIMEOUT_DB_SECONDS))
|
||||
defer ctxCancelFunc()
|
||||
|
||||
err = crud.Find_ByExtID_ctx(ctx, m)
|
||||
err = Find_ByExtID_ctx(ctx, m)
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
// Find_ByExtID_ctx - находит запись в БД по ext_id и connection_id
|
||||
func (crud Crud_DB) Find_ByExtID_ctx(ctx context.Context, m *lawsuit_status_types.LawsuitStatusType) error {
|
||||
func Find_ByExtID_ctx(ctx context.Context, m *lawsuit_status_types.LawsuitStatusType) error {
|
||||
var err error
|
||||
|
||||
if micro.ContextDone(ctx) == true {
|
||||
@ -294,12 +294,12 @@ func (crud Crud_DB) Delete(m *lawsuit_status_types.LawsuitStatusType) error {
|
||||
ctx, ctxCancelFunc := context.WithTimeout(ctxMain, time.Second*time.Duration(constants.TIMEOUT_DB_SECONDS))
|
||||
defer ctxCancelFunc()
|
||||
|
||||
err = crud.Delete_ctx(ctx, m)
|
||||
err = Delete_ctx(ctx, m)
|
||||
return err
|
||||
}
|
||||
|
||||
// Delete_ctx - удаляет запись в БД
|
||||
func (crud Crud_DB) Delete_ctx(ctx context.Context, m *lawsuit_status_types.LawsuitStatusType) error {
|
||||
func Delete_ctx(ctx context.Context, m *lawsuit_status_types.LawsuitStatusType) error {
|
||||
var err error
|
||||
|
||||
if micro.ContextDone(ctx) == true {
|
||||
|
@ -28,12 +28,12 @@ func (crud Crud_DB) Read(m *lawsuit_status_types.LawsuitStatusType) error {
|
||||
ctx, ctxCancelFunc := context.WithTimeout(ctxMain, time.Second*time.Duration(constants.TIMEOUT_DB_SECONDS))
|
||||
defer ctxCancelFunc()
|
||||
|
||||
err = crud.Read_ctx(ctx, m)
|
||||
err = Read_ctx(ctx, m)
|
||||
return err
|
||||
}
|
||||
|
||||
// Read_ctx - находит запись в БД по ID
|
||||
func (crud Crud_DB) Read_ctx(ctx context.Context, m *lawsuit_status_types.LawsuitStatusType) error {
|
||||
func Read_ctx(ctx context.Context, m *lawsuit_status_types.LawsuitStatusType) error {
|
||||
var err error
|
||||
|
||||
if micro.ContextDone(ctx) == true {
|
||||
@ -61,12 +61,12 @@ func (crud Crud_DB) Save(m *lawsuit_status_types.LawsuitStatusType) error {
|
||||
ctx, ctxCancelFunc := context.WithTimeout(ctxMain, time.Second*time.Duration(constants.TIMEOUT_DB_SECONDS))
|
||||
defer ctxCancelFunc()
|
||||
|
||||
err := crud.Save_ctx(ctx, m)
|
||||
err := Save_ctx(ctx, m)
|
||||
return err
|
||||
}
|
||||
|
||||
// Save_ctx - записывает новый или существующий объект в базу данных
|
||||
func (crud Crud_DB) Save_ctx(ctx context.Context, m *lawsuit_status_types.LawsuitStatusType) error {
|
||||
func Save_ctx(ctx context.Context, m *lawsuit_status_types.LawsuitStatusType) error {
|
||||
var err error
|
||||
if micro.ContextDone(ctx) == true {
|
||||
err = context.Canceled
|
||||
@ -74,7 +74,7 @@ func (crud Crud_DB) Save_ctx(ctx context.Context, m *lawsuit_status_types.Lawsui
|
||||
}
|
||||
|
||||
is_create := !micro.BoolFromInt64(int64(m.ID))
|
||||
err = crud.create_update_ctx(ctx, m, is_create)
|
||||
err = create_update_ctx(ctx, m, is_create)
|
||||
return err
|
||||
}
|
||||
|
||||
@ -84,19 +84,19 @@ func (crud Crud_DB) Update(m *lawsuit_status_types.LawsuitStatusType) error {
|
||||
ctx, ctxCancelFunc := context.WithTimeout(ctxMain, time.Second*time.Duration(constants.TIMEOUT_DB_SECONDS))
|
||||
defer ctxCancelFunc()
|
||||
|
||||
err := crud.Update_ctx(ctx, m)
|
||||
err := Update_ctx(ctx, m)
|
||||
return err
|
||||
}
|
||||
|
||||
// Update_ctx - записывает существующий объект в базу данных
|
||||
func (crud Crud_DB) Update_ctx(ctx context.Context, m *lawsuit_status_types.LawsuitStatusType) error {
|
||||
func Update_ctx(ctx context.Context, m *lawsuit_status_types.LawsuitStatusType) error {
|
||||
var err error
|
||||
if micro.ContextDone(ctx) == true {
|
||||
err = context.Canceled
|
||||
return err
|
||||
}
|
||||
|
||||
err = crud.create_update_ctx(ctx, m, false)
|
||||
err = create_update_ctx(ctx, m, false)
|
||||
return err
|
||||
}
|
||||
|
||||
@ -106,19 +106,19 @@ func (crud Crud_DB) Create(m *lawsuit_status_types.LawsuitStatusType) error {
|
||||
ctx, ctxCancelFunc := context.WithTimeout(ctxMain, time.Second*time.Duration(constants.TIMEOUT_DB_SECONDS))
|
||||
defer ctxCancelFunc()
|
||||
|
||||
err := crud.Create_ctx(ctx, m)
|
||||
err := Create_ctx(ctx, m)
|
||||
return err
|
||||
}
|
||||
|
||||
// Create_ctx - записывает новый объект в базу данных
|
||||
func (crud Crud_DB) Create_ctx(ctx context.Context, m *lawsuit_status_types.LawsuitStatusType) error {
|
||||
func Create_ctx(ctx context.Context, m *lawsuit_status_types.LawsuitStatusType) error {
|
||||
var err error
|
||||
if micro.ContextDone(ctx) == true {
|
||||
err = context.Canceled
|
||||
return err
|
||||
}
|
||||
|
||||
err = crud.create_update_ctx(ctx, m, true)
|
||||
err = create_update_ctx(ctx, m, true)
|
||||
return err
|
||||
}
|
||||
|
||||
@ -130,12 +130,12 @@ func (crud Crud_DB) create_update(m *lawsuit_status_types.LawsuitStatusType, is_
|
||||
ctx, ctxCancelFunc := context.WithTimeout(ctxMain, time.Second*time.Duration(constants.TIMEOUT_DB_SECONDS))
|
||||
defer ctxCancelFunc()
|
||||
|
||||
err = crud.create_update_ctx(ctx, m, is_create)
|
||||
err = create_update_ctx(ctx, m, is_create)
|
||||
return err
|
||||
}
|
||||
|
||||
// create_update_ctx - записывает объект в базу данных
|
||||
func (crud Crud_DB) create_update_ctx(ctx context.Context, m *lawsuit_status_types.LawsuitStatusType, is_create bool) error {
|
||||
func create_update_ctx(ctx context.Context, m *lawsuit_status_types.LawsuitStatusType, is_create bool) error {
|
||||
var err error
|
||||
|
||||
// log.Trace("start Save() ", TableName, " id: ", int64(m.ID))
|
||||
@ -208,12 +208,12 @@ func (crud Crud_DB) Delete(m *lawsuit_status_types.LawsuitStatusType) error {
|
||||
ctx, ctxCancelFunc := context.WithTimeout(ctxMain, time.Second*time.Duration(constants.TIMEOUT_DB_SECONDS))
|
||||
defer ctxCancelFunc()
|
||||
|
||||
err = crud.Delete_ctx(ctx, m)
|
||||
err = Delete_ctx(ctx, m)
|
||||
return err
|
||||
}
|
||||
|
||||
// Delete_ctx - записывает is_deleted = true
|
||||
func (crud Crud_DB) Delete_ctx(ctx context.Context, m *lawsuit_status_types.LawsuitStatusType) error {
|
||||
func Delete_ctx(ctx context.Context, m *lawsuit_status_types.LawsuitStatusType) error {
|
||||
var err error
|
||||
|
||||
if micro.ContextDone(ctx) == true {
|
||||
@ -223,7 +223,7 @@ func (crud Crud_DB) Delete_ctx(ctx context.Context, m *lawsuit_status_types.Laws
|
||||
|
||||
m2 := lawsuit_status_types.LawsuitStatusType{}
|
||||
m2.ID = m.ID
|
||||
err = crud.Read_ctx(ctx, &m2)
|
||||
err = Read_ctx(ctx, &m2)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@ -231,7 +231,7 @@ func (crud Crud_DB) Delete_ctx(ctx context.Context, m *lawsuit_status_types.Laws
|
||||
m2.IsDeleted = true
|
||||
m.IsDeleted = true
|
||||
|
||||
err = crud.Save_ctx(ctx, &m2)
|
||||
err = Save_ctx(ctx, &m2)
|
||||
if err != nil {
|
||||
err = fmt.Errorf(m.TableNameDB()+" Delete() id: %v, error: %v", m.ID, err)
|
||||
}
|
||||
@ -247,12 +247,12 @@ func (crud Crud_DB) Restore(m *lawsuit_status_types.LawsuitStatusType) error {
|
||||
ctx, ctxCancelFunc := context.WithTimeout(ctxMain, time.Second*time.Duration(constants.TIMEOUT_DB_SECONDS))
|
||||
defer ctxCancelFunc()
|
||||
|
||||
err = crud.Restore_ctx(ctx, m)
|
||||
err = Restore_ctx(ctx, m)
|
||||
return err
|
||||
}
|
||||
|
||||
// Restore_ctx - записывает is_deleted = true
|
||||
func (crud Crud_DB) Restore_ctx(ctx context.Context, m *lawsuit_status_types.LawsuitStatusType) error {
|
||||
func Restore_ctx(ctx context.Context, m *lawsuit_status_types.LawsuitStatusType) error {
|
||||
var err error
|
||||
|
||||
if micro.ContextDone(ctx) == true {
|
||||
@ -262,7 +262,7 @@ func (crud Crud_DB) Restore_ctx(ctx context.Context, m *lawsuit_status_types.Law
|
||||
|
||||
m2 := lawsuit_status_types.LawsuitStatusType{}
|
||||
m2.ID = m.ID
|
||||
err = crud.Read_ctx(ctx, &m2)
|
||||
err = Read_ctx(ctx, &m2)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@ -270,7 +270,7 @@ func (crud Crud_DB) Restore_ctx(ctx context.Context, m *lawsuit_status_types.Law
|
||||
m2.IsDeleted = false
|
||||
m.IsDeleted = false
|
||||
|
||||
err = crud.Save_ctx(ctx, &m2)
|
||||
err = Save_ctx(ctx, &m2)
|
||||
if err != nil {
|
||||
err = fmt.Errorf(m.TableNameDB()+" Restore() id: %v, error: %v", m.ID, err)
|
||||
}
|
||||
@ -292,13 +292,13 @@ func (crud Crud_DB) Find_ByExtID(m *lawsuit_status_types.LawsuitStatusType) erro
|
||||
ctx, ctxCancelFunc := context.WithTimeout(ctxMain, time.Second*time.Duration(constants.TIMEOUT_DB_SECONDS))
|
||||
defer ctxCancelFunc()
|
||||
|
||||
err = crud.Find_ByExtID_ctx(ctx, m)
|
||||
err = Find_ByExtID_ctx(ctx, m)
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
// Find_ByExtID_ctx - находит запись в БД по ext_id и connection_id
|
||||
func (crud Crud_DB) Find_ByExtID_ctx(ctx context.Context, m *lawsuit_status_types.LawsuitStatusType) error {
|
||||
func Find_ByExtID_ctx(ctx context.Context, m *lawsuit_status_types.LawsuitStatusType) error {
|
||||
var err error
|
||||
|
||||
if micro.ContextDone(ctx) == true {
|
||||
|
@ -124,6 +124,9 @@ func CreateFiles(Table1 *types.Table) error {
|
||||
ProtoURL := create_files.FindProtoURL()
|
||||
TextGRPCServer = create_files.AddImport(TextGRPCServer, ProtoURL)
|
||||
|
||||
CrudTableURL := create_files.FindCrudTableURL(TableName)
|
||||
TextGRPCServer = create_files.AddImport(TextGRPCServer, CrudTableURL)
|
||||
|
||||
//удалим лишние функции
|
||||
TextGRPCServer = DeleteFuncDelete(TextGRPCServer, Table1)
|
||||
TextGRPCServer = DeleteFuncRestore(TextGRPCServer, Table1)
|
||||
|
Loading…
Reference in New Issue
Block a user