carv api logic
This commit is contained in:
@@ -39,6 +39,7 @@ type ServiceContext struct {
|
||||
StakePropertyModel model.NhNftStakePropertyModel
|
||||
EmailRewardModel model.NhEmailRewardModel
|
||||
AmbassadorModel model.NhTaskAmbassadorModel
|
||||
GameReportModel model.NhGameReportModel
|
||||
|
||||
ApiKeyCheck rest.Middleware
|
||||
AdminSecretCheck rest.Middleware
|
||||
@@ -74,6 +75,7 @@ func NewServiceContext(c config.Config) *ServiceContext {
|
||||
StakePropertyModel: model.NewNhNftStakePropertyModel(dbConn),
|
||||
EmailRewardModel: model.NewNhEmailRewardModel(dbConn),
|
||||
AmbassadorModel: model.NewNhTaskAmbassadorModel(dbConn),
|
||||
GameReportModel: model.NewNhGameReportModel(dbConn),
|
||||
|
||||
ApiKeyCheck: middleware.NewApiKeyCheckMiddleware(configModel).Handle,
|
||||
AdminSecretCheck: middleware.NewAdminSecretCheckMiddleware(configModel).Handle,
|
||||
@@ -121,7 +123,7 @@ func (s *ServiceContext) HasBindTwitter(ctx context.Context, uid uint) bool {
|
||||
return tw.TwitterId != ""
|
||||
}
|
||||
|
||||
func (s *ServiceContext) FindUserByEmail(ctx context.Context, email string) (uint, *types.CarvResult) {
|
||||
func (s *ServiceContext) GetUidByEmail(ctx context.Context, email string) (uint, *types.CarvResult) {
|
||||
u, err := s.UserModel.FindOneByEmail(ctx, email)
|
||||
if err != nil {
|
||||
if !errors.Is(err, model.ErrNotFound) {
|
||||
|
||||
Reference in New Issue
Block a user