chore: 初始开源发布
iotlcm-onelink-mock:OneLink 挡板服务(本地测试替身)。 - Go module 迁移至 git.5iot.com/iotlcm-public/iotlcm-onelink-mock - 修复同毫秒内多次生成卡导致 ICCID/IMSI 唯一约束冲突 - 补 Apache-2.0 LICENSE,README 重写并新增 docs/deploy.md - 移除内部部署资产(CI 触发器 / 镜像推送脚本 / 指定环境部署文档) - 测试凭据改为 demo_appid / demo_password,真实手机号与内网 IP 脱敏 - 统一 LF 行尾并加 .gitattributes
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"os"
|
||||
|
||||
_ "github.com/gogf/gf/contrib/drivers/sqlite/v2"
|
||||
"github.com/gogf/gf/v2/database/gdb"
|
||||
)
|
||||
|
||||
func main() {
|
||||
schema, err := os.ReadFile("manifest/sql/schema.sql")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
if err = gdb.AddConfigNode(gdb.DefaultGroupName, gdb.ConfigNode{
|
||||
Type: "sqlite",
|
||||
Link: "sqlite::@file(./data/codegen.db)",
|
||||
}); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
db, err := gdb.NewByGroup()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
if _, err = db.Exec(context.Background(), string(schema)); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
gfcli:
|
||||
gen:
|
||||
dao:
|
||||
- link: "sqlite::@file(./data/codegen.db)"
|
||||
tables: "mock_card_group,mock_t_sim_card,mock_order"
|
||||
descriptionTag: true
|
||||
jsonCase: "CamelLower"
|
||||
Reference in New Issue
Block a user