Files
honoka-chan/internal/handler/payment/productlist.go
T
YumeMichi 947da92a66 webui: Add user birthday settings
- Store birth month and day in user_pref with default 10/18
- Migrate existing user_pref rows to fill missing birthday fields
- Expose birthday editing in the webui profile page
- Replace hardcoded birthday values in user info, top info, and product list responses
- Fix birthday month/day field alignment in the profile form

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

45 lines
1.0 KiB
Go

package payment
import (
"honoka-chan/internal/middleware"
"honoka-chan/internal/router"
paymentapischema "honoka-chan/internal/schema/api/payment"
paymentschema "honoka-chan/internal/schema/payment"
"honoka-chan/internal/session"
"time"
"github.com/gin-gonic/gin"
)
func productList(ctx *gin.Context) {
ss := session.Get(ctx)
defer ss.Finalize()
prodResp := paymentschema.ProductListResp{
ResponseData: paymentschema.ProductListData{
RestrictionInfo: paymentapischema.RestrictionInfo{
Restricted: false,
},
UnderAgeInfo: paymentapischema.UnderAgeInfo{
BirthSet: ss.UserPref.HasBirthDate(),
HasLimit: false,
LimitAmount: nil,
MonthUsed: 0,
},
SnsProductList: []any{},
ProductList: []any{},
SubscriptionList: []any{},
ShowPointShop: true,
ServerTimestamp: time.Now().Unix(),
},
ReleaseInfo: []any{},
StatusCode: 200,
}
ss.Respond(prodResp)
}
func init() {
router.AddHandler("main.php", "POST", "/payment/productList", middleware.Common, productList)
}