mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/per-boe/java-servers.git
synced 2025-12-11 11:56:50 +08:00
提交修改
This commit is contained in:
@@ -7,6 +7,7 @@ import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.xboe.account.entity.Account;
|
||||
import com.xboe.account.service.IAccountService;
|
||||
import com.xboe.core.JsonResponse;
|
||||
import com.xboe.core.api.ApiBaseController;
|
||||
@@ -39,7 +40,7 @@ public class UserDataSyncApi extends ApiBaseController {
|
||||
IDataUserSyncService service;
|
||||
|
||||
@PostMapping("/user")
|
||||
public JsonResponse<Boolean> syncUser( @RequestBody UserData user) {
|
||||
public JsonResponse<Boolean> syncUser(@RequestBody UserData user) {
|
||||
|
||||
if (StringUtils.isBlank(user.getId())) {
|
||||
return error("无用户的id");
|
||||
@@ -54,5 +55,24 @@ public class UserDataSyncApi extends ApiBaseController {
|
||||
return error("同步处理用户失败", e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@PostMapping("/deluser")
|
||||
public JsonResponse<Boolean> deleteUser(String id) {
|
||||
|
||||
if (StringUtils.isBlank(id)) {
|
||||
return error("无用户的id");
|
||||
}
|
||||
//清除缓存需要loginName
|
||||
try {
|
||||
//先查询是否存在
|
||||
Account a=new Account();
|
||||
a.setId(id);
|
||||
accountService.delete(a);
|
||||
return success(true);
|
||||
} catch (Exception e) {
|
||||
log.error("同步删除用户错误", e);
|
||||
return error("同步删除用户失败", e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -51,6 +51,9 @@ public class DataUserSyncServiceImpl implements IDataUserSyncService{
|
||||
if(user.getDeleted()!=null) {
|
||||
a.setDeleted(user.getDeleted());
|
||||
}
|
||||
|
||||
a.setLoginName(user.getCode());
|
||||
|
||||
}else {
|
||||
//新账户
|
||||
a=new Account();
|
||||
|
||||
Reference in New Issue
Block a user