mirror of
https://github.com/ManyakRus/crud_generator.git
synced 2024-12-22 00:36:41 +02:00
сделал ./crud_functions_rename.json
This commit is contained in:
parent
1965956ffa
commit
5c6452cd6d
@ -5,8 +5,7 @@ FILEMAIN=./cmd/$(SERVICENAME)/main.go
|
||||
FILEAPP=./bin/$(SERVICENAME)
|
||||
|
||||
NEW_REPO=$(SERVICENAME)
|
||||
CD_GENERATION_PROTO=cd ./api
|
||||
GENERATION_PROTO=generation_code.sh
|
||||
GENERATION_PROTO=cd ./api && ./generation_code.sh
|
||||
|
||||
|
||||
run:
|
||||
@ -54,7 +53,6 @@ conn:
|
||||
init:
|
||||
clear
|
||||
go mod init gitlab.aescorp.ru/dsp_dev/claim/sync_service
|
||||
$(CD_GENERATION_PROTO)
|
||||
$(GENERATION_PROTO)
|
||||
go mod tidy
|
||||
go mod vendor
|
@ -1,14 +1,3 @@
|
||||
{
|
||||
"lawsuit_payments.id": "alias.PaymentId",
|
||||
"lawsuit_payments.invoice_id": "alias.InvoiceId",
|
||||
"lawsuit_payments.lawsuit_id": "alias.LawsuitId",
|
||||
"lawsuit_payments.id": "alias.PaymentId",
|
||||
"invoice_debt_type_stats.invoice_id": "alias.InvoiceId",
|
||||
"invoice_debt_type_stats.lawsuit_id": "alias.LawsuitId",
|
||||
"contract_black_items.contract_number": "alias.ContractNumber",
|
||||
"contract_white_items.contract_number": "alias.ContractNumber",
|
||||
"lawsuits.number_claim": "alias.ClaimNumber",
|
||||
"lawsuits.number": "alias.LawsuitNumber",
|
||||
"contracts.number": "alias.ContractNumber"
|
||||
}
|
||||
|
||||
|
@ -1,8 +1,2 @@
|
||||
{
|
||||
"lawsuits": [
|
||||
{
|
||||
"old": "create_update_ctx",
|
||||
"new": "create_update_ctx_original"
|
||||
}
|
||||
]
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
{
|
||||
"lawsuits": [
|
||||
{
|
||||
"old": "create_update_ctx",
|
||||
"new": "create_update_ctx_original"
|
||||
}
|
||||
]
|
||||
}
|
@ -1,3 +1,2 @@
|
||||
{
|
||||
"lawsuits": "NewLawsuit,AsLawsuit,create_update_ctx"
|
||||
}
|
||||
|
@ -1,19 +1,2 @@
|
||||
{
|
||||
"inn": "INN",
|
||||
"kpp": "KPP",
|
||||
"okpo": "OKPO",
|
||||
"ogrn": "OGRN",
|
||||
"okato": "OKATO",
|
||||
"nsi_flat": "NSIFlat",
|
||||
"nsi_flat_id": "NSIFlatID",
|
||||
"nsi_id": "NSIID",
|
||||
"www": "WWW",
|
||||
"bik": "BIK",
|
||||
"city_name": "City",
|
||||
"edms_link": "EDMSLink",
|
||||
"code_nsi": "CodeNSI",
|
||||
"json_updated_at": "JSONUpdatedAt",
|
||||
"pdf_updated_at": "PDFUpdatedAt",
|
||||
"pdf_file_id": "PDFFileID",
|
||||
"json_file_id": "JSONFileID"
|
||||
}
|
@ -1,4 +1,2 @@
|
||||
{
|
||||
"ext_id": true,
|
||||
"created_at": false
|
||||
}
|
||||
|
@ -21,15 +21,15 @@ DB_PASSWORD=
|
||||
INCLUDE_TABLES=""
|
||||
|
||||
#INCLUDE_TABLES - table name ignore filter. Regular expression
|
||||
EXCLUDE_TABLES="ext_"
|
||||
EXCLUDE_TABLES=
|
||||
|
||||
#---------------------Template settings---------------------
|
||||
|
||||
#SERVICE_REPOSITORY_URL - URL of your new service repository (Github, gitlab, etc.)
|
||||
SERVICE_REPOSITORY_URL="gitlab.aescorp.ru/dsp_dev/claim/sync_service"
|
||||
SERVICE_REPOSITORY_URL="gitlab.aescorp.ru/dsp_dev/claim/crud_service"
|
||||
|
||||
#SERVICE_NAME - service name for your new service
|
||||
SERVICE_NAME=sync_service
|
||||
SERVICE_NAME=crud_service
|
||||
|
||||
#TEMPLATE_SERVICE_NAME - service name in your template files
|
||||
TEMPLATE_SERVICE_NAME=sync_service
|
||||
@ -96,7 +96,7 @@ TEXT_TEMPLATE_TABLENAME="lawsuit_status_types"
|
||||
USE_DEFAULT_TEMPLATE=true
|
||||
|
||||
#HAS_IS_DELETED - fill "true" if you have "is_deleted" column, and want Delete() Restore() functions.
|
||||
HAS_IS_DELETED=true
|
||||
HAS_IS_DELETED=false
|
||||
|
||||
#---------------------Create files settings---------------------
|
||||
|
||||
|
@ -7,6 +7,7 @@ import (
|
||||
"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"
|
||||
"testing"
|
||||
"math"
|
||||
)
|
||||
|
||||
// LawsuitStatusType_ID_Test - ID таблицы для тестирования
|
||||
@ -37,7 +38,7 @@ func Test_server_LawsuitStatusType_Delete(t *testing.T) {
|
||||
|
||||
ctx := context.Background()
|
||||
Request := grpc_proto.RequestId{}
|
||||
Request.Id = LawsuitStatusType_ID_Test
|
||||
Request.Id = math.MinInt64
|
||||
Request.VersionModel = lawsuit_status_types.LawsuitStatusType{}.GetStructVersion()
|
||||
|
||||
server1 := &ServerGRPC{}
|
||||
|
@ -4,6 +4,7 @@ import (
|
||||
config "github.com/ManyakRus/starter/config_main"
|
||||
"gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/network/grpc/grpc_client"
|
||||
"gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/object_model/entities/lawsuit_status_types"
|
||||
"math"
|
||||
"testing"
|
||||
)
|
||||
|
||||
@ -110,44 +111,11 @@ func TestDelete(t *testing.T) {
|
||||
|
||||
crud := Crud_GRPC{}
|
||||
Otvet := lawsuit_status_types.LawsuitStatusType{}
|
||||
Otvet.ID = Postgres_ID_Test
|
||||
err := crud.Read(&Otvet)
|
||||
Otvet.ID = math.MinInt64
|
||||
|
||||
err := crud.Delete(&Otvet)
|
||||
if err != nil {
|
||||
t.Error("TestRead() error: ", err)
|
||||
}
|
||||
|
||||
if Otvet.IsDeleted == false {
|
||||
err = crud.Delete(&Otvet)
|
||||
if err != nil {
|
||||
t.Error("TestDelete() error: ", err)
|
||||
}
|
||||
if Otvet.ID == 0 {
|
||||
t.Error("TestDelete() error: ID =0")
|
||||
}
|
||||
|
||||
err = crud.Restore(&Otvet)
|
||||
if err != nil {
|
||||
t.Error("TestDelete() error: ", err)
|
||||
}
|
||||
if Otvet.ID == 0 {
|
||||
t.Error("TestDelete() error: ID =0")
|
||||
}
|
||||
} else {
|
||||
err = crud.Restore(&Otvet)
|
||||
if err != nil {
|
||||
t.Error("TestDelete() error: ", err)
|
||||
}
|
||||
if Otvet.ID == 0 {
|
||||
t.Error("TestDelete() error: ID =0")
|
||||
}
|
||||
|
||||
err = crud.Delete(&Otvet)
|
||||
if err != nil {
|
||||
t.Error("TestDelete() error: ", err)
|
||||
}
|
||||
if Otvet.ID == 0 {
|
||||
t.Error("TestDelete() error: ID =0")
|
||||
}
|
||||
t.Error("TestDelete() error: ", err)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -5,6 +5,7 @@ import (
|
||||
"gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/network/nrpc/nrpc_client"
|
||||
"gitlab.aescorp.ru/dsp_dev/claim/sync_service/pkg/object_model/entities/lawsuit_status_types"
|
||||
"testing"
|
||||
"math"
|
||||
)
|
||||
|
||||
// Postgres_ID_Test - ID таблицы для тестирования
|
||||
@ -110,44 +111,10 @@ func TestDelete(t *testing.T) {
|
||||
|
||||
crud := Crud_NRPC{}
|
||||
Otvet := lawsuit_status_types.LawsuitStatusType{}
|
||||
Otvet.ID = Postgres_ID_Test
|
||||
err := crud.Read(&Otvet)
|
||||
Otvet.ID = math.MinInt64
|
||||
err := crud.Delete(&Otvet)
|
||||
if err != nil {
|
||||
t.Error("TestRead() error: ", err)
|
||||
}
|
||||
|
||||
if Otvet.IsDeleted == false {
|
||||
err = crud.Delete(&Otvet)
|
||||
if err != nil {
|
||||
t.Error("TestDelete() error: ", err)
|
||||
}
|
||||
if Otvet.ID == 0 {
|
||||
t.Error("TestDelete() error: ID =0")
|
||||
}
|
||||
|
||||
err = crud.Restore(&Otvet)
|
||||
if err != nil {
|
||||
t.Error("TestDelete() error: ", err)
|
||||
}
|
||||
if Otvet.ID == 0 {
|
||||
t.Error("TestDelete() error: ID =0")
|
||||
}
|
||||
} else {
|
||||
err = crud.Restore(&Otvet)
|
||||
if err != nil {
|
||||
t.Error("TestDelete() error: ", err)
|
||||
}
|
||||
if Otvet.ID == 0 {
|
||||
t.Error("TestDelete() error: ID =0")
|
||||
}
|
||||
|
||||
err = crud.Delete(&Otvet)
|
||||
if err != nil {
|
||||
t.Error("TestDelete() error: ", err)
|
||||
}
|
||||
if Otvet.ID == 0 {
|
||||
t.Error("TestDelete() error: ID =0")
|
||||
}
|
||||
t.Error("TestDelete() error: ", err)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user