plugai_updsrv/pkg/dal/models/news_do.go

166 lines
12 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// Code generated by db2go. DO NOT EDIT.
// https://github.com/civet148/sqlca
package models
const TableNameNews = "news" //新闻文章数据表(AI编辑)
const (
NEWS_COLUMN_ID = "id"
NEWS_COLUMN_ORG_ID = "org_id"
NEWS_COLUMN_SPIDER_ID = "spider_id"
NEWS_COLUMN_PNAME_ID = "p_name"
NEWS_COLUMN_TAG = "tag"
NEWS_COLUMN_CATEGORY = "category"
NEWS_COLUMN_MAIN_TITLE = "main_title"
NEWS_COLUMN_SUB_TITLE = "sub_title"
NEWS_COLUMN_SUMMARY = "summary"
NEWS_COLUMN_KEYWORDS = "keywords"
NEWS_COLUMN_SEO_KEYWORDS = "seo_keywords"
NEWS_COLUMN_TAGS = "tags"
NEWS_COLUMN_URL = "url"
NEWS_COLUMN_DIGEST = "digest"
NEWS_COLUMN_REPO_NAME = "repo_name"
NEWS_COLUMN_IMAGE_URL = "image_url"
NEWS_COLUMN_LOGO_URL = "logo_url"
NEWS_COLUMN_MODEL_PARAMETER= "model_parameter"
NEWS_COLUMN_CONTENT = "content"
NEWS_COLUMN_IS_HOTSPOT = "is_hotspot"
NEWS_COLUMN_IS_OVERWRITTEN = "is_overwritten"
NEWS_COLUMN_IS_DELETED = "is_deleted"
NEWS_COLUMN_IS_REPLICATE = "is_replicate"
NEWS_COLUMN_STATE = "state"
NEWS_COLUMN_LANGUAGE = "language"
NEWS_COLUMN_DATA_TIME = "data_time"
NEWS_COLUMN_CREATED_TIME = "created_time"
NEWS_COLUMN_UPDATED_TIME = "updated_time"
NEWS_COLUMN_EXTRA_DATA = "extra_data"
)
type NewsDO struct {
Id int64 `json:"id" db:"id" bson:"_id"` //自增ID
OrgId int64 `json:"org_id" db:"org_id" bson:"org_id"` //AI文章同步ID
SpiderId int64 `json:"spider_id" db:"spider_id" bson:"spider_id"` //爬虫文章ID
PnameId string `json:"p_name" db:"p_name" sqlca:"isnull" bson:"p_name"` //模型/产品名称
Tag string `json:"tag" db:"tag" bson:"tag"` //文章标签(原始标签)
Category string `json:"category" db:"category" bson:"category"` //分类
MainTitle string `json:"main_title" db:"main_title" bson:"main_title"` //主标题
SubTitle string `json:"sub_title" db:"sub_title" bson:"sub_title"` //副标题
Summary string `json:"summary" db:"summary" sqlca:"isnull" bson:"summary"` //摘要
Keywords string `json:"keywords" db:"keywords" sqlca:"isnull" bson:"keywords"` //文章关键词
SeoKeywords string `json:"seo_keywords" db:"seo_keywords" sqlca:"isnull" bson:"seo_keywords"` //SEO关键词
Tags []string `json:"tags" db:"tags" sqlca:"isnull" bson:"tags"` //人工打标签(多选)
Url string `json:"url" db:"url" sqlca:"isnull" bson:"url"` //文章链接
Digest string `json:"digest" db:"digest" sqlca:"isnull" bson:"digest"` //文章链接
RepoName string `json:"repo_name" db:"repo_name" sqlca:"isnull" bson:"repo_name"` //docker build时的名字repository name
ImageUrl string `json:"image_url" db:"image_url" sqlca:"isnull" bson:"image_url"` //图片URL
LogoUrl string `json:"logo_url" db:"logo_url" sqlca:"isnull" bson:"logo_url"` //Logo URL
ModelParameter int8 `json:"model_parameter" db:"model_parameter" sqlca:"isnull" bson:"model_parameter"` //模型的参数量
Content string `json:"content" db:"content" sqlca:"isnull" bson:"content"` //文章内容
IsHotspot bool `json:"is_hotspot" db:"is_hotspot" bson:"is_hotspot"` //是否热门(0=否 1=是)
IsOverwritten bool `json:"is_overwritten" db:"is_overwritten" bson:"is_overwritten"` //是否已被覆盖(0=否 1=是)
IsDeleted bool `json:"is_deleted" db:"is_deleted" bson:"is_deleted"` //是否已删除(0=否 1=是)
IsReplicate bool `json:"is_replicate" db:"is_replicate" bson:"is_replicate"` //是否为副本(0=否 1=是)
State int8 `json:"state" db:"state" bson:"state"` //状态(0=未发布订阅 1=已发布订阅 2=已推送)
Language LanguageType `json:"language" db:"language" bson:"language"` //语言(zh-CN=中文 en=英文)
DataTime string `json:"data_time" db:"data_time" bson:"data_time"` //数据生成时间
CreatedTime string `json:"created_time" db:"created_time" sqlca:"readonly" bson:"created_time"` //数据创建时间
UpdatedTime string `json:"updated_time" db:"updated_time" sqlca:"readonly" bson:"updated_time"` //数据更新时间
ExtraDataRaw string `db:"extra_data" json:"-"` // 原始 JSON 字符串,接收数据库字段
ExtraData map[string]interface{} `db:"-" json:"extra_data"` // 实际对外使用的 map跳过 DB 映射
}
func (do *NewsDO) GetId() int64 { return do.Id }
func (do *NewsDO) SetId(v int64) { do.Id = v }
func (do *NewsDO) GetOrgId() int64 { return do.OrgId }
func (do *NewsDO) SetOrgId(v int64) { do.OrgId = v }
func (do *NewsDO) GetSpiderId() int64 { return do.SpiderId }
func (do *NewsDO) SetSpiderId(v int64) { do.SpiderId = v }
func (do *NewsDO) GetPnameId() string { return do.PnameId }
func (do *NewsDO) SetPnameId(v string) { do.PnameId = v }
func (do *NewsDO) GetTag() string { return do.Tag }
func (do *NewsDO) SetTag(v string) { do.Tag = v }
func (do *NewsDO) GetCategory() string { return do.Category }
func (do *NewsDO) SetCategory(v string) { do.Category = v }
func (do *NewsDO) GetMainTitle() string { return do.MainTitle }
func (do *NewsDO) SetMainTitle(v string) { do.MainTitle = v }
func (do *NewsDO) GetSubTitle() string { return do.SubTitle }
func (do *NewsDO) SetSubTitle(v string) { do.SubTitle = v }
func (do *NewsDO) GetSummary() string { return do.Summary }
func (do *NewsDO) SetSummary(v string) { do.Summary = v }
func (do *NewsDO) GetKeywords() string { return do.Keywords }
func (do *NewsDO) SetKeywords(v string) { do.Keywords = v }
func (do *NewsDO) GetSeoKeywords() string { return do.SeoKeywords }
func (do *NewsDO) SetSeoKeywords(v string) { do.SeoKeywords = v }
func (do *NewsDO) GetTags() []string { return do.Tags }
func (do *NewsDO) SetTags(v []string) { do.Tags = v }
func (do *NewsDO) GetUrl() string { return do.Url }
func (do *NewsDO) SetUrl(v string) { do.Url = v }
func (do *NewsDO) GetDigest() string { return do.Digest }
func (do *NewsDO) SetDigest(v string) { do.Digest = v }
func (do *NewsDO) GetRepoName() string { return do.RepoName }
func (do *NewsDO) SetRepoName(v string) { do.RepoName = v }
func (do *NewsDO) GetImageUrl() string { return do.ImageUrl }
func (do *NewsDO) SetImageUrl(v string) { do.ImageUrl = v }
func (do *NewsDO) GetLogoUrl() string { return do.LogoUrl }
func (do *NewsDO) SetLogoUrl(v string) { do.LogoUrl = v }
func (do *NewsDO) GetModelParameter() int8 { return do.ModelParameter }
func (do *NewsDO) SetModelParameter(v int8) { do.ModelParameter = v }
func (do *NewsDO) GetContent() string { return do.Content }
func (do *NewsDO) SetContent(v string) { do.Content = v }
func (do *NewsDO) GetIsHotspot() bool { return do.IsHotspot }
func (do *NewsDO) SetIsHotspot(v bool) { do.IsHotspot = v }
func (do *NewsDO) GetIsOverwritten() bool { return do.IsOverwritten }
func (do *NewsDO) SetIsOverwritten(v bool) { do.IsOverwritten = v }
func (do *NewsDO) GetIsDeleted() bool { return do.IsDeleted }
func (do *NewsDO) SetIsDeleted(v bool) { do.IsDeleted = v }
func (do *NewsDO) GetIsReplicate() bool { return do.IsReplicate }
func (do *NewsDO) SetIsReplicate(v bool) { do.IsReplicate = v }
func (do *NewsDO) GetState() int8 { return do.State }
func (do *NewsDO) SetState(v int8) { do.State = v }
func (do *NewsDO) GetLanguage() LanguageType { return do.Language }
func (do *NewsDO) SetLanguage(v LanguageType) { do.Language = v }
func (do *NewsDO) GetDataTime() string { return do.DataTime }
func (do *NewsDO) SetDataTime(v string) { do.DataTime = v }
func (do *NewsDO) GetCreatedTime() string { return do.CreatedTime }
func (do *NewsDO) SetCreatedTime(v string) { do.CreatedTime = v }
func (do *NewsDO) GetUpdatedTime() string { return do.UpdatedTime }
func (do *NewsDO) SetUpdatedTime(v string) { do.UpdatedTime = v }
func (do *NewsDO) GetExtraData() map[string]interface{} { return do.ExtraData }
func (do *NewsDO) SetExtraData(v map[string]interface{}) { do.ExtraData = v }
/*
CREATE TABLE `news` (
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '自增ID',
`org_id` bigint NOT NULL DEFAULT '0' COMMENT 'AI文章同步ID',
`spider_id` bigint NOT NULL DEFAULT '0' COMMENT '爬虫文章ID',
`tag` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '文章标签(原始标签)',
`category` varchar(256) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '分类',
`main_title` varchar(256) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '主标题',
`sub_title` varchar(512) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '副标题',
`summary` text COLLATE utf8mb4_unicode_ci COMMENT '摘要',
`keywords` text COLLATE utf8mb4_unicode_ci COMMENT '文章关键词',
`seo_keywords` text COLLATE utf8mb4_unicode_ci COMMENT 'SEO关键词',
`tags` json DEFAULT NULL COMMENT '人工打标签(多选)',
`url` varchar(2048) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '文章链接',
`image_url` text COLLATE utf8mb4_unicode_ci COMMENT '图片URL',
`content` longtext COLLATE utf8mb4_unicode_ci COMMENT '文章内容',
`is_hotspot` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否热门(0=否 1=是)',
`is_overwritten` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否已被覆盖(0=否 1=是)',
`is_deleted` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否已删除(0=否 1=是)',
`is_replicate` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否为副本(0=否 1=是)',
`state` tinyint(1) NOT NULL DEFAULT '0' COMMENT '状态(0=未发布订阅 1=已发布订阅 2=已推送)',
`language` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '语言(zh-CN=中文 en=英文)',
`data_time` timestamp NOT NULL COMMENT '数据生成时间',
`created_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '数据创建时间',
`updated_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '数据更新时间',
`extra_data` json DEFAULT NULL COMMENT '附带数据(JSON)',
PRIMARY KEY (`id`),
KEY `INDEX_MAIN_TITLE` (`main_title`),
KEY `INDEX_SUB_TITLE` (`sub_title`),
KEY `INDEX_CREATED_TIME` (`created_time` DESC),
KEY `INDEX_TAG` (`tag`),
KEY `INDEX_HOTSPOT` (`is_hotspot`,`is_overwritten`,`is_deleted`)
) ENGINE=InnoDB AUTO_INCREMENT=213 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='新闻文章数据表(AI编辑)';
*/