Commit c3d0ecb3 authored by Administrator's avatar Administrator

增加功能

parent 27ef2675
package com.govmade.modules.system.controller;
import java.util.Map;
import java.util.Set;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.govmade.common.utils.Constant;
import com.govmade.common.utils.PageUtils;
import com.govmade.common.utils.R;
import com.govmade.modules.basic.controller.AbstractController;
import com.govmade.modules.system.entity.UserEntity;
import com.govmade.modules.system.service.UserService;
import cn.hutool.crypto.SecureUtil;
/**
......@@ -77,5 +81,35 @@ public class UserController extends AbstractController {
public R info(@PathVariable("id") Long id) {
return R.ok().put("user", userService.queryById(id));
}
/**
* 删除、批量删除用户
*
* @param ids
* @return
*/
@DeleteMapping("/delete")
public R deleteUser(@RequestParam Set<Long> ids) {
userService.deleteBatchIds(ids);
return R.ok();
}
/**
* 重置密码
* @param id
* @return
*/
@DeleteMapping("reset")
public R reset(UserEntity ue) {
if (null != ue.getId()) {
String password = SecureUtil.md5("123456");
ue.setPassword(password);
userService.updateById(ue);
}
return R.ok();
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment