部署相关修改
parent
6e51bc5606
commit
fd2c19e920
|
@ -1,6 +1,7 @@
|
|||
package com.jwl.driver.server.controller;
|
||||
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.jwl.driver.server.dto.QuestionQueryDto;
|
||||
import com.jwl.driver.server.exception.BusinessException;
|
||||
import com.jwl.driver.server.response.BaseResponse;
|
||||
|
@ -13,6 +14,7 @@ import org.springframework.web.bind.annotation.*;
|
|||
|
||||
import org.springframework.stereotype.Controller;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
|
@ -64,4 +66,15 @@ public class TdQuestionController {
|
|||
}
|
||||
return BaseResponse.success(tdQuestionService.getTestQuestion(queryDto));
|
||||
}
|
||||
|
||||
@ApiOperation("题目分类")
|
||||
@PostMapping("/questionCategory")
|
||||
public BaseResponse questionCategory(@RequestBody QuestionQueryDto queryDto) {
|
||||
log.info("分类题目标识======>questionIdList:{}", queryDto.getQuestionIdList());
|
||||
if (CollectionUtil.isEmpty(queryDto.getQuestionIdList())){
|
||||
return BaseResponse.success(Collections.emptyList());
|
||||
}
|
||||
return BaseResponse.success(tdQuestionService.questionCategory(queryDto));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ public class TdSysUserController {
|
|||
@Autowired
|
||||
private ITdSysUserService userService;
|
||||
|
||||
@ApiOperation("用户登陆")
|
||||
@ApiOperation("获取验证码")
|
||||
@GetMapping("/code")
|
||||
public BaseResponse code(@RequestParam String phone) {
|
||||
log.info("获取验证码======>phone:{}", phone);
|
||||
|
|
|
@ -24,6 +24,9 @@ public class TokenFilter extends OncePerRequestFilter {
|
|||
|
||||
|
||||
protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException {
|
||||
//移除线程变量里的缓存值
|
||||
TokenThreadUtil.remove();
|
||||
|
||||
String requestTokenHeader = request.getHeader("Authorization");
|
||||
if (StrUtil.isBlank(requestTokenHeader)) {
|
||||
log.warn("Bearer token 为空");
|
||||
|
|
|
@ -3,6 +3,7 @@ package com.jwl.driver.server.service;
|
|||
import com.jwl.driver.server.dto.QuestionQueryDto;
|
||||
import com.jwl.driver.server.entity.TdQuestion;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.jwl.driver.server.vo.QusetionCategoryVo;
|
||||
import com.jwl.driver.server.vo.QusetionVo;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -45,4 +46,11 @@ public interface ITdQuestionService extends IService<TdQuestion> {
|
|||
* @return
|
||||
*/
|
||||
List<QusetionVo> getTestQuestion(QuestionQueryDto queryDto);
|
||||
|
||||
/**
|
||||
* 题目分类
|
||||
* @param queryDto
|
||||
* @return
|
||||
*/
|
||||
List<QusetionCategoryVo> questionCategory(QuestionQueryDto queryDto);
|
||||
}
|
||||
|
|
|
@ -9,6 +9,7 @@ import com.jwl.driver.server.mapper.TdQuestionMapper;
|
|||
import com.jwl.driver.server.service.ITdQuestionService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.jwl.driver.server.service.ITdSysConfigService;
|
||||
import com.jwl.driver.server.vo.QusetionCategoryVo;
|
||||
import com.jwl.driver.server.vo.QusetionVo;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
@ -78,4 +79,13 @@ public class TdQuestionServiceImpl extends ServiceImpl<TdQuestionMapper, TdQuest
|
|||
}
|
||||
return resultList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<QusetionCategoryVo> questionCategory(QuestionQueryDto queryDto) {
|
||||
|
||||
return null;
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@ public class SmsUtil {
|
|||
private static String smsFreeSignName = "对嘛科技";
|
||||
|
||||
//用于存储短信验证码
|
||||
private static Map<String, String> codeMap = new HashMap<>();
|
||||
// private static Map<String, String> codeMap = new HashMap<>();
|
||||
|
||||
/**
|
||||
* 发送验证码
|
||||
|
@ -62,16 +62,16 @@ public class SmsUtil {
|
|||
if (code.length() == 5){
|
||||
code = "0" + code;
|
||||
}
|
||||
codeMap.put(phone, code);
|
||||
// codeMap.put(phone, code);
|
||||
return code;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取6位验证码
|
||||
*/
|
||||
public static String getCodeByPhone(String phone){
|
||||
return codeMap.get(phone);
|
||||
}
|
||||
// public static String getCodeByPhone(String phone){
|
||||
// return codeMap.get(phone);
|
||||
// }
|
||||
|
||||
/**
|
||||
* 通用的发送短信的方法
|
||||
|
|
|
@ -0,0 +1,38 @@
|
|||
package com.jwl.driver.server.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* @author 曹林
|
||||
* @description 题型分类
|
||||
* @create 2023/8/13 17:13
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@ApiModel("题型分类出参")
|
||||
public class QusetionCategoryVo {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 分类标识
|
||||
*/
|
||||
@ApiModelProperty("分类标识")
|
||||
private String category;
|
||||
|
||||
/**
|
||||
* 分类名称
|
||||
*/
|
||||
@ApiModelProperty("分类名称")
|
||||
private String categoryName;
|
||||
|
||||
/**
|
||||
* 类型数量
|
||||
*/
|
||||
@ApiModelProperty("类型数量")
|
||||
private Integer num;
|
||||
|
||||
}
|
|
@ -1,11 +1,11 @@
|
|||
spring:
|
||||
# redis 配置
|
||||
redis:
|
||||
host: 81.68.139.95
|
||||
port: 6793
|
||||
host: 118.31.23.45
|
||||
port: 6379
|
||||
database: 8
|
||||
timeout: 5000
|
||||
password: Rtf70vILtD
|
||||
password: 123456
|
||||
|
||||
# 数据库 配置
|
||||
datasource:
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
spring:
|
||||
# redis 配置
|
||||
redis:
|
||||
host: 81.68.139.95
|
||||
port: 6793
|
||||
host: 118.31.23.45
|
||||
port: 6379
|
||||
database: 8
|
||||
timeout: 5000
|
||||
password: Rtf70vILtD
|
||||
password: 123456
|
||||
|
||||
# 数据库 配置
|
||||
datasource:
|
||||
|
|
|
@ -7,7 +7,7 @@ spring:
|
|||
application:
|
||||
name: '@artifactId@'
|
||||
profiles:
|
||||
active: dev
|
||||
active: test
|
||||
#mybatis
|
||||
mybatis-plus:
|
||||
mapper-locations: classpath*:/mapper/**Mapper.xml
|
||||
|
|
|
@ -55,6 +55,9 @@
|
|||
<if test="queryDto.cid !=null and queryDto.cid !=''">
|
||||
and find_in_set(#{queryDto.cid},tq.CIDS)
|
||||
</if>
|
||||
<if test="queryDto.category !=null and queryDto.category !=''">
|
||||
and find_in_set(#{queryDto.category},tq.CATEGORY)
|
||||
</if>
|
||||
<if test="queryDto.point !=null and queryDto.point !=''">
|
||||
and tpq.POINT = #{queryDto.point}
|
||||
</if>
|
||||
|
|
Loading…
Reference in New Issue