|
|
@@ -3,7 +3,6 @@ package com.kym.miniapp.controller;
|
|
|
import cn.dev33.satoken.stp.StpUtil;
|
|
|
import com.alibaba.fastjson2.JSONObject;
|
|
|
import com.kym.common.R;
|
|
|
-import com.kym.common.utils.IDGenerator;
|
|
|
import com.kym.entity.common.PageBean;
|
|
|
import com.kym.entity.miniapp.User;
|
|
|
import com.kym.entity.miniapp.queryParams.WxLoginParams;
|
|
|
@@ -29,12 +28,10 @@ public class UserController {
|
|
|
|
|
|
private final CollectService collectService;
|
|
|
|
|
|
- private final IDGenerator idGenerator;
|
|
|
|
|
|
- public UserController(UserService userService, CollectService collectService, IDGenerator idGenerator) {
|
|
|
+ public UserController(UserService userService, CollectService collectService) {
|
|
|
this.userService = userService;
|
|
|
this.collectService = collectService;
|
|
|
- this.idGenerator = idGenerator;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -59,18 +56,6 @@ public class UserController {
|
|
|
return R.success();
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 刷新token
|
|
|
- *
|
|
|
- * @return
|
|
|
- */
|
|
|
- @GetMapping("/refresh")
|
|
|
- public R<?> refreshToken() {
|
|
|
- // 365天有效期,微信手机号接口开始收费了,有效期给长一点。
|
|
|
- StpUtil.renewTimeout(3600 * 24 * 365L);
|
|
|
- return R.success();
|
|
|
- }
|
|
|
-
|
|
|
/**
|
|
|
* 当前用户信息
|
|
|
*
|
|
|
@@ -81,17 +66,6 @@ public class UserController {
|
|
|
return R.success(userService.getMe());
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 获取单个用户信息
|
|
|
- *
|
|
|
- * @param id
|
|
|
- * @return
|
|
|
- */
|
|
|
- @GetMapping("/{id}")
|
|
|
- User getUser(@PathVariable("id") Long id) {
|
|
|
- return userService.getById(id);
|
|
|
- }
|
|
|
-
|
|
|
/**
|
|
|
* 用户列表
|
|
|
*
|
|
|
@@ -104,18 +78,6 @@ public class UserController {
|
|
|
return userService.listUserVo(pageNum, pageSize);
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 新增用户
|
|
|
- *
|
|
|
- * @param user
|
|
|
- * @return
|
|
|
- */
|
|
|
- @PostMapping
|
|
|
- Boolean saveUser(@RequestBody User user) {
|
|
|
- user.setId(idGenerator.nextId());
|
|
|
- return userService.save(user);
|
|
|
- }
|
|
|
-
|
|
|
/**
|
|
|
* 更新用户信息
|
|
|
*
|