feat: system notice
This commit is contained in:
@@ -19,6 +19,14 @@ const (
|
||||
)
|
||||
|
||||
type UserService struct {
|
||||
noticeService *NoticeService
|
||||
}
|
||||
|
||||
func NewUserService() *UserService {
|
||||
userService := UserService{
|
||||
noticeService: &NoticeService{},
|
||||
}
|
||||
return &userService
|
||||
}
|
||||
|
||||
// 用户注册
|
||||
@@ -75,6 +83,12 @@ func (u *UserService) Register(param *models.UserCreateParam) int {
|
||||
}
|
||||
}
|
||||
|
||||
// 注册通知
|
||||
u.noticeService.Create(&models.NoticeParam{
|
||||
Content: REGISTER_NOTICE_TEMPLATE,
|
||||
Creator: newUser.Id,
|
||||
})
|
||||
|
||||
return response.ErrCodeSuccess
|
||||
}
|
||||
|
||||
@@ -106,6 +120,12 @@ func (u *UserService) Login(param *models.UserLoginParam) (*models.UserInfo, int
|
||||
Token: token,
|
||||
}
|
||||
|
||||
// 登录通知
|
||||
u.noticeService.Create(&models.NoticeParam{
|
||||
Content: LOGIN_NOTICE_TEMPLATE,
|
||||
Creator: userInfo.Uid,
|
||||
})
|
||||
|
||||
return &userInfo, response.ErrCodeSuccess
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user