You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

91 lines
2.1 KiB

package user
import (
"recook/internal/libs/bean"
)
type Welfare struct {
}
type argsLists struct {
Type uint `json:"type" form:"type"`
bean.Page
}
// @Style 角色卡
//func (w *Welfare) Lists(c *gin.Context) {
// args := argsLists{}
// if err := tools.ParseParams(&args, c); err != nil {
// back.Fail(c, err.Error())
// return
// }
// userId, _ := common.GetAppUserId(c)
// lists, total := user.WelfareLogic.Lists(userId, args.Type, args.Page)
// back.Suc(c, "操作成功", bean.ResultLists{
// List: lists,
// Total: total,
// })
//}
type argsGive struct {
CardId uint `json:"cardId" form:"cardId"`
GiveUserId uint `json:"giveUserId" form:"giveUserId"`
}
//// @Style 角色卡赠送
//func (w *Welfare) Give(c *gin.Context) {
// args := argsGive{}
// if err := tools.ParseParams(&args, c); err != nil {
// back.Fail(c, err.Error())
// return
// }
// userId, _ := common.GetAppUserId(c)
// err := user.WelfareLogic.Give(userId, args.CardId, args.GiveUserId)
// if err != nil {
// back.Fail(c, err.Error())
// return
// }
// back.Suc(c, "操作成功", nil)
//}
//// @Style 角色卡使用
//func (w *Welfare) Use(c *gin.Context) {
// args := argsGive{}
// if err := tools.ParseParams(&args, c); err != nil {
// back.Fail(c, err.Error())
// return
// }
// userId, _ := common.GetAppUserId(c)
// err := user.WelfareLogic.Use(userId, args.CardId)
// if err != nil {
// back.Fail(c, err.Error())
// return
// }
// back.Suc(c, "操作成功", nil)
//}
//// @Style 通知列表
//func (w *Welfare) NoticeList(c *gin.Context) {
// userId, _ := common.GetAppUserId(c)
// list := user.WelfareLogic.NoticeList(userId)
// back.Suc(c, "操作成功", list)
//}
type argsNoticeLook struct {
NoticeId uint `json:"noticeId" form:"noticeId"`
}
// @Style 查看通知
//func (w *Welfare) NoticeLook(c *gin.Context) {
// args := argsNoticeLook{}
// if err := tools.ParseParams(&args, c); err != nil {
// back.Fail(c, err.Error())
// return
// }
// userId, _ := common.GetAppUserId(c)
// if err := user.WelfareLogic.NoticeLook(userId, args.NoticeId); err != nil {
// back.Fail(c, err.Error())
// return
// }
// back.Suc(c, "操作成功", nil)
//}