Drop LevelDB and move all the things to SQLite. Implemented endpoints: /api <unit, accessoryMaterialAll> /api <unit, accessoryTab> /live/continue /live/partyList /unit/favoriteAccessory (WIP) /unit/sale Signed-off-by: Sean Du <do4suki@gmail.com>
45 lines
1023 B
Go
45 lines
1023 B
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: true,
|
|
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)
|
|
}
|