package com.iamberry.app.face;

import java.util.List;

import com.iamberry.app.core.dto.RemoteIpInfoDTO;
import com.iamberry.app.core.dto.UserDTO;
import com.iamberry.app.core.entity.User;

/**
 * UserService
 *
 * @author Moon Cheng
 * @date 2016年3月23日 上午11:33:29
 */

public interface UserService {
	
	
	public User validateUserToken(String token);

	/**
	 * register
	 *
	 * @author Moon Cheng
	 * @param phone
	 * @param password
	 * @return User Information
	 */
	public User register(String phone, String password, String ip) ;

	/**
	 * thirdPartBindingPhone
	 *
	 * @param phone
	 * @param openId
	 * @return
	 */
	public User thirdPartBindingPhone(String phone, String openId) ;
	/**
	 * findById
	 *
	 * @param id
	 * @return User
	 */
	public User findById(Long id);

	/**
	 * login
	 *
	 * @param phone
	 * @param password
	 * @param userAgent
	 * @return
	 */
	public Object login(String phone, String password) ;

	/**
	 * thirdPartLogin
	 *
	 * @param openId
	 * @param extType
	 * @param extName
	 * @param extPicture
	 * @return
	 */
	public User thirdPartLogin(String openId, String extType, String extName, String extPicture, String ip) ;

	/**
	 * updateUserInfo
	 *
	 * @param user
	 * @param token
	 * @return
	 */
	public User updateUserInfo(User user, String token) ;

	/**
	 * updateDisplayPicture
	 *
	 * @author Moon Cheng
	 * @param base64
	 * @param token
	 * @return
	 */
	public String updateDisplayPicture(String base64, String token) ;
	/**
	 * changePhone
	 *
	 * @author Moon Cheng
	 * @param phone
	 * @param token
	 * @return
	 */
	public User changePhone(String phone, String token) ;
	/**
	 * resetPassWord
	 *
	 * @param oldPassword
	 * @param newPassword
	 * @param token
	 * @return
	 */
	public int changePassword(String oldPassword, String newPassword, String token) ;
	/**
	 * changePassWord
	 *
	 * @param username,
	 *            newPassword
	 * @param session
	 * @return int
	 */
	public int resetPassWord(String username, String newPassword) ;

	public UserDTO tuyaConnect(User user) ;

	/**
	 * getStartPage
	 *
	 * @return String
	 */
	public String getStartPage() ;
	/**
	 * getLocation
	 *
	 * @param ip
	 * @return String
	 */
	public RemoteIpInfoDTO getLocation(String ip) ;

	/**
	 * getApkVersion
	 *
	 * @return
	 */
	public String getApkVersion();
	
	/**
	 * selectUserAvator
	 *
	 * @param id
	 * @return String
	 */
	public String selectUserAvator(Long id);
	
	/**
	 * selectUserByUsername
	 *
	 * @param username
	 * @return User Information
	 */
	public User selectUserByUsername(String username);

	public List<User> getAll(int start, int end);

	/*public List<User> getAll(int start, int end);*/
}
