Implement session module

Signed-off-by: Sean Du <do4suki@gmail.com>
This commit is contained in:
2025-08-15 19:24:36 +08:00
parent 985895a780
commit 80a686849f
29 changed files with 837 additions and 694 deletions
+5 -7
View File
@@ -1,16 +1,17 @@
package handler
import (
"encoding/json"
"honoka-chan/internal/model"
"honoka-chan/internal/utils"
"net/http"
"honoka-chan/internal/session"
"time"
"github.com/gin-gonic/gin"
)
func ProductList(ctx *gin.Context) {
ss := session.New(ctx)
defer ss.Finalize()
prodReesp := model.ProductResp{
ResponseData: model.ProductRes{
RestrictionInfo: model.RestrictionInfo{
@@ -31,9 +32,6 @@ func ProductList(ctx *gin.Context) {
ReleaseInfo: []any{},
StatusCode: 200,
}
resp, err := json.Marshal(prodReesp)
utils.CheckErr(err)
ctx.Header("X-Message-Sign", utils.GenXMS(resp))
ctx.String(http.StatusOK, string(resp))
ss.Respond(prodReesp)
}