mirror of
https://github.com/bufanyun/hotgo.git
synced 2025-11-14 05:03:49 +08:00
1、泛型化参数,预留泛型约束,方便以后代码扩展的类型安全校验
2、升级goframe至v2.7.3
This commit is contained in:
@@ -48,7 +48,7 @@ func (c *cCash) List(ctx context.Context, req *cash.ListReq) (res *cash.ListRes,
|
||||
func (c *cCash) Apply(ctx context.Context, req *cash.ApplyReq) (res *cash.ApplyRes, err error) {
|
||||
err = service.AdminCash().Apply(ctx, &adminin.CashApplyInp{
|
||||
Money: req.Money,
|
||||
MemberId: contexts.GetUserId(ctx),
|
||||
MemberId: contexts.GetUserId[any](ctx),
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ func (c *cMember) UpdateProfile(ctx context.Context, req *member.UpdateProfileRe
|
||||
|
||||
// UpdatePwd 修改登录密码
|
||||
func (c *cMember) UpdatePwd(ctx context.Context, req *member.UpdatePwdReq) (res *member.UpdatePwdRes, err error) {
|
||||
var memberId = contexts.Get(ctx).User.Id
|
||||
var memberId = contexts.Get[any](ctx).User.Id
|
||||
if memberId <= 0 {
|
||||
err = gerror.New("获取用户信息失败!")
|
||||
return
|
||||
|
||||
@@ -46,7 +46,7 @@ func (c *cRole) Delete(ctx context.Context, req *role.DeleteReq) (res *role.Dele
|
||||
|
||||
// Dynamic 动态路由
|
||||
func (c *cRole) Dynamic(ctx context.Context, _ *role.DynamicReq) (res *role.DynamicRes, err error) {
|
||||
return service.AdminMenu().GetMenuList(ctx, contexts.GetUserId(ctx))
|
||||
return service.AdminMenu().GetMenuList(ctx, contexts.GetUserId[any](ctx))
|
||||
}
|
||||
|
||||
// GetPermissions 获取指定角色权限
|
||||
|
||||
@@ -44,7 +44,7 @@ func (c *cEms) SendTest(ctx context.Context, req *common.SendTestEmailReq) (res
|
||||
// SendBindEms 发送换绑邮件
|
||||
func (c *cEms) SendBindEms(ctx context.Context, _ *common.SendBindEmsReq) (res *common.SendBindEmsRes, err error) {
|
||||
var (
|
||||
memberId = contexts.GetUserId(ctx)
|
||||
memberId = contexts.GetUserId[any](ctx)
|
||||
models *entity.AdminMember
|
||||
)
|
||||
|
||||
|
||||
@@ -143,6 +143,6 @@ func (c *cSite) MobileLogin(ctx context.Context, req *common.MobileLoginReq) (re
|
||||
|
||||
// Logout 注销登录
|
||||
func (c *cSite) Logout(ctx context.Context, _ *common.LoginLogoutReq) (res *common.LoginLogoutRes, err error) {
|
||||
err = token.Logout(ghttp.RequestFromCtx(ctx))
|
||||
err = token.Logout[any](ghttp.RequestFromCtx(ctx))
|
||||
return
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ func (c *cSms) SendTest(ctx context.Context, req *common.SendTestSmsReq) (res *c
|
||||
// SendBindSms 发送换绑短信
|
||||
func (c *cSms) SendBindSms(ctx context.Context, _ *common.SendBindSmsReq) (res *common.SendBindSmsRes, err error) {
|
||||
var (
|
||||
memberId = contexts.GetUserId(ctx)
|
||||
memberId = contexts.GetUserId[any](ctx)
|
||||
models *entity.AdminMember
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user