Documentation ¶
Index ¶
- func CreateBlogHandler(w http.ResponseWriter, req *http.Request) (bool, interface{})
- func CreateUserHandler(w http.ResponseWriter, req *http.Request) (bool, interface{})
- func DeleteBlogHandler(w http.ResponseWriter, req *http.Request) (bool, interface{})
- func GetAllBlogFromUserHandler(w http.ResponseWriter, req *http.Request) (bool, interface{})
- func GetAllBlogPublic(w http.ResponseWriter, req *http.Request) (bool, interface{})
- func UserLoginHandler(w http.ResponseWriter, req *http.Request) (bool, interface{})
- type CreateBlogRequest
- type CreateUserRequest
- type DeleteBlogRequest
- type PublicBlogsResponse
- type TokenResponse
- type UserLogInRequest
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 TokenResponse ¶
type TokenResponse struct {
Token string `json:"token"`
}
type UserLogInRequest ¶
UserLogInRequest 用于用户登录请求
Click to show internal directories.
Click to hide internal directories.