|
@@ -5,10 +5,12 @@ import java.util.LinkedHashMap;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
-import com.baomidou.dynamic.datasource.annotation.DS;
|
|
|
|
|
import com.huimv.common.annotation.Anonymous;
|
|
import com.huimv.common.annotation.Anonymous;
|
|
|
|
|
+import com.huimv.common.core.domain.AjaxResult;
|
|
|
import com.huimv.common.core.domain.entity.SysUser;
|
|
import com.huimv.common.core.domain.entity.SysUser;
|
|
|
import com.huimv.system.service.ISysUserService;
|
|
import com.huimv.system.service.ISysUserService;
|
|
|
|
|
+import com.huimv.web.v1.domain.sqlite.DemoUserEntity;
|
|
|
|
|
+import com.huimv.web.v1.service.IDemoUserService;
|
|
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
import org.springframework.web.bind.annotation.PathVariable;
|
|
import org.springframework.web.bind.annotation.PathVariable;
|
|
@@ -43,6 +45,9 @@ public class TestController extends BaseController
|
|
|
@Resource
|
|
@Resource
|
|
|
private ISysUserService userService;
|
|
private ISysUserService userService;
|
|
|
|
|
|
|
|
|
|
+ @Resource
|
|
|
|
|
+ private IDemoUserService demoUserService;
|
|
|
|
|
+
|
|
|
private final static Map<Integer, UserEntity> users = new LinkedHashMap<Integer, UserEntity>();
|
|
private final static Map<Integer, UserEntity> users = new LinkedHashMap<Integer, UserEntity>();
|
|
|
{
|
|
{
|
|
|
users.put(1, new UserEntity(1, "admin", "admin123", "15888888888"));
|
|
users.put(1, new UserEntity(1, "admin", "admin123", "15888888888"));
|
|
@@ -67,15 +72,22 @@ public class TestController extends BaseController
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
- @DS("slave")
|
|
|
|
|
- @ApiOperation("获取从库用户列表")
|
|
|
|
|
|
|
+
|
|
|
|
|
+ @ApiOperation("获取用户列表")
|
|
|
@GetMapping("/list/slave")
|
|
@GetMapping("/list/slave")
|
|
|
- public R<List<SysUser>> slaveUserList()
|
|
|
|
|
|
|
+ public AjaxResult slaveUserList()
|
|
|
{
|
|
{
|
|
|
- List<SysUser> userList = new ArrayList<>(userService.selectUserList(new SysUser()));
|
|
|
|
|
- return R.ok(userList);
|
|
|
|
|
|
|
+ return success(demoUserService.listAll());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @ApiOperation("添加用户数据")
|
|
|
|
|
+ @PostMapping("/add/slave")
|
|
|
|
|
+ public AjaxResult slaveUserAdd(@RequestBody DemoUserEntity request)
|
|
|
|
|
+ {
|
|
|
|
|
+ return success(demoUserService.add(request));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
@ApiOperation("获取用户详细")
|
|
@ApiOperation("获取用户详细")
|
|
|
@ApiImplicitParam(name = "userId", value = "用户ID", required = true, dataType = "int", paramType = "path", dataTypeClass = Integer.class)
|
|
@ApiImplicitParam(name = "userId", value = "用户ID", required = true, dataType = "int", paramType = "path", dataTypeClass = Integer.class)
|
|
|
@GetMapping("/{userId}")
|
|
@GetMapping("/{userId}")
|