chore: replace all cn comments to en version by volc api (#313)
This commit is contained in:
@@ -8,15 +8,15 @@ const TableNamePromptResource = "prompt_resource"
|
||||
|
||||
// PromptResource prompt_resource
|
||||
type PromptResource struct {
|
||||
ID int64 `gorm:"column:id;primaryKey;autoIncrement:true;comment:主键ID" json:"id"` // 主键ID
|
||||
SpaceID int64 `gorm:"column:space_id;not null;comment:空间ID" json:"space_id"` // 空间ID
|
||||
Name string `gorm:"column:name;not null;comment:名称" json:"name"` // 名称
|
||||
Description string `gorm:"column:description;not null;comment:描述" json:"description"` // 描述
|
||||
PromptText string `gorm:"column:prompt_text;comment:prompt正文" json:"prompt_text"` // prompt正文
|
||||
Status int32 `gorm:"column:status;not null;comment:状态,0无效,1有效" json:"status"` // 状态,0无效,1有效
|
||||
CreatorID int64 `gorm:"column:creator_id;not null;comment:创建者ID" json:"creator_id"` // 创建者ID
|
||||
CreatedAt int64 `gorm:"column:created_at;not null;autoCreateTime:milli;comment:创建时间" json:"created_at"` // 创建时间
|
||||
UpdatedAt int64 `gorm:"column:updated_at;not null;autoUpdateTime:milli;comment:更新时间" json:"updated_at"` // 更新时间
|
||||
ID int64 `gorm:"column:id;primaryKey;autoIncrement:true;comment:id" json:"id"` // id
|
||||
SpaceID int64 `gorm:"column:space_id;not null;comment:space id" json:"space_id"` // space id
|
||||
Name string `gorm:"column:name;not null;comment:name" json:"name"` // name
|
||||
Description string `gorm:"column:description;not null;comment:description" json:"description"` // description
|
||||
PromptText string `gorm:"column:prompt_text;comment:prompt text" json:"prompt_text"` // prompt text
|
||||
Status int32 `gorm:"column:status;not null;comment:status, 0 is invalid, 1 is valid" json:"status"` // status, 0 is invalid, 1 is valid
|
||||
CreatorID int64 `gorm:"column:creator_id;not null;comment:creator id" json:"creator_id"` // creator id
|
||||
CreatedAt int64 `gorm:"column:created_at;not null;autoCreateTime:milli;comment:Create Time in Milliseconds" json:"created_at"` // Create Time in Milliseconds
|
||||
UpdatedAt int64 `gorm:"column:updated_at;not null;autoUpdateTime:milli;comment:Update Time in Milliseconds" json:"updated_at"` // Update Time in Milliseconds
|
||||
}
|
||||
|
||||
// TableName PromptResource's table name
|
||||
|
||||
@@ -47,15 +47,15 @@ type promptResource struct {
|
||||
promptResourceDo
|
||||
|
||||
ALL field.Asterisk
|
||||
ID field.Int64 // 主键ID
|
||||
SpaceID field.Int64 // 空间ID
|
||||
Name field.String // 名称
|
||||
Description field.String // 描述
|
||||
PromptText field.String // prompt正文
|
||||
Status field.Int32 // 状态,0无效,1有效
|
||||
CreatorID field.Int64 // 创建者ID
|
||||
CreatedAt field.Int64 // 创建时间
|
||||
UpdatedAt field.Int64 // 更新时间
|
||||
ID field.Int64 // id
|
||||
SpaceID field.Int64 // space id
|
||||
Name field.String // name
|
||||
Description field.String // description
|
||||
PromptText field.String // prompt text
|
||||
Status field.Int32 // status, 0 is invalid, 1 is valid
|
||||
CreatorID field.Int64 // creator id
|
||||
CreatedAt field.Int64 // Create Time in Milliseconds
|
||||
UpdatedAt field.Int64 // Update Time in Milliseconds
|
||||
|
||||
fieldMap map[string]field.Expr
|
||||
}
|
||||
|
||||
@@ -87,12 +87,12 @@ func searchPromptResourceList(ctx context.Context, resource []*entity.PromptReso
|
||||
if promptResource == nil {
|
||||
continue
|
||||
}
|
||||
// 名称匹配
|
||||
// name match
|
||||
if strings.Contains(strings.ToLower(promptResource.Name), strings.ToLower(keyword)) {
|
||||
retVal = append(retVal, promptResource)
|
||||
continue
|
||||
}
|
||||
// 正文匹配
|
||||
// Body Match
|
||||
if strings.Contains(strings.ToLower(promptResource.PromptText), strings.ToLower(keyword)) {
|
||||
retVal = append(retVal, promptResource)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user