Trang tài liệu Trí Nam

Chỉ có 2 loại ngôn ngữ lập trình: Một loại bị nhiều người chê và một loại không ai thèm sử dụng

Gen code Backend

Estimated reading: 3 minutes 443 views

Các bước gen code backend:

  • Endpoint:  https://tools.dttt.vn/gencode/ApiGenerator/GenApi

  • Method: POST
  • Authentication: None
STT Parameter Bắt buộc Mô tả Ví dụ
1
sourceDatabaseServer
[x]
Servername của Database
10.1.2.3,1433
2
sourceDataBase
[x]
Tên của database dùng để gen code
U202003_Dev_TaiNguyen_V5
3
sourceDatabaseUserId
[x]
Username để lấy dữ liệu gen code
********
4
sourceDatabasePassword
[x]
Password để lấy dữ liệu gen code
*************
5
sourceTables
[]
Các bảng dữ liệu sẽ dùng để gen code ra, để trống sẽ gen hết
DM_CaTruc
6
scopeService
[x]
Tên dự án, cần để gen đúng đường dẫn các file, tên service/component…
TaiNguyen
7
scopeName
[x]
Mã dự án, cần để gen đúng môi trường thuôc từng dự án(thường sẽ trùng với mã ở DB)
U202003
8
coreVersion
[x]
Cần để biết đang chay phiên bản Core bao nhiêu
5.0
9
dotNetCoreVersion
[x]
Giống trên
5.0
10
projectPortPrefix
[x]
Set cổng khi chạy api
16051
11
debugDeploymentServerIp
[x]
[x]
192.168.1.222
12
debugEtcdConfig
Chứa kết nối đến file cấu hình để api gọi đến các service hỗ trợ và đọc connetionstring

authenticated=true;
server=http://<ip>:2379;
username=*****;
password=*****

13
debugPersonalEnvironment
[x]
Tên viết tắt của người gencode
PhucND
14
debugPort
[x]
Mở cổng debug code cho api
16061
15
includeProjFiles
[x]
Cần để gen ra một project hoàn chỉnh chứa các thông tin trên
true
16
includeGenerated
[x]
gen bao gồm files generated
true
17
includeModifiable
[x]
gen bao gồm files có thể chỉnh sửa
true
18
includeService
[x]
gen bao gồm tầng service
true
19
includeController
[x]
gen bao gồm tầng controller
true
20
includeDataContext
[x]
gen bao gồm tầng datacontext
true
21
includeTemplate
[x]
gen bao gồm copy template vào thư mục .API/Template
true
22
tableSchema
[]
gen các table có schema theo value, thường chỉ dùng cho các trường hợp bị trùng table và cần gen table có schema theo value
true

Ví dụ cho body của request Gen backend

				
					{
  "sourceDatabaseServer": "***",
  "sourceDataBase": "U202003_Dev_Core_V5",
  "sourceDatabaseUserId": "admin",
  "sourceDatabasePassword": "***************",
  "sourceTables": "UserGroupHasUser",
  "tableSchema": "Authorization",
  "scopeService": "Core",
  "scopeName": "U202003",
  "coreVersion": "5.0",
  "dotNetCoreVersion": "5.0",
  "projectPortPrefix": "160",
  "debugDeploymentServerIp": "***",
  "debugEtcdConfig": "authenticated=true;server=http://***;username=***;password=**********",
  "debugPersonalEnvironment": "PhucND",
  "debugPort": "16019",
  "includeProjFiles": true
  "includeGenerated": true,
  "includeModifiable": true,
  "includeService": true,
  "includeController": true,
  "includeDataContext": true,
  "includeTemplate": true
}
				
			
CONTENTS