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>
30 lines
585 B
Go
30 lines
585 B
Go
package user
|
|
|
|
import (
|
|
usermodel "honoka-chan/internal/model/user"
|
|
userapischema "honoka-chan/internal/schema/api/user"
|
|
"honoka-chan/internal/session"
|
|
"time"
|
|
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
func userInfo(ctx *gin.Context) (res any, err error) {
|
|
ss := session.Get(ctx)
|
|
|
|
pref := usermodel.UserPref{}
|
|
_, err = ss.UserEng.Table("user_pref").Where("user_id = ?", ss.UserID).Get(&pref)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
res = userapischema.InfoResp{
|
|
Result: ss.GetUserInfo(),
|
|
Status: 200,
|
|
CommandNum: false,
|
|
TimeStamp: time.Now().Unix(),
|
|
}
|
|
|
|
return res, err
|
|
}
|