Files
honoka-chan/internal/handler/ghome/basic/getproductlist.go
T
YumeMichi e61c07a9a3 Reduce handler request boilerplate
- Add session.Attach to reuse per-request sessions across middleware and ghome handlers
- Make Session finalize/abort paths idempotent to avoid duplicate commit or rollback work
- Move request_data parsing helper to internal/utils
- Expand ParseRequestData usage across api, download, unit, live, multiunit, and subscenario handlers
- Extract download package metadata into internal/handler/download/types.go
- Return explicit errors from selected session lookup helpers and update callers
- Make api action handlers return errors directly instead of calling ss.CheckErr in nested layers

Signed-off-by: Sean Du <do4suki@gmail.com>
2026-06-04 03:05:32 +08:00

30 lines
547 B
Go

package basic
import (
"honoka-chan/internal/router"
ghomeschema "honoka-chan/internal/schema/ghome"
"honoka-chan/internal/session"
"github.com/gin-gonic/gin"
)
func getProductList(ctx *gin.Context) {
ss := session.Attach(ctx)
defer ss.Finalize()
getProductListData := ghomeschema.GetProductListData{
Message: []string{},
Result: 0,
}
ss.Respond(ghomeschema.GetProductListResp{
Code: 1,
Msg: "ok",
Data: getProductListData,
})
}
func init() {
router.AddHandler("v1", "POST", "/basic/getProductList", getProductList)
}