refactor: 组件升级、代码优化

This commit is contained in:
meilin.huang
2023-05-24 12:32:17 +08:00
parent 4fa52412c1
commit 9900b236ef
48 changed files with 777 additions and 345 deletions

View File

@@ -249,22 +249,15 @@ type DbInstance struct {
// 执行查询语句
// 依次返回 列名数组结果map错误
func (d *DbInstance) SelectData(execSql string) ([]string, []map[string]interface{}, error) {
func (d *DbInstance) SelectData(execSql string) ([]string, []map[string]any, error) {
return SelectDataByDb(d.db, execSql)
}
// 将查询结果映射至struct可具体参考sqlx库
func (d *DbInstance) SelectData2Struct(execSql string, dest interface{}) error {
func (d *DbInstance) SelectData2Struct(execSql string, dest any) error {
return Select2StructByDb(d.db, execSql, dest)
}
// 执行内部查询语句,不返回列名以及不限制行数
// 依次返回 结果map错误
func (d *DbInstance) innerSelect(execSql string) ([]map[string]interface{}, error) {
_, res, err := SelectDataByDb(d.db, execSql)
return res, err
}
// 执行 update, insert, delete建表等sql
// 返回影响条数和错误
func (d *DbInstance) Exec(sql string) (int64, error) {