同步建立账户
This commit is contained in:
parent
7528fedced
commit
d86b20c246
|
|
@ -0,0 +1,21 @@
|
|||
package com.bonus.system.feign;
|
||||
|
||||
import com.bonus.common.core.web.domain.AjaxResult;
|
||||
import com.bonus.system.api.domain.SysUser;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
|
||||
@FeignClient(value="bonus-smart-canteen")
|
||||
@Service
|
||||
@Component
|
||||
public interface SmartCanteenClient {
|
||||
@ApiOperation(value = "新增账户")
|
||||
@RequestMapping(value = "/acc_info/sync",method = RequestMethod.POST)
|
||||
AjaxResult syncAccInfo(SysUser sysUser);
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -20,6 +20,7 @@ import com.bonus.system.api.domain.SysRole;
|
|||
import com.bonus.system.api.domain.SysUser;
|
||||
import com.bonus.system.api.domain.SysUserRole;
|
||||
import com.bonus.system.domain.SysUserPost;
|
||||
import com.bonus.system.feign.SmartCanteenClient;
|
||||
import com.bonus.system.mapper.*;
|
||||
import com.bonus.system.service.ISysConfigService;
|
||||
import com.bonus.system.service.ISysDeptService;
|
||||
|
|
@ -80,6 +81,9 @@ public class SysUserServiceImpl implements ISysUserService {
|
|||
@Autowired
|
||||
private JavaMailSender mailSender; // 自动注入JavaMailSender,用于发送邮件
|
||||
|
||||
@Resource
|
||||
private SmartCanteenClient smartCanteenClient;
|
||||
|
||||
/**
|
||||
* 根据条件分页查询用户列表
|
||||
*
|
||||
|
|
@ -332,6 +336,8 @@ public class SysUserServiceImpl implements ISysUserService {
|
|||
insertUserPost(user);
|
||||
// 新增用户与角色管理
|
||||
insertUserRole(user);
|
||||
// 同步创建账户数据
|
||||
smartCanteenClient.syncAccInfo(user);
|
||||
return rows;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue