|
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.gree.mall.manager.annotation.ApiNotAuth;
|
|
|
import com.gree.mall.manager.bean.ExcelData;
|
|
|
import com.gree.mall.manager.bean.SVerification;
|
|
|
+import com.gree.mall.manager.bean.admin.AdminUserCom;
|
|
|
import com.gree.mall.manager.bean.admin.ExternalMapBean;
|
|
|
import com.gree.mall.manager.bean.admin.reqDto.AdminCompanyWechatReqBean;
|
|
|
import com.gree.mall.manager.bean.admin.reqDto.AdminUserAddReqBean;
|
|
@@ -30,7 +31,7 @@ import java.util.List;
|
|
|
|
|
|
@Slf4j
|
|
|
@RestController
|
|
|
-@Api(value = "系统用户管理", tags ={"后台用户相关API"} )
|
|
|
+@Api(value = "系统用户管理", tags = {"后台用户相关API"})
|
|
|
@RequestMapping(value = "/admin/user", produces = "application/json; charset=utf-8")
|
|
|
public class AdminUserController {
|
|
|
|
|
@@ -42,86 +43,56 @@ public class AdminUserController {
|
|
|
@ApiNotAuth
|
|
|
@PostMapping("/login")
|
|
|
@ApiOperation(value = "登录")
|
|
|
- public ResponseHelper<AdminUserBean> login(
|
|
|
- @ApiParam(value = "帐号",required = true) @RequestParam(required = true) String userName,
|
|
|
- @ApiParam(value = "密码",required = true) @RequestParam(required = true) String password,
|
|
|
- @ApiParam(value = "验证码code",required = true) @RequestParam(required = true) String code,
|
|
|
- @ApiParam(value = "验证码值",required = true) @RequestParam(required = true) String codeValue
|
|
|
+ public ResponseHelper<AdminUserCom> login(
|
|
|
+ @ApiParam(value = "帐号", required = true) @RequestParam(required = true) String userName,
|
|
|
+ @ApiParam(value = "密码", required = true) @RequestParam(required = true) String password,
|
|
|
+ @ApiParam(value = "验证码code", required = true) @RequestParam(required = true) String code,
|
|
|
+ @ApiParam(value = "验证码值", required = true) @RequestParam(required = true) String codeValue
|
|
|
|
|
|
) throws RemoteServiceException {
|
|
|
- AdminUserBean adminUserBean = adminUserLogic.login(userName, password,code,codeValue);
|
|
|
+ AdminUserCom adminUserBean = adminUserLogic.login(userName, password, code, codeValue);
|
|
|
return ResponseHelper.success(adminUserBean);
|
|
|
}
|
|
|
|
|
|
@PostMapping("/password/update")
|
|
|
@ApiOperation(value = "修改密码")
|
|
|
public ResponseHelper<AdminUserBean> login(
|
|
|
- @ApiParam(value = "帐号",required = true) @RequestParam(required = true) String userName,
|
|
|
- @ApiParam(value = "密码",required = true) @RequestParam(required = true) String password,
|
|
|
- @ApiParam(value = "新密码",required = true) @RequestParam(required = true) String newPassword
|
|
|
+ @ApiParam(value = "帐号", required = true) @RequestParam(required = true) String userName,
|
|
|
+ @ApiParam(value = "密码", required = true) @RequestParam(required = true) String password,
|
|
|
+ @ApiParam(value = "新密码", required = true) @RequestParam(required = true) String newPassword
|
|
|
) throws RemoteServiceException {
|
|
|
- adminUserLogic.updatePassword(userName, password,newPassword);
|
|
|
+ adminUserLogic.updatePassword(userName, password, newPassword);
|
|
|
return ResponseHelper.success();
|
|
|
}
|
|
|
|
|
|
@PostMapping("/status/update")
|
|
|
@ApiOperation("修改帐号状态(冻结/正常)")
|
|
|
public ResponseHelper updateStatus(
|
|
|
- @ApiParam(value = "帐号名称",required = true) @RequestParam(required = true) String adminUserId,
|
|
|
- @ApiParam(value = "true:正常 false:冻结",required = true) @RequestParam(required = true) Boolean status
|
|
|
- ) throws RemoteServiceException {
|
|
|
- adminUserLogic.updateStatus(adminUserId,status);
|
|
|
- return ResponseHelper.success();
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- @PostMapping("/addCompanyWechat")
|
|
|
- @ApiOperation("新增商户")
|
|
|
- public ResponseHelper addCompanyWechat(
|
|
|
- @ApiParam(value = "帐号",required = true) @RequestBody AdminCompanyWechatReqBean adminUserBean,
|
|
|
- HttpServletRequest request
|
|
|
+ @ApiParam(value = "帐号名称", required = true) @RequestParam(required = true) String adminUserId,
|
|
|
+ @ApiParam(value = "true:正常 false:冻结", required = true) @RequestParam(required = true) Boolean status
|
|
|
) throws RemoteServiceException {
|
|
|
- adminCompanyWechatLogic.addCompanyWechat(adminUserBean,request);
|
|
|
+ adminUserLogic.updateStatus(adminUserId, status);
|
|
|
return ResponseHelper.success();
|
|
|
}
|
|
|
|
|
|
- @PostMapping("/add")
|
|
|
- @ApiOperation("新增帐号")
|
|
|
+ @PostMapping("/save")
|
|
|
+ @ApiOperation("保存帐号")
|
|
|
public ResponseHelper add(
|
|
|
- @ApiParam(value = "帐号",required = true) @RequestBody AdminUserAddReqBean adminUserBean,
|
|
|
+ @ApiParam(value = "帐号", required = true) @RequestBody AdminUserAddReqBean adminUserBean,
|
|
|
HttpServletRequest request
|
|
|
) throws RemoteServiceException {
|
|
|
- adminUserLogic.add(adminUserBean,request);
|
|
|
- return ResponseHelper.success();
|
|
|
- }
|
|
|
-
|
|
|
- @PostMapping("/user/updateCompanyWechat")
|
|
|
- @ApiOperation(value = "修改商户信息")
|
|
|
- public ResponseHelper updateCompanyWechat(
|
|
|
- @ApiParam(value = "商户信息", required = true) @RequestBody AdminCompanyWechat adminCompanyWechat
|
|
|
- ) throws RemoteServiceException {
|
|
|
- adminCompanyWechatLogic.updateCompanyWechat(adminCompanyWechat);
|
|
|
- return ResponseHelper.success();
|
|
|
- }
|
|
|
-
|
|
|
- @PostMapping("/user/update")
|
|
|
- @ApiOperation(value = "修改帐号")
|
|
|
- public ResponseHelper updateUser(
|
|
|
- HttpServletRequest request,
|
|
|
- @ApiParam(value = "帐号", required = true) @RequestBody AdminUserAddReqBean adminUserBean
|
|
|
- ) throws RemoteServiceException {
|
|
|
- adminUserLogic.update(request, adminUserBean);
|
|
|
+ adminUserLogic.save(adminUserBean, request);
|
|
|
return ResponseHelper.success();
|
|
|
}
|
|
|
|
|
|
@PostMapping("/password/reset")
|
|
|
@ApiOperation("重置密码")
|
|
|
public ResponseHelper resetPwd(
|
|
|
- @ApiParam(value = "用户id",required = true) @RequestParam(required = true) String adminUserId,
|
|
|
- @ApiParam(value = "密码",required = true) @RequestParam(required = true) String password,
|
|
|
+ @ApiParam(value = "用户id", required = true) @RequestParam String adminUserId,
|
|
|
+ @ApiParam(value = "密码", required = true) @RequestParam String password,
|
|
|
HttpServletRequest request
|
|
|
) throws RemoteServiceException {
|
|
|
- adminUserLogic.resetPassword(adminUserId,password,request);
|
|
|
+ adminUserLogic.resetPassword(adminUserId, password, request);
|
|
|
return ResponseHelper.success();
|
|
|
}
|
|
|
|
|
@@ -129,53 +100,53 @@ public class AdminUserController {
|
|
|
@GetMapping("/list")
|
|
|
@ApiOperation(value = "帐号列表")
|
|
|
public ResponseHelper<IPage<AdminUser>> list(
|
|
|
- @ApiParam(value = "角色id",required = false) @RequestParam(required = false) String roleId,
|
|
|
- @ApiParam(value = "状态 true:正常 false:冻结",required = false) @RequestParam(required = false) Boolean status,
|
|
|
- @ApiParam(value = "用户名",required = false) @RequestParam(required = false) String userName,
|
|
|
- @ApiParam(value = "页号",required = true) @RequestParam(required = true) Integer pageNum,
|
|
|
- @ApiParam(value = "页大小",required = true) @RequestParam(required = true) Integer pageSize,
|
|
|
+ @ApiParam(value = "角色id", required = false) @RequestParam(required = false) String roleId,
|
|
|
+ @ApiParam(value = "状态 true:正常 false:冻结", required = false) @RequestParam(required = false) Boolean status,
|
|
|
+ @ApiParam(value = "用户名", required = false) @RequestParam(required = false) String userName,
|
|
|
+ @ApiParam(value = "页号", required = true) @RequestParam(required = true) Integer pageNum,
|
|
|
+ @ApiParam(value = "页大小", required = true) @RequestParam(required = true) Integer pageSize,
|
|
|
HttpServletRequest request
|
|
|
) throws RemoteServiceException {
|
|
|
- IPage<AdminUser> page = adminUserLogic.list(roleId,status,userName,pageNum, pageSize,request);
|
|
|
+ IPage<AdminUser> page = adminUserLogic.list(roleId, status, userName, pageNum, pageSize, request);
|
|
|
return ResponseHelper.success(page);
|
|
|
}
|
|
|
|
|
|
@GetMapping("/mch/list")
|
|
|
@ApiOperation(value = "商户列表")
|
|
|
public ResponseHelper<IPage<AdminCompanyWechatRespPageBean>> list(
|
|
|
- @ApiParam(value = "会员帐号",required = false) @RequestParam(required = false) String userName,
|
|
|
- @ApiParam(value = "用户昵称",required = false) @RequestParam(required = false) String nickName,
|
|
|
- @ApiParam(value = "联系电话",required = false) @RequestParam(required = false) String linkPhone,
|
|
|
- @ApiParam(value = "电子邮箱",required = false) @RequestParam(required = false) String email,
|
|
|
- @ApiParam(value = "状态 true:正常 false:冻结",required = false) @RequestParam(required = false) Boolean status,
|
|
|
- @ApiParam(value = "页号",required = true) @RequestParam(required = true) Integer pageNum,
|
|
|
- @ApiParam(value = "页大小",required = true) @RequestParam(required = true) Integer pageSize
|
|
|
+ @ApiParam(value = "会员帐号", required = false) @RequestParam(required = false) String userName,
|
|
|
+ @ApiParam(value = "用户昵称", required = false) @RequestParam(required = false) String nickName,
|
|
|
+ @ApiParam(value = "联系电话", required = false) @RequestParam(required = false) String linkPhone,
|
|
|
+ @ApiParam(value = "电子邮箱", required = false) @RequestParam(required = false) String email,
|
|
|
+ @ApiParam(value = "状态 true:正常 false:冻结", required = false) @RequestParam(required = false) Boolean status,
|
|
|
+ @ApiParam(value = "页号", required = true) @RequestParam(required = true) Integer pageNum,
|
|
|
+ @ApiParam(value = "页大小", required = true) @RequestParam(required = true) Integer pageSize
|
|
|
) throws RemoteServiceException {
|
|
|
- IPage<AdminCompanyWechatRespPageBean> page = adminCompanyWechatLogic.list(userName,nickName,linkPhone,email,status,pageNum, pageSize);
|
|
|
+ IPage<AdminCompanyWechatRespPageBean> page = adminCompanyWechatLogic.list(userName, nickName, linkPhone, email, status, pageNum, pageSize);
|
|
|
return ResponseHelper.success(page);
|
|
|
}
|
|
|
|
|
|
@GetMapping("/mch/export")
|
|
|
@ApiOperation(value = "商户列表导出")
|
|
|
public void exportMch(
|
|
|
- @ApiParam(value = "会员帐号",required = false) @RequestParam(required = false) String userName,
|
|
|
- @ApiParam(value = "用户昵称",required = false) @RequestParam(required = false) String nickName,
|
|
|
- @ApiParam(value = "联系电话",required = false) @RequestParam(required = false) String linkPhone,
|
|
|
- @ApiParam(value = "电子邮箱",required = false) @RequestParam(required = false) String email,
|
|
|
- @ApiParam(value = "状态 true:正常 false:冻结",required = false) @RequestParam(required = false) Boolean status,
|
|
|
+ @ApiParam(value = "会员帐号", required = false) @RequestParam(required = false) String userName,
|
|
|
+ @ApiParam(value = "用户昵称", required = false) @RequestParam(required = false) String nickName,
|
|
|
+ @ApiParam(value = "联系电话", required = false) @RequestParam(required = false) String linkPhone,
|
|
|
+ @ApiParam(value = "电子邮箱", required = false) @RequestParam(required = false) String email,
|
|
|
+ @ApiParam(value = "状态 true:正常 false:冻结", required = false) @RequestParam(required = false) Boolean status,
|
|
|
HttpServletRequest request,
|
|
|
HttpServletResponse response
|
|
|
) throws Exception {
|
|
|
- IPage<AdminUser> page = adminUserLogic.list(userName,nickName,linkPhone,email,status,1, -1);
|
|
|
+ IPage<AdminUser> page = adminUserLogic.list(userName, nickName, linkPhone, email, status, 1, -1);
|
|
|
ExcelData excelData = adminUserLogic.exportMch(page.getRecords());
|
|
|
- ExcelUtils.exportExcel(request,response,"mch.xlsx",excelData);
|
|
|
+ ExcelUtils.exportExcel(request, response, "mch.xlsx", excelData);
|
|
|
}
|
|
|
|
|
|
|
|
|
@GetMapping("/module/list")
|
|
|
@ApiOperation(value = "功能菜单权限列表")
|
|
|
public ResponseHelper<List<AdminModuleTree>> moduleList(
|
|
|
- @ApiParam(value = "用户id",required = true) @RequestParam(required = true) String adminUserId
|
|
|
+ @ApiParam(value = "用户id", required = true) @RequestParam(required = true) String adminUserId
|
|
|
) throws RemoteServiceException {
|
|
|
List<AdminModuleTree> adminModuleTrees = adminUserLogic.queryAdminModule(adminUserId);
|
|
|
return ResponseHelper.success(adminModuleTrees);
|
|
@@ -184,7 +155,7 @@ public class AdminUserController {
|
|
|
@GetMapping("/module/id/checked")
|
|
|
@ApiOperation("查询选中的功能模块ids")
|
|
|
public ResponseHelper<List<String>> queryModuleIdChecked(
|
|
|
- @ApiParam(value = "角色id",required = true) @RequestParam(required = true) String adminRoleId
|
|
|
+ @ApiParam(value = "角色id", required = true) @RequestParam(required = true) String adminRoleId
|
|
|
) throws RemoteServiceException {
|
|
|
List<String> moduleIds = adminUserLogic.queryModuleIdChecked(adminRoleId);
|
|
|
return ResponseHelper.success(moduleIds);
|
|
@@ -193,35 +164,35 @@ public class AdminUserController {
|
|
|
@GetMapping("/module/all")
|
|
|
@ApiOperation(value = "全部功能菜单权限列表")
|
|
|
public ResponseHelper<List<AdminModuleTree>> allModuleList(
|
|
|
- @ApiParam(value = "角色",required = true) @RequestParam(required = true) String adminRoleId,
|
|
|
+ @ApiParam(value = "角色", required = true) @RequestParam(required = true) String adminRoleId,
|
|
|
HttpServletRequest request
|
|
|
) throws RemoteServiceException {
|
|
|
- List<AdminModuleTree> adminModuleTrees = adminUserLogic.queryAllAdminModuleTree(adminRoleId,request);
|
|
|
+ List<AdminModuleTree> adminModuleTrees = adminUserLogic.queryAllAdminModuleTree(adminRoleId, request);
|
|
|
return ResponseHelper.success(adminModuleTrees);
|
|
|
}
|
|
|
|
|
|
@PostMapping("/module/grant")
|
|
|
@ApiOperation(value = "授权动能菜单权限")
|
|
|
public ResponseHelper grant(
|
|
|
- @ApiParam(value = "角色id",required = true) @RequestParam(required = true) String adminRoleId,
|
|
|
- @ApiParam(value = "功能模块ids",required = true) @RequestParam(required = true) List<String> adminModuleIds
|
|
|
+ @ApiParam(value = "角色id", required = true) @RequestParam(required = true) String adminRoleId,
|
|
|
+ @ApiParam(value = "功能模块ids", required = true) @RequestParam(required = true) List<String> adminModuleIds
|
|
|
) throws RemoteServiceException {
|
|
|
- adminUserLogic.grantModules(adminRoleId,adminModuleIds);
|
|
|
+ adminUserLogic.grantModules(adminRoleId, adminModuleIds);
|
|
|
return ResponseHelper.success();
|
|
|
}
|
|
|
|
|
|
@GetMapping("/detail")
|
|
|
@ApiOperation(value = "详情")
|
|
|
- public ResponseHelper<AdminUserBean> detail(
|
|
|
- @ApiParam(value = "帐号id",required = true) @RequestParam(required = true) String adminUserId
|
|
|
+ public ResponseHelper<AdminUserCom> detail(
|
|
|
+ @ApiParam(value = "帐号id", required = true) @RequestParam(required = true) String adminUserId
|
|
|
) throws RemoteServiceException {
|
|
|
- AdminUserBean detail = adminUserLogic.detail(adminUserId);
|
|
|
+ AdminUserCom detail = adminUserLogic.detail(adminUserId);
|
|
|
return ResponseHelper.success(detail);
|
|
|
}
|
|
|
|
|
|
@PostMapping("/logout")
|
|
|
@ApiOperation("退出登录")
|
|
|
- public ResponseHelper logout(HttpServletRequest request){
|
|
|
+ public ResponseHelper logout(HttpServletRequest request) {
|
|
|
adminUserLogic.logout(request);
|
|
|
return ResponseHelper.success();
|
|
|
}
|
|
@@ -239,11 +210,11 @@ public class AdminUserController {
|
|
|
@PostMapping("/check-or-login/account")
|
|
|
@ApiOperation(value = "检查账号")
|
|
|
public ResponseHelper<ExternalMapBean> checkOrLoginAccount(
|
|
|
- @ApiParam(value = "账号",required = true) @RequestParam String account,
|
|
|
- @ApiParam(value = "密码",required = true) @RequestParam String password,
|
|
|
- @ApiParam(value = "是否检查",required = true) @RequestParam Boolean isCheck,
|
|
|
- @ApiParam(value = "时间戳",required = true) @RequestParam String timestamp,
|
|
|
- @ApiParam(value = "签名",required = true) @RequestParam String sign
|
|
|
+ @ApiParam(value = "账号", required = true) @RequestParam String account,
|
|
|
+ @ApiParam(value = "密码", required = true) @RequestParam String password,
|
|
|
+ @ApiParam(value = "是否检查", required = true) @RequestParam Boolean isCheck,
|
|
|
+ @ApiParam(value = "时间戳", required = true) @RequestParam String timestamp,
|
|
|
+ @ApiParam(value = "签名", required = true) @RequestParam String sign
|
|
|
) throws Exception {
|
|
|
ExternalMapBean bean = adminUserLogic.checkOrLoginAccount(account, password, isCheck, timestamp, sign);
|
|
|
return ResponseHelper.success(bean);
|