Newer
Older
CosmosServer / src / main / java / com / example / cosmos_serversb / models / Users.java
package com.example.cosmos_serversb.models;

import com.example.cosmos_serversb.entities.*;

public class Users {
    //User testUser = new User("test", "123456789", "http://test.com", "testpw", "123456789", "123456789", "http://iconuri/123456789.com");

    public User createUser(String name, String pw, String iconImage) {
        User testUser = new User("test", "123456789", "http://test.com", "testpw", null, "123456789", "http://iconuri/123456789.com");
        testUser.token.add("123456789");
        testUser.token.add("987654321");
        return testUser;
    }

    public final static User getUserById(String uId) {
        User testUser = new User("test", "123456789", "http://test.com", "testpw", null, "123456789", "http://iconuri/123456789.com");
        testUser.token.add("123456789");
        testUser.token.add("987654321");
        return testUser;
    }

    public User getUserByToken(String token) {
        User testUser = new User("test", "123456789", "http://test.com", "testpw", null, "123456789", "http://iconuri/123456789.com");
        testUser.token.add("123456789");
        testUser.token.add("987654321");
        return testUser;
    }

    public DeleteResult deleteUser(String uId) {
        return DeleteResult.SUCCESS;
    }

    public String login(String uId) {

        return "123456789";//testToken
    }

    public DeleteResult logout(String token) {
        return DeleteResult.SUCCESS;
    }
}