models

package
v0.0.0-...-b58bbae Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 17, 2022 License: MIT Imports: 9 Imported by: 6

Documentation

Index

Constants

View Source
const (
	// 小说状态
	BOOKOPEN uint8 = iota + 1
	BOOKFINISH
	BOOKEUNUCHS
)
View Source
const (
	TABLE_CHAPTER_SLICE_NUM uint32 = 100
)
View Source
const (
	// 表前缀
	TABLE_PREFIX = "nov_"
)

Variables

View Source
var (
	RoleModel       *Role
	AdminModel      *Admin
	GroupModel      *Group
	AdminLogModel   *AdminLog
	NovelModel      *Novel
	NovelLinksModel *NovelLinks
	CateModel       *Cate
	ChapterModel    *Chapter
	FeedbackModel   *Feedback
	BannerModel     *Banner
	ConfigModel     *Config
	SearchModel     *Search
	SearchLogModel  *SearchLog
	SnatchRuleModel *SnatchRule
)

Functions

func InitDB

func InitDB()

db初始化操作

func InitModel

func InitModel()

Types

type Admin

type Admin struct {
	Id            uint32 `orm:"auto"`
	Account       string `orm:"size(30);unique"`
	Mail          string `orm:"size(100)"`
	Name          string `orm:"size(20)"`
	Mobile        uint64 `orm:"size(11)"`
	Password      string `orm:"size(100)"`
	GroupId       uint32 `orm:"size(11);default(0)"`
	GroupName     string `orm:"-"`
	Status        uint8  `orm:"size(1);default(0)"`
	LoginVisit    uint32 `orm:"size(1);default(0)"`
	LastLoginIp   string `orm:"size(15)"`
	LastLoginedAt uint32 `orm:"size(11)"`
	CreatedAt     uint32 `orm:"size(11)"`
	UpdatedAt     uint32 `orm:"size(11)"`
	DeletedAt     uint32 `orm:"size(11);default(0)"`
}

管理员模型

func NewAdmin

func NewAdmin() *Admin

func (*Admin) Delete

func (m *Admin) Delete(forceDelete ...bool) error

删除

func (*Admin) GetAll

func (m *Admin) GetAll() []*Admin

获取管理员列表

func (*Admin) GetByAccount

func (m *Admin) GetByAccount(account string) *Admin

判断账号是否存在

func (*Admin) Insert

func (m *Admin) Insert() error

添加

func (*Admin) Read

func (m *Admin) Read(fields ...string) error

读取

func (Admin) StatusName

func (m Admin) StatusName() string

获取用户状态

func (*Admin) Update

func (m *Admin) Update(fields ...string) error

修改

type AdminLog

type AdminLog struct {
	Id        uint32 `orm:"auto"`
	Uid       uint32 `orm:"size(11)"`
	Name      string `orm:"size(50)"`
	Ip        string `orm:"size(15);"`
	Type      uint   `orm:"size(5);"`
	Content   string `orm:"size(255);"`
	CreatedAt uint32 `orm:"size(11)"`
	UpdatedAt uint32 `orm:"size(11)"`
	DeletedAt uint32 `orm:"size(11);default(0)"`
}

后台日记操作

func NewAdminLog

func NewAdminLog() *AdminLog

func (*AdminLog) Delete

func (m *AdminLog) Delete(forceDelete ...bool) error

删除

func (*AdminLog) DeleteBatch

func (m *AdminLog) DeleteBatch(ids []string) error

批量删除

func (*AdminLog) GetAll

func (m *AdminLog) GetAll(args ArgsAdminLog) ([]*AdminLog, int64)

获取日记列表

func (*AdminLog) Insert

func (m *AdminLog) Insert() error

添加

func (*AdminLog) Read

func (m *AdminLog) Read(fields ...string) error

读取

func (*AdminLog) Update

func (m *AdminLog) Update(fields ...string) error

修改

type ArgsAdminLog

type ArgsAdminLog struct {
	ArgsBase
	StartTime int64
	EndTime   int64
}

管理日记列表参数

type ArgsBase

type ArgsBase struct {
	Count   bool
	Limit   int
	Offset  int
	OrderBy string
	Fields  []string
	Keyword string
}

type ArgsListRule

type ArgsListRule struct {
	Ids []interface{}
}
type ArgsNovelLinksList struct {
	ArgsBase
	NovId  uint32
	Link   string
	Source string
}

type ArgsNovelList

type ArgsNovelList struct {
	ArgsBase
	StartTextNum        int
	EndTextNum          int
	MaxChapterUpdatedAt int64
	FilterMaps          map[string]int
}

type ArgsSearchList

type ArgsSearchList struct {
	ArgsBase
	IsRec int
}

type ArgsSearchLogList

type ArgsSearchLogList struct {
	ArgsBase
	StartTime int64
	EndTime   int64
}
type Banner struct {
	Id        uint32 `orm:"auto;size(11)"`
	Name      string `orm:"size(100)"`
	Img       string `orm:"size(100)"`
	Link      string `orm:"size(100)"`
	Zone      uint8  `orm:"size(3)"`
	Ext       string `orm:"size(100)"`
	Desc      string `orm:"size(100)"`
	Status    uint8  `orm:"size(1);default(0)"`
	CreatedAt uint32 `orm:"size(11);default(0)"`
	UpdatedAt uint32 `orm:"size(11);default(0)"`
	DeletedAt uint32 `orm:"size(11);default(0)`
}

banner图管理

func NewBanner

func NewBanner() *Banner

func (*Banner) Delete

func (m *Banner) Delete(forceDelete ...bool) error

删除

func (*Banner) DeleteBatch

func (m *Banner) DeleteBatch(ids []string) error

批量删除

func (*Banner) GetAll

func (m *Banner) GetAll(args map[string]interface{}) []*Banner

获取banner列表

func (*Banner) Insert

func (m *Banner) Insert() error

添加

func (*Banner) Read

func (m *Banner) Read(fields ...string) error

读取

func (Banner) StatusName

func (m Banner) StatusName() string

获取是否显示

func (*Banner) Update

func (m *Banner) Update(fields ...string) error

修改

type Cate

type Cate struct {
	Id        uint32 `orm:"auto;size(11)"`
	Name      string `orm:"size(100)"`
	IsMenu    uint8  `orm:"size(1);default(0)"`
	IsHome    uint8  `orm:"size(1);default(0)"`
	CreatedAt uint32 `orm:"size(11);default(0)"`
	UpdatedAt uint32 `orm:"size(11);default(0)"`
	DeletedAt uint32 `orm:"size(11);default(0)`
}

小说分类

func NewCate

func NewCate() *Cate

func (*Cate) Delete

func (m *Cate) Delete(forceDelete ...bool) error

删除

func (*Cate) DeleteBatch

func (m *Cate) DeleteBatch(ids []string) error

批量删除

func (*Cate) GetAll

func (m *Cate) GetAll() []*Cate

获取分类列表

func (*Cate) Insert

func (m *Cate) Insert() error

添加

func (Cate) IsHomeName

func (m Cate) IsHomeName() string

获取是否首页显示

func (Cate) IsMenuName

func (m Cate) IsMenuName() string

获取是否菜单

func (*Cate) Read

func (m *Cate) Read(fields ...string) error

读取

func (*Cate) Update

func (m *Cate) Update(fields ...string) error

修改

type CateMap

type CateMap struct {
	Id   uint32 `json:"id"`
	Name string `json:"name"`
}

分类映射

type Chapter

type Chapter struct {
	Id        uint64 `orm:"auto"`
	NovId     uint32 `orm:"size(11)"`
	ChapterNo uint32 `orm:"size(11)"`
	Title     string `orm:"size(100)"`
	Desc      string `orm:"type(text)"`
	Link      string `orm:"size(100)"`
	Source    string `orm:"size(10)"`
	Views     uint32 `orm:"size(11);default(0);"`
	TextNum   uint32 `orm:"size(11);default(0);"`
	Status    uint8  `orm:"size(1);default(0);"`
	TryViews  uint8  `orm:"size(2);default(0);"`
	CreatedAt uint32 `orm:"size(11);default(0);"`
	UpdatedAt uint32 `orm:"size(11);default(0);"`
	DeletedAt uint32 `orm:"size(11);default(0)"`
}

小说章节内容

func NewChapter

func NewChapter() *Chapter

func (*Chapter) Count

func (m *Chapter) Count() int64

获取小说章节统计

func (*Chapter) DelByNovId

func (m *Chapter) DelByNovId() error

删除指定小说所有章节

func (*Chapter) Delete

func (m *Chapter) Delete() error

删除

func (*Chapter) DeleteBatch

func (m *Chapter) DeleteBatch(ids []string) error

批量删除

func (*Chapter) GetByChapNo

func (m *Chapter) GetByChapNo(asc string) error

获取小说上下章节

func (*Chapter) GetByTitle

func (m *Chapter) GetByTitle() error

根据小说ID和标题读取

func (*Chapter) GetChapsTextNum

func (m *Chapter) GetChapsTextNum(ids []string) int64

获取多个章节字数统计

func (*Chapter) GetEmptyChaps

func (m *Chapter) GetEmptyChaps() []*Chapter

获取小说空章节列表

func (*Chapter) GetFirst

func (m *Chapter) GetFirst() error

获取小说第一章节

func (*Chapter) GetLast

func (m *Chapter) GetLast() error

获取小说最新章节

func (*Chapter) GetNovChaps

func (m *Chapter) GetNovChaps(size, offset int, sort string) []*Chapter

获取小说章节列表

func (*Chapter) Insert

func (m *Chapter) Insert() error

添加

func (*Chapter) InsertMulti

func (m *Chapter) InsertMulti(chapters []*Chapter) error

批量添加

func (*Chapter) Read

func (m *Chapter) Read() error

读取

func (Chapter) StatusName

func (m Chapter) StatusName() string

获取是否推荐

func (*Chapter) Update

func (m *Chapter) Update(fields ...string) error

修改章节信息

func (*Chapter) UpdateEmpty

func (m *Chapter) UpdateEmpty(fields ...string) error

修改空章节信息

func (*Chapter) UpdateViews

func (m *Chapter) UpdateViews(fields ...string) error

修改章节浏览次数累加

type Config

type Config struct {
	Id        uint32 `orm:"auto;size(11)"`
	Key       string `orm:"size(50)"`
	Value     string `orm:"size(255)"`
	CreatedAt uint32 `orm:"size(11)"`
	UpdatedAt uint32 `orm:"size(11)"`
}

配置模型

func NewConfig

func NewConfig() *Config

func (*Config) Delete

func (m *Config) Delete() error

删除

func (*Config) GetAll

func (m *Config) GetAll() []*Config

获取配置列表

func (*Config) Insert

func (m *Config) Insert() error

添加

func (*Config) Read

func (m *Config) Read(fields ...string) error

读取

func (*Config) Update

func (m *Config) Update(key, value string) error

修改

type Feedback

type Feedback struct {
	Id        uint32 `orm:"auto"`
	Uid       uint32 `orm:"size(11)"`
	Name      string `orm:"size(50)"`
	Ip        string `orm:"size(15);"`
	Type      uint   `orm:"size(5);"`
	Status    uint   `orm:"size(1);"`
	Content   string `orm:"size(255);"`
	Contact   string `orm:"size(100);"`
	Reply     string `orm:"size(255);"`
	ReplyAt   uint32 `orm:"size(11);"`
	CreatedAt uint32 `orm:"size(11)"`
	UpdatedAt uint32 `orm:"size(11)"`
	DeletedAt uint32 `orm:"size(11);default(0)"`
}

用户意见反馈

func NewFeedback

func NewFeedback() *Feedback

func (*Feedback) Delete

func (m *Feedback) Delete(forceDelete ...bool) error

删除反馈记录

func (*Feedback) DeleteBatch

func (m *Feedback) DeleteBatch(ids []string) error

批量删除反馈记录

func (*Feedback) GetAll

func (m *Feedback) GetAll(size, offset int, args map[string]string) ([]*Feedback, int64)

获取反馈列表

func (*Feedback) Insert

func (m *Feedback) Insert() error

添加反馈记录

func (*Feedback) Read

func (m *Feedback) Read(fields ...string) error

读取单条记录

func (*Feedback) Update

func (m *Feedback) Update(fields ...string) error

修改反馈记录

type Group

type Group struct {
	Id        uint32 `orm:"auto"`
	Name      string `orm:"size(30)"`
	Desc      string `orm:"size(255)"`
	RoleIds   string `orm:"size(2555);"`
	CreatedAt uint32 `orm:"size(11)"`
	UpdatedAt uint32 `orm:"size(11)"`
	DeletedAt uint32 `orm:"size(11);default(0)"`
}

管理员群组

func NewGroup

func NewGroup() *Group

func (*Group) Delete

func (m *Group) Delete(forceDelete ...bool) error

删除

func (*Group) GetAll

func (m *Group) GetAll() []*Group

获取群组列表

func (*Group) GetRoleIds

func (m *Group) GetRoleIds() []string

获取权限id列表

func (*Group) HasRole

func (m *Group) HasRole(roleId uint32) bool

判断是否有权限

func (*Group) Insert

func (m *Group) Insert() error

添加

func (*Group) Read

func (m *Group) Read(fields ...string) error

读取

func (*Group) Update

func (m *Group) Update(fields ...string) error

修改

type Novel

type Novel struct {
	Id               uint32 `orm:"auto"`
	Name             string `orm:"size(100)"`
	Desc             string `orm:"size(2555)"`
	Cover            string `orm:"size(100);"`
	CateId           uint32 `orm:"size(11);default(0);"`
	CateName         string `orm:"size(30);"`
	Author           string `orm:"size(30);"`
	IsOriginal       uint8  `orm:"size(1);default(0);"`
	IsHot            uint8  `orm:"size(1);default(0);"`
	IsRec            uint8  `orm:"size(1);default(0);"`
	IsTodayRec       uint8  `orm:"size(1);default(0);"`
	IsVipRec         uint8  `orm:"size(1);default(0);"`
	IsVipReward      uint8  `orm:"size(1);default(0);"`
	IsVipUp          uint8  `orm:"size(1);default(0);"`
	IsSignNewBook    uint8  `orm:"size(1);default(0);"`
	IsCollect        uint8  `orm:"size(1);default(0);"`
	Status           uint8  `orm:"size(11);default(0);"`
	Views            uint32 `orm:"size(11);default(0);"`
	CollectNum       uint32 `orm:"size(11);default(0)"`
	RecNum           uint32 `orm:"size(11);default(0)"`
	TextNum          uint32 `orm:"size(11);default(0)"`
	ChapterNum       uint32 `orm:"size(6);default(0)"`
	ChapterUpdatedAt uint32 `orm:"size(11);default(0);"`
	ChapterId        uint64 `orm:"size(20);default(0);"`
	ChapterTitle     string `orm:"size(100);"`
	CreatedAt        uint32 `orm:"size(11);default(0);"`
	UpdatedAt        uint32 `orm:"size(11);default(0);"`
	DeletedAt        uint32 `orm:"size(11);default(0)"`
}

小说内容

func NewNovel

func NewNovel() *Novel

func (*Novel) Delete

func (m *Novel) Delete(forceDelete ...bool) error

删除

func (*Novel) DeleteBatch

func (m *Novel) DeleteBatch(ids []string) error

批量删除

func (*Novel) GetAll

func (m *Novel) GetAll(args ArgsNovelList) ([]*Novel, int64)

获取小说列表

func (*Novel) GetByName

func (m *Novel) GetByName(name string) *Novel

判断小说是否存在

func (*Novel) Insert

func (m *Novel) Insert() error

添加

func (Novel) IsHotName

func (m Novel) IsHotName() string

获取是否热门

func (Novel) IsOriginalName

func (m Novel) IsOriginalName() string

获取是否原创小说

func (Novel) IsRecName

func (m Novel) IsRecName() string

获取是否推荐

func (Novel) IsVipRecName

func (m Novel) IsVipRecName() string

获取是否精品

func (*Novel) Read

func (m *Novel) Read(fields ...string) error

读取

func (Novel) StatusList

func (m Novel) StatusList() map[uint8]string

func (Novel) StatusName

func (m Novel) StatusName() string

获取状态

func (*Novel) UpRecBatch

func (m *Novel) UpRecBatch(field string, books []string) error

批量更新推荐

func (*Novel) Update

func (m *Novel) Update(fields ...string) error

修改

type NovelLinks struct {
	Id          uint32 `orm:"auto"`
	NovId       uint32 `orm:"size(11)"`
	Link        string `orm:"size(100)"`
	Source      string `orm:"size(30);"`
	ChapterLink string `orm:"size(100);"`
	CreatedAt   uint32 `orm:"size(11);default(0);"`
	UpdatedAt   uint32 `orm:"size(11);default(0);"`
	DeletedAt   uint32 `orm:"size(11);default(0)"`
}

小说采集来源列表内容

func NewNovelLinks() *NovelLinks

func (*NovelLinks) DelByNovId

func (m *NovelLinks) DelByNovId(novId uint32) error

删除指定小说所有采集点

func (*NovelLinks) Delete

func (m *NovelLinks) Delete(forceDelete ...bool) error

删除

func (*NovelLinks) GetAll

func (m *NovelLinks) GetAll(args ArgsNovelLinksList) ([]*NovelLinks, int64)

获取小说采集点列表

func (m *NovelLinks) GetByLink(link, source string) *NovelLinks

判断小说是否存在

func (*NovelLinks) Insert

func (m *NovelLinks) Insert() error

添加

type Role

type Role struct {
	Id        uint32  `orm:"auto;size(11)"`
	Pid       uint32  `orm:"default(0);"`
	Name      string  `orm:"size(30)"`
	Icon      string  `orm:"size(10)"`
	IsMenu    uint8   `orm:"size(1)"`
	Desc      string  `orm:"size(255)"`
	Module    string  `orm:"size(50)"`
	Action    string  `orm:"size(50)"`
	Sort      uint8   `orm:"size(3)"`
	IsDefault uint8   `orm:"size(1);default(0)"`
	CreatedAt uint32  `orm:"size(11)"`
	UpdatedAt uint32  `orm:"size(11)"`
	DeletedAt uint32  `orm:"size(11);default(0)"`
	Child     []*Role `orm:"-"`
}

权限模型

func NewRole

func NewRole() *Role

func (*Role) Delete

func (m *Role) Delete(forceDelete ...bool) error

删除

func (*Role) GetByPurview

func (m *Role) GetByPurview(module, action string) *Role

根据接口获取权限id

func (*Role) GetMenus

func (m *Role) GetMenus(roleIds []string) []*Role

获取后台菜单列表

func (*Role) GetRoles

func (m *Role) GetRoles() []*Role

获取权限列表

func (*Role) Insert

func (m *Role) Insert() error

添加

func (Role) IsMenuName

func (m Role) IsMenuName() string

获取是否菜单

func (*Role) Read

func (m *Role) Read(fields ...string) error

读取

func (*Role) Update

func (m *Role) Update(fields ...string) error

修改

func (Role) Url

func (m Role) Url() string

拼接URL地址

type Rule

type Rule struct {
	// 是否小说简介页面
	IsBookURL string `json:"is_book_url"`

	// 是否可爬虫页面
	IsCrawlerURL string `json:"is_crawler_url"`

	// 小说简介页面采集规则
	BookTitleSelector            string `json:"book_title_selector"` // 小说标题
	BookTitleAttr                string `json:"book_title_attr"`     // 小说标题css选择器获取属性
	BookTitleFilter              string `json:"book_title_filter"`
	BookAuthorSelector           string `json:"book_author_selector"`
	BookAuthorAttr               string `json:"book_author_attr"`
	BookAuthorFilter             string `json:"book_author_filter"`
	BookCateSelector             string `json:"book_cate_selector"`
	BookCateAttr                 string `json:"book_cate_attr"`
	BookCateFilter               string `json:"book_cate_filter"`
	BookDescSelector             string `json:"book_desc_selector"`
	BookDescAttr                 string `json:"book_desc_attr"`
	BookDescFilter               string `json:"book_desc_filter"`
	BookCoverSelector            string `json:"book_cover_selector"`
	BookCoverAttr                string `json:"book_cover_attr"`
	BookNoCover                  string `json:"book_no_cover"`
	BookChapterURLSelector       string `json:"book_chapter_url_selector"`
	BookChapterURLAttr           string `json:"book_chapter_url_attr"`
	BookLastChapterTitleSelector string `json:"book_last_chapter_title_selector"`
	BookLastChapterTitleAttr     string `json:"book_last_chapter_title_attr"`

	// 章节目录采集规则
	ChapterCatalogSelector  string `json:"chapter_catalog_selector"`
	ChapterNextPageSelector string `json:"chapter_next_page_selector"` // 章节目录下一页选择器
	ChapterAbandonNum       int    `json:"chapter_abandon_num"`        // 丢弃章节数(最新章节)

	// 详情页面采集规则
	InfoTitleSelector    string `json:"info_title_selector"`
	InfoTitleFilter      string `json:"info_title_filter"`
	InfoDescSelector     string `json:"info_desc_selector"`
	InfoDescFilter       string `json:"info_desc_filter"`
	InfoPrePageSelector  string `json:"info_pre_page_selector"`
	InfoNextPageSelector string `json:"info_next_page_selector"`

	// 搜索页面采集规则
	FindURL             string `json:"find_url"`
	FindCharset         string `json:"find_charset"`
	FindBookURLSelector string `json:"find_book_url_selector"`
}

采集规则

type Search struct {
	Id        uint64 `orm:"auto"`
	Kw        string `orm:"size(100);unique"`
	Views     uint64 `orm:"size(21)"`
	IsRec     uint8  `orm:"size(1)"`
	CreatedAt uint32 `orm:"size(11)"`
	UpdatedAt uint32 `orm:"size(11)"`
}

搜索记录管理模型

func NewSearch

func NewSearch() *Search

func (*Search) Delete

func (m *Search) Delete() error

删除

func (*Search) DeleteBatch

func (m *Search) DeleteBatch(ids []string) error

批量删除

func (*Search) GetAll

func (m *Search) GetAll(args ArgsSearchList) ([]*Search, int64)

获取搜索记录列表

func (*Search) InsertOrIncrement

func (m *Search) InsertOrIncrement(kw string) error

更新搜索记录、不存在新增,存在更新搜索次数

func (Search) IsRecName

func (m Search) IsRecName() string

获取是否推荐

func (*Search) Update

func (m *Search) Update(fields ...string) error

修改

type SearchLog

type SearchLog struct {
	Id        uint64 `orm:"auto"`
	Kw        string `orm:"size(100)"`
	Uid       uint32 `orm:"size(11)"`
	Ip        string `orm:"size(15);"`
	Source    uint   `orm:"size(1);"`
	IsResult  uint   `orm:"size(1);"`
	CreatedAt uint32 `orm:"size(11)"`
	UpdatedAt uint32 `orm:"size(11)"`
	DeletedAt uint32 `orm:"size(11);default(0)"`
}

搜索日记操作

func NewSearchLog

func NewSearchLog() *SearchLog

func (*SearchLog) Delete

func (m *SearchLog) Delete(forceDelete ...bool) error

删除

func (*SearchLog) DeleteBatch

func (m *SearchLog) DeleteBatch(ids []string) error

批量删除

func (*SearchLog) GetAll

func (m *SearchLog) GetAll(args ArgsSearchLogList) ([]*SearchLog, int64)

获取搜索日记列表

func (*SearchLog) Insert

func (m *SearchLog) Insert() error

添加

func (SearchLog) IsResultName

func (m SearchLog) IsResultName() string

获取是否推荐

func (SearchLog) SourceName

func (m SearchLog) SourceName() string

获取是否推荐

func (*SearchLog) Update

func (m *SearchLog) Update(fields ...string) error

修改

type SnatchRule

type SnatchRule struct {
	Id        uint32 `orm:"auto;size(11)"`
	Name      string `orm:"size(50)"`
	Code      string `orm:"size(20)"`
	Url       string `orm:"size(50)"`
	State     uint8  `orm:"size(1)"`
	IsUpdate  uint8  `orm:"size(1);default(0)"`
	Charset   string `orm:"size(10)"`
	CateMap   string `orm:"size(2555)"`
	Rule      string `orm:"size(2555)"`
	TestData  string `orm:"size(2555)"`
	CreatedAt uint32 `orm:"size(11)"`
	UpdatedAt uint32 `orm:"size(11)"`
	DeletedAt uint32 `orm:"size(11)"`

	Test     *SnatchTestData `orm:"-"`
	Rules    *Rule           `orm:"-"`
	CateMaps []*CateMap      `orm:"-"`
}

采集规则配置模型

func NewSnatchRule

func NewSnatchRule() *SnatchRule

func (*SnatchRule) Decode

func (m *SnatchRule) Decode() error

func (*SnatchRule) Delete

func (m *SnatchRule) Delete(forceDelete ...bool) error

删除

func (*SnatchRule) DeleteBatch

func (m *SnatchRule) DeleteBatch(ids []string) error

批量删除

func (*SnatchRule) Encode

func (m *SnatchRule) Encode() error

func (*SnatchRule) GetAll

func (m *SnatchRule) GetAll(args *ArgsListRule) []*SnatchRule

获取配置列表

func (*SnatchRule) GetByCode

func (m *SnatchRule) GetByCode(code string) *SnatchRule

根据接口获取权限id

func (*SnatchRule) Insert

func (m *SnatchRule) Insert() error

添加

func (*SnatchRule) Read

func (m *SnatchRule) Read(fields ...string) error

读取

func (SnatchRule) StateName

func (m SnatchRule) StateName() string

获取是否启用

func (*SnatchRule) Update

func (m *SnatchRule) Update(fields ...string) error

修改

type SnatchTestData

type SnatchTestData struct {
	// 小说简介页面
	BookURL        string `json:"book_url"`         // 小说简介URL
	BookTitle      string `json:"book_title"`       // 小说标题
	BookAuthor     string `json:"book_author"`      // 小说作者
	BookCate       string `json:"book_cate"`        // 小说分类名
	BookDesc       string `json:"book_desc"`        // 小说简介
	BookCover      string `json:"book_cover"`       // 小说封面LOGO
	BookChapterURL string `json:"book_chapter_url"` // 小说章节页面URL

	// 章节目录
	ChapterURL          string `json:"chapter_url"`           // 章节目录URL
	ChapterCatalogURL   string `json:"chapter_catalog_url"`   // 章节目录中第一个章节的URL地址
	ChapterCatalogTitle string `json:"chapter_catalog_title"` // 章节目录中第一个章节的标题

	// 详情页面
	InfoURL         string `json:"info_url"`           // 小说章节页面URL
	InfoTitle       string `json:"info_title"`         // 小说章节标题
	InfoDesc        string `json:"info_desc"`          // 小说章节内容
	InfoPrePageURL  string `json:"info_pre_page_url"`  // 上一章节URL
	InfoNextPageURL string `json:"info_next_page_url"` // 下一章节URL

	// 搜索页面获得URL
	FindBookKw  string `json:"find_book_kw"`  // 搜索关键词
	FindBookURL string `json:"find_book_url"` // 搜索结果小说简介页面的URL
}

采集测试对比数据

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL