service.go 381 B

12345678910111213141516
  1. package user
  2. import "context"
  3. type UserService interface {
  4. CheckPassword(ctx context.Context, username string, password string) (bool, error)
  5. }
  6. type UserServiceImpl struct{}
  7. func (s UserServiceImpl) CheckPassword(ctx context.Context, username string, password string) (bool, error) {
  8. if username == "admin" && password == "admin" {
  9. return true, nil
  10. }
  11. return false, nil
  12. }