model

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2022 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteSubscription

func DeleteSubscription(url string, account int64, isGroup bool) error

删除订阅关系

func InitDB

func InitDB()

初始化数据库链接

func InsertHash

func InsertHash(hashStr string) error

插入已经推送的hash

func InsertSubscription

func InsertSubscription(url, name string, account int64, isGroup bool) error

插入订阅关系

func IsFeedExist

func IsFeedExist(hashStr string) bool

查询文章是否已经存在

Types

type Feed

type Feed struct {
	ID   uint
	URL  string `gorm:"index:idx_feed;unique;not null"`
	Name string `gorm:"index:idx_feed;not null"`
}

func QueryFeed

func QueryFeed(account int64, isGroup bool) (result []*Feed, err error)

查询某人订阅的feeds

func Search() (feeds []Feed)

type Summary

type Summary struct {
	ID   uint
	Hash string `gorm:"index;unique"`
}

type User

type User struct {
	ID      uint
	Account int64   `gorm:"uniqueIndex:idx_user;not null"`
	IsGroup bool    `gorm:"uniqueIndex:idx_user;not null"`
	Feeds   []*Feed `gorm:"many2many:subscriptions"`
}

func QueryUser

func QueryUser() (users []User, err error)

查询带有订阅关系的用户列表

Jump to

Keyboard shortcuts

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