parent
64b7bfaa0f
commit
b43a2bcf2d
1 changed files with 65 additions and 0 deletions
@ -0,0 +1,65 @@ |
||||
package org.jeecg.modules.system.controller; |
||||
|
||||
|
||||
import com.alibaba.fastjson.JSON; |
||||
import com.alibaba.fastjson.JSONObject; |
||||
import lombok.extern.slf4j.Slf4j; |
||||
import org.apache.shiro.SecurityUtils; |
||||
import org.aspectj.apache.bcel.generic.RET; |
||||
import org.jeecg.common.api.vo.Result; |
||||
import org.jeecg.common.constant.CommonConstant; |
||||
import org.jeecg.common.system.vo.LoginUser; |
||||
import org.jeecg.modules.base.service.BaseCommonService; |
||||
import org.jeecg.modules.system.entity.SysUser; |
||||
import org.jeecg.modules.system.service.ISysUserService; |
||||
import org.springframework.beans.factory.annotation.Autowired; |
||||
import org.springframework.http.HttpRequest; |
||||
import org.springframework.web.bind.annotation.*; |
||||
|
||||
import javax.annotation.Resource; |
||||
import java.lang.reflect.Field; |
||||
import java.util.Date; |
||||
import java.util.HashMap; |
||||
import java.util.Map; |
||||
|
||||
/* |
||||
这个是个人中心专用控制器,之前全都写在SysUserController(用户控制器里面,感觉不妥)因此就专门拖出来一个 |
||||
*/ |
||||
|
||||
@Slf4j |
||||
@RestController |
||||
@RequestMapping("/getuserpersion") |
||||
public class ApeopersionController { |
||||
|
||||
@Autowired |
||||
private ISysUserService sysUserService; |
||||
|
||||
|
||||
/* |
||||
个人中心,我的账户的数据获取 |
||||
*/ |
||||
@RequestMapping(value = "/getneeduser", method = RequestMethod.GET) |
||||
public Result<?> getdingdandh() { |
||||
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
||||
String id = loginUser.getId(); |
||||
SysUser syu = new SysUser(); |
||||
syu = sysUserService.getneeduser(id); |
||||
return Result.ok(syu); |
||||
} |
||||
|
||||
|
||||
@RequestMapping(value = "/updateneeduser", method = RequestMethod.GET) |
||||
public Result<?> updateneeduser(@RequestParam(name = "form", required = true) String form) { |
||||
|
||||
Map map = JSON.parseObject(form,Map.class); |
||||
System.out.println(map); |
||||
String id = (String) map.get("id"); |
||||
String sex= map.get("sex").toString(); |
||||
String birthday= (String) map.get("birthday"); |
||||
String realname= (String) map.get("realname"); |
||||
String phone= (String) map.get("phone"); |
||||
String email= (String) map.get("email"); |
||||
sysUserService.updateneed(id,sex,birthday,realname,phone,email); |
||||
return Result.ok("success"); |
||||
} |
||||
} |
Loading…
Reference in new issue