refactor: 重构签到系统和战斗特效逻辑
This commit is contained in:
@@ -28,17 +28,15 @@ func init() {
|
||||
}
|
||||
|
||||
type SignStateReq struct {
|
||||
g.Meta `path:"/state" method:"GET"`
|
||||
UserID uint32 `json:"user_id" v:"required|min:1#用户ID不能为空|用户ID非法"`
|
||||
Session string `json:"session" v:"required#session不能为空"`
|
||||
SignInID uint32 `json:"sign_in_id" d:"1" v:"min:1#签到活动ID非法"`
|
||||
g.Meta `path:"/state" method:"GET"`
|
||||
UserID uint32 `json:"user_id" v:"required|min:1#用户ID不能为空|用户ID非法"`
|
||||
Session string `json:"session" v:"required#session不能为空"`
|
||||
}
|
||||
|
||||
type SignClaimReq struct {
|
||||
g.Meta `path:"/claim" method:"POST"`
|
||||
UserID uint32 `json:"user_id" v:"required|min:1#用户ID不能为空|用户ID非法"`
|
||||
Session string `json:"session" v:"required#session不能为空"`
|
||||
SignInID uint32 `json:"sign_in_id" d:"1" v:"min:1#签到活动ID非法"`
|
||||
g.Meta `path:"/claim" method:"POST"`
|
||||
UserID uint32 `json:"user_id" v:"required|min:1#用户ID不能为空|用户ID非法"`
|
||||
Session string `json:"session" v:"required#session不能为空"`
|
||||
}
|
||||
|
||||
func (c *SignController) State(ctx context.Context, req *SignStateReq) (res *cool.BaseRes, err error) {
|
||||
@@ -49,7 +47,7 @@ func (c *SignController) State(ctx context.Context, req *SignStateReq) (res *coo
|
||||
return cool.Fail(err.Error()), nil
|
||||
}
|
||||
|
||||
state, err := playerservice.NewSignService(req.UserID).GetState(req.SignInID)
|
||||
state, err := playerservice.NewSignService(req.UserID).GetState()
|
||||
if err != nil {
|
||||
return cool.Fail(err.Error()), nil
|
||||
}
|
||||
@@ -64,7 +62,7 @@ func (c *SignController) Claim(ctx context.Context, req *SignClaimReq) (res *coo
|
||||
return cool.Fail(err.Error()), nil
|
||||
}
|
||||
|
||||
result, err := playerservice.NewSignService(req.UserID).Claim(req.SignInID)
|
||||
result, err := playerservice.NewSignService(req.UserID).Claim()
|
||||
if err != nil {
|
||||
return cool.Fail(err.Error()), nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user