prompts-core

This commit is contained in:
2026-05-15 09:45:51 +08:00
parent c4b8382dbb
commit 6497629fd0
18 changed files with 804 additions and 1643 deletions

View File

@@ -7,6 +7,7 @@ import (
"prompts-core/model/entity"
"gitea.com/red-future/common/db/gfdb"
"gitea.com/red-future/common/utils"
)
var Model = &modelDao{}
@@ -28,8 +29,13 @@ func (d *modelDao) GetByModelName(ctx context.Context, modelName string) (m *ent
}
func (d *modelDao) GetByIsChatModel(ctx context.Context) (m *entity.AsynchModel, err error) {
userInfo, err := utils.GetUserInfo(ctx)
if err != nil {
return nil, err
}
r, err := gfdb.DB(ctx).Model(ctx, public.TableNameModel).
Where(entity.AsynchModelCol.IsChatModel, 1).
Where(entity.AsynchModelCol.Creator, userInfo.UserName).
One()
if err != nil {
return nil, err