128 lines
3.2 KiB
Java
128 lines
3.2 KiB
Java
/*
|
|
* To change this license header, choose License Headers in Project Properties.
|
|
* To change this template file, choose Tools | Templates
|
|
* and open the template in the editor.
|
|
*/
|
|
package com.ifish.controller;
|
|
|
|
import com.ifish.bean.Tbl_User;
|
|
import com.ifish.helper.UserHelperI;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
/**
|
|
*
|
|
* @author Administrator
|
|
*/
|
|
@RestController
|
|
public class Login {
|
|
|
|
@Autowired
|
|
private UserHelperI userHelperI;
|
|
|
|
/**
|
|
* 用户登陆
|
|
*
|
|
* @param user
|
|
* @return
|
|
*/
|
|
@RequestMapping(value = "/userLogin.do", method = RequestMethod.POST)
|
|
public Object userLogin(Tbl_User user) {
|
|
return userHelperI.login(user);
|
|
}
|
|
|
|
/**
|
|
* 手机注册
|
|
*
|
|
* @param user
|
|
* @return
|
|
*/
|
|
@RequestMapping(value = "/registerByMobile", method = RequestMethod.POST)
|
|
public Object registerByMobile(Tbl_User user) {
|
|
return userHelperI.registerUserMobile(user);
|
|
}
|
|
|
|
/**
|
|
* 修改用户信息发送邮件验证
|
|
*
|
|
* @param user
|
|
* @return
|
|
*/
|
|
@RequestMapping(value = "/updateUserEmail", method = RequestMethod.POST)
|
|
public Object updateUserEmail(Tbl_User user) {
|
|
return null;
|
|
}
|
|
|
|
/**
|
|
* 发送邮件验证
|
|
*
|
|
* @param user
|
|
* @return
|
|
*/
|
|
@RequestMapping(value = "/registerByEmail", method = RequestMethod.POST)
|
|
public Object registerByEmail(Tbl_User user) {
|
|
return userHelperI.registerByEmail(user);
|
|
}
|
|
|
|
/**
|
|
* 添加邮箱用户
|
|
*
|
|
* @param md5
|
|
* @return
|
|
*/
|
|
@RequestMapping(value = "/registerEmail", method = RequestMethod.GET, produces = "application/json;charset=utf-8")
|
|
public Object registerEmailUser(String md5) {
|
|
return userHelperI.registerEmail(md5);
|
|
}
|
|
|
|
/**
|
|
* 游客注册
|
|
*
|
|
* @return
|
|
*/
|
|
@RequestMapping(value = "/touristLogin.do", method = RequestMethod.POST)
|
|
public Object touristLogin(String loginType) {
|
|
return userHelperI.touristRegister(loginType);
|
|
}
|
|
|
|
/**
|
|
* 修改用户属性
|
|
*
|
|
* @param user
|
|
* @return
|
|
*/
|
|
@RequestMapping(value = "/updateInfo.do", method = RequestMethod.POST)
|
|
public Object updateUser(Tbl_User user) {
|
|
return userHelperI.updateUser(user);
|
|
}
|
|
|
|
/**
|
|
* 修改用户头像
|
|
*
|
|
* @param userId
|
|
* @param file
|
|
* @return
|
|
*/
|
|
@RequestMapping(value = "/updateUserImg", method = RequestMethod.POST)
|
|
public Object updateUserImg(Integer userId, MultipartFile file, String path) {
|
|
return userHelperI.updateUserImg(file, userId, path);
|
|
}
|
|
|
|
/**
|
|
* 修改用户手机和密码
|
|
*
|
|
* @param userId
|
|
* @param password
|
|
* @param phoneNumber
|
|
* @return
|
|
*/
|
|
@RequestMapping(value = "/updateUserPassword", method = RequestMethod.POST)
|
|
public Object updateUserPassword(Integer userId, String password, String phoneNumber, String token) {
|
|
return userHelperI.updateUserPassword(userId, password, phoneNumber, token);
|
|
}
|
|
|
|
}
|