|
@@ -1,6 +1,7 @@
|
|
|
package com.fdage.controller.app;
|
|
|
|
|
|
import com.fdage.base.entity.TmUser;
|
|
|
+import com.fdage.base.service.impl.TmUserServiceImpl;
|
|
|
import com.fdage.controller.BaseController;
|
|
|
import fdage.back.sdk.base.entity.Result;
|
|
|
import fdage.back.sdk.base.enums.ResultCodeEnum;
|
|
@@ -8,9 +9,11 @@ import fdage.back.sdk.base.exception.CommonBaseException;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.extern.log4j.Log4j2;
|
|
|
-import org.springframework.web.bind.annotation.GetMapping;
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
+
|
|
|
+import java.sql.ResultSet;
|
|
|
|
|
|
/**
|
|
|
* 2 * @Author: Abner
|
|
@@ -23,6 +26,9 @@ import org.springframework.web.bind.annotation.RestController;
|
|
|
@Log4j2
|
|
|
public class AppUserController extends BaseController {
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private TmUserServiceImpl tmUserService;
|
|
|
+
|
|
|
|
|
|
@GetMapping("/detail")
|
|
|
@ApiOperation(value = "获当前用户详情")
|
|
@@ -34,5 +40,17 @@ public class AppUserController extends BaseController {
|
|
|
return Result.success(tmUser);
|
|
|
}
|
|
|
|
|
|
+ @PostMapping("/update")
|
|
|
+ @ApiOperation(value = "更新用户信息")
|
|
|
+ public Result<TmUser> update(@RequestBody TmUser tmUser){
|
|
|
|
|
|
+ if(StringUtils.isBlank(tmUser.getId())){
|
|
|
+ return Result.failure("用户ID缺失");
|
|
|
+ }
|
|
|
+ int update = tmUserService.getBaseMapper().updateById(tmUser);
|
|
|
+ if(update != 1){
|
|
|
+ return Result.failure("更新失败");
|
|
|
+ }
|
|
|
+ return Result.success("修改成功");
|
|
|
+ }
|
|
|
}
|