|
@@ -18,10 +18,7 @@ import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.http.MediaType;
|
|
|
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
|
|
-import org.springframework.web.bind.annotation.GetMapping;
|
|
|
-import org.springframework.web.bind.annotation.PostMapping;
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
@@ -64,8 +61,8 @@ public class UserController extends BaseController {
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "新增用户")
|
|
|
- @PostMapping(value = "/add",consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE)
|
|
|
- public Object add(SysUser sysUser) {
|
|
|
+ @RequestMapping(value = "/add",method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
|
|
|
+ public Object add(@RequestBody SysUser sysUser) {
|
|
|
// sysUser.setPassword(new BCryptPasswordEncoder().encode(sysUser.getPassword()));
|
|
|
sysUserService.insert(sysUser);
|
|
|
return succeed(sysUser.getId());
|