mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/per-boe/java-servers.git
synced 2025-12-10 19:36:50 +08:00
Merge branch 'master' of codeup.aliyun.com:6265f483e4166464dc2f9c14/boeu/baseservers
# Conflicts: # servers/boe-server-all/src/main/resources/application-pre.properties
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());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -61,7 +61,11 @@ public class OutSideDataServiceImpl implements IOutSideDataService {
|
||||
for(JsonNode node :result) {
|
||||
AudienceUser au=new AudienceUser();
|
||||
au.setId(node.get("userId").asText());
|
||||
au.setName(getNodeText(node.get("name")));
|
||||
if(node.get("realName")!=null) {
|
||||
au.setName(getNodeText(node.get("realName")));
|
||||
}else if(node.get("name")!=null){
|
||||
au.setName(getNodeText(node.get("name")));
|
||||
}
|
||||
au.setCode(getNodeText(node.get("userNo")));
|
||||
list.add(au);
|
||||
}
|
||||
|
||||
@@ -51,12 +51,13 @@ public class DataUserSyncServiceImpl implements IDataUserSyncService{
|
||||
if(user.getDeleted()!=null) {
|
||||
a.setDeleted(user.getDeleted());
|
||||
}
|
||||
|
||||
a.setLoginName(user.getCode());
|
||||
|
||||
}else {
|
||||
//新账户
|
||||
a=new Account();
|
||||
a.setDeleted(user.getDeleted());
|
||||
|
||||
a.setSysId(user.getKid());
|
||||
a.setLoginName(user.getCode());
|
||||
a.setAvatar(user.getAvatar());
|
||||
a.setId(user.getId());
|
||||
|
||||
Reference in New Issue
Block a user