Compare commits
2 Commits
7ed35400b9
...
1eeedbdab5
| Author | SHA1 | Date |
|---|---|---|
|
|
1eeedbdab5 | |
|
|
513c3a015c |
|
|
@ -87,11 +87,8 @@
|
||||||
<artifactId>socket.io-client</artifactId>
|
<artifactId>socket.io-client</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>com.dtflys.forest</groupId>
|
|
||||||
<artifactId>forest-spring-boot-starter</artifactId>
|
|
||||||
<version>1.6.3</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
package com.ff;
|
package com.ff;
|
||||||
|
|
||||||
import com.ff.base.config.IdGeneratorUtil;
|
|
||||||
import org.mybatis.spring.annotation.MapperScan;
|
import org.mybatis.spring.annotation.MapperScan;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.boot.CommandLineRunner;
|
import org.springframework.boot.CommandLineRunner;
|
||||||
|
|
@ -22,10 +21,9 @@ import org.springframework.security.authentication.dao.DaoAuthenticationProvider
|
||||||
@MapperScan({"com.ff.base.system.mapper","com.ff.quartz.mapper","com.ff.gen.mapper"})
|
@MapperScan({"com.ff.base.system.mapper","com.ff.quartz.mapper","com.ff.gen.mapper"})
|
||||||
@ComponentScan(excludeFilters = {@ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, value = DaoAuthenticationProvider.class)})
|
@ComponentScan(excludeFilters = {@ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, value = DaoAuthenticationProvider.class)})
|
||||||
@EnableAsync
|
@EnableAsync
|
||||||
public class FFApplication implements CommandLineRunner
|
public class FFApplication
|
||||||
{
|
{
|
||||||
@Autowired
|
|
||||||
private IdGeneratorUtil idGeneratorUtil;
|
|
||||||
|
|
||||||
|
|
||||||
public static void main(String[] args)
|
public static void main(String[] args)
|
||||||
|
|
@ -37,8 +35,5 @@ public class FFApplication implements CommandLineRunner
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void run(String... args) throws Exception {
|
|
||||||
idGeneratorUtil.init();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,124 @@
|
||||||
|
package com.ff.agent.contoller;
|
||||||
|
|
||||||
|
|
||||||
|
import cn.hutool.core.util.IdUtil;
|
||||||
|
import com.ff.agent.dto.AgentTenantSecretKeyDTO;
|
||||||
|
import com.ff.agent.request.AgentCreateTenantRequest;
|
||||||
|
import com.ff.base.core.controller.BaseController;
|
||||||
|
import com.ff.base.core.domain.AjaxResult;
|
||||||
|
import com.ff.base.core.page.TableDataInfo;
|
||||||
|
import com.ff.base.system.dto.TenantSecretKeyDTO;
|
||||||
|
import com.ff.base.system.service.ISysDeptService;
|
||||||
|
import com.ff.base.system.service.ISysRoleService;
|
||||||
|
import com.ff.base.system.service.ISysUserService;
|
||||||
|
import com.ff.base.utils.MessageUtils;
|
||||||
|
import com.ff.base.utils.SecurityUtils;
|
||||||
|
import com.ff.base.utils.bean.BeanUtils;
|
||||||
|
import com.ff.base.utils.uuid.IdUtils;
|
||||||
|
import com.ff.base.system.domain.TenantSecretKey;
|
||||||
|
import com.ff.common.service.ITenantGameQuotaService;
|
||||||
|
import com.ff.base.system.service.ITenantSecretKeyService;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import org.springframework.util.Assert;
|
||||||
|
import org.springframework.util.CollectionUtils;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* api控制器
|
||||||
|
*
|
||||||
|
* @author shi
|
||||||
|
* @date 2025/02/10
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/agent/tenant")
|
||||||
|
@Slf4j
|
||||||
|
public class AgentController extends BaseController {
|
||||||
|
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ITenantSecretKeyService tenantSecretKeyService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ITenantGameQuotaService tenantGameQuotaService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ISysRoleService roleService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ISysDeptService deptService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ISysUserService userService;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 列表
|
||||||
|
*
|
||||||
|
* @param tenantSecretKeyDTO 租户密钥
|
||||||
|
* @return {@link TableDataInfo }
|
||||||
|
*/
|
||||||
|
@GetMapping("/list")
|
||||||
|
@Transactional
|
||||||
|
@PreAuthorize("@ss.hasPermi('agent:tenant:list')")
|
||||||
|
public TableDataInfo list(TenantSecretKeyDTO tenantSecretKeyDTO) {
|
||||||
|
startPage();
|
||||||
|
tenantSecretKeyDTO.setAgentId(getUserId());
|
||||||
|
List<TenantSecretKey> tenantSecretKeys = tenantSecretKeyService.selectTenantSecretKeyDTOList(tenantSecretKeyDTO);
|
||||||
|
TableDataInfo dataTable = getDataTable(tenantSecretKeys);
|
||||||
|
List<AgentTenantSecretKeyDTO> list=new ArrayList<>();
|
||||||
|
for (TenantSecretKey row : (List<TenantSecretKey>) dataTable.getRows()) {
|
||||||
|
AgentTenantSecretKeyDTO agentTenantSecretKeyDTO=new AgentTenantSecretKeyDTO();
|
||||||
|
BeanUtils.copyProperties(row, agentTenantSecretKeyDTO);
|
||||||
|
list.add(agentTenantSecretKeyDTO);
|
||||||
|
}
|
||||||
|
dataTable.setRows(list);
|
||||||
|
|
||||||
|
return dataTable;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 信息
|
||||||
|
*
|
||||||
|
* @return {@link AjaxResult }
|
||||||
|
*/
|
||||||
|
@PostMapping("/create")
|
||||||
|
@Transactional
|
||||||
|
@PreAuthorize("@ss.hasPermi('agent:tenant:create')")
|
||||||
|
public AjaxResult createTenant(@Validated @RequestBody AgentCreateTenantRequest agentCreateTenantRequest) {
|
||||||
|
|
||||||
|
Assert.isTrue(CollectionUtils.isEmpty(tenantSecretKeyService.selectTenantSecretKeyList(TenantSecretKey.builder()
|
||||||
|
.tenantKey(agentCreateTenantRequest.getAccount())
|
||||||
|
.build())), MessageUtils.message("operation.tenant.account.already.used"));
|
||||||
|
|
||||||
|
Assert.isTrue(agentCreateTenantRequest.getPassword().equals(agentCreateTenantRequest.getConfirmPassword()),MessageUtils.message("operation.password.mismatch"));
|
||||||
|
//创建租户
|
||||||
|
TenantSecretKey tenantSecretKey = new TenantSecretKey();
|
||||||
|
tenantSecretKey.setAgentId(getUserId());
|
||||||
|
tenantSecretKey.setTenantKey(agentCreateTenantRequest.getAccount());
|
||||||
|
tenantSecretKey.setPassword(SecurityUtils.encryptPassword(agentCreateTenantRequest.getPassword()));
|
||||||
|
tenantSecretKey.setTenantSn(tenantSecretKeyService.generateTenantSn());
|
||||||
|
tenantSecretKey.setTenantSecret(IdUtils.simpleUUID());
|
||||||
|
tenantSecretKey.setDepositRatio(agentCreateTenantRequest.getDepositRatio());
|
||||||
|
tenantSecretKey.setTenantType(agentCreateTenantRequest.getTenantType());
|
||||||
|
tenantSecretKey.setCreateBy(getUsername());
|
||||||
|
tenantSecretKey.setTenantStatus(Boolean.TRUE);
|
||||||
|
int insertedTenantSecretKey = tenantSecretKeyService.insertTenantSecretKey(tenantSecretKey);
|
||||||
|
|
||||||
|
|
||||||
|
return toAjax(insertedTenantSecretKey);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,89 @@
|
||||||
|
package com.ff.agent.dto;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
|
import com.ff.base.annotation.Excel;
|
||||||
|
import com.ff.base.core.domain.BaseEntity;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户租户密钥对象 ff_tenant_secret_key
|
||||||
|
*
|
||||||
|
* @author shi
|
||||||
|
* @date 2025-02-20
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Builder
|
||||||
|
public class AgentTenantSecretKeyDTO extends BaseEntity
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** 主键id */
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/** 密码 */
|
||||||
|
@Excel(name = "密码")
|
||||||
|
@JsonIgnore
|
||||||
|
private String password;
|
||||||
|
|
||||||
|
/** 最后登录ip */
|
||||||
|
@Excel(name = "最后登录ip")
|
||||||
|
private String loginIp;
|
||||||
|
|
||||||
|
/** 最后登录时间 */
|
||||||
|
@Excel(name = "最后登录时间")
|
||||||
|
private Long loginData;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/** 租户key */
|
||||||
|
@Excel(name = "租户key")
|
||||||
|
private String tenantKey;
|
||||||
|
|
||||||
|
/** 代理id */
|
||||||
|
@Excel(name = "代理id")
|
||||||
|
private Long agentId;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/** 商户后缀 */
|
||||||
|
@Excel(name = "商户后缀")
|
||||||
|
@JsonIgnore
|
||||||
|
private String tenantSn;
|
||||||
|
|
||||||
|
/** 租户密钥 */
|
||||||
|
@Excel(name = "租户密钥")
|
||||||
|
@JsonIgnore
|
||||||
|
private String tenantSecret;
|
||||||
|
|
||||||
|
/** 租户状态 1正常 0停用 */
|
||||||
|
@Excel(name = "租户状态 1正常 0停用")
|
||||||
|
private Boolean tenantStatus;
|
||||||
|
|
||||||
|
/** 额度类型 TenantQuotaType 枚举 */
|
||||||
|
@Excel(name = "额度类型 TenantQuotaType 枚举")
|
||||||
|
private Integer quotaType;
|
||||||
|
|
||||||
|
/** 买分比例 */
|
||||||
|
@Excel(name = "买分比例")
|
||||||
|
private BigDecimal scoreRatio;
|
||||||
|
|
||||||
|
/** 租户类型 TenantType 枚举 */
|
||||||
|
@Excel(name = "租户类型 TenantType 枚举")
|
||||||
|
private Integer tenantType;
|
||||||
|
|
||||||
|
/** 透支比例 */
|
||||||
|
@Excel(name = "透支比例")
|
||||||
|
private BigDecimal depositRatio;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,58 @@
|
||||||
|
package com.ff.agent.request;
|
||||||
|
|
||||||
|
|
||||||
|
import com.ff.base.xss.Xss;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import javax.validation.constraints.Size;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 代理创建租户
|
||||||
|
*
|
||||||
|
* @author shi
|
||||||
|
* @date 2025/02/20
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class AgentCreateTenantRequest implements Serializable {
|
||||||
|
private static final long serialVersionUID = -5561068216486978354L;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 账户
|
||||||
|
*/
|
||||||
|
@Xss(message = "用户账号不能包含脚本字符")
|
||||||
|
@NotBlank(message = "用户账号不能为空")
|
||||||
|
@Size(min = 2, max = 30, message = "用户账号长度不能超过30个字符")
|
||||||
|
private String account;
|
||||||
|
/**
|
||||||
|
* 密码
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "密码不能为空")
|
||||||
|
@Size(min = 5, max = 20, message = "密码长度不能超过25个字符")
|
||||||
|
private String password;
|
||||||
|
/**
|
||||||
|
* 确认密码
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "确认密码不能为空")
|
||||||
|
@Size(min = 5, max = 20, message = "密码长度不能超过25个字符")
|
||||||
|
private String confirmPassword;
|
||||||
|
|
||||||
|
|
||||||
|
/** 租户类型 TenantType 枚举 */
|
||||||
|
@NotNull(message = "租户类型不能为空")
|
||||||
|
private Integer tenantType;
|
||||||
|
|
||||||
|
/** 信誉额度*/
|
||||||
|
private BigDecimal realBalance;
|
||||||
|
|
||||||
|
/** 透支比例 */
|
||||||
|
private BigDecimal depositRatio;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -3,8 +3,8 @@ package com.ff.annotation;
|
||||||
import com.ff.base.constant.Constants;
|
import com.ff.base.constant.Constants;
|
||||||
import com.ff.config.KeyConfig;
|
import com.ff.config.KeyConfig;
|
||||||
import com.ff.base.utils.sign.Md5Utils;
|
import com.ff.base.utils.sign.Md5Utils;
|
||||||
import com.ff.common.domain.TenantSecretKey;
|
import com.ff.base.system.domain.TenantSecretKey;
|
||||||
import com.ff.common.service.ITenantSecretKeyService;
|
import com.ff.base.system.service.ITenantSecretKeyService;
|
||||||
import org.aspectj.lang.annotation.Aspect;
|
import org.aspectj.lang.annotation.Aspect;
|
||||||
import org.aspectj.lang.annotation.Before;
|
import org.aspectj.lang.annotation.Before;
|
||||||
import org.aspectj.lang.annotation.Pointcut;
|
import org.aspectj.lang.annotation.Pointcut;
|
||||||
|
|
|
||||||
|
|
@ -1,81 +0,0 @@
|
||||||
package com.ff.api.controller;
|
|
||||||
|
|
||||||
|
|
||||||
import com.ff.annotation.CheckHeader;
|
|
||||||
import com.ff.api.response.TenantInfoResponse;
|
|
||||||
import com.ff.base.constant.Constants;
|
|
||||||
import com.ff.base.core.controller.BaseController;
|
|
||||||
import com.ff.base.core.domain.AjaxResult;
|
|
||||||
import com.ff.base.enums.QuotaType;
|
|
||||||
import com.ff.base.system.service.ISysDeptService;
|
|
||||||
import com.ff.base.system.service.ISysRoleService;
|
|
||||||
import com.ff.base.utils.SecurityUtils;
|
|
||||||
import com.ff.base.utils.StringUtils;
|
|
||||||
import com.ff.base.utils.bean.BeanUtils;
|
|
||||||
import com.ff.common.domain.TenantGameQuota;
|
|
||||||
import com.ff.common.domain.TenantSecretKey;
|
|
||||||
import com.ff.common.service.ITenantGameQuotaService;
|
|
||||||
import com.ff.common.service.ITenantSecretKeyService;
|
|
||||||
import com.ff.config.KeyConfig;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* api控制器
|
|
||||||
*
|
|
||||||
* @author shi
|
|
||||||
* @date 2025/02/10
|
|
||||||
*/
|
|
||||||
@RestController
|
|
||||||
@CheckHeader
|
|
||||||
@RequestMapping("/api/agent")
|
|
||||||
@Slf4j
|
|
||||||
public class ApiAgentController extends BaseController {
|
|
||||||
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
private ITenantSecretKeyService tenantSecretKeyService;
|
|
||||||
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
private ISysRoleService roleService;
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
private ISysDeptService deptService;
|
|
||||||
|
|
||||||
//
|
|
||||||
// /**
|
|
||||||
// * 信息
|
|
||||||
// *
|
|
||||||
// * @return {@link AjaxResult }
|
|
||||||
// */
|
|
||||||
// @PostMapping("/create/tenant")
|
|
||||||
// public AjaxResult createTenant(TenantSecretKey tenantSecretKey) {
|
|
||||||
// roleService.selectRoleList(tenantSecretKey)
|
|
||||||
// if (!userService.checkUserNameUnique(user))
|
|
||||||
// {
|
|
||||||
// return error("新增用户'" + user.getUserName() + "'失败,登录账号已存在");
|
|
||||||
// }
|
|
||||||
// else if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(user))
|
|
||||||
// {
|
|
||||||
// return error("新增用户'" + user.getUserName() + "'失败,手机号码已存在");
|
|
||||||
// }
|
|
||||||
// else if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(user))
|
|
||||||
// {
|
|
||||||
// return error("新增用户'" + user.getUserName() + "'失败,邮箱账号已存在");
|
|
||||||
// }
|
|
||||||
// user.setCreateBy(getUsername());
|
|
||||||
// user.setPassword(SecurityUtils.encryptPassword(user.getPassword()));
|
|
||||||
// return toAjax(userService.insertUser(user));
|
|
||||||
//
|
|
||||||
// tenantSecretKey.setAgentId(getUserId());
|
|
||||||
// tenantSecretKeyService.insertTenantSecretKey(tenantSecretKey);
|
|
||||||
// return AjaxResult.success(tenantInfoResponse);
|
|
||||||
// }
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -12,12 +12,9 @@ import com.ff.base.core.page.TableDataInfo;
|
||||||
import com.ff.base.enums.*;
|
import com.ff.base.enums.*;
|
||||||
import com.ff.base.exception.base.ApiException;
|
import com.ff.base.exception.base.ApiException;
|
||||||
import com.ff.base.exception.base.BaseException;
|
import com.ff.base.exception.base.BaseException;
|
||||||
import com.ff.base.utils.QuotaUtils;
|
|
||||||
import com.ff.base.utils.StringUtils;
|
import com.ff.base.utils.StringUtils;
|
||||||
import com.ff.base.utils.bean.BeanUtils;
|
import com.ff.base.utils.bean.BeanUtils;
|
||||||
import com.ff.common.domain.TenantGameQuotaFlow;
|
import com.ff.base.system.domain.TenantSecretKey;
|
||||||
import com.ff.common.domain.TenantSecretKey;
|
|
||||||
import com.ff.common.dto.BalanceChangesDTO;
|
|
||||||
import com.ff.common.dto.GameBalanceExchange;
|
import com.ff.common.dto.GameBalanceExchange;
|
||||||
import com.ff.common.service.ITenantGameQuotaFlowService;
|
import com.ff.common.service.ITenantGameQuotaFlowService;
|
||||||
import com.ff.common.service.ITenantGameQuotaService;
|
import com.ff.common.service.ITenantGameQuotaService;
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
package com.ff.api.controller;
|
package com.ff.api.controller;
|
||||||
|
|
||||||
|
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
|
||||||
import com.ff.annotation.CheckHeader;
|
import com.ff.annotation.CheckHeader;
|
||||||
import com.ff.api.request.MemberCreateApiRequest;
|
import com.ff.api.request.MemberCreateApiRequest;
|
||||||
import com.ff.api.request.MemberInfoAllApiRequest;
|
import com.ff.api.request.MemberInfoAllApiRequest;
|
||||||
|
|
@ -14,9 +13,8 @@ import com.ff.base.core.domain.AjaxResult;
|
||||||
import com.ff.base.enums.ErrorCode;
|
import com.ff.base.enums.ErrorCode;
|
||||||
import com.ff.base.exception.base.ApiException;
|
import com.ff.base.exception.base.ApiException;
|
||||||
import com.ff.base.exception.base.BaseException;
|
import com.ff.base.exception.base.BaseException;
|
||||||
import com.ff.base.manager.AsyncManager;
|
|
||||||
import com.ff.base.utils.StringUtils;
|
import com.ff.base.utils.StringUtils;
|
||||||
import com.ff.common.domain.TenantSecretKey;
|
import com.ff.base.system.domain.TenantSecretKey;
|
||||||
import com.ff.config.KeyConfig;
|
import com.ff.config.KeyConfig;
|
||||||
import com.ff.game.api.IGamesService;
|
import com.ff.game.api.IGamesService;
|
||||||
import com.ff.game.api.request.*;
|
import com.ff.game.api.request.*;
|
||||||
|
|
@ -42,7 +40,6 @@ import java.util.ArrayList;
|
||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
|
||||||
import java.util.concurrent.CountDownLatch;
|
import java.util.concurrent.CountDownLatch;
|
||||||
import java.util.concurrent.Future;
|
import java.util.concurrent.Future;
|
||||||
|
|
||||||
|
|
@ -99,14 +96,7 @@ public class ApiMemberController extends BaseController {
|
||||||
ApiException.notNull(gameSecretKey, ErrorCode.CURRENCY_NOT_EXIST.getCode());
|
ApiException.notNull(gameSecretKey, ErrorCode.CURRENCY_NOT_EXIST.getCode());
|
||||||
|
|
||||||
String gameAccount = StringUtils.addSuffix(memberCreateApiRequest.getAccount(), memberCreateApiRequest.getCurrencyCode() + tenantSecretKey.getTenantSn());
|
String gameAccount = StringUtils.addSuffix(memberCreateApiRequest.getAccount(), memberCreateApiRequest.getCurrencyCode() + tenantSecretKey.getTenantSn());
|
||||||
//向第三方注册账号
|
|
||||||
CreateMemberRequestDTO gamesBaseRequestDTO = CreateMemberRequestDTO.builder()
|
|
||||||
.account(gameAccount)
|
|
||||||
.agentId(gameSecretKey.getCode())
|
|
||||||
.agentKey(gameSecretKey.getKey())
|
|
||||||
.build();
|
|
||||||
Boolean result = iGamesService.createMember(gamesBaseRequestDTO);
|
|
||||||
Assert.isTrue(result, "建立游戏账号失败");
|
|
||||||
|
|
||||||
List<Member> members = memberService.selectMemberList(Member.builder()
|
List<Member> members = memberService.selectMemberList(Member.builder()
|
||||||
.tenantKey(tenantSecretKey.getTenantKey()).gameAccount(gameAccount).build());
|
.tenantKey(tenantSecretKey.getTenantKey()).gameAccount(gameAccount).build());
|
||||||
|
|
@ -119,8 +109,17 @@ public class ApiMemberController extends BaseController {
|
||||||
.platformCode(memberCreateApiRequest.getPlatformCode())
|
.platformCode(memberCreateApiRequest.getPlatformCode())
|
||||||
.currencyCode(memberCreateApiRequest.getCurrencyCode())
|
.currencyCode(memberCreateApiRequest.getCurrencyCode())
|
||||||
.build();
|
.build();
|
||||||
return toAjax(memberService.insertMember(member));
|
int insertMember = memberService.insertMember(member);
|
||||||
|
Assert.isTrue(insertMember>0, "建立游戏账号失败");
|
||||||
}
|
}
|
||||||
|
//向第三方注册账号
|
||||||
|
CreateMemberRequestDTO gamesBaseRequestDTO = CreateMemberRequestDTO.builder()
|
||||||
|
.account(gameAccount)
|
||||||
|
.agentId(gameSecretKey.getCode())
|
||||||
|
.agentKey(gameSecretKey.getKey())
|
||||||
|
.build();
|
||||||
|
Boolean result = iGamesService.createMember(gamesBaseRequestDTO);
|
||||||
|
Assert.isTrue(result, "建立游戏账号失败");
|
||||||
return toAjax(Boolean.TRUE);
|
return toAjax(Boolean.TRUE);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -152,8 +151,8 @@ public class ApiMemberController extends BaseController {
|
||||||
.agentKey(gameSecretKey.getKey())
|
.agentKey(gameSecretKey.getKey())
|
||||||
.build();
|
.build();
|
||||||
MemberInfoResponseDTO memberInfo = iGamesService.getMemberInfo(gamesBaseRequestDTO);
|
MemberInfoResponseDTO memberInfo = iGamesService.getMemberInfo(gamesBaseRequestDTO);
|
||||||
MemberInfoResponse memberInfoResponse=new MemberInfoResponse();
|
MemberInfoResponse memberInfoResponse = new MemberInfoResponse();
|
||||||
BeanUtils.copyProperties(memberInfo,memberInfoResponse);
|
BeanUtils.copyProperties(memberInfo, memberInfoResponse);
|
||||||
return AjaxResult.success(memberInfoResponse);
|
return AjaxResult.success(memberInfoResponse);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -226,6 +225,4 @@ public class ApiMemberController extends BaseController {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ import com.ff.base.core.domain.AjaxResult;
|
||||||
import com.ff.base.enums.QuotaType;
|
import com.ff.base.enums.QuotaType;
|
||||||
import com.ff.base.utils.bean.BeanUtils;
|
import com.ff.base.utils.bean.BeanUtils;
|
||||||
import com.ff.common.domain.TenantGameQuota;
|
import com.ff.common.domain.TenantGameQuota;
|
||||||
import com.ff.common.domain.TenantSecretKey;
|
import com.ff.base.system.domain.TenantSecretKey;
|
||||||
import com.ff.common.service.ITenantGameQuotaService;
|
import com.ff.common.service.ITenantGameQuotaService;
|
||||||
import com.ff.config.KeyConfig;
|
import com.ff.config.KeyConfig;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
|
||||||
|
|
@ -1,46 +0,0 @@
|
||||||
package com.ff.api.request;
|
|
||||||
|
|
||||||
|
|
||||||
import com.ff.base.annotation.Excel;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 代理创建租户
|
|
||||||
*
|
|
||||||
* @author shi
|
|
||||||
* @date 2025/02/20
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
public class AgentCreateTenant implements Serializable {
|
|
||||||
private static final long serialVersionUID = -5561068216486978354L;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 账户
|
|
||||||
*/
|
|
||||||
private String account;
|
|
||||||
/**
|
|
||||||
* 密码
|
|
||||||
*/
|
|
||||||
private String password;
|
|
||||||
/**
|
|
||||||
* 确认密码
|
|
||||||
*/
|
|
||||||
private String confirmPassword;
|
|
||||||
|
|
||||||
/** 额度类型 TenantQuotaType 枚举 */
|
|
||||||
private Integer quotaType;
|
|
||||||
|
|
||||||
/** 买分比例 */
|
|
||||||
@Excel(name = "买分比例")
|
|
||||||
private BigDecimal scoreRatio;
|
|
||||||
|
|
||||||
/** 租户类型 TenantType 枚举 */
|
|
||||||
private Integer tenantType;
|
|
||||||
|
|
||||||
/** 透支比例 */
|
|
||||||
private BigDecimal depositRatio;
|
|
||||||
}
|
|
||||||
|
|
@ -16,8 +16,8 @@ import com.ff.base.annotation.Log;
|
||||||
import com.ff.base.core.controller.BaseController;
|
import com.ff.base.core.controller.BaseController;
|
||||||
import com.ff.base.core.domain.AjaxResult;
|
import com.ff.base.core.domain.AjaxResult;
|
||||||
import com.ff.base.enums.BusinessType;
|
import com.ff.base.enums.BusinessType;
|
||||||
import com.ff.common.domain.TenantSecretKey;
|
import com.ff.base.system.domain.TenantSecretKey;
|
||||||
import com.ff.common.service.ITenantSecretKeyService;
|
import com.ff.base.system.service.ITenantSecretKeyService;
|
||||||
import com.ff.base.utils.poi.ExcelUtil;
|
import com.ff.base.utils.poi.ExcelUtil;
|
||||||
import com.ff.base.core.page.TableDataInfo;
|
import com.ff.base.core.page.TableDataInfo;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
package com.ff.common.domain;
|
package com.ff.common.domain;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.ff.base.annotation.Excel;
|
import com.ff.base.annotation.Excel;
|
||||||
import com.ff.base.core.domain.BaseEntity;
|
import com.ff.base.core.domain.BaseEntity;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
|
|
@ -23,6 +25,7 @@ public class TenantGameQuota extends BaseEntity
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
/** 主键id */
|
/** 主键id */
|
||||||
|
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
/** 租户key */
|
/** 租户key */
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
package com.ff.common.service.impl;
|
package com.ff.common.service.impl;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.IdUtil;
|
||||||
import com.ff.base.utils.DateUtils;
|
import com.ff.base.utils.DateUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
@ -53,6 +55,7 @@ public class CurrencyServiceImpl implements ICurrencyService
|
||||||
@Override
|
@Override
|
||||||
public int insertCurrency(Currency currency)
|
public int insertCurrency(Currency currency)
|
||||||
{
|
{
|
||||||
|
currency.setId(IdUtil.getSnowflakeNextId());
|
||||||
currency.setCreateTime(DateUtils.getNowDate());
|
currency.setCreateTime(DateUtils.getNowDate());
|
||||||
return currencyMapper.insertCurrency(currency);
|
return currencyMapper.insertCurrency(currency);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
package com.ff.common.service.impl;
|
package com.ff.common.service.impl;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.IdUtil;
|
||||||
import com.ff.base.utils.DateUtils;
|
import com.ff.base.utils.DateUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
@ -53,6 +55,7 @@ public class LangServiceImpl implements ILangService
|
||||||
@Override
|
@Override
|
||||||
public int insertLang(Lang lang)
|
public int insertLang(Lang lang)
|
||||||
{
|
{
|
||||||
|
lang.setId(IdUtil.getSnowflakeNextId());
|
||||||
lang.setCreateTime(DateUtils.getNowDate());
|
lang.setCreateTime(DateUtils.getNowDate());
|
||||||
return langMapper.insertLang(lang);
|
return langMapper.insertLang(lang);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ package com.ff.common.service.impl;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.IdUtil;
|
||||||
import com.ff.base.utils.DateUtils;
|
import com.ff.base.utils.DateUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
@ -51,6 +52,7 @@ public class TenantGameQuotaFlowServiceImpl implements ITenantGameQuotaFlowServi
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int insertTenantGameQuotaFlow(TenantGameQuotaFlow tenantGameQuotaFlow) {
|
public int insertTenantGameQuotaFlow(TenantGameQuotaFlow tenantGameQuotaFlow) {
|
||||||
|
tenantGameQuotaFlow.setId(IdUtil.getSnowflakeNextId());
|
||||||
tenantGameQuotaFlow.setCreateTime(DateUtils.getNowDate());
|
tenantGameQuotaFlow.setCreateTime(DateUtils.getNowDate());
|
||||||
return tenantGameQuotaFlowMapper.insertTenantGameQuotaFlow(tenantGameQuotaFlow);
|
return tenantGameQuotaFlowMapper.insertTenantGameQuotaFlow(tenantGameQuotaFlow);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,23 +5,23 @@ import java.math.RoundingMode;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.IdUtil;
|
||||||
import cn.hutool.core.util.NumberUtil;
|
import cn.hutool.core.util.NumberUtil;
|
||||||
import com.ff.base.constant.Constants;
|
import com.ff.base.constant.Constants;
|
||||||
import com.ff.base.enums.*;
|
import com.ff.base.enums.*;
|
||||||
import com.ff.base.exception.base.ApiException;
|
import com.ff.base.exception.base.ApiException;
|
||||||
import com.ff.base.utils.DateUtils;
|
import com.ff.base.utils.DateUtils;
|
||||||
import com.ff.base.utils.NumberUtils;
|
|
||||||
import com.ff.base.utils.QuotaUtils;
|
import com.ff.base.utils.QuotaUtils;
|
||||||
import com.ff.base.utils.StringUtils;
|
import com.ff.base.utils.StringUtils;
|
||||||
import com.ff.common.domain.TenantGameQuotaFlow;
|
import com.ff.common.domain.TenantGameQuotaFlow;
|
||||||
import com.ff.common.domain.TenantQuotaExchange;
|
import com.ff.common.domain.TenantQuotaExchange;
|
||||||
import com.ff.common.domain.TenantSecretKey;
|
import com.ff.base.system.domain.TenantSecretKey;
|
||||||
import com.ff.common.dto.BalanceChangesDTO;
|
import com.ff.common.dto.BalanceChangesDTO;
|
||||||
import com.ff.common.dto.BalanceRealChangesDTO;
|
import com.ff.common.dto.BalanceRealChangesDTO;
|
||||||
import com.ff.common.dto.GameBalanceExchange;
|
import com.ff.common.dto.GameBalanceExchange;
|
||||||
import com.ff.common.service.ITenantGameQuotaFlowService;
|
import com.ff.common.service.ITenantGameQuotaFlowService;
|
||||||
import com.ff.common.service.ITenantQuotaExchangeService;
|
import com.ff.common.service.ITenantQuotaExchangeService;
|
||||||
import com.ff.common.service.ITenantSecretKeyService;
|
import com.ff.base.system.service.ITenantSecretKeyService;
|
||||||
import com.ff.game.api.IGamesService;
|
import com.ff.game.api.IGamesService;
|
||||||
import com.ff.game.api.request.MemberInfoRequestDTO;
|
import com.ff.game.api.request.MemberInfoRequestDTO;
|
||||||
import com.ff.game.domain.GameSecretKey;
|
import com.ff.game.domain.GameSecretKey;
|
||||||
|
|
@ -34,7 +34,6 @@ import com.ff.common.mapper.TenantGameQuotaMapper;
|
||||||
import com.ff.common.domain.TenantGameQuota;
|
import com.ff.common.domain.TenantGameQuota;
|
||||||
import com.ff.common.service.ITenantGameQuotaService;
|
import com.ff.common.service.ITenantGameQuotaService;
|
||||||
import org.springframework.util.Assert;
|
import org.springframework.util.Assert;
|
||||||
import org.springframework.util.CollectionUtils;
|
|
||||||
import org.springframework.util.ObjectUtils;
|
import org.springframework.util.ObjectUtils;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
|
@ -105,6 +104,7 @@ public class TenantGameQuotaServiceImpl implements ITenantGameQuotaService {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int insertTenantGameQuota(TenantGameQuota tenantGameQuota) {
|
public int insertTenantGameQuota(TenantGameQuota tenantGameQuota) {
|
||||||
|
tenantGameQuota.setId(IdUtil.getSnowflakeNextId());
|
||||||
tenantGameQuota.setCreateTime(DateUtils.getNowDate());
|
tenantGameQuota.setCreateTime(DateUtils.getNowDate());
|
||||||
return tenantGameQuotaMapper.insertTenantGameQuota(tenantGameQuota);
|
return tenantGameQuotaMapper.insertTenantGameQuota(tenantGameQuota);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
package com.ff.common.service.impl;
|
package com.ff.common.service.impl;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.IdUtil;
|
||||||
import com.ff.base.utils.DateUtils;
|
import com.ff.base.utils.DateUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
@ -65,6 +67,7 @@ public class TenantQuotaExchangeServiceImpl implements ITenantQuotaExchangeServi
|
||||||
@Override
|
@Override
|
||||||
public int insertTenantQuotaExchange(TenantQuotaExchange tenantQuotaExchange)
|
public int insertTenantQuotaExchange(TenantQuotaExchange tenantQuotaExchange)
|
||||||
{
|
{
|
||||||
|
tenantQuotaExchange.setId(IdUtil.getSnowflakeNextId());
|
||||||
tenantQuotaExchange.setCreateTime(DateUtils.getNowDate());
|
tenantQuotaExchange.setCreateTime(DateUtils.getNowDate());
|
||||||
return tenantQuotaExchangeMapper.insertTenantQuotaExchange(tenantQuotaExchange);
|
return tenantQuotaExchangeMapper.insertTenantQuotaExchange(tenantQuotaExchange);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,126 +0,0 @@
|
||||||
package com.ff.common.service.impl;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import com.ff.base.utils.DateUtils;
|
|
||||||
import com.ff.base.utils.NumberUtils;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
import com.ff.common.mapper.TenantSecretKeyMapper;
|
|
||||||
import com.ff.common.domain.TenantSecretKey;
|
|
||||||
import com.ff.common.service.ITenantSecretKeyService;
|
|
||||||
import org.springframework.util.CollectionUtils;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 用户租户密钥Service业务层处理
|
|
||||||
*
|
|
||||||
* @author shi
|
|
||||||
* @date 2025-02-11
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
public class TenantSecretKeyServiceImpl implements ITenantSecretKeyService
|
|
||||||
{
|
|
||||||
@Autowired
|
|
||||||
private TenantSecretKeyMapper tenantSecretKeyMapper;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询用户租户密钥
|
|
||||||
*
|
|
||||||
* @param id 用户租户密钥主键
|
|
||||||
* @return 用户租户密钥
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public TenantSecretKey selectTenantSecretKeyById(Long id)
|
|
||||||
{
|
|
||||||
return tenantSecretKeyMapper.selectTenantSecretKeyById(id);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 生成租户sn
|
|
||||||
*
|
|
||||||
* @return {@link String }
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public synchronized String generateTenantSn() {
|
|
||||||
String sn = NumberUtils.generateRandomCode();
|
|
||||||
while (!CollectionUtils.isEmpty(tenantSecretKeyMapper.selectTenantSecretKeyList(TenantSecretKey.builder()
|
|
||||||
.tenantSn(sn)
|
|
||||||
.build()))) {
|
|
||||||
sn = NumberUtils.generateRandomCode();
|
|
||||||
}
|
|
||||||
return sn;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 按租户密钥选择租户密钥
|
|
||||||
*
|
|
||||||
* @param tenantKey 租户密钥
|
|
||||||
* @return {@link TenantSecretKey }
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public TenantSecretKey selectTenantSecretKeyByTenantKey(String tenantKey) {
|
|
||||||
return tenantSecretKeyMapper.selectTenantSecretKeyByTenantKey(tenantKey);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询用户租户密钥列表
|
|
||||||
*
|
|
||||||
* @param tenantSecretKey 用户租户密钥
|
|
||||||
* @return 用户租户密钥
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public List<TenantSecretKey> selectTenantSecretKeyList(TenantSecretKey tenantSecretKey)
|
|
||||||
{
|
|
||||||
return tenantSecretKeyMapper.selectTenantSecretKeyList(tenantSecretKey);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 新增用户租户密钥
|
|
||||||
*
|
|
||||||
* @param tenantSecretKey 用户租户密钥
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public int insertTenantSecretKey(TenantSecretKey tenantSecretKey)
|
|
||||||
{
|
|
||||||
tenantSecretKey.setCreateTime(DateUtils.getNowDate());
|
|
||||||
return tenantSecretKeyMapper.insertTenantSecretKey(tenantSecretKey);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改用户租户密钥
|
|
||||||
*
|
|
||||||
* @param tenantSecretKey 用户租户密钥
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public int updateTenantSecretKey(TenantSecretKey tenantSecretKey)
|
|
||||||
{
|
|
||||||
tenantSecretKey.setUpdateTime(DateUtils.getNowDate());
|
|
||||||
return tenantSecretKeyMapper.updateTenantSecretKey(tenantSecretKey);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量删除用户租户密钥
|
|
||||||
*
|
|
||||||
* @param ids 需要删除的用户租户密钥主键
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public int deleteTenantSecretKeyByIds(Long[] ids)
|
|
||||||
{
|
|
||||||
return tenantSecretKeyMapper.deleteTenantSecretKeyByIds(ids);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除用户租户密钥信息
|
|
||||||
*
|
|
||||||
* @param id 用户租户密钥主键
|
|
||||||
* @return 结果
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public int deleteTenantSecretKeyById(Long id)
|
|
||||||
{
|
|
||||||
return tenantSecretKeyMapper.deleteTenantSecretKeyById(id);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
package com.ff.config;
|
package com.ff.config;
|
||||||
|
|
||||||
import com.ff.common.domain.TenantSecretKey;
|
import com.ff.base.system.domain.TenantSecretKey;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
package com.ff.game.api.jili.service.impl;
|
package com.ff.game.api.jili.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.util.NumberUtil;
|
import cn.hutool.core.util.NumberUtil;
|
||||||
import com.alibaba.fastjson2.JSON;
|
|
||||||
import com.ff.base.constant.CacheConstants;
|
import com.ff.base.constant.CacheConstants;
|
||||||
import com.ff.base.constant.Constants;
|
import com.ff.base.constant.Constants;
|
||||||
import com.ff.base.core.redis.RedisCache;
|
import com.ff.base.core.redis.RedisCache;
|
||||||
|
|
@ -10,16 +9,9 @@ import com.ff.base.exception.base.ApiException;
|
||||||
import com.ff.base.exception.base.BaseException;
|
import com.ff.base.exception.base.BaseException;
|
||||||
import com.ff.base.system.service.ISysConfigService;
|
import com.ff.base.system.service.ISysConfigService;
|
||||||
import com.ff.base.utils.DateUtils;
|
import com.ff.base.utils.DateUtils;
|
||||||
import com.ff.base.utils.JsonUtil;
|
|
||||||
import com.ff.base.utils.MessageUtils;
|
|
||||||
import com.ff.base.utils.StringUtils;
|
import com.ff.base.utils.StringUtils;
|
||||||
import com.ff.base.utils.http.HttpClientSslUtils;
|
|
||||||
import com.ff.base.utils.http.HttpUtils;
|
|
||||||
import com.ff.base.utils.sign.Md5Utils;
|
import com.ff.base.utils.sign.Md5Utils;
|
||||||
import com.ff.base.utils.uuid.IdUtils;
|
import com.ff.base.utils.uuid.IdUtils;
|
||||||
import com.ff.common.domain.TenantSecretKey;
|
|
||||||
import com.ff.common.dto.BalanceChangesDTO;
|
|
||||||
import com.ff.common.service.ITenantGameQuotaService;
|
|
||||||
import com.ff.config.KeyConfig;
|
import com.ff.config.KeyConfig;
|
||||||
import com.ff.game.api.IGamesService;
|
import com.ff.game.api.IGamesService;
|
||||||
import com.ff.game.api.jili.client.JILIClient;
|
import com.ff.game.api.jili.client.JILIClient;
|
||||||
|
|
@ -30,7 +22,6 @@ import com.ff.game.service.*;
|
||||||
import com.ff.member.domain.Member;
|
import com.ff.member.domain.Member;
|
||||||
import com.ff.member.service.IMemberService;
|
import com.ff.member.service.IMemberService;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.http.entity.ContentType;
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.util.Assert;
|
import org.springframework.util.Assert;
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
package com.ff.game.api.xk.service.impl;
|
package com.ff.game.api.xk.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.util.NumberUtil;
|
import cn.hutool.core.util.NumberUtil;
|
||||||
import com.alibaba.fastjson2.JSON;
|
|
||||||
import com.ff.base.constant.CacheConstants;
|
import com.ff.base.constant.CacheConstants;
|
||||||
import com.ff.base.constant.Constants;
|
import com.ff.base.constant.Constants;
|
||||||
import com.ff.base.core.redis.RedisCache;
|
import com.ff.base.core.redis.RedisCache;
|
||||||
|
|
@ -15,11 +14,8 @@ import com.ff.base.system.service.ISysConfigService;
|
||||||
import com.ff.base.utils.DateUtils;
|
import com.ff.base.utils.DateUtils;
|
||||||
import com.ff.base.utils.JsonUtil;
|
import com.ff.base.utils.JsonUtil;
|
||||||
import com.ff.base.utils.MessageUtils;
|
import com.ff.base.utils.MessageUtils;
|
||||||
import com.ff.base.utils.StringUtils;
|
|
||||||
import com.ff.base.utils.http.HttpClientSslUtils;
|
|
||||||
import com.ff.base.utils.sign.Md5Utils;
|
import com.ff.base.utils.sign.Md5Utils;
|
||||||
import com.ff.base.utils.uuid.IdUtils;
|
import com.ff.base.utils.uuid.IdUtils;
|
||||||
import com.ff.common.domain.TenantSecretKey;
|
|
||||||
import com.ff.config.KeyConfig;
|
import com.ff.config.KeyConfig;
|
||||||
import com.ff.game.api.IGamesService;
|
import com.ff.game.api.IGamesService;
|
||||||
import com.ff.game.api.request.*;
|
import com.ff.game.api.request.*;
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ package com.ff.game.mapper;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.ff.common.domain.TenantSecretKey;
|
import com.ff.base.system.domain.TenantSecretKey;
|
||||||
import com.ff.game.domain.GameSecretKey;
|
import com.ff.game.domain.GameSecretKey;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@ package com.ff.game.service;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.ff.common.domain.TenantSecretKey;
|
|
||||||
import com.ff.game.domain.GameSecretKey;
|
import com.ff.game.domain.GameSecretKey;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,8 @@ package com.ff.game.service.impl;
|
||||||
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.IdUtil;
|
||||||
import com.ff.base.utils.DateUtils;
|
import com.ff.base.utils.DateUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
@ -65,6 +67,7 @@ public class GameBettingDetailsServiceImpl implements IGameBettingDetailsService
|
||||||
@Override
|
@Override
|
||||||
public int insertGameBettingDetails(GameBettingDetails gameBettingDetails)
|
public int insertGameBettingDetails(GameBettingDetails gameBettingDetails)
|
||||||
{
|
{
|
||||||
|
gameBettingDetails.setId(IdUtil.getSnowflakeNextId());
|
||||||
gameBettingDetails.setCreateTime(DateUtils.getNowDate());
|
gameBettingDetails.setCreateTime(DateUtils.getNowDate());
|
||||||
return gameBettingDetailsMapper.insertGameBettingDetails(gameBettingDetails);
|
return gameBettingDetailsMapper.insertGameBettingDetails(gameBettingDetails);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
package com.ff.game.service.impl;
|
package com.ff.game.service.impl;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.IdUtil;
|
||||||
import com.ff.base.utils.DateUtils;
|
import com.ff.base.utils.DateUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
@ -53,6 +55,7 @@ public class GameExchangeMoneyServiceImpl implements IGameExchangeMoneyService
|
||||||
@Override
|
@Override
|
||||||
public int insertGameExchangeMoney(GameExchangeMoney gameExchangeMoney)
|
public int insertGameExchangeMoney(GameExchangeMoney gameExchangeMoney)
|
||||||
{
|
{
|
||||||
|
gameExchangeMoney.setId(IdUtil.getSnowflakeNextId());
|
||||||
gameExchangeMoney.setCreateTime(DateUtils.getNowDate());
|
gameExchangeMoney.setCreateTime(DateUtils.getNowDate());
|
||||||
return gameExchangeMoneyMapper.insertGameExchangeMoney(gameExchangeMoney);
|
return gameExchangeMoneyMapper.insertGameExchangeMoney(gameExchangeMoney);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
package com.ff.game.service.impl;
|
package com.ff.game.service.impl;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.IdUtil;
|
||||||
import com.ff.base.utils.DateUtils;
|
import com.ff.base.utils.DateUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
@ -53,6 +55,7 @@ public class GameFreeRecordServiceImpl implements IGameFreeRecordService
|
||||||
@Override
|
@Override
|
||||||
public int insertGameFreeRecord(GameFreeRecord gameFreeRecord)
|
public int insertGameFreeRecord(GameFreeRecord gameFreeRecord)
|
||||||
{
|
{
|
||||||
|
gameFreeRecord.setId(IdUtil.getSnowflakeNextId());
|
||||||
gameFreeRecord.setCreateTime(DateUtils.getNowDate());
|
gameFreeRecord.setCreateTime(DateUtils.getNowDate());
|
||||||
return gameFreeRecordMapper.insertGameFreeRecord(gameFreeRecord);
|
return gameFreeRecordMapper.insertGameFreeRecord(gameFreeRecord);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
package com.ff.game.service.impl;
|
package com.ff.game.service.impl;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.IdUtil;
|
||||||
import com.ff.base.utils.DateUtils;
|
import com.ff.base.utils.DateUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
@ -53,6 +55,7 @@ public class GamePlatformServiceImpl implements IGamePlatformService
|
||||||
@Override
|
@Override
|
||||||
public int insertGamePlatform(GamePlatform gamePlatform)
|
public int insertGamePlatform(GamePlatform gamePlatform)
|
||||||
{
|
{
|
||||||
|
gamePlatform.setId(IdUtil.getSnowflakeNextId());
|
||||||
gamePlatform.setCreateTime(DateUtils.getNowDate());
|
gamePlatform.setCreateTime(DateUtils.getNowDate());
|
||||||
return gamePlatformMapper.insertGamePlatform(gamePlatform);
|
return gamePlatformMapper.insertGamePlatform(gamePlatform);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
package com.ff.game.service.impl;
|
package com.ff.game.service.impl;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.IdUtil;
|
||||||
import com.ff.base.utils.DateUtils;
|
import com.ff.base.utils.DateUtils;
|
||||||
import com.ff.common.domain.TenantSecretKey;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.ff.game.mapper.GameSecretKeyMapper;
|
import com.ff.game.mapper.GameSecretKeyMapper;
|
||||||
|
|
@ -54,6 +55,7 @@ public class GameSecretKeyServiceImpl implements IGameSecretKeyService
|
||||||
@Override
|
@Override
|
||||||
public int insertGameSecretKey(GameSecretKey gameSecretKey)
|
public int insertGameSecretKey(GameSecretKey gameSecretKey)
|
||||||
{
|
{
|
||||||
|
gameSecretKey.setId(IdUtil.getSnowflakeNextId());
|
||||||
gameSecretKey.setCreateTime(DateUtils.getNowDate());
|
gameSecretKey.setCreateTime(DateUtils.getNowDate());
|
||||||
return gameSecretKeyMapper.insertGameSecretKey(gameSecretKey);
|
return gameSecretKeyMapper.insertGameSecretKey(gameSecretKey);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ package com.ff.game.service.impl;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.IdUtil;
|
||||||
import com.ff.api.response.GameResponse;
|
import com.ff.api.response.GameResponse;
|
||||||
import com.ff.base.constant.ConfigConstants;
|
import com.ff.base.constant.ConfigConstants;
|
||||||
import com.ff.base.utils.DateUtils;
|
import com.ff.base.utils.DateUtils;
|
||||||
|
|
@ -64,6 +65,7 @@ public class GameServiceImpl implements IGameService
|
||||||
@Override
|
@Override
|
||||||
public int insertGame(Game game)
|
public int insertGame(Game game)
|
||||||
{
|
{
|
||||||
|
game.setId(IdUtil.getSnowflakeNextId());
|
||||||
game.setCreateTime(DateUtils.getNowDate());
|
game.setCreateTime(DateUtils.getNowDate());
|
||||||
return gameMapper.insertGame(game);
|
return gameMapper.insertGame(game);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
package com.ff.member.service.impl;
|
package com.ff.member.service.impl;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.IdUtil;
|
||||||
import com.ff.base.utils.DateUtils;
|
import com.ff.base.utils.DateUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
@ -53,6 +55,7 @@ public class MemberServiceImpl implements IMemberService
|
||||||
@Override
|
@Override
|
||||||
public int insertMember(Member member)
|
public int insertMember(Member member)
|
||||||
{
|
{
|
||||||
|
member.setId(IdUtil.getSnowflakeNextId());
|
||||||
member.setCreateTime(DateUtils.getNowDate());
|
member.setCreateTime(DateUtils.getNowDate());
|
||||||
return memberMapper.insertMember(member);
|
return memberMapper.insertMember(member);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package com.ff.quartz.service.impl;
|
package com.ff.quartz.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.IdUtil;
|
||||||
import com.ff.quartz.domain.SysJobLog;
|
import com.ff.quartz.domain.SysJobLog;
|
||||||
import com.ff.quartz.mapper.SysJobLogMapper;
|
import com.ff.quartz.mapper.SysJobLogMapper;
|
||||||
import com.ff.quartz.service.ISysJobLogService;
|
import com.ff.quartz.service.ISysJobLogService;
|
||||||
|
|
@ -51,6 +52,7 @@ public class SysJobLogServiceImpl implements ISysJobLogService
|
||||||
@Override
|
@Override
|
||||||
public void addJobLog(SysJobLog jobLog)
|
public void addJobLog(SysJobLog jobLog)
|
||||||
{
|
{
|
||||||
|
jobLog.setJobLogId(IdUtil.getSnowflakeNextId());
|
||||||
jobLogMapper.insertJobLog(jobLog);
|
jobLogMapper.insertJobLog(jobLog);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package com.ff.quartz.service.impl;
|
package com.ff.quartz.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.IdUtil;
|
||||||
import com.ff.base.constant.ScheduleConstants;
|
import com.ff.base.constant.ScheduleConstants;
|
||||||
import com.ff.base.exception.job.TaskException;
|
import com.ff.base.exception.job.TaskException;
|
||||||
import com.ff.quartz.domain.SysJob;
|
import com.ff.quartz.domain.SysJob;
|
||||||
|
|
@ -202,6 +203,7 @@ public class SysJobServiceImpl implements ISysJobService
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public int insertJob(SysJob job) throws SchedulerException, TaskException
|
public int insertJob(SysJob job) throws SchedulerException, TaskException
|
||||||
{
|
{
|
||||||
|
job.setJobId(IdUtil.getSnowflakeNextId());
|
||||||
job.setStatus(ScheduleConstants.Status.PAUSE.getValue());
|
job.setStatus(ScheduleConstants.Status.PAUSE.getValue());
|
||||||
int rows = jobMapper.insertJob(job);
|
int rows = jobMapper.insertJob(job);
|
||||||
if (rows > 0)
|
if (rows > 0)
|
||||||
|
|
|
||||||
|
|
@ -5,18 +5,14 @@ import com.ff.base.constant.Constants;
|
||||||
import com.ff.base.enums.OperationType;
|
import com.ff.base.enums.OperationType;
|
||||||
import com.ff.base.enums.QuotaType;
|
import com.ff.base.enums.QuotaType;
|
||||||
import com.ff.base.utils.DateUtils;
|
import com.ff.base.utils.DateUtils;
|
||||||
import com.ff.common.domain.TenantGameQuota;
|
|
||||||
import com.ff.common.domain.TenantGameQuotaFlow;
|
import com.ff.common.domain.TenantGameQuotaFlow;
|
||||||
import com.ff.common.domain.TenantQuotaExchange;
|
import com.ff.common.domain.TenantQuotaExchange;
|
||||||
import com.ff.common.domain.TenantSecretKey;
|
|
||||||
import com.ff.common.dto.BalanceChangesDTO;
|
|
||||||
import com.ff.common.dto.BalanceRealChangesDTO;
|
import com.ff.common.dto.BalanceRealChangesDTO;
|
||||||
import com.ff.common.service.ITenantGameQuotaFlowService;
|
import com.ff.common.service.ITenantGameQuotaFlowService;
|
||||||
import com.ff.common.service.ITenantGameQuotaService;
|
import com.ff.common.service.ITenantGameQuotaService;
|
||||||
import com.ff.common.service.ITenantQuotaExchangeService;
|
import com.ff.common.service.ITenantQuotaExchangeService;
|
||||||
import com.ff.common.service.ITenantSecretKeyService;
|
import com.ff.base.system.service.ITenantSecretKeyService;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.poi.ss.formula.functions.T;
|
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
|
|
||||||
|
|
@ -3,14 +3,18 @@ package com.ff.system;
|
||||||
import com.ff.base.constant.Constants;
|
import com.ff.base.constant.Constants;
|
||||||
import com.ff.base.core.domain.AjaxResult;
|
import com.ff.base.core.domain.AjaxResult;
|
||||||
import com.ff.base.core.domain.model.LoginBody;
|
import com.ff.base.core.domain.model.LoginBody;
|
||||||
|
import com.ff.base.enums.LoginType;
|
||||||
import com.ff.base.system.domain.SysMenu;
|
import com.ff.base.system.domain.SysMenu;
|
||||||
|
import com.ff.base.system.domain.SysRole;
|
||||||
import com.ff.base.system.domain.SysUser;
|
import com.ff.base.system.domain.SysUser;
|
||||||
import com.ff.base.system.service.ISysDatasourceService;
|
import com.ff.base.system.service.ISysDatasourceService;
|
||||||
import com.ff.base.system.service.ISysMenuService;
|
import com.ff.base.system.service.ISysMenuService;
|
||||||
import com.ff.base.utils.SecurityUtils;
|
import com.ff.base.utils.SecurityUtils;
|
||||||
import com.ff.base.web.service.SysLoginService;
|
import com.ff.base.web.service.SysLoginService;
|
||||||
import com.ff.base.web.service.SysPermissionService;
|
import com.ff.base.web.service.SysPermissionService;
|
||||||
|
import com.ff.base.system.service.ITenantSecretKeyService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.util.CollectionUtils;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
|
@ -18,8 +22,10 @@ import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 登录验证
|
* 登录验证
|
||||||
|
|
@ -27,8 +33,7 @@ import java.util.Set;
|
||||||
* @author ff
|
* @author ff
|
||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
public class SysLoginController
|
public class SysLoginController {
|
||||||
{
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private SysLoginService loginService;
|
private SysLoginService loginService;
|
||||||
|
|
||||||
|
|
@ -39,7 +44,11 @@ public class SysLoginController
|
||||||
private SysPermissionService permissionService;
|
private SysPermissionService permissionService;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private ISysDatasourceService datasourceService;
|
private ISysDatasourceService datasourceService;
|
||||||
|
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ITenantSecretKeyService tenantSecretKeyService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 登录方法
|
* 登录方法
|
||||||
|
|
@ -48,12 +57,21 @@ public class SysLoginController
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@PostMapping("/login")
|
@PostMapping("/login")
|
||||||
public AjaxResult login(@RequestBody LoginBody loginBody)
|
public AjaxResult login(@RequestBody LoginBody loginBody) {
|
||||||
{
|
|
||||||
AjaxResult ajax = AjaxResult.success();
|
AjaxResult ajax = AjaxResult.success();
|
||||||
// 生成令牌
|
// 生成令牌
|
||||||
String token = loginService.login(loginBody.getUsername(), loginBody.getPassword(), loginBody.getCode(),
|
String token = "";
|
||||||
loginBody.getUuid());
|
// 验证码校验
|
||||||
|
// loginService.validateCaptcha(loginBody.getUsername(), loginBody.getCode(), loginBody.getUuid());
|
||||||
|
// 登录前置校验
|
||||||
|
loginService.loginPreCheck(loginBody.getUsername(), loginBody.getPassword());
|
||||||
|
if (LoginType.TENANT.getValue().equals(loginBody.getLoginType())) {
|
||||||
|
token = tenantSecretKeyService.login(loginBody.getUsername(), loginBody.getPassword());
|
||||||
|
} else {
|
||||||
|
token = loginService.login(loginBody.getUsername(), loginBody.getPassword(), loginBody.getCode(),
|
||||||
|
loginBody.getUuid());
|
||||||
|
}
|
||||||
|
|
||||||
ajax.put(Constants.TOKEN, token);
|
ajax.put(Constants.TOKEN, token);
|
||||||
return ajax;
|
return ajax;
|
||||||
}
|
}
|
||||||
|
|
@ -64,8 +82,7 @@ public class SysLoginController
|
||||||
* @return 用户信息
|
* @return 用户信息
|
||||||
*/
|
*/
|
||||||
@GetMapping("getInfo")
|
@GetMapping("getInfo")
|
||||||
public AjaxResult getInfo(HttpServletRequest request)
|
public AjaxResult getInfo(HttpServletRequest request) {
|
||||||
{
|
|
||||||
SysUser user = SecurityUtils.getLoginUser().getUser();
|
SysUser user = SecurityUtils.getLoginUser().getUser();
|
||||||
// 角色集合
|
// 角色集合
|
||||||
Set<String> roles = permissionService.getRolePermission(user);
|
Set<String> roles = permissionService.getRolePermission(user);
|
||||||
|
|
@ -90,10 +107,13 @@ public class SysLoginController
|
||||||
* @return 路由信息
|
* @return 路由信息
|
||||||
*/
|
*/
|
||||||
@GetMapping("getRouters")
|
@GetMapping("getRouters")
|
||||||
public AjaxResult getRouters()
|
public AjaxResult getRouters() {
|
||||||
{
|
List<Long> roleIds = SecurityUtils.getRoles().stream().map(SysRole::getRoleId).collect(Collectors.toList());
|
||||||
Long userId = SecurityUtils.getUserId();
|
List<SysMenu> menus = new ArrayList<>();
|
||||||
List<SysMenu> menus = menuService.selectMenuTreeByUserId(userId);
|
if (!CollectionUtils.isEmpty(roleIds)) {
|
||||||
|
menus = menuService.selectMenuTree(roleIds);
|
||||||
|
}
|
||||||
|
|
||||||
return AjaxResult.success(menuService.buildMenus(menus));
|
return AjaxResult.success(menuService.buildMenus(menus));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,9 +4,12 @@ import com.ff.base.annotation.Log;
|
||||||
import com.ff.base.config.FFConfig;
|
import com.ff.base.config.FFConfig;
|
||||||
import com.ff.base.core.controller.BaseController;
|
import com.ff.base.core.controller.BaseController;
|
||||||
import com.ff.base.core.domain.AjaxResult;
|
import com.ff.base.core.domain.AjaxResult;
|
||||||
|
import com.ff.base.enums.LoginType;
|
||||||
import com.ff.base.system.domain.SysUser;
|
import com.ff.base.system.domain.SysUser;
|
||||||
import com.ff.base.core.domain.model.LoginUser;
|
import com.ff.base.core.domain.model.LoginUser;
|
||||||
import com.ff.base.enums.BusinessType;
|
import com.ff.base.enums.BusinessType;
|
||||||
|
import com.ff.base.system.domain.TenantSecretKey;
|
||||||
|
import com.ff.base.system.service.ITenantSecretKeyService;
|
||||||
import com.ff.base.utils.SecurityUtils;
|
import com.ff.base.utils.SecurityUtils;
|
||||||
import com.ff.base.utils.StringUtils;
|
import com.ff.base.utils.StringUtils;
|
||||||
import com.ff.base.utils.file.FileUploadUtils;
|
import com.ff.base.utils.file.FileUploadUtils;
|
||||||
|
|
@ -17,6 +20,8 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 个人信息 业务处理
|
* 个人信息 业务处理
|
||||||
*
|
*
|
||||||
|
|
@ -24,20 +29,21 @@ import org.springframework.web.multipart.MultipartFile;
|
||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/system/user/profile")
|
@RequestMapping("/system/user/profile")
|
||||||
public class SysProfileController extends BaseController
|
public class SysProfileController extends BaseController {
|
||||||
{
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ISysUserService userService;
|
private ISysUserService userService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private TokenService tokenService;
|
private TokenService tokenService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ITenantSecretKeyService tenantSecretKeyService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 个人信息
|
* 个人信息
|
||||||
*/
|
*/
|
||||||
@GetMapping
|
@GetMapping
|
||||||
public AjaxResult profile()
|
public AjaxResult profile() {
|
||||||
{
|
|
||||||
LoginUser loginUser = getLoginUser();
|
LoginUser loginUser = getLoginUser();
|
||||||
SysUser user = loginUser.getUser();
|
SysUser user = loginUser.getUser();
|
||||||
AjaxResult ajax = AjaxResult.success(user);
|
AjaxResult ajax = AjaxResult.success(user);
|
||||||
|
|
@ -51,24 +57,20 @@ public class SysProfileController extends BaseController
|
||||||
*/
|
*/
|
||||||
@Log(title = "个人信息", businessType = BusinessType.UPDATE)
|
@Log(title = "个人信息", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping
|
@PutMapping
|
||||||
public AjaxResult updateProfile(@RequestBody SysUser user)
|
public AjaxResult updateProfile(@RequestBody SysUser user) {
|
||||||
{
|
|
||||||
LoginUser loginUser = getLoginUser();
|
LoginUser loginUser = getLoginUser();
|
||||||
SysUser currentUser = loginUser.getUser();
|
SysUser currentUser = loginUser.getUser();
|
||||||
currentUser.setNickName(user.getNickName());
|
currentUser.setNickName(user.getNickName());
|
||||||
currentUser.setEmail(user.getEmail());
|
currentUser.setEmail(user.getEmail());
|
||||||
currentUser.setPhonenumber(user.getPhonenumber());
|
currentUser.setPhonenumber(user.getPhonenumber());
|
||||||
currentUser.setSex(user.getSex());
|
currentUser.setSex(user.getSex());
|
||||||
if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(currentUser))
|
if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(currentUser)) {
|
||||||
{
|
|
||||||
return error("修改用户'" + loginUser.getUsername() + "'失败,手机号码已存在");
|
return error("修改用户'" + loginUser.getUsername() + "'失败,手机号码已存在");
|
||||||
}
|
}
|
||||||
if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(currentUser))
|
if (StringUtils.isNotEmpty(user.getEmail()) && !userService.checkEmailUnique(currentUser)) {
|
||||||
{
|
|
||||||
return error("修改用户'" + loginUser.getUsername() + "'失败,邮箱账号已存在");
|
return error("修改用户'" + loginUser.getUsername() + "'失败,邮箱账号已存在");
|
||||||
}
|
}
|
||||||
if (userService.updateUserProfile(currentUser) > 0)
|
if (userService.updateUserProfile(currentUser) > 0) {
|
||||||
{
|
|
||||||
// 更新缓存用户信息
|
// 更新缓存用户信息
|
||||||
tokenService.setLoginUser(loginUser);
|
tokenService.setLoginUser(loginUser);
|
||||||
return success();
|
return success();
|
||||||
|
|
@ -81,22 +83,28 @@ public class SysProfileController extends BaseController
|
||||||
*/
|
*/
|
||||||
@Log(title = "个人信息", businessType = BusinessType.UPDATE)
|
@Log(title = "个人信息", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping("/updatePwd")
|
@PutMapping("/updatePwd")
|
||||||
public AjaxResult updatePwd(String oldPassword, String newPassword)
|
public AjaxResult updatePwd(String oldPassword, String newPassword) {
|
||||||
{
|
|
||||||
LoginUser loginUser = getLoginUser();
|
LoginUser loginUser = getLoginUser();
|
||||||
String userName = loginUser.getUsername();
|
String userName = loginUser.getUsername();
|
||||||
String password = loginUser.getPassword();
|
String password = loginUser.getPassword();
|
||||||
if (!SecurityUtils.matchesPassword(oldPassword, password))
|
if (!SecurityUtils.matchesPassword(oldPassword, password)) {
|
||||||
{
|
|
||||||
return error("修改密码失败,旧密码错误");
|
return error("修改密码失败,旧密码错误");
|
||||||
}
|
}
|
||||||
if (SecurityUtils.matchesPassword(newPassword, password))
|
if (SecurityUtils.matchesPassword(newPassword, password)) {
|
||||||
{
|
|
||||||
return error("新密码不能与旧密码相同");
|
return error("新密码不能与旧密码相同");
|
||||||
}
|
}
|
||||||
newPassword = SecurityUtils.encryptPassword(newPassword);
|
newPassword = SecurityUtils.encryptPassword(newPassword);
|
||||||
if (userService.resetUserPwd(userName, newPassword) > 0)
|
|
||||||
{
|
Integer loginType = loginUser.getUser().getLoginType();
|
||||||
|
Boolean result = Boolean.FALSE;
|
||||||
|
if (LoginType.TENANT.getValue().equals(loginType)) {
|
||||||
|
TenantSecretKey tenantSecretKey = tenantSecretKeyService.selectTenantSecretKeyByTenantKey(userName);
|
||||||
|
tenantSecretKey.setPassword(newPassword);
|
||||||
|
result = tenantSecretKeyService.updateTenantSecretKey(tenantSecretKey) > 0;
|
||||||
|
} else if (LoginType.ADMIN.getValue().equals(loginType)) {
|
||||||
|
result = userService.resetUserPwd(userName, newPassword) > 0;
|
||||||
|
}
|
||||||
|
if (result) {
|
||||||
// 更新缓存用户密码
|
// 更新缓存用户密码
|
||||||
loginUser.getUser().setPassword(newPassword);
|
loginUser.getUser().setPassword(newPassword);
|
||||||
tokenService.setLoginUser(loginUser);
|
tokenService.setLoginUser(loginUser);
|
||||||
|
|
@ -110,14 +118,11 @@ public class SysProfileController extends BaseController
|
||||||
*/
|
*/
|
||||||
@Log(title = "用户头像", businessType = BusinessType.UPDATE)
|
@Log(title = "用户头像", businessType = BusinessType.UPDATE)
|
||||||
@PostMapping("/avatar")
|
@PostMapping("/avatar")
|
||||||
public AjaxResult avatar(@RequestParam("avatarfile") MultipartFile file) throws Exception
|
public AjaxResult avatar(@RequestParam("avatarfile") MultipartFile file) throws Exception {
|
||||||
{
|
if (!file.isEmpty()) {
|
||||||
if (!file.isEmpty())
|
|
||||||
{
|
|
||||||
LoginUser loginUser = getLoginUser();
|
LoginUser loginUser = getLoginUser();
|
||||||
String avatar = FileUploadUtils.upload(FFConfig.getAvatarPath(), file, MimeTypeUtils.IMAGE_EXTENSION);
|
String avatar = FileUploadUtils.upload(FFConfig.getAvatarPath(), file, MimeTypeUtils.IMAGE_EXTENSION);
|
||||||
if (userService.updateUserAvatar(loginUser.getUsername(), avatar))
|
if (userService.updateUserAvatar(loginUser.getUsername(), avatar)) {
|
||||||
{
|
|
||||||
AjaxResult ajax = AjaxResult.success();
|
AjaxResult ajax = AjaxResult.success();
|
||||||
ajax.put("imgUrl", avatar);
|
ajax.put("imgUrl", avatar);
|
||||||
// 更新缓存用户头像
|
// 更新缓存用户头像
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ spring:
|
||||||
# 端口,默认为6379
|
# 端口,默认为6379
|
||||||
port: 6379
|
port: 6379
|
||||||
# 数据库索引
|
# 数据库索引
|
||||||
database: 2
|
database: 1
|
||||||
# 密码
|
# 密码
|
||||||
password:
|
password:
|
||||||
# 连接超时时间
|
# 连接超时时间
|
||||||
|
|
|
||||||
|
|
@ -116,23 +116,8 @@ xss:
|
||||||
# 匹配链接
|
# 匹配链接
|
||||||
urlPatterns: /system/*,/monitor/*,/tool/*
|
urlPatterns: /system/*,/monitor/*,/tool/*
|
||||||
|
|
||||||
#雪花算法id生成器配置
|
|
||||||
snowflake:
|
|
||||||
worker:
|
|
||||||
id: 1
|
|
||||||
datacenter:
|
|
||||||
id: 1
|
|
||||||
|
|
||||||
#aes密钥
|
|
||||||
encrypt:
|
|
||||||
body:
|
|
||||||
aes-key: gktsdFKqo7lJi3Kc #AES加密秘钥
|
|
||||||
|
|
||||||
netty:
|
|
||||||
app:
|
|
||||||
port: 9820
|
|
||||||
|
|
||||||
web:
|
|
||||||
port: 9821
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -42,3 +42,6 @@ no.export.permission=您没有导出数据的权限,请联系管理员添加
|
||||||
no.view.permission=您没有查看数据的权限,请联系管理员添加权限 [{0}]
|
no.view.permission=您没有查看数据的权限,请联系管理员添加权限 [{0}]
|
||||||
|
|
||||||
|
|
||||||
|
##租户
|
||||||
|
operation.tenant.account.already.used=租户账号已被使用,请更换租户账号
|
||||||
|
operation.password.mismatch=两次密码不一致
|
||||||
|
|
@ -1,44 +1,73 @@
|
||||||
<?xml version="1.0" encoding="UTF-8" ?>
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
<!DOCTYPE mapper
|
<!DOCTYPE mapper
|
||||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.ff.common.mapper.CurrencyMapper">
|
<mapper namespace="com.ff.common.mapper.CurrencyMapper">
|
||||||
|
|
||||||
<resultMap type="Currency" id="CurrencyResult">
|
<resultMap type="Currency" id="CurrencyResult">
|
||||||
<result property="id" column="id" />
|
<result property="id" column="id"/>
|
||||||
<result property="status" column="status" />
|
<result property="status" column="status"/>
|
||||||
<result property="country" column="country" />
|
<result property="country" column="country"/>
|
||||||
<result property="currencyCode" column="currency_code" />
|
<result property="currencyCode" column="currency_code"/>
|
||||||
<result property="currencySign" column="currency_sign" />
|
<result property="currencySign" column="currency_sign"/>
|
||||||
<result property="gameRate" column="game_rate" />
|
<result property="gameRate" column="game_rate"/>
|
||||||
<result property="currencyDisplay" column="currency_display" />
|
<result property="currencyDisplay" column="currency_display"/>
|
||||||
<result property="currencyName" column="currency_name" />
|
<result property="currencyName" column="currency_name"/>
|
||||||
<result property="fullName" column="full_name" />
|
<result property="fullName" column="full_name"/>
|
||||||
<result property="createBy" column="create_by" />
|
<result property="createBy" column="create_by"/>
|
||||||
<result property="createTime" column="create_time" />
|
<result property="createTime" column="create_time"/>
|
||||||
<result property="updateBy" column="update_by" />
|
<result property="updateBy" column="update_by"/>
|
||||||
<result property="updateTime" column="update_time" />
|
<result property="updateTime" column="update_time"/>
|
||||||
<result property="remark" column="remark" />
|
<result property="remark" column="remark"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectCurrencyVo">
|
<sql id="selectCurrencyVo">
|
||||||
select id, status, country, currency_code, currency_sign, game_rate, currency_display, currency_name, full_name, create_by, create_time, update_by, update_time, remark from ff_currency
|
select id,
|
||||||
|
status,
|
||||||
|
country,
|
||||||
|
currency_code,
|
||||||
|
currency_sign,
|
||||||
|
game_rate,
|
||||||
|
currency_display,
|
||||||
|
currency_name,
|
||||||
|
full_name,
|
||||||
|
create_by,
|
||||||
|
create_time,
|
||||||
|
update_by,
|
||||||
|
update_time,
|
||||||
|
remark
|
||||||
|
from ff_currency
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectCurrencyList" parameterType="Currency" resultMap="CurrencyResult">
|
<select id="selectCurrencyList" parameterType="Currency" resultMap="CurrencyResult">
|
||||||
<include refid="selectCurrencyVo"/>
|
<include refid="selectCurrencyVo"/>
|
||||||
<where>
|
<where>
|
||||||
<if test="status != null and status != ''"> and status = #{status}</if>
|
<if test="status != null and status != ''">
|
||||||
<if test="country != null and country != ''"> and country = #{country}</if>
|
and status = #{status}
|
||||||
<if test="currencyCode != null and currencyCode != ''"> and currency_code = #{currencyCode}</if>
|
</if>
|
||||||
<if test="currencySign != null and currencySign != ''"> and currency_sign = #{currencySign}</if>
|
<if test="country != null and country != ''">
|
||||||
<if test="gameRate != null "> and game_rate = #{gameRate}</if>
|
and country = #{country}
|
||||||
<if test="currencyDisplay != null and currencyDisplay != ''"> and currency_display = #{currencyDisplay}</if>
|
</if>
|
||||||
<if test="currencyName != null and currencyName != ''"> and currency_name like concat('%', #{currencyName}, '%')</if>
|
<if test="currencyCode != null and currencyCode != ''">
|
||||||
<if test="fullName != null and fullName != ''"> and full_name like concat('%', #{fullName}, '%')</if>
|
and currency_code = #{currencyCode}
|
||||||
|
</if>
|
||||||
|
<if test="currencySign != null and currencySign != ''">
|
||||||
|
and currency_sign = #{currencySign}
|
||||||
|
</if>
|
||||||
|
<if test="gameRate != null ">
|
||||||
|
and game_rate = #{gameRate}
|
||||||
|
</if>
|
||||||
|
<if test="currencyDisplay != null and currencyDisplay != ''">
|
||||||
|
and currency_display = #{currencyDisplay}
|
||||||
|
</if>
|
||||||
|
<if test="currencyName != null and currencyName != ''">
|
||||||
|
and currency_name like concat('%', #{currencyName}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="fullName != null and fullName != ''">
|
||||||
|
and full_name like concat('%', #{fullName}, '%')
|
||||||
|
</if>
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectCurrencyById" parameterType="Long" resultMap="CurrencyResult">
|
<select id="selectCurrencyById" parameterType="Long" resultMap="CurrencyResult">
|
||||||
<include refid="selectCurrencyVo"/>
|
<include refid="selectCurrencyVo"/>
|
||||||
where id = #{id}
|
where id = #{id}
|
||||||
|
|
@ -47,63 +76,149 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<insert id="insertCurrency" parameterType="Currency" useGeneratedKeys="true" keyProperty="id">
|
<insert id="insertCurrency" parameterType="Currency" useGeneratedKeys="true" keyProperty="id">
|
||||||
insert into ff_currency
|
insert into ff_currency
|
||||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
<if test="status != null">status,</if>
|
<if test="id != null">
|
||||||
<if test="country != null">country,</if>
|
id,
|
||||||
<if test="currencyCode != null">currency_code,</if>
|
</if>
|
||||||
<if test="currencySign != null">currency_sign,</if>
|
<if test="status != null">
|
||||||
<if test="gameRate != null">game_rate,</if>
|
status,
|
||||||
<if test="currencyDisplay != null">currency_display,</if>
|
</if>
|
||||||
<if test="currencyName != null">currency_name,</if>
|
<if test="country != null">
|
||||||
<if test="fullName != null">full_name,</if>
|
country,
|
||||||
<if test="createBy != null">create_by,</if>
|
</if>
|
||||||
<if test="createTime != null">create_time,</if>
|
<if test="currencyCode != null">
|
||||||
<if test="updateBy != null">update_by,</if>
|
currency_code,
|
||||||
<if test="updateTime != null">update_time,</if>
|
</if>
|
||||||
<if test="remark != null">remark,</if>
|
<if test="currencySign != null">
|
||||||
</trim>
|
currency_sign,
|
||||||
|
</if>
|
||||||
|
<if test="gameRate != null">
|
||||||
|
game_rate,
|
||||||
|
</if>
|
||||||
|
<if test="currencyDisplay != null">
|
||||||
|
currency_display,
|
||||||
|
</if>
|
||||||
|
<if test="currencyName != null">
|
||||||
|
currency_name,
|
||||||
|
</if>
|
||||||
|
<if test="fullName != null">
|
||||||
|
full_name,
|
||||||
|
</if>
|
||||||
|
<if test="createBy != null">
|
||||||
|
create_by,
|
||||||
|
</if>
|
||||||
|
<if test="createTime != null">
|
||||||
|
create_time,
|
||||||
|
</if>
|
||||||
|
<if test="updateBy != null">
|
||||||
|
update_by,
|
||||||
|
</if>
|
||||||
|
<if test="updateTime != null">
|
||||||
|
update_time,
|
||||||
|
</if>
|
||||||
|
<if test="remark != null">
|
||||||
|
remark,
|
||||||
|
</if>
|
||||||
|
</trim>
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
<if test="status != null">#{status},</if>
|
<if test="id != null">
|
||||||
<if test="country != null">#{country},</if>
|
#{id},
|
||||||
<if test="currencyCode != null">#{currencyCode},</if>
|
</if>
|
||||||
<if test="currencySign != null">#{currencySign},</if>
|
<if test="status != null">
|
||||||
<if test="gameRate != null">#{gameRate},</if>
|
#{status},
|
||||||
<if test="currencyDisplay != null">#{currencyDisplay},</if>
|
</if>
|
||||||
<if test="currencyName != null">#{currencyName},</if>
|
<if test="country != null">
|
||||||
<if test="fullName != null">#{fullName},</if>
|
#{country},
|
||||||
<if test="createBy != null">#{createBy},</if>
|
</if>
|
||||||
<if test="createTime != null">#{createTime},</if>
|
<if test="currencyCode != null">
|
||||||
<if test="updateBy != null">#{updateBy},</if>
|
#{currencyCode},
|
||||||
<if test="updateTime != null">#{updateTime},</if>
|
</if>
|
||||||
<if test="remark != null">#{remark},</if>
|
<if test="currencySign != null">
|
||||||
</trim>
|
#{currencySign},
|
||||||
|
</if>
|
||||||
|
<if test="gameRate != null">
|
||||||
|
#{gameRate},
|
||||||
|
</if>
|
||||||
|
<if test="currencyDisplay != null">
|
||||||
|
#{currencyDisplay},
|
||||||
|
</if>
|
||||||
|
<if test="currencyName != null">
|
||||||
|
#{currencyName},
|
||||||
|
</if>
|
||||||
|
<if test="fullName != null">
|
||||||
|
#{fullName},
|
||||||
|
</if>
|
||||||
|
<if test="createBy != null">
|
||||||
|
#{createBy},
|
||||||
|
</if>
|
||||||
|
<if test="createTime != null">
|
||||||
|
#{createTime},
|
||||||
|
</if>
|
||||||
|
<if test="updateBy != null">
|
||||||
|
#{updateBy},
|
||||||
|
</if>
|
||||||
|
<if test="updateTime != null">
|
||||||
|
#{updateTime},
|
||||||
|
</if>
|
||||||
|
<if test="remark != null">
|
||||||
|
#{remark},
|
||||||
|
</if>
|
||||||
|
</trim>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
<update id="updateCurrency" parameterType="Currency">
|
<update id="updateCurrency" parameterType="Currency">
|
||||||
update ff_currency
|
update ff_currency
|
||||||
<trim prefix="SET" suffixOverrides=",">
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
<if test="status != null">status = #{status},</if>
|
<if test="status != null">
|
||||||
<if test="country != null">country = #{country},</if>
|
status = #{status},
|
||||||
<if test="currencyCode != null">currency_code = #{currencyCode},</if>
|
</if>
|
||||||
<if test="currencySign != null">currency_sign = #{currencySign},</if>
|
<if test="country != null">
|
||||||
<if test="gameRate != null">game_rate = #{gameRate},</if>
|
country = #{country},
|
||||||
<if test="currencyDisplay != null">currency_display = #{currencyDisplay},</if>
|
</if>
|
||||||
<if test="currencyName != null">currency_name = #{currencyName},</if>
|
<if test="currencyCode != null">
|
||||||
<if test="fullName != null">full_name = #{fullName},</if>
|
currency_code = #{currencyCode},
|
||||||
<if test="createBy != null">create_by = #{createBy},</if>
|
</if>
|
||||||
<if test="createTime != null">create_time = #{createTime},</if>
|
<if test="currencySign != null">
|
||||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
currency_sign = #{currencySign},
|
||||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
</if>
|
||||||
<if test="remark != null">remark = #{remark},</if>
|
<if test="gameRate != null">
|
||||||
|
game_rate = #{gameRate},
|
||||||
|
</if>
|
||||||
|
<if test="currencyDisplay != null">
|
||||||
|
currency_display = #{currencyDisplay},
|
||||||
|
</if>
|
||||||
|
<if test="currencyName != null">
|
||||||
|
currency_name = #{currencyName},
|
||||||
|
</if>
|
||||||
|
<if test="fullName != null">
|
||||||
|
full_name = #{fullName},
|
||||||
|
</if>
|
||||||
|
<if test="createBy != null">
|
||||||
|
create_by = #{createBy},
|
||||||
|
</if>
|
||||||
|
<if test="createTime != null">
|
||||||
|
create_time = #{createTime},
|
||||||
|
</if>
|
||||||
|
<if test="updateBy != null">
|
||||||
|
update_by = #{updateBy},
|
||||||
|
</if>
|
||||||
|
<if test="updateTime != null">
|
||||||
|
update_time = #{updateTime},
|
||||||
|
</if>
|
||||||
|
<if test="remark != null">
|
||||||
|
remark = #{remark},
|
||||||
|
</if>
|
||||||
</trim>
|
</trim>
|
||||||
where id = #{id}
|
where id = #{id}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
<delete id="deleteCurrencyById" parameterType="Long">
|
<delete id="deleteCurrencyById" parameterType="Long">
|
||||||
delete from ff_currency where id = #{id}
|
delete
|
||||||
|
from ff_currency
|
||||||
|
where id = #{id}
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
<delete id="deleteCurrencyByIds" parameterType="String">
|
<delete id="deleteCurrencyByIds" parameterType="String">
|
||||||
delete from ff_currency where id in
|
delete from ff_currency where id in
|
||||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
#{id}
|
#{id}
|
||||||
</foreach>
|
</foreach>
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
|
||||||
<insert id="insertLang" parameterType="Lang" useGeneratedKeys="true" keyProperty="id">
|
<insert id="insertLang" parameterType="Lang" useGeneratedKeys="true" keyProperty="id">
|
||||||
insert into ff_lang
|
insert into ff_lang
|
||||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<trim prefix="(" suffix=")" suffixOverrides=","><if test="id != null">id,</if>
|
||||||
<if test="name != null">name,</if>
|
<if test="name != null">name,</if>
|
||||||
<if test="country != null">country,</if>
|
<if test="country != null">country,</if>
|
||||||
<if test="langCode != null">lang_code,</if>
|
<if test="langCode != null">lang_code,</if>
|
||||||
|
|
@ -47,7 +47,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="updateBy != null">update_by,</if>
|
<if test="updateBy != null">update_by,</if>
|
||||||
<if test="updateTime != null">update_time,</if>
|
<if test="updateTime != null">update_time,</if>
|
||||||
</trim>
|
</trim>
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<trim prefix="values (" suffix=")" suffixOverrides=","> <if test="id != null">#{id},</if>
|
||||||
<if test="name != null">#{name},</if>
|
<if test="name != null">#{name},</if>
|
||||||
<if test="country != null">#{country},</if>
|
<if test="country != null">#{country},</if>
|
||||||
<if test="langCode != null">#{langCode},</if>
|
<if test="langCode != null">#{langCode},</if>
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
|
||||||
<insert id="insertTenantAgent" parameterType="TenantAgent" useGeneratedKeys="true" keyProperty="id">
|
<insert id="insertTenantAgent" parameterType="TenantAgent" useGeneratedKeys="true" keyProperty="id">
|
||||||
insert into ff_tenant_agent
|
insert into ff_tenant_agent
|
||||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<trim prefix="(" suffix=")" suffixOverrides=","><if test="id != null">id,</if>
|
||||||
<if test="account != null">account,</if>
|
<if test="account != null">account,</if>
|
||||||
<if test="password != null">password,</if>
|
<if test="password != null">password,</if>
|
||||||
<if test="agentStatus != null">agent_status,</if>
|
<if test="agentStatus != null">agent_status,</if>
|
||||||
|
|
@ -44,7 +44,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="updateBy != null">update_by,</if>
|
<if test="updateBy != null">update_by,</if>
|
||||||
<if test="updateTime != null">update_time,</if>
|
<if test="updateTime != null">update_time,</if>
|
||||||
</trim>
|
</trim>
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<trim prefix="values (" suffix=")" suffixOverrides=","> <if test="id != null">#{id},</if>
|
||||||
<if test="account != null">#{account},</if>
|
<if test="account != null">#{account},</if>
|
||||||
<if test="password != null">#{password},</if>
|
<if test="password != null">#{password},</if>
|
||||||
<if test="agentStatus != null">#{agentStatus},</if>
|
<if test="agentStatus != null">#{agentStatus},</if>
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
|
||||||
<insert id="insertTenantGameQuotaFlow" parameterType="TenantGameQuotaFlow" useGeneratedKeys="true" keyProperty="id">
|
<insert id="insertTenantGameQuotaFlow" parameterType="TenantGameQuotaFlow" useGeneratedKeys="true" keyProperty="id">
|
||||||
insert into ff_tenant_game_quota_flow
|
insert into ff_tenant_game_quota_flow
|
||||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<trim prefix="(" suffix=")" suffixOverrides=","><if test="id != null">id,</if>
|
||||||
<if test="tenantKey != null and tenantKey != ''">tenant_key,</if>
|
<if test="tenantKey != null and tenantKey != ''">tenant_key,</if>
|
||||||
<if test="quotaType != null">quota_type,</if>
|
<if test="quotaType != null">quota_type,</if>
|
||||||
<if test="memberId != null">member_id,</if>
|
<if test="memberId != null">member_id,</if>
|
||||||
|
|
@ -73,7 +73,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="updateBy != null">update_by,</if>
|
<if test="updateBy != null">update_by,</if>
|
||||||
<if test="updateTime != null">update_time,</if>
|
<if test="updateTime != null">update_time,</if>
|
||||||
</trim>
|
</trim>
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<trim prefix="values (" suffix=")" suffixOverrides=","> <if test="id != null">#{id},</if>
|
||||||
<if test="tenantKey != null and tenantKey != ''">#{tenantKey},</if>
|
<if test="tenantKey != null and tenantKey != ''">#{tenantKey},</if>
|
||||||
<if test="quotaType != null">#{quotaType},</if>
|
<if test="quotaType != null">#{quotaType},</if>
|
||||||
<if test="memberId != null">#{memberId},</if>
|
<if test="memberId != null">#{memberId},</if>
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
|
||||||
<insert id="insertTenantGameQuota" parameterType="TenantGameQuota" useGeneratedKeys="true" keyProperty="id">
|
<insert id="insertTenantGameQuota" parameterType="TenantGameQuota" useGeneratedKeys="true" keyProperty="id">
|
||||||
insert into ff_tenant_game_quota
|
insert into ff_tenant_game_quota
|
||||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<trim prefix="(" suffix=")" suffixOverrides=","><if test="id != null">id,</if>
|
||||||
<if test="tenantKey != null and tenantKey != ''">tenant_key,</if>
|
<if test="tenantKey != null and tenantKey != ''">tenant_key,</if>
|
||||||
<if test="balance != null">balance,</if>
|
<if test="balance != null">balance,</if>
|
||||||
<if test="quotaType != null">quota_type,</if>
|
<if test="quotaType != null">quota_type,</if>
|
||||||
|
|
@ -57,7 +57,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="updateBy != null">update_by,</if>
|
<if test="updateBy != null">update_by,</if>
|
||||||
<if test="updateTime != null">update_time,</if>
|
<if test="updateTime != null">update_time,</if>
|
||||||
</trim>
|
</trim>
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<trim prefix="values (" suffix=")" suffixOverrides=","> <if test="id != null">#{id},</if>
|
||||||
<if test="tenantKey != null and tenantKey != ''">#{tenantKey},</if>
|
<if test="tenantKey != null and tenantKey != ''">#{tenantKey},</if>
|
||||||
<if test="balance != null">#{balance},</if>
|
<if test="balance != null">#{balance},</if>
|
||||||
<if test="quotaType != null">#{quotaType},</if>
|
<if test="quotaType != null">#{quotaType},</if>
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
|
||||||
<insert id="insertTenantQuotaExchange" parameterType="TenantQuotaExchange" useGeneratedKeys="true" keyProperty="id">
|
<insert id="insertTenantQuotaExchange" parameterType="TenantQuotaExchange" useGeneratedKeys="true" keyProperty="id">
|
||||||
insert into ff_tenant_quota_exchange
|
insert into ff_tenant_quota_exchange
|
||||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<trim prefix="(" suffix=")" suffixOverrides=","><if test="id != null">id,</if>
|
||||||
<if test="currencyCode != null">currency_code,</if>
|
<if test="currencyCode != null">currency_code,</if>
|
||||||
<if test="exchangeCurrencyCode != null">exchange_currency_code,</if>
|
<if test="exchangeCurrencyCode != null">exchange_currency_code,</if>
|
||||||
<if test="exchangeRate != null">exchange_rate,</if>
|
<if test="exchangeRate != null">exchange_rate,</if>
|
||||||
|
|
@ -53,7 +53,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="updateBy != null">update_by,</if>
|
<if test="updateBy != null">update_by,</if>
|
||||||
<if test="updateTime != null">update_time,</if>
|
<if test="updateTime != null">update_time,</if>
|
||||||
</trim>
|
</trim>
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<trim prefix="values (" suffix=")" suffixOverrides=","> <if test="id != null">#{id},</if>
|
||||||
<if test="currencyCode != null">#{currencyCode},</if>
|
<if test="currencyCode != null">#{currencyCode},</if>
|
||||||
<if test="exchangeCurrencyCode != null">#{exchangeCurrencyCode},</if>
|
<if test="exchangeCurrencyCode != null">#{exchangeCurrencyCode},</if>
|
||||||
<if test="exchangeRate != null">#{exchangeRate},</if>
|
<if test="exchangeRate != null">#{exchangeRate},</if>
|
||||||
|
|
|
||||||
|
|
@ -2,10 +2,13 @@
|
||||||
<!DOCTYPE mapper
|
<!DOCTYPE mapper
|
||||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.ff.common.mapper.TenantSecretKeyMapper">
|
<mapper namespace="com.ff.base.system.mapper.TenantSecretKeyMapper">
|
||||||
|
|
||||||
<resultMap type="TenantSecretKey" id="TenantSecretKeyResult">
|
<resultMap type="TenantSecretKey" id="TenantSecretKeyResult">
|
||||||
<result property="id" column="id" />
|
<result property="id" column="id" />
|
||||||
|
<result property="password" column="password" />
|
||||||
|
<result property="loginIp" column="login_ip" />
|
||||||
|
<result property="loginData" column="login_data" />
|
||||||
<result property="tenantKey" column="tenant_key" />
|
<result property="tenantKey" column="tenant_key" />
|
||||||
<result property="agentId" column="agent_id" />
|
<result property="agentId" column="agent_id" />
|
||||||
<result property="tenantSn" column="tenant_sn" />
|
<result property="tenantSn" column="tenant_sn" />
|
||||||
|
|
@ -22,12 +25,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectTenantSecretKeyVo">
|
<sql id="selectTenantSecretKeyVo">
|
||||||
select id, tenant_key, agent_id, tenant_sn, tenant_secret, tenant_status, quota_type, score_ratio, tenant_type, deposit_ratio, create_by, create_time, update_by, update_time from ff_tenant_secret_key
|
select id, password, login_ip, login_data, tenant_key, agent_id, tenant_sn, tenant_secret, tenant_status, quota_type, score_ratio, tenant_type, deposit_ratio, create_by, create_time, update_by, update_time from ff_tenant_secret_key
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectTenantSecretKeyList" parameterType="TenantSecretKey" resultMap="TenantSecretKeyResult">
|
<select id="selectTenantSecretKeyList" parameterType="TenantSecretKey" resultMap="TenantSecretKeyResult">
|
||||||
<include refid="selectTenantSecretKeyVo"/>
|
<include refid="selectTenantSecretKeyVo"/>
|
||||||
<where>
|
<where>
|
||||||
|
<if test="password != null and password != ''"> and password = #{password}</if>
|
||||||
|
<if test="loginIp != null and loginIp != ''"> and login_ip = #{loginIp}</if>
|
||||||
|
<if test="loginData != null "> and login_data = #{loginData}</if>
|
||||||
<if test="tenantKey != null and tenantKey != ''"> and tenant_key = #{tenantKey}</if>
|
<if test="tenantKey != null and tenantKey != ''"> and tenant_key = #{tenantKey}</if>
|
||||||
<if test="agentId != null "> and agent_id = #{agentId}</if>
|
<if test="agentId != null "> and agent_id = #{agentId}</if>
|
||||||
<if test="tenantSn != null and tenantSn != ''"> and tenant_sn = #{tenantSn}</if>
|
<if test="tenantSn != null and tenantSn != ''"> and tenant_sn = #{tenantSn}</if>
|
||||||
|
|
@ -39,20 +45,37 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="depositRatio != null "> and deposit_ratio = #{depositRatio}</if>
|
<if test="depositRatio != null "> and deposit_ratio = #{depositRatio}</if>
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="selectTenantSecretKeyDTOList" parameterType="com.ff.base.system.dto.TenantSecretKeyDTO" resultMap="TenantSecretKeyResult">
|
||||||
|
<include refid="selectTenantSecretKeyVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="password != null and password != ''"> and password = #{password}</if>
|
||||||
|
<if test="loginIp != null and loginIp != ''"> and login_ip = #{loginIp}</if>
|
||||||
|
<if test="loginData != null "> and login_data = #{loginData}</if>
|
||||||
|
<if test="tenantKey != null and tenantKey != ''"> and tenant_key like concat('%',#{tenantKey},'%') </if>
|
||||||
|
<if test="agentId != null "> and agent_id = #{agentId}</if>
|
||||||
|
<if test="tenantSn != null and tenantSn != ''"> and tenant_sn = #{tenantSn}</if>
|
||||||
|
<if test="tenantSecret != null and tenantSecret != ''"> and tenant_secret = #{tenantSecret}</if>
|
||||||
|
<if test="tenantStatus != null "> and tenant_status = #{tenantStatus}</if>
|
||||||
|
<if test="quotaType != null "> and quota_type = #{quotaType}</if>
|
||||||
|
<if test="scoreRatio != null "> and score_ratio = #{scoreRatio}</if>
|
||||||
|
<if test="tenantType != null "> and tenant_type = #{tenantType}</if>
|
||||||
|
<if test="depositRatio != null "> and deposit_ratio = #{depositRatio}</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
<select id="selectTenantSecretKeyById" parameterType="Long" resultMap="TenantSecretKeyResult">
|
<select id="selectTenantSecretKeyById" parameterType="Long" resultMap="TenantSecretKeyResult">
|
||||||
<include refid="selectTenantSecretKeyVo"/>
|
<include refid="selectTenantSecretKeyVo"/>
|
||||||
where id = #{id}
|
where id = #{id}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectTenantSecretKeyByTenantKey" parameterType="String" resultMap="TenantSecretKeyResult">
|
|
||||||
<include refid="selectTenantSecretKeyVo"/>
|
|
||||||
where tenant_key = #{tenantKey}
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<insert id="insertTenantSecretKey" parameterType="TenantSecretKey" useGeneratedKeys="true" keyProperty="id">
|
<insert id="insertTenantSecretKey" parameterType="TenantSecretKey" useGeneratedKeys="true" keyProperty="id">
|
||||||
insert into ff_tenant_secret_key
|
insert into ff_tenant_secret_key
|
||||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<trim prefix="(" suffix=")" suffixOverrides=","><if test="id != null">id,</if>
|
||||||
|
<if test="id != null">id,</if>
|
||||||
|
<if test="password != null">password,</if>
|
||||||
|
<if test="loginIp != null">login_ip,</if>
|
||||||
|
<if test="loginData != null">login_data,</if>
|
||||||
<if test="tenantKey != null and tenantKey != ''">tenant_key,</if>
|
<if test="tenantKey != null and tenantKey != ''">tenant_key,</if>
|
||||||
<if test="agentId != null">agent_id,</if>
|
<if test="agentId != null">agent_id,</if>
|
||||||
<if test="tenantSn != null">tenant_sn,</if>
|
<if test="tenantSn != null">tenant_sn,</if>
|
||||||
|
|
@ -66,8 +89,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="createTime != null">create_time,</if>
|
<if test="createTime != null">create_time,</if>
|
||||||
<if test="updateBy != null">update_by,</if>
|
<if test="updateBy != null">update_by,</if>
|
||||||
<if test="updateTime != null">update_time,</if>
|
<if test="updateTime != null">update_time,</if>
|
||||||
</trim>
|
</trim>
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<trim prefix="values (" suffix=")" suffixOverrides=","> <if test="id != null">#{id},</if>
|
||||||
|
<if test="id != null">#{id},</if>
|
||||||
|
<if test="password != null">#{password},</if>
|
||||||
|
<if test="loginIp != null">#{loginIp},</if>
|
||||||
|
<if test="loginData != null">#{loginData},</if>
|
||||||
<if test="tenantKey != null and tenantKey != ''">#{tenantKey},</if>
|
<if test="tenantKey != null and tenantKey != ''">#{tenantKey},</if>
|
||||||
<if test="agentId != null">#{agentId},</if>
|
<if test="agentId != null">#{agentId},</if>
|
||||||
<if test="tenantSn != null">#{tenantSn},</if>
|
<if test="tenantSn != null">#{tenantSn},</if>
|
||||||
|
|
@ -81,12 +108,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="createTime != null">#{createTime},</if>
|
<if test="createTime != null">#{createTime},</if>
|
||||||
<if test="updateBy != null">#{updateBy},</if>
|
<if test="updateBy != null">#{updateBy},</if>
|
||||||
<if test="updateTime != null">#{updateTime},</if>
|
<if test="updateTime != null">#{updateTime},</if>
|
||||||
</trim>
|
</trim>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
<update id="updateTenantSecretKey" parameterType="TenantSecretKey">
|
<update id="updateTenantSecretKey" parameterType="TenantSecretKey">
|
||||||
update ff_tenant_secret_key
|
update ff_tenant_secret_key
|
||||||
<trim prefix="SET" suffixOverrides=",">
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="password != null">password = #{password},</if>
|
||||||
|
<if test="loginIp != null">login_ip = #{loginIp},</if>
|
||||||
|
<if test="loginData != null">login_data = #{loginData},</if>
|
||||||
<if test="tenantKey != null and tenantKey != ''">tenant_key = #{tenantKey},</if>
|
<if test="tenantKey != null and tenantKey != ''">tenant_key = #{tenantKey},</if>
|
||||||
<if test="agentId != null">agent_id = #{agentId},</if>
|
<if test="agentId != null">agent_id = #{agentId},</if>
|
||||||
<if test="tenantSn != null">tenant_sn = #{tenantSn},</if>
|
<if test="tenantSn != null">tenant_sn = #{tenantSn},</if>
|
||||||
|
|
@ -104,6 +134,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
where id = #{id}
|
where id = #{id}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
<select id="selectTenantSecretKeyByTenantKey" parameterType="String" resultMap="TenantSecretKeyResult">
|
||||||
|
<include refid="selectTenantSecretKeyVo"/>
|
||||||
|
where tenant_key = #{tenantKey}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<delete id="deleteTenantSecretKeyById" parameterType="Long">
|
<delete id="deleteTenantSecretKeyById" parameterType="Long">
|
||||||
delete from ff_tenant_secret_key where id = #{id}
|
delete from ff_tenant_secret_key where id = #{id}
|
||||||
</delete>
|
</delete>
|
||||||
|
|
|
||||||
|
|
@ -90,7 +90,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
|
||||||
<insert id="insertGameBettingDetails" parameterType="GameBettingDetails" useGeneratedKeys="true" keyProperty="id">
|
<insert id="insertGameBettingDetails" parameterType="GameBettingDetails" useGeneratedKeys="true" keyProperty="id">
|
||||||
insert into ff_game_betting_details
|
insert into ff_game_betting_details
|
||||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<trim prefix="(" suffix=")" suffixOverrides=","><if test="id != null">id,</if>
|
||||||
<if test="tenantKey != null">tenant_key,</if>
|
<if test="tenantKey != null">tenant_key,</if>
|
||||||
<if test="currencyCode != null">currency_code,</if>
|
<if test="currencyCode != null">currency_code,</if>
|
||||||
<if test="memberId != null">member_id,</if>
|
<if test="memberId != null">member_id,</if>
|
||||||
|
|
@ -117,7 +117,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="updateBy != null">update_by,</if>
|
<if test="updateBy != null">update_by,</if>
|
||||||
<if test="updateTime != null">update_time,</if>
|
<if test="updateTime != null">update_time,</if>
|
||||||
</trim>
|
</trim>
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<trim prefix="values (" suffix=")" suffixOverrides=","> <if test="id != null">#{id},</if>
|
||||||
<if test="tenantKey != null">#{tenantKey},</if>
|
<if test="tenantKey != null">#{tenantKey},</if>
|
||||||
<if test="currencyCode != null">#{currencyCode},</if>
|
<if test="currencyCode != null">#{currencyCode},</if>
|
||||||
<if test="memberId != null">#{memberId},</if>
|
<if test="memberId != null">#{memberId},</if>
|
||||||
|
|
@ -191,7 +191,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
|
||||||
<insert id="batchInsert" parameterType="list" useGeneratedKeys="true" keyProperty="id">
|
<insert id="batchInsert" parameterType="list" useGeneratedKeys="true" keyProperty="id">
|
||||||
insert into ff_game_betting_details
|
insert into ff_game_betting_details
|
||||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<trim prefix="(" suffix=")" suffixOverrides=","><if test="id != null">id,</if>
|
||||||
tenant_key, game_id, currency_code, member_id, game_code, game_type, platform_code,
|
tenant_key, game_id, currency_code, member_id, game_code, game_type, platform_code,
|
||||||
game_name, game_status, game_status_type, game_currency_code, account,
|
game_name, game_status, game_status_type, game_currency_code, account,
|
||||||
wagers_id, wagers_time, bet_amount, payoff_time, payoff_amount,
|
wagers_id, wagers_time, bet_amount, payoff_time, payoff_amount,
|
||||||
|
|
@ -199,7 +199,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</trim>
|
</trim>
|
||||||
values
|
values
|
||||||
<foreach collection="list" item="item" separator=",">
|
<foreach collection="list" item="item" separator=",">
|
||||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<trim prefix="(" suffix=")" suffixOverrides=","><if test="id != null">id,</if>
|
||||||
#{item.tenantKey},
|
#{item.tenantKey},
|
||||||
#{item.gameId},
|
#{item.gameId},
|
||||||
#{item.currencyCode},
|
#{item.currencyCode},
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@
|
||||||
|
|
||||||
<insert id="insertGameExchangeMoney" parameterType="GameExchangeMoney" useGeneratedKeys="true" keyProperty="id">
|
<insert id="insertGameExchangeMoney" parameterType="GameExchangeMoney" useGeneratedKeys="true" keyProperty="id">
|
||||||
insert into ff_game_exchange_money
|
insert into ff_game_exchange_money
|
||||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<trim prefix="(" suffix=")" suffixOverrides=","><if test="id != null">id,</if>
|
||||||
<if test="tenantKey != null">tenant_key,</if>
|
<if test="tenantKey != null">tenant_key,</if>
|
||||||
<if test="currencyCode != null">currency_code,</if>
|
<if test="currencyCode != null">currency_code,</if>
|
||||||
<if test="orderId != null">order_id,</if>
|
<if test="orderId != null">order_id,</if>
|
||||||
|
|
@ -77,7 +77,7 @@
|
||||||
<if test="updateBy != null">update_by,</if>
|
<if test="updateBy != null">update_by,</if>
|
||||||
<if test="updateTime != null">update_time,</if>
|
<if test="updateTime != null">update_time,</if>
|
||||||
</trim>
|
</trim>
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<trim prefix="values (" suffix=")" suffixOverrides=","> <if test="id != null">#{id},</if>
|
||||||
<if test="tenantKey != null">#{tenantKey},</if>
|
<if test="tenantKey != null">#{tenantKey},</if>
|
||||||
<if test="currencyCode != null">#{currencyCode},</if>
|
<if test="currencyCode != null">#{currencyCode},</if>
|
||||||
<if test="orderId != null">#{orderId},</if>
|
<if test="orderId != null">#{orderId},</if>
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
|
||||||
<insert id="insertGameFreeRecord" parameterType="GameFreeRecord" useGeneratedKeys="true" keyProperty="id">
|
<insert id="insertGameFreeRecord" parameterType="GameFreeRecord" useGeneratedKeys="true" keyProperty="id">
|
||||||
insert into ff_game_free_record
|
insert into ff_game_free_record
|
||||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<trim prefix="(" suffix=")" suffixOverrides=","><if test="id != null">id,</if>
|
||||||
<if test="currencyCode != null">currency_code,</if>
|
<if test="currencyCode != null">currency_code,</if>
|
||||||
<if test="platformCode != null">platform_code,</if>
|
<if test="platformCode != null">platform_code,</if>
|
||||||
<if test="referenceId != null">reference_id,</if>
|
<if test="referenceId != null">reference_id,</if>
|
||||||
|
|
@ -77,7 +77,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="updateBy != null">update_by,</if>
|
<if test="updateBy != null">update_by,</if>
|
||||||
<if test="updateTime != null">update_time,</if>
|
<if test="updateTime != null">update_time,</if>
|
||||||
</trim>
|
</trim>
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<trim prefix="values (" suffix=")" suffixOverrides=","> <if test="id != null">#{id},</if>
|
||||||
<if test="currencyCode != null">#{currencyCode},</if>
|
<if test="currencyCode != null">#{currencyCode},</if>
|
||||||
<if test="platformCode != null">#{platformCode},</if>
|
<if test="platformCode != null">#{platformCode},</if>
|
||||||
<if test="referenceId != null">#{referenceId},</if>
|
<if test="referenceId != null">#{referenceId},</if>
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
|
||||||
<insert id="insertGame" parameterType="Game" useGeneratedKeys="true" keyProperty="id">
|
<insert id="insertGame" parameterType="Game" useGeneratedKeys="true" keyProperty="id">
|
||||||
insert into ff_game
|
insert into ff_game
|
||||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<trim prefix="(" suffix=")" suffixOverrides=","><if test="id != null">id,</if>
|
||||||
<if test="sortNo != null">sort_no,</if>
|
<if test="sortNo != null">sort_no,</if>
|
||||||
<if test="platformId != null">platform_id,</if>
|
<if test="platformId != null">platform_id,</if>
|
||||||
<if test="gameCode != null">game_code,</if>
|
<if test="gameCode != null">game_code,</if>
|
||||||
|
|
@ -59,7 +59,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="updateBy != null">update_by,</if>
|
<if test="updateBy != null">update_by,</if>
|
||||||
<if test="updateTime != null">update_time,</if>
|
<if test="updateTime != null">update_time,</if>
|
||||||
</trim>
|
</trim>
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<trim prefix="values (" suffix=")" suffixOverrides=","> <if test="id != null">#{id},</if>
|
||||||
<if test="sortNo != null">#{sortNo},</if>
|
<if test="sortNo != null">#{sortNo},</if>
|
||||||
<if test="platformId != null">#{platformId},</if>
|
<if test="platformId != null">#{platformId},</if>
|
||||||
<if test="gameCode != null">#{gameCode},</if>
|
<if test="gameCode != null">#{gameCode},</if>
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
|
||||||
<insert id="insertGamePlatform" parameterType="GamePlatform" useGeneratedKeys="true" keyProperty="id">
|
<insert id="insertGamePlatform" parameterType="GamePlatform" useGeneratedKeys="true" keyProperty="id">
|
||||||
insert into ff_game_platform
|
insert into ff_game_platform
|
||||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<trim prefix="(" suffix=")" suffixOverrides=","><if test="id != null">id,</if>
|
||||||
<if test="sortNo != null">sort_no,</if>
|
<if test="sortNo != null">sort_no,</if>
|
||||||
<if test="platformCode != null">platform_code,</if>
|
<if test="platformCode != null">platform_code,</if>
|
||||||
<if test="platformType != null">platform_type,</if>
|
<if test="platformType != null">platform_type,</if>
|
||||||
|
|
@ -50,7 +50,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="updateBy != null">update_by,</if>
|
<if test="updateBy != null">update_by,</if>
|
||||||
<if test="updateTime != null">update_time,</if>
|
<if test="updateTime != null">update_time,</if>
|
||||||
</trim>
|
</trim>
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<trim prefix="values (" suffix=")" suffixOverrides=","> <if test="id != null">#{id},</if>
|
||||||
<if test="sortNo != null">#{sortNo},</if>
|
<if test="sortNo != null">#{sortNo},</if>
|
||||||
<if test="platformCode != null">#{platformCode},</if>
|
<if test="platformCode != null">#{platformCode},</if>
|
||||||
<if test="platformType != null">#{platformType},</if>
|
<if test="platformType != null">#{platformType},</if>
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
|
||||||
<insert id="insertGameSecretKey" parameterType="GameSecretKey" useGeneratedKeys="true" keyProperty="id">
|
<insert id="insertGameSecretKey" parameterType="GameSecretKey" useGeneratedKeys="true" keyProperty="id">
|
||||||
insert into ff_game_secret_key
|
insert into ff_game_secret_key
|
||||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<trim prefix="(" suffix=")" suffixOverrides=","><if test="id != null">id,</if>
|
||||||
<if test="platform != null and platform != ''">platform,</if>
|
<if test="platform != null and platform != ''">platform,</if>
|
||||||
<if test="code != null and code != ''">code,</if>
|
<if test="code != null and code != ''">code,</if>
|
||||||
<if test="key != null and key != ''">`key`,</if>
|
<if test="key != null and key != ''">`key`,</if>
|
||||||
|
|
@ -56,7 +56,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="updateBy != null">update_by,</if>
|
<if test="updateBy != null">update_by,</if>
|
||||||
<if test="updateTime != null">update_time,</if>
|
<if test="updateTime != null">update_time,</if>
|
||||||
</trim>
|
</trim>
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<trim prefix="values (" suffix=")" suffixOverrides=","> <if test="id != null">#{id},</if>
|
||||||
<if test="platform != null and platform != ''">#{platform},</if>
|
<if test="platform != null and platform != ''">#{platform},</if>
|
||||||
<if test="code != null and code != ''">#{code},</if>
|
<if test="code != null and code != ''">#{code},</if>
|
||||||
<if test="key != null and key != ''">#{key},</if>
|
<if test="key != null and key != ''">#{key},</if>
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@
|
||||||
|
|
||||||
<insert id="insertMember" parameterType="Member" useGeneratedKeys="true" keyProperty="id">
|
<insert id="insertMember" parameterType="Member" useGeneratedKeys="true" keyProperty="id">
|
||||||
insert into ff_member
|
insert into ff_member
|
||||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<trim prefix="(" suffix=")" suffixOverrides=","><if test="id != null">id,</if>
|
||||||
<if test="tenantKey != null">tenant_key,</if>
|
<if test="tenantKey != null">tenant_key,</if>
|
||||||
<if test="memberAccount != null and memberAccount != ''">member_account,</if>
|
<if test="memberAccount != null and memberAccount != ''">member_account,</if>
|
||||||
<if test="gameAccount != null">game_account,</if>
|
<if test="gameAccount != null">game_account,</if>
|
||||||
|
|
@ -50,7 +50,7 @@
|
||||||
<if test="updateBy != null">update_by,</if>
|
<if test="updateBy != null">update_by,</if>
|
||||||
<if test="updateTime != null">update_time,</if>
|
<if test="updateTime != null">update_time,</if>
|
||||||
</trim>
|
</trim>
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<trim prefix="values (" suffix=")" suffixOverrides=","> <if test="id != null">#{id},</if>
|
||||||
<if test="tenantKey != null">#{tenantKey},</if>
|
<if test="tenantKey != null">#{tenantKey},</if>
|
||||||
<if test="memberAccount != null and memberAccount != ''">#{memberAccount},</if>
|
<if test="memberAccount != null and memberAccount != ''">#{memberAccount},</if>
|
||||||
<if test="gameAccount != null">#{gameAccount},</if>
|
<if test="gameAccount != null">#{gameAccount},</if>
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,11 @@
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.dtflys.forest</groupId>
|
||||||
|
<artifactId>forest-spring-boot-starter</artifactId>
|
||||||
|
<version>1.6.3</version>
|
||||||
|
</dependency>
|
||||||
<!-- SpringBoot的依赖配置-->
|
<!-- SpringBoot的依赖配置-->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
|
@ -184,6 +189,7 @@
|
||||||
<artifactId>javase</artifactId>
|
<artifactId>javase</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|
|
||||||
|
|
@ -1,34 +0,0 @@
|
||||||
package com.ff.base.config;
|
|
||||||
|
|
||||||
import com.ff.base.utils.SnowflakeIdGenerator;
|
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
|
||||||
import org.springframework.context.annotation.Configuration;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 雪花算法id
|
|
||||||
*
|
|
||||||
* @author liukang
|
|
||||||
* @date 2024-11-04
|
|
||||||
*/
|
|
||||||
@Configuration
|
|
||||||
public class IdGeneratorUtil {
|
|
||||||
|
|
||||||
private static SnowflakeIdGenerator snowflakeIdGenerator;
|
|
||||||
|
|
||||||
@Value("${snowflake.worker.id}")
|
|
||||||
private long workerId;
|
|
||||||
|
|
||||||
@Value("${snowflake.datacenter.id}")
|
|
||||||
private long dataCenterId;
|
|
||||||
|
|
||||||
public void init() {
|
|
||||||
snowflakeIdGenerator = new SnowflakeIdGenerator(workerId, dataCenterId);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static long generateId() {
|
|
||||||
if (snowflakeIdGenerator == null) {
|
|
||||||
throw new IllegalStateException("SnowflakeIdGenerator is not initialized");
|
|
||||||
}
|
|
||||||
return snowflakeIdGenerator.nextId();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -6,7 +6,7 @@ import com.ff.base.security.filter.JwtAuthenticationTokenFilter;
|
||||||
import com.ff.base.security.handle.AuthenticationEntryPointImpl;
|
import com.ff.base.security.handle.AuthenticationEntryPointImpl;
|
||||||
import com.ff.base.security.handle.LogoutSuccessHandlerImpl;
|
import com.ff.base.security.handle.LogoutSuccessHandlerImpl;
|
||||||
import com.ff.base.security.provider.MyDaoAuthenticationProvider;
|
import com.ff.base.security.provider.MyDaoAuthenticationProvider;
|
||||||
import com.ff.base.web.service.MemberDetailsServiceImpl;
|
import com.ff.base.web.service.TenantDetailsServiceImpl;
|
||||||
import com.ff.base.web.service.UserDetailsServiceImpl;
|
import com.ff.base.web.service.UserDetailsServiceImpl;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
|
|
@ -41,11 +41,8 @@ public class SecurityConfig {
|
||||||
@Autowired
|
@Autowired
|
||||||
private UserDetailsServiceImpl userDetailsService;
|
private UserDetailsServiceImpl userDetailsService;
|
||||||
|
|
||||||
/**
|
|
||||||
* 会员自定义用户认证逻辑
|
|
||||||
*/
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private MemberDetailsServiceImpl memberDetailsService;
|
private TenantDetailsServiceImpl tenantDetailsService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 认证失败处理类
|
* 认证失败处理类
|
||||||
|
|
@ -86,20 +83,20 @@ public class SecurityConfig {
|
||||||
// 后台、会员两种验证方式实现类
|
// 后台、会员两种验证方式实现类
|
||||||
List<UserDetailsService> userDetailsServices = new ArrayList<>();
|
List<UserDetailsService> userDetailsServices = new ArrayList<>();
|
||||||
userDetailsServices.add(userDetailsService);
|
userDetailsServices.add(userDetailsService);
|
||||||
userDetailsServices.add(memberDetailsService);
|
userDetailsServices.add(tenantDetailsService);
|
||||||
|
|
||||||
List<AuthenticationProvider> providers = new ArrayList<>();
|
List<AuthenticationProvider> providers = new ArrayList<>();
|
||||||
MyDaoAuthenticationProvider adminDaoAuthenticationProvider = new MyDaoAuthenticationProvider();
|
MyDaoAuthenticationProvider adminDaoAuthenticationProvider = new MyDaoAuthenticationProvider();
|
||||||
adminDaoAuthenticationProvider.setUserDetailsService(userDetailsService); // or userDetailsService
|
adminDaoAuthenticationProvider.setUserDetailsService(userDetailsService); // or userDetailsService
|
||||||
adminDaoAuthenticationProvider.setPasswordEncoder(bCryptPasswordEncoder());
|
adminDaoAuthenticationProvider.setPasswordEncoder(bCryptPasswordEncoder());
|
||||||
adminDaoAuthenticationProvider.setUserDetailsServices(userDetailsServices);
|
adminDaoAuthenticationProvider.setUserDetailsServices(userDetailsServices);
|
||||||
|
|
||||||
MyDaoAuthenticationProvider memberDaoAuthenticationProvider = new MyDaoAuthenticationProvider();
|
|
||||||
memberDaoAuthenticationProvider.setUserDetailsService(memberDetailsService); // or userDetailsService
|
|
||||||
memberDaoAuthenticationProvider.setPasswordEncoder(bCryptPasswordEncoder());
|
|
||||||
memberDaoAuthenticationProvider.setUserDetailsServices(userDetailsServices);
|
|
||||||
providers.add(adminDaoAuthenticationProvider);
|
providers.add(adminDaoAuthenticationProvider);
|
||||||
providers.add(memberDaoAuthenticationProvider);
|
|
||||||
|
MyDaoAuthenticationProvider adminDaoAuthenticationProvider1 = new MyDaoAuthenticationProvider();
|
||||||
|
adminDaoAuthenticationProvider1.setUserDetailsService(tenantDetailsService);
|
||||||
|
adminDaoAuthenticationProvider1.setPasswordEncoder(bCryptPasswordEncoder());
|
||||||
|
adminDaoAuthenticationProvider1.setUserDetailsServices(userDetailsServices);
|
||||||
|
|
||||||
|
|
||||||
return new ProviderManager(providers);
|
return new ProviderManager(providers);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -251,4 +251,14 @@ public class Constants {
|
||||||
*/
|
*/
|
||||||
public static final String USDT = "USDT";
|
public static final String USDT = "USDT";
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 代理人角色
|
||||||
|
*/
|
||||||
|
public static final String AGENT_ROLE = "agent";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 租户角色
|
||||||
|
*/
|
||||||
|
public static final String TENANT_ROLE = "tenant";
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -30,4 +30,9 @@ public class LoginBody
|
||||||
*/
|
*/
|
||||||
private String uuid;
|
private String uuid;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 登录类型
|
||||||
|
*/
|
||||||
|
private Integer loginType;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -74,10 +74,6 @@ public class LoginUser implements UserDetails
|
||||||
*/
|
*/
|
||||||
private SysUser user;
|
private SysUser user;
|
||||||
|
|
||||||
/**
|
|
||||||
* 币种
|
|
||||||
*/
|
|
||||||
private String currencyType;
|
|
||||||
|
|
||||||
public LoginUser()
|
public LoginUser()
|
||||||
{
|
{
|
||||||
|
|
@ -97,12 +93,6 @@ public class LoginUser implements UserDetails
|
||||||
this.permissions = permissions;
|
this.permissions = permissions;
|
||||||
}
|
}
|
||||||
|
|
||||||
public LoginUser(Long userId,String currencyType, SysUser user)
|
|
||||||
{
|
|
||||||
this.userId = userId;
|
|
||||||
this.user = user;
|
|
||||||
this.currencyType = currencyType;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getUserId()
|
public Long getUserId()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,35 @@
|
||||||
|
package com.ff.base.enums;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 登录类型
|
||||||
|
*
|
||||||
|
* @author shi
|
||||||
|
* @date 2025/02/24
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
public enum LoginType {
|
||||||
|
ADMIN(0, "后台"),
|
||||||
|
TENANT(1, "租户"),
|
||||||
|
AGENT(2, "代理"),
|
||||||
|
;
|
||||||
|
|
||||||
|
private final Integer value; // 登录类型值
|
||||||
|
private final String description; // 登录类型描述
|
||||||
|
|
||||||
|
LoginType(Integer value, String description) {
|
||||||
|
this.value = value;
|
||||||
|
this.description = description;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 根据 value 查找对应的 description
|
||||||
|
public static String getDescriptionByValue(Integer value) {
|
||||||
|
for (LoginType type : LoginType.values()) {
|
||||||
|
if (type.getValue().equals(value)) {
|
||||||
|
return type.getDescription();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null; // 未找到时返回 null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -6,6 +6,7 @@ import com.ff.base.annotation.Excel.Type;
|
||||||
import com.ff.base.annotation.Excels;
|
import com.ff.base.annotation.Excels;
|
||||||
import com.ff.base.core.domain.BaseEntity;
|
import com.ff.base.core.domain.BaseEntity;
|
||||||
import com.ff.base.xss.Xss;
|
import com.ff.base.xss.Xss;
|
||||||
|
import lombok.Data;
|
||||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
|
|
||||||
|
|
@ -19,334 +20,157 @@ import java.util.List;
|
||||||
*
|
*
|
||||||
* @author ff
|
* @author ff
|
||||||
*/
|
*/
|
||||||
public class SysUser extends BaseEntity
|
@Data
|
||||||
{
|
public class SysUser extends BaseEntity {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
/** 用户ID */
|
/**
|
||||||
|
* 用户ID
|
||||||
|
*/
|
||||||
@Excel(name = "用户序号", type = Type.EXPORT, cellType = ColumnType.NUMERIC, prompt = "用户编号")
|
@Excel(name = "用户序号", type = Type.EXPORT, cellType = ColumnType.NUMERIC, prompt = "用户编号")
|
||||||
private Long userId;
|
private Long userId;
|
||||||
|
|
||||||
/** 部门ID */
|
/**
|
||||||
|
* 部门ID
|
||||||
|
*/
|
||||||
@Excel(name = "部门编号", type = Type.IMPORT)
|
@Excel(name = "部门编号", type = Type.IMPORT)
|
||||||
private Long deptId;
|
private Long deptId;
|
||||||
|
|
||||||
/** 用户账号 */
|
/**
|
||||||
|
* 用户账号
|
||||||
|
*/
|
||||||
@Excel(name = "登录名称")
|
@Excel(name = "登录名称")
|
||||||
|
@Xss(message = "用户账号不能包含脚本字符")
|
||||||
|
@NotBlank(message = "用户账号不能为空")
|
||||||
|
@Size(min = 0, max = 30, message = "用户账号长度不能超过30个字符")
|
||||||
private String userName;
|
private String userName;
|
||||||
|
|
||||||
/** 用户昵称 */
|
/**
|
||||||
|
* 用户昵称
|
||||||
|
*/
|
||||||
@Excel(name = "用户名称")
|
@Excel(name = "用户名称")
|
||||||
|
@Xss(message = "用户昵称不能包含脚本字符")
|
||||||
|
@Size(min = 0, max = 30, message = "用户昵称长度不能超过30个字符")
|
||||||
private String nickName;
|
private String nickName;
|
||||||
|
|
||||||
/** 用户邮箱 */
|
/**
|
||||||
|
* 用户邮箱
|
||||||
|
*/
|
||||||
@Excel(name = "用户邮箱")
|
@Excel(name = "用户邮箱")
|
||||||
|
@Email(message = "邮箱格式不正确")
|
||||||
|
@Size(min = 0, max = 50, message = "邮箱长度不能超过50个字符")
|
||||||
private String email;
|
private String email;
|
||||||
|
|
||||||
/** 手机号码 */
|
/**
|
||||||
|
* 手机号码
|
||||||
|
*/
|
||||||
@Excel(name = "手机号码", cellType = ColumnType.TEXT)
|
@Excel(name = "手机号码", cellType = ColumnType.TEXT)
|
||||||
|
@Size(min = 0, max = 11, message = "手机号码长度不能超过11个字符")
|
||||||
private String phonenumber;
|
private String phonenumber;
|
||||||
|
|
||||||
/** 用户性别 */
|
/**
|
||||||
|
* 用户性别
|
||||||
|
*/
|
||||||
@Excel(name = "用户性别", readConverterExp = "0=男,1=女,2=未知")
|
@Excel(name = "用户性别", readConverterExp = "0=男,1=女,2=未知")
|
||||||
private String sex;
|
private String sex;
|
||||||
|
|
||||||
/** 用户头像 */
|
/**
|
||||||
|
* 用户头像
|
||||||
|
*/
|
||||||
private String avatar;
|
private String avatar;
|
||||||
|
|
||||||
/** 密码 */
|
/**
|
||||||
|
* 密码
|
||||||
|
*/
|
||||||
private String password;
|
private String password;
|
||||||
|
|
||||||
/** 帐号状态(0正常 1停用) */
|
/**
|
||||||
|
* 帐号状态(0正常 1停用)
|
||||||
|
*/
|
||||||
@Excel(name = "帐号状态", readConverterExp = "0=正常,1=停用")
|
@Excel(name = "帐号状态", readConverterExp = "0=正常,1=停用")
|
||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
/** 删除标志(0代表存在 2代表删除) */
|
/**
|
||||||
|
* 删除标志(0代表存在 2代表删除)
|
||||||
|
*/
|
||||||
private String delFlag;
|
private String delFlag;
|
||||||
|
|
||||||
/** 最后登录IP */
|
/**
|
||||||
|
* 最后登录IP
|
||||||
|
*/
|
||||||
@Excel(name = "最后登录IP", type = Type.EXPORT)
|
@Excel(name = "最后登录IP", type = Type.EXPORT)
|
||||||
private String loginIp;
|
private String loginIp;
|
||||||
|
|
||||||
/** 最后登录时间 */
|
/**
|
||||||
|
* 最后登录时间
|
||||||
|
*/
|
||||||
@Excel(name = "最后登录时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss", type = Type.EXPORT)
|
@Excel(name = "最后登录时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss", type = Type.EXPORT)
|
||||||
private Long loginDate;
|
private Long loginDate;
|
||||||
|
|
||||||
/** 部门对象 */
|
/**
|
||||||
|
* 部门对象
|
||||||
|
*/
|
||||||
@Excels({
|
@Excels({
|
||||||
@Excel(name = "部门名称", targetAttr = "deptName", type = Type.EXPORT),
|
@Excel(name = "部门名称", targetAttr = "deptName", type = Type.EXPORT),
|
||||||
@Excel(name = "部门负责人", targetAttr = "leader", type = Type.EXPORT)
|
@Excel(name = "部门负责人", targetAttr = "leader", type = Type.EXPORT)
|
||||||
})
|
})
|
||||||
private SysDept dept;
|
private SysDept dept;
|
||||||
|
|
||||||
/** 角色对象 */
|
/**
|
||||||
|
* 角色对象
|
||||||
|
*/
|
||||||
private List<SysRole> roles;
|
private List<SysRole> roles;
|
||||||
|
|
||||||
/** 角色组 */
|
/**
|
||||||
|
* 角色组
|
||||||
|
*/
|
||||||
private Long[] roleIds;
|
private Long[] roleIds;
|
||||||
|
|
||||||
/** 岗位组 */
|
/**
|
||||||
|
* 岗位组
|
||||||
|
*/
|
||||||
private Long[] postIds;
|
private Long[] postIds;
|
||||||
|
|
||||||
/** 角色ID */
|
/**
|
||||||
|
* 角色ID
|
||||||
|
*/
|
||||||
private Long roleId;
|
private Long roleId;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 登录类型 0.后台登录 1.前端网页登录
|
* 登录类型 0 后台 1 代理 2 租户
|
||||||
*/
|
*/
|
||||||
private Integer loginType;
|
private Integer loginType;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 真实姓名
|
* 真实姓名
|
||||||
*/
|
*/
|
||||||
private String realName;
|
private String realName;
|
||||||
|
|
||||||
public SysUser()
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public SysUser() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public SysUser(Long userId)
|
public SysUser(Long userId) {
|
||||||
{
|
|
||||||
this.userId = userId;
|
this.userId = userId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getRealName() {
|
|
||||||
return realName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setRealName(String realName) {
|
public boolean isAdmin() {
|
||||||
this.realName = realName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getLoginType() {
|
|
||||||
return loginType;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setLoginType(Integer loginType) {
|
|
||||||
this.loginType = loginType;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getUserId()
|
|
||||||
{
|
|
||||||
return userId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setUserId(Long userId)
|
|
||||||
{
|
|
||||||
this.userId = userId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isAdmin()
|
|
||||||
{
|
|
||||||
return isAdmin(this.userId);
|
return isAdmin(this.userId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isAdmin(Long userId)
|
public static boolean isAdmin(Long userId) {
|
||||||
{
|
|
||||||
return userId != null && 1L == userId;
|
return userId != null && 1L == userId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Long getDeptId()
|
|
||||||
{
|
|
||||||
return deptId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDeptId(Long deptId)
|
|
||||||
{
|
|
||||||
this.deptId = deptId;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Xss(message = "用户昵称不能包含脚本字符")
|
|
||||||
@Size(min = 0, max = 30, message = "用户昵称长度不能超过30个字符")
|
|
||||||
public String getNickName()
|
|
||||||
{
|
|
||||||
return nickName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setNickName(String nickName)
|
|
||||||
{
|
|
||||||
this.nickName = nickName;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Xss(message = "用户账号不能包含脚本字符")
|
|
||||||
@NotBlank(message = "用户账号不能为空")
|
|
||||||
@Size(min = 0, max = 30, message = "用户账号长度不能超过30个字符")
|
|
||||||
public String getUserName()
|
|
||||||
{
|
|
||||||
return userName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setUserName(String userName)
|
|
||||||
{
|
|
||||||
this.userName = userName;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Email(message = "邮箱格式不正确")
|
|
||||||
@Size(min = 0, max = 50, message = "邮箱长度不能超过50个字符")
|
|
||||||
public String getEmail()
|
|
||||||
{
|
|
||||||
return email;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setEmail(String email)
|
|
||||||
{
|
|
||||||
this.email = email;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Size(min = 0, max = 11, message = "手机号码长度不能超过11个字符")
|
|
||||||
public String getPhonenumber()
|
|
||||||
{
|
|
||||||
return phonenumber;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPhonenumber(String phonenumber)
|
|
||||||
{
|
|
||||||
this.phonenumber = phonenumber;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getSex()
|
|
||||||
{
|
|
||||||
return sex;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSex(String sex)
|
|
||||||
{
|
|
||||||
this.sex = sex;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getAvatar()
|
|
||||||
{
|
|
||||||
return avatar;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAvatar(String avatar)
|
|
||||||
{
|
|
||||||
this.avatar = avatar;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getPassword()
|
|
||||||
{
|
|
||||||
return password;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPassword(String password)
|
|
||||||
{
|
|
||||||
this.password = password;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getStatus()
|
|
||||||
{
|
|
||||||
return status;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setStatus(String status)
|
|
||||||
{
|
|
||||||
this.status = status;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getDelFlag()
|
|
||||||
{
|
|
||||||
return delFlag;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDelFlag(String delFlag)
|
|
||||||
{
|
|
||||||
this.delFlag = delFlag;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getLoginIp()
|
|
||||||
{
|
|
||||||
return loginIp;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setLoginIp(String loginIp)
|
|
||||||
{
|
|
||||||
this.loginIp = loginIp;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getLoginDate()
|
|
||||||
{
|
|
||||||
return loginDate;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setLoginDate(Long loginDate)
|
|
||||||
{
|
|
||||||
this.loginDate = loginDate;
|
|
||||||
}
|
|
||||||
|
|
||||||
public SysDept getDept()
|
|
||||||
{
|
|
||||||
return dept;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDept(SysDept dept)
|
|
||||||
{
|
|
||||||
this.dept = dept;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<SysRole> getRoles()
|
|
||||||
{
|
|
||||||
return roles;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setRoles(List<SysRole> roles)
|
|
||||||
{
|
|
||||||
this.roles = roles;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long[] getRoleIds()
|
|
||||||
{
|
|
||||||
return roleIds;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setRoleIds(Long[] roleIds)
|
|
||||||
{
|
|
||||||
this.roleIds = roleIds;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long[] getPostIds()
|
|
||||||
{
|
|
||||||
return postIds;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPostIds(Long[] postIds)
|
|
||||||
{
|
|
||||||
this.postIds = postIds;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getRoleId()
|
|
||||||
{
|
|
||||||
return roleId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setRoleId(Long roleId)
|
|
||||||
{
|
|
||||||
this.roleId = roleId;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
|
||||||
.append("userId", getUserId())
|
|
||||||
.append("deptId", getDeptId())
|
|
||||||
.append("userName", getUserName())
|
|
||||||
.append("nickName", getNickName())
|
|
||||||
.append("email", getEmail())
|
|
||||||
.append("phonenumber", getPhonenumber())
|
|
||||||
.append("sex", getSex())
|
|
||||||
.append("avatar", getAvatar())
|
|
||||||
.append("password", getPassword())
|
|
||||||
.append("status", getStatus())
|
|
||||||
.append("delFlag", getDelFlag())
|
|
||||||
.append("loginIp", getLoginIp())
|
|
||||||
.append("loginDate", getLoginDate())
|
|
||||||
.append("createBy", getCreateBy())
|
|
||||||
.append("createTime", getCreateTime())
|
|
||||||
.append("updateBy", getUpdateBy())
|
|
||||||
.append("updateTime", getUpdateTime())
|
|
||||||
.append("remark", getRemark())
|
|
||||||
.append("dept", getDept())
|
|
||||||
.toString();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,9 @@
|
||||||
package com.ff.common.domain;
|
package com.ff.base.system.domain;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
import com.ff.base.annotation.Excel;
|
import com.ff.base.annotation.Excel;
|
||||||
import com.ff.base.core.domain.BaseEntity;
|
import com.ff.base.core.domain.BaseEntity;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
|
|
@ -27,6 +30,22 @@ public class TenantSecretKey extends BaseEntity
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/** 密码 */
|
||||||
|
@Excel(name = "密码")
|
||||||
|
@JsonIgnore
|
||||||
|
private String password;
|
||||||
|
|
||||||
|
/** 最后登录ip */
|
||||||
|
@Excel(name = "最后登录ip")
|
||||||
|
private String loginIp;
|
||||||
|
|
||||||
|
/** 最后登录时间 */
|
||||||
|
@Excel(name = "最后登录时间")
|
||||||
|
private Long loginData;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/** 租户key */
|
/** 租户key */
|
||||||
@Excel(name = "租户key")
|
@Excel(name = "租户key")
|
||||||
private String tenantKey;
|
private String tenantKey;
|
||||||
|
|
@ -35,12 +54,16 @@ public class TenantSecretKey extends BaseEntity
|
||||||
@Excel(name = "代理id")
|
@Excel(name = "代理id")
|
||||||
private Long agentId;
|
private Long agentId;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/** 商户后缀 */
|
/** 商户后缀 */
|
||||||
@Excel(name = "商户后缀")
|
@Excel(name = "商户后缀")
|
||||||
|
@JsonIgnore
|
||||||
private String tenantSn;
|
private String tenantSn;
|
||||||
|
|
||||||
/** 租户密钥 */
|
/** 租户密钥 */
|
||||||
@Excel(name = "租户密钥")
|
@Excel(name = "租户密钥")
|
||||||
|
@JsonIgnore
|
||||||
private String tenantSecret;
|
private String tenantSecret;
|
||||||
|
|
||||||
/** 租户状态 1正常 0停用 */
|
/** 租户状态 1正常 0停用 */
|
||||||
|
|
@ -0,0 +1,27 @@
|
||||||
|
package com.ff.base.system.dto;
|
||||||
|
|
||||||
|
import com.ff.base.annotation.Excel;
|
||||||
|
import com.ff.base.core.domain.BaseEntity;
|
||||||
|
import com.ff.base.system.domain.TenantSecretKey;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户租户密钥对象 ff_tenant_secret_key
|
||||||
|
*
|
||||||
|
* @author shi
|
||||||
|
* @date 2025-02-20
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class TenantSecretKeyDTO extends TenantSecretKey
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -1,9 +1,11 @@
|
||||||
package com.ff.base.system.mapper;
|
package com.ff.base.system.mapper;
|
||||||
|
|
||||||
import com.ff.base.system.domain.SysMenu;
|
import com.ff.base.system.domain.SysMenu;
|
||||||
|
import com.ff.base.system.domain.SysRole;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 菜单表 数据层
|
* 菜单表 数据层
|
||||||
|
|
@ -61,10 +63,10 @@ public interface SysMenuMapper
|
||||||
/**
|
/**
|
||||||
* 根据用户ID查询菜单
|
* 根据用户ID查询菜单
|
||||||
*
|
*
|
||||||
* @param userId 用户ID
|
* @param roleIds 权限
|
||||||
* @return 菜单列表
|
* @return 菜单列表
|
||||||
*/
|
*/
|
||||||
public List<SysMenu> selectMenuTreeByUserId(Long userId);
|
public List<SysMenu> selectMenuTreeByUserId(@Param("roleIds") List<Long> roleIds);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据角色ID查询菜单树信息
|
* 根据角色ID查询菜单树信息
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ package com.ff.base.system.mapper;
|
||||||
|
|
||||||
import com.ff.base.system.domain.SysRole;
|
import com.ff.base.system.domain.SysRole;
|
||||||
|
|
||||||
|
import javax.management.relation.Role;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -66,6 +67,15 @@ public interface SysRoleMapper
|
||||||
*/
|
*/
|
||||||
public SysRole checkRoleNameUnique(String roleName);
|
public SysRole checkRoleNameUnique(String roleName);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 按角色键选择角色
|
||||||
|
*
|
||||||
|
* @param roleKey 角色键
|
||||||
|
* @return {@link SysRole }
|
||||||
|
*/
|
||||||
|
SysRole selectRoleByRoleKey(String roleKey);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 校验角色权限是否唯一
|
* 校验角色权限是否唯一
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -126,10 +126,5 @@ public interface SysUserMapper
|
||||||
*/
|
*/
|
||||||
public SysUser checkEmailUnique(String email);
|
public SysUser checkEmailUnique(String email);
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据账号名/手机号查询会员用户
|
|
||||||
* @param accountName 账号名/手机号
|
|
||||||
* @return 会员用户
|
|
||||||
*/
|
|
||||||
SysUser selectMemberUserByUserName(String accountName);
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,8 @@
|
||||||
package com.ff.common.mapper;
|
package com.ff.base.system.mapper;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import com.ff.common.domain.TenantSecretKey;
|
import com.ff.base.system.domain.TenantSecretKey;
|
||||||
|
import com.ff.base.system.dto.TenantSecretKeyDTO;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户租户密钥Mapper接口
|
* 用户租户密钥Mapper接口
|
||||||
|
|
@ -35,6 +36,15 @@ public interface TenantSecretKeyMapper
|
||||||
*/
|
*/
|
||||||
List<TenantSecretKey> selectTenantSecretKeyList(TenantSecretKey tenantSecretKey);
|
List<TenantSecretKey> selectTenantSecretKeyList(TenantSecretKey tenantSecretKey);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 选择租户密钥数据列表
|
||||||
|
*
|
||||||
|
* @param tenantSecretKeyDTO 租户密钥dto
|
||||||
|
* @return {@link List }<{@link TenantSecretKey }>
|
||||||
|
*/
|
||||||
|
List<TenantSecretKey> selectTenantSecretKeyDTOList(TenantSecretKeyDTO tenantSecretKeyDTO);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增用户租户密钥
|
* 新增用户租户密钥
|
||||||
*
|
*
|
||||||
|
|
@ -2,6 +2,7 @@ package com.ff.base.system.service;
|
||||||
|
|
||||||
import com.ff.base.core.domain.TreeSelect;
|
import com.ff.base.core.domain.TreeSelect;
|
||||||
import com.ff.base.system.domain.SysMenu;
|
import com.ff.base.system.domain.SysMenu;
|
||||||
|
import com.ff.base.system.domain.SysRole;
|
||||||
import com.ff.base.system.domain.vo.RouterVo;
|
import com.ff.base.system.domain.vo.RouterVo;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
@ -50,10 +51,10 @@ public interface ISysMenuService
|
||||||
/**
|
/**
|
||||||
* 根据用户ID查询菜单树信息
|
* 根据用户ID查询菜单树信息
|
||||||
*
|
*
|
||||||
* @param userId 用户ID
|
* @param roleIds 角色
|
||||||
* @return 菜单列表
|
* @return 菜单列表
|
||||||
*/
|
*/
|
||||||
public List<SysMenu> selectMenuTreeByUserId(Long userId);
|
public List<SysMenu> selectMenuTree( List<Long> roleIds);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据角色ID查询菜单树信息
|
* 根据角色ID查询菜单树信息
|
||||||
|
|
|
||||||
|
|
@ -68,6 +68,14 @@ public interface ISysRoleService
|
||||||
*/
|
*/
|
||||||
public boolean checkRoleNameUnique(SysRole role);
|
public boolean checkRoleNameUnique(SysRole role);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 按角色键选择角色
|
||||||
|
*
|
||||||
|
* @param roleKey 角色键
|
||||||
|
* @return {@link SysRole }
|
||||||
|
*/
|
||||||
|
SysRole selectRoleByRoleKey(String roleKey);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 校验角色权限是否唯一
|
* 校验角色权限是否唯一
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -205,10 +205,7 @@ public interface ISysUserService
|
||||||
*/
|
*/
|
||||||
public String importUser(List<SysUser> userList, Boolean isUpdateSupport, String operName);
|
public String importUser(List<SysUser> userList, Boolean isUpdateSupport, String operName);
|
||||||
|
|
||||||
/**
|
|
||||||
* 查看会员用户根据账号名/手机号
|
|
||||||
* @param accountName 账号名/手机号
|
|
||||||
* @return 用户
|
|
||||||
*/
|
|
||||||
SysUser selectMemberUserByUserName(String accountName);
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,8 @@
|
||||||
package com.ff.common.service;
|
package com.ff.base.system.service;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import com.ff.common.domain.TenantSecretKey;
|
import com.ff.base.system.domain.TenantSecretKey;
|
||||||
|
import com.ff.base.system.dto.TenantSecretKeyDTO;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户租户密钥Service接口
|
* 用户租户密钥Service接口
|
||||||
|
|
@ -11,6 +12,16 @@ import com.ff.common.domain.TenantSecretKey;
|
||||||
*/
|
*/
|
||||||
public interface ITenantSecretKeyService
|
public interface ITenantSecretKeyService
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 登录
|
||||||
|
*
|
||||||
|
* @param username 用户名
|
||||||
|
* @param password 密码
|
||||||
|
* @return {@link String }
|
||||||
|
*/
|
||||||
|
String login(String username, String password);
|
||||||
/**
|
/**
|
||||||
* 查询用户租户密钥
|
* 查询用户租户密钥
|
||||||
*
|
*
|
||||||
|
|
@ -19,6 +30,15 @@ public interface ITenantSecretKeyService
|
||||||
*/
|
*/
|
||||||
TenantSecretKey selectTenantSecretKeyById(Long id);
|
TenantSecretKey selectTenantSecretKeyById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 选择租户密钥数据列表
|
||||||
|
*
|
||||||
|
* @param tenantSecretKeyDTO 租户密钥dto
|
||||||
|
* @return {@link List }<{@link TenantSecretKey }>
|
||||||
|
*/
|
||||||
|
List<TenantSecretKey> selectTenantSecretKeyDTOList(TenantSecretKeyDTO tenantSecretKeyDTO);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 生成租户sn
|
* 生成租户sn
|
||||||
|
|
@ -73,4 +93,6 @@ public interface ITenantSecretKeyService
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
int deleteTenantSecretKeyById(Long id);
|
int deleteTenantSecretKeyById(Long id);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package com.ff.base.system.service.impl;
|
package com.ff.base.system.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.IdUtil;
|
||||||
import com.ff.base.constant.CacheConstants;
|
import com.ff.base.constant.CacheConstants;
|
||||||
import com.ff.base.constant.UserConstants;
|
import com.ff.base.constant.UserConstants;
|
||||||
import com.ff.base.core.redis.RedisCache;
|
import com.ff.base.core.redis.RedisCache;
|
||||||
|
|
@ -100,6 +101,7 @@ public class SysConfigServiceImpl implements ISysConfigService {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int insertConfig(SysConfig config) {
|
public int insertConfig(SysConfig config) {
|
||||||
|
config.setConfigId(IdUtil.getSnowflakeNextId());
|
||||||
int row = configMapper.insertConfig(config);
|
int row = configMapper.insertConfig(config);
|
||||||
if (row > 0) {
|
if (row > 0) {
|
||||||
redisCache.setCacheObject(getCacheKey(config.getConfigKey()), config.getConfigValue());
|
redisCache.setCacheObject(getCacheKey(config.getConfigKey()), config.getConfigValue());
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package com.ff.base.system.service.impl;
|
package com.ff.base.system.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.IdUtil;
|
||||||
import com.ff.base.system.domain.SysDatasource;
|
import com.ff.base.system.domain.SysDatasource;
|
||||||
import com.ff.base.system.mapper.SysDatasourceMapper;
|
import com.ff.base.system.mapper.SysDatasourceMapper;
|
||||||
import com.ff.base.system.service.ISysDatasourceService;
|
import com.ff.base.system.service.ISysDatasourceService;
|
||||||
|
|
@ -86,6 +87,7 @@ public class SysDatasourceServiceImpl implements ISysDatasourceService
|
||||||
@Override
|
@Override
|
||||||
public int insertSysDatasource(SysDatasource sysDatasource)
|
public int insertSysDatasource(SysDatasource sysDatasource)
|
||||||
{
|
{
|
||||||
|
sysDatasource.setId(IdUtil.getSnowflakeNextId());
|
||||||
sysDatasource.setCreateTime(DateUtils.getNowDate());
|
sysDatasource.setCreateTime(DateUtils.getNowDate());
|
||||||
return sysDatasourceMapper.insertSysDatasource(sysDatasource);
|
return sysDatasourceMapper.insertSysDatasource(sysDatasource);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package com.ff.base.system.service.impl;
|
package com.ff.base.system.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.IdUtil;
|
||||||
import com.ff.base.annotation.DataScope;
|
import com.ff.base.annotation.DataScope;
|
||||||
import com.ff.base.constant.UserConstants;
|
import com.ff.base.constant.UserConstants;
|
||||||
import com.ff.base.core.domain.TreeSelect;
|
import com.ff.base.core.domain.TreeSelect;
|
||||||
|
|
@ -212,6 +213,7 @@ public class SysDeptServiceImpl implements ISysDeptService
|
||||||
@Override
|
@Override
|
||||||
public int insertDept(SysDept dept)
|
public int insertDept(SysDept dept)
|
||||||
{
|
{
|
||||||
|
dept.setDeptId(IdUtil.getSnowflakeNextId());
|
||||||
SysDept info = deptMapper.selectDeptById(dept.getParentId());
|
SysDept info = deptMapper.selectDeptById(dept.getParentId());
|
||||||
// 如果父节点不为正常状态,则不允许新增子节点
|
// 如果父节点不为正常状态,则不允许新增子节点
|
||||||
if (!UserConstants.DEPT_NORMAL.equals(info.getStatus()))
|
if (!UserConstants.DEPT_NORMAL.equals(info.getStatus()))
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package com.ff.base.system.service.impl;
|
package com.ff.base.system.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.IdUtil;
|
||||||
import com.ff.base.system.domain.SysDictData;
|
import com.ff.base.system.domain.SysDictData;
|
||||||
import com.ff.base.utils.DictUtils;
|
import com.ff.base.utils.DictUtils;
|
||||||
import com.ff.base.system.mapper.SysDictDataMapper;
|
import com.ff.base.system.mapper.SysDictDataMapper;
|
||||||
|
|
@ -83,6 +84,7 @@ public class SysDictDataServiceImpl implements ISysDictDataService
|
||||||
@Override
|
@Override
|
||||||
public int insertDictData(SysDictData data)
|
public int insertDictData(SysDictData data)
|
||||||
{
|
{
|
||||||
|
data.setDictCode(IdUtil.getSnowflakeNextId());
|
||||||
int row = dictDataMapper.insertDictData(data);
|
int row = dictDataMapper.insertDictData(data);
|
||||||
if (row > 0)
|
if (row > 0)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package com.ff.base.system.service.impl;
|
package com.ff.base.system.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.IdUtil;
|
||||||
import com.ff.base.constant.UserConstants;
|
import com.ff.base.constant.UserConstants;
|
||||||
import com.ff.base.datasource.DynamicDataSourceContextHolder;
|
import com.ff.base.datasource.DynamicDataSourceContextHolder;
|
||||||
import com.ff.base.exception.ServiceException;
|
import com.ff.base.exception.ServiceException;
|
||||||
|
|
@ -160,6 +161,7 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int insertDictType(SysDictType dict) {
|
public int insertDictType(SysDictType dict) {
|
||||||
|
dict.setDictId(IdUtil.getSnowflakeNextId());
|
||||||
int row = dictTypeMapper.insertDictType(dict);
|
int row = dictTypeMapper.insertDictType(dict);
|
||||||
if (row > 0) {
|
if (row > 0) {
|
||||||
DictUtils.setDictCache(dict.getDictType(), null);
|
DictUtils.setDictCache(dict.getDictType(), null);
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package com.ff.base.system.service.impl;
|
package com.ff.base.system.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.IdUtil;
|
||||||
import com.ff.base.system.domain.SysLogininfor;
|
import com.ff.base.system.domain.SysLogininfor;
|
||||||
import com.ff.base.system.mapper.SysLogininforMapper;
|
import com.ff.base.system.mapper.SysLogininforMapper;
|
||||||
import com.ff.base.system.service.ISysLogininforService;
|
import com.ff.base.system.service.ISysLogininforService;
|
||||||
|
|
@ -28,6 +29,7 @@ public class SysLogininforServiceImpl implements ISysLogininforService
|
||||||
@Override
|
@Override
|
||||||
public void insertLogininfor(SysLogininfor logininfor)
|
public void insertLogininfor(SysLogininfor logininfor)
|
||||||
{
|
{
|
||||||
|
logininfor.setInfoId(IdUtil.getSnowflakeNextId());
|
||||||
logininforMapper.insertLogininfor(logininfor);
|
logininforMapper.insertLogininfor(logininfor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package com.ff.base.system.service.impl;
|
package com.ff.base.system.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.IdUtil;
|
||||||
import com.ff.base.constant.Constants;
|
import com.ff.base.constant.Constants;
|
||||||
import com.ff.base.constant.UserConstants;
|
import com.ff.base.constant.UserConstants;
|
||||||
import com.ff.base.core.domain.TreeSelect;
|
import com.ff.base.core.domain.TreeSelect;
|
||||||
|
|
@ -119,20 +120,20 @@ public class SysMenuServiceImpl implements ISysMenuService
|
||||||
/**
|
/**
|
||||||
* 根据用户ID查询菜单
|
* 根据用户ID查询菜单
|
||||||
*
|
*
|
||||||
* @param userId 用户名称
|
* @param roleIds 角色
|
||||||
* @return 菜单列表
|
* @return 菜单列表
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<SysMenu> selectMenuTreeByUserId(Long userId)
|
public List<SysMenu> selectMenuTree( List<Long> roleIds)
|
||||||
{
|
{
|
||||||
List<SysMenu> menus = null;
|
List<SysMenu> menus = null;
|
||||||
if (SecurityUtils.isAdmin(userId))
|
if (SecurityUtils.isAdmin(SecurityUtils.getUserId()))
|
||||||
{
|
{
|
||||||
menus = menuMapper.selectMenuTreeAll();
|
menus = menuMapper.selectMenuTreeAll();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
menus = menuMapper.selectMenuTreeByUserId(userId);
|
menus = menuMapper.selectMenuTreeByUserId(roleIds);
|
||||||
}
|
}
|
||||||
return getChildPerms(menus, 0);
|
return getChildPerms(menus, 0);
|
||||||
}
|
}
|
||||||
|
|
@ -296,6 +297,7 @@ public class SysMenuServiceImpl implements ISysMenuService
|
||||||
@Override
|
@Override
|
||||||
public int insertMenu(SysMenu menu)
|
public int insertMenu(SysMenu menu)
|
||||||
{
|
{
|
||||||
|
menu.setMenuId(IdUtil.getSnowflakeNextId());
|
||||||
return menuMapper.insertMenu(menu);
|
return menuMapper.insertMenu(menu);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package com.ff.base.system.service.impl;
|
package com.ff.base.system.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.IdUtil;
|
||||||
import com.ff.base.system.domain.SysOperLog;
|
import com.ff.base.system.domain.SysOperLog;
|
||||||
import com.ff.base.system.mapper.SysOperLogMapper;
|
import com.ff.base.system.mapper.SysOperLogMapper;
|
||||||
import com.ff.base.system.service.ISysOperLogService;
|
import com.ff.base.system.service.ISysOperLogService;
|
||||||
|
|
@ -27,6 +28,7 @@ public class SysOperLogServiceImpl implements ISysOperLogService
|
||||||
@Override
|
@Override
|
||||||
public void insertOperlog(SysOperLog operLog)
|
public void insertOperlog(SysOperLog operLog)
|
||||||
{
|
{
|
||||||
|
operLog.setOperId(IdUtil.getSnowflakeNextId());
|
||||||
operLogMapper.insertOperlog(operLog);
|
operLogMapper.insertOperlog(operLog);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package com.ff.base.system.service.impl;
|
package com.ff.base.system.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.IdUtil;
|
||||||
import com.ff.base.constant.UserConstants;
|
import com.ff.base.constant.UserConstants;
|
||||||
import com.ff.base.exception.ServiceException;
|
import com.ff.base.exception.ServiceException;
|
||||||
import com.ff.base.utils.StringUtils;
|
import com.ff.base.utils.StringUtils;
|
||||||
|
|
@ -162,6 +163,7 @@ public class SysPostServiceImpl implements ISysPostService
|
||||||
@Override
|
@Override
|
||||||
public int insertPost(SysPost post)
|
public int insertPost(SysPost post)
|
||||||
{
|
{
|
||||||
|
post.setPostId(IdUtil.getSnowflakeNextId());
|
||||||
return postMapper.insertPost(post);
|
return postMapper.insertPost(post);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package com.ff.base.system.service.impl;
|
package com.ff.base.system.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.IdUtil;
|
||||||
import com.ff.base.annotation.DataScope;
|
import com.ff.base.annotation.DataScope;
|
||||||
import com.ff.base.constant.UserConstants;
|
import com.ff.base.constant.UserConstants;
|
||||||
import com.ff.base.system.domain.SysRole;
|
import com.ff.base.system.domain.SysRole;
|
||||||
|
|
@ -154,6 +155,17 @@ public class SysRoleServiceImpl implements ISysRoleService
|
||||||
return UserConstants.UNIQUE;
|
return UserConstants.UNIQUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 按角色键选择角色
|
||||||
|
*
|
||||||
|
* @param roleKey 角色键
|
||||||
|
* @return {@link SysRole }
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public SysRole selectRoleByRoleKey(String roleKey) {
|
||||||
|
return roleMapper.selectRoleByRoleKey(roleKey);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 校验角色权限是否唯一
|
* 校验角色权限是否唯一
|
||||||
*
|
*
|
||||||
|
|
@ -231,6 +243,7 @@ public class SysRoleServiceImpl implements ISysRoleService
|
||||||
@Transactional
|
@Transactional
|
||||||
public int insertRole(SysRole role)
|
public int insertRole(SysRole role)
|
||||||
{
|
{
|
||||||
|
role.setRoleId(IdUtil.getSnowflakeNextId());
|
||||||
// 新增角色信息
|
// 新增角色信息
|
||||||
roleMapper.insertRole(role);
|
roleMapper.insertRole(role);
|
||||||
return insertRoleMenu(role);
|
return insertRoleMenu(role);
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package com.ff.base.system.service.impl;
|
package com.ff.base.system.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.IdUtil;
|
||||||
import com.ff.base.annotation.DataScope;
|
import com.ff.base.annotation.DataScope;
|
||||||
import com.ff.base.constant.UserConstants;
|
import com.ff.base.constant.UserConstants;
|
||||||
import com.ff.base.system.domain.SysRole;
|
import com.ff.base.system.domain.SysRole;
|
||||||
|
|
@ -257,6 +258,7 @@ public class SysUserServiceImpl implements ISysUserService
|
||||||
@Transactional
|
@Transactional
|
||||||
public int insertUser(SysUser user)
|
public int insertUser(SysUser user)
|
||||||
{
|
{
|
||||||
|
user.setUserId(IdUtil.getSnowflakeNextId());
|
||||||
// 新增用户信息
|
// 新增用户信息
|
||||||
int rows = userMapper.insertUser(user);
|
int rows = userMapper.insertUser(user);
|
||||||
// 新增用户岗位关联
|
// 新增用户岗位关联
|
||||||
|
|
@ -545,13 +547,5 @@ public class SysUserServiceImpl implements ISysUserService
|
||||||
return successMsg.toString();
|
return successMsg.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据账号名/手机号查询会员用户
|
|
||||||
* @param accountName 账号名/手机号
|
|
||||||
* @return 会员用户
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public SysUser selectMemberUserByUserName(String accountName) {
|
|
||||||
return userMapper.selectMemberUserByUserName(accountName);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,206 @@
|
||||||
|
package com.ff.base.system.service.impl;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.IdUtil;
|
||||||
|
import com.ff.base.constant.Constants;
|
||||||
|
import com.ff.base.core.domain.model.LoginForm;
|
||||||
|
import com.ff.base.core.domain.model.LoginUser;
|
||||||
|
import com.ff.base.enums.LoginType;
|
||||||
|
import com.ff.base.exception.ServiceException;
|
||||||
|
import com.ff.base.exception.user.UserPasswordNotMatchException;
|
||||||
|
import com.ff.base.manager.AsyncManager;
|
||||||
|
import com.ff.base.manager.factory.AsyncFactory;
|
||||||
|
import com.ff.base.security.context.AuthenticationContextHolder;
|
||||||
|
import com.ff.base.system.dto.TenantSecretKeyDTO;
|
||||||
|
import com.ff.base.utils.DateUtils;
|
||||||
|
import com.ff.base.utils.MessageUtils;
|
||||||
|
import com.ff.base.utils.NumberUtils;
|
||||||
|
import com.ff.base.utils.ip.IpUtils;
|
||||||
|
import com.ff.base.web.service.TokenService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.security.authentication.AuthenticationManager;
|
||||||
|
import org.springframework.security.authentication.BadCredentialsException;
|
||||||
|
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
|
||||||
|
import org.springframework.security.core.Authentication;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import com.ff.base.system.mapper.TenantSecretKeyMapper;
|
||||||
|
import com.ff.base.system.domain.TenantSecretKey;
|
||||||
|
import com.ff.base.system.service.ITenantSecretKeyService;
|
||||||
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户租户密钥Service业务层处理
|
||||||
|
*
|
||||||
|
* @author shi
|
||||||
|
* @date 2025-02-11
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class TenantSecretKeyServiceImpl implements ITenantSecretKeyService {
|
||||||
|
@Autowired
|
||||||
|
private TenantSecretKeyMapper tenantSecretKeyMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private TokenService tokenService;
|
||||||
|
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private AuthenticationManager authenticationManager;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 登录
|
||||||
|
*
|
||||||
|
* @param username 用户名
|
||||||
|
* @param password 密码
|
||||||
|
* @return {@link String }
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String login(String username, String password) {
|
||||||
|
// 用户验证
|
||||||
|
Authentication authentication = null;
|
||||||
|
try {
|
||||||
|
|
||||||
|
|
||||||
|
LoginForm loginForm = new LoginForm();
|
||||||
|
loginForm.setAccountName(username);
|
||||||
|
loginForm.setPassword(password);
|
||||||
|
loginForm.setLoginType(LoginType.TENANT.getValue());
|
||||||
|
UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken(username, loginForm);
|
||||||
|
AuthenticationContextHolder.setContext(authenticationToken);
|
||||||
|
authentication = authenticationManager.authenticate(authenticationToken);
|
||||||
|
} catch (Exception e) {
|
||||||
|
if (e instanceof BadCredentialsException) {
|
||||||
|
AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.password.not.match")));
|
||||||
|
throw new UserPasswordNotMatchException();
|
||||||
|
} else {
|
||||||
|
AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, e.getMessage()));
|
||||||
|
throw new ServiceException(e.getMessage());
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
AuthenticationContextHolder.clearContext();
|
||||||
|
}
|
||||||
|
AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_SUCCESS, MessageUtils.message("user.login.success")));
|
||||||
|
LoginUser loginUser = (LoginUser) authentication.getPrincipal();
|
||||||
|
|
||||||
|
//更新租户信息
|
||||||
|
TenantSecretKey tenantSecretKey = new TenantSecretKey();
|
||||||
|
tenantSecretKey.setId(loginUser.getUserId());
|
||||||
|
tenantSecretKey.setLoginIp(IpUtils.getIpAddr());
|
||||||
|
tenantSecretKey.setLoginData(DateUtils.getNowDate());
|
||||||
|
tenantSecretKeyMapper.updateTenantSecretKey(tenantSecretKey);
|
||||||
|
// 生成token
|
||||||
|
return tokenService.createToken(loginUser);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询用户租户密钥
|
||||||
|
*
|
||||||
|
* @param id 用户租户密钥主键
|
||||||
|
* @return 用户租户密钥
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public TenantSecretKey selectTenantSecretKeyById(Long id) {
|
||||||
|
return tenantSecretKeyMapper.selectTenantSecretKeyById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 选择租户密钥数据列表
|
||||||
|
*
|
||||||
|
* @param tenantSecretKeyDTO 租户密钥dto
|
||||||
|
* @return {@link List }<{@link TenantSecretKey }>
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<TenantSecretKey> selectTenantSecretKeyDTOList(TenantSecretKeyDTO tenantSecretKeyDTO) {
|
||||||
|
return tenantSecretKeyMapper.selectTenantSecretKeyDTOList(tenantSecretKeyDTO);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生成租户sn
|
||||||
|
*
|
||||||
|
* @return {@link String }
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public synchronized String generateTenantSn() {
|
||||||
|
String sn = NumberUtils.generateRandomCode();
|
||||||
|
while (!CollectionUtils.isEmpty(tenantSecretKeyMapper.selectTenantSecretKeyList(TenantSecretKey.builder()
|
||||||
|
.tenantSn(sn)
|
||||||
|
.build()))) {
|
||||||
|
sn = NumberUtils.generateRandomCode();
|
||||||
|
}
|
||||||
|
return sn;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 按租户密钥选择租户密钥
|
||||||
|
*
|
||||||
|
* @param tenantKey 租户密钥
|
||||||
|
* @return {@link TenantSecretKey }
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public TenantSecretKey selectTenantSecretKeyByTenantKey(String tenantKey) {
|
||||||
|
return tenantSecretKeyMapper.selectTenantSecretKeyByTenantKey(tenantKey);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询用户租户密钥列表
|
||||||
|
*
|
||||||
|
* @param tenantSecretKey 用户租户密钥
|
||||||
|
* @return 用户租户密钥
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<TenantSecretKey> selectTenantSecretKeyList(TenantSecretKey tenantSecretKey) {
|
||||||
|
return tenantSecretKeyMapper.selectTenantSecretKeyList(tenantSecretKey);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增用户租户密钥
|
||||||
|
*
|
||||||
|
* @param tenantSecretKey 用户租户密钥
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertTenantSecretKey(TenantSecretKey tenantSecretKey) {
|
||||||
|
tenantSecretKey.setCreateTime(DateUtils.getNowDate());
|
||||||
|
tenantSecretKey.setId(IdUtil.getSnowflakeNextId());
|
||||||
|
return tenantSecretKeyMapper.insertTenantSecretKey(tenantSecretKey);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改用户租户密钥
|
||||||
|
*
|
||||||
|
* @param tenantSecretKey 用户租户密钥
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateTenantSecretKey(TenantSecretKey tenantSecretKey) {
|
||||||
|
tenantSecretKey.setUpdateTime(DateUtils.getNowDate());
|
||||||
|
return tenantSecretKeyMapper.updateTenantSecretKey(tenantSecretKey);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除用户租户密钥
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的用户租户密钥主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteTenantSecretKeyByIds(Long[] ids) {
|
||||||
|
return tenantSecretKeyMapper.deleteTenantSecretKeyByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除用户租户密钥信息
|
||||||
|
*
|
||||||
|
* @param id 用户租户密钥主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteTenantSecretKeyById(Long id) {
|
||||||
|
return tenantSecretKeyMapper.deleteTenantSecretKeyById(id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -14,8 +14,10 @@ import org.springframework.security.core.Authentication;
|
||||||
import org.springframework.security.core.context.SecurityContextHolder;
|
import org.springframework.security.core.context.SecurityContextHolder;
|
||||||
import org.springframework.util.PatternMatchUtils;
|
import org.springframework.util.PatternMatchUtils;
|
||||||
|
|
||||||
|
import javax.management.relation.Role;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -26,14 +28,6 @@ import java.util.stream.Collectors;
|
||||||
public class SecurityUtils
|
public class SecurityUtils
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取当前登录用户币种
|
|
||||||
* @return {@link String }
|
|
||||||
*/
|
|
||||||
public static String getUserCurrencyType(){
|
|
||||||
return getLoginUser().getCurrencyType();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取用户id或null
|
* 获取用户id或null
|
||||||
|
|
@ -67,6 +61,24 @@ public class SecurityUtils
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取角色
|
||||||
|
*
|
||||||
|
* @return {@link List }<{@link SysRole }>
|
||||||
|
*/
|
||||||
|
public static List<SysRole> getRoles()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
return getLoginUser().getUser().getRoles();
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
throw new ServiceException("获取用户角色异常", HttpStatus.UNAUTHORIZED);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取部门ID
|
* 获取部门ID
|
||||||
**/
|
**/
|
||||||
|
|
@ -227,6 +239,7 @@ public class SecurityUtils
|
||||||
return hasRole(roles, role);
|
return hasRole(roles, role);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 判断是否包含角色
|
* 判断是否包含角色
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -1,73 +0,0 @@
|
||||||
package com.ff.base.utils;
|
|
||||||
/**
|
|
||||||
* 雪花算法id
|
|
||||||
*
|
|
||||||
* @author liukang
|
|
||||||
* @date 2024-11-04
|
|
||||||
*/
|
|
||||||
public class SnowflakeIdGenerator {
|
|
||||||
|
|
||||||
private static final long EPOCH = 1609459200000L; // 自定义起始时间戳,例如2021-01-01 00:00:00
|
|
||||||
private static final long WORKER_ID_BITS = 5L;
|
|
||||||
private static final long DATA_CENTER_ID_BITS = 5L;
|
|
||||||
private static final long SEQUENCE_BITS = 12L;
|
|
||||||
|
|
||||||
private static final long MAX_WORKER_ID = -1L ^ (-1L << WORKER_ID_BITS);
|
|
||||||
private static final long MAX_DATA_CENTER_ID = -1L ^ (-1L << DATA_CENTER_ID_BITS);
|
|
||||||
private static final long SEQUENCE_MASK = -1L ^ (-1L << SEQUENCE_BITS);
|
|
||||||
|
|
||||||
private static final long WORKER_ID_SHIFT = SEQUENCE_BITS;
|
|
||||||
private static final long DATA_CENTER_ID_SHIFT = SEQUENCE_BITS + WORKER_ID_BITS;
|
|
||||||
private static final long TIMESTAMP_LEFT_SHIFT = SEQUENCE_BITS + WORKER_ID_BITS + DATA_CENTER_ID_BITS;
|
|
||||||
|
|
||||||
private long workerId;
|
|
||||||
private long dataCenterId;
|
|
||||||
private long sequence = 0L;
|
|
||||||
private long lastTimestamp = -1L;
|
|
||||||
|
|
||||||
public SnowflakeIdGenerator(long workerId, long dataCenterId) {
|
|
||||||
if (workerId > MAX_WORKER_ID || workerId < 0) {
|
|
||||||
throw new IllegalArgumentException("worker Id can't be greater than " + MAX_WORKER_ID + " or less than 0");
|
|
||||||
}
|
|
||||||
if (dataCenterId > MAX_DATA_CENTER_ID || dataCenterId < 0) {
|
|
||||||
throw new IllegalArgumentException("data center Id can't be greater than " + MAX_DATA_CENTER_ID + " or less than 0");
|
|
||||||
}
|
|
||||||
this.workerId = workerId;
|
|
||||||
this.dataCenterId = dataCenterId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public synchronized long nextId() {
|
|
||||||
long timestamp = timeGen();
|
|
||||||
if (timestamp < lastTimestamp) {
|
|
||||||
throw new RuntimeException(String.format("Clock moved backwards. Refusing to generate id for %d milliseconds", lastTimestamp - timestamp));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (lastTimestamp == timestamp) {
|
|
||||||
sequence = (sequence + 1) & SEQUENCE_MASK;
|
|
||||||
if (sequence == 0) {
|
|
||||||
timestamp = tilNextMillis(lastTimestamp);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
sequence = 0L;
|
|
||||||
}
|
|
||||||
|
|
||||||
lastTimestamp = timestamp;
|
|
||||||
|
|
||||||
return ((timestamp - EPOCH) << TIMESTAMP_LEFT_SHIFT) |
|
|
||||||
(dataCenterId << DATA_CENTER_ID_SHIFT) |
|
|
||||||
(workerId << WORKER_ID_SHIFT) |
|
|
||||||
sequence;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected long tilNextMillis(long lastTimestamp) {
|
|
||||||
long timestamp = timeGen();
|
|
||||||
while (timestamp <= lastTimestamp) {
|
|
||||||
timestamp = timeGen();
|
|
||||||
}
|
|
||||||
return timestamp;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected long timeGen() {
|
|
||||||
return System.currentTimeMillis();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
package com.ff.base.utils.file;
|
package com.ff.base.utils.file;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.IdUtil;
|
||||||
import com.ff.base.config.FFConfig;
|
import com.ff.base.config.FFConfig;
|
||||||
import com.ff.base.config.IdGeneratorUtil;
|
|
||||||
import com.ff.base.constant.Constants;
|
import com.ff.base.constant.Constants;
|
||||||
import com.ff.base.exception.file.FileNameLengthLimitExceededException;
|
import com.ff.base.exception.file.FileNameLengthLimitExceededException;
|
||||||
import com.ff.base.exception.file.FileSizeLimitExceededException;
|
import com.ff.base.exception.file.FileSizeLimitExceededException;
|
||||||
|
|
@ -125,7 +125,7 @@ public class FileUploadUtils
|
||||||
public static final String extractFilename(MultipartFile file)
|
public static final String extractFilename(MultipartFile file)
|
||||||
{
|
{
|
||||||
return StringUtils.format("{}/{}_{}.{}", DateUtils.datePath(),
|
return StringUtils.format("{}/{}_{}.{}", DateUtils.datePath(),
|
||||||
IdGeneratorUtil.generateId(), Seq.getId(Seq.uploadSeqType), getExtension(file));
|
IdUtil.getSnowflakeNextId(), Seq.getId(Seq.uploadSeqType), getExtension(file));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final File getAbsoluteFile(String uploadDir, String fileName) throws IOException
|
public static final File getAbsoluteFile(String uploadDir, String fileName) throws IOException
|
||||||
|
|
|
||||||
|
|
@ -1,59 +0,0 @@
|
||||||
package com.ff.base.web.service;
|
|
||||||
|
|
||||||
import com.ff.base.core.domain.model.LoginUser;
|
|
||||||
import com.ff.base.enums.MemberStatus;
|
|
||||||
import com.ff.base.exception.ServiceException;
|
|
||||||
import com.ff.base.system.domain.SysUser;
|
|
||||||
import com.ff.base.system.service.ISysConfigService;
|
|
||||||
import com.ff.base.system.service.ISysUserService;
|
|
||||||
import com.ff.base.utils.MessageUtils;
|
|
||||||
import com.ff.base.utils.StringUtils;
|
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.security.core.userdetails.UserDetails;
|
|
||||||
import org.springframework.security.core.userdetails.UserDetailsService;
|
|
||||||
import org.springframework.security.core.userdetails.UsernameNotFoundException;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 会员验证处理
|
|
||||||
*
|
|
||||||
* @author ff
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
public class MemberDetailsServiceImpl implements UserDetailsService {
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private ISysUserService userService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private SysPasswordService passwordService;
|
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private ISysConfigService sysConfigService;
|
|
||||||
|
|
||||||
|
|
||||||
private static final Logger log = LoggerFactory.getLogger(MemberDetailsServiceImpl.class);
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public UserDetails loadUserByUsername(String accountName) throws UsernameNotFoundException {
|
|
||||||
SysUser user = userService.selectMemberUserByUserName(accountName);
|
|
||||||
if (StringUtils.isNull(user)) {
|
|
||||||
log.info("登录用户:{} 不存在.", accountName);
|
|
||||||
throw new ServiceException(MessageUtils.message("user.not.exists"));
|
|
||||||
} else if (MemberStatus.MemberStatus_6.getCode().equals(user.getStatus())) {
|
|
||||||
log.info("登录用户:{} 已被停用.", accountName);
|
|
||||||
throw new ServiceException(MessageUtils.message("user.blocked"));
|
|
||||||
}
|
|
||||||
|
|
||||||
passwordService.validate(user);
|
|
||||||
String defaultCurrency = sysConfigService.selectConfigByKey("default.currency");
|
|
||||||
return createLoginUser(user,defaultCurrency);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public UserDetails createLoginUser(SysUser user,String defaultCurrency) {
|
|
||||||
return new LoginUser(user.getUserId(),defaultCurrency, user);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -4,6 +4,7 @@ import com.ff.base.constant.CacheConstants;
|
||||||
import com.ff.base.constant.Constants;
|
import com.ff.base.constant.Constants;
|
||||||
import com.ff.base.constant.UserConstants;
|
import com.ff.base.constant.UserConstants;
|
||||||
import com.ff.base.core.domain.model.LoginForm;
|
import com.ff.base.core.domain.model.LoginForm;
|
||||||
|
import com.ff.base.enums.LoginType;
|
||||||
import com.ff.base.system.domain.SysUser;
|
import com.ff.base.system.domain.SysUser;
|
||||||
import com.ff.base.core.domain.model.LoginUser;
|
import com.ff.base.core.domain.model.LoginUser;
|
||||||
import com.ff.base.core.redis.RedisCache;
|
import com.ff.base.core.redis.RedisCache;
|
||||||
|
|
@ -61,18 +62,18 @@ public class SysLoginService
|
||||||
*/
|
*/
|
||||||
public String login(String username, String password, String code, String uuid)
|
public String login(String username, String password, String code, String uuid)
|
||||||
{
|
{
|
||||||
// 验证码校验
|
|
||||||
validateCaptcha(username, code, uuid);
|
|
||||||
// 登录前置校验
|
|
||||||
loginPreCheck(username, password);
|
|
||||||
// 用户验证
|
// 用户验证
|
||||||
Authentication authentication = null;
|
Authentication authentication = null;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
LoginForm loginForm = new LoginForm();
|
LoginForm loginForm = new LoginForm();
|
||||||
loginForm.setAccountName(username);
|
loginForm.setAccountName(username);
|
||||||
loginForm.setPassword(password);
|
loginForm.setPassword(password);
|
||||||
loginForm.setLoginType(0);
|
loginForm.setLoginType(LoginType.ADMIN.getValue());
|
||||||
UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken(username, loginForm);
|
UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken(username, loginForm);
|
||||||
AuthenticationContextHolder.setContext(authenticationToken);
|
AuthenticationContextHolder.setContext(authenticationToken);
|
||||||
// 该方法会去调用UserDetailsServiceImpl.loadUserByUsername
|
// 该方法会去调用UserDetailsServiceImpl.loadUserByUsername
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@ public class SysPasswordService
|
||||||
return CacheConstants.PWD_ERR_CNT_KEY + username;
|
return CacheConstants.PWD_ERR_CNT_KEY + username;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void validate(SysUser user)
|
public void validate(String userPassword)
|
||||||
{
|
{
|
||||||
Authentication usernamePasswordAuthenticationToken = AuthenticationContextHolder.getContext();
|
Authentication usernamePasswordAuthenticationToken = AuthenticationContextHolder.getContext();
|
||||||
String username = usernamePasswordAuthenticationToken.getName();
|
String username = usernamePasswordAuthenticationToken.getName();
|
||||||
|
|
@ -62,7 +62,7 @@ public class SysPasswordService
|
||||||
throw new UserPasswordRetryLimitExceedException(maxRetryCount, lockTime);
|
throw new UserPasswordRetryLimitExceedException(maxRetryCount, lockTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!matches(user, password))
|
if (!matches(userPassword, password))
|
||||||
{
|
{
|
||||||
retryCount = retryCount + 1;
|
retryCount = retryCount + 1;
|
||||||
redisCache.setCacheObject(getCacheKey(username), retryCount, lockTime, TimeUnit.MINUTES);
|
redisCache.setCacheObject(getCacheKey(username), retryCount, lockTime, TimeUnit.MINUTES);
|
||||||
|
|
@ -74,9 +74,9 @@ public class SysPasswordService
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean matches(SysUser user, String rawPassword)
|
public boolean matches(String userPassword, String rawPassword)
|
||||||
{
|
{
|
||||||
return SecurityUtils.matchesPassword(rawPassword, user.getPassword());
|
return SecurityUtils.matchesPassword(rawPassword, userPassword);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void clearLoginRecordCache(String loginName)
|
public void clearLoginRecordCache(String loginName)
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,97 @@
|
||||||
|
package com.ff.base.web.service;
|
||||||
|
|
||||||
|
import com.ff.base.constant.Constants;
|
||||||
|
import com.ff.base.core.domain.model.LoginUser;
|
||||||
|
import com.ff.base.enums.LoginType;
|
||||||
|
import com.ff.base.enums.UserStatus;
|
||||||
|
import com.ff.base.exception.ServiceException;
|
||||||
|
import com.ff.base.system.domain.SysRole;
|
||||||
|
import com.ff.base.system.domain.SysUser;
|
||||||
|
import com.ff.base.system.domain.TenantSecretKey;
|
||||||
|
import com.ff.base.system.service.ISysMenuService;
|
||||||
|
import com.ff.base.system.service.ISysRoleService;
|
||||||
|
import com.ff.base.system.service.ISysUserService;
|
||||||
|
import com.ff.base.system.service.ITenantSecretKeyService;
|
||||||
|
import com.ff.base.utils.MessageUtils;
|
||||||
|
import com.ff.base.utils.StringUtils;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.security.core.userdetails.UserDetails;
|
||||||
|
import org.springframework.security.core.userdetails.UserDetailsService;
|
||||||
|
import org.springframework.security.core.userdetails.UsernameNotFoundException;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 用户验证处理
|
||||||
|
*
|
||||||
|
* @author ff
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class TenantDetailsServiceImpl implements UserDetailsService
|
||||||
|
{
|
||||||
|
private static final Logger log = LoggerFactory.getLogger(TenantDetailsServiceImpl.class);
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ITenantSecretKeyService tenantSecretKeyService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private SysPasswordService passwordService;
|
||||||
|
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ISysMenuService menuService;
|
||||||
|
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private SysPermissionService permissionService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private ISysRoleService roleService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException
|
||||||
|
{
|
||||||
|
|
||||||
|
TenantSecretKey tenantSecretKey = tenantSecretKeyService.selectTenantSecretKeyByTenantKey(username);
|
||||||
|
if (StringUtils.isNull(tenantSecretKey))
|
||||||
|
{
|
||||||
|
log.info("登录用户:{} 不存在.", username);
|
||||||
|
throw new ServiceException(MessageUtils.message("user.not.exists"));
|
||||||
|
}
|
||||||
|
else if (!tenantSecretKey.getTenantStatus())
|
||||||
|
{
|
||||||
|
log.info("登录用户:{} 已被停用.", username);
|
||||||
|
throw new ServiceException(MessageUtils.message("user.blocked"));
|
||||||
|
}
|
||||||
|
|
||||||
|
passwordService.validate(tenantSecretKey.getPassword());
|
||||||
|
|
||||||
|
return createLoginUser(tenantSecretKey);
|
||||||
|
}
|
||||||
|
|
||||||
|
public UserDetails createLoginUser(TenantSecretKey tenantSecretKey)
|
||||||
|
{
|
||||||
|
SysRole sysRole = roleService.selectRoleByRoleKey(Constants.TENANT_ROLE);
|
||||||
|
SysUser sysUser=new SysUser();
|
||||||
|
sysUser.setUserId(tenantSecretKey.getId());
|
||||||
|
sysUser.setUserName(tenantSecretKey.getTenantKey());
|
||||||
|
sysUser.setNickName(tenantSecretKey.getTenantKey());
|
||||||
|
sysUser.setPassword(tenantSecretKey.getPassword());
|
||||||
|
sysUser.setLoginType(LoginType.TENANT.getValue());
|
||||||
|
sysUser.setLoginIp(tenantSecretKey.getLoginIp());
|
||||||
|
sysUser.setLoginDate(tenantSecretKey.getLoginData());
|
||||||
|
ArrayList<SysRole> sysRoles = new ArrayList<>();
|
||||||
|
sysRoles.add(sysRole);
|
||||||
|
sysUser.setRoles(sysRoles);
|
||||||
|
sysUser.setRoleId(sysRole.getRoleId());
|
||||||
|
sysUser.setRoleIds(new Long[]{sysRole.getRoleId()});
|
||||||
|
|
||||||
|
|
||||||
|
return new LoginUser(tenantSecretKey.getId(),null, sysUser, menuService.selectMenuPermsByRoleId(sysRole.getRoleId()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package com.ff.base.web.service;
|
package com.ff.base.web.service;
|
||||||
|
|
||||||
|
import com.ff.base.enums.LoginType;
|
||||||
import com.ff.base.system.domain.SysUser;
|
import com.ff.base.system.domain.SysUser;
|
||||||
import com.ff.base.core.domain.model.LoginUser;
|
import com.ff.base.core.domain.model.LoginUser;
|
||||||
import com.ff.base.enums.UserStatus;
|
import com.ff.base.enums.UserStatus;
|
||||||
|
|
@ -54,13 +55,14 @@ public class UserDetailsServiceImpl implements UserDetailsService
|
||||||
throw new ServiceException(MessageUtils.message("user.blocked"));
|
throw new ServiceException(MessageUtils.message("user.blocked"));
|
||||||
}
|
}
|
||||||
|
|
||||||
passwordService.validate(user);
|
passwordService.validate(user.getPassword());
|
||||||
|
|
||||||
return createLoginUser(user);
|
return createLoginUser(user);
|
||||||
}
|
}
|
||||||
|
|
||||||
public UserDetails createLoginUser(SysUser user)
|
public UserDetails createLoginUser(SysUser user)
|
||||||
{
|
{
|
||||||
|
user.setLoginType(LoginType.ADMIN.getValue());
|
||||||
return new LoginUser(user.getUserId(), user.getDeptId(), user, permissionService.getMenuPermission(user));
|
return new LoginUser(user.getUserId(), user.getDeptId(), user, permissionService.getMenuPermission(user));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -73,6 +73,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
|
||||||
<insert id="insertConfig" parameterType="SysConfig">
|
<insert id="insertConfig" parameterType="SysConfig">
|
||||||
insert into sys_config (
|
insert into sys_config (
|
||||||
|
<if test="configId != null ">config_id,</if>
|
||||||
<if test="configName != null and configName != '' ">config_name,</if>
|
<if test="configName != null and configName != '' ">config_name,</if>
|
||||||
<if test="configKey != null and configKey != '' ">config_key,</if>
|
<if test="configKey != null and configKey != '' ">config_key,</if>
|
||||||
<if test="configValue != null and configValue != '' ">config_value,</if>
|
<if test="configValue != null and configValue != '' ">config_value,</if>
|
||||||
|
|
@ -81,6 +82,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="remark != null and remark != ''">remark,</if>
|
<if test="remark != null and remark != ''">remark,</if>
|
||||||
create_time
|
create_time
|
||||||
)values(
|
)values(
|
||||||
|
<if test="configId != null ">#{configId},</if>
|
||||||
<if test="configName != null and configName != ''">#{configName},</if>
|
<if test="configName != null and configName != ''">#{configName},</if>
|
||||||
<if test="configKey != null and configKey != ''">#{configKey},</if>
|
<if test="configKey != null and configKey != ''">#{configKey},</if>
|
||||||
<if test="configValue != null and configValue != ''">#{configValue},</if>
|
<if test="configValue != null and configValue != ''">#{configValue},</if>
|
||||||
|
|
|
||||||
|
|
@ -96,6 +96,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
|
||||||
<insert id="insertDictData" parameterType="SysDictData">
|
<insert id="insertDictData" parameterType="SysDictData">
|
||||||
insert into sys_dict_data(
|
insert into sys_dict_data(
|
||||||
|
<if test="dictCode !=null">dict_code,</if>
|
||||||
<if test="dictSort != null">dict_sort,</if>
|
<if test="dictSort != null">dict_sort,</if>
|
||||||
<if test="dictLabel != null and dictLabel != ''">dict_label,</if>
|
<if test="dictLabel != null and dictLabel != ''">dict_label,</if>
|
||||||
<if test="dictValue != null and dictValue != ''">dict_value,</if>
|
<if test="dictValue != null and dictValue != ''">dict_value,</if>
|
||||||
|
|
@ -108,6 +109,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||||
create_time
|
create_time
|
||||||
)values(
|
)values(
|
||||||
|
<if test="dictCode !=null">#{dictCode},</if>
|
||||||
<if test="dictSort != null">#{dictSort},</if>
|
<if test="dictSort != null">#{dictSort},</if>
|
||||||
<if test="dictLabel != null and dictLabel != ''">#{dictLabel},</if>
|
<if test="dictLabel != null and dictLabel != ''">#{dictLabel},</if>
|
||||||
<if test="dictValue != null and dictValue != ''">#{dictValue},</if>
|
<if test="dictValue != null and dictValue != ''">#{dictValue},</if>
|
||||||
|
|
|
||||||
|
|
@ -88,6 +88,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
|
||||||
<insert id="insertDictType" parameterType="SysDictType">
|
<insert id="insertDictType" parameterType="SysDictType">
|
||||||
insert into sys_dict_type(
|
insert into sys_dict_type(
|
||||||
|
<if test="dictId != null">dict_id,</if>
|
||||||
<if test="dictName != null and dictName != ''">dict_name,</if>
|
<if test="dictName != null and dictName != ''">dict_name,</if>
|
||||||
<if test="dictType != null and dictType != ''">dict_type,</if>
|
<if test="dictType != null and dictType != ''">dict_type,</if>
|
||||||
<if test="status != null">status,</if>
|
<if test="status != null">status,</if>
|
||||||
|
|
@ -95,6 +96,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||||
create_time
|
create_time
|
||||||
)values(
|
)values(
|
||||||
|
<if test="dictId != null">#{dictId},</if>
|
||||||
<if test="dictName != null and dictName != ''">#{dictName},</if>
|
<if test="dictName != null and dictName != ''">#{dictName},</if>
|
||||||
<if test="dictType != null and dictType != ''">#{dictType},</if>
|
<if test="dictType != null and dictType != ''">#{dictType},</if>
|
||||||
<if test="status != null">#{status},</if>
|
<if test="status != null">#{status},</if>
|
||||||
|
|
|
||||||
|
|
@ -17,8 +17,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<insert id="insertLogininfor" parameterType="SysLogininfor">
|
<insert id="insertLogininfor" parameterType="SysLogininfor">
|
||||||
insert into sys_logininfor (user_name, status, ipaddr, login_location, browser, os, msg, login_time)
|
insert into sys_logininfor (info_id, user_name, status, ipaddr, login_location, browser, os, msg, login_time)
|
||||||
values (#{userName}, #{status}, #{ipaddr}, #{loginLocation}, #{browser}, #{os}, #{msg}, UNIX_TIMESTAMP() * 1000)
|
values (#{infoId},#{userName}, #{status}, #{ipaddr}, #{loginLocation}, #{browser}, #{os}, #{msg}, UNIX_TIMESTAMP() * 1000)
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
<select id="selectLogininforList" parameterType="SysLogininfor" resultMap="SysLogininforResult">
|
<select id="selectLogininforList" parameterType="SysLogininfor" resultMap="SysLogininforResult">
|
||||||
|
|
|
||||||
|
|
@ -74,14 +74,18 @@
|
||||||
order by m.parent_id, m.order_num
|
order by m.parent_id, m.order_num
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectMenuTreeByUserId" parameterType="Long" resultMap="SysMenuResult">
|
<select id="selectMenuTreeByUserId" resultMap="SysMenuResult">
|
||||||
select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.`query`, m.route_name, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time
|
select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.`query`, m.route_name, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time
|
||||||
from sys_menu m
|
from sys_menu m
|
||||||
left join sys_role_menu rm on m.menu_id = rm.menu_id
|
left join sys_role_menu rm on m.menu_id = rm.menu_id
|
||||||
left join sys_user_role ur on rm.role_id = ur.role_id
|
left join sys_user_role ur on rm.role_id = ur.role_id
|
||||||
left join sys_role ro on ur.role_id = ro.role_id
|
left join sys_role ro on ur.role_id = ro.role_id
|
||||||
left join sys_user u on ur.user_id = u.user_id
|
where m.menu_type in ('M', 'C') and m.status = 0 AND ro.status = 0
|
||||||
where u.user_id = #{userId} and m.menu_type in ('M', 'C') and m.status = 0 AND ro.status = 0
|
and ro.role_id in
|
||||||
|
<foreach collection="roleIds" item="roleId" open="(" separator="," close=")">
|
||||||
|
#{roleId}
|
||||||
|
</foreach>
|
||||||
|
|
||||||
order by m.parent_id, m.order_num
|
order by m.parent_id, m.order_num
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -30,8 +30,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<insert id="insertOperlog" parameterType="SysOperLog">
|
<insert id="insertOperlog" parameterType="SysOperLog">
|
||||||
insert into sys_oper_log(title, business_type, method, request_method, operator_type, oper_name, dept_name, oper_url, oper_ip, oper_location, oper_param, json_result, status, error_msg, cost_time, oper_time)
|
insert into sys_oper_log(oper_Id,title, business_type, method, request_method, operator_type, oper_name, dept_name, oper_url, oper_ip, oper_location, oper_param, json_result, status, error_msg, cost_time, oper_time)
|
||||||
values (#{title}, #{businessType}, #{method}, #{requestMethod}, #{operatorType}, #{operName}, #{deptName}, #{operUrl}, #{operIp}, #{operLocation}, #{operParam}, #{jsonResult}, #{status}, #{errorMsg}, #{costTime}, UNIX_TIMESTAMP() * 1000)
|
values (#{operId},#{title}, #{businessType}, #{method}, #{requestMethod}, #{operatorType}, #{operName}, #{deptName}, #{operUrl}, #{operIp}, #{operLocation}, #{operParam}, #{jsonResult}, #{status}, #{errorMsg}, #{costTime}, UNIX_TIMESTAMP() * 1000)
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
<select id="selectOperLogList" parameterType="SysOperLog" resultMap="SysOperLogResult">
|
<select id="selectOperLogList" parameterType="SysOperLog" resultMap="SysOperLogResult">
|
||||||
|
|
|
||||||
|
|
@ -90,6 +90,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
where r.role_name=#{roleName} and r.del_flag = '0' limit 1
|
where r.role_name=#{roleName} and r.del_flag = '0' limit 1
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="selectRoleByRoleKey" parameterType="String" resultMap="SysRoleResult">
|
||||||
|
select role_id,
|
||||||
|
role_name,
|
||||||
|
role_key,
|
||||||
|
role_sort,
|
||||||
|
data_scope,
|
||||||
|
status,
|
||||||
|
del_flag,
|
||||||
|
create_by,
|
||||||
|
create_time,
|
||||||
|
update_by,
|
||||||
|
update_time,
|
||||||
|
remark
|
||||||
|
from sys_role where del_flag = '0' and role_key=#{roleKey} limit 1
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
<select id="checkRoleKeyUnique" parameterType="String" resultMap="SysRoleResult">
|
<select id="checkRoleKeyUnique" parameterType="String" resultMap="SysRoleResult">
|
||||||
<include refid="selectRoleVo"/>
|
<include refid="selectRoleVo"/>
|
||||||
where r.role_key=#{roleKey} and r.del_flag = '0' limit 1
|
where r.role_key=#{roleKey} and r.del_flag = '0' limit 1
|
||||||
|
|
|
||||||
|
|
@ -222,25 +222,5 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</foreach>
|
</foreach>
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
<select id="selectMemberUserByUserName" resultMap="SysUserResult">
|
|
||||||
SELECT
|
|
||||||
u.id AS user_id,
|
|
||||||
u.member_account AS user_name,
|
|
||||||
u.member_account AS nick_name,
|
|
||||||
u.real_name,
|
|
||||||
u.email,
|
|
||||||
u.avatar,
|
|
||||||
u.phone_number AS phonenumber,
|
|
||||||
u.PASSWORD,
|
|
||||||
u.sex,
|
|
||||||
u.STATUS,
|
|
||||||
u.login_ip,
|
|
||||||
u.login_date,
|
|
||||||
1 AS login_type
|
|
||||||
FROM
|
|
||||||
ff_member u
|
|
||||||
WHERE
|
|
||||||
u.member_account = #{accountName}
|
|
||||||
OR u.phone_number = #{accountName}
|
|
||||||
</select>
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue