sql转golang struct 工具实现

deploy
DESKTOP-4RNDQIC\29019 2021-02-28 01:46:03 +08:00
parent 1ae683ab85
commit d1cdd28136
1 changed files with 45 additions and 0 deletions

View File

@ -107,6 +107,23 @@ function on_click() {
var str = create + update + get + batchget + deletetext ;//
$('#out').text(str);
}
function on_click_ddl(){
console.log(JSON.stringify($("#ddl").val()))
$.ajax({
type:"post",
url:"https://www.testingcloud.club/sapi/openapi/ddl2orm",
contentType: "application/json",
async: false,
data :JSON.stringify({
data:$("#ddl").val()
}),
success: function(result) {
$('#gencode').text(result.Data);
},
dataType:"json"
},
);
}
</script>
<div style="padding: 5px; margin: 0px;width: 100%">
@ -114,6 +131,7 @@ function on_click() {
<div id="grouptab" class="col-md-1" style="background: #bbbbbb; text-align: center;padding: 10px; margin-left: 10px;height: 100%;">
<ul class="nav nav-tabs" style="font-size: 12px;">
<li> <a href="#gincurd" data-toggle="tab">gin接口代码生成工具</a></li>
<li> <a href="#ddl2sql" data-toggle="tab">sql ddl转代码和文档</a></li>
</ul>
</div>
<div class="col-md-8 tab-content" >
@ -121,6 +139,7 @@ function on_click() {
<p style="display: block;font-size: 20px ; text-align: center;">
gin接口代码CURD生成工具
</p>
<form action="" class="form-horizontal" role="form">
<div class="form-group">
<label for="interface" class="col-sm-2 control-label">模型名称</label>
@ -162,7 +181,33 @@ function on_click() {
</textarea>
</div>
</div>
<div class="tab-pane fade in" id="ddl2sql">
<p style="display: block;font-size: 20px ; text-align: center;">
ddl2sql
</p>
<div class="row" style="width: 50%;display: inline-block;">
<div class="col-md-2" >
输入ddl:
</div>
<textarea id="ddl" class="col-md-10" style="background: #bbbbbb;height: 600px;" >
</textarea>
</div>
<div class="row" style="width: 50%;display: inline-block;margin-left: 30px;">
<div class="col-md-2" style="margin-left: -10px;">
输出代码:
</div>
<textarea id="gencode" class="col-md-10" style="background: #bbbbbb;height: 600px;" >
</textarea>
</div>
<form action="" class="form-horizontal" role="form" style="margin-top: 30px;margin-left: 40%">
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<button type="button" class="btn btn-default" onclick="on_click_ddl()">生成</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>