com.osomapps.pt.tokenemail.EmailConfirmResource   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
eloc 14
c 1
b 0
f 0
dl 0
loc 22
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A create(String) 0 6 2
A EmailConfirmResource(TokenEmailSignupService) 0 3 1
A list() 0 3 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