server

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: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateBlogHandler

func CreateBlogHandler(w http.ResponseWriter, req *http.Request) (bool, interface{})

CreateBlogHandler 提供创建博客服务

func CreateUserHandler

func CreateUserHandler(w http.ResponseWriter, req *http.Request) (bool, interface{})

CreateUserHandler 提供创建用户服务

func DeleteBlogHandler

func DeleteBlogHandler(w http.ResponseWriter, req *http.Request) (bool, interface{})

DeleteBlogHandler 提供删除博客服务

func GetAllBlogFromUserHandler

func GetAllBlogFromUserHandler(w http.ResponseWriter, req *http.Request) (bool, interface{})

GetAllBlogFromUserHandler 获取当前用户所有的博客

func GetAllBlogPublic

func GetAllBlogPublic(w http.ResponseWriter, req *http.Request) (bool, interface{})

GetAllBlogPublic 获取当前所有public博客

func UserLoginHandler

func UserLoginHandler(w http.ResponseWriter, req *http.Request) (bool, interface{})

UserLoginHandler 提供用户登录服务

Types

type CreateBlogRequest

type CreateBlogRequest struct {
	Title    string `json:"title"`
	IsPublic string `json:"ispublic"`
	Content  string `json:"content"`
	Tag      string `json:"tag"`
}

CreateBlogRequest 用户创建博客请求

type CreateUserRequest

type CreateUserRequest struct {
	Username string `json:"username"`
	Password string `json:"password"`
	Email    string `json:"email"`
}

CreateUserRequest 用于创建网站用户请求

type DeleteBlogRequest

type DeleteBlogRequest struct {
	ID string `json:"id"`
}

DeleteBlogRequest 用于用户删除自己的博客

type PublicBlogsResponse

type PublicBlogsResponse struct {
	ID          string `json:"id"`
	CreatorName string `json:"creatorname"`
	CreateTime  string `json:"createtime"`
	Title       string `json:"title"`
	Content     string `json:"content"`
	Tag         string `json:"tag"`
}

type TokenResponse

type TokenResponse struct {
	Token string `json:"token"`
}

type UserLogInRequest

type UserLogInRequest struct {
	Password string `json:"password"`
	Email    string `json:"email"`
}

UserLogInRequest 用于用户登录请求

Jump to

Keyboard shortcuts

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