mirror of
https://gitee.com/dromara/mayfly-go
synced 2025-11-03 16:00:25 +08:00
fix: file文件缺失
This commit is contained in:
@@ -347,6 +347,25 @@ func (v *MysqlVisitor) VisitAtomTableItem(ctx *mysqlparser.AtomTableItemContext)
|
||||
return tableSourceItem
|
||||
}
|
||||
|
||||
func (v *MysqlVisitor) VisitSubqueryTableItem(ctx *mysqlparser.SubqueryTableItemContext) interface{} {
|
||||
sti := new(sqlstmt.SubqueryTableItem)
|
||||
sti.Node = sqlstmt.NewNode(ctx.GetParser(), ctx)
|
||||
|
||||
// 解析子查询
|
||||
if ss := ctx.SelectStatement(); ss != nil {
|
||||
sti.SubQuery = ss.Accept(v).(sqlstmt.ISelectStmt)
|
||||
}
|
||||
|
||||
// 获取别名
|
||||
if alias := ctx.GetAlias(); alias != nil {
|
||||
sti.Alias = alias.GetText()
|
||||
} else if uid := ctx.Uid(); uid != nil {
|
||||
sti.Alias = uid.GetText()
|
||||
}
|
||||
|
||||
return sti
|
||||
}
|
||||
|
||||
func (v *MysqlVisitor) VisitInnerJoin(ctx *mysqlparser.InnerJoinContext) interface{} {
|
||||
ij := new(sqlstmt.InnerJoin)
|
||||
ij.Node = sqlstmt.NewNode(ctx.GetParser(), ctx)
|
||||
|
||||
@@ -139,6 +139,14 @@ type (
|
||||
TableName *TableName // 表名
|
||||
Alias string // 别名
|
||||
}
|
||||
|
||||
// SubqueryTableItem 表示子查询表项,如 (SELECT * FROM table1) AS alias
|
||||
SubqueryTableItem struct {
|
||||
TableSourceItem
|
||||
|
||||
SubQuery ISelectStmt
|
||||
Alias string
|
||||
}
|
||||
)
|
||||
|
||||
func (*TableSource) isTableSource() {}
|
||||
|
||||
15
server/internal/file/infra/persistence/file.go
Normal file
15
server/internal/file/infra/persistence/file.go
Normal file
@@ -0,0 +1,15 @@
|
||||
package persistence
|
||||
|
||||
import (
|
||||
"mayfly-go/internal/file/domain/entity"
|
||||
"mayfly-go/internal/file/domain/repository"
|
||||
"mayfly-go/pkg/base"
|
||||
)
|
||||
|
||||
type fileRepoImpl struct {
|
||||
base.RepoImpl[*entity.File]
|
||||
}
|
||||
|
||||
func newFileRepo() repository.File {
|
||||
return &fileRepoImpl{}
|
||||
}
|
||||
9
server/internal/file/infra/persistence/persistence.go
Normal file
9
server/internal/file/infra/persistence/persistence.go
Normal file
@@ -0,0 +1,9 @@
|
||||
package persistence
|
||||
|
||||
import (
|
||||
"mayfly-go/pkg/ioc"
|
||||
)
|
||||
|
||||
func InitIoc() {
|
||||
ioc.Register(newFileRepo(), ioc.WithComponentName("FileRepo"))
|
||||
}
|
||||
Reference in New Issue
Block a user