|
@@ -7,6 +7,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
+import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
|
@@ -65,6 +66,45 @@ public class UserController {
|
|
|
return userService.deleteUser(userId, request);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 修改密码
|
|
|
+ * originPassword 原密码
|
|
|
+ * newPassword 新密码
|
|
|
+ */
|
|
|
+ @RequestMapping("/editPassword")
|
|
|
+ HttpRespMsg editPassword(@RequestParam String originPassword, @RequestParam String newPassword) {
|
|
|
+ return userService.editPassword(originPassword, newPassword, request);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 新增公司和负责人
|
|
|
+ * companyName 公司名
|
|
|
+ * name 姓名
|
|
|
+ * phone 电话号码
|
|
|
+ */
|
|
|
+ @RequestMapping("/createCompany")
|
|
|
+ HttpRespMsg createCompany(@RequestParam String companyName, @RequestParam String name, @RequestParam String phone) {
|
|
|
+ return userService.createCompany(companyName, name, phone);
|
|
|
+ }
|
|
|
|
|
|
+ /**
|
|
|
+ * 新增用户
|
|
|
+ * name 用户名
|
|
|
+ * phone 电话号码
|
|
|
+ * role 角色 0-普通员工 2-管理员
|
|
|
+ */
|
|
|
+ @RequestMapping("/insertUser")
|
|
|
+ HttpRespMsg insertUser(@RequestParam String name, @RequestParam String phone, @RequestParam Integer role) {
|
|
|
+ return userService.insertUser(name, phone, role, request);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 使用文件导入用户信息
|
|
|
+ * file Excel文件
|
|
|
+ */
|
|
|
+ @RequestMapping("/importUser")
|
|
|
+ HttpRespMsg importUser(@RequestParam MultipartFile file) {
|
|
|
+ return userService.importUser(file, request);
|
|
|
+ }
|
|
|
}
|
|
|
|