Browse Source

auth索引

master
zy_Java 5 years ago
parent
commit
d35fadc466
  1. 3
      game/src/main/java/com/ccsens/game/bean/dto/message/AuthMessageDto.java
  2. 17
      game/src/main/java/com/ccsens/game/service/ScreenService.java
  3. 4
      game/src/main/resources/application.yml
  4. 2
      tall/src/main/java/com/ccsens/tall/service/SysDomainService.java
  5. 21
      tall/src/main/java/com/ccsens/tall/service/UserService.java

3
game/src/main/java/com/ccsens/game/bean/dto/message/AuthMessageDto.java

@ -2,13 +2,12 @@ package com.ccsens.game.bean.dto.message;
import com.ccsens.util.WebConstant; import com.ccsens.util.WebConstant;
import lombok.Data; import lombok.Data;
import lombok.Getter;
import lombok.Setter;
@Data @Data
public class AuthMessageDto extends BaseMessageDto { public class AuthMessageDto extends BaseMessageDto {
@lombok.Data @lombok.Data
public static class Data{ public static class Data{
//游戏id
private String id; private String id;
private String userId; private String userId;
private String channelId; private String channelId;

17
game/src/main/java/com/ccsens/game/service/ScreenService.java

@ -1180,7 +1180,7 @@ public class ScreenService implements IScreenService {
} }
// //再玩一次 // //再玩一次
// if (start.getStartStatus() != null && start.getStartStatus().byteValue() == GameConstant.GAME_RESTART_STATUS) { // if (start.getStartStatus() != null && start.getStartStatus().byteValue() == GameConstant.GAME_RESTART_STATUS) {
// //再玩一次,设置参的用户为无效用户 // //再玩一次,设置参的用户为无效用户
// GameUserJoin delUserJoin = new GameUserJoin(); // GameUserJoin delUserJoin = new GameUserJoin();
// delUserJoin.setRecStatus(WebConstant.REC_STATUS.Deleted.value); // delUserJoin.setRecStatus(WebConstant.REC_STATUS.Deleted.value);
// GameUserJoinExample example = new GameUserJoinExample(); // GameUserJoinExample example = new GameUserJoinExample();
@ -1468,6 +1468,7 @@ public class ScreenService implements IScreenService {
gameRecord.setId(snowflake.nextId()); gameRecord.setId(snowflake.nextId());
gameRecord.setUserPayId(gameUserPay.getId()); gameRecord.setUserPayId(gameUserPay.getId());
gameRecord.setGameGroup((byte) 0); gameRecord.setGameGroup((byte) 0);
// gameRecord.setGameStatus((byte) 1);
//添加路径 //添加路径
String gameUrl = PropUtil.notGatewayUrl + WebConstant.TEST_URL_GAME_SQ; String gameUrl = PropUtil.notGatewayUrl + WebConstant.TEST_URL_GAME_SQ;
switch (gameType.getCode()){ switch (gameType.getCode()){
@ -1495,15 +1496,11 @@ public class ScreenService implements IScreenService {
gameGroupBlue.setCode(GameConstant.SECOND_GROUP); gameGroupBlue.setCode(GameConstant.SECOND_GROUP);
gameGroupDao.insertSelective(gameGroupBlue); gameGroupDao.insertSelective(gameGroupBlue);
} }
ScreenDto.Start start = new ScreenDto.Start();
//5、查询该游戏的规则 start.setLocalTime(System.currentTimeMillis());
List<String> ruleList = getGameActivityRule(gameType.getId()); start.setMemberRecord(gameRecord.getId());
//6、返回 start.setStartStatus((byte) 1);
ScreenVo.UrlVo urlVo = new ScreenVo.UrlVo(); startGame(start);
urlVo.setId(gameRecord.getId());
urlVo.setUrl(gameRecord.getUrl());
urlVo.setRuleList(ruleList);
return gameRecord.getId(); return gameRecord.getId();
} }
} }

4
game/src/main/resources/application.yml

@ -1,4 +1,4 @@
spring: spring:
profiles: profiles:
active: prod active: dev
include: common, util-prod include: common, util-dev

2
tall/src/main/java/com/ccsens/tall/service/SysDomainService.java

@ -63,7 +63,7 @@ public class SysDomainService implements ISysDomainService{
if(ObjectUtil.isNull(domainInfo)){ if(ObjectUtil.isNull(domainInfo)){
domainInfo = new DomainVo.DomainInfo(); domainInfo = new DomainVo.DomainInfo();
domainInfo.setDomainName(PropUtil.notGatewayUrl + "gateway/tall/v1.0"); domainInfo.setDomainName(PropUtil.notGatewayUrl + "gateway/tall/v1.0");
domainInfo.setLogo("https://test.tall.wiki/staticrec/logo.png"); domainInfo.setLogo(PropUtil.notGatewayUrl+"staticrec/logo.png");
domainInfo.setCompanyName("传控电子科技有限公司"); domainInfo.setCompanyName("传控电子科技有限公司");
domainInfo.setSystemName("TALL时物链条"); domainInfo.setSystemName("TALL时物链条");
domainInfo.setBackdropUrl(""); domainInfo.setBackdropUrl("");

21
tall/src/main/java/com/ccsens/tall/service/UserService.java

@ -362,8 +362,7 @@ public class UserService implements IUserService {
SysAuth theAuth; SysAuth theAuth;
SysAuthExample authExample = new SysAuthExample(); SysAuthExample authExample = new SysAuthExample();
authExample.createCriteria() authExample.createCriteria()
.andIdentifierEqualTo(username) .andIdentifyTypeEqualTo((byte) WebConstant.IDENTIFY_TYPE.Account.value).andIdentifierEqualTo(username);
.andIdentifyTypeEqualTo((byte) WebConstant.IDENTIFY_TYPE.Account.value);
authList = authDao.selectByExample(authExample); authList = authDao.selectByExample(authExample);
if (CollectionUtil.isNotEmpty(authList)) { if (CollectionUtil.isNotEmpty(authList)) {
theAuth = authList.get(0); theAuth = authList.get(0);
@ -427,7 +426,7 @@ public class UserService implements IUserService {
} }
SysAuthExample authExample = new SysAuthExample(); SysAuthExample authExample = new SysAuthExample();
authExample.createCriteria().andIdentifierEqualTo(openId).andIdentifyTypeEqualTo(identifyType); authExample.createCriteria().andIdentifyTypeEqualTo(identifyType).andIdentifierEqualTo(openId);
authList = authDao.selectByExample(authExample); authList = authDao.selectByExample(authExample);
long end1 = System.currentTimeMillis(); long end1 = System.currentTimeMillis();
log.info("查auth表耗时:{}",end1 - start); log.info("查auth表耗时:{}",end1 - start);
@ -698,8 +697,7 @@ public class UserService implements IUserService {
//检查手机号是否已被注册 //检查手机号是否已被注册
SysAuthExample authExample = new SysAuthExample(); SysAuthExample authExample = new SysAuthExample();
authExample.createCriteria() authExample.createCriteria()
.andIdentifierEqualTo(userSignup.getPhone()) .andIdentifyTypeEqualTo((byte) WebConstant.IDENTIFY_TYPE.Phone.value).andIdentifierEqualTo(userSignup.getPhone());
.andIdentifyTypeEqualTo((byte) WebConstant.IDENTIFY_TYPE.Phone.value);
List<SysAuth> authList = authDao.selectByExample(authExample); List<SysAuth> authList = authDao.selectByExample(authExample);
if (CollectionUtil.isEmpty(authList)) { if (CollectionUtil.isEmpty(authList)) {
//验证账号是否被注册 //验证账号是否被注册
@ -1036,8 +1034,8 @@ public class UserService implements IUserService {
public Long selectUserIdByPhone(String phoneCell) { public Long selectUserIdByPhone(String phoneCell) {
Long userId = null; Long userId = null;
SysAuthExample authExample = new SysAuthExample(); SysAuthExample authExample = new SysAuthExample();
authExample.createCriteria().andIdentifierEqualTo(phoneCell) authExample.createCriteria()
.andIdentifyTypeEqualTo((byte) WebConstant.IDENTIFY_TYPE.Phone.value); .andIdentifyTypeEqualTo((byte) WebConstant.IDENTIFY_TYPE.Phone.value).andIdentifierEqualTo(phoneCell);
List<SysAuth> authList = authDao.selectByExample(authExample); List<SysAuth> authList = authDao.selectByExample(authExample);
if (CollectionUtil.isNotEmpty(authList)) { if (CollectionUtil.isNotEmpty(authList)) {
userId = authList.get(0).getUserId(); userId = authList.get(0).getUserId();
@ -1053,8 +1051,8 @@ public class UserService implements IUserService {
String account = null; String account = null;
if (StrUtil.isNotEmpty(phone)) { if (StrUtil.isNotEmpty(phone)) {
SysAuthExample authExample = new SysAuthExample(); SysAuthExample authExample = new SysAuthExample();
authExample.createCriteria().andIdentifierEqualTo(phone) authExample.createCriteria()
.andIdentifyTypeEqualTo((byte) WebConstant.IDENTIFY_TYPE.Phone.value); .andIdentifyTypeEqualTo((byte) WebConstant.IDENTIFY_TYPE.Phone.value).andIdentifierEqualTo(phone);
List<SysAuth> authList = authDao.selectByExample(authExample); List<SysAuth> authList = authDao.selectByExample(authExample);
if (CollectionUtil.isNotEmpty(authList)) { if (CollectionUtil.isNotEmpty(authList)) {
SysAuthExample authExample1 = new SysAuthExample(); SysAuthExample authExample1 = new SysAuthExample();
@ -1151,8 +1149,7 @@ public class UserService implements IUserService {
//检查手机号是否已被注册 //检查手机号是否已被注册
SysAuthExample authExample = new SysAuthExample(); SysAuthExample authExample = new SysAuthExample();
authExample.createCriteria() authExample.createCriteria()
.andIdentifierEqualTo(signup.getPhone()) .andIdentifyTypeEqualTo((byte) WebConstant.IDENTIFY_TYPE.Phone.value).andIdentifierEqualTo(signup.getPhone());
.andIdentifyTypeEqualTo((byte) WebConstant.IDENTIFY_TYPE.Phone.value);
List<SysAuth> authList = authDao.selectByExample(authExample); List<SysAuth> authList = authDao.selectByExample(authExample);
if (CollectionUtil.isNotEmpty(authList)) { if (CollectionUtil.isNotEmpty(authList)) {
log.info("用户已存在,直接返回user"); log.info("用户已存在,直接返回user");
@ -1567,7 +1564,7 @@ public class UserService implements IUserService {
if(StrUtil.isNotEmpty(userSignup.getAccount())){ if(StrUtil.isNotEmpty(userSignup.getAccount())){
accountName = userSignup.getAccount(); accountName = userSignup.getAccount();
SysAuthExample sysAuthExample = new SysAuthExample(); SysAuthExample sysAuthExample = new SysAuthExample();
sysAuthExample.createCriteria().andIdentifierEqualTo(accountName).andIdentifyTypeEqualTo((byte) WebConstant.IDENTIFY_TYPE.Account.value); sysAuthExample.createCriteria().andIdentifyTypeEqualTo((byte) WebConstant.IDENTIFY_TYPE.Account.value).andIdentifierEqualTo(accountName);
List<SysAuth> authList = authDao.selectByExample(sysAuthExample); List<SysAuth> authList = authDao.selectByExample(sysAuthExample);
if(CollectionUtil.isNotEmpty(authList)){ if(CollectionUtil.isNotEmpty(authList)){
throw new BaseException(CodeEnum.ALREADY_EXIST_ACCOUNT); throw new BaseException(CodeEnum.ALREADY_EXIST_ACCOUNT);

Loading…
Cancel
Save