From 82af63a5f4f91f80c72daa2d2e6550f136eea607 Mon Sep 17 00:00:00 2001 From: RIceWqy <1840169763@qq.com> Date: Tue, 19 Dec 2023 20:25:38 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=86=E7=B1=BB=E5=AE=9E=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/fushouxian-server/config/dbconfig.json | 6 +++--- module/category/Category.go | 20 ++++++++++++++++++++ module/category/init.go | 11 ----------- 3 files changed, 23 insertions(+), 14 deletions(-) diff --git a/apps/fushouxian-server/config/dbconfig.json b/apps/fushouxian-server/config/dbconfig.json index 5524858..fcc97a9 100644 --- a/apps/fushouxian-server/config/dbconfig.json +++ b/apps/fushouxian-server/config/dbconfig.json @@ -1,10 +1,10 @@ [ { - "DbType":"mssql", + "DbType":"mysql", "IsMaster":true, - "Dsn":"server=172.0.0.8;user id=sa;password=Password1!;database=DIGITAL", + "Dsn":"server=127.0.0.1;user id=root;password=root;database=fushouxian", "sqlMaxIdleConns":1, "sqlMaxOpenConns":1, "sqlLogLevel":2 } -] \ No newline at end of file +] diff --git a/module/category/Category.go b/module/category/Category.go index 79661ad..5d26945 100644 --- a/module/category/Category.go +++ b/module/category/Category.go @@ -1 +1,21 @@ package category + +import ( + "gitlab.fanhaninfo.net/go/togo/dao/basedboperat" +) + +func (Category) TableName() string { + return "category" +} + +type Category struct { + Id int64 `json:"id"` + Type int64 `json:"type"` + Name string `json:"name"` + ParentId int64 `json:"parent_id"` + Children []Category `json:"children" xorm:"-"` +} + +func (c *Category) AfterQuery(session basedboperat.DbTransactionSession) { + +} diff --git a/module/category/init.go b/module/category/init.go index e09a92c..79661ad 100644 --- a/module/category/init.go +++ b/module/category/init.go @@ -1,12 +1 @@ package category - -func (Category) TableName() string { - return "category" -} - -type Category struct { - Id int64 `json:"id"` - FormTemplateId int64 `json:"form_template_id"` - DataId int64 `json:"data_id"` - Data string `json:"data"` -}