feat(repository): 添加通用基础仓库及具体实体仓库实现

- 新增 core.BaseRepo 泛型仓库,提供增删改查基本操作方法
- 实现 Insert、SelectById、List、Update 和 Delete 方法,支持上下文传递
- 新增 ChannelRepo、ModelRepo 和 APIKeyRepo,均基于 BaseRepo 实现
- 规范化仓库结构,提升代码复用性和维护性
- 支持对不同模型的统一数据访问接口设计
This commit is contained in:
yangzhaohan
2026-07-17 09:17:15 +08:00
parent a18e4847c2
commit 66db64267c
4 changed files with 49 additions and 0 deletions
+10
View File
@@ -0,0 +1,10 @@
package repository
import (
"synoth.com/janus/internal/core"
"synoth.com/janus/internal/model"
)
type APIKeyRepo struct {
core.BaseRepo[model.APIKey]
}
+10
View File
@@ -0,0 +1,10 @@
package repository
import (
"synoth.com/janus/internal/core"
"synoth.com/janus/internal/model"
)
type ChannelRepo struct {
core.BaseRepo[model.Channel]
}
+10
View File
@@ -0,0 +1,10 @@
package repository
import (
"synoth.com/janus/internal/core"
"synoth.com/janus/internal/model"
)
type ModelRepo struct {
core.BaseRepo[model.Model]
}