list()   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 3
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
1
package com.osomapps.pt.tokenemail;
2
3
import com.osomapps.pt.token.InUser;
4
import java.util.Collections;
5
import java.util.List;
6
import org.springframework.beans.factory.annotation.Autowired;
7
import org.springframework.web.bind.annotation.GetMapping;
8
import org.springframework.web.bind.annotation.PathVariable;
9
import org.springframework.web.bind.annotation.RequestMapping;
10
import org.springframework.web.bind.annotation.RestController;
11
12
@RestController
13
@RequestMapping("email/confirm")
14
class EmailConfirmResource {
15
16
    private final TokenEmailSignupService tokenEmailSignupService;
17
18
    @Autowired
19
    EmailConfirmResource(TokenEmailSignupService tokenEmailSignupService) {
20
        this.tokenEmailSignupService = tokenEmailSignupService;
21
    }
22
23
    @GetMapping
24
    List<InUser> list() {
25
        return Collections.emptyList();
26
    }
27
28
    @GetMapping("{confirmToken}")
29
    String create(@PathVariable String confirmToken) {
30
        if (tokenEmailSignupService.confirmToken(confirmToken)) {
31
            return "Your e-mail was confirmed";
32
        }
33
        return "";
34
    }
35
}
36