database

package
v0.0.0-...-6559d9f Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DBService

type DBService struct{}

DBService 接口的实现

func (*DBService) AddNewBlogToUser

func (dbservice *DBService) AddNewBlogToUser(blog model.Blog) bool

AddNewBlogToUser 为用户增加从文件名到ID的映射

func (*DBService) AddNewSignUpUser

func (dbservice *DBService) AddNewSignUpUser(user model.User)

AddNewSignUpUser 添加博客网站注册用户

func (*DBService) DeleteBlogByID

func (dbservice *DBService) DeleteBlogByID(id string, useremail string) error

DeleteBlogByID 删除用户自己的博客

func (*DBService) GetAllBlogData

func (dbservice *DBService) GetAllBlogData(idlist []string) (bool, []model.Blog)

GetAllBlogData 从用户名ID的list获取所有博客内容

func (*DBService) GetAllBlogIDFromUserEmail

func (dbservice *DBService) GetAllBlogIDFromUserEmail(email string) (bool, []string)

GetAllBlogIDFromUserEmail 为用户增加从文件名到ID的映射

func (*DBService) GetAllPublicBlog

func (dbservice *DBService) GetAllPublicBlog() (bool, []model.Blog)

GetAllPublicBlog 获取所有用户的public博客

func (*DBService) GetUserAllBlogName

func (dbservice *DBService) GetUserAllBlogName(user model.User) []string

GetUserAllBlogName 从

func (*DBService) GetUserFromEmail

func (dbservice *DBService) GetUserFromEmail(email string) (bool, model.User)

GetUserFromEmail 根据邮箱获取用户信息

func (*DBService) UserCreateBlog

func (dbservice *DBService) UserCreateBlog(blog model.Blog) bool

UserCreateBlog 用户新建博客

type DBServiceInterface

type DBServiceInterface interface {
	GetUserFromEmail(email string) (bool, model.User)
	AddNewSignUpUser(user model.User)
	UserCreateBlog(blog model.Blog) bool
	GetUserAllBlogName(user model.User) []string
	AddNewBlogToUser(blog model.Blog) bool
	GetAllBlogIDFromUserEmail(email string) (bool, []string)
	GetAllBlogData(idlist []string) (bool, []model.Blog)
	GetAllPublicBlog() (bool, []model.Blog)
	DeleteBlogByID(id string, useremail string) error
}

DBServiceInterface 定义数据库操作接口

Jump to

Keyboard shortcuts

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