mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-01-04 03:25:30 +08:00
add seed data generation (#13)
* merge upstream * add seed data generation
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
use chrono::{FixedOffset, Utc};
|
||||
use sea_orm::{ActiveModelTrait, DbConn, DbErr, DeleteResult, EntityTrait, PaginatorTrait, QueryOrder, ColumnTrait, QueryFilter};
|
||||
use sea_orm::ActiveValue::Set;
|
||||
use sea_orm::ActiveValue::{Set, NotSet};
|
||||
use crate::entity::tag_info;
|
||||
use crate::entity::tag_info::Entity;
|
||||
|
||||
@ -51,7 +51,10 @@ impl Mutation {
|
||||
regx: Set(form_data.regx.to_owned()),
|
||||
color: Set(form_data.color.to_owned()),
|
||||
icon: Set(form_data.icon.to_owned()),
|
||||
folder_id: Set(form_data.folder_id.to_owned()),
|
||||
folder_id: match form_data.folder_id {
|
||||
0 => NotSet,
|
||||
_ => Set(form_data.folder_id.to_owned())
|
||||
},
|
||||
created_at: Set(now()),
|
||||
updated_at: Set(now()),
|
||||
}
|
||||
|
||||
@ -23,8 +23,11 @@ impl Query {
|
||||
.await
|
||||
}
|
||||
|
||||
pub async fn find_user_infos(db: &DbConn) -> Result<Vec<user_info::Model>, DbErr> {
|
||||
Entity::find().all(db).await
|
||||
pub async fn find_user_infos(db: &DbConn, email:&String) -> Result<Option<user_info::Model>, DbErr> {
|
||||
Entity::find()
|
||||
.filter(user_info::Column::Email.eq(email))
|
||||
.one(db)
|
||||
.await
|
||||
}
|
||||
|
||||
pub async fn find_user_infos_in_page(
|
||||
|
||||
Reference in New Issue
Block a user