You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
74 lines
2.6 KiB
74 lines
2.6 KiB
6 years ago
|
package com.epmet.controller;
|
||
|
|
||
|
import com.epmet.commons.tools.utils.Result;
|
||
|
import com.epmet.commons.tools.validator.ValidatorUtils;
|
||
|
import com.epmet.commons.tools.validator.group.AddGroup;
|
||
|
import com.epmet.commons.tools.validator.group.DefaultGroup;
|
||
|
import com.epmet.dto.UserDTO;
|
||
|
import com.epmet.dto.UserWechatDTO;
|
||
|
import com.epmet.dto.form.PasswordLoginUserInfoFormDTO;
|
||
|
import com.epmet.dto.form.WxLoginUserInfoFormDTO;
|
||
|
import com.epmet.dto.result.PasswordLoginUserInfoResultDTO;
|
||
|
import com.epmet.service.UserService;
|
||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||
|
import org.springframework.web.bind.annotation.RestController;
|
||
|
|
||
|
/**
|
||
|
* @Description
|
||
|
* @Author yinzuomei
|
||
|
* @Date 2020/3/30 12:42
|
||
|
*/
|
||
|
@RestController
|
||
|
@RequestMapping("user")
|
||
|
public class UserController {
|
||
|
@Autowired
|
||
|
private UserService userService;
|
||
|
|
||
|
|
||
|
/**
|
||
|
* @param formDTO
|
||
|
* @return com.epmet.commons.tools.utils.Result
|
||
|
* @Author yinzuomei
|
||
|
* @Description 根据openId、app查询对应终端用户信息
|
||
|
* @Date 2020/3/16 16:15
|
||
|
**/
|
||
|
@PostMapping("selecWxLoginUserInfo")
|
||
|
public Result<UserDTO> selecWxLoginUserInfo(@RequestBody WxLoginUserInfoFormDTO formDTO){
|
||
|
ValidatorUtils.validateEntity(formDTO);
|
||
|
return userService.selecWxLoginUserInfo(formDTO);
|
||
|
}
|
||
|
|
||
|
|
||
|
/**
|
||
|
* @param userWechatDTO
|
||
|
* @return 将获取到的居民微信信息,保存到user_wechat表,返回主键
|
||
|
* @Author yinzuomei
|
||
|
* @Description
|
||
|
* @Date 2020/3/16 15:49
|
||
|
**/
|
||
|
@PostMapping("saveOrUpdateUserWechatDTO")
|
||
|
public Result<UserDTO> saveOrUpdateUserWechatDTO(@RequestBody UserWechatDTO userWechatDTO) {
|
||
|
//效验数据
|
||
|
ValidatorUtils.validateEntity(userWechatDTO, AddGroup.class, DefaultGroup.class);
|
||
|
return userService.saveOrUpdateUserWechatDTO(userWechatDTO);
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* @param passwordLoginUserInfoFormDTO
|
||
|
* @return com.epmet.commons.tools.utils.Result<com.epmet.dto.result.PasswordLoginUserInfoResultDTO>
|
||
|
* @Author yinzuomei
|
||
|
* @Description 根据手机号、app获取对应终端用户信息
|
||
|
* @Date 2020/3/16 16:15
|
||
|
**/
|
||
|
@PostMapping("selectLoginUserInfoByPassword")
|
||
|
public Result<PasswordLoginUserInfoResultDTO> selectLoginUserInfoByPassword(@RequestBody PasswordLoginUserInfoFormDTO passwordLoginUserInfoFormDTO) {
|
||
|
//效验数据
|
||
|
ValidatorUtils.validateEntity(passwordLoginUserInfoFormDTO);
|
||
|
Result<PasswordLoginUserInfoResultDTO> result= userService.selectLoginUserInfoByPassword(passwordLoginUserInfoFormDTO);
|
||
|
return result;
|
||
|
}
|
||
|
}
|