This commit is contained in:
parent
ac87b0dbe9
commit
235f4dce5b
@ -4,15 +4,25 @@ import club.joylink.rtss.services.ISysUserService;
|
|||||||
import club.joylink.rtss.vo.AccountVO;
|
import club.joylink.rtss.vo.AccountVO;
|
||||||
import club.joylink.rtss.vo.UserQueryVO;
|
import club.joylink.rtss.vo.UserQueryVO;
|
||||||
import club.joylink.rtss.vo.client.PageVO;
|
import club.joylink.rtss.vo.client.PageVO;
|
||||||
import club.joylink.rtss.vo.client.user.*;
|
import club.joylink.rtss.vo.client.user.MobileInfoVO;
|
||||||
|
import club.joylink.rtss.vo.client.user.RetrievePwdVO;
|
||||||
|
import club.joylink.rtss.vo.client.user.UpdateEmailVO;
|
||||||
|
import club.joylink.rtss.vo.client.user.UpdateMobileVO;
|
||||||
|
import club.joylink.rtss.vo.client.user.UpdatePasswordVO;
|
||||||
import club.joylink.rtss.vo.user.AccountCreateVO;
|
import club.joylink.rtss.vo.user.AccountCreateVO;
|
||||||
import club.joylink.rtss.vo.user.AccountRegisterVO;
|
import club.joylink.rtss.vo.user.AccountRegisterVO;
|
||||||
import club.joylink.rtss.vo.user.UserRegisterCheck;
|
import club.joylink.rtss.vo.user.UserRegisterCheck;
|
||||||
|
import java.util.List;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
import java.util.List;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PutMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 系统账户接口
|
* 系统账户接口
|
||||||
@ -25,7 +35,8 @@ public class SysAccountController {
|
|||||||
private ISysUserService iSysUserService;
|
private ISysUserService iSysUserService;
|
||||||
|
|
||||||
@PostMapping("/register")
|
@PostMapping("/register")
|
||||||
public void register(@RequestBody @Validated(value = UserRegisterCheck.class) AccountCreateVO accountCreateVO) {
|
public void register(
|
||||||
|
@RequestBody @Validated(value = UserRegisterCheck.class) AccountCreateVO accountCreateVO) {
|
||||||
this.iSysUserService.register(accountCreateVO);
|
this.iSysUserService.register(accountCreateVO);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -38,9 +49,9 @@ public class SysAccountController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*根据姓名或电话号查询用户
|
* 根据姓名或电话号查询用户
|
||||||
*/
|
*/
|
||||||
@GetMapping(path="/nameOrMobile")
|
@GetMapping(path = "/nameOrMobile")
|
||||||
public List<AccountVO> queryUserByNameOrMobile(String query) {
|
public List<AccountVO> queryUserByNameOrMobile(String query) {
|
||||||
List<AccountVO> list = this.iSysUserService.queryUserByNameOrMobile(query);
|
List<AccountVO> list = this.iSysUserService.queryUserByNameOrMobile(query);
|
||||||
return list;
|
return list;
|
||||||
@ -63,7 +74,7 @@ public class SysAccountController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*根据用户id获取用户信息
|
* 根据用户id获取用户信息
|
||||||
*/
|
*/
|
||||||
@GetMapping(path = "/{id}")
|
@GetMapping(path = "/{id}")
|
||||||
public AccountVO getUserBaseInfoById(@PathVariable Long id) {
|
public AccountVO getUserBaseInfoById(@PathVariable Long id) {
|
||||||
@ -71,7 +82,7 @@ public class SysAccountController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*修改用户信息
|
* 修改用户信息
|
||||||
*/
|
*/
|
||||||
@PutMapping(path = "/{id}")
|
@PutMapping(path = "/{id}")
|
||||||
public void modify(@PathVariable Long id, @RequestBody AccountVO userInfo, String vdcode) {
|
public void modify(@PathVariable Long id, @RequestBody AccountVO userInfo, String vdcode) {
|
||||||
@ -79,7 +90,7 @@ public class SysAccountController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*微信关注事件
|
* 微信关注事件
|
||||||
*/
|
*/
|
||||||
@GetMapping(path = "/wxsubscribe")
|
@GetMapping(path = "/wxsubscribe")
|
||||||
public void wxSubscribe(@RequestParam String wxId) {
|
public void wxSubscribe(@RequestParam String wxId) {
|
||||||
@ -87,7 +98,7 @@ public class SysAccountController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*批量修改用户的openId为unionId
|
* 批量修改用户的openId为unionId
|
||||||
*/
|
*/
|
||||||
@PutMapping(path = "/batchchange/unionid")
|
@PutMapping(path = "/batchchange/unionid")
|
||||||
public void batchChangeOpenId2UnionId() {
|
public void batchChangeOpenId2UnionId() {
|
||||||
@ -95,7 +106,7 @@ public class SysAccountController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*更新用户真实姓名
|
* 更新用户真实姓名
|
||||||
*/
|
*/
|
||||||
@PutMapping(path = "/{id}/name")
|
@PutMapping(path = "/{id}/name")
|
||||||
public void updateName(@PathVariable Long id, String name) {
|
public void updateName(@PathVariable Long id, String name) {
|
||||||
@ -103,7 +114,7 @@ public class SysAccountController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*更新用户昵称
|
* 更新用户昵称
|
||||||
*/
|
*/
|
||||||
@PutMapping(path = "/{id}/nickname")
|
@PutMapping(path = "/{id}/nickname")
|
||||||
public void updateNickname(@PathVariable Long id, String nickname) {
|
public void updateNickname(@PathVariable Long id, String nickname) {
|
||||||
@ -111,7 +122,7 @@ public class SysAccountController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*用户上传头像
|
* 用户上传头像
|
||||||
*/
|
*/
|
||||||
@PostMapping(path = "/{id}/avatar")
|
@PostMapping(path = "/{id}/avatar")
|
||||||
public void uploadAvatar(@PathVariable Long id, @RequestBody AccountVO accountVO) {
|
public void uploadAvatar(@PathVariable Long id, @RequestBody AccountVO accountVO) {
|
||||||
@ -119,7 +130,7 @@ public class SysAccountController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*发送手机验证码
|
* 发送手机验证码
|
||||||
*/
|
*/
|
||||||
@PostMapping(path = "/mobile/code")
|
@PostMapping(path = "/mobile/code")
|
||||||
public String sendMobileValidCode(@RequestBody MobileInfoVO mobileInfoVO) {
|
public String sendMobileValidCode(@RequestBody MobileInfoVO mobileInfoVO) {
|
||||||
@ -127,7 +138,7 @@ public class SysAccountController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*发送邮箱验证码
|
* 发送邮箱验证码
|
||||||
*/
|
*/
|
||||||
@PostMapping(path = "/email/code")
|
@PostMapping(path = "/email/code")
|
||||||
public String sendEmailValidCode(String email) {
|
public String sendEmailValidCode(String email) {
|
||||||
@ -135,26 +146,29 @@ public class SysAccountController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*更新用户手机号
|
* 更新用户手机号
|
||||||
*/
|
*/
|
||||||
@PutMapping(path = "/{id}/mobile")
|
@PutMapping(path = "/{id}/mobile")
|
||||||
public void updateMobile(@PathVariable Long id, @RequestBody @Validated UpdateMobileVO updateMobileVO) {
|
public void updateMobile(@PathVariable Long id,
|
||||||
|
@RequestBody @Validated UpdateMobileVO updateMobileVO) {
|
||||||
this.iSysUserService.updateMobile(id, updateMobileVO);
|
this.iSysUserService.updateMobile(id, updateMobileVO);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*更新用户邮箱
|
* 更新用户邮箱
|
||||||
*/
|
*/
|
||||||
@PutMapping(path = "/{id}/email")
|
@PutMapping(path = "/{id}/email")
|
||||||
public void updateEmail(@PathVariable Long id, @RequestBody @Validated UpdateEmailVO updateEmailVO) {
|
public void updateEmail(@PathVariable Long id,
|
||||||
|
@RequestBody @Validated UpdateEmailVO updateEmailVO) {
|
||||||
this.iSysUserService.updateEmail(id, updateEmailVO);
|
this.iSysUserService.updateEmail(id, updateEmailVO);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*更新用户登陆密码
|
* 更新用户登陆密码
|
||||||
*/
|
*/
|
||||||
@PutMapping(path = "/{id}/password")
|
@PutMapping(path = "/{id}/password")
|
||||||
public void updatePassword(@PathVariable Long id, @RequestBody @Validated UpdatePasswordVO updatePasswordVO) {
|
public void updatePassword(@PathVariable Long id,
|
||||||
|
@RequestBody @Validated UpdatePasswordVO updatePasswordVO) {
|
||||||
this.iSysUserService.updatePassword(id, updatePasswordVO);
|
this.iSysUserService.updatePassword(id, updatePasswordVO);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -162,7 +176,8 @@ public class SysAccountController {
|
|||||||
* 按条件分页查询指定来源的账号
|
* 按条件分页查询指定来源的账号
|
||||||
*/
|
*/
|
||||||
@GetMapping("/page/criteria/{source}")
|
@GetMapping("/page/criteria/{source}")
|
||||||
public PageVO<AccountVO> queryPagedAccountOfTheSource(UserQueryVO queryVO, @PathVariable String source) {
|
public PageVO<AccountVO> queryPagedAccountOfTheSource(UserQueryVO queryVO,
|
||||||
|
@PathVariable String source) {
|
||||||
queryVO.setSource(source);
|
queryVO.setSource(source);
|
||||||
return this.iSysUserService.queryPagedUser(queryVO);
|
return this.iSysUserService.queryPagedUser(queryVO);
|
||||||
}
|
}
|
||||||
@ -182,4 +197,12 @@ public class SysAccountController {
|
|||||||
public void retrievePwd(@RequestBody @Validated RetrievePwdVO vo) {
|
public void retrievePwd(@RequestBody @Validated RetrievePwdVO vo) {
|
||||||
iSysUserService.retrievePwd(vo);
|
iSysUserService.retrievePwd(vo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据用户id列表获取用户信息
|
||||||
|
*/
|
||||||
|
@PostMapping("/list/ids")
|
||||||
|
public List<AccountVO> listByIds(@RequestBody List<Long> ids) {
|
||||||
|
return iSysUserService.listByIds(ids);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -363,4 +363,6 @@ public interface ISysUserService {
|
|||||||
boolean isSameMobileExist(String mobile);
|
boolean isSameMobileExist(String mobile);
|
||||||
|
|
||||||
boolean isSameEmailExist(String email);
|
boolean isSameEmailExist(String email);
|
||||||
|
|
||||||
|
List<AccountVO> listByIds(List<Long> ids);
|
||||||
}
|
}
|
||||||
|
@ -1112,6 +1112,14 @@ public class SysUserService implements ISysUserService {
|
|||||||
return sysAccountDAO.countByExample(example) > 0;
|
return sysAccountDAO.countByExample(example) > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<AccountVO> listByIds(List<Long> ids) {
|
||||||
|
SysAccountExample example = new SysAccountExample();
|
||||||
|
example.createCriteria().andIdIn(ids);
|
||||||
|
List<SysAccount> sysAccounts = sysAccountDAO.selectByExample(example);
|
||||||
|
return AccountVO.convertFromDB(sysAccounts);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询包含组织信息的用户信息
|
* 查询包含组织信息的用户信息
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user