init project

This commit is contained in:
LeeShuang
2021-12-08 23:43:14 +08:00
commit 2f72bfa946
19 changed files with 677 additions and 0 deletions

11
api/utils.go Normal file
View File

@ -0,0 +1,11 @@
package api
import (
"net/http"
)
func GetUserIdInCookie(r *http.Request) (string, error) {
userIdCookie, err := r.Cookie("user_id")
return userIdCookie.Value, err
}