update restful api

This commit is contained in:
steven
2021-12-09 22:02:57 +08:00
parent bdaeb3a68b
commit a08ad0ebab
17 changed files with 520 additions and 94 deletions

View File

@ -4,8 +4,18 @@ import (
"net/http"
)
type Response struct {
Succeed bool `json:"succeed"`
Message string `json:"message"`
Data interface{} `json:"data"`
}
func GetUserIdInCookie(r *http.Request) (string, error) {
userIdCookie, err := r.Cookie("user_id")
if err != nil {
return "", err
}
return userIdCookie.Value, err
}