Lihong@123456 5 years ago
parent
commit
0f9b7fc708
  1. 4
      cloudutil/src/main/java/com/ccsens/cloudutil/aspect/MustLoginAspect.java
  2. 1
      cloudutil/src/main/java/com/ccsens/cloudutil/ribbon/RibbonClientConfig.java
  3. 2
      cloudutil/src/main/java/com/ccsens/cloudutil/ribbon/RibbonConfiguration.java
  4. 28
      cloudutil/src/main/java/com/ccsens/cloudutil/ribbon/WpsBalanceRule.java
  5. 69
      cloudutil/src/main/resources/application-util-prodsd.yml
  6. 16
      game/src/main/java/com/ccsens/game/api/DebugController.java
  7. 8
      game/src/main/java/com/ccsens/game/bean/vo/ScreenVo.java
  8. 49
      game/src/main/java/com/ccsens/game/netty/ChannelManager.java
  9. 9
      game/src/main/java/com/ccsens/game/service/RabbitMQListener.java
  10. 303
      game/src/main/java/com/ccsens/game/service/ScreenService.java
  11. 7
      game/src/main/java/com/ccsens/game/util/GameConstant.java
  12. 2
      game/src/main/java/com/ccsens/game/util/SendMsg.java
  13. 6
      game/src/main/resources/application-dev.yml
  14. 10
      game/src/main/resources/application-prod.yml
  15. 44
      game/src/main/resources/application-prodsd.yml
  16. 15
      game/src/main/resources/application-test.yml
  17. 33
      game/src/main/resources/druid-prodsd.yml
  18. 5
      game/src/main/resources/druid-test.yml
  19. 3
      health/src/main/resources/application-prod.yml
  20. 4
      health/src/main/resources/application.yml
  21. 10
      ht/src/main/resources/application-prod.yml
  22. 1
      mt/src/main/java/com/ccsens/mt/api/CompeteCompanyController.java
  23. 4
      mt/src/main/java/com/ccsens/mt/api/CompeteScoreController.java
  24. 14
      mt/src/main/java/com/ccsens/mt/api/CompeteVideoController.java
  25. 21
      mt/src/main/java/com/ccsens/mt/api/DebugController.java
  26. 10
      mt/src/main/java/com/ccsens/mt/api/KCPlayerController.java
  27. 14
      mt/src/main/java/com/ccsens/mt/bean/dto/VideoDto.java
  28. 12
      mt/src/main/java/com/ccsens/mt/bean/po/CompeteProjectConfig.java
  29. 48
      mt/src/main/java/com/ccsens/mt/bean/po/CompeteProjectConfigExample.java
  30. 128
      mt/src/main/java/com/ccsens/mt/bean/po/CompeteSpeedVideo.java
  31. 841
      mt/src/main/java/com/ccsens/mt/bean/po/CompeteSpeedVideoExample.java
  32. 22
      mt/src/main/java/com/ccsens/mt/bean/po/CompeteVideo.java
  33. 140
      mt/src/main/java/com/ccsens/mt/bean/po/CompeteVideoExample.java
  34. 8
      mt/src/main/java/com/ccsens/mt/bean/vo/CompeteExcelVo.java
  35. 2
      mt/src/main/java/com/ccsens/mt/bean/vo/ScoreVo.java
  36. 4
      mt/src/main/java/com/ccsens/mt/bean/vo/VideoProjectVo.java
  37. 23
      mt/src/main/java/com/ccsens/mt/persist/dao/CompeteScoreDao.java
  38. 30
      mt/src/main/java/com/ccsens/mt/persist/mapper/CompeteSpeedVideoMapper.java
  39. 2
      mt/src/main/java/com/ccsens/mt/service/CompeteScoreService.java
  40. 51
      mt/src/main/java/com/ccsens/mt/service/CompeteService.java
  41. 45
      mt/src/main/java/com/ccsens/mt/service/CompeteVedioService.java
  42. 18
      mt/src/main/java/com/ccsens/mt/service/ExcelService.java
  43. 2
      mt/src/main/java/com/ccsens/mt/service/ICompeteVedioService.java
  44. 3
      mt/src/main/java/com/ccsens/mt/service/IKCPlayerService.java
  45. 72
      mt/src/main/java/com/ccsens/mt/service/KCPlayerService.java
  46. 12
      mt/src/main/java/com/ccsens/mt/util/Constant.java
  47. 3
      mt/src/main/resources/application-prod.yml
  48. 4
      mt/src/main/resources/application.yml
  49. 1
      mt/src/main/resources/druid-dev.yml
  50. 2
      mt/src/main/resources/druid-prod.yml
  51. 1
      mt/src/main/resources/mapper_dao/CompeteProjectConfigDao.xml
  52. 1103
      mt/src/main/resources/mapper_dao/CompeteScoreDao.xml
  53. 7
      mt/src/main/resources/mapper_dao/CompeteVideoDao.xml
  54. 28
      mt/src/main/resources/mapper_raw/CompeteProjectConfigMapper.xml
  55. 291
      mt/src/main/resources/mapper_raw/CompeteSpeedVideoMapper.xml
  56. 42
      mt/src/main/resources/mapper_raw/CompeteVideoMapper.xml
  57. 2
      pom.xml
  58. 33
      signin/.gitignore
  59. 322
      signin/mvnw
  60. 182
      signin/mvnw.cmd
  61. 69
      signin/pom.xml
  62. 24
      signin/src/main/java/com/ccsens/signin/SigninApplication.java
  63. 29
      signin/src/main/java/com/ccsens/signin/api/DebugController.java
  64. 478
      signin/src/main/java/com/ccsens/signin/api/UserController.java
  65. 89
      signin/src/main/java/com/ccsens/signin/api/UserInfoController.java
  66. 214
      signin/src/main/java/com/ccsens/signin/bean/dto/UserDto.java
  67. 128
      signin/src/main/java/com/ccsens/signin/bean/po/SysAuth.java
  68. 831
      signin/src/main/java/com/ccsens/signin/bean/po/SysAuthExample.java
  69. 205
      signin/src/main/java/com/ccsens/signin/bean/po/SysUser.java
  70. 1311
      signin/src/main/java/com/ccsens/signin/bean/po/SysUserExample.java
  71. 150
      signin/src/main/java/com/ccsens/signin/bean/po/SysUserInfo.java
  72. 991
      signin/src/main/java/com/ccsens/signin/bean/po/SysUserInfoExample.java
  73. 165
      signin/src/main/java/com/ccsens/signin/bean/vo/UserVo.java
  74. 31
      signin/src/main/java/com/ccsens/signin/config/BeanConfig.java
  75. 169
      signin/src/main/java/com/ccsens/signin/config/SpringConfig.java
  76. 56
      signin/src/main/java/com/ccsens/signin/config/SwaggerConfigure.java
  77. 10
      signin/src/main/java/com/ccsens/signin/exception/GetCurrentPartiException.java
  78. 11
      signin/src/main/java/com/ccsens/signin/exception/GetCurrentUserException.java
  79. 10
      signin/src/main/java/com/ccsens/signin/exception/GetTaskException.java
  80. 10
      signin/src/main/java/com/ccsens/signin/exception/PartiLoginException.java
  81. 17
      signin/src/main/java/com/ccsens/signin/exception/SmsException.java
  82. 10
      signin/src/main/java/com/ccsens/signin/exception/TaskValidateException.java
  83. 10
      signin/src/main/java/com/ccsens/signin/exception/UnAuthenticationException.java
  84. 10
      signin/src/main/java/com/ccsens/signin/exception/UnAuthorizationException.java
  85. 10
      signin/src/main/java/com/ccsens/signin/exception/UserLoginException.java
  86. 159
      signin/src/main/java/com/ccsens/signin/intercept/MybatisInterceptor.java
  87. 18
      signin/src/main/java/com/ccsens/signin/persist/dao/SysAuthDao.java
  88. 65
      signin/src/main/java/com/ccsens/signin/persist/dao/SysUserDao.java
  89. 8
      signin/src/main/java/com/ccsens/signin/persist/dao/SysUserInfoDao.java
  90. 30
      signin/src/main/java/com/ccsens/signin/persist/mapper/SysAuthMapper.java
  91. 30
      signin/src/main/java/com/ccsens/signin/persist/mapper/SysUserInfoMapper.java
  92. 30
      signin/src/main/java/com/ccsens/signin/persist/mapper/SysUserMapper.java
  93. 48
      signin/src/main/java/com/ccsens/signin/service/IUserInfoService.java
  94. 110
      signin/src/main/java/com/ccsens/signin/service/IUserService.java
  95. 258
      signin/src/main/java/com/ccsens/signin/service/UserInfoService.java
  96. 1621
      signin/src/main/java/com/ccsens/signin/service/UserService.java
  97. 55
      signin/src/main/java/com/ccsens/signin/util/TallConstant.java
  98. 168
      signin/src/main/java/com/ccsens/signin/util/WxTemplateUtil.java
  99. 28
      signin/src/main/resources/application-common.yml
  100. 41
      signin/src/main/resources/application-dev.yml

4
cloudutil/src/main/java/com/ccsens/cloudutil/aspect/MustLoginAspect.java

@ -48,7 +48,9 @@ public class MustLoginAspect {
RequestContextHolder.getRequestAttributes()).getRequest();
final String authHeader = request.getHeader(WebConstant.HEADER_KEY_TOKEN);
// if(StrUtil.isEmpty(authHeader)){
// return JsonResponse.newInstance().ok(CodeEnum.NOT_LOGIN);
// }
Object[] args = pjp.getArgs();
QueryDto dto = args == null || args.length < 1 ? null : (QueryDto) args[0];

1
cloudutil/src/main/java/com/ccsens/cloudutil/ribbon/RibbonClientConfig.java

@ -1,6 +1,7 @@
package com.ccsens.cloudutil.ribbon;
import org.springframework.cloud.netflix.ribbon.RibbonClient;
import org.springframework.cloud.netflix.ribbon.RibbonClients;
import org.springframework.context.annotation.Configuration;
/**

2
cloudutil/src/main/java/com/ccsens/cloudutil/ribbon/RibbonConfiguration.java

@ -3,6 +3,8 @@ package com.ccsens.cloudutil.ribbon;
import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.RoundRobinRule;
import com.netflix.loadbalancer.WeightedResponseTimeRule;
import org.springframework.cloud.netflix.ribbon.RibbonClient;
import org.springframework.cloud.netflix.ribbon.RibbonClients;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

28
cloudutil/src/main/java/com/ccsens/cloudutil/ribbon/WpsBalanceRule.java

@ -0,0 +1,28 @@
//package com.ccsens.cloudutil.ribbon;
//
//import com.netflix.client.config.IClientConfig;
//import com.netflix.loadbalancer.AbstractLoadBalancerRule;
//import com.netflix.loadbalancer.ILoadBalancer;
//import com.netflix.loadbalancer.Server;
//import org.springframework.context.annotation.Primary;
//
////@Primary
//public class WpsBalanceRule extends AbstractLoadBalancerRule {
//
// @Override
// public void initWithNiwsConfig(IClientConfig clientConfig) {
//
// }
//
// @Override
// public Server choose(Object key) {
// return choose(getLoadBalancer(), key);
// }
//
// private Server choose(ILoadBalancer loadBalancer, Object key) {
// System.out.println(key);
// return null;
// }
//
//
//}

69
cloudutil/src/main/resources/application-util-prodsd.yml

@ -0,0 +1,69 @@
#服务端点暴露
management:
endpoints:
web:
exposure:
# 暴露xxx端点,如需暴露多个,用,分隔;如需暴露所有端点,用'*'
include: auditevents,caches,conditions,flyway,health,heapdump,httptrace,info,integrationgraph,jolokia,logfile,loggers,liquibase,metrics,mappings,prometheus,scheduledtasks,sessions,shutdown,threaddump,hystrix.stream
# # 不暴露哪些端点
exclude: env,beans,configprops
endpoint:
health:
# 是否展示健康检查详情
show-details: always
health:
redis:
enabled: false
#eureka注册
eureka:
client:
service-url:
# 指定eureka server通信地址,注意/eureka/小尾巴不能少
#defaultZone: http://admin:admin@peer1:8761/eureka/,http://admin:admin@peer2:8762/eureka/
# defaultZone: http://admin:admin@81.70.54.64:7010/eureka/
defaultZone: http://admin:admin@192.144.182.42:7010/eureka/
instance:
# 是否注册IP到eureka server,如不指定或设为false,那就回注册主机名到eureka server
prefer-ip-address: true
metadata-map:
management:
context-path: ${server.servlet.context-path:}/actuator
home-page-url-path: ${server.servlet.context-path:}/
status-page-url-path: ${server.servlet.context-path:}/actuator/info
health-check-url-path: ${server.servlet.context-path:}/actuator/health
feign:
client:
config:
default:
connectTime: 5000
readTimeout: 5000
# NONE【性能最佳,适用于生产】:不记录任何日志(默认值)。
# BASIC【适用于生产环境追踪问题】:仅记录请求方法、URL、响应状态代码以及执行时间。
# HEADERS:记录BASIC级别的基础上,记录请求和响应的header。
# FULL【比较适用于开发及测试环境定位问题】:记录请求和响应的header、body和元数据
loggerLevel: basic
hystrix:
enabled: true
hystrix:
threadpool:
default:
coreSize: 200 #并发执行的最大线程数,默认10
maxQueueSize: 1000 #BlockingQueue的最大队列数,默认值-1
queueSizeRejectionThreshold: 800 #即使maxQueueSize没有达到,达到queueSizeRejectionThreshold该值后,请求也会被拒绝,默认值5
# sleuth
logging:
level:
root: info
org.springframework.cloud.sleuth: DEBUG
spring:
# zipkin:
# base-url: http://140.143.228.3:9411
# sleuth:
# sampler:
# # 采样率,模式0.1,也就是10%,为了便于观察效果,改为1.0,也就是100%。生产环境建议保持默认。
# probability: 0.1
cloud:
inetutils:
ignored-interfaces: ['VMware.*']

16
game/src/main/java/com/ccsens/game/api/DebugController.java

@ -1,9 +1,16 @@
package com.ccsens.game.api;
import com.ccsens.util.JacksonUtil;
import com.ccsens.util.JsonResponse;
import com.ccsens.util.bean.message.common.InMessage;
import com.ccsens.util.bean.message.common.MessageConstant;
import com.ccsens.util.bean.message.common.ServerMessage;
import com.ccsens.util.config.RabbitMQConfig;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
@ -14,6 +21,8 @@ import javax.servlet.http.HttpServletRequest;
@RestController
@RequestMapping("/debug")
public class DebugController {
@Autowired
private AmqpTemplate rabbitTemplate;
@ApiOperation(value = "/测试",notes = "")
@ApiImplicitParams({
@ -24,5 +33,12 @@ public class DebugController {
return JsonResponse.newInstance().ok("测试");
}
@ApiOperation(value = "/测试",notes = "")
@ApiImplicitParams({
})
@RequestMapping(value="/game",method = RequestMethod.GET,produces = {"application/json;charset=UTF-8"})
public JsonResponse testGameMq(HttpServletRequest request) throws Exception {
return JsonResponse.newInstance().ok("测试");
}
}

8
game/src/main/java/com/ccsens/game/bean/vo/ScreenVo.java

@ -115,6 +115,14 @@ public class ScreenVo {
private Byte gameStatus;
@ApiModelProperty("总人数")
private int totalMembers;
@ApiModelProperty("时长")
private int duration;
@ApiModelProperty("本地开始时间")
private Long startLocalTime;
@ApiModelProperty("本地结束时间")
private Long endLocalTime;
@ApiModelProperty("分组别赛时的计分规则,0总分 1平均分")
private int rankRule;
@ApiModelProperty("分组信息")
private List<GroupVo> groups ;

49
game/src/main/java/com/ccsens/game/netty/ChannelManager.java

@ -1,10 +1,15 @@
package com.ccsens.game.netty;
import cn.hutool.core.collection.CollectionUtil;
import com.ccsens.game.util.GameConstant;
import com.ccsens.util.RedisUtil;
import io.netty.channel.Channel;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
import javax.annotation.Resource;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
@ -12,8 +17,12 @@ import java.util.concurrent.ConcurrentHashMap;
* @author wei
*/
@Slf4j
@Component
public class ChannelManager {
private static ThreadLocal<Channel> threadLocal = new ThreadLocal<>();
static ChannelManager channelManager;
// @Resource
// private RedisUtil redisUtil;
/**
* UserId,WrappedChannel authed channels;
@ -28,6 +37,30 @@ public class ChannelManager {
authedChannels = new ConcurrentHashMap<>();
rawChannels = new ConcurrentHashMap<>();
}
// @PostConstruct
// public void init(){
// channelManager = this;
// channelManager.redisUtil = this.redisUtil;
// log.info("redis:{}",this.redisUtil);
// }
//
// private static Map<String,Set<WrapperedChannel>> getAuthedChannels(){
// String key = GameConstant.GAME_WS_AUTHED_CHANNELS;
// Map<?, ?> hmget = channelManager.redisUtil.hmget(key);
// if(CollectionUtil.isEmpty(hmget)){
// return new HashMap<>();
// }
// return (Map<String,Set<WrapperedChannel>>)hmget;
// }
//
// private static Map<Channel,WrapperedChannel> getRawChannels(){
// String key = GameConstant.GAME_WS_RAW_CHANNELS;
// Map<?, ?> hmget = channelManager.redisUtil.hmget(key);
// if(CollectionUtil.isEmpty(hmget)){
// return new HashMap<>();
// }
// return (Map<Channel,WrapperedChannel>)hmget;
// }
/**
* 私有构造,不允许生成该类对象
@ -65,6 +98,7 @@ public class ChannelManager {
public static synchronized void addChannel(Channel channel,String serverType){
log.info("Invoke addChannel({},{})",channel,serverType);
if(null != channel) {
// channelManager.redisUtil.hset(GameConstant.GAME_WS_RAW_CHANNELS,channel, new WrapperedChannel(channel, serverType),GameConstant.WS_CHANNELS);
rawChannels.put(channel, new WrapperedChannel(channel, serverType));
log.info("Add a new channel: {},{}",channel.id().asLongText(),serverType);
}else{
@ -85,9 +119,15 @@ public class ChannelManager {
minor = minor != null ? minor : 0;
WrapperedChannel wrapperedChannel = rawChannels.get(channel);
// WrapperedChannel wrapperedChannel = getRawChannels().get(channel);
if(wrapperedChannel != null){
wrapperedChannel.whenAuthed(userId,major,minor);
Set<WrapperedChannel> authedWchannelSet = authedChannels.computeIfAbsent(userId, k -> new HashSet<>());
// Set<WrapperedChannel> wrapperedChannels = getAuthedChannels().get(userId);
// if(CollectionUtil.isEmpty(wrapperedChannels)){
// wrapperedChannels = new HashSet<>();
// }
// Set<WrapperedChannel> authedWchannelSet = wrapperedChannels;
authedWchannelSet.add(wrapperedChannel);
log.info("Authed channel {} with user {}", channel.id().asLongText(), userId);
}else{
@ -112,6 +152,11 @@ public class ChannelManager {
if(wrapperedChannel != null){
wrapperedChannel.whenAuthed(userId,major,minor,recordId);
Set<WrapperedChannel> authedWchannelSet = authedChannels.computeIfAbsent(userId, k -> new HashSet<>());
// Set<WrapperedChannel> wrapperedChannels = getAuthedChannels().get(userId);
// if(CollectionUtil.isEmpty(wrapperedChannels)){
// wrapperedChannels = new HashSet<>();
// }
// Set<WrapperedChannel> authedWchannelSet = wrapperedChannels;
authedWchannelSet.add(wrapperedChannel);
log.info("Authed channel {} with user {}", channel.id().asLongText(), userId);
}else{
@ -129,6 +174,7 @@ public class ChannelManager {
if(wrapperedChannel != null){
//从rawChannels集合中删除
rawChannels.remove(channel);
// channelManager.redisUtil.hdel(GameConstant.GAME_WS_RAW_CHANNELS,channel);
log.info("Remove a channel from rawChannels: {}",channel.id().asLongText());
if(wrapperedChannel.isAuthed()){
Set<WrapperedChannel> authedChannelSet = authedChannels.get(wrapperedChannel.getUserId());
@ -140,6 +186,7 @@ public class ChannelManager {
//从authedChannel中删除,此处不用else,因为if中语句执行完毕之后,authedChannelSet也可能变成空集合
if(CollectionUtil.isEmpty(authedChannelSet)){
authedChannels.remove(wrapperedChannel.getUserId());
// channelManager.redisUtil.hdel(GameConstant.GAME_WS_AUTHED_CHANNELS,wrapperedChannel.getUserId());
log.info("Remove a user from authedChannels: {}",wrapperedChannel.getUserId());
}
}
@ -163,11 +210,13 @@ public class ChannelManager {
for(WrapperedChannel wChannel : wChannelSet){
//从rawChannel中依次删除
rawChannels.remove(wChannel.getChannel());
// channelManager.redisUtil.hdel(GameConstant.GAME_WS_RAW_CHANNELS,wChannel.getChannel());
log.info("Remove a channel from rawChannels: {}",wChannel.getChannel().id().asLongText());
}
}
//从authedChannel中删除
authedChannels.remove(userId);
// channelManager.redisUtil.hdel(GameConstant.GAME_WS_AUTHED_CHANNELS,userId);
log.info("Remove a user from authedChannels: {}",userId);
}

9
game/src/main/java/com/ccsens/game/service/RabbitMQListener.java

@ -1,11 +1,8 @@
package com.ccsens.game.service;
import cn.hutool.core.collection.CollectionUtil;
import com.ccsens.game.bean.dto.message.GameMessageWithChangeStatusOut;
import com.ccsens.util.JacksonUtil;
import com.ccsens.util.WebConstant;
import com.ccsens.util.config.RabbitMQConfig;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -15,12 +12,10 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.io.IOException;
import java.util.List;
import java.util.TreeMap;
@Slf4j
@Component
@RabbitListener(queues = RabbitMQConfig.GAME_STATUS)
@RabbitListener(queues = "${gameMqName:}")
public class RabbitMQListener {
private Logger logger = LoggerFactory.getLogger(RabbitMQListener.class);
@Autowired
@ -35,4 +30,6 @@ public class RabbitMQListener {
messageService.doChangeStatusMessage(JacksonUtil.jsonToBean(messageJson,
GameMessageWithChangeStatusOut.class, true));
}
}

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

@ -6,6 +6,7 @@ import cn.hutool.core.date.DateUtil;
import cn.hutool.core.lang.Snowflake;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.ccsens.cloudutil.bean.tall.dto.WpsDto;
@ -24,6 +25,7 @@ import com.ccsens.util.bean.dto.QueryDto;
import com.ccsens.util.exception.BaseException;
import com.ccsens.util.wx.WxXcxUtil;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.google.common.util.concurrent.AtomicDouble;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.xssf.usermodel.XSSFRow;
@ -39,6 +41,7 @@ import java.io.*;
import java.util.*;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.atomic.AtomicInteger;
/**
* @author zy
@ -131,7 +134,7 @@ public class ScreenService implements IScreenService {
gameRecord.setUrl(gameUrl + gameType.getScreenUrl() + "?id=" + gameRecord.getId());
// gameRecord.setQrCodeUrl(gameUrl + gameRecord.getId() + File.separator + gameType.getClientUrl());
// if("1".equalsIgnoreCase(PropUtil.openWx)){
if("1".equalsIgnoreCase(PropUtil.openWx)){
//生成二维码
String fileName = "/gameQrCode/" + DateUtil.today() + "/" + System.currentTimeMillis() + ".png";
String path = WebConstant.UPLOAD_PATH_BASE + fileName;
@ -141,11 +144,11 @@ public class ScreenService implements IScreenService {
gameRecord.setQrCodeUrl(PropUtil.qrCode + fileName);
log.info("调用微信生成二维码");
// } else {
// log.info("测试环境,不调用生成二维码");
// //给一个默认测试的
// gameRecord.setQrCodeUrl(PropUtil.qrCode + "/gameQrCode/2020-08-19/1597822577181.png");
// }
} else {
log.info("测试环境,不调用生成二维码");
//给一个默认测试的
gameRecord.setQrCodeUrl(PropUtil.qrCode + "gameQrCode/2020-08-19/1597822577181.png");
}
//查找此任务下的游戏配置表
byte businessType = 8;
@ -154,18 +157,23 @@ public class ScreenService implements IScreenService {
}else if( GameConstant.GAME_TYPE_BH.equalsIgnoreCase(memberGame.getGameType())){
businessType = 10;
}
Map<String,Object> map = new HashMap<>();
map.put("businessId",memberGame.getTaskId());
map.put("businessType",businessType);
// String wpsFilePath = (String)RestTemplateUtil.getForEntity(PropUtil.gatewayUrl + PropUtil.getWpsFilePath, map, String.class);
String wpsFilePath = tallFeignClient.getWpsFilePath(memberGame.getTaskId(),businessType);
log.info("游戏配置表的路径:{}",wpsFilePath);
if(StrUtil.isNotEmpty(wpsFilePath)){
//添加配置信息
saveGameRecord(wpsFilePath,gameRecord);
}
//将游戏记录添加数据库
gameRecordDao.insertSelective(gameRecord);
//如果是分组游戏
log.info("添加游戏记录:{}",gameRecord);
//配置表不存在,而且游戏类型默认为分组游戏,默认添加两个分组
if(StrUtil.isEmpty(wpsFilePath) && gameType.getIsGroup() == 1){
if (gameType.getIsGroup() == 1) {
gameRecord.setGameGroup((byte) 1);
GameGroup gameGroupRed = new GameGroup();
gameGroupRed.setId(snowflake.nextId());
gameGroupRed.setRecordId(gameRecord.getId());
@ -179,8 +187,8 @@ public class ScreenService implements IScreenService {
gameGroupBlue.setCode(GameConstant.SECOND_GROUP);
gameGroupDao.insertSelective(gameGroupBlue);
}
}
//将游戏记录添加数据库
gameRecordDao.insertSelective(gameRecord);
//5、查询该游戏的规则
List<String> ruleList = getGameActivityRule(gameType.getId());
//6、返回
@ -207,11 +215,7 @@ public class ScreenService implements IScreenService {
}
}
chromeMessageDto.setReceivers(messageUserList);
//<<<<<<< HEAD
// log.info("给所有成员发送开始游戏的消息:{}",chromeMessageDto.toString());
// messageService.sendGameMessageWithGetUrl(chromeMessageDto);
//
//=======
messageService.sendGameMessageWithGetUrl(chromeMessageDto,userIdSet);
log.info("给所有成员发送消息:{}",chromeMessageDto);
log.info("返回游戏信息:{}",urlVo);
@ -226,6 +230,9 @@ public class ScreenService implements IScreenService {
*/
private void saveGameRecord(String wpsFilePath,GameRecord gameRecord) throws Exception{
InputStream is = new FileInputStream(new File(wpsFilePath));
//读取excel
XSSFWorkbook wb = new XSSFWorkbook(is);
if(ObjectUtil.isNull(wb)){ throw new BaseException(CodeEnum.NOT_CONFIG_OR_ERR); }
@ -348,118 +355,6 @@ public class ScreenService implements IScreenService {
return gameUserPay;
}
// @Override
// public ScreenVo.UrlVo getScreenUrl(QueryDto<ScreenDto.MemberGame> params) throws Exception {
// ScreenDto.MemberGame memberGame = params.getParam();
// //查找游戏
// GameType gameType = null;
// GameTypeExample gameTypeExample = new GameTypeExample();
// gameTypeExample.createCriteria().andCodeEqualTo(memberGame.getGameType());
// List<GameType> gameTypeList = gameTypeDao.selectByExample(gameTypeExample);
// if (CollectionUtil.isNotEmpty(gameTypeList)) {
// gameType = gameTypeList.get(0);
// }
// if (ObjectUtil.isNull(gameType)) {
// throw new BaseException(CodeEnum.NOT_GAME_TYPE);
// }
// //2、查找此用户购买的此游戏的信息,若没有则添加一条记录,默认已付款,结束时间为添加后的一个月,默认次数为10次
// GameUserPay gameUserPay = null;
// GameUserPayExample gameUserPayExample = new GameUserPayExample();
// gameUserPayExample.createCriteria().andUserIdEqualTo(params.getUserId()).andGameTypeIdEqualTo(gameType.getId());
// List<GameUserPay> gameUserPayList = gameUserPayDao.selectByExample(gameUserPayExample);
// if (CollectionUtil.isNotEmpty(gameUserPayList)) {
// gameUserPay = gameUserPayList.get(0);
// } else {
// gameUserPay = new GameUserPay();
// gameUserPay.setId(snowflake.nextId());
// gameUserPay.setUserId(params.getUserId());
// gameUserPay.setGameTypeId(gameType.getId());
// gameUserPay.setTotalCount(10);
// gameUserPay.setUsedCount(0);
// gameUserPay.setCreatedTime(System.currentTimeMillis());
// gameUserPay.setDueTime(gameUserPay.getCreatedTime() + (3600 * 24 * 30));
// gameUserPayDao.insertSelective(gameUserPay);
// }
// //查询该任务下的游戏记录信息
// if (ObjectUtil.isNotNull(memberGame.getTaskId())) {
// GameRecordExample recordExample = new GameRecordExample();
// recordExample.createCriteria().andTaskIdEqualTo(memberGame.getTaskId());
// recordExample.setOrderByClause("created_at DESC");
// List<GameRecord> recordList = gameRecordDao.selectByExample(recordExample);
// if (CollectionUtil.isNotEmpty(recordList)) {
// GameRecord record = recordList.get(0);
// if(record.getGameStatus() == GameConstant.GAME_PREPARATION ||
// record.getGameStatus() == GameConstant.GAME_PROCESSING){
// throw new BaseException(CodeEnum.GAME_NO_END);
// }
// if(record.getGameStatus() == GameConstant.GAME_PENDING){
// record.setGameStatus(GameConstant.GAME_COMPLETED);
// gameRecordDao.updateByPrimaryKeySelective(record);
// }
// }
// }
//
// //3、根据用户购买的记录,添加一场新的游戏记录
// GameRecord gameRecord = new GameRecord();
// gameRecord.setId(snowflake.nextId());
// gameRecord.setUserPayId(gameUserPay.getId());
// gameRecord.setTaskId(memberGame.getTaskId());
// //添加路径
// String gameUrl = WebConstant.TEST_URL_GAME_SQ;
// switch (gameType.getCode()){
// case GameConstant.GAME_TYPE_SQ: break;
// case GameConstant.GAME_TYPE_SP: gameUrl = WebConstant.TEST_URL_GAME_SP; break;
// case GameConstant.GAME_TYPE_BH: gameUrl = WebConstant.TEST_URL_GAME_BH; break;
// default:break;
// }
// gameRecord.setUrl(gameUrl + gameType.getScreenUrl() + "?id=" + gameRecord.getId());
// gameRecord.setQrCodeUrl(gameUrl + gameRecord.getId() + File.separator + gameType.getClientUrl());
// gameRecordDao.insertSelective(gameRecord);
// //4、 判断是否有分组,如果是分组游戏,添加两条分组信息
// if (gameType.getIsGroup() == 1) {
// GameGroup gameGroupRed = new GameGroup();
// gameGroupRed.setId(snowflake.nextId());
// gameGroupRed.setRecordId(gameRecord.getId());
// gameGroupRed.setName(memberGame.getFirstTeam());
// gameGroupRed.setCode(GameConstant.FIRST_GROUP);
// gameGroupDao.insertSelective(gameGroupRed);
// GameGroup gameGroupBlue = new GameGroup();
// gameGroupBlue.setId(snowflake.nextId());
// gameGroupBlue.setRecordId(gameRecord.getId());
// gameGroupBlue.setName(memberGame.getSecondTeam());
// gameGroupBlue.setCode(GameConstant.SECOND_GROUP);
// gameGroupDao.insertSelective(gameGroupBlue);
// }
//
// //5、查询该游戏的规则
// List<String> ruleList = getGameActivityRule(gameType.getId());
// //6、返回
// ScreenVo.UrlVo urlVo = new ScreenVo.UrlVo();
// urlVo.setId(gameRecord.getId());
// urlVo.setUrl(gameRecord.getUrl());
// urlVo.setRuleList(ruleList);
//
// //路径(添加项目id)
// String url = gameRecord.getUrl() + "&projectId=" + memberGame.getProjectId();
// //给所有人发送消息发送消息
// ChromeMessageDto chromeMessageDto = new ChromeMessageDto(url, gameRecord.getId(), memberGame.getProjectId(),gameType.getCode());
// BaseMessageDto.MessageUser messageUser = null;
// List<BaseMessageDto.MessageUser> messageUserList = new ArrayList<>();
// //获取项目下所有成员
// List<Long> memberIdList = tallFeignClient.getMemberIdListByProject(memberGame.getProjectId());
// if (CollectionUtil.isNotEmpty(memberIdList)) {
// for (Long memberId : memberIdList) {
// messageUser = new BaseMessageDto.MessageUser();
// messageUser.setUserId(memberId);
// messageUserList.add(messageUser);
// }
// }
// chromeMessageDto.setReceivers(messageUserList);
// messageService.sendGameMessageWithGetUrl(chromeMessageDto);
//
// return urlVo;
// }
/**
* 获取游戏基本信息
* @return 返回游戏基本信息
@ -554,8 +449,13 @@ public class ScreenService implements IScreenService {
//获取游戏的购买记录和类型
GameUserPay gameUserPay = gameUserPayDao.selectByPrimaryKey(gameRecord.getUserPayId());
GameType gameType = gameTypeDao.selectByPrimaryKey(gameUserPay.getGameTypeId());
gameStatusVo.setGameStatus(gameRecord.getGameStatus());
//返回开始结束时间和时长
gameStatusVo.setStartLocalTime(gameRecord.getStartTime() + gameRecord.getTimeDifference());
gameStatusVo.setEndLocalTime(gameRecord.getEndTime() + gameRecord.getTimeDifference());
gameStatusVo.setDuration(gameRecord.getDuration());
//返回计分规则
gameStatusVo.setRankRule(gameRecord.getRankRule());
//获取分组的信息
List<ScreenVo.GroupVo> groupVo = getGroupScore2(gameRecord);
gameStatusVo.setGroups(groupVo);
@ -705,9 +605,6 @@ public class ScreenService implements IScreenService {
/**
* 结束时查询胜利组的信息总分数总次数平均以及前十名
*/
private ScreenVo.CompletedData getCompletedDataByWin(GameRecord gameRecord, int totalMember) {
String groupKey = gameRecord.getId() + "_group";
Set<ZSetOperations.TypedTuple<Object>> typedTuples = redisUtil.zsRevGetWithScore(groupKey, 0, -1);
@ -715,31 +612,32 @@ public class ScreenService implements IScreenService {
ScreenVo.CompletedData completedData = new ScreenVo.CompletedData();
List<ScreenVo.CompletedData> list = new ArrayList<>();
Double maxSore = 0d;
String winGroupName = null;
if (CollectionUtil.isNotEmpty(typedTuples)) {
typedTuples.forEach(type -> {
for(ZSetOperations.TypedTuple<Object> type : typedTuples) {
completedData.setTotalScore(completedData.getTotalScore() + type.getScore().intValue());
GameGroup gameGroup = JSON.parseObject((String) type.getValue(), GameGroup.class);
if (gameRecord.getRankRule() == GameConstant.RANK_RULE_AVA) {
Object o = redisUtil.get(gameGroup.getId() + GameConstant.GAME_GROUP_NUM);
if (o == null || (Integer) o == 0) {
continue;
}
Integer a = (Integer) o;
if (maxSore <= type.getScore() / a) {
maxSore = type.getScore() / a;
winGroupName = gameGroup.getName();
}
} else {
if (maxSore <= type.getScore()) {
maxSore = type.getScore();
winGroupName = gameGroup.getName();
}
}
}
// ScreenVo.CompletedData completedData = new ScreenVo.CompletedData();
//// GameGroup gameGroup = JSON.parseObject((String) type.getValue(), GameGroup.class);
//// int score = type.getScore().intValue();
//// Object o = redisUtil.get(gameGroup.getId() + GameConstant.GAME_GROUP_NUM);
//// if (o==null) {
//// o = 0;
//// }
//// completedData.setTotalMember((int)o);
//// completedData.setTotalScore(score);
//// completedData.setAverageScore((int)o == 0 ? 0 : completedData.getTotalScore()/(int)o);
//// completedData.setTotalTimes(score/100);
//// completedData.setAverageTimes((int)o == 0 ? 0 : completedData.getTotalTimes()/(int)o);
//// completedData.setWinGroup(gameGroup.getName());
//// GameUserJoinExample joinExample = new GameUserJoinExample();
//// joinExample.createCriteria().andRecordIdEqualTo(gameRecord.getId()).andScoreGreaterThan(completedData.getAverageTimes());
//// long l = gameUserJoinDao.countByExample(joinExample);
//// completedData.setOver(totalMember == 0 ? 0 : (int) (l * 100 / totalMember));
//// list.add(completedData);
});
} else {
List<ScreenVo.GroupVo> groupVos = gameGroupDao.queryGroups(gameRecord.getId());
@ -748,70 +646,37 @@ public class ScreenService implements IScreenService {
return new ScreenVo.CompletedData();
}
groupVos.forEach(groupVo -> {
completedData.setTotalScore((groupVo.getScore() == null ? 0 : groupVo.getScore()) + completedData.getTotalScore());
// groupVo.setScore(groupVo.getTotalMembers() == null || groupVo.getTotalMembers() == 0 ? 0 : groupVo.getScore()/groupVo.getTotalMembers());
// ScreenVo.CompletedData completedData = new ScreenVo.CompletedData();
//
// int members = groupVo.getTotalMembers() == null ? 0 : groupVo.getTotalMembers();
// completedData.setTotalMember(members);
// completedData.setTotalScore(groupVo.getScore());
// completedData.setAverageScore(members == 0 ? 0 : completedData.getTotalScore()/members);
// completedData.setTotalTimes(groupVo.getScore() == null ? 0 : groupVo.getScore()/100);
// completedData.setAverageTimes(members == 0 ? 0 : completedData.getTotalTimes()/members);
// completedData.setWinGroup(groupVo.getGroupName());
// GameUserJoinExample joinExample = new GameUserJoinExample();
// joinExample.createCriteria().andRecordIdEqualTo(gameRecord.getId()).andScoreGreaterThan(completedData.getAverageTimes());
// long l = gameUserJoinDao.countByExample(joinExample);
// completedData.setOver(totalMember == 0 ? 0 : (int) (l * 100 /totalMember));
// list.add(completedData);
});
for(ScreenVo.GroupVo groupVo : groupVos) {
if (gameRecord.getRankRule() == GameConstant.RANK_RULE_AVA) {
if (groupVo.getTotalMembers() == null || groupVo.getTotalMembers() == 0) {
continue;
}
if (maxSore <= groupVo.getTotalScore() / groupVo.getTotalMembers()) {
maxSore = (double)groupVo.getTotalScore() / groupVo.getTotalMembers();
winGroupName = groupVo.getGroupName();
}
} else {
if (maxSore <= groupVo.getTotalScore()) {
maxSore = (double)groupVo.getTotalScore();
winGroupName = groupVo.getGroupName();
}
}
}
}
completedData.setAverageScore(totalMember == 0 ? 0 : completedData.getTotalScore() / totalMember);
completedData.setTotalTimes(completedData.getTotalScore() / 100);
completedData.setAverageTimes(totalMember == 0 ? 0 : completedData.getTotalTimes() / totalMember);
completedData.setTotalMember(totalMember);
completedData.setWinGroup(winGroupName);
GameUserJoinExample joinExample = new GameUserJoinExample();
joinExample.createCriteria().andRecordIdEqualTo(gameRecord.getId()).andScoreGreaterThan(completedData.getAverageScore());
long l = gameUserJoinDao.countByExample(joinExample);
completedData.setOver(totalMember == 0 ? 0 : (int) (l * 100 / totalMember));
// if (gameRecord.getRankRule() == GameConstant.RANK_RULE_AVA) {
// CollectionUtil.sort(list, (t1,t2)-> t2.getAverageScore() - t1.getAverageScore());
// }
//TODO 1、分别查询redis内每个队伍的总分,
//2、查询获胜队伍的信息
//3、redis内没有则查询数据库
//查询分组信息
// GameGroupExample gameGroupExample = new GameGroupExample();
// gameGroupExample.createCriteria().andRecordIdEqualTo(gameRecordId);
// List<GameGroup> gameGroupList = gameGroupDao.selectByExample(gameGroupExample);
// if (CollectionUtil.isNotEmpty(gameGroupList)) {
// List<GameUserJoin> userJoinList = null;
// //分别查找两个队伍的总分
// Map<String, Object> group1 = getGroupTotalScore(gameGroupList.get(0).getId());
// Map<String, Object> group2 = getGroupTotalScore(gameGroupList.get(1).getId());
// if (CollectionUtil.isNotEmpty(group1) && CollectionUtil.isNotEmpty(group2)) {
// int score1 = (int) group1.get("totalScore");
// int score2 = (int) group2.get("totalScore");
// if (score1 > score2) {
// userJoinList = (List<GameUserJoin>) group1.get("userJoinList");
// completedData.setTotalMember(userJoinList.size());
// completedData.setWinGroup(gameGroupList.get(0).getName());
// } else {
// userJoinList = (List<GameUserJoin>) group2.get("userJoinList");
// completedData.setTotalMember(userJoinList.size());
// completedData.setWinGroup(gameGroupList.get(1).getName());
// }
// }
// //5、获取获胜队伍的信息
// completedData = getCompletedData(userJoinList);
// }
//前十名
// ScreenVo.CompletedData completedData = list.get(0);
List<ScreenVo.TopUsers> top2 = getTopUsers(gameRecord.getId());
completedData.setMembers(top2);
return completedData;
@ -1012,8 +877,10 @@ public class ScreenService implements IScreenService {
//生成二维码
String fileName = "/gameQrCode/" + DateUtil.today() + "/" + System.currentTimeMillis() + ".png";
String path = WebConstant.UPLOAD_PATH_BASE + fileName;
WxXcxUtil.getWxCode(WebConstant.QRCODE_GAME
, "id=" + gameRecordNew.getId() + "&type=" + gameType.getCode(), null, path,gameType.getCode());
// WxXcxUtil.getWxCode(WebConstant.QRCODE_GAME, "id=" + gameRecordNew.getId() + "&type=" + gameType.getCode(), null, path,gameType.getCode());
WxXcxUtil.getWxCodeC(WebConstant.QRCODE_GAME+"?id=" + gameRecordNew.getId() + "&type=" + gameType.getCode(), path, gameType.getCode());
gameRecordNew.setQrCodeUrl(PropUtil.qrCode + fileName);
log.info("调用微信生成二维码");
} else {
@ -1410,12 +1277,19 @@ public class ScreenService implements IScreenService {
businessType = 10;
}
//查询该任务是否已有创建的游戏配置
List<String> wpsPath;
List<String> wpsPath = new ArrayList<>();
WpsDto.VisitWpsUrl visitWpsUrl = new WpsDto.VisitWpsUrl();
visitWpsUrl.setBusinessId(getConfig.getTaskId());
visitWpsUrl.setBusinessType(businessType);
visitWpsUrl.setUserId(params.getUserId());
wpsPath = tallFeignClient.queryVisitUrls(visitWpsUrl);
String result = RestTemplateUtil.postBody(PropUtil.gatewayUrl + PropUtil.queryVisitUrls, visitWpsUrl);
log.info("调用tall查看游戏已有配置表:{}",result);
if(StrUtil.isNotEmpty(result)){
List<String> list = JSONUtil.toList(JSONUtil.parseArray(result), String.class);
wpsPath.addAll(list);
}
// wpsPath = tallFeignClient.queryVisitUrls(visitWpsUrl);
log.info("是否已有创建的游戏配置:{}",wpsPath);
//有配置直接返回
if (CollectionUtil.isNotEmpty(wpsPath)) {
@ -1460,8 +1334,15 @@ public class ScreenService implements IScreenService {
business.setFileSize(tmpFile.length());
business.setOperation(WebConstant.Wps.USER_OPERATION_NEW);
business.setPrivilege(WebConstant.Wps.PROJECT_PRIVILEGE_WRITE);
tallFeignClient.saveWpsFile(business);
wpsPath = tallFeignClient.queryVisitUrls(visitWpsUrl);
RestTemplateUtil.postBody(PropUtil.gatewayUrl + PropUtil.saveWpsFile, business);
// tallFeignClient.saveWpsFile(business);
String result1 = RestTemplateUtil.postBody(PropUtil.gatewayUrl + PropUtil.queryVisitUrls, visitWpsUrl);
log.info("调用tall查看游戏已有配置表:{}",result1);
if(StrUtil.isNotEmpty(result1)){
List<String> list = JSONUtil.toList(JSONUtil.parseArray(result1), String.class);
wpsPath.addAll(list);
}
// wpsPath = tallFeignClient.queryVisitUrls(visitWpsUrl);
return wpsPath;
}

7
game/src/main/java/com/ccsens/game/util/GameConstant.java

@ -58,7 +58,12 @@ public class GameConstant {
public static final byte GAME_GROUP = 1;
/**游戏:单人*/
public static final byte GAME_SINGLE = 0;
/**ws已授权的连接*/
public static final String GAME_WS_AUTHED_CHANNELS = "authedChannels";
/**ws全部的连接*/
public static final String GAME_WS_RAW_CHANNELS = "rawChannels";
/**ws连接时间*/
public static final long WS_CHANNELS = 24 * 60 * 60L;
/**
* 生成游戏key
* @param recordId

2
game/src/main/java/com/ccsens/game/util/SendMsg.java

@ -69,7 +69,7 @@ public class SendMsg {
});
if (CollectionUtil.isNotEmpty(outs)) {
rabbitTemplate.convertAndSend(RabbitMQConfig.GAME_STATUS, JacksonUtil.beanToJson(outs));
rabbitTemplate.convertAndSend("fanoutExchange", "",JacksonUtil.beanToJson(outs));
log.info("发送成功:{}", JacksonUtil.beanToJson(outs));
}

6
game/src/main/resources/application-dev.yml

@ -8,7 +8,7 @@ spring:
datasource:
type: com.alibaba.druid.pool.DruidDataSource
rabbitmq:
host: 81.70.54.64
host: 192.168.0.99
password: 111111
port: 5672
username: admin
@ -29,6 +29,10 @@ swagger:
gatewayUrl: https://test.tall.wiki/gateway/
notGatewayUrl: https://test.tall.wiki/
gameMqName: game_status_dev
saveWpsFile: tall/v1.0/wps/saveWps
queryVisitUrls: tall/v1.0/wps/visitUrls
getWpsFilePath: tall/v1.0/v1/3rd/getFilePath
file:
qrCode: https://test.tall.wiki/gateway/tall/uploads/
openWX: 0

10
game/src/main/resources/application-prod.yml

@ -3,6 +3,9 @@ server:
servlet:
context-path:
spring:
snowflake:
datacenterId: 1
workerId: 1
application:
name: game
datasource:
@ -21,7 +24,8 @@ spring:
max-idle: 10
max-wait: -1ms
min-idle: 0
password: ''
# password: ''
password: 'areowqr!@43ef'
port: 6379
timeout: 1000ms
swagger:
@ -32,6 +36,10 @@ eureka:
gatewayUrl: https://www.tall.wiki/gateway/
notGatewayUrl: https://www.tall.wiki/
gameMqName: game_status_www
saveWpsFile: tall/v1.0/wps/saveWps
queryVisitUrls: tall/v1.0/wps/visitUrls
getWpsFilePath: tall/v1.0/v1/3rd/getFilePath
file:
qrCode: https://www.tall.wiki/gateway/tall/v1.0/uploads/
openWX: 1

44
game/src/main/resources/application-prodsd.yml

@ -0,0 +1,44 @@
server:
port: 7050
servlet:
context-path:
spring:
snowflake:
datacenterId: 2
workerId: 2
application:
name: game
datasource:
type: com.alibaba.druid.pool.DruidDataSource
rabbitmq:
host: www.tall.wiki
password: 111111
port: 5672
username: admin
redis:
database: 0
host: www.tall.wiki
jedis:
pool:
max-active: 200
max-idle: 10
max-wait: -1ms
min-idle: 0
password: 'areowqr!@43ef'
port: 6379
timeout: 1000ms
swagger:
enable: true
eureka:
instance:
ip-address: 81.70.54.64
gatewayUrl: https://www.tall.wiki/gateway/
notGatewayUrl: https://www.tall.wiki/
gameMqName: game_status_sd
saveWpsFile: tall/v1.0/wps/saveWps
queryVisitUrls: tall/v1.0/wps/visitUrls
getWpsFilePath: tall/v1.0/v1/3rd/getFilePath
file:
qrCode: https://www.tall.wiki/gateway/tall/v1.0/uploads/
openWX: 1

15
game/src/main/resources/application-test.yml

@ -8,17 +8,13 @@ spring:
datasource:
type: com.alibaba.druid.pool.DruidDataSource
rabbitmq:
<<<<<<< HEAD
host: 81.70.54.64
=======
host: 127.0.0.1
>>>>>>> pt
password: 111111
port: 5672
username: admin
redis:
database: 0
host: 192.168.0.99
host: 127.0.0.1
jedis:
pool:
max-active: 200
@ -32,14 +28,15 @@ swagger:
enable: true
eureka:
instance:
<<<<<<< HEAD
ip-address: 192.168.0.99
=======
ip-address: 192.168.0.99
gatewayUrl: https://test.tall.wiki/gateway/
notGatewayUrl: https://test.tall.wiki/
gameMqName: game_status_sd
saveWpsFile: tall/v1.0/wps/saveWps
queryVisitUrls: tall/v1.0/wps/visitUrls
getWpsFilePath: tall/v1.0/v1/3rd/getFilePath
file:
qrCode: https://test.tall.wiki/gateway/tall/v1.0/uploads/
openWX: 0
>>>>>>> pt

33
game/src/main/resources/druid-prodsd.yml

@ -0,0 +1,33 @@
spring:
datasource:
druid:
connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
driverClassName: com.mysql.cj.jdbc.Driver
dynamicUrl: jdbc:mysql://localhost:3306/${schema}
filterExclusions: '*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*'
filterName: druidFilter
filterProfileEnable: true
filterUrlPattern: /*
filters: stat,wall
initialSize: 5
maxActive: 20
maxPoolPreparedStatementPerConnectionSize: 20
maxWait: 60000
minEvictableIdleTimeMillis: 300000
minIdle: 5
password: 37080c1f223685592316b02dad8816c019290a476e54ebb638f9aa3ba8b6bdb9
poolPreparedStatements: true
servletLogSlowSql: true
servletLoginPassword: 111111
servletLoginUsername: druid
servletName: druidServlet
servletResetEnable: true
servletUrlMapping: /druid/*
testOnBorrow: false
testOnReturn: false
testWhileIdle: true
timeBetweenEvictionRunsMillis: 60000
url: jdbc:mysql://www.tall.wiki/game?useUnicode=true&characterEncoding=UTF-8
username: root
validationQuery: SELECT 1 FROM DUAL
env: CCSENS_GAME

5
game/src/main/resources/druid-test.yml

@ -27,10 +27,9 @@ spring:
testOnReturn: false
testWhileIdle: true
timeBetweenEvictionRunsMillis: 60000
<<<<<<< HEAD
# url: jdbc:mysql://test.tall.wiki/game?useUnicode=true&characterEncoding=UTF-8
=======
>>>>>>> pt
url: jdbc:mysql://49.233.89.188:3306/game?useUnicode=true&characterEncoding=UTF-8
username: root
validationQuery: SELECT 1 FROM DUAL

3
health/src/main/resources/application-prod.yml

@ -24,7 +24,8 @@ spring:
max-idle: 10
max-wait: -1ms
min-idle: 0
password: ''
# password: ''
password: 'areowqr!@43ef'
port: 6379
timeout: 1000ms
swagger:

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

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

10
ht/src/main/resources/application-prod.yml

@ -21,11 +21,8 @@ spring:
max-idle: 10
max-wait: -1ms
min-idle: 0
<<<<<<< HEAD
password: ''
=======
password: 'areowqr!@43ef'
>>>>>>> pt
port: 6379
timeout: 1000ms
@ -42,8 +39,5 @@ ht:
name: 认知功能评测云平台系统
eureka:
instance:
<<<<<<< HEAD
ip-address: 81.70.54.64
=======
ip-address: 71.80.54.64
>>>>>>> pt

1
mt/src/main/java/com/ccsens/mt/api/CompeteCompanyController.java

@ -3,7 +3,6 @@ package com.ccsens.mt.api;
import com.ccsens.cloudutil.annotation.MustLogin;
import com.ccsens.mt.bean.dto.CompeteDto;
import com.ccsens.mt.bean.vo.CompeteVo;
import com.ccsens.mt.service.CompeteService;
import com.ccsens.mt.service.ICompeteService;
import com.ccsens.util.JsonResponse;
import com.ccsens.util.bean.dto.QueryDto;

4
mt/src/main/java/com/ccsens/mt/api/CompeteScoreController.java

@ -84,7 +84,7 @@ public class CompeteScoreController {
}
@ApiOperation(value = "项目状态", notes = "")
@ApiOperation(value = "项目状态(手机用)", notes = "")
@RequestMapping(value = "/countScore", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse<CompeteVo.CountScore> countScore(@ApiParam @Validated @RequestBody QueryDto<CompeteDto.CompeteTime> params) {
log.info("查询比赛项目上的参赛选手列表:{}",params);
@ -93,7 +93,7 @@ public class CompeteScoreController {
}
@ApiOperation(value = "选手排名", notes = "多个信息表关联之后,利用分数排序")
@ApiOperation(value = "选手排名(手机用)", notes = "多个信息表关联之后,利用分数排序")
@RequestMapping(value = "/countScoreDetail", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse<ScoreVo.CompeteScore> countScoreDetail(@ApiParam @Validated @RequestBody QueryDto<CompeteDto.ProjectIdAndGroupId> params) {
log.info("查询比赛项目上的参赛选手列表:{}",params);

14
mt/src/main/java/com/ccsens/mt/api/CompeteVideoController.java

@ -66,11 +66,12 @@ public class CompeteVideoController {
return JsonResponse.newInstance().ok(peoSignStatus);
}
@MustLogin
@ApiOperation(value = "查看教练签到状态(签到用)", notes = "Mr.王---------查看教练的人的签到状态")
@ApiOperation(value = "查看裁判签到状态(签到用)", notes = "Mr.王---------查看教练的人的签到状态")
@RequestMapping(value = "/selectCoachStatus", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse<PageInfo<VideoProjectVo.CoachSignStatu>> selectCoachSignStatus(@ApiParam @Validated @RequestBody QueryDto<VideoDto.GetSignStatus> params) {
log.info("查看教练签到状态(签到用):{}",params);
log.info("查看裁判签到状态(签到用):{}",params);
PageInfo<VideoProjectVo.CoachSignStatu> coachSignStatus = iCompeteVedioService.selectCoachSignStatus(params);
log.info("查看裁判签到状态:{}",coachSignStatus);
return JsonResponse.newInstance().ok(coachSignStatus);
}
@ -92,6 +93,13 @@ public class CompeteVideoController {
return JsonResponse.newInstance().ok(list);
}
@MustLogin
@ApiOperation(value = "上传速度通级赛视频", notes = "zy--保存速度通级赛的视频,只存单位信息,选手名和视频地址")
@RequestMapping(value = "/save/speedVideo", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse<Boolean> saveSpeedVideo(@ApiParam @Validated @RequestBody QueryDto<VideoDto.SpeedVideoInfo> params) {
log.info("上传速度通级赛视频:{}",params);
iCompeteVedioService.saveSpeedVideo(params.getParam(),params.getUserId());
return JsonResponse.newInstance().ok(true);
}
}

21
mt/src/main/java/com/ccsens/mt/api/DebugController.java

@ -1,11 +1,15 @@
package com.ccsens.mt.api;
import com.ccsens.mt.bean.dto.LevelDto;
import com.ccsens.mt.bean.dto.VideoDto;
import com.ccsens.mt.bean.po.CompetePlayer;
import com.ccsens.mt.bean.po.CompeteVideo;
import com.ccsens.mt.bean.po.LevelUser;
import com.ccsens.mt.bean.vo.ProvinceCompeteVo;
import com.ccsens.mt.bean.vo.TableVo;
import com.ccsens.mt.bean.vo.VideoProjectVo;
import com.ccsens.mt.persist.dao.CompetePlayerDao;
import com.ccsens.mt.persist.dao.CompeteVideoDao;
import com.ccsens.mt.service.IExcelService;
import com.ccsens.mt.service.ILevelUpService;
import com.ccsens.util.JsonResponse;
@ -13,6 +17,7 @@ import com.ccsens.util.RedisUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.data.redis.core.ZSetOperations;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
@ -29,6 +34,7 @@ import java.util.Set;
@Api(tags = "DEBUG" , description = "DebugController | ")
@RestController
@RequestMapping("/debug")
@Slf4j
public class DebugController {
@Resource
private RedisUtil redisUtil;
@ -37,6 +43,8 @@ public class DebugController {
@Resource
private CompetePlayerDao competePlayerDao;
@Resource
private CompeteVideoDao competeVideoDao;
@Resource
private IExcelService excelService;
@ApiOperation(value = "/测试",notes = "")
@ -82,4 +90,17 @@ public class DebugController {
return JsonResponse.newInstance().ok(competeAllCount);
}
@ApiOperation(value = "/测试",notes = "")
@ApiImplicitParams({
})
@RequestMapping(value="/time",method = RequestMethod.GET,produces = {"application/json;charset=UTF-8"})
public JsonResponse debugTime() throws Exception {
VideoDto.GetSignStatus getSignStatus = new VideoDto.GetSignStatus();
getSignStatus.setId((long) 1);
List<VideoProjectVo.CoachSignStatu> coachSignStatus = competeVideoDao.selectCoachSignStatus(getSignStatus);
log.info("查看裁判签到状态:{}",coachSignStatus);
return JsonResponse.newInstance().ok(coachSignStatus);
}
}

10
mt/src/main/java/com/ccsens/mt/api/KCPlayerController.java

@ -1,25 +1,17 @@
package com.ccsens.mt.api;
import com.ccsens.cloudutil.annotation.MustLogin;
import com.ccsens.mt.bean.dto.CompeteDto;
import com.ccsens.mt.bean.vo.CompeteVo;
import com.alibaba.fastjson.JSONObject;
import com.ccsens.mt.service.IKCPlayerService;
import com.ccsens.util.JsonResponse;
import com.ccsens.util.bean.dto.QueryDto;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.json.JSONObject;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
@Slf4j
@Api(tags = "云点播", description = "")

14
mt/src/main/java/com/ccsens/mt/bean/dto/VideoDto.java

@ -8,7 +8,9 @@ import lombok.NonNull;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.util.Date;
import java.util.List;
/**
@ -115,4 +117,16 @@ public class VideoDto {
private int pageSize = 10;
}
@Data
@ApiModel("上传通级赛视频")
public static class SpeedVideoInfo{
@NotNull(message = "单位信息不正确")
@ApiModelProperty("单位id")
private Long companyId;
@ApiModelProperty("选手名称")
private String playerName;
@ApiModelProperty("签到时间")
private List<String> videoUrlList;
}
}

12
mt/src/main/java/com/ccsens/mt/bean/po/CompeteProjectConfig.java

@ -26,7 +26,7 @@ public class CompeteProjectConfig implements Serializable {
private Long videoEndTime;
private Byte restrict;
private Byte videoRestrict;
private static final long serialVersionUID = 1L;
@ -118,12 +118,12 @@ public class CompeteProjectConfig implements Serializable {
this.videoEndTime = videoEndTime;
}
public Byte getRestrict() {
return restrict;
public Byte getVideoRestrict() {
return videoRestrict;
}
public void setRestrict(Byte restrict) {
this.restrict = restrict;
public void setVideoRestrict(Byte videoRestrict) {
this.videoRestrict = videoRestrict;
}
@Override
@ -143,7 +143,7 @@ public class CompeteProjectConfig implements Serializable {
sb.append(", recStatus=").append(recStatus);
sb.append(", videoStartTime=").append(videoStartTime);
sb.append(", videoEndTime=").append(videoEndTime);
sb.append(", restrict=").append(restrict);
sb.append(", videoRestrict=").append(videoRestrict);
sb.append("]");
return sb.toString();
}

48
mt/src/main/java/com/ccsens/mt/bean/po/CompeteProjectConfigExample.java

@ -765,63 +765,63 @@ public class CompeteProjectConfigExample {
return (Criteria) this;
}
public Criteria andRestrictIsNull() {
addCriterion("restrict is null");
public Criteria andVideoRestrictIsNull() {
addCriterion("video_restrict is null");
return (Criteria) this;
}
public Criteria andRestrictIsNotNull() {
addCriterion("restrict is not null");
public Criteria andVideoRestrictIsNotNull() {
addCriterion("video_restrict is not null");
return (Criteria) this;
}
public Criteria andRestrictEqualTo(Byte value) {
addCriterion("restrict =", value, "restrict");
public Criteria andVideoRestrictEqualTo(Byte value) {
addCriterion("video_restrict =", value, "videoRestrict");
return (Criteria) this;
}
public Criteria andRestrictNotEqualTo(Byte value) {
addCriterion("restrict <>", value, "restrict");
public Criteria andVideoRestrictNotEqualTo(Byte value) {
addCriterion("video_restrict <>", value, "videoRestrict");
return (Criteria) this;
}
public Criteria andRestrictGreaterThan(Byte value) {
addCriterion("restrict >", value, "restrict");
public Criteria andVideoRestrictGreaterThan(Byte value) {
addCriterion("video_restrict >", value, "videoRestrict");
return (Criteria) this;
}
public Criteria andRestrictGreaterThanOrEqualTo(Byte value) {
addCriterion("restrict >=", value, "restrict");
public Criteria andVideoRestrictGreaterThanOrEqualTo(Byte value) {
addCriterion("video_restrict >=", value, "videoRestrict");
return (Criteria) this;
}
public Criteria andRestrictLessThan(Byte value) {
addCriterion("restrict <", value, "restrict");
public Criteria andVideoRestrictLessThan(Byte value) {
addCriterion("video_restrict <", value, "videoRestrict");
return (Criteria) this;
}
public Criteria andRestrictLessThanOrEqualTo(Byte value) {
addCriterion("restrict <=", value, "restrict");
public Criteria andVideoRestrictLessThanOrEqualTo(Byte value) {
addCriterion("video_restrict <=", value, "videoRestrict");
return (Criteria) this;
}
public Criteria andRestrictIn(List<Byte> values) {
addCriterion("restrict in", values, "restrict");
public Criteria andVideoRestrictIn(List<Byte> values) {
addCriterion("video_restrict in", values, "videoRestrict");
return (Criteria) this;
}
public Criteria andRestrictNotIn(List<Byte> values) {
addCriterion("restrict not in", values, "restrict");
public Criteria andVideoRestrictNotIn(List<Byte> values) {
addCriterion("video_restrict not in", values, "videoRestrict");
return (Criteria) this;
}
public Criteria andRestrictBetween(Byte value1, Byte value2) {
addCriterion("restrict between", value1, value2, "restrict");
public Criteria andVideoRestrictBetween(Byte value1, Byte value2) {
addCriterion("video_restrict between", value1, value2, "videoRestrict");
return (Criteria) this;
}
public Criteria andRestrictNotBetween(Byte value1, Byte value2) {
addCriterion("restrict not between", value1, value2, "restrict");
public Criteria andVideoRestrictNotBetween(Byte value1, Byte value2) {
addCriterion("video_restrict not between", value1, value2, "videoRestrict");
return (Criteria) this;
}
}

128
mt/src/main/java/com/ccsens/mt/bean/po/CompeteSpeedVideo.java

@ -0,0 +1,128 @@
package com.ccsens.mt.bean.po;
import java.io.Serializable;
import java.util.Date;
public class CompeteSpeedVideo implements Serializable {
private Long id;
private Long companyId;
private String companyName;
private String playerName;
private Long userId;
private String videoUrlOne;
private String videoUrlTwo;
private Date createdAt;
private Date updatedAt;
private Byte recStatus;
private static final long serialVersionUID = 1L;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getCompanyId() {
return companyId;
}
public void setCompanyId(Long companyId) {
this.companyId = companyId;
}
public String getCompanyName() {
return companyName;
}
public void setCompanyName(String companyName) {
this.companyName = companyName == null ? null : companyName.trim();
}
public String getPlayerName() {
return playerName;
}
public void setPlayerName(String playerName) {
this.playerName = playerName == null ? null : playerName.trim();
}
public Long getUserId() {
return userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public String getVideoUrlOne() {
return videoUrlOne;
}
public void setVideoUrlOne(String videoUrlOne) {
this.videoUrlOne = videoUrlOne == null ? null : videoUrlOne.trim();
}
public String getVideoUrlTwo() {
return videoUrlTwo;
}
public void setVideoUrlTwo(String videoUrlTwo) {
this.videoUrlTwo = videoUrlTwo == null ? null : videoUrlTwo.trim();
}
public Date getCreatedAt() {
return createdAt;
}
public void setCreatedAt(Date createdAt) {
this.createdAt = createdAt;
}
public Date getUpdatedAt() {
return updatedAt;
}
public void setUpdatedAt(Date updatedAt) {
this.updatedAt = updatedAt;
}
public Byte getRecStatus() {
return recStatus;
}
public void setRecStatus(Byte recStatus) {
this.recStatus = recStatus;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", companyId=").append(companyId);
sb.append(", companyName=").append(companyName);
sb.append(", playerName=").append(playerName);
sb.append(", userId=").append(userId);
sb.append(", videoUrlOne=").append(videoUrlOne);
sb.append(", videoUrlTwo=").append(videoUrlTwo);
sb.append(", createdAt=").append(createdAt);
sb.append(", updatedAt=").append(updatedAt);
sb.append(", recStatus=").append(recStatus);
sb.append("]");
return sb.toString();
}
}

841
mt/src/main/java/com/ccsens/mt/bean/po/CompeteSpeedVideoExample.java

@ -0,0 +1,841 @@
package com.ccsens.mt.bean.po;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class CompeteSpeedVideoExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public CompeteSpeedVideoExample() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(Long value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(Long value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(Long value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(Long value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(Long value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(Long value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<Long> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<Long> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(Long value1, Long value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(Long value1, Long value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andCompanyIdIsNull() {
addCriterion("company_id is null");
return (Criteria) this;
}
public Criteria andCompanyIdIsNotNull() {
addCriterion("company_id is not null");
return (Criteria) this;
}
public Criteria andCompanyIdEqualTo(Long value) {
addCriterion("company_id =", value, "companyId");
return (Criteria) this;
}
public Criteria andCompanyIdNotEqualTo(Long value) {
addCriterion("company_id <>", value, "companyId");
return (Criteria) this;
}
public Criteria andCompanyIdGreaterThan(Long value) {
addCriterion("company_id >", value, "companyId");
return (Criteria) this;
}
public Criteria andCompanyIdGreaterThanOrEqualTo(Long value) {
addCriterion("company_id >=", value, "companyId");
return (Criteria) this;
}
public Criteria andCompanyIdLessThan(Long value) {
addCriterion("company_id <", value, "companyId");
return (Criteria) this;
}
public Criteria andCompanyIdLessThanOrEqualTo(Long value) {
addCriterion("company_id <=", value, "companyId");
return (Criteria) this;
}
public Criteria andCompanyIdIn(List<Long> values) {
addCriterion("company_id in", values, "companyId");
return (Criteria) this;
}
public Criteria andCompanyIdNotIn(List<Long> values) {
addCriterion("company_id not in", values, "companyId");
return (Criteria) this;
}
public Criteria andCompanyIdBetween(Long value1, Long value2) {
addCriterion("company_id between", value1, value2, "companyId");
return (Criteria) this;
}
public Criteria andCompanyIdNotBetween(Long value1, Long value2) {
addCriterion("company_id not between", value1, value2, "companyId");
return (Criteria) this;
}
public Criteria andCompanyNameIsNull() {
addCriterion("company_name is null");
return (Criteria) this;
}
public Criteria andCompanyNameIsNotNull() {
addCriterion("company_name is not null");
return (Criteria) this;
}
public Criteria andCompanyNameEqualTo(String value) {
addCriterion("company_name =", value, "companyName");
return (Criteria) this;
}
public Criteria andCompanyNameNotEqualTo(String value) {
addCriterion("company_name <>", value, "companyName");
return (Criteria) this;
}
public Criteria andCompanyNameGreaterThan(String value) {
addCriterion("company_name >", value, "companyName");
return (Criteria) this;
}
public Criteria andCompanyNameGreaterThanOrEqualTo(String value) {
addCriterion("company_name >=", value, "companyName");
return (Criteria) this;
}
public Criteria andCompanyNameLessThan(String value) {
addCriterion("company_name <", value, "companyName");
return (Criteria) this;
}
public Criteria andCompanyNameLessThanOrEqualTo(String value) {
addCriterion("company_name <=", value, "companyName");
return (Criteria) this;
}
public Criteria andCompanyNameLike(String value) {
addCriterion("company_name like", value, "companyName");
return (Criteria) this;
}
public Criteria andCompanyNameNotLike(String value) {
addCriterion("company_name not like", value, "companyName");
return (Criteria) this;
}
public Criteria andCompanyNameIn(List<String> values) {
addCriterion("company_name in", values, "companyName");
return (Criteria) this;
}
public Criteria andCompanyNameNotIn(List<String> values) {
addCriterion("company_name not in", values, "companyName");
return (Criteria) this;
}
public Criteria andCompanyNameBetween(String value1, String value2) {
addCriterion("company_name between", value1, value2, "companyName");
return (Criteria) this;
}
public Criteria andCompanyNameNotBetween(String value1, String value2) {
addCriterion("company_name not between", value1, value2, "companyName");
return (Criteria) this;
}
public Criteria andPlayerNameIsNull() {
addCriterion("player_name is null");
return (Criteria) this;
}
public Criteria andPlayerNameIsNotNull() {
addCriterion("player_name is not null");
return (Criteria) this;
}
public Criteria andPlayerNameEqualTo(String value) {
addCriterion("player_name =", value, "playerName");
return (Criteria) this;
}
public Criteria andPlayerNameNotEqualTo(String value) {
addCriterion("player_name <>", value, "playerName");
return (Criteria) this;
}
public Criteria andPlayerNameGreaterThan(String value) {
addCriterion("player_name >", value, "playerName");
return (Criteria) this;
}
public Criteria andPlayerNameGreaterThanOrEqualTo(String value) {
addCriterion("player_name >=", value, "playerName");
return (Criteria) this;
}
public Criteria andPlayerNameLessThan(String value) {
addCriterion("player_name <", value, "playerName");
return (Criteria) this;
}
public Criteria andPlayerNameLessThanOrEqualTo(String value) {
addCriterion("player_name <=", value, "playerName");
return (Criteria) this;
}
public Criteria andPlayerNameLike(String value) {
addCriterion("player_name like", value, "playerName");
return (Criteria) this;
}
public Criteria andPlayerNameNotLike(String value) {
addCriterion("player_name not like", value, "playerName");
return (Criteria) this;
}
public Criteria andPlayerNameIn(List<String> values) {
addCriterion("player_name in", values, "playerName");
return (Criteria) this;
}
public Criteria andPlayerNameNotIn(List<String> values) {
addCriterion("player_name not in", values, "playerName");
return (Criteria) this;
}
public Criteria andPlayerNameBetween(String value1, String value2) {
addCriterion("player_name between", value1, value2, "playerName");
return (Criteria) this;
}
public Criteria andPlayerNameNotBetween(String value1, String value2) {
addCriterion("player_name not between", value1, value2, "playerName");
return (Criteria) this;
}
public Criteria andUserIdIsNull() {
addCriterion("user_id is null");
return (Criteria) this;
}
public Criteria andUserIdIsNotNull() {
addCriterion("user_id is not null");
return (Criteria) this;
}
public Criteria andUserIdEqualTo(Long value) {
addCriterion("user_id =", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotEqualTo(Long value) {
addCriterion("user_id <>", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdGreaterThan(Long value) {
addCriterion("user_id >", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdGreaterThanOrEqualTo(Long value) {
addCriterion("user_id >=", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdLessThan(Long value) {
addCriterion("user_id <", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdLessThanOrEqualTo(Long value) {
addCriterion("user_id <=", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdIn(List<Long> values) {
addCriterion("user_id in", values, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotIn(List<Long> values) {
addCriterion("user_id not in", values, "userId");
return (Criteria) this;
}
public Criteria andUserIdBetween(Long value1, Long value2) {
addCriterion("user_id between", value1, value2, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotBetween(Long value1, Long value2) {
addCriterion("user_id not between", value1, value2, "userId");
return (Criteria) this;
}
public Criteria andVideoUrlOneIsNull() {
addCriterion("video_url_one is null");
return (Criteria) this;
}
public Criteria andVideoUrlOneIsNotNull() {
addCriterion("video_url_one is not null");
return (Criteria) this;
}
public Criteria andVideoUrlOneEqualTo(String value) {
addCriterion("video_url_one =", value, "videoUrlOne");
return (Criteria) this;
}
public Criteria andVideoUrlOneNotEqualTo(String value) {
addCriterion("video_url_one <>", value, "videoUrlOne");
return (Criteria) this;
}
public Criteria andVideoUrlOneGreaterThan(String value) {
addCriterion("video_url_one >", value, "videoUrlOne");
return (Criteria) this;
}
public Criteria andVideoUrlOneGreaterThanOrEqualTo(String value) {
addCriterion("video_url_one >=", value, "videoUrlOne");
return (Criteria) this;
}
public Criteria andVideoUrlOneLessThan(String value) {
addCriterion("video_url_one <", value, "videoUrlOne");
return (Criteria) this;
}
public Criteria andVideoUrlOneLessThanOrEqualTo(String value) {
addCriterion("video_url_one <=", value, "videoUrlOne");
return (Criteria) this;
}
public Criteria andVideoUrlOneLike(String value) {
addCriterion("video_url_one like", value, "videoUrlOne");
return (Criteria) this;
}
public Criteria andVideoUrlOneNotLike(String value) {
addCriterion("video_url_one not like", value, "videoUrlOne");
return (Criteria) this;
}
public Criteria andVideoUrlOneIn(List<String> values) {
addCriterion("video_url_one in", values, "videoUrlOne");
return (Criteria) this;
}
public Criteria andVideoUrlOneNotIn(List<String> values) {
addCriterion("video_url_one not in", values, "videoUrlOne");
return (Criteria) this;
}
public Criteria andVideoUrlOneBetween(String value1, String value2) {
addCriterion("video_url_one between", value1, value2, "videoUrlOne");
return (Criteria) this;
}
public Criteria andVideoUrlOneNotBetween(String value1, String value2) {
addCriterion("video_url_one not between", value1, value2, "videoUrlOne");
return (Criteria) this;
}
public Criteria andVideoUrlTwoIsNull() {
addCriterion("video_url_two is null");
return (Criteria) this;
}
public Criteria andVideoUrlTwoIsNotNull() {
addCriterion("video_url_two is not null");
return (Criteria) this;
}
public Criteria andVideoUrlTwoEqualTo(String value) {
addCriterion("video_url_two =", value, "videoUrlTwo");
return (Criteria) this;
}
public Criteria andVideoUrlTwoNotEqualTo(String value) {
addCriterion("video_url_two <>", value, "videoUrlTwo");
return (Criteria) this;
}
public Criteria andVideoUrlTwoGreaterThan(String value) {
addCriterion("video_url_two >", value, "videoUrlTwo");
return (Criteria) this;
}
public Criteria andVideoUrlTwoGreaterThanOrEqualTo(String value) {
addCriterion("video_url_two >=", value, "videoUrlTwo");
return (Criteria) this;
}
public Criteria andVideoUrlTwoLessThan(String value) {
addCriterion("video_url_two <", value, "videoUrlTwo");
return (Criteria) this;
}
public Criteria andVideoUrlTwoLessThanOrEqualTo(String value) {
addCriterion("video_url_two <=", value, "videoUrlTwo");
return (Criteria) this;
}
public Criteria andVideoUrlTwoLike(String value) {
addCriterion("video_url_two like", value, "videoUrlTwo");
return (Criteria) this;
}
public Criteria andVideoUrlTwoNotLike(String value) {
addCriterion("video_url_two not like", value, "videoUrlTwo");
return (Criteria) this;
}
public Criteria andVideoUrlTwoIn(List<String> values) {
addCriterion("video_url_two in", values, "videoUrlTwo");
return (Criteria) this;
}
public Criteria andVideoUrlTwoNotIn(List<String> values) {
addCriterion("video_url_two not in", values, "videoUrlTwo");
return (Criteria) this;
}
public Criteria andVideoUrlTwoBetween(String value1, String value2) {
addCriterion("video_url_two between", value1, value2, "videoUrlTwo");
return (Criteria) this;
}
public Criteria andVideoUrlTwoNotBetween(String value1, String value2) {
addCriterion("video_url_two not between", value1, value2, "videoUrlTwo");
return (Criteria) this;
}
public Criteria andCreatedAtIsNull() {
addCriterion("created_at is null");
return (Criteria) this;
}
public Criteria andCreatedAtIsNotNull() {
addCriterion("created_at is not null");
return (Criteria) this;
}
public Criteria andCreatedAtEqualTo(Date value) {
addCriterion("created_at =", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotEqualTo(Date value) {
addCriterion("created_at <>", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtGreaterThan(Date value) {
addCriterion("created_at >", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtGreaterThanOrEqualTo(Date value) {
addCriterion("created_at >=", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtLessThan(Date value) {
addCriterion("created_at <", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtLessThanOrEqualTo(Date value) {
addCriterion("created_at <=", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtIn(List<Date> values) {
addCriterion("created_at in", values, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotIn(List<Date> values) {
addCriterion("created_at not in", values, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtBetween(Date value1, Date value2) {
addCriterion("created_at between", value1, value2, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotBetween(Date value1, Date value2) {
addCriterion("created_at not between", value1, value2, "createdAt");
return (Criteria) this;
}
public Criteria andUpdatedAtIsNull() {
addCriterion("updated_at is null");
return (Criteria) this;
}
public Criteria andUpdatedAtIsNotNull() {
addCriterion("updated_at is not null");
return (Criteria) this;
}
public Criteria andUpdatedAtEqualTo(Date value) {
addCriterion("updated_at =", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtNotEqualTo(Date value) {
addCriterion("updated_at <>", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtGreaterThan(Date value) {
addCriterion("updated_at >", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtGreaterThanOrEqualTo(Date value) {
addCriterion("updated_at >=", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtLessThan(Date value) {
addCriterion("updated_at <", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtLessThanOrEqualTo(Date value) {
addCriterion("updated_at <=", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtIn(List<Date> values) {
addCriterion("updated_at in", values, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtNotIn(List<Date> values) {
addCriterion("updated_at not in", values, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtBetween(Date value1, Date value2) {
addCriterion("updated_at between", value1, value2, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtNotBetween(Date value1, Date value2) {
addCriterion("updated_at not between", value1, value2, "updatedAt");
return (Criteria) this;
}
public Criteria andRecStatusIsNull() {
addCriterion("rec_status is null");
return (Criteria) this;
}
public Criteria andRecStatusIsNotNull() {
addCriterion("rec_status is not null");
return (Criteria) this;
}
public Criteria andRecStatusEqualTo(Byte value) {
addCriterion("rec_status =", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotEqualTo(Byte value) {
addCriterion("rec_status <>", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusGreaterThan(Byte value) {
addCriterion("rec_status >", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusGreaterThanOrEqualTo(Byte value) {
addCriterion("rec_status >=", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusLessThan(Byte value) {
addCriterion("rec_status <", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusLessThanOrEqualTo(Byte value) {
addCriterion("rec_status <=", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusIn(List<Byte> values) {
addCriterion("rec_status in", values, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotIn(List<Byte> values) {
addCriterion("rec_status not in", values, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusBetween(Byte value1, Byte value2) {
addCriterion("rec_status between", value1, value2, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotBetween(Byte value1, Byte value2) {
addCriterion("rec_status not between", value1, value2, "recStatus");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}

22
mt/src/main/java/com/ccsens/mt/bean/po/CompeteVideo.java

@ -26,6 +26,10 @@ public class CompeteVideo implements Serializable {
private Byte recStatus;
private String taskId;
private String videoUrlOrigin;
private static final long serialVersionUID = 1L;
public Long getId() {
@ -116,6 +120,22 @@ public class CompeteVideo implements Serializable {
this.recStatus = recStatus;
}
public String getTaskId() {
return taskId;
}
public void setTaskId(String taskId) {
this.taskId = taskId == null ? null : taskId.trim();
}
public String getVideoUrlOrigin() {
return videoUrlOrigin;
}
public void setVideoUrlOrigin(String videoUrlOrigin) {
this.videoUrlOrigin = videoUrlOrigin == null ? null : videoUrlOrigin.trim();
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
@ -133,6 +153,8 @@ public class CompeteVideo implements Serializable {
sb.append(", createdAt=").append(createdAt);
sb.append(", updatedAt=").append(updatedAt);
sb.append(", recStatus=").append(recStatus);
sb.append(", taskId=").append(taskId);
sb.append(", videoUrlOrigin=").append(videoUrlOrigin);
sb.append("]");
return sb.toString();
}

140
mt/src/main/java/com/ccsens/mt/bean/po/CompeteVideoExample.java

@ -774,6 +774,146 @@ public class CompeteVideoExample {
addCriterion("rec_status not between", value1, value2, "recStatus");
return (Criteria) this;
}
public Criteria andTaskIdIsNull() {
addCriterion("task_id is null");
return (Criteria) this;
}
public Criteria andTaskIdIsNotNull() {
addCriterion("task_id is not null");
return (Criteria) this;
}
public Criteria andTaskIdEqualTo(String value) {
addCriterion("task_id =", value, "taskId");
return (Criteria) this;
}
public Criteria andTaskIdNotEqualTo(String value) {
addCriterion("task_id <>", value, "taskId");
return (Criteria) this;
}
public Criteria andTaskIdGreaterThan(String value) {
addCriterion("task_id >", value, "taskId");
return (Criteria) this;
}
public Criteria andTaskIdGreaterThanOrEqualTo(String value) {
addCriterion("task_id >=", value, "taskId");
return (Criteria) this;
}
public Criteria andTaskIdLessThan(String value) {
addCriterion("task_id <", value, "taskId");
return (Criteria) this;
}
public Criteria andTaskIdLessThanOrEqualTo(String value) {
addCriterion("task_id <=", value, "taskId");
return (Criteria) this;
}
public Criteria andTaskIdLike(String value) {
addCriterion("task_id like", value, "taskId");
return (Criteria) this;
}
public Criteria andTaskIdNotLike(String value) {
addCriterion("task_id not like", value, "taskId");
return (Criteria) this;
}
public Criteria andTaskIdIn(List<String> values) {
addCriterion("task_id in", values, "taskId");
return (Criteria) this;
}
public Criteria andTaskIdNotIn(List<String> values) {
addCriterion("task_id not in", values, "taskId");
return (Criteria) this;
}
public Criteria andTaskIdBetween(String value1, String value2) {
addCriterion("task_id between", value1, value2, "taskId");
return (Criteria) this;
}
public Criteria andTaskIdNotBetween(String value1, String value2) {
addCriterion("task_id not between", value1, value2, "taskId");
return (Criteria) this;
}
public Criteria andVideoUrlOriginIsNull() {
addCriterion("video_url_origin is null");
return (Criteria) this;
}
public Criteria andVideoUrlOriginIsNotNull() {
addCriterion("video_url_origin is not null");
return (Criteria) this;
}
public Criteria andVideoUrlOriginEqualTo(String value) {
addCriterion("video_url_origin =", value, "videoUrlOrigin");
return (Criteria) this;
}
public Criteria andVideoUrlOriginNotEqualTo(String value) {
addCriterion("video_url_origin <>", value, "videoUrlOrigin");
return (Criteria) this;
}
public Criteria andVideoUrlOriginGreaterThan(String value) {
addCriterion("video_url_origin >", value, "videoUrlOrigin");
return (Criteria) this;
}
public Criteria andVideoUrlOriginGreaterThanOrEqualTo(String value) {
addCriterion("video_url_origin >=", value, "videoUrlOrigin");
return (Criteria) this;
}
public Criteria andVideoUrlOriginLessThan(String value) {
addCriterion("video_url_origin <", value, "videoUrlOrigin");
return (Criteria) this;
}
public Criteria andVideoUrlOriginLessThanOrEqualTo(String value) {
addCriterion("video_url_origin <=", value, "videoUrlOrigin");
return (Criteria) this;
}
public Criteria andVideoUrlOriginLike(String value) {
addCriterion("video_url_origin like", value, "videoUrlOrigin");
return (Criteria) this;
}
public Criteria andVideoUrlOriginNotLike(String value) {
addCriterion("video_url_origin not like", value, "videoUrlOrigin");
return (Criteria) this;
}
public Criteria andVideoUrlOriginIn(List<String> values) {
addCriterion("video_url_origin in", values, "videoUrlOrigin");
return (Criteria) this;
}
public Criteria andVideoUrlOriginNotIn(List<String> values) {
addCriterion("video_url_origin not in", values, "videoUrlOrigin");
return (Criteria) this;
}
public Criteria andVideoUrlOriginBetween(String value1, String value2) {
addCriterion("video_url_origin between", value1, value2, "videoUrlOrigin");
return (Criteria) this;
}
public Criteria andVideoUrlOriginNotBetween(String value1, String value2) {
addCriterion("video_url_origin not between", value1, value2, "videoUrlOrigin");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {

8
mt/src/main/java/com/ccsens/mt/bean/vo/CompeteExcelVo.java

@ -27,12 +27,18 @@ public class CompeteExcelVo {
public static class TeamOrderPlayerList {
@ApiModelProperty("团队id")
private Long teamId;
@ApiModelProperty("场次")
@ApiModelProperty("场次加场地")
private String startOrder;
@ApiModelProperty("单位名称")
private String companyName;
@ApiModelProperty("团队选手名字")
private String playerName;
@ApiModelProperty("视频路径")
private String videoUrl;
@ApiModelProperty("场次")
private String competeOrder;
@ApiModelProperty("场地")
private String site;
}
@Data

2
mt/src/main/java/com/ccsens/mt/bean/vo/ScoreVo.java

@ -251,7 +251,7 @@ public class ScoreVo {
@ApiModelProperty("最终成绩")
private BigDecimal finalScore;
@ApiModelProperty("备注")
private String remark;
private String remark = "";
@ApiModelProperty("名次")
private int rangee;
}

4
mt/src/main/java/com/ccsens/mt/bean/vo/VideoProjectVo.java

@ -50,7 +50,9 @@ public class VideoProjectVo {
@ApiModelProperty("裁判类型")
private byte chiefJudgment;
@ApiModelProperty("最近签到时间")
private Date time;
private Date dateTime;
@ApiModelProperty("最近签到时间戳")
private Long time;
}

23
mt/src/main/java/com/ccsens/mt/persist/dao/CompeteScoreDao.java

@ -122,4 +122,27 @@ public interface CompeteScoreDao {
* @return
*/
ScoreVo.CountScoreCurrentSite getCountScoreByOrderId(@Param("siteId")Long siteId);
/**
* 根据组别和项目查找排名(计数赛团体)
* @param projectId 项目id
* @param competeGroupId 组别id
* @return
*/
List<ScoreVo.CompeteScore> selectCountTeam(@Param("projectId")Long projectId, @Param("competeGroupId")Long competeGroupId);
/**
* 根据组别和项目查找排名计数赛个人
* @param projectId 项目id
* @param competeGroupId 组别id
* @return
*/
List<ScoreVo.CompeteScore> selectCountPlayer(@Param("projectId")Long projectId, @Param("competeGroupId")Long competeGroupId);
/**
* 根据组别和项目查找排名花样赛
* @param projectId
* @param competeGroupId
* @return
*/
List<ScoreVo.CompeteScore> selectVarietyPlayer(@Param("projectId")Long projectId, @Param("competeGroupId")Long competeGroupId);
}

30
mt/src/main/java/com/ccsens/mt/persist/mapper/CompeteSpeedVideoMapper.java

@ -0,0 +1,30 @@
package com.ccsens.mt.persist.mapper;
import com.ccsens.mt.bean.po.CompeteSpeedVideo;
import com.ccsens.mt.bean.po.CompeteSpeedVideoExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface CompeteSpeedVideoMapper {
long countByExample(CompeteSpeedVideoExample example);
int deleteByExample(CompeteSpeedVideoExample example);
int deleteByPrimaryKey(Long id);
int insert(CompeteSpeedVideo record);
int insertSelective(CompeteSpeedVideo record);
List<CompeteSpeedVideo> selectByExample(CompeteSpeedVideoExample example);
CompeteSpeedVideo selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") CompeteSpeedVideo record, @Param("example") CompeteSpeedVideoExample example);
int updateByExample(@Param("record") CompeteSpeedVideo record, @Param("example") CompeteSpeedVideoExample example);
int updateByPrimaryKeySelective(CompeteSpeedVideo record);
int updateByPrimaryKey(CompeteSpeedVideo record);
}

2
mt/src/main/java/com/ccsens/mt/service/CompeteScoreService.java

@ -36,6 +36,7 @@ public class CompeteScoreService implements ICompeteScoreService{
countScore = countScoreList.get(0);
countScore.setChiefJudgmentScore(param.getMainScore());
countScore.setJudgmentAScore(param.getMainOneScore());
countScore.setCompeteTimeId(param.getCompeteTimeId());
countScore.setJudgmentBScore2(param.getMainTwoScore());
countScore.setShouldTimes(param.getShouldScore());
countScore.setDeductTimes(param.getDeductTime());
@ -46,6 +47,7 @@ public class CompeteScoreService implements ICompeteScoreService{
countScore = new CompeteCountScore();
countScore.setId(snowflake.nextId());
countScore.setProjectId(param.getProjectId());
countScore.setCompeteTimeId(param.getCompeteTimeId());
countScore.setSiteOrderId(param.getSiteOrderId());
countScore.setChiefJudgmentScore(param.getMainScore());
countScore.setJudgmentAScore(param.getMainOneScore());

51
mt/src/main/java/com/ccsens/mt/service/CompeteService.java

@ -72,6 +72,7 @@ public class CompeteService implements ICompeteService {
private CompeteProjectMapper competeProjectMapper;
@Resource
private CompeteProjectPlayerMapper competeProjectPlayerMapper;
@Resource
private CompeteGroupMapper competeGroupMapper;
@Resource
@ -1395,26 +1396,39 @@ public class CompeteService implements ICompeteService {
if (ObjectUtil.isNotNull(competeProject)){
int team = competeProject.getTeam();
long fatherId = competeProject.getParentId();
//如果比赛是个人计数赛
if (fatherId == 2001 && team == 0){
List<ScoreVo.CompeteScore> competeScores = competeScoreDao.selectSingleCount(ProjectId, competeGroupId);
competeScoreList.addAll(competeScores);
}
//如果是个人花样赛
if (fatherId == 2002 && team == 0){
List<ScoreVo.CompeteScore> competeScores = competeScoreDao.selectSingleVarity(ProjectId, competeGroupId);
competeScoreList.addAll(competeScores);
}
//如果是团队计数赛
if (fatherId == 2001 && team == 1){
List<ScoreVo.CompeteScore> competeScores = competeScoreDao.selectGroupCount(ProjectId, competeGroupId);
competeScoreList.addAll(competeScores);
if(fatherId == Constant.COMPETE_COUNT) {
if (competeProject.getTeam() == Constant.Compete.TEAM_YES) {
// 团体赛
competeScoreList = competeScoreDao.selectCountTeam(params.getProjectId(), params.getCompeteGroupId());
} else {
// 个人赛
competeScoreList = competeScoreDao.selectCountPlayer(params.getProjectId(), params.getCompeteGroupId());
}
//如果是团队花样赛
if (fatherId == 2002 && team == 1){
List<ScoreVo.CompeteScore> competeScores = competeScoreDao.selectGroupVarity(ProjectId, competeGroupId);
competeScoreList.addAll(competeScores);
}else {
//花样赛
competeScoreList = competeScoreDao.selectVarietyPlayer(params.getProjectId(), params.getCompeteGroupId());
}
// //如果比赛是个人计数赛
// if (fatherId == 2001 && team == 0){
// List<ScoreVo.CompeteScore> competeScores = competeScoreDao.selectSingleCount(ProjectId, competeGroupId);
// competeScoreList.addAll(competeScores);
// }
// //如果是个人花样赛
// if (fatherId == 2002 && team == 0){
// List<ScoreVo.CompeteScore> competeScores = competeScoreDao.selectSingleVarity(ProjectId, competeGroupId);
// competeScoreList.addAll(competeScores);
// }
// //如果是团队计数赛
// if (fatherId == 2001 && team == 1){
// List<ScoreVo.CompeteScore> competeScores = competeScoreDao.selectGroupCount(ProjectId, competeGroupId);
// competeScoreList.addAll(competeScores);
// }
// //如果是团队花样赛
// if (fatherId == 2002 && team == 1){
// List<ScoreVo.CompeteScore> competeScores = competeScoreDao.selectGroupVarity(ProjectId, competeGroupId);
// competeScoreList.addAll(competeScores);
// }
}
return competeScoreList;
}
@ -1874,7 +1888,6 @@ public class CompeteService implements ICompeteService {
if (project == null) {
throw new BaseException(CodeEnum.PARAM_ERROR);
}
PageHelper.startPage(param.getPageNum(), param.getSize());
List<ScoreVo.CountScorePublicity> list;
if (project.getTeam() == Constant.Compete.TEAM_YES) {

45
mt/src/main/java/com/ccsens/mt/service/CompeteVedioService.java

@ -1,17 +1,18 @@
package com.ccsens.mt.service;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.lang.Snowflake;
import cn.hutool.core.util.ObjectUtil;
import com.ccsens.mt.bean.dto.VideoDto;
import com.ccsens.mt.bean.po.*;
import com.ccsens.mt.bean.vo.VideoProjectVo;
import com.ccsens.mt.persist.dao.CompeteTeamDao;
import com.ccsens.mt.persist.dao.CompeteTimeDao;
import com.ccsens.mt.persist.dao.CompeteVideoDao;
import com.ccsens.mt.persist.mapper.CompeteCompanyMapper;
import com.ccsens.mt.persist.mapper.CompetePlayerLookMapper;
import com.ccsens.mt.persist.mapper.CompeteProjectMapper;
import com.ccsens.mt.persist.mapper.CompeteVideoMapper;
import com.ccsens.mt.persist.mapper.*;
import com.ccsens.util.CodeEnum;
import com.ccsens.util.bean.dto.QueryDto;
import com.ccsens.util.exception.BaseException;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j;
@ -21,6 +22,7 @@ import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Base64;
import java.util.List;
/**
@ -37,9 +39,8 @@ public class CompeteVedioService implements ICompeteVedioService{
private CompetePlayerLookMapper competePlayerLookMapper;
@Resource
private CompeteVideoMapper competeVideoMapper;
@Resource
private CompeteProjectMapper competeProjectMapper;
private CompeteSpeedVideoMapper speedVideoMapper;
@Resource
private CompeteCompanyMapper competeCompanyMapper;
@Resource
@ -142,6 +143,34 @@ public class CompeteVedioService implements ICompeteVedioService{
return new PageInfo<>(competeVideoDao.selectCoachSignStatus(params.getParam()));
}
/**
* 上传速度通级赛视频
* @param param 视频地址和选手名
* @param userId 上传者的userId
*/
@Override
public void saveSpeedVideo(VideoDto.SpeedVideoInfo param, Long userId) {
//查找单位信息
CompeteCompany company = competeCompanyMapper.selectByPrimaryKey(param.getCompanyId());
if(ObjectUtil.isNull(company)){
throw new BaseException(CodeEnum.PARAM_ERROR);
}
//保存视频信息
CompeteSpeedVideo speedVideo = new CompeteSpeedVideo();
speedVideo.setId(snowflake.nextId());
speedVideo.setCompanyId(param.getCompanyId());
speedVideo.setCompanyName(company.getName());
speedVideo.setPlayerName(param.getPlayerName());
if(CollectionUtil.isNotEmpty(param.getVideoUrlList())){
for (int i = 0; i < param.getVideoUrlList().size(); i++) {
String url = param.getVideoUrlList().get(i);
if(i == 0){
speedVideo.setVideoUrlOne(url);
}else {
speedVideo.setVideoUrlTwo(url);
}
}
}
speedVideoMapper.insertSelective(speedVideo);
}
}

18
mt/src/main/java/com/ccsens/mt/service/ExcelService.java

@ -628,12 +628,21 @@ public class ExcelService implements IExcelService {
two5.setValue("参赛单位");
PoiUtil.PoiUtilCell two6=new PoiUtil.PoiUtilCell(WebConstant.CELL_NULL, 1, 1);
two6.setValue("参赛人员");
PoiUtil.PoiUtilCell two7=new PoiUtil.PoiUtilCell(WebConstant.CELL_NULL, 1, 1);
two7.setValue("比赛视频路径");
PoiUtil.PoiUtilCell two8=new PoiUtil.PoiUtilCell(WebConstant.CELL_NULL, 1, 1);
two7.setValue("场次");
PoiUtil.PoiUtilCell two9=new PoiUtil.PoiUtilCell(WebConstant.CELL_NULL, 1, 1);
two7.setValue("场地");
two.add(two1);
two.add(two2);
two.add(two3);
two.add(two4);
two.add(two5);
two.add(two6);
two.add(two7);
two.add(two8);
two.add(two9);
biao.add(two);
for (CompeteExcelVo.Project project : allProjectList) {
int j = 0, q = 0;//一个项目得长度 项目循环
@ -675,12 +684,18 @@ public class ExcelService implements IExcelService {
PoiUtil.PoiUtilCell three4 = new PoiUtil.PoiUtilCell(project.getProjectList().get(k).getCompanyNameList().get(m).getStartOrder(), 1, 1);
PoiUtil.PoiUtilCell three5 = new PoiUtil.PoiUtilCell(project.getProjectList().get(k).getCompanyNameList().get(m).getCompanyName(), 1, 1);
PoiUtil.PoiUtilCell three6 = new PoiUtil.PoiUtilCell(project.getProjectList().get(k).getCompanyNameList().get(m).getPlayerName(), 1, 1);
PoiUtil.PoiUtilCell three7 = new PoiUtil.PoiUtilCell(project.getProjectList().get(k).getCompanyNameList().get(m).getVideoUrl(), 1, 1);
PoiUtil.PoiUtilCell three8 = new PoiUtil.PoiUtilCell(project.getProjectList().get(k).getCompanyNameList().get(m).getCompeteOrder(), 1, 1);
PoiUtil.PoiUtilCell three9 = new PoiUtil.PoiUtilCell(project.getProjectList().get(k).getCompanyNameList().get(m).getSite(), 1, 1);
three.add(three1);
three.add(three2);
three.add(three3);
three.add(three4);
three.add(three5);
three.add(three6);
three.add(three7);
three.add(three8);
three.add(three9);
biao.add(three);
}
}
@ -1442,7 +1457,6 @@ public class ExcelService implements IExcelService {
}
List<ScoreVo.CountScorePublicity> countScoreCurrentSites = countScoreCurrentSiteList;
List<List<PoiUtil.PoiUtilCell>> list = new ArrayList<>();
List<PoiUtil.PoiUtilCell> zero=new ArrayList<>();
PoiUtil.PoiUtilCell zeroOne=new PoiUtil.PoiUtilCell("比赛成绩公示(计数赛)", 10, 1);
@ -1456,7 +1470,7 @@ public class ExcelService implements IExcelService {
PoiUtil.PoiUtilCell oneFive=new PoiUtil.PoiUtilCell("总成绩", 1, 2);
PoiUtil.PoiUtilCell oneSix=new PoiUtil.PoiUtilCell("扣除次数", 1, 2);
PoiUtil.PoiUtilCell oneSeven=new PoiUtil.PoiUtilCell("最终成绩", 1, 2);
PoiUtil.PoiUtilCell oneEight=new PoiUtil.PoiUtilCell("名", 1, 2);
PoiUtil.PoiUtilCell oneEight=new PoiUtil.PoiUtilCell("名", 1, 2);
PoiUtil.PoiUtilCell oneNine=new PoiUtil.PoiUtilCell("备注", 1, 2);
one.add(oneOne);

2
mt/src/main/java/com/ccsens/mt/service/ICompeteVedioService.java

@ -32,4 +32,6 @@ public interface ICompeteVedioService {
PageInfo<VideoProjectVo.PeoSignStatu> selectCompanySignStatus(QueryDto<VideoDto.GetSignStatus> params);
PageInfo<VideoProjectVo.CoachSignStatu> selectCoachSignStatus(QueryDto<VideoDto.GetSignStatus> params);
void saveSpeedVideo(VideoDto.SpeedVideoInfo param, Long userId);
}

3
mt/src/main/java/com/ccsens/mt/service/IKCPlayerService.java

@ -1,6 +1,7 @@
package com.ccsens.mt.service;
import org.json.JSONObject;
import com.alibaba.fastjson.JSONObject;
public interface IKCPlayerService {
/**

72
mt/src/main/java/com/ccsens/mt/service/KCPlayerService.java

@ -1,7 +1,9 @@
package com.ccsens.mt.service;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.lang.Snowflake;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSONObject;
import com.ccsens.mt.bean.po.CompeteStartOrder;
import com.ccsens.mt.bean.po.CompeteVideo;
import com.ccsens.mt.bean.po.CompeteVideoExample;
@ -13,12 +15,14 @@ import com.ccsens.util.KCPlayerSignature;
import com.ccsens.util.RedisUtil;
import com.ccsens.util.exception.BaseException;
import lombok.extern.slf4j.Slf4j;
import org.json.JSONObject;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Random;
@Slf4j
@Service
@ -67,16 +71,53 @@ public class KCPlayerService implements IKCPlayerService{
@Override
public void saveVideoUrl(JSONObject jsonObject) {
log.info("云点播事件通知:{}", jsonObject);
switch (jsonObject.getString(Constant.KCPlayer.EVENT_TYPE)) {
// 任务流状态变更
case Constant.KCPlayer.FILE_PROCEDURE_CHANGE : procedureChange(jsonObject);break;
// 文件上传
case Constant.KCPlayer.FILE_UPLOAD : fileUpload(jsonObject);break;
}
}
private void procedureChange(JSONObject json) {
log.info("任务流变更");
JSONObject procedure = json.getJSONObject(Constant.KCPlayer.PROCEDURE_STATUS_CHANGE);
String taskId = procedure.getString(Constant.KCPlayer.TASK_ID);
Object result = procedure.getJSONArray(Constant.KCPlayer.PROCEDURE_RESULT).get(0);
JSONObject resultJson = JSONObject.parseObject(JSONObject.toJSONString(result));
String url = resultJson.getJSONObject("TranscodeTask").getJSONObject("Output").getString("Url");
CompeteVideoExample competeVideoExample = new CompeteVideoExample();
competeVideoExample.createCriteria().andTaskIdEqualTo(taskId);
List<CompeteVideo> competeVideos = competeVideoMapper.selectByExample(competeVideoExample);
if (CollectionUtil.isEmpty(competeVideos)) {
log.info("{}未找到,{}", taskId, url);
return;
}
CompeteVideo competeVideo = competeVideos.get(0);
CompeteVideo update = new CompeteVideo();
update.setId(competeVideo.getId());
update.setVideoUrl(url);
competeVideoMapper.updateByPrimaryKeySelective(update);
}
private void fileUpload(JSONObject jsonObject) {
log.info("文件上传");
JSONObject fileUploadEvent = jsonObject.getJSONObject("FileUploadEvent");
JSONObject mediaBasicInfo = fileUploadEvent.getJSONObject("MediaBasicInfo");
// TODO 获取回传的id(场次id)
JSONObject sourceInfo = mediaBasicInfo.getJSONObject("SourceInfo");
JSONObject sourceContext = sourceInfo.getJSONObject("SourceContext");
Long orderId = Long.parseLong(sourceContext.toString());
long orderId = sourceInfo.getLongValue("SourceContext");
log.info("获取场次id:{}",orderId);
// TODO 获取视频路径
JSONObject mediaUrl = mediaBasicInfo.getJSONObject("MediaUrl");
String videoUrl = mediaUrl.toString();
String videoUrl = mediaBasicInfo.getString("MediaUrl");
log.info("获取视频路径:{}",videoUrl);
//通过场次id获取场次信息
CompeteStartOrder startOrder = startOrderMapper.selectByPrimaryKey(orderId);
@ -87,20 +128,29 @@ public class KCPlayerService implements IKCPlayerService{
CompeteVideoExample competeVideoExample = new CompeteVideoExample();
competeVideoExample.createCriteria().andProjectIdEqualTo(startOrder.getProjectId())
.andPlayerIdEqualTo(startOrder.getPlayerId());
long count = competeVideoMapper.countByExample(competeVideoExample);
log.info("查询以前上传的视频的记录:{}",count);
if(count > 0){
throw new BaseException(CodeEnum.ALREADY_UPLOAD_VIDEO);
}
List<CompeteVideo> competeVideos = competeVideoMapper.selectByExample(competeVideoExample);
log.info("查询以前上传的视频的记录:{}",competeVideos);
if(CollectionUtil.isNotEmpty(competeVideos)){
CompeteVideo competeVideo = competeVideos.get(0);
CompeteVideo update = new CompeteVideo();
update.setId(competeVideo.getId());
update.setVideoUrl(videoUrl);
update.setVideoUrlOrigin(videoUrl);
update.setTaskId(fileUploadEvent.getString(Constant.KCPlayer.PROCEDURE_TASK_ID));
competeVideoMapper.updateByPrimaryKeySelective(update);
} else {
//将视频信息存入视频表
CompeteVideo competeVideo = new CompeteVideo();
competeVideo.setId(snowflake.nextId());
competeVideo.setProjectId(startOrder.getProjectId());
competeVideo.setPlayerId(startOrder.getPlayerId());
competeVideo.setVideoUrl(videoUrl);
competeVideo.setVideoUrlOrigin(videoUrl);
competeVideo.setUploadTime(System.currentTimeMillis());
log.info("添加上传视频记录:{}",count);
competeVideo.setTaskId(fileUploadEvent.getString(Constant.KCPlayer.PROCEDURE_TASK_ID));
log.info("添加上传视频记录:{}", competeVideo);
competeVideoMapper.insertSelective(competeVideo);
}
}
}

12
mt/src/main/java/com/ccsens/mt/util/Constant.java

@ -8,6 +8,18 @@ import com.ccsens.util.WebConstant;
* @time: 2020/8/13 17:14
*/
public class Constant {
public static class KCPlayer{
public final static String EVENT_TYPE = "EventType";
public final static String PROCEDURE_RESULT = "MediaProcessResultSet";
public final static String PROCEDURE_TASK_ID = "ProcedureTaskId";
public final static String TASK_ID = "TaskId";
public final static String FILE_URL = "FileUrl";
public final static String PROCEDURE_STATUS_CHANGE = "ProcedureStateChangeEvent";
/**文件上传*/
public final static String FILE_UPLOAD = "NewFileUpload";
public final static String FILE_PROCEDURE_CHANGE = "ProcedureStateChanged";
}
public static class Redis{
// 项目正在进行中的题目 项目ID_start_question
public final static String START_QUESTION = "_start_question";

3
mt/src/main/resources/application-prod.yml

@ -21,7 +21,8 @@ spring:
max-idle: 10
max-wait: -1ms
min-idle: 0
password: ''
# password: ''
password: 'areowqr!@43ef'
port: 6379
timeout: 1000ms
swagger:

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

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

1
mt/src/main/resources/druid-dev.yml

@ -29,6 +29,7 @@ spring:
testWhileIdle: true
timeBetweenEvictionRunsMillis: 60000
url: jdbc:mysql://49.233.89.188:3306/mt?useUnicode=true&characterEncoding=UTF-8
# url: jdbc:mysql://127.0.0.1/mt?useUnicode=true&characterEncoding=UTF-8
username: root
validationQuery: SELECT 1 FROM DUAL
# env: CCSENS_GAME

2
mt/src/main/resources/druid-prod.yml

@ -27,7 +27,7 @@ spring:
testOnReturn: false
testWhileIdle: true
timeBetweenEvictionRunsMillis: 60000
url: jdbc:mysql://127.0.0.1/mt?useUnicode=true&characterEncoding=UTF-8
url: jdbc:mysql://127.0.0.1/mt?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&autoReconnect=true
username: root
validationQuery: SELECT 1 FROM DUAL
env: CCSENS_GAME

1
mt/src/main/resources/mapper_dao/CompeteProjectConfigDao.xml

@ -396,6 +396,7 @@
and(a.ppId is not null or b.teamId is not null)
and so.rec_status = 0
and pr.rec_status = 0
and pc.rec_status = 0
ORDER BY so.start_time
</select>
<select id="queryProjectByTaskDetailId" resultType="com.ccsens.mt.bean.vo.ProvinceCompeteVo$QueryProjectByTall">

1103
mt/src/main/resources/mapper_dao/CompeteScoreDao.xml

File diff suppressed because it is too large

7
mt/src/main/resources/mapper_dao/CompeteVideoDao.xml

@ -65,10 +65,11 @@
tcj.`name` as `name`,
tcj.`phone` as `phone`,
tcj.`chief_judgment` as `chiefJudgment`,
tt.`cr` as `time`
(UNIX_TIMESTAMP(tt.`cr`) * 1000) as `time`,
tt.`cr` as dateTime
FROM
t_compete_judgment tcj
left join tall.t_pro_member ttpm on tcj.member_id=ttpm.id
left join tall.t_pro_member ttpm on tcj.member_id=ttpm.id and ttpm.user_id != 0
left join (
select
@ -76,7 +77,7 @@
user_id
From tall.t_sys_log
where `url`='/users/signin' and `rec_status`=0
where `url`='/users/signin' and `rec_status`=0 and user_id != 0
<if test="param.signEndTime!=null">
and tall.t_sys_log.created_at &lt;= #{param.signEndTime,jdbcType=TIMESTAMP}
</if>

28
mt/src/main/resources/mapper_raw/CompeteProjectConfigMapper.xml

@ -13,7 +13,7 @@
<result column="rec_status" jdbcType="TINYINT" property="recStatus" />
<result column="video_start_time" jdbcType="BIGINT" property="videoStartTime" />
<result column="video_end_time" jdbcType="BIGINT" property="videoEndTime" />
<result column="restrict" jdbcType="TINYINT" property="restrict" />
<result column="video_restrict" jdbcType="TINYINT" property="videoRestrict" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
@ -75,7 +75,7 @@
</sql>
<sql id="Base_Column_List">
id, project_id, project_duration, site_num, start_time, end_time, created_at, updated_at,
rec_status, video_start_time, video_end_time, restrict
rec_status, video_start_time, video_end_time, video_restrict
</sql>
<select id="selectByExample" parameterType="com.ccsens.mt.bean.po.CompeteProjectConfigExample" resultMap="BaseResultMap">
select
@ -111,12 +111,12 @@
insert into t_compete_project_config (id, project_id, project_duration,
site_num, start_time, end_time,
created_at, updated_at, rec_status,
video_start_time, video_end_time, restrict
video_start_time, video_end_time, video_restrict
)
values (#{id,jdbcType=BIGINT}, #{projectId,jdbcType=BIGINT}, #{projectDuration,jdbcType=BIGINT},
#{siteNum,jdbcType=INTEGER}, #{startTime,jdbcType=BIGINT}, #{endTime,jdbcType=BIGINT},
#{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT},
#{videoStartTime,jdbcType=BIGINT}, #{videoEndTime,jdbcType=BIGINT}, #{restrict,jdbcType=TINYINT}
#{videoStartTime,jdbcType=BIGINT}, #{videoEndTime,jdbcType=BIGINT}, #{videoRestrict,jdbcType=TINYINT}
)
</insert>
<insert id="insertSelective" parameterType="com.ccsens.mt.bean.po.CompeteProjectConfig">
@ -155,8 +155,8 @@
<if test="videoEndTime != null">
video_end_time,
</if>
<if test="restrict != null">
restrict,
<if test="videoRestrict != null">
video_restrict,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
@ -193,8 +193,8 @@
<if test="videoEndTime != null">
#{videoEndTime,jdbcType=BIGINT},
</if>
<if test="restrict != null">
#{restrict,jdbcType=TINYINT},
<if test="videoRestrict != null">
#{videoRestrict,jdbcType=TINYINT},
</if>
</trim>
</insert>
@ -240,8 +240,8 @@
<if test="record.videoEndTime != null">
video_end_time = #{record.videoEndTime,jdbcType=BIGINT},
</if>
<if test="record.restrict != null">
restrict = #{record.restrict,jdbcType=TINYINT},
<if test="record.videoRestrict != null">
video_restrict = #{record.videoRestrict,jdbcType=TINYINT},
</if>
</set>
<if test="_parameter != null">
@ -261,7 +261,7 @@
rec_status = #{record.recStatus,jdbcType=TINYINT},
video_start_time = #{record.videoStartTime,jdbcType=BIGINT},
video_end_time = #{record.videoEndTime,jdbcType=BIGINT},
restrict = #{record.restrict,jdbcType=TINYINT}
video_restrict = #{record.videoRestrict,jdbcType=TINYINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
@ -299,8 +299,8 @@
<if test="videoEndTime != null">
video_end_time = #{videoEndTime,jdbcType=BIGINT},
</if>
<if test="restrict != null">
restrict = #{restrict,jdbcType=TINYINT},
<if test="videoRestrict != null">
video_restrict = #{videoRestrict,jdbcType=TINYINT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
@ -317,7 +317,7 @@
rec_status = #{recStatus,jdbcType=TINYINT},
video_start_time = #{videoStartTime,jdbcType=BIGINT},
video_end_time = #{videoEndTime,jdbcType=BIGINT},
restrict = #{restrict,jdbcType=TINYINT}
video_restrict = #{videoRestrict,jdbcType=TINYINT}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>

291
mt/src/main/resources/mapper_raw/CompeteSpeedVideoMapper.xml

@ -0,0 +1,291 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ccsens.mt.persist.mapper.CompeteSpeedVideoMapper">
<resultMap id="BaseResultMap" type="com.ccsens.mt.bean.po.CompeteSpeedVideo">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="company_id" jdbcType="BIGINT" property="companyId" />
<result column="company_name" jdbcType="VARCHAR" property="companyName" />
<result column="player_name" jdbcType="VARCHAR" property="playerName" />
<result column="user_id" jdbcType="BIGINT" property="userId" />
<result column="video_url_one" jdbcType="VARCHAR" property="videoUrlOne" />
<result column="video_url_two" jdbcType="VARCHAR" property="videoUrlTwo" />
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
<result column="rec_status" jdbcType="TINYINT" property="recStatus" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, company_id, company_name, player_name, user_id, video_url_one, video_url_two,
created_at, updated_at, rec_status
</sql>
<select id="selectByExample" parameterType="com.ccsens.mt.bean.po.CompeteSpeedVideoExample" resultMap="BaseResultMap">
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from t_compete_speed_video
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from t_compete_speed_video
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from t_compete_speed_video
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.ccsens.mt.bean.po.CompeteSpeedVideoExample">
delete from t_compete_speed_video
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.ccsens.mt.bean.po.CompeteSpeedVideo">
insert into t_compete_speed_video (id, company_id, company_name,
player_name, user_id, video_url_one,
video_url_two, created_at, updated_at,
rec_status)
values (#{id,jdbcType=BIGINT}, #{companyId,jdbcType=BIGINT}, #{companyName,jdbcType=VARCHAR},
#{playerName,jdbcType=VARCHAR}, #{userId,jdbcType=BIGINT}, #{videoUrlOne,jdbcType=VARCHAR},
#{videoUrlTwo,jdbcType=VARCHAR}, #{createdAt,jdbcType=TIMESTAMP}, #{updatedAt,jdbcType=TIMESTAMP},
#{recStatus,jdbcType=TINYINT})
</insert>
<insert id="insertSelective" parameterType="com.ccsens.mt.bean.po.CompeteSpeedVideo">
insert into t_compete_speed_video
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
id,
</if>
<if test="companyId != null">
company_id,
</if>
<if test="companyName != null">
company_name,
</if>
<if test="playerName != null">
player_name,
</if>
<if test="userId != null">
user_id,
</if>
<if test="videoUrlOne != null">
video_url_one,
</if>
<if test="videoUrlTwo != null">
video_url_two,
</if>
<if test="createdAt != null">
created_at,
</if>
<if test="updatedAt != null">
updated_at,
</if>
<if test="recStatus != null">
rec_status,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
<if test="companyId != null">
#{companyId,jdbcType=BIGINT},
</if>
<if test="companyName != null">
#{companyName,jdbcType=VARCHAR},
</if>
<if test="playerName != null">
#{playerName,jdbcType=VARCHAR},
</if>
<if test="userId != null">
#{userId,jdbcType=BIGINT},
</if>
<if test="videoUrlOne != null">
#{videoUrlOne,jdbcType=VARCHAR},
</if>
<if test="videoUrlTwo != null">
#{videoUrlTwo,jdbcType=VARCHAR},
</if>
<if test="createdAt != null">
#{createdAt,jdbcType=TIMESTAMP},
</if>
<if test="updatedAt != null">
#{updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="recStatus != null">
#{recStatus,jdbcType=TINYINT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.ccsens.mt.bean.po.CompeteSpeedVideoExample" resultType="java.lang.Long">
select count(*) from t_compete_speed_video
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
update t_compete_speed_video
<set>
<if test="record.id != null">
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.companyId != null">
company_id = #{record.companyId,jdbcType=BIGINT},
</if>
<if test="record.companyName != null">
company_name = #{record.companyName,jdbcType=VARCHAR},
</if>
<if test="record.playerName != null">
player_name = #{record.playerName,jdbcType=VARCHAR},
</if>
<if test="record.userId != null">
user_id = #{record.userId,jdbcType=BIGINT},
</if>
<if test="record.videoUrlOne != null">
video_url_one = #{record.videoUrlOne,jdbcType=VARCHAR},
</if>
<if test="record.videoUrlTwo != null">
video_url_two = #{record.videoUrlTwo,jdbcType=VARCHAR},
</if>
<if test="record.createdAt != null">
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
</if>
<if test="record.updatedAt != null">
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="record.recStatus != null">
rec_status = #{record.recStatus,jdbcType=TINYINT},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
update t_compete_speed_video
set id = #{record.id,jdbcType=BIGINT},
company_id = #{record.companyId,jdbcType=BIGINT},
company_name = #{record.companyName,jdbcType=VARCHAR},
player_name = #{record.playerName,jdbcType=VARCHAR},
user_id = #{record.userId,jdbcType=BIGINT},
video_url_one = #{record.videoUrlOne,jdbcType=VARCHAR},
video_url_two = #{record.videoUrlTwo,jdbcType=VARCHAR},
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
rec_status = #{record.recStatus,jdbcType=TINYINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.ccsens.mt.bean.po.CompeteSpeedVideo">
update t_compete_speed_video
<set>
<if test="companyId != null">
company_id = #{companyId,jdbcType=BIGINT},
</if>
<if test="companyName != null">
company_name = #{companyName,jdbcType=VARCHAR},
</if>
<if test="playerName != null">
player_name = #{playerName,jdbcType=VARCHAR},
</if>
<if test="userId != null">
user_id = #{userId,jdbcType=BIGINT},
</if>
<if test="videoUrlOne != null">
video_url_one = #{videoUrlOne,jdbcType=VARCHAR},
</if>
<if test="videoUrlTwo != null">
video_url_two = #{videoUrlTwo,jdbcType=VARCHAR},
</if>
<if test="createdAt != null">
created_at = #{createdAt,jdbcType=TIMESTAMP},
</if>
<if test="updatedAt != null">
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
</if>
<if test="recStatus != null">
rec_status = #{recStatus,jdbcType=TINYINT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.ccsens.mt.bean.po.CompeteSpeedVideo">
update t_compete_speed_video
set company_id = #{companyId,jdbcType=BIGINT},
company_name = #{companyName,jdbcType=VARCHAR},
player_name = #{playerName,jdbcType=VARCHAR},
user_id = #{userId,jdbcType=BIGINT},
video_url_one = #{videoUrlOne,jdbcType=VARCHAR},
video_url_two = #{videoUrlTwo,jdbcType=VARCHAR},
created_at = #{createdAt,jdbcType=TIMESTAMP},
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
rec_status = #{recStatus,jdbcType=TINYINT}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>

42
mt/src/main/resources/mapper_raw/CompeteVideoMapper.xml

@ -13,6 +13,8 @@
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
<result column="rec_status" jdbcType="TINYINT" property="recStatus" />
<result column="task_id" jdbcType="VARCHAR" property="taskId" />
<result column="video_url_origin" jdbcType="VARCHAR" property="videoUrlOrigin" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
@ -74,7 +76,7 @@
</sql>
<sql id="Base_Column_List">
id, compete_time_id, project_id, player_id, user_id, video_url, upload_time, upload_status,
created_at, updated_at, rec_status
created_at, updated_at, rec_status, task_id, video_url_origin
</sql>
<select id="selectByExample" parameterType="com.ccsens.mt.bean.po.CompeteVideoExample" resultMap="BaseResultMap">
select
@ -110,11 +112,13 @@
insert into t_compete_video (id, compete_time_id, project_id,
player_id, user_id, video_url,
upload_time, upload_status, created_at,
updated_at, rec_status)
updated_at, rec_status, task_id,
video_url_origin)
values (#{id,jdbcType=BIGINT}, #{competeTimeId,jdbcType=BIGINT}, #{projectId,jdbcType=BIGINT},
#{playerId,jdbcType=BIGINT}, #{userId,jdbcType=BIGINT}, #{videoUrl,jdbcType=VARCHAR},
#{uploadTime,jdbcType=BIGINT}, #{uploadStatus,jdbcType=TINYINT}, #{createdAt,jdbcType=TIMESTAMP},
#{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT})
#{updatedAt,jdbcType=TIMESTAMP}, #{recStatus,jdbcType=TINYINT}, #{taskId,jdbcType=VARCHAR},
#{videoUrlOrigin,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.ccsens.mt.bean.po.CompeteVideo">
insert into t_compete_video
@ -152,6 +156,12 @@
<if test="recStatus != null">
rec_status,
</if>
<if test="taskId != null">
task_id,
</if>
<if test="videoUrlOrigin != null">
video_url_origin,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
@ -187,6 +197,12 @@
<if test="recStatus != null">
#{recStatus,jdbcType=TINYINT},
</if>
<if test="taskId != null">
#{taskId,jdbcType=VARCHAR},
</if>
<if test="videoUrlOrigin != null">
#{videoUrlOrigin,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.ccsens.mt.bean.po.CompeteVideoExample" resultType="java.lang.Long">
@ -231,6 +247,12 @@
<if test="record.recStatus != null">
rec_status = #{record.recStatus,jdbcType=TINYINT},
</if>
<if test="record.taskId != null">
task_id = #{record.taskId,jdbcType=VARCHAR},
</if>
<if test="record.videoUrlOrigin != null">
video_url_origin = #{record.videoUrlOrigin,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
@ -248,7 +270,9 @@
upload_status = #{record.uploadStatus,jdbcType=TINYINT},
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
rec_status = #{record.recStatus,jdbcType=TINYINT}
rec_status = #{record.recStatus,jdbcType=TINYINT},
task_id = #{record.taskId,jdbcType=VARCHAR},
video_url_origin = #{record.videoUrlOrigin,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
@ -286,6 +310,12 @@
<if test="recStatus != null">
rec_status = #{recStatus,jdbcType=TINYINT},
</if>
<if test="taskId != null">
task_id = #{taskId,jdbcType=VARCHAR},
</if>
<if test="videoUrlOrigin != null">
video_url_origin = #{videoUrlOrigin,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
@ -300,7 +330,9 @@
upload_status = #{uploadStatus,jdbcType=TINYINT},
created_at = #{createdAt,jdbcType=TIMESTAMP},
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
rec_status = #{recStatus,jdbcType=TINYINT}
rec_status = #{recStatus,jdbcType=TINYINT},
task_id = #{taskId,jdbcType=VARCHAR},
video_url_origin = #{videoUrlOrigin,jdbcType=VARCHAR}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>

2
pom.xml

@ -12,6 +12,8 @@
<!-- <module>ht</module>-->
<module>game</module>
<module>mt</module>
<module>wisdomcar</module>
<module>signin</module>
<!-- <module>pims</module>-->
<!-- <module>health</module>-->
<!-- <module>ct</module>-->

33
signin/.gitignore

@ -0,0 +1,33 @@
HELP.md
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/
### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/
### VS Code ###
.vscode/

322
signin/mvnw

@ -0,0 +1,322 @@
#!/bin/sh
# ----------------------------------------------------------------------------
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
# ----------------------------------------------------------------------------
# ----------------------------------------------------------------------------
# Maven Start Up Batch script
#
# Required ENV vars:
# ------------------
# JAVA_HOME - location of a JDK home dir
#
# Optional ENV vars
# -----------------
# M2_HOME - location of maven2's installed home dir
# MAVEN_OPTS - parameters passed to the Java VM when running Maven
# e.g. to debug Maven itself, use
# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
# MAVEN_SKIP_RC - flag to disable loading of mavenrc files
# ----------------------------------------------------------------------------
if [ -z "$MAVEN_SKIP_RC" ]; then
if [ -f /etc/mavenrc ]; then
. /etc/mavenrc
fi
if [ -f "$HOME/.mavenrc" ]; then
. "$HOME/.mavenrc"
fi
fi
# OS specific support. $var _must_ be set to either true or false.
cygwin=false
darwin=false
mingw=false
case "$(uname)" in
CYGWIN*) cygwin=true ;;
MINGW*) mingw=true ;;
Darwin*)
darwin=true
# Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home
# See https://developer.apple.com/library/mac/qa/qa1170/_index.html
if [ -z "$JAVA_HOME" ]; then
if [ -x "/usr/libexec/java_home" ]; then
export JAVA_HOME="$(/usr/libexec/java_home)"
else
export JAVA_HOME="/Library/Java/Home"
fi
fi
;;
esac
if [ -z "$JAVA_HOME" ]; then
if [ -r /etc/gentoo-release ]; then
JAVA_HOME=$(java-config --jre-home)
fi
fi
if [ -z "$M2_HOME" ]; then
## resolve links - $0 may be a link to maven's home
PRG="$0"
# need this for relative symlinks
while [ -h "$PRG" ]; do
ls=$(ls -ld "$PRG")
link=$(expr "$ls" : '.*-> \(.*\)$')
if expr "$link" : '/.*' >/dev/null; then
PRG="$link"
else
PRG="$(dirname "$PRG")/$link"
fi
done
saveddir=$(pwd)
M2_HOME=$(dirname "$PRG")/..
# make it fully qualified
M2_HOME=$(cd "$M2_HOME" && pwd)
cd "$saveddir"
# echo Using m2 at $M2_HOME
fi
# For Cygwin, ensure paths are in UNIX format before anything is touched
if $cygwin; then
[ -n "$M2_HOME" ] &&
M2_HOME=$(cygpath --unix "$M2_HOME")
[ -n "$JAVA_HOME" ] &&
JAVA_HOME=$(cygpath --unix "$JAVA_HOME")
[ -n "$CLASSPATH" ] &&
CLASSPATH=$(cygpath --path --unix "$CLASSPATH")
fi
# For Mingw, ensure paths are in UNIX format before anything is touched
if $mingw; then
[ -n "$M2_HOME" ] &&
M2_HOME="$( (
cd "$M2_HOME"
pwd
))"
[ -n "$JAVA_HOME" ] &&
JAVA_HOME="$( (
cd "$JAVA_HOME"
pwd
))"
fi
if [ -z "$JAVA_HOME" ]; then
javaExecutable="$(which javac)"
if [ -n "$javaExecutable" ] && ! [ "$(expr \"$javaExecutable\" : '\([^ ]*\)')" = "no" ]; then
# readlink(1) is not available as standard on Solaris 10.
readLink=$(which readlink)
if [ ! $(expr "$readLink" : '\([^ ]*\)') = "no" ]; then
if $darwin; then
javaHome="$(dirname \"$javaExecutable\")"
javaExecutable="$(cd \"$javaHome\" && pwd -P)/javac"
else
javaExecutable="$(readlink -f \"$javaExecutable\")"
fi
javaHome="$(dirname \"$javaExecutable\")"
javaHome=$(expr "$javaHome" : '\(.*\)/bin')
JAVA_HOME="$javaHome"
export JAVA_HOME
fi
fi
fi
if [ -z "$JAVACMD" ]; then
if [ -n "$JAVA_HOME" ]; then
if [ -x "$JAVA_HOME/jre/sh/java" ]; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
else
JAVACMD="$(which java)"
fi
fi
if [ ! -x "$JAVACMD" ]; then
echo "Error: JAVA_HOME is not defined correctly." >&2
echo " We cannot execute $JAVACMD" >&2
exit 1
fi
if [ -z "$JAVA_HOME" ]; then
echo "Warning: JAVA_HOME environment variable is not set."
fi
CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
# traverses directory structure from process work directory to filesystem root
# first directory with .mvn subdirectory is considered project base directory
find_maven_basedir() {
if [ -z "$1" ]; then
echo "Path not specified to find_maven_basedir"
return 1
fi
basedir="$1"
wdir="$1"
while [ "$wdir" != '/' ]; do
if [ -d "$wdir"/.mvn ]; then
basedir=$wdir
break
fi
# workaround for JBEAP-8937 (on Solaris 10/Sparc)
if [ -d "${wdir}" ]; then
wdir=$(
cd "$wdir/.."
pwd
)
fi
# end of workaround
done
echo "${basedir}"
}
# concatenates all lines of a file
concat_lines() {
if [ -f "$1" ]; then
echo "$(tr -s '\n' ' ' <"$1")"
fi
}
BASE_DIR=$(find_maven_basedir "$(pwd)")
if [ -z "$BASE_DIR" ]; then
exit 1
fi
##########################################################################################
# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
# This allows using the maven wrapper in projects that prohibit checking in binary data.
##########################################################################################
if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then
if [ "$MVNW_VERBOSE" = true ]; then
echo "Found .mvn/wrapper/maven-wrapper.jar"
fi
else
if [ "$MVNW_VERBOSE" = true ]; then
echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..."
fi
if [ -n "$MVNW_REPOURL" ]; then
jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
else
jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
fi
while IFS="=" read key value; do
case "$key" in wrapperUrl)
jarUrl="$value"
break
;;
esac
done <"$BASE_DIR/.mvn/wrapper/maven-wrapper.properties"
if [ "$MVNW_VERBOSE" = true ]; then
echo "Downloading from: $jarUrl"
fi
wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar"
if $cygwin; then
wrapperJarPath=$(cygpath --path --windows "$wrapperJarPath")
fi
if command -v wget >/dev/null; then
if [ "$MVNW_VERBOSE" = true ]; then
echo "Found wget ... using wget"
fi
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
wget "$jarUrl" -O "$wrapperJarPath"
else
wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath"
fi
elif command -v curl >/dev/null; then
if [ "$MVNW_VERBOSE" = true ]; then
echo "Found curl ... using curl"
fi
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
curl -o "$wrapperJarPath" "$jarUrl" -f
else
curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f
fi
else
if [ "$MVNW_VERBOSE" = true ]; then
echo "Falling back to using Java to download"
fi
javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java"
# For Cygwin, switch paths to Windows format before running javac
if $cygwin; then
javaClass=$(cygpath --path --windows "$javaClass")
fi
if [ -e "$javaClass" ]; then
if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
if [ "$MVNW_VERBOSE" = true ]; then
echo " - Compiling MavenWrapperDownloader.java ..."
fi
# Compiling the Java class
("$JAVA_HOME/bin/javac" "$javaClass")
fi
if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
# Running the downloader
if [ "$MVNW_VERBOSE" = true ]; then
echo " - Running MavenWrapperDownloader.java ..."
fi
("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR")
fi
fi
fi
fi
##########################################################################################
# End of extension
##########################################################################################
export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}
if [ "$MVNW_VERBOSE" = true ]; then
echo $MAVEN_PROJECTBASEDIR
fi
MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
# For Cygwin, switch paths to Windows format before running java
if $cygwin; then
[ -n "$M2_HOME" ] &&
M2_HOME=$(cygpath --path --windows "$M2_HOME")
[ -n "$JAVA_HOME" ] &&
JAVA_HOME=$(cygpath --path --windows "$JAVA_HOME")
[ -n "$CLASSPATH" ] &&
CLASSPATH=$(cygpath --path --windows "$CLASSPATH")
[ -n "$MAVEN_PROJECTBASEDIR" ] &&
MAVEN_PROJECTBASEDIR=$(cygpath --path --windows "$MAVEN_PROJECTBASEDIR")
fi
# Provide a "standardized" way to retrieve the CLI args that will
# work with both Windows and non-Windows executions.
MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@"
export MAVEN_CMD_LINE_ARGS
WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
exec "$JAVACMD" \
$MAVEN_OPTS \
-classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
"-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"

182
signin/mvnw.cmd

@ -0,0 +1,182 @@
@REM ----------------------------------------------------------------------------
@REM Licensed to the Apache Software Foundation (ASF) under one
@REM or more contributor license agreements. See the NOTICE file
@REM distributed with this work for additional information
@REM regarding copyright ownership. The ASF licenses this file
@REM to you under the Apache License, Version 2.0 (the
@REM "License"); you may not use this file except in compliance
@REM with the License. You may obtain a copy of the License at
@REM
@REM https://www.apache.org/licenses/LICENSE-2.0
@REM
@REM Unless required by applicable law or agreed to in writing,
@REM software distributed under the License is distributed on an
@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@REM KIND, either express or implied. See the License for the
@REM specific language governing permissions and limitations
@REM under the License.
@REM ----------------------------------------------------------------------------
@REM ----------------------------------------------------------------------------
@REM Maven Start Up Batch script
@REM
@REM Required ENV vars:
@REM JAVA_HOME - location of a JDK home dir
@REM
@REM Optional ENV vars
@REM M2_HOME - location of maven2's installed home dir
@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending
@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
@REM e.g. to debug Maven itself, use
@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
@REM ----------------------------------------------------------------------------
@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
@echo off
@REM set title of command window
title %0
@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on'
@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
@REM set %HOME% to equivalent of $HOME
if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
@REM Execute a user defined script before this one
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
@REM check for pre script, once with legacy .bat ending and once with .cmd ending
if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat"
if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd"
:skipRcPre
@setlocal
set ERROR_CODE=0
@REM To isolate internal variables from possible post scripts, we use another setlocal
@setlocal
@REM ==== START VALIDATION ====
if not "%JAVA_HOME%" == "" goto OkJHome
echo.
echo Error: JAVA_HOME not found in your environment. >&2
echo Please set the JAVA_HOME variable in your environment to match the >&2
echo location of your Java installation. >&2
echo.
goto error
:OkJHome
if exist "%JAVA_HOME%\bin\java.exe" goto init
echo.
echo Error: JAVA_HOME is set to an invalid directory. >&2
echo JAVA_HOME = "%JAVA_HOME%" >&2
echo Please set the JAVA_HOME variable in your environment to match the >&2
echo location of your Java installation. >&2
echo.
goto error
@REM ==== END VALIDATION ====
:init
@REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
@REM Fallback to current working directory if not found.
set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
set EXEC_DIR=%CD%
set WDIR=%EXEC_DIR%
:findBaseDir
IF EXIST "%WDIR%"\.mvn goto baseDirFound
cd ..
IF "%WDIR%"=="%CD%" goto baseDirNotFound
set WDIR=%CD%
goto findBaseDir
:baseDirFound
set MAVEN_PROJECTBASEDIR=%WDIR%
cd "%EXEC_DIR%"
goto endDetectBaseDir
:baseDirNotFound
set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
cd "%EXEC_DIR%"
:endDetectBaseDir
IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
@setlocal EnableExtensions EnableDelayedExpansion
for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
:endReadAdditionalConfig
SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO (
IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B
)
@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
@REM This allows using the maven wrapper in projects that prohibit checking in binary data.
if exist %WRAPPER_JAR% (
if "%MVNW_VERBOSE%" == "true" (
echo Found %WRAPPER_JAR%
)
) else (
if not "%MVNW_REPOURL%" == "" (
SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
)
if "%MVNW_VERBOSE%" == "true" (
echo Couldn't find %WRAPPER_JAR%, downloading it ...
echo Downloading from: %DOWNLOAD_URL%
)
powershell -Command "&{"^
"$webclient = new-object System.Net.WebClient;"^
"if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^
"$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^
"}"^
"[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^
"}"
if "%MVNW_VERBOSE%" == "true" (
echo Finished downloading %WRAPPER_JAR%
)
)
@REM End of extension
@REM Provide a "standardized" way to retrieve the CLI args that will
@REM work with both Windows and non-Windows executions.
set MAVEN_CMD_LINE_ARGS=%*
%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
if ERRORLEVEL 1 goto error
goto end
:error
set ERROR_CODE=1
:end
@endlocal & set ERROR_CODE=%ERROR_CODE%
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost
@REM check for post script, once with legacy .bat ending and once with .cmd ending
if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"
if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd"
:skipRcPost
@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
if "%MAVEN_BATCH_PAUSE%" == "on" pause
if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE%
exit /B %ERROR_CODE%

69
signin/pom.xml

@ -0,0 +1,69 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>ccsenscloud</artifactId>
<groupId>com.ccsens</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>signin</artifactId>
<properties>
<java.version>1.8</java.version>
</properties>
<dependencies>
<!--cloud 工具类-->
<dependency>
<artifactId>cloudutil</artifactId>
<groupId>com.ccsens</groupId>
<version>1.0-SNAPSHOT</version>
</dependency>
<!--util 工具类-->
<dependency>
<artifactId>util</artifactId>
<groupId>com.ccsens</groupId>
<version>1.0-SNAPSHOT</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.mybatis.generator</groupId>
<artifactId>mybatis-generator-maven-plugin</artifactId>
<version>1.3.7</version>
<configuration>
<configurationFile>${basedir}/src/main/resources/mbg.xml</configurationFile>
<overwrite>true</overwrite>
</configuration>
<dependencies>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.34</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<mainClass>com.ccsens.signin.SigninApplication</mainClass>
<!--<skip>true</skip>-->
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

24
signin/src/main/java/com/ccsens/signin/SigninApplication.java

@ -0,0 +1,24 @@
package com.ccsens.signin;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.scheduling.annotation.EnableAsync;
@MapperScan(basePackages = {"com.ccsens.signin.persist.*"})
@ServletComponentScan
@EnableAsync
//开启断路器功能
@EnableCircuitBreaker
@EnableFeignClients(basePackages = "com.ccsens.cloudutil.feign")
@SpringBootApplication(scanBasePackages = "com.ccsens")
public class SigninApplication {
public static void main(String[] args) {
SpringApplication.run(SigninApplication.class, args);
}
}

29
signin/src/main/java/com/ccsens/signin/api/DebugController.java

@ -0,0 +1,29 @@
package com.ccsens.wisdomcar.api;
import com.ccsens.util.JsonResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
@Api(tags = "DEBUG" , description = "DebugController | ")
@RestController
@RequestMapping("/debug")
@Slf4j
public class DebugController {
@ApiOperation(value = "/测试",notes = "")
@ApiImplicitParams({
})
@RequestMapping(value="",method = RequestMethod.GET,produces = {"application/json;charset=UTF-8"})
public JsonResponse debug(HttpServletRequest request) throws Exception {
return JsonResponse.newInstance().ok("测试");
}
}

478
signin/src/main/java/com/ccsens/signin/api/UserController.java

@ -0,0 +1,478 @@
package com.ccsens.signin.api;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.extra.servlet.ServletUtil;
import com.ccsens.signin.bean.dto.UserDto;
import com.ccsens.signin.bean.vo.UserVo;
import com.ccsens.signin.exception.UserLoginException;
import com.ccsens.signin.service.IUserService;
import com.ccsens.util.CodeEnum;
import com.ccsens.util.JsonResponse;
import com.ccsens.util.JwtUtil;
import com.ccsens.util.WebConstant;
import io.jsonwebtoken.Claims;
import io.jsonwebtoken.ExpiredJwtException;
import io.jsonwebtoken.SignatureException;
import io.swagger.annotations.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Map;
@Slf4j
@Api(tags = "用户相关操作API", description = "UserController | 用户操作控制器类")
@RestController
@RequestMapping("/users")
public class UserController {
@Autowired
private IUserService userService;
// @Autowired
// private IProMemberService proMemberService;
@ApiOperation(value = "/用户登录", notes = "")
@ApiImplicitParams({
})
@RequestMapping(value = "/signin", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse<UserVo.TokenBean> userSignin(HttpServletRequest request,
@ApiParam @Validated @RequestBody(required = true) UserDto.UserSginin dto) throws Exception {
log.info("开始登陆:{}",dto);
Long start = System.currentTimeMillis();
WebConstant.CLIENT_TYPE clientType = WebConstant.CLIENT_TYPE.valueOf(dto.getClient());
WebConstant.IDENTIFY_TYPE identify_type = WebConstant.IDENTIFY_TYPE.valueOf(dto.getType());
String identifier = dto.getData().getIdentifier();
String credential = dto.getData().getCredential();
//1.验证参数
switch (clientType) {
case Wxmp:
case H5:
case Android:
case IOS:
case WxEnterprise:
break;
default:
throw new UserLoginException(-1, String.format("Not supported client type: %1$d(%2$s)",
clientType.value, clientType));
}
log.info("登录场景");
switch (identify_type) {
case WxEnterprise:
case Wxmp:
case OAUTH2_Wx:
case Wx_H5:
case OAUTH2_WeiBo: {
break;
}
case Phone:
case Email:
case Account: {
if (StrUtil.isEmpty(credential)) {
String msg = "credential is required when type is %1$d(%2$s)";
throw new UserLoginException(-2, String.format(msg, identify_type.value, identify_type.phase));
}
break;
}
default: {
throw new UserLoginException(-2, String.format("Not supported signin type: %1$d(%2$s)",
identify_type.value, identify_type.phase));
}
}
log.info("登录方式");
//2.调用业务方法(注册/添加登陆记录)
UserVo.UserSign userSignVo = userService.signin(
clientType, identify_type, identifier, credential,
ServletUtil.getClientIP(request), dto.getRedirect());
//3.生成token(access_token,refresh_token)
if (ObjectUtil.isNotNull(userSignVo)) {
Map<String, Object> theMap = CollectionUtil.newHashMap();
theMap.put("authId", String.valueOf(userSignVo.getAuthId()));
UserVo.TokenBean tokenBean = userService.getUserInfoAndToken(clientType, identify_type,userSignVo, theMap);
Long end = System.currentTimeMillis();
log.info("本次登录使用了{}毫秒",end - start);
log.info("登录返回:{}",tokenBean);
return JsonResponse.newInstance().ok(tokenBean);
} else {
return JsonResponse.newInstance().fail("登陆信息不正确.");
}
}
@ApiOperation(value = "/发送验证码", notes = "")
@ApiImplicitParams({
})
@RequestMapping(value = "/smscode", method = RequestMethod.GET, produces = {"application/json;charset=UTF-8"})
public JsonResponse<UserVo.SmsCode> getSmsCode(HttpServletRequest request,
@ApiParam @RequestParam String phone,
// @ApiParam Integer client,
@RequestParam(required = true) String verificationCodeId, String verificationCodeValue) throws Exception {
log.info("发送验证码,手机号:{},图形验证码id:{},值:{}",phone,verificationCodeId,verificationCodeValue);
UserVo.SmsCode smsCodeVo = userService.getSignInSmsCode(phone,verificationCodeId,verificationCodeValue);
return JsonResponse.newInstance().ok(smsCodeVo);
}
@ApiOperation(value = "/注册", notes = "")
@ApiImplicitParams({
})
@RequestMapping(value = "/signup", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse<UserVo.TokenBean> registerUser(HttpServletRequest request,
@ApiParam @Validated @RequestBody(required = true) UserDto.UserSignup userSignup) throws Exception {
UserVo.UserSign userSignVo = userService.registerUser(userSignup);
//3.生成token(access_token,refresh_token)
if (ObjectUtil.isNotNull(userSignVo)) {
WebConstant.CLIENT_TYPE clientType = WebConstant.CLIENT_TYPE.valueOf(1);
WebConstant.IDENTIFY_TYPE identifyType = WebConstant.IDENTIFY_TYPE.valueOf(3);
Map<String, Object> theMap = CollectionUtil.newHashMap();
theMap.put("authId", String.valueOf(userSignVo.getAuthId()));
UserVo.TokenBean tokenBean = userService.getUserInfoAndToken(clientType, identifyType,userSignVo, theMap);
return JsonResponse.newInstance().ok(tokenBean);
} else {
return JsonResponse.newInstance().fail("登陆信息不正确.");
}
}
@ApiOperation(value = "/注册(不需要手机号)", notes = "")
@ApiImplicitParams({
})
@RequestMapping(value = "/signup/system", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse<UserVo.TokenBean> systemRegister(HttpServletRequest request,
@ApiParam @Validated @RequestBody(required = true) UserDto.UserSignupSystem userSignup) throws Exception {
UserVo.Account account = userService.systemRegister(userSignup);
return JsonResponse.newInstance().ok(account);
}
@ApiOperation(value = "/检查账号是否被注册", notes = "")
@ApiImplicitParams({
})
@RequestMapping(value = "/account", method = RequestMethod.GET, produces = {"application/json;charset=UTF-8"})
public JsonResponse<Boolean> accounts(@ApiParam @RequestParam String account) throws Exception {
Boolean flag = userService.findAccount(account);
return JsonResponse.newInstance().ok(flag);
}
@ApiOperation(value = "/检查手机号是否被注册", notes = "")
@ApiImplicitParams({
})
@RequestMapping(value = "/phone", method = RequestMethod.GET, produces = {"application/json;charset=UTF-8"})
public JsonResponse<Boolean> findPhone(@ApiParam @RequestParam String phone) throws Exception {
Boolean flag = userService.findPhone(phone);
return JsonResponse.newInstance().ok(flag);
}
// @ApiOperation(value = "/修改账号信息",notes = "")
// @ApiImplicitParams({
// })
// @RequestMapping(value="/account",method = RequestMethod.POST,produces = {"application/json;charset=UTF-8"})
// public JsonResponse updateAccount(HttpServletRequest request,@ApiParam @RequestBody UserDto.Account account) throws Exception {
// userService.updateAccount(account);
// return JsonResponse.newInstance().ok();
// }
@ApiOperation(value = "/微信合并已有账号",notes = "")
@ApiImplicitParams({
})
@RequestMapping(value="/merge",method = RequestMethod.POST,produces = {"application/json;charset=UTF-8"})
public JsonResponse<UserVo.TokenBean> bindingPhone(HttpServletRequest request,
@ApiParam @RequestBody UserDto.WxMergePhone wxPhone) throws Exception {
Long currentUserId = Long.valueOf(((Claims) request.getAttribute(WebConstant.REQUEST_KEY_CLAIMS)).getSubject());
UserVo.UserSign userSignVo = userService.mergeByPhone(currentUserId,wxPhone);
UserVo.TokenBean tokenBean = null;
if (ObjectUtil.isNotNull(userSignVo)) {
WebConstant.CLIENT_TYPE clientType = WebConstant.CLIENT_TYPE.valueOf(1);
WebConstant.IDENTIFY_TYPE identifyType = WebConstant.IDENTIFY_TYPE.valueOf(3);
Map<String, Object> theMap = CollectionUtil.newHashMap();
theMap.put("authId", String.valueOf(userSignVo.getAuthId()));
tokenBean = userService.getUserInfoAndToken(clientType, identifyType,userSignVo, theMap);
}
return JsonResponse.newInstance().ok(tokenBean);
}
@ApiOperation(value = "/微信绑定账号",notes = "")
@ApiImplicitParams({
})
@RequestMapping(value="/binding",method = RequestMethod.POST,produces = {"application/json;charset=UTF-8"})
public JsonResponse<UserVo.TokenBean> bindingPhone(HttpServletRequest request,
@ApiParam @RequestBody UserDto.WxBindingPhone wxPhone) throws Exception {
Long currentUserId = Long.valueOf(((Claims) request.getAttribute(WebConstant.REQUEST_KEY_CLAIMS)).getSubject());
UserVo.UserSign userSignVo = userService.bindingNewPhone(currentUserId,wxPhone);
UserVo.TokenBean tokenBean = null;
if (ObjectUtil.isNotNull(userSignVo)) {
WebConstant.CLIENT_TYPE clientType = WebConstant.CLIENT_TYPE.valueOf(1);
WebConstant.IDENTIFY_TYPE identifyType = WebConstant.IDENTIFY_TYPE.valueOf(3);
Map<String, Object> theMap = CollectionUtil.newHashMap();
theMap.put("authId", String.valueOf(userSignVo.getAuthId()));
tokenBean = userService.getUserInfoAndToken(clientType,identifyType, userSignVo, theMap);
}
return JsonResponse.newInstance().ok(tokenBean);
}
@ApiOperation(value = "/更改绑定手机", notes = "")
@ApiImplicitParams({
})
@RequestMapping(value = "/upPhone", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse updatePhone(HttpServletRequest request,
@ApiParam @RequestBody UserDto.UpdatePhone updatePhone) throws Exception {
Long currentUserId = Long.valueOf(((Claims) request.getAttribute(WebConstant.REQUEST_KEY_CLAIMS)).getSubject());
userService.updatePhone(currentUserId, updatePhone);
return JsonResponse.newInstance().ok();
}
@ApiOperation(value = "/修改用户信息", notes = "")
@ApiImplicitParams({
})
@RequestMapping(value = "/userInfo", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse<UserVo.WxInfo> updateUserInfo(HttpServletRequest request,
@ApiParam @RequestBody UserDto.WxInfo userInfo) throws Exception {
log.info("修改用户信息,{}",userInfo);
Long currentUserId = Long.valueOf(((Claims) request.getAttribute(WebConstant.REQUEST_KEY_CLAIMS)).getSubject());
UserVo.WxInfo wxInfo = userService.updateUserInfo(currentUserId, userInfo);
return JsonResponse.newInstance().ok(wxInfo);
}
@ApiOperation(value = "通过手机号修改密码", notes = "")
@ApiImplicitParams({
})
@RequestMapping(value = "/password", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse updatePassword(HttpServletRequest request,
@ApiParam @Validated @RequestBody UserDto.UpdatePassword passwordDto) throws Exception {
userService.updatePassword(passwordDto);
return JsonResponse.newInstance().ok();
}
@ApiOperation(value = "通过账号密码修改密码", notes = "")
@ApiImplicitParams({
})
@RequestMapping(value = "/password/account", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse updatePasswordByAccount(HttpServletRequest request,
@ApiParam @Validated @RequestBody UserDto.UpdatePasswordByAccount passwordDto) throws Exception {
userService.updatePasswordByAccount(passwordDto);
return JsonResponse.newInstance().ok();
}
@ApiOperation(value = "解绑手机号", notes = "")
@ApiImplicitParams({
})
@RequestMapping(value = "/relievePhone", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse relievePhone(HttpServletRequest request,
@ApiParam @Validated @RequestBody UserDto.WxBindingPhone phoneInfo) throws Exception {
Long currentUserId = Long.valueOf(((Claims) request.getAttribute(WebConstant.REQUEST_KEY_CLAIMS)).getSubject());
userService.relievePhone(currentUserId,phoneInfo);
return JsonResponse.newInstance().ok();
}
@ApiOperation(value = "直接更改手机号(不用输入密码)", notes = "")
@ApiImplicitParams({
})
@RequestMapping(value = "/changePhone", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse changePhone(HttpServletRequest request,
@ApiParam @Validated @RequestBody UserDto.WxBindingPhone phoneInfo) throws Exception {
Long currentUserId = Long.valueOf(((Claims) request.getAttribute(WebConstant.REQUEST_KEY_CLAIMS)).getSubject());
UserVo.UserSign userSignVo = userService.changePhoneNotPassword(currentUserId,phoneInfo);
UserVo.TokenBean tokenBean = null;
if (ObjectUtil.isNotNull(userSignVo)) {
WebConstant.CLIENT_TYPE clientType = WebConstant.CLIENT_TYPE.valueOf(1);
WebConstant.IDENTIFY_TYPE identifyType = WebConstant.IDENTIFY_TYPE.valueOf(3);
Map<String, Object> theMap = CollectionUtil.newHashMap();
theMap.put("authId", String.valueOf(userSignVo.getAuthId()));
tokenBean = userService.getUserInfoAndToken(clientType, identifyType,userSignVo, theMap);
}
return JsonResponse.newInstance().ok(tokenBean);
}
// @ApiOperation(value = "查询用户是否关注某个项目",notes = "")
// @ApiImplicitParams({
// @ApiImplicitParam(name="projectId",value = "projectId",required = true,paramType = "query")
// })
// @RequestMapping(value = "/attention",method = RequestMethod.GET,produces = {"application/json;charset=UTF-8"})
// public JsonResponse<UserVo.TokenToUserId> getIsAttention(HttpServletRequest request,
// @RequestParam(required = true) Long projectId) throws Exception {
// Long currentUserId = Long.valueOf(((Claims) request.getAttribute(WebConstant.REQUEST_KEY_CLAIMS)).getSubject());
//
// Boolean isAttention = userService.getIsAttention(currentUserId,projectId);
// return JsonResponse.newInstance().ok(isAttention);
// }
// @ApiOperation(value = "用户关注项目",notes = "")
// @ApiImplicitParams({
// @ApiImplicitParam(name="projectId",value = "projectId",required = true,paramType = "query")
// })
// @RequestMapping(value = "/attention",method = RequestMethod.POST,produces = {"application/json;charset=UTF-8"})
// public JsonResponse<UserVo.TokenToUserId> userAttentionProject(HttpServletRequest request,
// @ApiParam @Validated @RequestBody ProjectDto.ProjectIdDto projectIdDto) throws Exception {
// Long currentUserId = Long.valueOf(((Claims) request.getAttribute(WebConstant.REQUEST_KEY_CLAIMS)).getSubject());
// userService.userAttentionProject(currentUserId,projectIdDto);
// return JsonResponse.newInstance().ok();
// }
@ApiOperation(value = "输入两个userid将两个账号合并(保留企业用户的id)",notes = "")
@ApiImplicitParams({
@ApiImplicitParam(name="userId",value = "需要保留的userId",required = true,paramType = "query"),
@ApiImplicitParam(name="uselessId",value = "不需要保留的userId",required = true,paramType = "query")
})
@RequestMapping(value = "/mergeUserId",method = RequestMethod.GET,produces = {"application/json;charset=UTF-8"})
public JsonResponse mergeUserId(HttpServletRequest request,
@RequestParam(required = true) Long userId,Long uselessId) throws Exception {
userService.mergeUserId(userId,uselessId);
return JsonResponse.newInstance().ok();
}
@ApiOperation(value = "通过userId获取token",notes = "")
@ApiImplicitParams({
@ApiImplicitParam(name="userId",value = "用户id",required = true,paramType = "query")
})
@RequestMapping(value = "/userId",method = RequestMethod.GET,produces = {"application/json;charset=UTF-8"})
public JsonResponse<UserVo.TokenBean> getTokenByUserId(HttpServletRequest request,
@RequestParam(required = true) Long userId) throws Exception {
UserVo.TokenBean tokenBean = userService.getTokenByUserId(userId);
return JsonResponse.newInstance().ok(tokenBean);
}
/*===============================================================================================*/
@ApiOperation(value = "根据token获取userId",notes = "")
@ApiImplicitParams({
@ApiImplicitParam(name="token",value = "token",required = true,paramType = "query")
})
@RequestMapping(value = "claims",method = RequestMethod.GET,produces = {"application/json;charset=UTF-8"})
public String getNodeMessage(@RequestParam(required = true) String token) throws Exception {
log.info("根据token获取userId,token:{}",token);
//验证token是否有效
String userId = null;
Claims claims = null;
boolean flag = false;
if (token != null) {
try {
claims = JwtUtil.parseJWT(token, WebConstant.JWT_ACCESS_TOKEN_SECERT);
flag = true;
}catch(SignatureException e){
flag = false;
}catch(ExpiredJwtException e){
flag = false;
}catch(Exception e){
e.printStackTrace();
flag = false;
}
}
if(flag){
userId = claims.getSubject();
}
return userId;
}
@ApiOperation(value = "根据token字符串获取userId",notes = "")
@ApiImplicitParams({
@ApiImplicitParam(name="token",value = "token",required = true,paramType = "query")
})
@RequestMapping(value = "token",method = RequestMethod.GET,produces = {"application/json;charset=UTF-8"})
public JsonResponse<UserVo.TokenToUserId> getUserByToken(@RequestParam(required = true) String token) throws Exception {
long start = System.currentTimeMillis();
UserVo.TokenToUserId tokenToUserId = new UserVo.TokenToUserId();
// 验证token是否存在
String tokenStr = token;
if (tokenStr == null || !tokenStr.startsWith(WebConstant.HEADER_KEY_TOKEN_PREFIX)) {
return JsonResponse.newInstance().ok(CodeEnum.NOT_LOGIN);
}
String userToken = tokenStr.substring(WebConstant.HEADER_KEY_TOKEN_PREFIX.length());
//验证token是否有效
Claims claims = null;
try {
claims = JwtUtil.parseJWT(userToken, WebConstant.JWT_ACCESS_TOKEN_SECERT);
}catch(Exception e){
return JsonResponse.newInstance().ok(CodeEnum.NOT_LOGIN);
}
//验证用户存根
if(userService.tokenNotExistInCache(Long.valueOf(claims.getSubject()))){
return JsonResponse.newInstance().ok(CodeEnum.NOT_LOGIN);
}
// //验证用户是否禁用
// SysUser user = userService.getUserById(Long.valueOf(claims.getSubject()));
// if(user.getRecStatus() == WebConstant.REC_STATUS.Disabled.value){
// return JsonResponse.newInstance().ok(CodeEnum.NOT_LOGIN);
// }
tokenToUserId.setId(Long.valueOf(claims.getSubject()));
long end = System.currentTimeMillis();
log.info("根据token查找userId用时:{}",end - start);
return JsonResponse.newInstance().ok(tokenToUserId);
}
// /**
// * 查询user在项目中的member信息
// */
// @RequestMapping(value = "member", method = RequestMethod.GET, produces = {"application/json;charset=UTF-8"})
// public JsonResponse<MemberVo.MemberInfo> getMemberByUserIdAndProjectId( Long userId,Long projectId) throws Exception {
//
// MemberVo.MemberInfo memberInfo = proMemberService.getMemberByUserIdAndProjectId(userId,projectId);
// return JsonResponse.newInstance().ok(memberInfo);
// }
// /**
// * 查询user在项目中的member信息
// */
// @RequestMapping(value = "memberByTask", method = RequestMethod.GET, produces = {"application/json;charset=UTF-8"})
// public JsonResponse<MemberVo.MemberInfo> getMemberByUserIdAndTaskId( Long userId,Long taskId) throws Exception {
// log.info("根据任务ID和用户ID查询用户信息:{}-{}", userId, taskId);
// MemberVo.MemberInfo memberInfo = proMemberService.getMemberByUserIdAndTaskId(userId,taskId);
// log.info("用户信息:{}", memberInfo);
// return JsonResponse.newInstance().ok(memberInfo);
// }
// /**
// * 查询user的信息
// */
// @RequestMapping(value = "getUserInfo", method = RequestMethod.GET, produces = {"application/json;charset=UTF-8"})
// public JsonResponse<MemberVo.MemberInfo> getUserInfoByUserId(Long userId) throws Exception {
//
// MemberVo.MemberInfo memberInfo = proMemberService.getUserInfoByUserId(userId);
// return JsonResponse.newInstance().ok(memberInfo);
// }
// /**
// * 获取项目下的所有成员ID
// */
// @RequestMapping(value = "allMemberAll", method = RequestMethod.GET, produces = {"application/json;charset=UTF-8"})
// public List<Long> getMemberIdByProjectId(Long projectId) throws Exception {
//
// List<Long> memberIdInfo = proMemberService.getMemberIdByProjectId(projectId);
// return memberIdInfo;
// }
@ApiOperation(value = "图片验证码")
@ApiImplicitParams({
})
@RequestMapping(value = "/code", method = RequestMethod.GET, produces = {"application/json;charset=UTF-8"})
public JsonResponse<UserVo.VerificationCode> vertifyCode(HttpServletRequest request, HttpServletResponse response) throws Exception {
UserVo.VerificationCode vertifyCode = userService.getVertifyCode();
// ImageCodeGeneratorUtil.generateCodeImage(response.getOutputStream(), (String) codeMap.get("imageCode"), 200, 70);
return JsonResponse.newInstance().ok(vertifyCode);
}
}

89
signin/src/main/java/com/ccsens/signin/api/UserInfoController.java

@ -0,0 +1,89 @@
package com.ccsens.signin.api;
import com.ccsens.signin.bean.dto.UserDto;
import com.ccsens.signin.bean.vo.UserVo;
import com.ccsens.signin.service.IUserInfoService;
import com.ccsens.util.JsonResponse;
import com.ccsens.util.WebConstant;
import io.jsonwebtoken.Claims;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.Part;
/**
* @author
*/
@Api(tags = "用户详细信息操作API")
@RestController
@RequestMapping("/users/info")
public class UserInfoController {
@Resource
private IUserInfoService userInfoService;
@ApiOperation(value = "修改登录账号")
@ApiImplicitParams({
})
@RequestMapping(value = "/account", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse updateAccount(HttpServletRequest request,
@ApiParam @Validated @RequestBody UserDto.UpdateAccount updateAccount) throws Exception {
Long currentUserId = Long.valueOf(((Claims) request.getAttribute(WebConstant.REQUEST_KEY_CLAIMS)).getSubject());
userInfoService.updateAccount(currentUserId, updateAccount);
return JsonResponse.newInstance().ok();
}
@ApiOperation(value = "修改昵称")
@ApiImplicitParams({
})
@RequestMapping(value = "/nickname", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse updateNickname(HttpServletRequest request,
@ApiParam @Validated @RequestBody UserDto.UpdateNickname updateNickname) throws Exception {
Long currentUserId = Long.valueOf(((Claims) request.getAttribute(WebConstant.REQUEST_KEY_CLAIMS)).getSubject());
userInfoService.updateNickname(currentUserId, updateNickname);
return JsonResponse.newInstance().ok();
}
@ApiOperation(value = "上传头像")
@ApiImplicitParams({
})
@RequestMapping(value = "/avatarUrl", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse uploadAvatarUrl(HttpServletRequest request,
@RequestParam(required = true) Part file) throws Exception {
Long currentUserId = Long.valueOf(((Claims) request.getAttribute(WebConstant.REQUEST_KEY_CLAIMS)).getSubject());
userInfoService.uploadAvatarUrl(currentUserId,file);
return JsonResponse.newInstance().ok();
}
@ApiOperation(value = "查找用户详细信息")
@ApiImplicitParams({
})
@RequestMapping(value = "", method = RequestMethod.GET, produces = {"application/json;charset=UTF-8"})
public JsonResponse<UserVo.SelectUserInfo> selectUserInfo(HttpServletRequest request) throws Exception {
Long currentUserId = Long.valueOf(((Claims) request.getAttribute(WebConstant.REQUEST_KEY_CLAIMS)).getSubject());
UserVo.SelectUserInfo selectUserInfo = userInfoService.selectUserInfo(currentUserId);
return JsonResponse.newInstance().ok(selectUserInfo);
}
@ApiOperation(value = "修改用户详细信息")
@ApiImplicitParams({
})
@RequestMapping(value = "", method = RequestMethod.POST, produces = {"application/json;charset=UTF-8"})
public JsonResponse<UserVo.SelectUserInfo> updateUserInfo(HttpServletRequest request,
@ApiParam @Validated @RequestBody UserDto.UpdateUserInfo updateUserInfo) throws Exception {
Long currentUserId = Long.valueOf(((Claims) request.getAttribute(WebConstant.REQUEST_KEY_CLAIMS)).getSubject());
UserVo.SelectUserInfo selectUserInfo = userInfoService.updateUserInfo(currentUserId,updateUserInfo);
return JsonResponse.newInstance().ok(selectUserInfo);
}
}

214
signin/src/main/java/com/ccsens/signin/bean/dto/UserDto.java

@ -0,0 +1,214 @@
package com.ccsens.signin.bean.dto;
import com.ccsens.util.WebConstant;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
/**
* @author
*/
@Data
public class UserDto {
@Data
@ApiModel
public static class UserSginin{
@lombok.Data
@ApiModel
public static class Data{
@ApiModelProperty("用户标识|用户名")
@NotEmpty(message = "identifier is required.")
private String identifier;
@ApiModelProperty("用户凭据|密码")
private String credential;
}
@ApiModelProperty("登录客户端:0-wxmp,1-H5,2-Android,3-IOS,4-WxEnterprise")
@NotNull(message = "client is required.")
private Integer client;
@ApiModelProperty("登录类型:0-wxmp,1-phone,2-email,3-accounts,4-OAUTH2_Wx,5-Wx_H5,6-OAUTH2_WeiBo, 7-Wx_Enterprise")
@NotNull(message = "type is required.")
private Integer type;
@ApiModelProperty("登录信息")
private Data data;
@ApiModelProperty("通知消息")
private String redirect;
}
@Data
@ApiModel
public static class UpdatePhone{
@ApiModelProperty("旧手机号")
private String oldPhone;
@ApiModelProperty("密码")
private String password;
@ApiModelProperty("新手机号")
private String newPhone;
@ApiModelProperty("新手机号的验证码")
private String code;
}
@Data
@ApiModel
public static class Account{
@ApiModelProperty("用户id")
private Long id;
@ApiModelProperty("用户名")
private String username;
@ApiModelProperty("密码")
private String password;
}
@Data
@ApiModel
public static class UpdatePassword{
@ApiModelProperty("手机号")
@NotEmpty(message = "手机号不能为空")
@Pattern(regexp="^[1]([3-9])[0-9]{9}$",message="请输入正确的手机号")
private String phone;
@ApiModelProperty("验证码")
@NotEmpty(message = "验证码不能为空.")
private String code;
@ApiModelProperty("密码")
@NotEmpty(message = "密码不能为空")
@Pattern(regexp="^[a-zA-Z0-9._-]{6,20}$",message="密码长度需在6~20之间,不能使用汉字,不能包含特殊字符")
private String password;
}
@Data
@ApiModel("通过账号修改密码")
public static class UpdatePasswordByAccount{
@ApiModelProperty("账号")
@NotEmpty(message = "账号不能为空")
private String account;
@ApiModelProperty("旧密码")
@NotEmpty(message = "旧密码不能为空.")
@Pattern(regexp="^[a-zA-Z0-9._-]{6,20}$",message="密码长度需在6~20之间,不能使用汉字,不能包含特殊字符")
private String passwordOld;
@ApiModelProperty("新密码")
@NotEmpty(message = "新密码不能为空")
@Pattern(regexp="^[a-zA-Z0-9._-]{6,20}$",message="密码长度需在6~20之间,不能使用汉字,不能包含特殊字符")
private String passwordNew;
}
@Data
@ApiModel("手机号注册")
public static class UserSignup{
@ApiModelProperty("手机号")
@NotEmpty(message = "手机号不能为空")
@Pattern(regexp="^[1]([3-9])[0-9]{9}$",message="请输入正确的手机号")
private String phone;
@ApiModelProperty("验证码")
@NotEmpty(message = "验证码不能为空.")
private String smsCode;
@ApiModelProperty("账号")
@NotEmpty(message = "账号不能为空.")
@Pattern(regexp="^[a-zA-Z0-9._-]{2,20}$",message="账号长度需在2~20之间,不能使用汉字,不能包含特殊字符")
private String account;
@ApiModelProperty("密码")
@NotEmpty(message = "密码不能为空")
@Pattern(regexp="^[a-zA-Z0-9._-]{6,20}$",message="密码长度需在6~20之间,不能使用汉字,不能包含特殊字符")
private String password;
@ApiModelProperty("来源 0:默认注册,1:跳绳")
private byte source = WebConstant.Regist.SOURCE;
}
@Data
@ApiModel("注册")
public static class UserSignupSystem{
@ApiModelProperty("账号")
private String account;
@ApiModelProperty("密码")
private String password;
}
@Data
@ApiModel
public static class WxMergePhone{
@ApiModelProperty("手机号")
private String phone;
@ApiModelProperty("合并方式 0直接合并 1不合并以前的信息")
private int isMerge;
}
@Data
@ApiModel
public static class WxBindingPhone{
@ApiModelProperty("手机号")
private String phone;
@ApiModelProperty("手机验证码")
private String smsCode;
}
@Data
@ApiModel
public static class WxInfo{
// @ApiModelProperty("用户id")
// private String userId;
@ApiModelProperty("微信名")
private String nickname;
@ApiModelProperty("微信头像")
private String headImgUrl;
@ApiModelProperty("性别")
private Byte sex;
@ApiModelProperty("省")
private String province;
@ApiModelProperty("市")
private String city;
@ApiModelProperty("国家")
private String country;
@ApiModelProperty("语言")
private String language;
}
@Data
@ApiModel("修改登录账号")
public static class UpdateAccount{
@ApiModelProperty("手机号")
@NotEmpty(message = "手机号不能为空")
@Pattern(regexp="^[1]([3-9])[0-9]{9}$",message="请输入正确的手机号")
private String phone;
@ApiModelProperty("验证码")
@NotEmpty(message = "验证码不能为空.")
private String smsCode;
@ApiModelProperty("账号")
@NotEmpty(message = "新账号不能为空.")
private String account;
@ApiModelProperty("密码,有账号登录信息则验证密码,没有则设为新密码")
@NotEmpty(message = "密码不能为空")
private String password;
}
@Data
@ApiModel("修改昵称")
public static class UpdateNickname{
@ApiModelProperty("昵称")
@NotEmpty(message = "新昵称不能为空.")
private String nickname;
}
@Data
@ApiModel("修改个人详细信息")
public static class UpdateUserInfo{
@NotNull
@ApiModelProperty("userId")
private Long id;
@ApiModelProperty("昵称")
private String nickname;
@ApiModelProperty("个人签名")
private String signature;
@ApiModelProperty("个人简介")
private String introduction;
@ApiModelProperty("生日")
private String birthday;
@ApiModelProperty("所在地")
private String address;
@ApiModelProperty("网页")
private String webPath;
@ApiModelProperty("公司")
private String company;
@ApiModelProperty("职位")
private String position;
}
}

128
signin/src/main/java/com/ccsens/signin/bean/po/SysAuth.java

@ -0,0 +1,128 @@
package com.ccsens.signin.bean.po;
import java.io.Serializable;
import java.util.Date;
public class SysAuth implements Serializable {
private Long id;
private Long userId;
private Byte identifyType;
private String identifier;
private String credential;
private String salt;
private Date createdAt;
private Date updatedAt;
private Byte recStatus;
private Byte registerType;
private static final long serialVersionUID = 1L;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getUserId() {
return userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public Byte getIdentifyType() {
return identifyType;
}
public void setIdentifyType(Byte identifyType) {
this.identifyType = identifyType;
}
public String getIdentifier() {
return identifier;
}
public void setIdentifier(String identifier) {
this.identifier = identifier == null ? null : identifier.trim();
}
public String getCredential() {
return credential;
}
public void setCredential(String credential) {
this.credential = credential == null ? null : credential.trim();
}
public String getSalt() {
return salt;
}
public void setSalt(String salt) {
this.salt = salt == null ? null : salt.trim();
}
public Date getCreatedAt() {
return createdAt;
}
public void setCreatedAt(Date createdAt) {
this.createdAt = createdAt;
}
public Date getUpdatedAt() {
return updatedAt;
}
public void setUpdatedAt(Date updatedAt) {
this.updatedAt = updatedAt;
}
public Byte getRecStatus() {
return recStatus;
}
public void setRecStatus(Byte recStatus) {
this.recStatus = recStatus;
}
public Byte getRegisterType() {
return registerType;
}
public void setRegisterType(Byte registerType) {
this.registerType = registerType;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", userId=").append(userId);
sb.append(", identifyType=").append(identifyType);
sb.append(", identifier=").append(identifier);
sb.append(", credential=").append(credential);
sb.append(", salt=").append(salt);
sb.append(", createdAt=").append(createdAt);
sb.append(", updatedAt=").append(updatedAt);
sb.append(", recStatus=").append(recStatus);
sb.append(", registerType=").append(registerType);
sb.append("]");
return sb.toString();
}
}

831
signin/src/main/java/com/ccsens/signin/bean/po/SysAuthExample.java

@ -0,0 +1,831 @@
package com.ccsens.signin.bean.po;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class SysAuthExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public SysAuthExample() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(Long value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(Long value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(Long value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(Long value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(Long value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(Long value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<Long> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<Long> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(Long value1, Long value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(Long value1, Long value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andUserIdIsNull() {
addCriterion("user_id is null");
return (Criteria) this;
}
public Criteria andUserIdIsNotNull() {
addCriterion("user_id is not null");
return (Criteria) this;
}
public Criteria andUserIdEqualTo(Long value) {
addCriterion("user_id =", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotEqualTo(Long value) {
addCriterion("user_id <>", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdGreaterThan(Long value) {
addCriterion("user_id >", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdGreaterThanOrEqualTo(Long value) {
addCriterion("user_id >=", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdLessThan(Long value) {
addCriterion("user_id <", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdLessThanOrEqualTo(Long value) {
addCriterion("user_id <=", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdIn(List<Long> values) {
addCriterion("user_id in", values, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotIn(List<Long> values) {
addCriterion("user_id not in", values, "userId");
return (Criteria) this;
}
public Criteria andUserIdBetween(Long value1, Long value2) {
addCriterion("user_id between", value1, value2, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotBetween(Long value1, Long value2) {
addCriterion("user_id not between", value1, value2, "userId");
return (Criteria) this;
}
public Criteria andIdentifyTypeIsNull() {
addCriterion("identify_type is null");
return (Criteria) this;
}
public Criteria andIdentifyTypeIsNotNull() {
addCriterion("identify_type is not null");
return (Criteria) this;
}
public Criteria andIdentifyTypeEqualTo(Byte value) {
addCriterion("identify_type =", value, "identifyType");
return (Criteria) this;
}
public Criteria andIdentifyTypeNotEqualTo(Byte value) {
addCriterion("identify_type <>", value, "identifyType");
return (Criteria) this;
}
public Criteria andIdentifyTypeGreaterThan(Byte value) {
addCriterion("identify_type >", value, "identifyType");
return (Criteria) this;
}
public Criteria andIdentifyTypeGreaterThanOrEqualTo(Byte value) {
addCriterion("identify_type >=", value, "identifyType");
return (Criteria) this;
}
public Criteria andIdentifyTypeLessThan(Byte value) {
addCriterion("identify_type <", value, "identifyType");
return (Criteria) this;
}
public Criteria andIdentifyTypeLessThanOrEqualTo(Byte value) {
addCriterion("identify_type <=", value, "identifyType");
return (Criteria) this;
}
public Criteria andIdentifyTypeIn(List<Byte> values) {
addCriterion("identify_type in", values, "identifyType");
return (Criteria) this;
}
public Criteria andIdentifyTypeNotIn(List<Byte> values) {
addCriterion("identify_type not in", values, "identifyType");
return (Criteria) this;
}
public Criteria andIdentifyTypeBetween(Byte value1, Byte value2) {
addCriterion("identify_type between", value1, value2, "identifyType");
return (Criteria) this;
}
public Criteria andIdentifyTypeNotBetween(Byte value1, Byte value2) {
addCriterion("identify_type not between", value1, value2, "identifyType");
return (Criteria) this;
}
public Criteria andIdentifierIsNull() {
addCriterion("identifier is null");
return (Criteria) this;
}
public Criteria andIdentifierIsNotNull() {
addCriterion("identifier is not null");
return (Criteria) this;
}
public Criteria andIdentifierEqualTo(String value) {
addCriterion("identifier =", value, "identifier");
return (Criteria) this;
}
public Criteria andIdentifierNotEqualTo(String value) {
addCriterion("identifier <>", value, "identifier");
return (Criteria) this;
}
public Criteria andIdentifierGreaterThan(String value) {
addCriterion("identifier >", value, "identifier");
return (Criteria) this;
}
public Criteria andIdentifierGreaterThanOrEqualTo(String value) {
addCriterion("identifier >=", value, "identifier");
return (Criteria) this;
}
public Criteria andIdentifierLessThan(String value) {
addCriterion("identifier <", value, "identifier");
return (Criteria) this;
}
public Criteria andIdentifierLessThanOrEqualTo(String value) {
addCriterion("identifier <=", value, "identifier");
return (Criteria) this;
}
public Criteria andIdentifierLike(String value) {
addCriterion("identifier like", value, "identifier");
return (Criteria) this;
}
public Criteria andIdentifierNotLike(String value) {
addCriterion("identifier not like", value, "identifier");
return (Criteria) this;
}
public Criteria andIdentifierIn(List<String> values) {
addCriterion("identifier in", values, "identifier");
return (Criteria) this;
}
public Criteria andIdentifierNotIn(List<String> values) {
addCriterion("identifier not in", values, "identifier");
return (Criteria) this;
}
public Criteria andIdentifierBetween(String value1, String value2) {
addCriterion("identifier between", value1, value2, "identifier");
return (Criteria) this;
}
public Criteria andIdentifierNotBetween(String value1, String value2) {
addCriterion("identifier not between", value1, value2, "identifier");
return (Criteria) this;
}
public Criteria andCredentialIsNull() {
addCriterion("credential is null");
return (Criteria) this;
}
public Criteria andCredentialIsNotNull() {
addCriterion("credential is not null");
return (Criteria) this;
}
public Criteria andCredentialEqualTo(String value) {
addCriterion("credential =", value, "credential");
return (Criteria) this;
}
public Criteria andCredentialNotEqualTo(String value) {
addCriterion("credential <>", value, "credential");
return (Criteria) this;
}
public Criteria andCredentialGreaterThan(String value) {
addCriterion("credential >", value, "credential");
return (Criteria) this;
}
public Criteria andCredentialGreaterThanOrEqualTo(String value) {
addCriterion("credential >=", value, "credential");
return (Criteria) this;
}
public Criteria andCredentialLessThan(String value) {
addCriterion("credential <", value, "credential");
return (Criteria) this;
}
public Criteria andCredentialLessThanOrEqualTo(String value) {
addCriterion("credential <=", value, "credential");
return (Criteria) this;
}
public Criteria andCredentialLike(String value) {
addCriterion("credential like", value, "credential");
return (Criteria) this;
}
public Criteria andCredentialNotLike(String value) {
addCriterion("credential not like", value, "credential");
return (Criteria) this;
}
public Criteria andCredentialIn(List<String> values) {
addCriterion("credential in", values, "credential");
return (Criteria) this;
}
public Criteria andCredentialNotIn(List<String> values) {
addCriterion("credential not in", values, "credential");
return (Criteria) this;
}
public Criteria andCredentialBetween(String value1, String value2) {
addCriterion("credential between", value1, value2, "credential");
return (Criteria) this;
}
public Criteria andCredentialNotBetween(String value1, String value2) {
addCriterion("credential not between", value1, value2, "credential");
return (Criteria) this;
}
public Criteria andSaltIsNull() {
addCriterion("salt is null");
return (Criteria) this;
}
public Criteria andSaltIsNotNull() {
addCriterion("salt is not null");
return (Criteria) this;
}
public Criteria andSaltEqualTo(String value) {
addCriterion("salt =", value, "salt");
return (Criteria) this;
}
public Criteria andSaltNotEqualTo(String value) {
addCriterion("salt <>", value, "salt");
return (Criteria) this;
}
public Criteria andSaltGreaterThan(String value) {
addCriterion("salt >", value, "salt");
return (Criteria) this;
}
public Criteria andSaltGreaterThanOrEqualTo(String value) {
addCriterion("salt >=", value, "salt");
return (Criteria) this;
}
public Criteria andSaltLessThan(String value) {
addCriterion("salt <", value, "salt");
return (Criteria) this;
}
public Criteria andSaltLessThanOrEqualTo(String value) {
addCriterion("salt <=", value, "salt");
return (Criteria) this;
}
public Criteria andSaltLike(String value) {
addCriterion("salt like", value, "salt");
return (Criteria) this;
}
public Criteria andSaltNotLike(String value) {
addCriterion("salt not like", value, "salt");
return (Criteria) this;
}
public Criteria andSaltIn(List<String> values) {
addCriterion("salt in", values, "salt");
return (Criteria) this;
}
public Criteria andSaltNotIn(List<String> values) {
addCriterion("salt not in", values, "salt");
return (Criteria) this;
}
public Criteria andSaltBetween(String value1, String value2) {
addCriterion("salt between", value1, value2, "salt");
return (Criteria) this;
}
public Criteria andSaltNotBetween(String value1, String value2) {
addCriterion("salt not between", value1, value2, "salt");
return (Criteria) this;
}
public Criteria andCreatedAtIsNull() {
addCriterion("created_at is null");
return (Criteria) this;
}
public Criteria andCreatedAtIsNotNull() {
addCriterion("created_at is not null");
return (Criteria) this;
}
public Criteria andCreatedAtEqualTo(Date value) {
addCriterion("created_at =", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotEqualTo(Date value) {
addCriterion("created_at <>", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtGreaterThan(Date value) {
addCriterion("created_at >", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtGreaterThanOrEqualTo(Date value) {
addCriterion("created_at >=", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtLessThan(Date value) {
addCriterion("created_at <", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtLessThanOrEqualTo(Date value) {
addCriterion("created_at <=", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtIn(List<Date> values) {
addCriterion("created_at in", values, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotIn(List<Date> values) {
addCriterion("created_at not in", values, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtBetween(Date value1, Date value2) {
addCriterion("created_at between", value1, value2, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotBetween(Date value1, Date value2) {
addCriterion("created_at not between", value1, value2, "createdAt");
return (Criteria) this;
}
public Criteria andUpdatedAtIsNull() {
addCriterion("updated_at is null");
return (Criteria) this;
}
public Criteria andUpdatedAtIsNotNull() {
addCriterion("updated_at is not null");
return (Criteria) this;
}
public Criteria andUpdatedAtEqualTo(Date value) {
addCriterion("updated_at =", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtNotEqualTo(Date value) {
addCriterion("updated_at <>", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtGreaterThan(Date value) {
addCriterion("updated_at >", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtGreaterThanOrEqualTo(Date value) {
addCriterion("updated_at >=", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtLessThan(Date value) {
addCriterion("updated_at <", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtLessThanOrEqualTo(Date value) {
addCriterion("updated_at <=", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtIn(List<Date> values) {
addCriterion("updated_at in", values, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtNotIn(List<Date> values) {
addCriterion("updated_at not in", values, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtBetween(Date value1, Date value2) {
addCriterion("updated_at between", value1, value2, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtNotBetween(Date value1, Date value2) {
addCriterion("updated_at not between", value1, value2, "updatedAt");
return (Criteria) this;
}
public Criteria andRecStatusIsNull() {
addCriterion("rec_status is null");
return (Criteria) this;
}
public Criteria andRecStatusIsNotNull() {
addCriterion("rec_status is not null");
return (Criteria) this;
}
public Criteria andRecStatusEqualTo(Byte value) {
addCriterion("rec_status =", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotEqualTo(Byte value) {
addCriterion("rec_status <>", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusGreaterThan(Byte value) {
addCriterion("rec_status >", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusGreaterThanOrEqualTo(Byte value) {
addCriterion("rec_status >=", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusLessThan(Byte value) {
addCriterion("rec_status <", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusLessThanOrEqualTo(Byte value) {
addCriterion("rec_status <=", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusIn(List<Byte> values) {
addCriterion("rec_status in", values, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotIn(List<Byte> values) {
addCriterion("rec_status not in", values, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusBetween(Byte value1, Byte value2) {
addCriterion("rec_status between", value1, value2, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotBetween(Byte value1, Byte value2) {
addCriterion("rec_status not between", value1, value2, "recStatus");
return (Criteria) this;
}
public Criteria andRegisterTypeIsNull() {
addCriterion("register_type is null");
return (Criteria) this;
}
public Criteria andRegisterTypeIsNotNull() {
addCriterion("register_type is not null");
return (Criteria) this;
}
public Criteria andRegisterTypeEqualTo(Byte value) {
addCriterion("register_type =", value, "registerType");
return (Criteria) this;
}
public Criteria andRegisterTypeNotEqualTo(Byte value) {
addCriterion("register_type <>", value, "registerType");
return (Criteria) this;
}
public Criteria andRegisterTypeGreaterThan(Byte value) {
addCriterion("register_type >", value, "registerType");
return (Criteria) this;
}
public Criteria andRegisterTypeGreaterThanOrEqualTo(Byte value) {
addCriterion("register_type >=", value, "registerType");
return (Criteria) this;
}
public Criteria andRegisterTypeLessThan(Byte value) {
addCriterion("register_type <", value, "registerType");
return (Criteria) this;
}
public Criteria andRegisterTypeLessThanOrEqualTo(Byte value) {
addCriterion("register_type <=", value, "registerType");
return (Criteria) this;
}
public Criteria andRegisterTypeIn(List<Byte> values) {
addCriterion("register_type in", values, "registerType");
return (Criteria) this;
}
public Criteria andRegisterTypeNotIn(List<Byte> values) {
addCriterion("register_type not in", values, "registerType");
return (Criteria) this;
}
public Criteria andRegisterTypeBetween(Byte value1, Byte value2) {
addCriterion("register_type between", value1, value2, "registerType");
return (Criteria) this;
}
public Criteria andRegisterTypeNotBetween(Byte value1, Byte value2) {
addCriterion("register_type not between", value1, value2, "registerType");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}

205
signin/src/main/java/com/ccsens/signin/bean/po/SysUser.java

@ -0,0 +1,205 @@
package com.ccsens.signin.bean.po;
import java.io.Serializable;
import java.util.Date;
public class SysUser implements Serializable {
private Long id;
private Long gradeId;
private String avatarUrl;
private String nickname;
private Byte gender;
private String country;
private String province;
private String city;
private String language;
private String phone;
private String wechat;
private String email;
private Long balance;
private Date createdAt;
private Date updatedAt;
private Byte recStatus;
private Byte source;
private static final long serialVersionUID = 1L;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getGradeId() {
return gradeId;
}
public void setGradeId(Long gradeId) {
this.gradeId = gradeId;
}
public String getAvatarUrl() {
return avatarUrl;
}
public void setAvatarUrl(String avatarUrl) {
this.avatarUrl = avatarUrl == null ? null : avatarUrl.trim();
}
public String getNickname() {
return nickname;
}
public void setNickname(String nickname) {
this.nickname = nickname == null ? null : nickname.trim();
}
public Byte getGender() {
return gender;
}
public void setGender(Byte gender) {
this.gender = gender;
}
public String getCountry() {
return country;
}
public void setCountry(String country) {
this.country = country == null ? null : country.trim();
}
public String getProvince() {
return province;
}
public void setProvince(String province) {
this.province = province == null ? null : province.trim();
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city == null ? null : city.trim();
}
public String getLanguage() {
return language;
}
public void setLanguage(String language) {
this.language = language == null ? null : language.trim();
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone == null ? null : phone.trim();
}
public String getWechat() {
return wechat;
}
public void setWechat(String wechat) {
this.wechat = wechat == null ? null : wechat.trim();
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email == null ? null : email.trim();
}
public Long getBalance() {
return balance;
}
public void setBalance(Long balance) {
this.balance = balance;
}
public Date getCreatedAt() {
return createdAt;
}
public void setCreatedAt(Date createdAt) {
this.createdAt = createdAt;
}
public Date getUpdatedAt() {
return updatedAt;
}
public void setUpdatedAt(Date updatedAt) {
this.updatedAt = updatedAt;
}
public Byte getRecStatus() {
return recStatus;
}
public void setRecStatus(Byte recStatus) {
this.recStatus = recStatus;
}
public Byte getSource() {
return source;
}
public void setSource(Byte source) {
this.source = source;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", gradeId=").append(gradeId);
sb.append(", avatarUrl=").append(avatarUrl);
sb.append(", nickname=").append(nickname);
sb.append(", gender=").append(gender);
sb.append(", country=").append(country);
sb.append(", province=").append(province);
sb.append(", city=").append(city);
sb.append(", language=").append(language);
sb.append(", phone=").append(phone);
sb.append(", wechat=").append(wechat);
sb.append(", email=").append(email);
sb.append(", balance=").append(balance);
sb.append(", createdAt=").append(createdAt);
sb.append(", updatedAt=").append(updatedAt);
sb.append(", recStatus=").append(recStatus);
sb.append(", source=").append(source);
sb.append("]");
return sb.toString();
}
}

1311
signin/src/main/java/com/ccsens/signin/bean/po/SysUserExample.java

File diff suppressed because it is too large

150
signin/src/main/java/com/ccsens/signin/bean/po/SysUserInfo.java

@ -0,0 +1,150 @@
package com.ccsens.signin.bean.po;
import java.io.Serializable;
import java.util.Date;
public class SysUserInfo implements Serializable {
private Long id;
private Long userId;
private String signature;
private String introduction;
private String birthday;
private String address;
private String webPath;
private String company;
private String position;
private Date createdAt;
private Date updatedAt;
private Byte recStatus;
private static final long serialVersionUID = 1L;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getUserId() {
return userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public String getSignature() {
return signature;
}
public void setSignature(String signature) {
this.signature = signature == null ? null : signature.trim();
}
public String getIntroduction() {
return introduction;
}
public void setIntroduction(String introduction) {
this.introduction = introduction == null ? null : introduction.trim();
}
public String getBirthday() {
return birthday;
}
public void setBirthday(String birthday) {
this.birthday = birthday == null ? null : birthday.trim();
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address == null ? null : address.trim();
}
public String getWebPath() {
return webPath;
}
public void setWebPath(String webPath) {
this.webPath = webPath == null ? null : webPath.trim();
}
public String getCompany() {
return company;
}
public void setCompany(String company) {
this.company = company == null ? null : company.trim();
}
public String getPosition() {
return position;
}
public void setPosition(String position) {
this.position = position == null ? null : position.trim();
}
public Date getCreatedAt() {
return createdAt;
}
public void setCreatedAt(Date createdAt) {
this.createdAt = createdAt;
}
public Date getUpdatedAt() {
return updatedAt;
}
public void setUpdatedAt(Date updatedAt) {
this.updatedAt = updatedAt;
}
public Byte getRecStatus() {
return recStatus;
}
public void setRecStatus(Byte recStatus) {
this.recStatus = recStatus;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", userId=").append(userId);
sb.append(", signature=").append(signature);
sb.append(", introduction=").append(introduction);
sb.append(", birthday=").append(birthday);
sb.append(", address=").append(address);
sb.append(", webPath=").append(webPath);
sb.append(", company=").append(company);
sb.append(", position=").append(position);
sb.append(", createdAt=").append(createdAt);
sb.append(", updatedAt=").append(updatedAt);
sb.append(", recStatus=").append(recStatus);
sb.append("]");
return sb.toString();
}
}

991
signin/src/main/java/com/ccsens/signin/bean/po/SysUserInfoExample.java

@ -0,0 +1,991 @@
package com.ccsens.signin.bean.po;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class SysUserInfoExample {
protected String orderByClause;
protected boolean distinct;
protected List<Criteria> oredCriteria;
public SysUserInfoExample() {
oredCriteria = new ArrayList<Criteria>();
}
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
public String getOrderByClause() {
return orderByClause;
}
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
public boolean isDistinct() {
return distinct;
}
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(Long value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(Long value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(Long value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(Long value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(Long value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(Long value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<Long> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<Long> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(Long value1, Long value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(Long value1, Long value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andUserIdIsNull() {
addCriterion("user_id is null");
return (Criteria) this;
}
public Criteria andUserIdIsNotNull() {
addCriterion("user_id is not null");
return (Criteria) this;
}
public Criteria andUserIdEqualTo(Long value) {
addCriterion("user_id =", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotEqualTo(Long value) {
addCriterion("user_id <>", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdGreaterThan(Long value) {
addCriterion("user_id >", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdGreaterThanOrEqualTo(Long value) {
addCriterion("user_id >=", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdLessThan(Long value) {
addCriterion("user_id <", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdLessThanOrEqualTo(Long value) {
addCriterion("user_id <=", value, "userId");
return (Criteria) this;
}
public Criteria andUserIdIn(List<Long> values) {
addCriterion("user_id in", values, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotIn(List<Long> values) {
addCriterion("user_id not in", values, "userId");
return (Criteria) this;
}
public Criteria andUserIdBetween(Long value1, Long value2) {
addCriterion("user_id between", value1, value2, "userId");
return (Criteria) this;
}
public Criteria andUserIdNotBetween(Long value1, Long value2) {
addCriterion("user_id not between", value1, value2, "userId");
return (Criteria) this;
}
public Criteria andSignatureIsNull() {
addCriterion("signature is null");
return (Criteria) this;
}
public Criteria andSignatureIsNotNull() {
addCriterion("signature is not null");
return (Criteria) this;
}
public Criteria andSignatureEqualTo(String value) {
addCriterion("signature =", value, "signature");
return (Criteria) this;
}
public Criteria andSignatureNotEqualTo(String value) {
addCriterion("signature <>", value, "signature");
return (Criteria) this;
}
public Criteria andSignatureGreaterThan(String value) {
addCriterion("signature >", value, "signature");
return (Criteria) this;
}
public Criteria andSignatureGreaterThanOrEqualTo(String value) {
addCriterion("signature >=", value, "signature");
return (Criteria) this;
}
public Criteria andSignatureLessThan(String value) {
addCriterion("signature <", value, "signature");
return (Criteria) this;
}
public Criteria andSignatureLessThanOrEqualTo(String value) {
addCriterion("signature <=", value, "signature");
return (Criteria) this;
}
public Criteria andSignatureLike(String value) {
addCriterion("signature like", value, "signature");
return (Criteria) this;
}
public Criteria andSignatureNotLike(String value) {
addCriterion("signature not like", value, "signature");
return (Criteria) this;
}
public Criteria andSignatureIn(List<String> values) {
addCriterion("signature in", values, "signature");
return (Criteria) this;
}
public Criteria andSignatureNotIn(List<String> values) {
addCriterion("signature not in", values, "signature");
return (Criteria) this;
}
public Criteria andSignatureBetween(String value1, String value2) {
addCriterion("signature between", value1, value2, "signature");
return (Criteria) this;
}
public Criteria andSignatureNotBetween(String value1, String value2) {
addCriterion("signature not between", value1, value2, "signature");
return (Criteria) this;
}
public Criteria andIntroductionIsNull() {
addCriterion("introduction is null");
return (Criteria) this;
}
public Criteria andIntroductionIsNotNull() {
addCriterion("introduction is not null");
return (Criteria) this;
}
public Criteria andIntroductionEqualTo(String value) {
addCriterion("introduction =", value, "introduction");
return (Criteria) this;
}
public Criteria andIntroductionNotEqualTo(String value) {
addCriterion("introduction <>", value, "introduction");
return (Criteria) this;
}
public Criteria andIntroductionGreaterThan(String value) {
addCriterion("introduction >", value, "introduction");
return (Criteria) this;
}
public Criteria andIntroductionGreaterThanOrEqualTo(String value) {
addCriterion("introduction >=", value, "introduction");
return (Criteria) this;
}
public Criteria andIntroductionLessThan(String value) {
addCriterion("introduction <", value, "introduction");
return (Criteria) this;
}
public Criteria andIntroductionLessThanOrEqualTo(String value) {
addCriterion("introduction <=", value, "introduction");
return (Criteria) this;
}
public Criteria andIntroductionLike(String value) {
addCriterion("introduction like", value, "introduction");
return (Criteria) this;
}
public Criteria andIntroductionNotLike(String value) {
addCriterion("introduction not like", value, "introduction");
return (Criteria) this;
}
public Criteria andIntroductionIn(List<String> values) {
addCriterion("introduction in", values, "introduction");
return (Criteria) this;
}
public Criteria andIntroductionNotIn(List<String> values) {
addCriterion("introduction not in", values, "introduction");
return (Criteria) this;
}
public Criteria andIntroductionBetween(String value1, String value2) {
addCriterion("introduction between", value1, value2, "introduction");
return (Criteria) this;
}
public Criteria andIntroductionNotBetween(String value1, String value2) {
addCriterion("introduction not between", value1, value2, "introduction");
return (Criteria) this;
}
public Criteria andBirthdayIsNull() {
addCriterion("birthday is null");
return (Criteria) this;
}
public Criteria andBirthdayIsNotNull() {
addCriterion("birthday is not null");
return (Criteria) this;
}
public Criteria andBirthdayEqualTo(String value) {
addCriterion("birthday =", value, "birthday");
return (Criteria) this;
}
public Criteria andBirthdayNotEqualTo(String value) {
addCriterion("birthday <>", value, "birthday");
return (Criteria) this;
}
public Criteria andBirthdayGreaterThan(String value) {
addCriterion("birthday >", value, "birthday");
return (Criteria) this;
}
public Criteria andBirthdayGreaterThanOrEqualTo(String value) {
addCriterion("birthday >=", value, "birthday");
return (Criteria) this;
}
public Criteria andBirthdayLessThan(String value) {
addCriterion("birthday <", value, "birthday");
return (Criteria) this;
}
public Criteria andBirthdayLessThanOrEqualTo(String value) {
addCriterion("birthday <=", value, "birthday");
return (Criteria) this;
}
public Criteria andBirthdayLike(String value) {
addCriterion("birthday like", value, "birthday");
return (Criteria) this;
}
public Criteria andBirthdayNotLike(String value) {
addCriterion("birthday not like", value, "birthday");
return (Criteria) this;
}
public Criteria andBirthdayIn(List<String> values) {
addCriterion("birthday in", values, "birthday");
return (Criteria) this;
}
public Criteria andBirthdayNotIn(List<String> values) {
addCriterion("birthday not in", values, "birthday");
return (Criteria) this;
}
public Criteria andBirthdayBetween(String value1, String value2) {
addCriterion("birthday between", value1, value2, "birthday");
return (Criteria) this;
}
public Criteria andBirthdayNotBetween(String value1, String value2) {
addCriterion("birthday not between", value1, value2, "birthday");
return (Criteria) this;
}
public Criteria andAddressIsNull() {
addCriterion("address is null");
return (Criteria) this;
}
public Criteria andAddressIsNotNull() {
addCriterion("address is not null");
return (Criteria) this;
}
public Criteria andAddressEqualTo(String value) {
addCriterion("address =", value, "address");
return (Criteria) this;
}
public Criteria andAddressNotEqualTo(String value) {
addCriterion("address <>", value, "address");
return (Criteria) this;
}
public Criteria andAddressGreaterThan(String value) {
addCriterion("address >", value, "address");
return (Criteria) this;
}
public Criteria andAddressGreaterThanOrEqualTo(String value) {
addCriterion("address >=", value, "address");
return (Criteria) this;
}
public Criteria andAddressLessThan(String value) {
addCriterion("address <", value, "address");
return (Criteria) this;
}
public Criteria andAddressLessThanOrEqualTo(String value) {
addCriterion("address <=", value, "address");
return (Criteria) this;
}
public Criteria andAddressLike(String value) {
addCriterion("address like", value, "address");
return (Criteria) this;
}
public Criteria andAddressNotLike(String value) {
addCriterion("address not like", value, "address");
return (Criteria) this;
}
public Criteria andAddressIn(List<String> values) {
addCriterion("address in", values, "address");
return (Criteria) this;
}
public Criteria andAddressNotIn(List<String> values) {
addCriterion("address not in", values, "address");
return (Criteria) this;
}
public Criteria andAddressBetween(String value1, String value2) {
addCriterion("address between", value1, value2, "address");
return (Criteria) this;
}
public Criteria andAddressNotBetween(String value1, String value2) {
addCriterion("address not between", value1, value2, "address");
return (Criteria) this;
}
public Criteria andWebPathIsNull() {
addCriterion("web_path is null");
return (Criteria) this;
}
public Criteria andWebPathIsNotNull() {
addCriterion("web_path is not null");
return (Criteria) this;
}
public Criteria andWebPathEqualTo(String value) {
addCriterion("web_path =", value, "webPath");
return (Criteria) this;
}
public Criteria andWebPathNotEqualTo(String value) {
addCriterion("web_path <>", value, "webPath");
return (Criteria) this;
}
public Criteria andWebPathGreaterThan(String value) {
addCriterion("web_path >", value, "webPath");
return (Criteria) this;
}
public Criteria andWebPathGreaterThanOrEqualTo(String value) {
addCriterion("web_path >=", value, "webPath");
return (Criteria) this;
}
public Criteria andWebPathLessThan(String value) {
addCriterion("web_path <", value, "webPath");
return (Criteria) this;
}
public Criteria andWebPathLessThanOrEqualTo(String value) {
addCriterion("web_path <=", value, "webPath");
return (Criteria) this;
}
public Criteria andWebPathLike(String value) {
addCriterion("web_path like", value, "webPath");
return (Criteria) this;
}
public Criteria andWebPathNotLike(String value) {
addCriterion("web_path not like", value, "webPath");
return (Criteria) this;
}
public Criteria andWebPathIn(List<String> values) {
addCriterion("web_path in", values, "webPath");
return (Criteria) this;
}
public Criteria andWebPathNotIn(List<String> values) {
addCriterion("web_path not in", values, "webPath");
return (Criteria) this;
}
public Criteria andWebPathBetween(String value1, String value2) {
addCriterion("web_path between", value1, value2, "webPath");
return (Criteria) this;
}
public Criteria andWebPathNotBetween(String value1, String value2) {
addCriterion("web_path not between", value1, value2, "webPath");
return (Criteria) this;
}
public Criteria andCompanyIsNull() {
addCriterion("company is null");
return (Criteria) this;
}
public Criteria andCompanyIsNotNull() {
addCriterion("company is not null");
return (Criteria) this;
}
public Criteria andCompanyEqualTo(String value) {
addCriterion("company =", value, "company");
return (Criteria) this;
}
public Criteria andCompanyNotEqualTo(String value) {
addCriterion("company <>", value, "company");
return (Criteria) this;
}
public Criteria andCompanyGreaterThan(String value) {
addCriterion("company >", value, "company");
return (Criteria) this;
}
public Criteria andCompanyGreaterThanOrEqualTo(String value) {
addCriterion("company >=", value, "company");
return (Criteria) this;
}
public Criteria andCompanyLessThan(String value) {
addCriterion("company <", value, "company");
return (Criteria) this;
}
public Criteria andCompanyLessThanOrEqualTo(String value) {
addCriterion("company <=", value, "company");
return (Criteria) this;
}
public Criteria andCompanyLike(String value) {
addCriterion("company like", value, "company");
return (Criteria) this;
}
public Criteria andCompanyNotLike(String value) {
addCriterion("company not like", value, "company");
return (Criteria) this;
}
public Criteria andCompanyIn(List<String> values) {
addCriterion("company in", values, "company");
return (Criteria) this;
}
public Criteria andCompanyNotIn(List<String> values) {
addCriterion("company not in", values, "company");
return (Criteria) this;
}
public Criteria andCompanyBetween(String value1, String value2) {
addCriterion("company between", value1, value2, "company");
return (Criteria) this;
}
public Criteria andCompanyNotBetween(String value1, String value2) {
addCriterion("company not between", value1, value2, "company");
return (Criteria) this;
}
public Criteria andPositionIsNull() {
addCriterion("position is null");
return (Criteria) this;
}
public Criteria andPositionIsNotNull() {
addCriterion("position is not null");
return (Criteria) this;
}
public Criteria andPositionEqualTo(String value) {
addCriterion("position =", value, "position");
return (Criteria) this;
}
public Criteria andPositionNotEqualTo(String value) {
addCriterion("position <>", value, "position");
return (Criteria) this;
}
public Criteria andPositionGreaterThan(String value) {
addCriterion("position >", value, "position");
return (Criteria) this;
}
public Criteria andPositionGreaterThanOrEqualTo(String value) {
addCriterion("position >=", value, "position");
return (Criteria) this;
}
public Criteria andPositionLessThan(String value) {
addCriterion("position <", value, "position");
return (Criteria) this;
}
public Criteria andPositionLessThanOrEqualTo(String value) {
addCriterion("position <=", value, "position");
return (Criteria) this;
}
public Criteria andPositionLike(String value) {
addCriterion("position like", value, "position");
return (Criteria) this;
}
public Criteria andPositionNotLike(String value) {
addCriterion("position not like", value, "position");
return (Criteria) this;
}
public Criteria andPositionIn(List<String> values) {
addCriterion("position in", values, "position");
return (Criteria) this;
}
public Criteria andPositionNotIn(List<String> values) {
addCriterion("position not in", values, "position");
return (Criteria) this;
}
public Criteria andPositionBetween(String value1, String value2) {
addCriterion("position between", value1, value2, "position");
return (Criteria) this;
}
public Criteria andPositionNotBetween(String value1, String value2) {
addCriterion("position not between", value1, value2, "position");
return (Criteria) this;
}
public Criteria andCreatedAtIsNull() {
addCriterion("created_at is null");
return (Criteria) this;
}
public Criteria andCreatedAtIsNotNull() {
addCriterion("created_at is not null");
return (Criteria) this;
}
public Criteria andCreatedAtEqualTo(Date value) {
addCriterion("created_at =", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotEqualTo(Date value) {
addCriterion("created_at <>", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtGreaterThan(Date value) {
addCriterion("created_at >", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtGreaterThanOrEqualTo(Date value) {
addCriterion("created_at >=", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtLessThan(Date value) {
addCriterion("created_at <", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtLessThanOrEqualTo(Date value) {
addCriterion("created_at <=", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtIn(List<Date> values) {
addCriterion("created_at in", values, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotIn(List<Date> values) {
addCriterion("created_at not in", values, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtBetween(Date value1, Date value2) {
addCriterion("created_at between", value1, value2, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotBetween(Date value1, Date value2) {
addCriterion("created_at not between", value1, value2, "createdAt");
return (Criteria) this;
}
public Criteria andUpdatedAtIsNull() {
addCriterion("updated_at is null");
return (Criteria) this;
}
public Criteria andUpdatedAtIsNotNull() {
addCriterion("updated_at is not null");
return (Criteria) this;
}
public Criteria andUpdatedAtEqualTo(Date value) {
addCriterion("updated_at =", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtNotEqualTo(Date value) {
addCriterion("updated_at <>", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtGreaterThan(Date value) {
addCriterion("updated_at >", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtGreaterThanOrEqualTo(Date value) {
addCriterion("updated_at >=", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtLessThan(Date value) {
addCriterion("updated_at <", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtLessThanOrEqualTo(Date value) {
addCriterion("updated_at <=", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtIn(List<Date> values) {
addCriterion("updated_at in", values, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtNotIn(List<Date> values) {
addCriterion("updated_at not in", values, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtBetween(Date value1, Date value2) {
addCriterion("updated_at between", value1, value2, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtNotBetween(Date value1, Date value2) {
addCriterion("updated_at not between", value1, value2, "updatedAt");
return (Criteria) this;
}
public Criteria andRecStatusIsNull() {
addCriterion("rec_status is null");
return (Criteria) this;
}
public Criteria andRecStatusIsNotNull() {
addCriterion("rec_status is not null");
return (Criteria) this;
}
public Criteria andRecStatusEqualTo(Byte value) {
addCriterion("rec_status =", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotEqualTo(Byte value) {
addCriterion("rec_status <>", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusGreaterThan(Byte value) {
addCriterion("rec_status >", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusGreaterThanOrEqualTo(Byte value) {
addCriterion("rec_status >=", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusLessThan(Byte value) {
addCriterion("rec_status <", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusLessThanOrEqualTo(Byte value) {
addCriterion("rec_status <=", value, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusIn(List<Byte> values) {
addCriterion("rec_status in", values, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotIn(List<Byte> values) {
addCriterion("rec_status not in", values, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusBetween(Byte value1, Byte value2) {
addCriterion("rec_status between", value1, value2, "recStatus");
return (Criteria) this;
}
public Criteria andRecStatusNotBetween(Byte value1, Byte value2) {
addCriterion("rec_status not between", value1, value2, "recStatus");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}

165
signin/src/main/java/com/ccsens/signin/bean/vo/UserVo.java

@ -0,0 +1,165 @@
package com.ccsens.signin.bean.vo;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
import java.util.List;
@Data
public class UserVo {
@Data
@ApiModel
public static class UserSign{
@ApiModelProperty("用户Id")
private Long userId;
@ApiModelProperty("认证类型Id")
private Long authId;
}
@Data
@ApiModel
public static class TokenBean {
@ApiModelProperty("用户id")
private Long id;
@ApiModelProperty("账号")
private String account;
@ApiModelProperty("手机号")
private String phone;
@ApiModelProperty("token")
private String token;
@ApiModelProperty("刷新token")
private String refresh_token;
@ApiModelProperty("微信信息")
private WxInfo wxInfo;
}
@Data
@ApiModel
public static class SmsCode{
@ApiModelProperty("手机号")
private String phone;
@ApiModelProperty("有效时间(秒)")
private Integer expiredInSeconds;
@JsonIgnore
private String smsCode;
}
@Data
@ApiModel
public static class Account{
@ApiModelProperty("用户id")
private Long id;
@ApiModelProperty("用户名")
private String username;
@ApiModelProperty("密码")
private String password;
}
@Data
@ApiModel
public static class TokenToUserId{
@ApiModelProperty("用户id")
private Long id;
}
@Data
@ApiModel
public static class WxInfo{
@ApiModelProperty("微信名")
private String nickname;
@ApiModelProperty("微信头像")
private String headImgUrl;
@ApiModelProperty("性别")
private Byte sex;
@ApiModelProperty("省")
private String province;
@ApiModelProperty("市")
private String city;
@ApiModelProperty("国家")
private String country;
@ApiModelProperty("语言")
private String language;
}
@Data
@ApiModel("公众号用户")
public static class Oauth2WX{
@ApiModelProperty("openid")
private String openid;
@ApiModelProperty("用户id")
private Long userId;
}
@Data
@ApiModel("用户信息")
public static class UserInfo {
@ApiModelProperty("用户id")
private Long id;
@ApiModelProperty("昵称")
private String nickname;
@ApiModelProperty("头像")
private String avatarUrl;
}
@Data
@ApiModel("查询个人信息")
public static class SelectUserInfo{
@ApiModelProperty("userId")
private Long id;
@ApiModelProperty("账号")
private String account;
@ApiModelProperty("手机号")
private String phone;
@ApiModelProperty("昵称")
private String nickname;
@ApiModelProperty("头像")
private String avatarUrl;
@ApiModelProperty("个人签名")
private String signature;
@ApiModelProperty("个人简介")
private String introduction;
@ApiModelProperty("生日")
private String birthday;
@ApiModelProperty("所在地")
private String address;
@ApiModelProperty("网页")
private String webPath;
@ApiModelProperty("公司")
private String company;
@ApiModelProperty("职位")
private String position;
@ApiModelProperty("已使用tall多少天")
private Integer dayOfUseTall;
@JsonIgnore // 已使用tall多少天
private Date createdAt;
@ApiModelProperty("空间使用情况")
private Interspace interspace;
// @ApiModelProperty("标签信息")
// private List<LabelVo.SelectLabel> labelList;
}
@Data
@ApiModel("空间使用信息")
public static class Interspace{
@ApiModelProperty("空间已有项目")
private Integer projectNum;
@ApiModelProperty("空间总项目(目前写无限制)")
private Integer projectTotal;
@ApiModelProperty("空间剩余(目前写无限制)")
private Integer interspaceResidue;
@ApiModelProperty("总空间(目前写无限制)")
private Integer interspaceTotal;
}
@Data
@ApiModel("返回图片验证码")
public static class VerificationCode{
@ApiModelProperty("图片验证码Id")
private String verificationCodeId;
@ApiModelProperty("图片的Base64字符串")
private String imageBase64;
}
}

31
signin/src/main/java/com/ccsens/signin/config/BeanConfig.java

@ -0,0 +1,31 @@
package com.ccsens.wisdomcar.config;
import com.ccsens.wisdomcar.intercept.MybatisInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
* @description:
* @author: wuHuiJuan
* @create: 2019/12/03 18:01
*/
@Configuration
public class BeanConfig {
// @Bean
// public static PropertySourcesPlaceholderConfigurer properties(){
// PropertySourcesPlaceholderConfigurer conf = new PropertySourcesPlaceholderConfigurer();
// YamlPropertiesFactoryBean yml = new YamlPropertiesFactoryBean();
// yml.setResources(new ClassPathResource("business.yml"));
// conf.setProperties(yml.getObject());
// return conf;
// }
/**
* 注册拦截器
*/
@Bean
public MybatisInterceptor mybatisInterceptor() {
MybatisInterceptor interceptor = new MybatisInterceptor();
return interceptor;
}
}

169
signin/src/main/java/com/ccsens/signin/config/SpringConfig.java

@ -0,0 +1,169 @@
package com.ccsens.wisdomcar.config;
import cn.hutool.core.lang.Snowflake;
import cn.hutool.core.util.IdUtil;
import com.ccsens.util.config.DruidProps;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.module.SimpleModule;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.MediaType;
import org.springframework.http.converter.HttpMessageConverter;
import org.springframework.http.converter.StringHttpMessageConverter;
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
import org.springframework.web.servlet.config.annotation.*;
import javax.annotation.Resource;
import javax.sql.DataSource;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.List;
@Configuration
//public class SpringConfig extends WebMvcConfigurationSupport {
public class SpringConfig implements WebMvcConfigurer {
@Resource
private DruidProps druidPropsUtil;
@Value("${spring.snowflake.workerId}")
private String workerId;
@Value("${spring.snowflake.datacenterId}")
private String datacenterId;
/**
* 配置Converter
* @return
*/
@Bean
public HttpMessageConverter<String> responseStringConverter() {
StringHttpMessageConverter converter = new StringHttpMessageConverter(
Charset.forName("UTF-8"));
return converter;
}
@Bean
public HttpMessageConverter<Object> responseJsonConverter(){
MappingJackson2HttpMessageConverter converter = new MappingJackson2HttpMessageConverter();
List<MediaType> mediaTypeList = new ArrayList<>();
mediaTypeList.add(MediaType.TEXT_HTML);
mediaTypeList.add(MediaType.APPLICATION_JSON_UTF8);
converter.setSupportedMediaTypes(mediaTypeList);
//converter.setObjectMapper();
ObjectMapper objectMapper = new ObjectMapper();
SimpleModule simpleModule = new SimpleModule();
simpleModule.addSerializer(Long.class, ToStringSerializer.instance);
simpleModule.addSerializer(Long.TYPE, ToStringSerializer.instance);
objectMapper.registerModule(simpleModule);
objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
converter.setObjectMapper(objectMapper);
return converter;
}
@Override
public void configureMessageConverters(List<HttpMessageConverter<?>> converters) {
//super.configureMessageConverters(converters);
converters.add(responseStringConverter());
converters.add(responseJsonConverter());
}
@Override
public void configureContentNegotiation(ContentNegotiationConfigurer configurer) {
configurer.favorPathExtension(false);
}
@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**").allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS")
// .allowedMethods("*") // 允许提交请求的方法,*表示全部允许
.allowedOrigins("*") // #允许向该服务器提交请求的URI,*表示全部允许
.allowCredentials(true) // 允许cookies跨域
.allowedHeaders("*") // #允许访问的头信息,*表示全部
.maxAge(18000L); // 预检请求的缓存时间(秒),即在这个时间段里,对于相同的跨域请求不会再预检了
}
/**
* 配置视图解析器 SpringBoot建议使用Thymeleaf代替jsp动态页面默认路径resources/template静态页面默认路径: resources/static
* @return
*/
// @Bean
// public ViewResolver getViewResolver() {
// InternalResourceViewResolver resolver = new InternalResourceViewResolver();
// resolver.setPrefix("/WEB-INF/views/");
// resolver.setSuffix(".jsp");
// return resolver;
// }
// @Override
// public void configureDefaultServletHandling(
// DefaultServletHandlerConfigurer configurer) {
// configurer.enable();
// }
/**
* 配置静态资源
*/
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("swagger-ui.html")
.addResourceLocations("classpath:/META-INF/resources/");
registry.addResourceHandler("/webjars/**")
.addResourceLocations("classpath:/META-INF/resources/webjars/");
registry.addResourceHandler("/uploads/**")
.addResourceLocations("file:///home/cloud/game/uploads/");
//super.addResourceHandlers(registry);
}
/**
* 配置拦截器
* @param registry
*/
@Override
public void addInterceptors(InterceptorRegistry registry) {
//addPathPatterns 用于添加拦截规则
//excludePathPatterns 用于排除拦截
// registry.addInterceptor(tokenInterceptor())
// .addPathPatterns("/projects/**")
// .addPathPatterns("/messages/**")
// .addPathPatterns("/users/**")
// .excludePathPatterns("/users/signin")
// .excludePathPatterns("/users/smscode")
// .excludePathPatterns("/users/signup")
// .excludePathPatterns("/users/password")
// .excludePathPatterns("/users/account")
// .excludePathPatterns("/users/token")
// .excludePathPatterns("/users/claims")
// .addPathPatterns("/plugins/**")
// .addPathPatterns("/delivers/**")
// .addPathPatterns("/tasks/**")
// .addPathPatterns("/members/**")
// .addPathPatterns("/templates/**")
// .addPathPatterns("/hardware/**");
//super.addInterceptors(registry);
}
//
// @Bean
// public TokenInterceptor tokenInterceptor(){
// return new TokenInterceptor();
// }
/**
* 配置数据源单数据源
*/
@Bean
public DataSource dataSource(){
return druidPropsUtil.createDruidDataSource();
}
@Bean
public Snowflake snowflake(){
// return new Snowflake(Long.valueOf(workerId),Long.valueOf(datacenterId));
return IdUtil.createSnowflake(Long.valueOf(workerId),Long.valueOf(datacenterId));
}
}

56
signin/src/main/java/com/ccsens/signin/config/SwaggerConfigure.java

@ -0,0 +1,56 @@
package com.ccsens.wisdomcar.config;
import com.ccsens.util.WebConstant;
import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ParameterBuilder;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.schema.ModelRef;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Parameter;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
import java.util.ArrayList;
import java.util.List;
@Configuration
@EnableSwagger2
@ConditionalOnExpression("${swagger.enable}")
//public class SwaggerConfigure extends WebMvcConfigurationSupport {
public class SwaggerConfigure /*implements WebMvcConfigurer*/ {
@Bean
public Docket customDocket() {
//
return new Docket(DocumentationType.SWAGGER_2)
.apiInfo(apiInfo())
.select()
.apis(RequestHandlerSelectors
.basePackage("com.ccsens.signin.api"))
.build()
.globalOperationParameters(setHeaderToken());
}
private ApiInfo apiInfo() {
return new ApiInfo("Swagger Tall-game",//大标题 title
"This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.",//小标题
"1.0.0",//版本
"http://swagger.io/terms/",//termsOfServiceUrl
"zhangsan",//作者
"Apache 2.0",//链接显示文字
"http://www.apache.org/licenses/LICENSE-2.0.html"//网站链接
);
}
private List<Parameter> setHeaderToken() {
ParameterBuilder tokenPar = new ParameterBuilder();
List<Parameter> pars = new ArrayList<>();
tokenPar.name(WebConstant.HEADER_KEY_TOKEN).description("token")
.defaultValue(WebConstant.HEADER_KEY_TOKEN_PREFIX)
.modelRef(new ModelRef("string")).parameterType("header").required(false).build();
pars.add(tokenPar.build());
return pars;
}
}

10
signin/src/main/java/com/ccsens/signin/exception/GetCurrentPartiException.java

@ -0,0 +1,10 @@
package com.ccsens.signin.exception;
import com.ccsens.util.exception.BaseException;
public class GetCurrentPartiException extends BaseException {
public GetCurrentPartiException(Integer code, String message) {
super(code, message);
}
}

11
signin/src/main/java/com/ccsens/signin/exception/GetCurrentUserException.java

@ -0,0 +1,11 @@
package com.ccsens.signin.exception;
import com.ccsens.util.exception.BaseException;
import lombok.Getter;
@Getter
public class GetCurrentUserException extends BaseException {
public GetCurrentUserException(int code, String msg){
super(code,msg);
}
}

10
signin/src/main/java/com/ccsens/signin/exception/GetTaskException.java

@ -0,0 +1,10 @@
package com.ccsens.signin.exception;
import com.ccsens.util.exception.BaseException;
public class GetTaskException extends BaseException {
public GetTaskException(Integer code, String message) {
super(code, message);
}
}

10
signin/src/main/java/com/ccsens/signin/exception/PartiLoginException.java

@ -0,0 +1,10 @@
package com.ccsens.signin.exception;
import com.ccsens.util.exception.BaseException;
public class PartiLoginException extends BaseException {
public PartiLoginException(Integer code, String message) {
super(code, message);
}
}

17
signin/src/main/java/com/ccsens/signin/exception/SmsException.java

@ -0,0 +1,17 @@
package com.ccsens.signin.exception;
import com.ccsens.util.WebConstant;
import com.ccsens.util.exception.BaseException;
public class SmsException extends BaseException {
public static final String Error_SendTooFast = WebConstant.Exist_Verify_Code_In_Seconds + "内只能发送一次,请稍后再试";
public SmsException(String message) {
super(message);
}
public SmsException(Integer code,String message) {
super(code,message);
}
}

10
signin/src/main/java/com/ccsens/signin/exception/TaskValidateException.java

@ -0,0 +1,10 @@
package com.ccsens.signin.exception;
import com.ccsens.util.exception.BaseException;
public class TaskValidateException extends BaseException {
public TaskValidateException(int i, String s) {
super(i,s);
}
}

10
signin/src/main/java/com/ccsens/signin/exception/UnAuthenticationException.java

@ -0,0 +1,10 @@
package com.ccsens.signin.exception;
import com.ccsens.util.exception.BaseException;
public class UnAuthenticationException extends BaseException {
public UnAuthenticationException() {
super(400,"未认证的用户");
}
}

10
signin/src/main/java/com/ccsens/signin/exception/UnAuthorizationException.java

@ -0,0 +1,10 @@
package com.ccsens.signin.exception;
import com.ccsens.util.exception.BaseException;
public class UnAuthorizationException extends BaseException {
public UnAuthorizationException() {
super(401,"未授权的用户");
}
}

10
signin/src/main/java/com/ccsens/signin/exception/UserLoginException.java

@ -0,0 +1,10 @@
package com.ccsens.signin.exception;
import com.ccsens.util.exception.BaseException;
public class UserLoginException extends BaseException {
public UserLoginException(int code,String message){
super(code,message);
}
}

159
signin/src/main/java/com/ccsens/signin/intercept/MybatisInterceptor.java

@ -0,0 +1,159 @@
package com.ccsens.wisdomcar.intercept;
import cn.hutool.core.collection.CollectionUtil;
import com.ccsens.util.WebConstant;
import org.apache.ibatis.executor.Executor;
import org.apache.ibatis.mapping.BoundSql;
import org.apache.ibatis.mapping.MappedStatement;
import org.apache.ibatis.mapping.ResultMap;
import org.apache.ibatis.mapping.SqlSource;
import org.apache.ibatis.plugin.*;
import org.apache.ibatis.reflection.DefaultReflectorFactory;
import org.apache.ibatis.reflection.MetaObject;
import org.apache.ibatis.reflection.factory.DefaultObjectFactory;
import org.apache.ibatis.reflection.wrapper.DefaultObjectWrapperFactory;
import org.apache.ibatis.session.ResultHandler;
import org.apache.ibatis.session.RowBounds;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.List;
import java.util.Map;
import java.util.Properties;
/**
* @description:
* @author: wuHuiJuan
* @create: 2019/12/11 10:58
*/
@Intercepts({
@Signature(
type = Executor.class,
method = "query",
args = {MappedStatement.class, Object.class, RowBounds.class, ResultHandler.class}
)
})
public class MybatisInterceptor implements Interceptor {
@Override
public Object intercept(Invocation invocation) throws Throwable {
String selectByExample = "selectByExample";
String countByExample = "countByExample";
String countByExample2 = "selectByExample_COUNT";
String selectByPrimaryKey = "selectByPrimaryKey";
Object[] args = invocation.getArgs();
MappedStatement statement = (MappedStatement) args[0];
if (statement.getId().endsWith(selectByExample)
|| statement.getId().endsWith(countByExample)
|| statement.getId().endsWith(countByExample2)) {
//XXXExample
Object example = args[1];
addCondition(statement, example);
} else if (statement.getId().endsWith(selectByPrimaryKey)) {
BoundSql boundSql = statement.getBoundSql(args[1]);
String sql = boundSql.getSql() + " and rec_status = 0";
MappedStatement newStatement = newMappedStatement(statement, new BoundSqlSqlSource(boundSql));
MetaObject msObject = MetaObject.forObject(newStatement, new DefaultObjectFactory(), new DefaultObjectWrapperFactory(),new DefaultReflectorFactory());
msObject.setValue("sqlSource.boundSql.sql", sql);
args[0] = newStatement;
}
return invocation.proceed();
}
private void addCondition(MappedStatement statement, Object example) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException, InstantiationException, ClassNotFoundException {
if (example instanceof Map) {
example = ((Map) example).get("_ORIGINAL_PARAMETER_OBJECT");
}
Method method = example.getClass().getMethod("getOredCriteria", null);
//获取到条件数组,第一个是Criteria
List list = (List) method.invoke(example);
if (CollectionUtil.isEmpty(list)) {
Class clazz = ((ResultMap) statement.getResultMaps().get(0)).getType();
String exampleName = clazz.getName() + "Example";
Object paramExample = Class.forName(exampleName).newInstance();
Method createCriteria = paramExample.getClass().getMethod("createCriteria");
Object criteria = createCriteria.invoke(paramExample);
Method andIsDelEqualTo = criteria.getClass().getMethod("andRecStatusEqualTo", Byte.class);
andIsDelEqualTo.invoke(criteria, WebConstant.REC_STATUS.Normal.value);
list.add(criteria);
} else {
Object criteria = list.get(0);
Method getCriteria = criteria.getClass().getMethod("getCriteria");
List params = (List) getCriteria.invoke(criteria);
boolean hasDel = false;
for (Object param : params) {
Method getCondition = param.getClass().getMethod("getCondition");
Object condition = getCondition.invoke(param);
if ("rec_status =".equals(condition)) {
hasDel = true;
}
}
if (!hasDel) {
Method andIsDelEqualTo = criteria.getClass().getMethod("andRecStatusEqualTo", Byte.class);
andIsDelEqualTo.invoke(criteria, WebConstant.REC_STATUS.Normal.value);
}
}
}
@Override
public Object plugin(Object target) {
return Plugin.wrap(target, this);
}
@Override
public void setProperties(Properties properties) {
}
private MappedStatement newMappedStatement(MappedStatement ms, SqlSource newSqlSource) {
MappedStatement.Builder builder =
new MappedStatement.Builder(ms.getConfiguration(), ms.getId(), newSqlSource, ms.getSqlCommandType());
builder.resource(ms.getResource());
builder.fetchSize(ms.getFetchSize());
builder.statementType(ms.getStatementType());
builder.keyGenerator(ms.getKeyGenerator());
if (ms.getKeyProperties() != null && ms.getKeyProperties().length != 0) {
StringBuilder keyProperties = new StringBuilder();
for (String keyProperty : ms.getKeyProperties()) {
keyProperties.append(keyProperty).append(",");
}
keyProperties.delete(keyProperties.length() - 1, keyProperties.length());
builder.keyProperty(keyProperties.toString());
}
builder.timeout(ms.getTimeout());
builder.parameterMap(ms.getParameterMap());
builder.resultMaps(ms.getResultMaps());
builder.resultSetType(ms.getResultSetType());
builder.cache(ms.getCache());
builder.flushCacheRequired(ms.isFlushCacheRequired());
builder.useCache(ms.isUseCache());
return builder.build();
}
// 定义一个内部辅助类,作用是包装sq
class BoundSqlSqlSource implements SqlSource {
private BoundSql boundSql;
public BoundSqlSqlSource(BoundSql boundSql) {
this.boundSql = boundSql;
}
@Override
public BoundSql getBoundSql(Object parameterObject) {
return boundSql;
}
}
}

18
signin/src/main/java/com/ccsens/signin/persist/dao/SysAuthDao.java

@ -0,0 +1,18 @@
package com.ccsens.signin.persist.dao;
import com.ccsens.signin.bean.vo.UserVo;
import com.ccsens.signin.persist.mapper.SysAuthMapper;
import org.springframework.stereotype.Repository;
import java.util.List;
@Repository
public interface SysAuthDao extends SysAuthMapper {
/**
* 查询关注了公众号的用户的openid
* @param userIds
* @return
*/
List<UserVo.Oauth2WX> queryOauth2WX(List<Long> userIds);
}

65
signin/src/main/java/com/ccsens/signin/persist/dao/SysUserDao.java

@ -0,0 +1,65 @@
package com.ccsens.signin.persist.dao;
import com.ccsens.signin.bean.vo.UserVo;
import com.ccsens.signin.persist.mapper.SysUserMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.List;
@Repository
public interface SysUserDao extends SysUserMapper {
void replaceAuth(@Param("oldUserId") Long userId, @Param("newUserId") Long currentUserId);
void replaceAttention(@Param("oldUserId") Long userId, @Param("newUserId") Long currentUserId);
void replaceBalance(@Param("oldUserId") Long userId, @Param("newUserId") Long currentUserId);
void replaceProject(@Param("oldUserId") Long userId, @Param("newUserId") Long currentUserId);
void replaceMember(@Param("oldUserId") Long userId, @Param("newUserId") Long currentUserId);
void replaceDeliverPostLog(@Param("oldUserId") Long userId, @Param("newUserId") Long currentUserId);
void replaceProLog(@Param("oldUserId") Long userId, @Param("newUserId") Long currentUserId);
String getUserNameByUserId(@Param("userId") Long userId);
void replaceComment(@Param("oldUserId") Long userId, @Param("newUserId") Long currentUserId);
/**
* 查询用户信息
* @param userId 用户id
* @return 用户信息
*/
UserVo.UserInfo getUserInfoByUserId(Long userId);
/**
* 根据id查询用户信息
* @param ids 用户id数组
* @return 用户信息列表
*/
List<UserVo.UserInfo> queryUserInfos(Long[] ids);
/**
* 查找个人详细信息
* @param currentUserId userId
* @return 个人信息
*/
UserVo.SelectUserInfo selectUserInfo(@Param("userId") Long currentUserId);
/**
* 获取空间使用信息
* @param currentUserId userId
* @return 目前只查询用户创建了几个项目
*/
UserVo.Interspace selectInterspace(@Param("userId") Long currentUserId);
/**
* 查询登录返回的信息
* @param userId
* @return
*/
UserVo.TokenBean getTokenBeanByUserId(Long userId);
}

8
signin/src/main/java/com/ccsens/signin/persist/dao/SysUserInfoDao.java

@ -0,0 +1,8 @@
package com.ccsens.signin.persist.dao;
import com.ccsens.signin.persist.mapper.SysUserInfoMapper;
import org.springframework.stereotype.Repository;
@Repository
public interface SysUserInfoDao extends SysUserInfoMapper {
}

30
signin/src/main/java/com/ccsens/signin/persist/mapper/SysAuthMapper.java

@ -0,0 +1,30 @@
package com.ccsens.signin.persist.mapper;
import com.ccsens.signin.bean.po.SysAuth;
import com.ccsens.signin.bean.po.SysAuthExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface SysAuthMapper {
long countByExample(SysAuthExample example);
int deleteByExample(SysAuthExample example);
int deleteByPrimaryKey(Long id);
int insert(SysAuth record);
int insertSelective(SysAuth record);
List<SysAuth> selectByExample(SysAuthExample example);
SysAuth selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") SysAuth record, @Param("example") SysAuthExample example);
int updateByExample(@Param("record") SysAuth record, @Param("example") SysAuthExample example);
int updateByPrimaryKeySelective(SysAuth record);
int updateByPrimaryKey(SysAuth record);
}

30
signin/src/main/java/com/ccsens/signin/persist/mapper/SysUserInfoMapper.java

@ -0,0 +1,30 @@
package com.ccsens.signin.persist.mapper;
import com.ccsens.signin.bean.po.SysUserInfo;
import com.ccsens.signin.bean.po.SysUserInfoExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface SysUserInfoMapper {
long countByExample(SysUserInfoExample example);
int deleteByExample(SysUserInfoExample example);
int deleteByPrimaryKey(Long id);
int insert(SysUserInfo record);
int insertSelective(SysUserInfo record);
List<SysUserInfo> selectByExample(SysUserInfoExample example);
SysUserInfo selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") SysUserInfo record, @Param("example") SysUserInfoExample example);
int updateByExample(@Param("record") SysUserInfo record, @Param("example") SysUserInfoExample example);
int updateByPrimaryKeySelective(SysUserInfo record);
int updateByPrimaryKey(SysUserInfo record);
}

30
signin/src/main/java/com/ccsens/signin/persist/mapper/SysUserMapper.java

@ -0,0 +1,30 @@
package com.ccsens.signin.persist.mapper;
import com.ccsens.signin.bean.po.SysUser;
import com.ccsens.signin.bean.po.SysUserExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface SysUserMapper {
long countByExample(SysUserExample example);
int deleteByExample(SysUserExample example);
int deleteByPrimaryKey(Long id);
int insert(SysUser record);
int insertSelective(SysUser record);
List<SysUser> selectByExample(SysUserExample example);
SysUser selectByPrimaryKey(Long id);
int updateByExampleSelective(@Param("record") SysUser record, @Param("example") SysUserExample example);
int updateByExample(@Param("record") SysUser record, @Param("example") SysUserExample example);
int updateByPrimaryKeySelective(SysUser record);
int updateByPrimaryKey(SysUser record);
}

48
signin/src/main/java/com/ccsens/signin/service/IUserInfoService.java

@ -0,0 +1,48 @@
package com.ccsens.signin.service;
import com.ccsens.signin.bean.dto.UserDto;
import com.ccsens.signin.bean.vo.UserVo;
import javax.servlet.http.Part;
/**
* @author
*/
public interface IUserInfoService {
/**
* 修改登录的账号
* @param userId 用户id
* @param changeAccount 验证码和新账号
*/
void updateAccount(Long userId, UserDto.UpdateAccount changeAccount);
/**
* 修改昵称
* @param userId 用户id
* @param updateNickname 新昵称
*/
void updateNickname(Long userId, UserDto.UpdateNickname updateNickname);
/**
* 上传头像
* @param currentUserId userId
* @param file 上传的文件
* @throws Exception 文件异常
*/
void uploadAvatarUrl(Long currentUserId, Part file) throws Exception;
/**
* 查找全部个人信息
* @param currentUserId userId
* @return 个人信息
*/
UserVo.SelectUserInfo selectUserInfo(Long currentUserId);
/**
* 修改个人详细信息
* @param currentUserId userId
* @param updateUserInfo 需要修改的信息为空则不需要修改
* @return 返回当前用户的详细信息
*/
UserVo.SelectUserInfo updateUserInfo(Long currentUserId, UserDto.UpdateUserInfo updateUserInfo);
}

110
signin/src/main/java/com/ccsens/signin/service/IUserService.java

@ -0,0 +1,110 @@
package com.ccsens.signin.service;
import com.ccsens.signin.bean.dto.UserDto;
import com.ccsens.signin.bean.po.SysUser;
import com.ccsens.signin.bean.vo.UserVo;
import com.ccsens.util.WebConstant;
import java.util.List;
import java.util.Map;
/**
* @author
*/
public interface IUserService {
UserVo.UserSign signin(WebConstant.CLIENT_TYPE clientType, WebConstant.IDENTIFY_TYPE identifyType,
String identifier, String credential, String clientIp, String redirect) throws Exception;
UserVo.TokenBean generateToken(WebConstant.CLIENT_TYPE client_type, Object subject, Map<String, Object> payLoads) throws Exception;
UserVo.TokenBean getUserInfoAndToken(WebConstant.CLIENT_TYPE client_type, WebConstant.IDENTIFY_TYPE identify_type, UserVo.UserSign userSignVo, Map<String, Object> theMap) throws Exception;
boolean tokenNotExistInCache(Long authId) throws Exception;
UserVo.SmsCode getSignInSmsCode(String phone, String verificationCodeId, String verificationCodeValue) throws Exception;
SysUser getUserById(Long aLong) throws Exception;
UserVo.UserSign registerUser(UserDto.UserSignup userSignup)throws Exception;
UserVo.UserSign bindingNewPhone(Long currentUserId, UserDto.WxBindingPhone wxPhone)throws Exception;
String getPhone(Long userId);
void updatePhone(Long currentUserId, UserDto.UpdatePhone updatePhone) throws Exception;
Boolean findAccount(String account);
Boolean findPhone(String phone);
UserVo.UserSign saveAuth(UserDto.UserSignup userSignup);
void updateAccount(UserDto.Account account);
/**
* 通过手机号修改密码
* @param passwordDto 手机号验证码
*/
void updatePassword(UserDto.UpdatePassword passwordDto) throws Exception;
/**
* 通过账号密码修改密码
* @param passwordDto 账号旧密码和新密码
*/
void updatePasswordByAccount(UserDto.UpdatePasswordByAccount passwordDto) throws Exception;
/**
* 通过手机号查找userId
* @param phoneCell 手机号
* @return userId
*/
Long selectUserIdByPhone(String phoneCell)throws Exception;
String selectAccountByPhone(String phone)throws Exception;
// List<Long> selectUserIdByRoleId(Long roleId)throws Exception;
//
// Boolean getIsAttention(Long currentUserId, Long projectId);
// void userAttentionProject(Long currentUserId, ProjectDto.ProjectIdDto projectIdDto);
//默认注册
/**
*@Description: 注冊用戶若用戶手机号存在则默认用户已注册不做任何操作若账号重复则再名字后面添加_1递增直到不重复
* @param signup
*@return: long
*@Author: wuhuijuan
*@date: 2019/10/29 14:43
*/
long defaultRegisterUser(com.ccsens.cloudutil.bean.tall.dto.UserDto.DefaultUserSingup signup);
UserVo.UserSign mergeByPhone(Long currentUserId, UserDto.WxMergePhone wxPhone);
UserVo.WxInfo updateUserInfo(Long currentUserId, UserDto.WxInfo userInfo);
void relievePhone(Long userId, UserDto.WxBindingPhone phoneInfo);
UserVo.UserSign changePhoneNotPassword(Long userId, UserDto.WxBindingPhone phoneInfo) throws Exception;
UserVo.TokenBean getTokenByUserId(Long userId);
void mergeUserId(Long userId, Long uselessId);
UserVo.Account systemRegister(UserDto.UserSignupSystem userSignup);
String getUserNameByUserId(Long userId);
/**
* 根据id查询用户信息
* @param ids
* @return
*/
List<UserVo.UserInfo> queryUserInfos(Long[] ids);
/**
* 获取图片验证码信息
* @return 返回图片转成的base64字符串和图片的id
*/
UserVo.VerificationCode getVertifyCode();
}

258
signin/src/main/java/com/ccsens/signin/service/UserInfoService.java

@ -0,0 +1,258 @@
package com.ccsens.signin.service;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.lang.Snowflake;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.ImageUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.ccsens.signin.bean.dto.UserDto;
import com.ccsens.signin.bean.po.*;
import com.ccsens.signin.bean.vo.UserVo;
import com.ccsens.signin.persist.dao.SysAuthDao;
import com.ccsens.signin.persist.dao.SysUserDao;
import com.ccsens.signin.persist.dao.SysUserInfoDao;
import com.ccsens.signin.util.TallConstant;
import com.ccsens.util.*;
import com.ccsens.util.exception.BaseException;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.FileUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import javax.servlet.http.Part;
import java.io.File;
import java.security.NoSuchAlgorithmException;
import java.security.spec.InvalidKeySpecException;
import java.util.Date;
import java.util.List;
/**
* @author
*/
@Slf4j
@Service
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
public class UserInfoService implements IUserInfoService{
@Resource
private RedisUtil redisUtil;
@Resource
private SysAuthDao sysAuthDao;
@Resource
private SysUserDao sysUserDao;
// @Resource
// private SysLabelDao sysLabelDao;
@Resource
private SysUserInfoDao sysUserInfoDao;
@Resource
private Snowflake snowflake;
@Override
public void updateAccount(Long userId, UserDto.UpdateAccount changeAccount) {
//判断验证码是否正确
if (redisUtil.hasKey(RedisKeyManager.getSigninSmsKey(changeAccount.getPhone()))) {
if (changeAccount.getSmsCode().equals(redisUtil.get(RedisKeyManager.getSigninSmsKey(changeAccount.getPhone())).toString())) {
//查找redis该账号是否正在使用
String accountKey = TallConstant.getUpdateAccount(changeAccount.getAccount());
if(redisUtil.hasKey(accountKey)){
throw new BaseException(CodeEnum.ALREADY_EXIST_ACCOUNT);
}
//未查到则存进redis时效一分钟
redisUtil.set(accountKey,changeAccount.getAccount(),60);
//检查数据库内账号是否存在
SysAuthExample sysAuthExample = new SysAuthExample();
sysAuthExample.createCriteria().andIdentifyTypeEqualTo((byte) WebConstant.IDENTIFY_TYPE.Account.value)
.andIdentifierEqualTo(changeAccount.getAccount());
List<SysAuth> sysAuthList = sysAuthDao.selectByExample(sysAuthExample);
if(CollectionUtil.isNotEmpty(sysAuthList)){
throw new BaseException(CodeEnum.ALREADY_EXIST_ACCOUNT);
}
//修改账号
SysAuthExample authAccountExample = new SysAuthExample();
authAccountExample.createCriteria().andUserIdEqualTo(userId).andIdentifyTypeEqualTo((byte) WebConstant.IDENTIFY_TYPE.Account.value);
List<SysAuth> authList = sysAuthDao.selectByExample(authAccountExample);
if(CollectionUtil.isNotEmpty(authList)){
authList.forEach(sysAuth -> {
//验证密码
try {
if (!ShiroKit.authenticate(changeAccount.getPassword(), sysAuth.getCredential(), sysAuth.getSalt())) {
throw new BaseException(CodeEnum.PASSWORD_ERROR);
}
sysAuth.setIdentifier(changeAccount.getAccount());
sysAuthDao.updateByPrimaryKeySelective(sysAuth);
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
} catch (InvalidKeySpecException e) {
e.printStackTrace();
}
});
}else {
//不存在则添加账号
SysAuth sysAuth = new SysAuth();
sysAuth.setId(snowflake.nextId());
sysAuth.setUserId(userId);
sysAuth.setIdentifyType((byte) WebConstant.IDENTIFY_TYPE.Account.value);
sysAuth.setIdentifier(changeAccount.getAccount());
sysAuth.setSalt(ShiroKit.getRandomSalt(6));
sysAuth.setCredential(ShiroKit.md5(changeAccount.getPassword(), sysAuth.getSalt()));
sysAuthDao.insertSelective(sysAuth);
}
//修改完删除redis
redisUtil.del(accountKey);
}else {
throw new BaseException(CodeEnum.SMS_CODE_CORRECT);
}
}else {
throw new BaseException(CodeEnum.SMS_CODE_CORRECT);
}
}
@Override
public void updateNickname(Long userId, UserDto.UpdateNickname updateNickname) {
//查找redis该昵称是否正在使用
String nicknameKey = TallConstant.getUpdateNickname(updateNickname.getNickname());
if(redisUtil.hasKey(nicknameKey)){
throw new BaseException(CodeEnum.NICKNAME_REPEAT);
}
//未查到则存进redis时效一分钟
redisUtil.set(nicknameKey,updateNickname.getNickname(),60);
//查找数据库此昵称是否存在
SysUserExample sysUserExample = new SysUserExample();
sysUserExample.createCriteria().andNicknameEqualTo(updateNickname.getNickname());
List<SysUser> userList = sysUserDao.selectByExample(sysUserExample);
if(CollectionUtil.isNotEmpty(userList)){
throw new BaseException(CodeEnum.NICKNAME_REPEAT);
}
SysUser user = sysUserDao.selectByPrimaryKey(userId);
if(ObjectUtil.isNotNull(user)){
user.setNickname(updateNickname.getNickname());
sysUserDao.updateByPrimaryKeySelective(user);
}
redisUtil.del(nicknameKey);
}
@Override
public void uploadAvatarUrl(Long currentUserId, Part file) throws Exception {
//获取文件大小
float fileSize = (float) file.getSize();
System.out.println(fileSize);
//计算出倍数
float a = (float)(80 * 1024) / fileSize;
System.out.println(a);
//限制文件格式
String allowedExts = "png,jpg,jpeg";
String original = UploadFileUtil_Servlet3.getFileNameByPart(file);
String ext = FileUtil.extName(original);
if (StrUtil.isEmpty(ext) || !allowedExts.contains(ext)){
throw new NotSupportedFileTypeException("不支持的格式类型: " + ext);
}
//创建文件目录及名字
String extraPath = DateUtil.format(new Date(), "yyyyMMdd");
//上传的文件
String temporaryFilePath = File.separator + IdUtil.simpleUUID() + "." + ext;
File temporaryFile = new File(WebConstant.UPLOAD_AVATAR_URL + extraPath + temporaryFilePath);
FileUtils.copyInputStreamToFile(file.getInputStream(), temporaryFile);
//压缩后的文件
String compressFilePath = File.separator + IdUtil.simpleUUID() + "." + ext;
File compressFile = new File(WebConstant.UPLOAD_AVATAR_URL+ extraPath + compressFilePath);
//文件大于80k则进行压缩,否则不压缩
if(a < 1) {
ImageUtil.scale(temporaryFile, compressFile, a);
}
//获取文件的压缩前的文件名
String fullPath = WebConstant.UPLOAD_PATH_AVATAR_URL + File.separator + extraPath + temporaryFilePath;
//压缩前和压缩后的文件都存在则删除压缩前的文件
if(temporaryFile.exists() && compressFile.exists()){
FileUtil.del(temporaryFile);
//压缩成功后获取压缩后的文件名
fullPath = WebConstant.UPLOAD_PATH_AVATAR_URL + File.separator + extraPath + compressFilePath;
}
//查找到当前的用户,修改头像路径信息
SysUser sysUser = sysUserDao.selectByPrimaryKey(currentUserId);
sysUser.setAvatarUrl(PropUtil.gatewayUrl + WebConstant.TALL_UPLOADS + fullPath);
sysUserDao.updateByPrimaryKeySelective(sysUser);
}
@Override
public UserVo.SelectUserInfo selectUserInfo(Long currentUserId){
UserVo.SelectUserInfo selectUserInfo = sysUserDao.selectUserInfo(currentUserId);
if(ObjectUtil.isNotNull(selectUserInfo)){
//计算注册时长
if(ObjectUtil.isNotNull(selectUserInfo.getCreatedAt())){
long now = System.currentTimeMillis();
selectUserInfo.setDayOfUseTall((int) ((now - selectUserInfo.getCreatedAt().getTime()) / 1000 / 3600 / 24));
}
// //获取标签信息
// selectUserInfo.setLabelList(sysLabelDao.selectLabelByUserId(currentUserId,null,null));
//获取空间使用信息
UserVo.Interspace interspace = sysUserDao.selectInterspace(currentUserId);
selectUserInfo.setInterspace(interspace);
}
return selectUserInfo;
}
@Override
public UserVo.SelectUserInfo updateUserInfo(Long currentUserId, UserDto.UpdateUserInfo updateUserInfo) {
//查找用户
SysUser user = sysUserDao.selectByPrimaryKey(updateUserInfo.getId());
if(ObjectUtil.isNull(user)){
throw new BaseException(CodeEnum.NOT_USER);
}
//查找用户详细信息的记录
SysUserInfo sysUserInfo;
SysUserInfoExample sysUserInfoExample = new SysUserInfoExample();
sysUserInfoExample.createCriteria().andUserIdEqualTo(updateUserInfo.getId());
List<SysUserInfo> sysUserInfoList = sysUserInfoDao.selectByExample(sysUserInfoExample);
if(CollectionUtil.isNotEmpty(sysUserInfoList)){
sysUserInfo = sysUserInfoList.get(0);
}else {
sysUserInfo = new SysUserInfo();
sysUserInfo.setId(snowflake.nextId());
sysUserInfo.setUserId(updateUserInfo.getId());
sysUserInfoDao.insertSelective(sysUserInfo);
}
//修改昵称
if(StrUtil.isNotEmpty(updateUserInfo.getNickname())){
UserDto.UpdateNickname updateNickname = new UserDto.UpdateNickname();
updateNickname.setNickname(updateUserInfo.getNickname());
updateNickname(updateUserInfo.getId(),updateNickname);
}
//个人签名
if(StrUtil.isNotEmpty(updateUserInfo.getSignature())){
sysUserInfo.setSignature(updateUserInfo.getSignature());
}
//个人简介
if(StrUtil.isNotEmpty(updateUserInfo.getIntroduction())){
sysUserInfo.setIntroduction(updateUserInfo.getIntroduction());
}
//生日
if(StrUtil.isNotEmpty(updateUserInfo.getBirthday())){
sysUserInfo.setBirthday(updateUserInfo.getBirthday());
}
//所在地
if(StrUtil.isNotEmpty(updateUserInfo.getAddress())){
sysUserInfo.setAddress(updateUserInfo.getAddress());
}
//网页
if(StrUtil.isNotEmpty(updateUserInfo.getWebPath())){
sysUserInfo.setWebPath(updateUserInfo.getWebPath());
}
//公司
if(StrUtil.isNotEmpty(updateUserInfo.getCompany())){
sysUserInfo.setCompany(updateUserInfo.getCompany());
}
//职位
if(StrUtil.isNotEmpty(updateUserInfo.getPosition())){
sysUserInfo.setPosition(updateUserInfo.getPosition());
}
sysUserInfoDao.updateByPrimaryKeySelective(sysUserInfo);
return selectUserInfo(updateUserInfo.getId());
}
}

1621
signin/src/main/java/com/ccsens/signin/service/UserService.java

File diff suppressed because it is too large

55
signin/src/main/java/com/ccsens/signin/util/TallConstant.java

@ -0,0 +1,55 @@
package com.ccsens.signin.util;
/**
* @author
*/
public class TallConstant {
/*** redis key: 修改账号*/
public static final String UPDATE_ACCOUNT = "update_account_";
/*** redis key: 修改账号*/
public static final String UPDATE_NICKNAME = "update_nickname_";
/*** redis key: 查找登陆用户 格式 identifier_login_identifyType 有效期一天*/
public static final String LOGIN = "_login_";
/*** (需要特殊处理的插件)个人任务汇报插件*/
public static final String PERSONAL_TASK_REPORT = "personal_task_report";
/***一天 */
public static final long LOGIN_TIME = 60 * 60 * 24;
/**
* 接口发送的信息模板
* @param operateType 接口code
* @return
*/
public static String getRobotTemplateKey(int operateType) {
return "operate_type_" + operateType;
}
public static String getUpdateAccount(String account){
return UPDATE_ACCOUNT + account;
}
public static String getUpdateNickname(String nickname){
return UPDATE_ACCOUNT + nickname;
}
public static final class TaskRemindTiming {
/**不提醒*/
public static final byte REMIND_NONE = 0;
/**开始前*/
public static final byte REMIND_TASK_BEFORE_START = 1;
/**开始时*/
public static final byte REMIND_TASK_START = 2;
/**开始后*/
public static final byte REMIND_TASK_AFTER_START = 3;
/**结束前*/
public static final byte REMIND_TASK_BEFORE_END = 4;
/**结束时*/
public static final byte REMIND_TASK_END = 5;
/**结束后*/
public static final byte REMIND_TASK_AFTER_END = 6;
/**自定义*/
public static final byte REMIND_TASK_USER_DEFINED = 7;
}
}

168
signin/src/main/java/com/ccsens/signin/util/WxTemplateUtil.java

@ -0,0 +1,168 @@
package com.ccsens.signin.util;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import com.ccsens.util.WechatUtil;
import com.ccsens.util.wx.WxGzhUtil;
import com.ccsens.util.wx.WxTemplateMessage;
/**
* @description: 微信模板
* @author: whj
* @time: 2020/6/9 11:07
*/
public class WxTemplateUtil {
/**
* 设置小程序跳转
* @param projectId
* @return
*/
private static WxTemplateMessage getWxTemplateMessage(Long projectId) {
String url = String.format(WechatUtil.PROJECT_URL, projectId);
WxTemplateMessage.MiniProgram miniProgram = new WxTemplateMessage.MiniProgram(WechatUtil.appid,url);
WxTemplateMessage message = new WxTemplateMessage();
message.setMiniprogram(miniProgram);
return message;
}
/**
* 完成任务提醒(备注是在切面处统一加的)
* @param projectId
* @param userName
* @param operation
* @param taskName
* @return
*/
public static WxTemplateMessage getFinishTask(Long projectId, String userName, String operation, String taskName){
WxTemplateMessage message = getWxTemplateMessage(projectId);
message.setTemplate_id(WxGzhUtil.Template.TASK_FINISH.templateId);
WxTemplateMessage.TemplateData data = new WxTemplateMessage.TemplateData();
data.setFirst(new WxTemplateMessage.TemplateSettings(userName + operation + taskName));
data.setKeyword1(new WxTemplateMessage.TemplateSettings(taskName));
data.setKeyword2(new WxTemplateMessage.TemplateSettings(DateUtil.now()));
message.setData(data);
return message;
}
/**
* 添加任务(备注是在切面处统一加的)
* @param projectId
* @param userName
* @param taskName
* @return
*/
public static WxTemplateMessage getAddTask(Long projectId, String userName, String taskName) {
WxTemplateMessage message = getWxTemplateMessage(projectId);
message.setTemplate_id(WxGzhUtil.Template.TASK_ADD.templateId);
WxTemplateMessage.TemplateData data = new WxTemplateMessage.TemplateData();
data.setFirst(new WxTemplateMessage.TemplateSettings(StrUtil.format("{}添加了{}任务", userName, taskName)));
data.setKeyword1(new WxTemplateMessage.TemplateSettings(taskName));
data.setKeyword2(new WxTemplateMessage.TemplateSettings(DateUtil.now()));
message.setData(data);
return message;
}
/**
* 删除任务
* @param projectId
* @param userName
* @param taskName
* @return
*/
public static WxTemplateMessage getDeleteTask(Long projectId, String userName, String taskName) {
WxTemplateMessage message = getWxTemplateMessage(projectId);
message.setTemplate_id(WxGzhUtil.Template.TASK_DELETE.templateId);
WxTemplateMessage.TemplateData data = new WxTemplateMessage.TemplateData();
data.setFirst(new WxTemplateMessage.TemplateSettings(StrUtil.format("{}删除了{}任务", userName, taskName)));
data.setKeyword1(new WxTemplateMessage.TemplateSettings(taskName));
data.setKeyword2(new WxTemplateMessage.TemplateSettings(DateUtil.now()));
data.setKeyword3(new WxTemplateMessage.TemplateSettings(""));
message.setData(data);
return message;
}
/**
* 修改任务
* @param projectId
* @param userName
* @param taskName
* @return
*/
public static WxTemplateMessage getChangeTask(Long projectId, String userName, String taskName) {
WxTemplateMessage message = getAddTask(projectId, userName, taskName);
message.getData().setFirst(new WxTemplateMessage.TemplateSettings(StrUtil.format("{}修改了{}任务", userName, taskName)));
return message;
}
/**
* 上传交付物
* @param projectId
* @param userName
* @param deliverName
* @return
*/
public static WxTemplateMessage getAddDeliver(Long projectId, String userName, String deliverName) {
WxTemplateMessage message = getWxTemplateMessage(projectId);
message.setTemplate_id(WxGzhUtil.Template.TASK_PROGRESS.templateId);
WxTemplateMessage.TemplateData data = new WxTemplateMessage.TemplateData();
data.setFirst(new WxTemplateMessage.TemplateSettings(""));
data.setKeyword1(new WxTemplateMessage.TemplateSettings(userName + "上传了" + deliverName));
data.setKeyword2(new WxTemplateMessage.TemplateSettings("上传交付物"));
message.setData(data);
return message;
}
/**
* 删除交付物
* @param projectId
* @param userName
* @param deliverName
* @return
*/
public static WxTemplateMessage getDeleteDeliver(Long projectId, String userName, String deliverName) {
WxTemplateMessage message = getAddDeliver(projectId, userName, deliverName);
WxTemplateMessage.TemplateData data = message.getData();
data.setKeyword1(new WxTemplateMessage.TemplateSettings(userName + "删除了" + deliverName));
data.setKeyword2(new WxTemplateMessage.TemplateSettings("删除交付物"));
message.setData(data);
return message;
}
/**
* 检查交付物
* @param projectId
* @param userName
* @param deliverName
* @return
*/
public static WxTemplateMessage getCheckDeliver(Long projectId, String userName, String deliverName) {
WxTemplateMessage message = getAddDeliver(projectId, userName, deliverName);
WxTemplateMessage.TemplateData data = message.getData();
data.setKeyword1(new WxTemplateMessage.TemplateSettings(userName + "检查了" + deliverName));
data.setKeyword2(new WxTemplateMessage.TemplateSettings("检查交付物"));
message.setData(data);
return message;
}
/**
* 发表评论
* @param projectId
* @param userName
* @return
*/
public static WxTemplateMessage getAddComment(Long projectId, String userName) {
WxTemplateMessage message = getWxTemplateMessage(projectId);
message.setTemplate_id(WxGzhUtil.Template.TASK_PROGRESS.templateId);
WxTemplateMessage.TemplateData data = new WxTemplateMessage.TemplateData();
data.setFirst(new WxTemplateMessage.TemplateSettings(userName + "进行了点评"));
data.setKeyword1(new WxTemplateMessage.TemplateSettings(userName));
data.setKeyword2(new WxTemplateMessage.TemplateSettings(DateUtil.now()));
message.setData(data);
return message;
}
}

28
signin/src/main/resources/application-common.yml

@ -0,0 +1,28 @@
logging:
level:
com:
favorites: DEBUG
org:
hibernate: ERROR
springframework:
web: DEBUG
mybatis:
config-location: classpath:mybatis/mybatis-config.xml
mapper-locations: classpath*:mapper_*/*.xml
type-aliases-package: com.ccsens.ht.bean
server:
tomcat:
uri-encoding: UTF-8
spring:
http:
encoding:
charset: UTF-8
enabled: true
force: true
log-request-details: true
servlet:
multipart:
max-file-size: 10MB
max-request-size: 100MB

41
signin/src/main/resources/application-dev.yml

@ -0,0 +1,41 @@
server:
port: 7130
servlet:
context-path:
spring:
snowflake:
datacenterId: 1
workerId: 1
application:
name: signin
datasource:
type: com.alibaba.druid.pool.DruidDataSource
rabbitmq:
host: 192.168.0.99
password: 111111
port: 5672
username: admin
redis:
database: 0
host: 127.0.0.1
jedis:
pool:
max-active: 200
max-idle: 10
max-wait: -1ms
min-idle: 0
password: ''
port: 6379
timeout: 1000ms
swagger:
enable: true
gatewayUrl: https://test.tall.wiki/gateway/
notGatewayUrl: /home/staticrec/logo.png
smsCode: 0
wx:
prefixUrl: https://test.tall.wiki/wxconfigurer-api/
file:
path: /home/cloud/tall/uploads/
domain: http://localhost:7030/v1.0/
imgDomain: http://localhost:7030/v1.0/uploads

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save