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>
This commit is contained in:
@@ -1,11 +1,15 @@
|
||||
package payment
|
||||
|
||||
import "fmt"
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
func PaymentApi(action string) (res any, err error) {
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func PaymentApi(ctx *gin.Context, action string) (res any, err error) {
|
||||
switch action {
|
||||
case "productList":
|
||||
res, err = productList()
|
||||
res, err = productList(ctx)
|
||||
default:
|
||||
err = fmt.Errorf("unimplemented action: payment: %s", action)
|
||||
}
|
||||
|
||||
@@ -2,17 +2,22 @@ package payment
|
||||
|
||||
import (
|
||||
paymentapischema "honoka-chan/internal/schema/api/payment"
|
||||
"honoka-chan/internal/session"
|
||||
"time"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func productList() (res any, err error) {
|
||||
func productList(ctx *gin.Context) (res any, err error) {
|
||||
ss := session.Get(ctx)
|
||||
|
||||
res = paymentapischema.ProductListResp{
|
||||
Result: paymentapischema.ProductListData{
|
||||
RestrictionInfo: paymentapischema.RestrictionInfo{
|
||||
Restricted: false,
|
||||
},
|
||||
UnderAgeInfo: paymentapischema.UnderAgeInfo{
|
||||
BirthSet: false,
|
||||
BirthSet: ss.UserPref.HasBirthDate(),
|
||||
HasLimit: false,
|
||||
LimitAmount: nil,
|
||||
MonthUsed: 0,
|
||||
|
||||
Reference in New Issue
Block a user