MCPcopy Create free account
hub / github.com/defineYIDA/LWebServer / UserService

Class UserService

src/main/java/cn/lws/server/service/UserService.java:9–26  ·  view source on GitHub ↗

Created by zl on 2019/03/01.

Source from the content-addressed store, hash-verified

7 * Created by zl on 2019/03/01.
8 */
9public class UserService {
10 private Map<String,String> users = new ConcurrentHashMap<>();
11 private Map<String,String> online = new ConcurrentHashMap<>();
12
13 public UserService(){
14 users.put("admin","admin");
15 users.put("user1","pwd1");
16 }
17
18 public boolean login(String username,String password){
19 if(users.containsKey(username) && users.get(username).equals(password)){
20 online.put(username,"");
21 return true;
22 }
23 return false;
24 }
25
26}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected