Commit 9cb811a7 authored by guangjing.gao's avatar guangjing.gao

默认羊小咩租户下

parent 3b360d28
......@@ -203,6 +203,10 @@ public class UserController implements IBaseController {
String verificationCode = successResult.getMsg();
// 执行短信验证码检查
verifyPhoneAndCodeForOnce(phoneNo, verificationCode);
//默认羊小咩租户
if (tenantId == null) {
tenantId = TenantUtil.TENANT_DEFAULT;
}
return userService.loginFast(channelId, appChannel, createdFrom, btRegisterChannelId, dimension, clickId, request, merchant, phoneNo, tenantId);
}
......@@ -438,6 +442,10 @@ public class UserController implements IBaseController {
*/
@RequestMapping("/token")
public JsonResult token(@RequestParam String token, @RequestParam(required = false) Integer tenantId) {
//默认羊小咩租户
if (tenantId == null) {
tenantId = TenantUtil.TENANT_DEFAULT;
}
Map<String, Object> result = new HashMap<>();
result.put("exist", false);
if (StringUtils.isEmpty(token)) {
......
......@@ -311,6 +311,10 @@ public class AppController implements IBaseController {
@RequestParam(required = false, defaultValue = "") String appChannel,
@RequestParam(required = false) Integer tenantId,
HttpServletRequest request) {
//默认羊小咩租户
if (tenantId == null) {
tenantId = TenantUtil.TENANT_DEFAULT;
}
if (!ValidationUtil.validatePhoneNo(phoneNo)) {
return JsonResult.buildErrorStateResult(USER_ERROR_OR_PASSWORD_ERROR, null);
}
......
......@@ -282,6 +282,10 @@ public class InnerController implements IBaseController {
@ApiOperation(httpMethod = "POST", value = "根据用户 ID 批量查询用户信息")
public JsonResult findByIds(@RequestParam(value = "userIds") String userIdsString, @RequestParam(required = false) Integer tenantId) {
log.info("批量查询用户的手机号列表, userIdsString:" + userIdsString + ", tenantId:" + tenantId);
//默认羊小咩租户
if (tenantId == null) {
tenantId = TenantUtil.TENANT_DEFAULT;
}
if (StringUtils.isEmpty(userIdsString)) {
return JsonResult.buildErrorStateResult(null, null);
}
......
......@@ -8,6 +8,7 @@ import cn.quantgroup.xyqb.entity.*;
import cn.quantgroup.xyqb.event.UserExtInfoSaveEvent;
import cn.quantgroup.xyqb.model.JsonResult;
import cn.quantgroup.xyqb.service.user.*;
import cn.quantgroup.xyqb.util.TenantUtil;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import io.swagger.annotations.ApiOperation;
......@@ -61,6 +62,10 @@ public class UserCenterController {
*/
@PostMapping("/attach/list")
public JsonResult queryUserAttachList(@RequestBody List<Long> userIds, @RequestParam(required = false) Integer tenantId) {
//默认羊小咩租户
if (tenantId == null) {
tenantId = TenantUtil.TENANT_DEFAULT;
}
if (CollectionUtils.isEmpty(userIds)) {
return JsonResult.buildErrorStateResult("用户 ID 不能为空", null);
}
......
......@@ -4,6 +4,7 @@ import cn.quantgroup.xyqb.entity.User;
import cn.quantgroup.xyqb.event.DisableActiveEvent;
import cn.quantgroup.xyqb.model.JsonResult;
import cn.quantgroup.xyqb.service.user.IUserService;
import cn.quantgroup.xyqb.util.TenantUtil;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.web.bind.annotation.*;
......@@ -94,6 +95,10 @@ public class UserController {
if (vals.size() > 500) {
vals = vals.subList(0,500);
}
//默认羊小咩租户
if (tenantId == null) {
tenantId = TenantUtil.TENANT_DEFAULT;
}
return JsonResult.buildSuccessResultGeneric(userService.findByUuidsOrUserIds(vals, type, tenantId));
}
}
......@@ -38,6 +38,10 @@ public class WxController {
*/
@GetMapping("/userId/{userId}")
public JsonResult openId(@PathVariable Long userId, @RequestParam(required = false) Integer tenantId) {
//默认羊小咩租户
if (tenantId == null) {
tenantId = TenantUtil.TENANT_DEFAULT;
}
WechatUserInfo wechatUserInfo = wechatService.queryByUserId(userId);
if (wechatUserInfo == null) {
return JsonResult.buildSuccessResult();
......@@ -70,6 +74,9 @@ public class WxController {
*/
@GetMapping("/phoneNo/{phoneNo}")
public JsonResult openId(@PathVariable String phoneNo, @RequestParam(required = false) Integer tenantId) {
if (tenantId == null) {
tenantId = TenantUtil.TENANT_DEFAULT;
}
WechatUserInfo wechatUserInfo = wechatService.findWechatUserInfoByPhoneNo(phoneNo);
if (wechatUserInfo == null) {
return JsonResult.buildSuccessResult();
......
......@@ -4,10 +4,11 @@ public class TenantUtil {
/* 租户羊小咩 */
public static final Integer TENANT_DEFAULT = 560761;
public static final String TENANT_USER_ERROR = "该租户下未找到此用户";
/* 租户ID校验是否羊小咩 */
public static boolean checkoutTenantIsDefault(Integer tenantId) {
if (tenantId == null || tenantId.equals(0) || TenantUtil.TENANT_DEFAULT.equals(tenantId)) {
if (tenantId == null || tenantId.equals(0)) {
return false;
}
return true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment