Compare commits
13 Commits
c2226c499f
...
b9da231fda
Author | SHA1 | Date |
---|---|---|
|
b9da231fda | |
|
dd72d75e2e | |
|
fd2c19e920 | |
|
6e51bc5606 | |
|
c209aa3da3 | |
|
e3fbbe7922 | |
|
38d85ae195 | |
|
8fa894e344 | |
|
963d35a9a5 | |
|
773a323d84 | |
|
15462ce0ba | |
|
456a6192f6 | |
|
06bcf56bbc |
7
pom.xml
7
pom.xml
|
@ -145,6 +145,13 @@
|
|||
</dependency>
|
||||
<!-- 短信服务 -->
|
||||
|
||||
<!-- 微信支付 -->
|
||||
<dependency>
|
||||
<groupId>com.github.wechatpay-apiv3</groupId>
|
||||
<artifactId>wechatpay-java</artifactId>
|
||||
<version>0.2.11</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
package com.jwl.driver.server.autoconfigure;
|
||||
|
||||
import com.jwl.driver.server.util.SpringAsyncUtil;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
/**
|
||||
* spring工具类
|
||||
*/
|
||||
|
||||
@Configuration
|
||||
public class SecurityAutoConfiguration {
|
||||
|
||||
@Bean(name = {"SpringAsyncUtilBySecurityConfigurationProperties"})
|
||||
@ConditionalOnMissingBean({SpringAsyncUtil.class})
|
||||
public SpringAsyncUtil springAsyncUtil() {
|
||||
return new SpringAsyncUtil();
|
||||
}
|
||||
|
||||
}
|
|
@ -28,7 +28,8 @@ public class CorsConfig implements WebMvcConfigurer {
|
|||
registry.addInterceptor(authInterceptor).addPathPatterns("/**").excludePathPatterns("/**/login",
|
||||
"/error",
|
||||
"/webjars/**",
|
||||
"/doc.html");
|
||||
"/doc.html",
|
||||
"/tdQuestion/duima/*");
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -32,7 +32,6 @@ public class SwaggerConfig {
|
|||
@Order(value = 1)
|
||||
public Docket adminDocket(){
|
||||
return new Docket(DocumentationType.SWAGGER_2)
|
||||
.pathMapping("/driver-api")
|
||||
.enable(true)
|
||||
.apiInfo(groupApiInfo())
|
||||
.select()
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
package com.jwl.driver.server.config;
|
||||
|
||||
import lombok.Data;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@ConfigurationProperties(prefix = "wechatpay")
|
||||
@Data
|
||||
@Component
|
||||
public class WechatPayConfig {
|
||||
/** 应用ID */
|
||||
private String appId;
|
||||
/** 商户ID */
|
||||
private String mchId;
|
||||
/** 秘钥 */
|
||||
private String apiV3Key;
|
||||
/** 证书序列号 */
|
||||
private String mchSerialNo;
|
||||
/** 证书路径 */
|
||||
private String privateKeyPath;
|
||||
}
|
|
@ -6,5 +6,42 @@ package com.jwl.driver.server.constant;
|
|||
|
||||
public class Constants {
|
||||
|
||||
public static Integer DEFAULT_CARTYPE_ID = -1;
|
||||
|
||||
//短信验证码redis存储的前缀
|
||||
public static String MESSAGE_CODE_PREFIX = "code_";
|
||||
|
||||
//短信验证码的模板
|
||||
public static String MESSAGE_TEMPLATE = "SMS_198880447";
|
||||
|
||||
//是否有效-有效
|
||||
public static String IS_ACTIVE_TRUE = "0";
|
||||
|
||||
//是否有效-无效
|
||||
public static String IS_ACTIVE_FALSE = "1";
|
||||
|
||||
//科目一
|
||||
public static String SUBJECT_ONE = "1";
|
||||
|
||||
//科目二
|
||||
public static String SUBJECT_TWO = "2";
|
||||
|
||||
//科目三
|
||||
public static String SUBJECT_THREE = "3";
|
||||
|
||||
//科目四
|
||||
public static String SUBJECT_FOUR = "4";
|
||||
|
||||
//单选题
|
||||
public static String QUESTION_TYPE_ONE = "1";
|
||||
|
||||
//判断题
|
||||
public static String QUESTION_TYPE_TWO = "2";
|
||||
|
||||
//多选题
|
||||
public static String QUESTION_TYPE_THREE = "3";
|
||||
|
||||
//字典表题目分类标识
|
||||
public static String QUESTION_CATEGORY = "QusetionCategory";
|
||||
|
||||
}
|
||||
|
|
|
@ -1,9 +1,19 @@
|
|||
package com.jwl.driver.server.controller;
|
||||
|
||||
|
||||
import com.jwl.driver.server.dto.QuestionQueryDto;
|
||||
import com.jwl.driver.server.response.BaseResponse;
|
||||
import com.jwl.driver.server.service.ITdCarService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
|
@ -13,8 +23,19 @@ import org.springframework.stereotype.Controller;
|
|||
* @author Automated procedures
|
||||
* @since 2023-08-10
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("//tdCar")
|
||||
@Api(tags = "车型")
|
||||
@RestController
|
||||
@RequestMapping("/tdCar")
|
||||
@Slf4j
|
||||
public class TdCarController {
|
||||
|
||||
@Autowired
|
||||
private ITdCarService carService;
|
||||
|
||||
@ApiOperation("获取车型列表")
|
||||
@GetMapping("/list")
|
||||
public BaseResponse list() {
|
||||
return BaseResponse.success(carService.list());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,9 +1,21 @@
|
|||
package com.jwl.driver.server.controller;
|
||||
|
||||
|
||||
import com.jwl.driver.server.dto.MemberQueryDto;
|
||||
import com.jwl.driver.server.exception.BusinessException;
|
||||
import com.jwl.driver.server.response.BaseResponse;
|
||||
import com.jwl.driver.server.service.ITdMemberService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
|
@ -13,8 +25,27 @@ import org.springframework.stereotype.Controller;
|
|||
* @author Automated procedures
|
||||
* @since 2023-08-10
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("//tdMember")
|
||||
@Api(tags = "会员")
|
||||
@RestController
|
||||
@RequestMapping("/tdMember")
|
||||
@Slf4j
|
||||
public class TdMemberController {
|
||||
|
||||
@Autowired
|
||||
private ITdMemberService memberService;
|
||||
|
||||
@ApiOperation("查询会员列表")
|
||||
@PostMapping("/queryMember")
|
||||
public BaseResponse queryMember(@RequestBody MemberQueryDto queryDto) {
|
||||
log.info("获取会员列表======>queryDto:{}", queryDto);
|
||||
return BaseResponse.success(memberService.queryMember(queryDto));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("查询用户开通的会员")
|
||||
@PostMapping("/queryUserMember")
|
||||
public BaseResponse queryUserMember(@RequestBody MemberQueryDto queryDto) {
|
||||
log.info("获取用户会员列表======>queryDto:{}", queryDto);
|
||||
return BaseResponse.success(memberService.queryUserMember(queryDto));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,10 +1,25 @@
|
|||
package com.jwl.driver.server.controller;
|
||||
|
||||
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
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;
|
||||
import com.jwl.driver.server.service.ITdQuestionService;
|
||||
import com.jwl.driver.server.vo.QusetionVo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import org.springframework.stereotype.Controller;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 题库; 前端控制器
|
||||
|
@ -13,8 +28,77 @@ import org.springframework.stereotype.Controller;
|
|||
* @author Automated procedures
|
||||
* @since 2023-08-10
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("//tdQuestion")
|
||||
@Api(tags = "考试题库")
|
||||
@RestController
|
||||
@RequestMapping("/tdQuestion")
|
||||
@Slf4j
|
||||
public class TdQuestionController {
|
||||
|
||||
@Autowired
|
||||
private ITdQuestionService tdQuestionService;
|
||||
|
||||
@ApiOperation("根据id获取题目")
|
||||
@PostMapping("/queryQuestionById")
|
||||
public BaseResponse queryQuestionById(@RequestBody QuestionQueryDto queryDto) {
|
||||
log.info("获取题型======>queryDto:{}", queryDto);
|
||||
return BaseResponse.success(tdQuestionService.queryQuestionById(queryDto));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("根据id列表获取题目")
|
||||
@PostMapping("/queryQuestionByIdList")
|
||||
public BaseResponse queryQuestionByIdList(@RequestBody QuestionQueryDto queryDto) {
|
||||
log.info("获取题型======>queryDto:{}", queryDto);
|
||||
return BaseResponse.success(tdQuestionService.queryQuestionByIdList(queryDto));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("根据查询条件获取题目")
|
||||
@PostMapping("/queryQuestion")
|
||||
public BaseResponse queryQuestion(@RequestBody QuestionQueryDto queryDto) {
|
||||
log.info("获取题型======>queryDto:{}", queryDto);
|
||||
return BaseResponse.success(tdQuestionService.queryQuestion(queryDto));
|
||||
}
|
||||
|
||||
@ApiOperation("获取模拟考试题目")
|
||||
@PostMapping("/getTestQuestion")
|
||||
public BaseResponse getTestQuestion(@RequestBody QuestionQueryDto queryDto) {
|
||||
log.info("获取模拟考试题目======>queryDto:{}", queryDto);
|
||||
if (Objects.isNull(queryDto.getCarTypeId()) && Objects.isNull(queryDto.getSubject())){
|
||||
throw new BusinessException("缺少必要参数");
|
||||
}
|
||||
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));
|
||||
}
|
||||
|
||||
@ApiOperation("对嘛接口-根据查询条件获取题目")
|
||||
@GetMapping("/duima/list")
|
||||
public Map listQuestion( QuestionQueryDto queryDto) {
|
||||
log.info("获取题型======>queryDto:{}", queryDto);
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
result.put("code", 200);
|
||||
result.put("data", tdQuestionService.queryQuestion(queryDto));
|
||||
return result;
|
||||
}
|
||||
|
||||
@ApiOperation("对嘛接口-修改题库")
|
||||
@PutMapping("/duima/update")
|
||||
public Map updateQuestion(@RequestBody QusetionVo qusetionVo) {
|
||||
log.info("修改题库======>qusetionVo:{}", qusetionVo);
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
result.put("code", 200);
|
||||
result.put("data", tdQuestionService.updateQuestion(qusetionVo));
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,10 +1,21 @@
|
|||
package com.jwl.driver.server.controller;
|
||||
|
||||
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import com.jwl.driver.server.dto.QuestionQueryDto;
|
||||
import com.jwl.driver.server.dto.TestSubmitDto;
|
||||
import com.jwl.driver.server.response.BaseResponse;
|
||||
import com.jwl.driver.server.service.ITdQuestionService;
|
||||
import com.jwl.driver.server.service.ITdQuestionTestService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import org.springframework.stereotype.Controller;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 模拟考试成绩表; 前端控制器
|
||||
|
@ -13,8 +24,23 @@ import org.springframework.stereotype.Controller;
|
|||
* @author Automated procedures
|
||||
* @since 2023-08-10
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("//tdQuestionTest")
|
||||
@Api(tags = "考试")
|
||||
@RestController
|
||||
@RequestMapping("/tdQuestionTest")
|
||||
@Slf4j
|
||||
public class TdQuestionTestController {
|
||||
|
||||
@Autowired
|
||||
private ITdQuestionTestService testService;
|
||||
|
||||
@ApiOperation("提交考试成绩")
|
||||
@PostMapping("/testSubmit")
|
||||
public BaseResponse testSubmit(@RequestBody @Valid TestSubmitDto submitDto) {
|
||||
log.info("考试成绩======>submitDto:{}", submitDto);
|
||||
return BaseResponse.success(testService.testSubmit(submitDto));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,9 +1,18 @@
|
|||
package com.jwl.driver.server.controller;
|
||||
|
||||
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.jwl.driver.server.entity.TdSysConfig;
|
||||
import com.jwl.driver.server.response.BaseResponse;
|
||||
import com.jwl.driver.server.service.ITdSysConfigService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import org.springframework.stereotype.Controller;
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
|
@ -13,8 +22,42 @@ import org.springframework.stereotype.Controller;
|
|||
* @author Automated procedures
|
||||
* @since 2023-08-10
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("//tdSysConfig")
|
||||
@Api(tags = "字典值配置")
|
||||
@RestController
|
||||
@RequestMapping("/tdSysConfig")
|
||||
@Slf4j
|
||||
public class TdSysConfigController {
|
||||
|
||||
@Autowired
|
||||
private ITdSysConfigService configService;
|
||||
|
||||
/**
|
||||
* 根据配置key和carTypeId获取配置信息,配置与车型无关则carTypeId为-1
|
||||
*/
|
||||
@ApiOperation("根据配置key和carTypeId获取配置信息,配置与车型无关则carTypeId为-1")
|
||||
@GetMapping(value = "/queryConfigByKey")
|
||||
public BaseResponse queryConfigByKey(@RequestParam("configKey") String configKey, @RequestParam("carTypeId") Integer carTypeId) {
|
||||
return BaseResponse.success(configService.queryConfigByKey(configKey, carTypeId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据配置key和carTypeId获取配置值,配置与车型无关则carTypeId为-1
|
||||
*/
|
||||
@ApiOperation("根据配置key获取配置值")
|
||||
@GetMapping(value = "/queryConfigValueByKey")
|
||||
public BaseResponse<String> queryConfigValueByKey(@RequestParam("configKey") String configKey, @RequestParam("carTypeId") Integer carTypeId) {
|
||||
|
||||
return BaseResponse.success(configService.queryConfigValueByKey(configKey, carTypeId));
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据配置keys和carTypeId获取配置信息,配置与车型无关则carTypeId为-1
|
||||
*/
|
||||
@ApiOperation("根据配置keys和carTypeId获取配置信息,配置与车型无关则carTypeId为-1")
|
||||
@GetMapping(value = "/queryConfigByKeys")
|
||||
public BaseResponse<Map<String, TdSysConfig>> queryConfigByKeys(@RequestParam("configKeys") String configKeys, @RequestParam("carTypeId") Integer carTypeId) {
|
||||
return BaseResponse.success(configService.queryConfigByKeys(Arrays.asList(configKeys.split(",")),carTypeId));
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,10 +1,23 @@
|
|||
package com.jwl.driver.server.controller;
|
||||
|
||||
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.jwl.driver.server.entity.TdSysConfigList;
|
||||
import com.jwl.driver.server.response.BaseResponse;
|
||||
import com.jwl.driver.server.service.ITdSysConfigListService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import org.springframework.stereotype.Controller;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 系统配置列表; 前端控制器
|
||||
|
@ -13,8 +26,36 @@ import org.springframework.stereotype.Controller;
|
|||
* @author Automated procedures
|
||||
* @since 2023-08-10
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("//tdSysConfigList")
|
||||
@Api(tags = "字典值列表配置")
|
||||
@RestController
|
||||
@RequestMapping("/tdSysConfigList")
|
||||
@Slf4j
|
||||
public class TdSysConfigListController {
|
||||
|
||||
@Autowired
|
||||
private ITdSysConfigListService configListService;
|
||||
|
||||
/**
|
||||
* 根据configKey和carTypeId查询系统配置列表
|
||||
*/
|
||||
@ApiOperation("根据configKey和carTypeId查询系统配置列表")
|
||||
@GetMapping("/querySysConfigList")
|
||||
public BaseResponse querySysConfigList(@RequestParam("configKey") String configKey, @RequestParam("carTypeId") Integer carTypeId) {
|
||||
log.info("request to querySysConfigList :{}", configKey);
|
||||
List<TdSysConfigList> resultList = configListService.querySysConfigList(configKey, carTypeId);
|
||||
return BaseResponse.success(resultList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过多个配置key 和 carTypeId 查询多个配置列表
|
||||
*/
|
||||
@ApiOperation("通过多个配置key 和 carTypeId 查询多个配置列表")
|
||||
@GetMapping("/querySysConfigMap")
|
||||
public BaseResponse querySysConfigMap(@RequestParam("configKeys") String configKeys, @RequestParam("carTypeId") Integer carTypeId) {
|
||||
log.info("request to querySysConfigList :{}", configKeys);
|
||||
Map<String, Map<String, String>> map = configListService.querySysConfigMap(Arrays.asList(configKeys.split(",")), carTypeId);
|
||||
return BaseResponse.success(map);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -12,6 +12,7 @@ import org.springframework.web.bind.annotation.*;
|
|||
|
||||
import org.springframework.stereotype.Controller;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
|
@ -31,15 +32,20 @@ public class TdSysUserController {
|
|||
@Autowired
|
||||
private ITdSysUserService userService;
|
||||
|
||||
@ApiOperation("获取验证码")
|
||||
@GetMapping("/code")
|
||||
public BaseResponse code(@RequestParam String phone) {
|
||||
log.info("获取验证码======>phone:{}", phone);
|
||||
return BaseResponse.success(userService.code(phone));
|
||||
}
|
||||
|
||||
@ApiOperation("用户登陆")
|
||||
@PostMapping("/login")
|
||||
public BaseResponse login(@RequestBody LoginUserDto loginUserDto) {
|
||||
public BaseResponse login(@RequestBody @Valid LoginUserDto loginUserDto) {
|
||||
log.info("用户登录======>loginUserDto:{}", loginUserDto);
|
||||
return BaseResponse.success(userService.login(loginUserDto));
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation("用户登出")
|
||||
@GetMapping("/loginOut")
|
||||
public BaseResponse loginOut(){
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
package com.jwl.driver.server.controller;
|
||||
|
||||
import com.jwl.driver.server.dto.WechatPayDto;
|
||||
import com.jwl.driver.server.response.BaseResponse;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 微信支付 接口
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/wechat/pay")
|
||||
public class WechatPayController {
|
||||
|
||||
//生成预支付订单
|
||||
@PostMapping("/prepay")
|
||||
public BaseResponse createPrepay(@RequestBody WechatPayDto payDto){
|
||||
//获取openId
|
||||
|
||||
return BaseResponse.success();
|
||||
|
||||
}
|
||||
|
||||
//支付回调接口
|
||||
|
||||
//查询订单接口
|
||||
|
||||
//关闭订单接口
|
||||
}
|
|
@ -15,11 +15,11 @@ import javax.validation.constraints.NotBlank;
|
|||
@Accessors(chain = true)
|
||||
public class LoginUserDto {
|
||||
|
||||
@ApiModelProperty("登陆手机号")
|
||||
@ApiModelProperty(value = "登陆手机号",required = true)
|
||||
@NotBlank(message = "登陆手机号不能为空")
|
||||
private String phone;
|
||||
|
||||
@ApiModelProperty("登陆验证码")
|
||||
@ApiModelProperty(value = "登陆验证码",required = true)
|
||||
@NotBlank(message = "登陆验证码不能为空")
|
||||
private String code;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,44 @@
|
|||
package com.jwl.driver.server.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 会员查询入参;
|
||||
* </p>
|
||||
*
|
||||
* @author Automated procedures
|
||||
* @since 2023-08-10
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@ApiModel("会员查询入参")
|
||||
public class MemberQueryDto implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 会员标识
|
||||
*/
|
||||
@ApiModelProperty("会员标识")
|
||||
private Integer memberId;
|
||||
|
||||
/**
|
||||
* 车型标识
|
||||
*/
|
||||
@ApiModelProperty("车型标识")
|
||||
private Integer carTypeId;
|
||||
|
||||
/**
|
||||
* 科目标识
|
||||
*/
|
||||
@ApiModelProperty("科目标识")
|
||||
private String subject;
|
||||
|
||||
}
|
|
@ -0,0 +1,96 @@
|
|||
package com.jwl.driver.server.dto;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 题库查询入参;
|
||||
* </p>
|
||||
*
|
||||
* @author Automated procedures
|
||||
* @since 2023-08-10
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@ApiModel("题目查询入参")
|
||||
public class QuestionQueryDto implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 题目标识
|
||||
*/
|
||||
@ApiModelProperty("题目标识")
|
||||
private Long questionId;
|
||||
|
||||
/**
|
||||
* 题目标识列表
|
||||
*/
|
||||
@ApiModelProperty("题目标识列表")
|
||||
private List<Long> questionIdList;
|
||||
|
||||
/**
|
||||
* 题型分类
|
||||
*/
|
||||
@ApiModelProperty("题型分类")
|
||||
private String category;
|
||||
|
||||
/**
|
||||
* 章节标识
|
||||
*/
|
||||
@ApiModelProperty("章节标识")
|
||||
private String chapter;
|
||||
|
||||
/**
|
||||
* 所属科目,1:科目1,2:科目4
|
||||
*/
|
||||
@ApiModelProperty("所属科目,1:科目1,2:科目4")
|
||||
private String subject;
|
||||
|
||||
/**
|
||||
* 车型
|
||||
*/
|
||||
@ApiModelProperty("车型")
|
||||
private Integer carTypeId;
|
||||
|
||||
/**
|
||||
* 题型: 单选 多选 判断题
|
||||
*/
|
||||
@ApiModelProperty("题型: 单选 多选 判断题")
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 专项练习类型
|
||||
*/
|
||||
@ApiModelProperty("专项练习类型")
|
||||
private String cid;
|
||||
|
||||
/**
|
||||
* 考点
|
||||
*/
|
||||
@ApiModelProperty("考点")
|
||||
private String point;
|
||||
|
||||
/**
|
||||
* 获取题数
|
||||
*/
|
||||
@ApiModelProperty("获取题数")
|
||||
private int Num;
|
||||
|
||||
/**
|
||||
* 题目
|
||||
*/
|
||||
@ApiModelProperty("题目")
|
||||
private String question;
|
||||
|
||||
}
|
|
@ -0,0 +1,50 @@
|
|||
package com.jwl.driver.server.dto;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.Max;
|
||||
import javax.validation.constraints.Min;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author 曹林
|
||||
* @description 成绩提交入参
|
||||
* @create 2023/8/14 21:22
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@ApiModel("成绩提交入参")
|
||||
public class TestSubmitDto {
|
||||
|
||||
/**
|
||||
* 车型标识
|
||||
*/
|
||||
@ApiModelProperty(value = "车型标识",required = true)
|
||||
@NotNull(message = "车型标识不能为空")
|
||||
private Integer carTypeId;
|
||||
|
||||
/**
|
||||
* 考试得分
|
||||
*/
|
||||
@ApiModelProperty(value = "考试得分",required = true)
|
||||
@NotNull(message = "考试得分不能为空")
|
||||
@Max(100)
|
||||
@Min(0)
|
||||
private Integer score;
|
||||
|
||||
/**
|
||||
* 考试时长,单位为秒
|
||||
*/
|
||||
@ApiModelProperty(value = "考试时长,单位为秒",required = true)
|
||||
@NotNull(message = "考试时间不能为空")
|
||||
@Max(3600)
|
||||
@Min(0)
|
||||
private Integer testTime;
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
|
||||
package com.jwl.driver.server.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class WechatPayDto {
|
||||
|
||||
private Double money;//金额
|
||||
|
||||
private String code;
|
||||
|
||||
|
||||
}
|
|
@ -43,6 +43,12 @@ public class TdMember implements Serializable {
|
|||
@TableField("CAR_TYPE_ID")
|
||||
private Integer carTypeId;
|
||||
|
||||
/**
|
||||
* 科目
|
||||
*/
|
||||
@TableField("SUBJECTS")
|
||||
private String subjects;
|
||||
|
||||
/**
|
||||
* 会员价格,单位元
|
||||
*/
|
||||
|
|
|
@ -27,8 +27,8 @@ public class TdPointQuestion implements Serializable {
|
|||
/**
|
||||
* 考点标识
|
||||
*/
|
||||
@TableId(value = "POINT", type = IdType.AUTO)
|
||||
private Integer point;
|
||||
@TableField(value = "POINT")
|
||||
private String point;
|
||||
|
||||
/**
|
||||
* 车型
|
||||
|
|
|
@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.annotation.IdType;
|
|||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import java.io.Serializable;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
@ -86,8 +88,8 @@ public class TdQuestion implements Serializable {
|
|||
/**
|
||||
* 未知
|
||||
*/
|
||||
@TableField("CID")
|
||||
private String cid;
|
||||
@TableField("CIDS")
|
||||
private String cids;
|
||||
|
||||
/**
|
||||
* 题型分类
|
||||
|
@ -137,6 +139,12 @@ public class TdQuestion implements Serializable {
|
|||
@TableField("TYPE")
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 显示序号
|
||||
*/
|
||||
@TableField("SHOW_ORDER")
|
||||
private int showOrder;
|
||||
|
||||
/**
|
||||
* 车型
|
||||
*/
|
||||
|
@ -150,4 +158,20 @@ public class TdQuestion implements Serializable {
|
|||
private String isActive;
|
||||
|
||||
|
||||
/**
|
||||
* 是否易错
|
||||
*/
|
||||
@TableField("IS_ERROR")
|
||||
private Integer isError;
|
||||
/**
|
||||
* 是否v新规
|
||||
*/
|
||||
@TableField("IS_NEW")
|
||||
private Integer isNew;
|
||||
/**
|
||||
* 考点
|
||||
*/
|
||||
@TableField("EXAM_KEYS")
|
||||
private String examKeys;
|
||||
|
||||
}
|
||||
|
|
|
@ -5,6 +5,11 @@ import com.baomidou.mybatisplus.annotation.TableId;
|
|||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import java.io.Serializable;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
|
||||
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
@ -64,6 +69,8 @@ public class TdSysUser implements Serializable {
|
|||
* 创建时间
|
||||
*/
|
||||
@TableField("CREATE_TIME")
|
||||
@JsonDeserialize(using = LocalDateTimeDeserializer.class)
|
||||
@JsonSerialize(using = LocalDateTimeSerializer.class)
|
||||
private LocalDateTime createTime;
|
||||
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package com.jwl.driver.server.exception;
|
||||
|
||||
|
||||
import com.jwl.driver.server.enums.StatusEnum;
|
||||
import com.jwl.driver.server.response.BaseResponse;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
@ -37,6 +38,7 @@ public class GlobalExceptionHandler {
|
|||
|
||||
@ExceptionHandler(BusinessException.class)
|
||||
public BaseResponse<?> businessException(BusinessException e) {
|
||||
e.printStackTrace();
|
||||
return BaseResponse.fail(e.getCode(), null, e.getMessage());
|
||||
}
|
||||
|
||||
|
|
|
@ -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 为空");
|
||||
|
|
|
@ -1,7 +1,12 @@
|
|||
package com.jwl.driver.server.mapper;
|
||||
|
||||
import com.jwl.driver.server.dto.MemberQueryDto;
|
||||
import com.jwl.driver.server.entity.TdMember;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.jwl.driver.server.vo.MemberVo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
|
@ -13,4 +18,18 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|||
*/
|
||||
public interface TdMemberMapper extends BaseMapper<TdMember> {
|
||||
|
||||
/**
|
||||
* 获取会员列表
|
||||
* @param queryDto
|
||||
* @return
|
||||
*/
|
||||
List<MemberVo> queryMember(@Param("queryDto") MemberQueryDto queryDto);
|
||||
|
||||
/**
|
||||
* 获取用户会员
|
||||
* @param queryDto
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
List<MemberVo> queryUserMember(@Param("queryDto") MemberQueryDto queryDto, @Param("userId") Long userId);
|
||||
}
|
||||
|
|
|
@ -1,7 +1,12 @@
|
|||
package com.jwl.driver.server.mapper;
|
||||
|
||||
import com.jwl.driver.server.dto.QuestionQueryDto;
|
||||
import com.jwl.driver.server.entity.TdQuestion;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.jwl.driver.server.vo.QusetionVo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
|
@ -13,4 +18,19 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|||
*/
|
||||
public interface TdQuestionMapper extends BaseMapper<TdQuestion> {
|
||||
|
||||
/**
|
||||
* 查询考题
|
||||
* @param queryDto
|
||||
* @return
|
||||
*/
|
||||
List<QusetionVo> queryQuestion(@Param("queryDto") QuestionQueryDto queryDto);
|
||||
|
||||
/**
|
||||
* 随机查询考题
|
||||
* @param queryDto
|
||||
* @return
|
||||
*/
|
||||
List<QusetionVo> queryQuestionByRandom(@Param("queryDto") QuestionQueryDto queryDto);
|
||||
|
||||
int updateQuestion(@Param("qusetionVo") QusetionVo qusetionVo);
|
||||
}
|
||||
|
|
|
@ -21,6 +21,7 @@ import org.springframework.stereotype.Component;
|
|||
@Component
|
||||
@Slf4j
|
||||
public class RedisCache {
|
||||
|
||||
@Autowired
|
||||
public RedisTemplate redisTemplate;
|
||||
|
||||
|
|
|
@ -1,7 +1,11 @@
|
|||
package com.jwl.driver.server.service;
|
||||
|
||||
import com.jwl.driver.server.dto.MemberQueryDto;
|
||||
import com.jwl.driver.server.entity.TdMember;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.jwl.driver.server.vo.MemberVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
|
@ -13,4 +17,17 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
|||
*/
|
||||
public interface ITdMemberService extends IService<TdMember> {
|
||||
|
||||
/**
|
||||
* 查询会员列表
|
||||
* @param queryDto
|
||||
* @return
|
||||
*/
|
||||
List<MemberVo> queryMember(MemberQueryDto queryDto);
|
||||
|
||||
/**
|
||||
* 获取用户开通的会员
|
||||
* @param queryDto
|
||||
* @return
|
||||
*/
|
||||
List<MemberVo> queryUserMember(MemberQueryDto queryDto);
|
||||
}
|
||||
|
|
|
@ -1,7 +1,12 @@
|
|||
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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
|
@ -13,4 +18,46 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
|||
*/
|
||||
public interface ITdQuestionService extends IService<TdQuestion> {
|
||||
|
||||
|
||||
/**
|
||||
* 根据id 获取题目
|
||||
* @param queryDto
|
||||
* @return
|
||||
*/
|
||||
TdQuestion queryQuestionById(QuestionQueryDto queryDto);
|
||||
|
||||
/**
|
||||
* 根据id列表 批量获取题目
|
||||
* @param queryDto
|
||||
* @return
|
||||
*/
|
||||
List<TdQuestion> queryQuestionByIdList(QuestionQueryDto queryDto);
|
||||
|
||||
/**
|
||||
* 根据查询条件获取列表
|
||||
* @param queryDto
|
||||
* @return
|
||||
*/
|
||||
List<QusetionVo> queryQuestion(QuestionQueryDto queryDto);
|
||||
|
||||
/**
|
||||
* 获取考试题目
|
||||
* @param queryDto
|
||||
* @return
|
||||
*/
|
||||
List<QusetionVo> getTestQuestion(QuestionQueryDto queryDto);
|
||||
|
||||
/**
|
||||
* 题目分类
|
||||
* @param queryDto
|
||||
* @return
|
||||
*/
|
||||
List<QusetionCategoryVo> questionCategory(QuestionQueryDto queryDto);
|
||||
|
||||
/**
|
||||
* 修改题库
|
||||
* @param qusetionVo
|
||||
* @return
|
||||
*/
|
||||
int updateQuestion(QusetionVo qusetionVo);
|
||||
}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.jwl.driver.server.service;
|
||||
|
||||
import com.jwl.driver.server.dto.TestSubmitDto;
|
||||
import com.jwl.driver.server.entity.TdQuestionTest;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
|
@ -13,4 +14,10 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
|||
*/
|
||||
public interface ITdQuestionTestService extends IService<TdQuestionTest> {
|
||||
|
||||
/**
|
||||
* 交卷 考试提交
|
||||
* @param submitDto
|
||||
* @return
|
||||
*/
|
||||
Boolean testSubmit(TestSubmitDto submitDto);
|
||||
}
|
||||
|
|
|
@ -3,6 +3,9 @@ package com.jwl.driver.server.service;
|
|||
import com.jwl.driver.server.entity.TdSysConfigList;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 系统配置列表; 服务类
|
||||
|
@ -13,4 +16,19 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
|||
*/
|
||||
public interface ITdSysConfigListService extends IService<TdSysConfigList> {
|
||||
|
||||
/**
|
||||
* 根据configKey和carTypeId查询系统配置列表
|
||||
* @param configKey
|
||||
* @param carTypeId
|
||||
* @return
|
||||
*/
|
||||
List<TdSysConfigList> querySysConfigList(String configKey, Integer carTypeId);
|
||||
|
||||
/**
|
||||
* 通过多个配置key 和 carTypeId 查询多个配置列表
|
||||
* @param configKeyList
|
||||
* @param carTypeId
|
||||
* @return
|
||||
*/
|
||||
Map<String, Map<String, String>> querySysConfigMap(List<String> configKeyList, Integer carTypeId);
|
||||
}
|
||||
|
|
|
@ -3,6 +3,9 @@ package com.jwl.driver.server.service;
|
|||
import com.jwl.driver.server.entity.TdSysConfig;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 系统配置表; 服务类
|
||||
|
@ -13,4 +16,27 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
|||
*/
|
||||
public interface ITdSysConfigService extends IService<TdSysConfig> {
|
||||
|
||||
/**
|
||||
* 根据配置key和carTypeId获取配置信息,配置与车型无关则carTypeId为-1
|
||||
* @param configKey
|
||||
* @param carTypeId
|
||||
* @return
|
||||
*/
|
||||
TdSysConfig queryConfigByKey(String configKey, Integer carTypeId);
|
||||
|
||||
/**
|
||||
* 根据配置key和carTypeId获取配置值,配置与车型无关则carTypeId为-1
|
||||
* @param configKey
|
||||
* @param carTypeId
|
||||
* @return
|
||||
*/
|
||||
String queryConfigValueByKey(String configKey,Integer carTypeId);
|
||||
|
||||
/**
|
||||
* 根据配置keys和carTypeId获取配置信息,配置与车型无关则carTypeId为-1
|
||||
* @param configKeyList
|
||||
* @param carTypeId
|
||||
* @return
|
||||
*/
|
||||
Map<String, TdSysConfig> queryConfigByKeys(List<String> configKeyList,Integer carTypeId);
|
||||
}
|
||||
|
|
|
@ -15,6 +15,13 @@ import com.jwl.driver.server.vo.LoginUserVo;
|
|||
*/
|
||||
public interface ITdSysUserService extends IService<TdSysUser> {
|
||||
|
||||
/**
|
||||
* 获取短信验证码
|
||||
* @param phone
|
||||
* @return
|
||||
*/
|
||||
String code(String phone);
|
||||
|
||||
/**
|
||||
* 用户登陆
|
||||
* @param loginUserDto
|
||||
|
@ -27,4 +34,5 @@ public interface ITdSysUserService extends IService<TdSysUser> {
|
|||
* @return
|
||||
*/
|
||||
Boolean loginOut();
|
||||
|
||||
}
|
||||
|
|
|
@ -1,11 +1,20 @@
|
|||
package com.jwl.driver.server.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.jwl.driver.server.constant.Constants;
|
||||
import com.jwl.driver.server.dto.MemberQueryDto;
|
||||
import com.jwl.driver.server.entity.TdMember;
|
||||
import com.jwl.driver.server.mapper.TdMemberMapper;
|
||||
import com.jwl.driver.server.service.ITdMemberService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.jwl.driver.server.util.SecurityUtil;
|
||||
import com.jwl.driver.server.vo.MemberVo;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 会员类型表; 服务实现类
|
||||
|
@ -17,4 +26,39 @@ import org.springframework.stereotype.Service;
|
|||
@Service
|
||||
public class TdMemberServiceImpl extends ServiceImpl<TdMemberMapper, TdMember> implements ITdMemberService {
|
||||
|
||||
@Override
|
||||
public List<MemberVo> queryMember(MemberQueryDto queryDto) {
|
||||
|
||||
List<MemberVo> resultList = new ArrayList<>();
|
||||
|
||||
//获取用户已开通且未到期的会员(即使该会员已不售卖了)
|
||||
List<MemberVo> userMemberList = queryUserMember(queryDto);
|
||||
Map<Integer, MemberVo> userMemberMap = userMemberList.stream().collect(Collectors.toMap(MemberVo::getMemberId, v -> v, (v1, v2) -> v1));
|
||||
|
||||
//将用户购买的已停售但未过期的会员放在最前面
|
||||
List<MemberVo> expireMemberlist = userMemberList.stream().filter(s -> StrUtil.equals(s.getIsActive(), Constants.IS_ACTIVE_FALSE)).collect(Collectors.toList());
|
||||
if (CollectionUtil.isNotEmpty(expireMemberlist)){
|
||||
resultList.addAll(expireMemberlist);
|
||||
}
|
||||
|
||||
//获取现在可开通的会员
|
||||
List<MemberVo> memberList = this.getBaseMapper().queryMember(queryDto);
|
||||
if (CollectionUtil.isNotEmpty(memberList)){
|
||||
for (MemberVo memberVo : memberList) {
|
||||
if(userMemberMap.containsKey(memberVo.getMemberId())){
|
||||
resultList.add(userMemberMap.get(memberVo.getMemberId()));
|
||||
}else {
|
||||
resultList.add(memberVo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return resultList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MemberVo> queryUserMember(MemberQueryDto queryDto) {
|
||||
return this.getBaseMapper().queryUserMember(queryDto,SecurityUtil.getUserId());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,11 +1,25 @@
|
|||
package com.jwl.driver.server.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.jwl.driver.server.constant.Constants;
|
||||
import com.jwl.driver.server.dto.QuestionQueryDto;
|
||||
import com.jwl.driver.server.entity.TdQuestion;
|
||||
import com.jwl.driver.server.entity.TdSysConfigList;
|
||||
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.ITdSysConfigListService;
|
||||
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;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 题库; 服务实现类
|
||||
|
@ -17,4 +31,103 @@ import org.springframework.stereotype.Service;
|
|||
@Service
|
||||
public class TdQuestionServiceImpl extends ServiceImpl<TdQuestionMapper, TdQuestion> implements ITdQuestionService {
|
||||
|
||||
@Autowired
|
||||
private ITdSysConfigService configService;
|
||||
|
||||
@Autowired
|
||||
private ITdSysConfigListService configListService;
|
||||
|
||||
@Override
|
||||
public TdQuestion queryQuestionById(QuestionQueryDto queryDto) {
|
||||
return this.getBaseMapper().selectById(queryDto.getQuestionId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TdQuestion> queryQuestionByIdList(QuestionQueryDto queryDto) {
|
||||
LambdaQueryWrapper<TdQuestion> queryWrapper = new LambdaQueryWrapper<TdQuestion>()
|
||||
.in(TdQuestion::getQuestionId,queryDto.getQuestionIdList());
|
||||
|
||||
return this.getBaseMapper().selectList(queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<QusetionVo> queryQuestion(QuestionQueryDto queryDto) {
|
||||
return this.getBaseMapper().queryQuestion(queryDto);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<QusetionVo> getTestQuestion(QuestionQueryDto queryDto) {
|
||||
List<QusetionVo> resultList = new ArrayList<>();
|
||||
|
||||
if (StrUtil.equals(Constants.SUBJECT_ONE,queryDto.getSubject())){
|
||||
//40道判断题 60道单选 每题1分
|
||||
queryDto.setType(Constants.QUESTION_TYPE_ONE)
|
||||
.setNum(60);
|
||||
resultList.addAll(this.getBaseMapper().queryQuestionByRandom(queryDto));
|
||||
|
||||
queryDto.setType(Constants.QUESTION_TYPE_TWO)
|
||||
.setNum(40);
|
||||
resultList.addAll(this.getBaseMapper().queryQuestionByRandom(queryDto));
|
||||
|
||||
}else if(StrUtil.equals(Constants.SUBJECT_FOUR,queryDto.getSubject())){
|
||||
//20道判断题 20道单选 10道多选,每题2分,如果各车型不统一 可以配在数据库里
|
||||
queryDto.setType(Constants.QUESTION_TYPE_TWO)
|
||||
.setNum(20);
|
||||
|
||||
resultList.addAll(this.getBaseMapper().queryQuestionByRandom(queryDto));
|
||||
queryDto.setType(Constants.QUESTION_TYPE_ONE)
|
||||
.setNum(20);
|
||||
|
||||
resultList.addAll(this.getBaseMapper().queryQuestionByRandom(queryDto));
|
||||
queryDto.setType(Constants.QUESTION_TYPE_THREE)
|
||||
.setNum(10);
|
||||
resultList.addAll(this.getBaseMapper().queryQuestionByRandom(queryDto));
|
||||
}
|
||||
return resultList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<QusetionCategoryVo> questionCategory(QuestionQueryDto queryDto) {
|
||||
|
||||
List<QusetionCategoryVo> resultList = new ArrayList<>();
|
||||
//获取题目
|
||||
List<TdQuestion> tdQuestions = queryQuestionByIdList(queryDto);
|
||||
if (CollectionUtil.isEmpty(tdQuestions)){
|
||||
return resultList;
|
||||
}
|
||||
//获取分类
|
||||
List<TdSysConfigList> categoryList = configListService.querySysConfigList(Constants.QUESTION_CATEGORY, Constants.DEFAULT_CARTYPE_ID);
|
||||
Map<String, String> categoryMap = categoryList.stream().collect(Collectors.toMap(TdSysConfigList::getConfigItemCode, TdSysConfigList::getConfigItemName, (v1, v2) -> v1));
|
||||
Map<String,Integer> totalMap = new HashMap<>();
|
||||
|
||||
for (TdQuestion tdQuestion : tdQuestions) {
|
||||
String category = tdQuestion.getCategory();
|
||||
if (StrUtil.isBlank(category)){
|
||||
continue;
|
||||
}
|
||||
String[] split = category.split(",");
|
||||
for (String s : split) { //遍历字符串数组
|
||||
if (totalMap.containsKey(s)) { //判断Map集合中是否有该字符
|
||||
Integer value = totalMap.get(s); //通过key找出集合中的value
|
||||
totalMap.put(s, value + 1); //将值的数据加1,然后添加到集合中去
|
||||
} else {
|
||||
totalMap.put(s,1); //此时集合中没有该Key,所以将该字符作为键加入到集合中
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (String category : totalMap.keySet()) {
|
||||
QusetionCategoryVo categoryVo = new QusetionCategoryVo()
|
||||
.setCategory(category)
|
||||
.setCategoryName(categoryMap.getOrDefault(category,"其他类型"))
|
||||
.setNum(totalMap.get(category));
|
||||
resultList.add(categoryVo);
|
||||
}
|
||||
return resultList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateQuestion(QusetionVo qusetionVo) {
|
||||
return this.getBaseMapper().updateQuestion(qusetionVo);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,10 +1,17 @@
|
|||
package com.jwl.driver.server.service.impl;
|
||||
|
||||
import com.jwl.driver.server.dto.SecurityUser;
|
||||
import com.jwl.driver.server.dto.TestSubmitDto;
|
||||
import com.jwl.driver.server.entity.TdQuestionTest;
|
||||
import com.jwl.driver.server.mapper.TdQuestionTestMapper;
|
||||
import com.jwl.driver.server.service.ITdQuestionTestService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.jwl.driver.server.util.SecurityUtil;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
|
@ -17,4 +24,15 @@ import org.springframework.stereotype.Service;
|
|||
@Service
|
||||
public class TdQuestionTestServiceImpl extends ServiceImpl<TdQuestionTestMapper, TdQuestionTest> implements ITdQuestionTestService {
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean testSubmit(TestSubmitDto submitDto) {
|
||||
|
||||
TdQuestionTest questionTest = new TdQuestionTest();
|
||||
BeanUtils.copyProperties(submitDto,questionTest);
|
||||
questionTest.setUserId(SecurityUtil.getUserId())
|
||||
.setCreateTime(LocalDateTime.now());
|
||||
|
||||
return this.save(questionTest);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,11 +1,20 @@
|
|||
package com.jwl.driver.server.service.impl;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.jwl.driver.server.constant.Constants;
|
||||
import com.jwl.driver.server.entity.TdSysConfigList;
|
||||
import com.jwl.driver.server.mapper.TdSysConfigListMapper;
|
||||
import com.jwl.driver.server.service.ITdSysConfigListService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Comparator;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 系统配置列表; 服务实现类
|
||||
|
@ -17,4 +26,33 @@ import org.springframework.stereotype.Service;
|
|||
@Service
|
||||
public class TdSysConfigListServiceImpl extends ServiceImpl<TdSysConfigListMapper, TdSysConfigList> implements ITdSysConfigListService {
|
||||
|
||||
@Override
|
||||
public List<TdSysConfigList> querySysConfigList(String configKey, Integer carTypeId) {
|
||||
LambdaQueryWrapper<TdSysConfigList> queryWrapper = new LambdaQueryWrapper<TdSysConfigList>()
|
||||
.eq(TdSysConfigList::getCarTypeId, carTypeId)
|
||||
.eq(TdSysConfigList::getConfigKey, configKey)
|
||||
.eq(TdSysConfigList::getIsActive, Constants.IS_ACTIVE_TRUE)
|
||||
.orderByAsc(TdSysConfigList::getShowOrder);
|
||||
|
||||
return this.getBaseMapper().selectList(queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Map<String, String>> querySysConfigMap(List<String> configKeyList, Integer carTypeId) {
|
||||
|
||||
Map<String, Map<String, String>> resultMap = new HashMap<>();
|
||||
LambdaQueryWrapper<TdSysConfigList> queryWrapper = new LambdaQueryWrapper<TdSysConfigList>()
|
||||
.eq(TdSysConfigList::getCarTypeId, carTypeId)
|
||||
.in(TdSysConfigList::getConfigKey, configKeyList)
|
||||
.eq(TdSysConfigList::getIsActive, Constants.IS_ACTIVE_TRUE);
|
||||
|
||||
List<TdSysConfigList> configLists = this.getBaseMapper().selectList(queryWrapper);
|
||||
for (String configKey : configKeyList) {
|
||||
Map<String, String> collect = configLists.stream().filter(s -> StrUtil.equals(s.getConfigKey(), configKey))
|
||||
.sorted(Comparator.comparing(TdSysConfigList::getShowOrder))
|
||||
.collect(Collectors.toMap(TdSysConfigList::getConfigItemCode, TdSysConfigList::getConfigItemName));
|
||||
resultMap.put(configKey, collect);
|
||||
}
|
||||
return resultMap;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,11 +1,23 @@
|
|||
package com.jwl.driver.server.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.jwl.driver.server.constant.Constants;
|
||||
import com.jwl.driver.server.entity.TdSysConfig;
|
||||
import com.jwl.driver.server.mapper.TdSysConfigMapper;
|
||||
import com.jwl.driver.server.service.ITdSysConfigService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 系统配置表; 服务实现类
|
||||
|
@ -15,6 +27,45 @@ import org.springframework.stereotype.Service;
|
|||
* @since 2023-08-10
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class TdSysConfigServiceImpl extends ServiceImpl<TdSysConfigMapper, TdSysConfig> implements ITdSysConfigService {
|
||||
|
||||
@Override
|
||||
public TdSysConfig queryConfigByKey(String configKey, Integer carTypeId) {
|
||||
log.info("获取系统配置参数,configKey:{}", configKey);
|
||||
LambdaQueryWrapper<TdSysConfig> queryWrapper = new QueryWrapper<TdSysConfig>().lambda()
|
||||
.eq(TdSysConfig::getCarTypeId,carTypeId)
|
||||
.eq(TdSysConfig::getConfigKey, configKey)
|
||||
.eq(TdSysConfig::getIsActive, Constants.IS_ACTIVE_TRUE);
|
||||
return getOne(queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String queryConfigValueByKey(String configKey, Integer carTypeId) {
|
||||
log.info("获取系统配置参数,configKey:{}", configKey);
|
||||
LambdaQueryWrapper<TdSysConfig> queryWrapper = new QueryWrapper<TdSysConfig>().lambda()
|
||||
.eq(TdSysConfig::getCarTypeId,carTypeId)
|
||||
.eq(TdSysConfig::getConfigKey, configKey)
|
||||
.eq(TdSysConfig::getIsActive, Constants.IS_ACTIVE_TRUE);
|
||||
TdSysConfig config = getOne(queryWrapper);
|
||||
if(null == config) {
|
||||
return null;
|
||||
}
|
||||
return config.getConfigValue();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, TdSysConfig> queryConfigByKeys(List<String> configKeyList,Integer carTypeId) {
|
||||
log.info("获取系统配置参数,configKeyList:{}", configKeyList);
|
||||
LambdaQueryWrapper<TdSysConfig> queryWrapper = new QueryWrapper<TdSysConfig>().lambda()
|
||||
.eq(TdSysConfig::getCarTypeId,carTypeId)
|
||||
.in(TdSysConfig::getConfigKey, configKeyList)
|
||||
.eq(TdSysConfig::getIsActive, Constants.IS_ACTIVE_TRUE);
|
||||
List<TdSysConfig> configList = list(queryWrapper);
|
||||
|
||||
if(CollectionUtil.isEmpty(configList)) {
|
||||
return Collections.EMPTY_MAP;
|
||||
}
|
||||
return configList.stream().collect(Collectors.toMap(TdSysConfig::getConfigKey, sysConfig -> sysConfig));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
package com.jwl.driver.server.service.impl;
|
||||
|
||||
import cn.hutool.core.util.PhoneUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.jwl.driver.server.constant.Constants;
|
||||
import com.jwl.driver.server.dto.LoginUserDto;
|
||||
import com.jwl.driver.server.entity.TdSysUser;
|
||||
import com.jwl.driver.server.exception.BusinessException;
|
||||
|
@ -9,15 +11,18 @@ import com.jwl.driver.server.mapper.TdSysUserMapper;
|
|||
import com.jwl.driver.server.redis.RedisCache;
|
||||
import com.jwl.driver.server.service.ITdSysUserService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.jwl.driver.server.util.SmsUtil;
|
||||
import com.jwl.driver.server.util.TokenThreadUtil;
|
||||
import com.jwl.driver.server.vo.LoginUserVo;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
|
@ -33,42 +38,76 @@ public class TdSysUserServiceImpl extends ServiceImpl<TdSysUserMapper, TdSysUser
|
|||
@Autowired
|
||||
private RedisCache redisCache;
|
||||
|
||||
@Value("${token.expireTime}")
|
||||
private Integer tokenExpireTime;
|
||||
|
||||
@Value("${message.code.expireTime}")
|
||||
private Integer codeExpireTime;
|
||||
|
||||
@Override
|
||||
public String code(String phone) {
|
||||
|
||||
if (!PhoneUtil.isPhone(phone)) {
|
||||
throw new BusinessException("手机号格式不正确");
|
||||
}
|
||||
|
||||
if (redisCache.hasKey(Constants.MESSAGE_CODE_PREFIX + phone)){
|
||||
Long expire = redisCache.getExpire(Constants.MESSAGE_CODE_PREFIX + phone);
|
||||
throw new BusinessException("请在" + expire + "秒后重新获取验证码");
|
||||
}
|
||||
|
||||
String code = SmsUtil.sendMessage(phone);
|
||||
redisCache.setCacheObject((Constants.MESSAGE_CODE_PREFIX + phone), code, codeExpireTime, TimeUnit.SECONDS);
|
||||
return code;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public LoginUserVo login(LoginUserDto loginUserDto) {
|
||||
//todo 这里还需要校验验证码
|
||||
//校验验证码
|
||||
String code = redisCache.getCacheObject(Constants.MESSAGE_CODE_PREFIX + loginUserDto.getPhone());
|
||||
|
||||
if (StrUtil.isBlank(code)){
|
||||
throw new BusinessException("验证码已过期,请重新获取");
|
||||
}
|
||||
|
||||
if (!StrUtil.equals(code,loginUserDto.getCode())){
|
||||
throw new BusinessException("验证码错误");
|
||||
}
|
||||
|
||||
LambdaQueryWrapper<TdSysUser> cond = new LambdaQueryWrapper<TdSysUser>()
|
||||
.eq(TdSysUser::getPhone,"18255439337");
|
||||
.eq(TdSysUser::getPhone, "18255439337");
|
||||
//用户不存在则直接注册登陆
|
||||
TdSysUser tdSysUser = this.baseMapper.selectOne(cond);
|
||||
if (tdSysUser == null){
|
||||
//todo 用户基础信息填写这里还要完善一下
|
||||
if (tdSysUser == null) {
|
||||
tdSysUser = new TdSysUser()
|
||||
.setUserName("车友")
|
||||
.setAvatar("")
|
||||
.setPhone(loginUserDto.getPhone())
|
||||
.setCreateTime(LocalDateTime.now());
|
||||
int insert = this.getBaseMapper().insert(tdSysUser);
|
||||
if (insert != 1){
|
||||
if (insert != 1) {
|
||||
throw new BusinessException("用户注册异常");
|
||||
}
|
||||
}
|
||||
|
||||
String token = UUID.randomUUID().toString();
|
||||
redisCache.setCacheObject(token,"123456",365*24*60*60);
|
||||
LoginUserVo loginUserVo = new LoginUserVo();
|
||||
BeanUtils.copyProperties(tdSysUser,loginUserVo);
|
||||
BeanUtils.copyProperties(tdSysUser, loginUserVo);
|
||||
loginUserVo.setToken(token);
|
||||
|
||||
// 存入redis
|
||||
redisCache.setCacheObject(token, tdSysUser, tokenExpireTime, TimeUnit.DAYS);
|
||||
return loginUserVo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean loginOut() {
|
||||
String token = TokenThreadUtil.getToken();
|
||||
if (StrUtil.isNotBlank(token)){
|
||||
if (StrUtil.isNotBlank(token)) {
|
||||
redisCache.deleteObject(token);
|
||||
}
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -35,10 +35,10 @@ public class SecurityUtil {
|
|||
String token = TokenThreadUtil.getToken();
|
||||
if (StrUtil.isBlank(token))
|
||||
throw new BusinessException(ErrorCode.AUTH_ERROR, "尚未登录");
|
||||
SecurityUser securityUser = null;
|
||||
SecurityUser securityUser = new SecurityUser();
|
||||
TdSysUser tdSysUser = redisCache.getCacheObject(token);
|
||||
|
||||
if (Objects.isNull(securityUser)){
|
||||
if (Objects.isNull(tdSysUser)){
|
||||
throw new BusinessException(ErrorCode.AUTH_ERROR, "登录信息已失效");
|
||||
}
|
||||
BeanUtils.copyProperties(tdSysUser,securityUser);
|
||||
|
|
|
@ -8,6 +8,8 @@ import com.aliyuncs.dysmsapi.model.v20170525.SendSmsResponse;
|
|||
import com.aliyuncs.exceptions.ClientException;
|
||||
import com.aliyuncs.profile.DefaultProfile;
|
||||
import com.aliyuncs.profile.IClientProfile;
|
||||
import com.jwl.driver.server.constant.Constants;
|
||||
import com.jwl.driver.server.exception.BusinessException;
|
||||
import lombok.Data;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
@ -36,7 +38,22 @@ public class SmsUtil {
|
|||
private static String smsFreeSignName = "对嘛科技";
|
||||
|
||||
//用于存储短信验证码
|
||||
private static Map<String, String> codeMap = new HashMap<>();
|
||||
// private static Map<String, String> codeMap = new HashMap<>();
|
||||
|
||||
/**
|
||||
* 发送验证码
|
||||
* @param sendPhone
|
||||
* @return
|
||||
*/
|
||||
public static String sendMessage(String sendPhone) {
|
||||
String code = getMessageCode(sendPhone);
|
||||
Map<String, Object> param = new HashMap<>();
|
||||
param.put("code", code);
|
||||
//发送短信
|
||||
currencySendMessage(sendPhone, Constants.MESSAGE_TEMPLATE, JSONObject.toJSONString(param));
|
||||
return code;
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成短信验证码并存储
|
||||
*/
|
||||
|
@ -44,17 +61,21 @@ public class SmsUtil {
|
|||
String code = (int)(Math.random()*999999)+ "";
|
||||
if (code.length() == 5){
|
||||
code = "0" + code;
|
||||
} else if(code.length() == 4){
|
||||
code = "00" + code;
|
||||
} else if(code.length() == 3){
|
||||
code = "000" + 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);
|
||||
// }
|
||||
|
||||
/**
|
||||
* 通用的发送短信的方法
|
||||
|
@ -87,12 +108,14 @@ public class SmsUtil {
|
|||
} catch (ClientException e) {
|
||||
logger.error("发送短信失败:"+e.getErrMsg()+"\n"+e.getMessage());
|
||||
e.printStackTrace();
|
||||
throw new BusinessException("获取验证码失败");
|
||||
}
|
||||
if (sendSmsResponse!=null){
|
||||
logger.info("message:"+sendSmsResponse.getMessage()+"\n"+
|
||||
"code:"+sendSmsResponse.getCode()+"\n");
|
||||
}else{
|
||||
logger.info("发送短信响应为null");
|
||||
throw new BusinessException("获取验证码失败");
|
||||
}
|
||||
|
||||
return JSONObject.toJSONString(sendSmsResponse);
|
||||
|
@ -117,8 +140,8 @@ public class SmsUtil {
|
|||
|
||||
public static void main(String[] args) throws IOException {
|
||||
Map<String, Object> param = new HashMap<>();
|
||||
param.put("code", getMessageCode("18855146869"));
|
||||
SmsUtil.currencySendMessage("18855146869", "SMS_198880447", JSONObject.toJSONString(param) );
|
||||
param.put("code", getMessageCode("18255439337"));
|
||||
SmsUtil.currencySendMessage("18255439337", "SMS_198880447", JSONObject.toJSONString(param) );
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
package com.jwl.driver.server.util;
|
||||
|
||||
/**
|
||||
* 微信支付工具
|
||||
*/
|
||||
public class WechatPayUtil {
|
||||
}
|
|
@ -0,0 +1,100 @@
|
|||
package com.jwl.driver.server.vo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* @author 曹林
|
||||
* @description 会员列表出参
|
||||
* @create 2023/8/13 17:13
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
@ApiModel("会员列表出参")
|
||||
public class MemberVo {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 用户标识
|
||||
*/
|
||||
@ApiModelProperty("用户标识")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 会员结束时间
|
||||
*/
|
||||
@ApiModelProperty("会员结束时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime endDate;
|
||||
|
||||
/**
|
||||
* 会员标识
|
||||
*/
|
||||
@ApiModelProperty("会员标识")
|
||||
private Integer memberId;
|
||||
|
||||
/**
|
||||
* 会员名称
|
||||
*/
|
||||
@ApiModelProperty("会员名称")
|
||||
private String memberName;
|
||||
|
||||
/**
|
||||
* 车型标识
|
||||
*/
|
||||
@ApiModelProperty("车型标识")
|
||||
private Integer carTypeId;
|
||||
|
||||
/**
|
||||
* 科目
|
||||
*/
|
||||
@ApiModelProperty("科目")
|
||||
private String subjects;
|
||||
|
||||
/**
|
||||
* 会员价格,单位元
|
||||
*/
|
||||
@ApiModelProperty("会员价格,单位元")
|
||||
private BigDecimal price;
|
||||
|
||||
/**
|
||||
* 会员折扣,单位元
|
||||
*/
|
||||
@ApiModelProperty("会员折扣,单位元")
|
||||
private BigDecimal discount;
|
||||
|
||||
/**
|
||||
* 会员时间
|
||||
*/
|
||||
@ApiModelProperty("会员时间")
|
||||
private Integer duration;
|
||||
|
||||
/**
|
||||
* 时长单位,1:天,2:月 3:年
|
||||
*/
|
||||
@ApiModelProperty("时长单位,1:天,2:月 3:年")
|
||||
private String unit;
|
||||
|
||||
/**
|
||||
* 会员描述
|
||||
*/
|
||||
@ApiModelProperty("会员描述")
|
||||
private String desc;
|
||||
|
||||
/**
|
||||
* 是否生效
|
||||
*/
|
||||
@ApiModelProperty("是否生效")
|
||||
private String isActive;
|
||||
|
||||
}
|
|
@ -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;
|
||||
|
||||
}
|
|
@ -0,0 +1,174 @@
|
|||
package com.jwl.driver.server.vo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
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 QusetionVo {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 题目标识
|
||||
*/
|
||||
@ApiModelProperty("题目标识")
|
||||
private Long questionId;
|
||||
|
||||
/**
|
||||
* 题目内容
|
||||
*/
|
||||
@ApiModelProperty("题目内容")
|
||||
private String question;
|
||||
|
||||
/**
|
||||
* 选项A
|
||||
*/
|
||||
@ApiModelProperty("选项A")
|
||||
private String chooseA;
|
||||
|
||||
/**
|
||||
* 选项B
|
||||
*/
|
||||
@ApiModelProperty("选项B")
|
||||
private String chooseB;
|
||||
|
||||
/**
|
||||
* 选项C
|
||||
*/
|
||||
@ApiModelProperty("选项C")
|
||||
private String chooseC;
|
||||
|
||||
/**
|
||||
* 选项D
|
||||
*/
|
||||
@ApiModelProperty("选项D")
|
||||
private String chooseD;
|
||||
|
||||
/**
|
||||
* 选项E
|
||||
*/
|
||||
@ApiModelProperty("选项E")
|
||||
private String chooseE;
|
||||
|
||||
/**
|
||||
* 选项F
|
||||
*/
|
||||
@ApiModelProperty("选项F")
|
||||
private String chooseF;
|
||||
|
||||
/**
|
||||
* 选项G
|
||||
*/
|
||||
@ApiModelProperty("选项G")
|
||||
private String chooseG;
|
||||
|
||||
/**
|
||||
* 正确答案
|
||||
*/
|
||||
@ApiModelProperty("正确答案")
|
||||
private String trueAnswer;
|
||||
|
||||
/**
|
||||
* 未知
|
||||
*/
|
||||
@ApiModelProperty("未知")
|
||||
private String cids;
|
||||
|
||||
/**
|
||||
* 题型分类
|
||||
*/
|
||||
@ApiModelProperty("题型分类")
|
||||
private String category;
|
||||
|
||||
/**
|
||||
* 题目图片url
|
||||
*/
|
||||
@ApiModelProperty("题目图片url")
|
||||
private String imageUrl;
|
||||
|
||||
/**
|
||||
* 未知
|
||||
*/
|
||||
@ApiModelProperty("未知")
|
||||
private String sohuImg;
|
||||
|
||||
/**
|
||||
* 最佳回答
|
||||
*/
|
||||
@ApiModelProperty("最佳回答")
|
||||
private String bestAnswer;
|
||||
|
||||
/**
|
||||
* 章节标识
|
||||
*/
|
||||
@ApiModelProperty("章节标识")
|
||||
private String chapter;
|
||||
|
||||
/**
|
||||
* 所属科目,1:科目1,2:科目4
|
||||
*/
|
||||
@ApiModelProperty("所属科目,1:科目1,2:科目4")
|
||||
private String subject;
|
||||
|
||||
/**
|
||||
* 选择
|
||||
*/
|
||||
@ApiModelProperty("选择")
|
||||
private String options;
|
||||
|
||||
/**
|
||||
* 题目类型,1:选择题 2:判断题,3:多选题
|
||||
*/
|
||||
@ApiModelProperty("题目类型,1:选择题 2:判断题,3:多选题")
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 显示序号
|
||||
*/
|
||||
@ApiModelProperty("显示序号")
|
||||
private int showOrder;
|
||||
|
||||
/**
|
||||
* 车型
|
||||
*/
|
||||
@ApiModelProperty("车型")
|
||||
private Integer carTypeId;
|
||||
|
||||
/**
|
||||
* 是否生效
|
||||
*/
|
||||
@ApiModelProperty("是否生效")
|
||||
private String isActive;
|
||||
|
||||
/**
|
||||
* 是否vip题型
|
||||
*/
|
||||
@ApiModelProperty("是否VIP")
|
||||
private Integer isVip;
|
||||
/**
|
||||
* 是否易错
|
||||
*/
|
||||
@ApiModelProperty("是否易错")
|
||||
private Integer isError;
|
||||
/**
|
||||
* 是否v新规
|
||||
*/
|
||||
@ApiModelProperty("是否新规")
|
||||
private Integer isNew;
|
||||
/**
|
||||
* 考点
|
||||
*/
|
||||
@ApiModelProperty("考点")
|
||||
private String examKeys;
|
||||
}
|
|
@ -10,7 +10,7 @@ spring:
|
|||
|
||||
# 数据库 配置
|
||||
datasource:
|
||||
url: jdbc:mysql://127.0.0.1:3306/driver_server?characterEncoding=utf-8&autoReconnect=true&maxReconnects=2&useSSL=false&failOverReadOnly=false&serverTimezone=Asia/Shanghai
|
||||
url: jdbc:mysql://127.0.0.1:3306/driver_server?characterEncoding=utf-8&autoReconnect=true&maxReconnects=2&useSSL=false&allowPublicKeyRetrieval=true&failOverReadOnly=false&serverTimezone=Asia/Shanghai
|
||||
username: root
|
||||
password: 123456
|
||||
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
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:
|
||||
url: jdbc:mysql://118.31.23.45:3306/driver_server?characterEncoding=utf-8&autoReconnect=true&maxReconnects=2&useSSL=false&failOverReadOnly=false&serverTimezone=Asia/Shanghai
|
||||
url: jdbc:mysql://118.31.23.45:3306/driver_server?characterEncoding=utf-8&autoReconnect=true&maxReconnects=2&useSSL=false&allowPublicKeyRetrieval=true&failOverReadOnly=false&serverTimezone=Asia/Shanghai
|
||||
username: root
|
||||
password: admin231280
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
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:
|
||||
url: jdbc:mysql://118.31.23.45:3306/driver_server?characterEncoding=utf-8&autoReconnect=true&maxReconnects=2&useSSL=false&failOverReadOnly=false&serverTimezone=Asia/Shanghai
|
||||
url: jdbc:mysql://118.31.23.45:3306/driver_server?characterEncoding=utf-8&autoReconnect=true&maxReconnects=2&useSSL=false&allowPublicKeyRetrieval=true&failOverReadOnly=false&serverTimezone=Asia/Shanghai
|
||||
username: root
|
||||
password: admin231280
|
||||
|
|
|
@ -7,7 +7,7 @@ spring:
|
|||
application:
|
||||
name: '@artifactId@'
|
||||
profiles:
|
||||
active: dev
|
||||
active: test
|
||||
#mybatis
|
||||
mybatis-plus:
|
||||
mapper-locations: classpath*:/mapper/**Mapper.xml
|
||||
|
@ -41,6 +41,28 @@ driver:
|
|||
- /driver-api/v2/api-docs
|
||||
- /driver-api/swagger-resources
|
||||
- /driver-api/favicon.ico
|
||||
- /driver-api/tdSysUser/code
|
||||
- /tdQuestion/duima/list
|
||||
- /tdQuestion/duima/update
|
||||
|
||||
# 需要权限校验url集合
|
||||
needAuthEndPoints:
|
||||
|
||||
# token 有效期1年
|
||||
token:
|
||||
expireTime: 365
|
||||
|
||||
# 短信验证码失效时间5分钟
|
||||
message:
|
||||
code:
|
||||
expireTime: 300
|
||||
|
||||
|
||||
|
||||
wechatpay:
|
||||
appId: 'wx756a7425037609fb'
|
||||
mchId: '1650477646'
|
||||
apiV3Key: 'JingWuLianJiaKao20120813ZhouHong'
|
||||
mchSerialNo: '52974C99DFCC518EA2E5AD20C3753E38B924868D'
|
||||
privateKeyPath: 'classpath*:/wechatPay/**Mapper.xml'
|
||||
|
||||
|
|
|
@ -2,4 +2,63 @@
|
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.jwl.driver.server.mapper.TdMemberMapper">
|
||||
|
||||
<select id="queryMember" resultType="com.jwl.driver.server.vo.MemberVo">
|
||||
select
|
||||
tm.MEMBER_ID,
|
||||
tm.MEMBER_NAME,
|
||||
tm.CAR_TYPE_ID,
|
||||
tm.PRICE,
|
||||
tm.DISCOUNT,
|
||||
tm.DURATION,
|
||||
tm.SUBJECTS,
|
||||
tm.UNIT,
|
||||
tm.DESC,
|
||||
tm.IS_ACTIVE
|
||||
from
|
||||
td_member tm
|
||||
<where>
|
||||
tm.IS_ACTIVE = '0'
|
||||
<if test="queryDto.memberId !=null">
|
||||
and tm.MEMBER_ID = #{queryDto.memberId}
|
||||
</if>
|
||||
<if test="queryDto.carTypeId !=null">
|
||||
and tm.CAR_TYPE_ID = #{queryDto.carTypeId}
|
||||
</if>
|
||||
<if test="queryDto.subject !=null and queryDto.subject !=''">
|
||||
and find_in_set(#{queryDto.subject},tm.SUBJECTS)
|
||||
</if>
|
||||
</where>
|
||||
order by tm.SHOW_ORDER
|
||||
</select>
|
||||
<select id="queryUserMember" resultType="com.jwl.driver.server.vo.MemberVo">
|
||||
select
|
||||
tsum.USER_ID,
|
||||
tsum.END_DATE,
|
||||
tm.MEMBER_ID,
|
||||
tm.MEMBER_NAME,
|
||||
tm.CAR_TYPE_ID,
|
||||
tm.PRICE,
|
||||
tm.DISCOUNT,
|
||||
tm.DURATION,
|
||||
tm.SUBJECTS,
|
||||
tm.UNIT,
|
||||
tm.DESC,
|
||||
tm.IS_ACTIVE
|
||||
from
|
||||
td_sys_user_member tsum
|
||||
left join td_member tm on tsum.MEMBER_ID = tm.MEMBER_ID
|
||||
<where>
|
||||
tsum.USER_ID = #{userId} and sysdate() between tsum.START_DATE and tsum.END_DATE
|
||||
<if test="queryDto.memberId !=null">
|
||||
and tsum.MEMBER_ID = #{queryDto.memberId}
|
||||
</if>
|
||||
<if test="queryDto.carTypeId !=null">
|
||||
and tm.CAR_TYPE_ID = #{queryDto.carTypeId}
|
||||
</if>
|
||||
<if test="queryDto.subject !=null and queryDto.subject !=''">
|
||||
and find_in_set(#{queryDto.subject},tm.SUBJECTS)
|
||||
</if>
|
||||
</where>
|
||||
order by tm.SHOW_ORDER
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
@ -2,4 +2,139 @@
|
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.jwl.driver.server.mapper.TdQuestionMapper">
|
||||
|
||||
<select id="queryQuestion" resultType="com.jwl.driver.server.vo.QusetionVo">
|
||||
select
|
||||
tq.QUESTION_ID,
|
||||
tq.QUESTION,
|
||||
tq.CHOOSE_A,
|
||||
tq.CHOOSE_B,
|
||||
tq.CHOOSE_C,
|
||||
tq.CHOOSE_D,
|
||||
tq.CHOOSE_E,
|
||||
tq.CHOOSE_F,
|
||||
tq.CHOOSE_G,
|
||||
tq.TRUE_ANSWER,
|
||||
tq.CIDS,
|
||||
tq.CATEGORY,
|
||||
tq.IMAGE_URL,
|
||||
tq.SOHU_IMG,
|
||||
tq.BEST_ANSWER,
|
||||
tq.CHAPTER,
|
||||
tq.SUBJECT,
|
||||
tq.OPTIONS,
|
||||
tq.TYPE,
|
||||
tq.SHOW_ORDER,
|
||||
tq.CAR_TYPE_ID,
|
||||
tq.IS_ACTIVE,
|
||||
tq.IS_VIP,
|
||||
tq.IS_ERROR,
|
||||
tq.IS_NEW,
|
||||
tq.EXAM_KEYS
|
||||
from td_question tq
|
||||
left join td_point_question tpq on tq.QUESTION_ID = tpq.QUESTION_ID and tq.CAR_TYPE_ID = tpq.CAR_TYPE_ID and
|
||||
tpq.IS_ACTIVE = '0'
|
||||
<where>
|
||||
tq.IS_ACTIVE = '0'
|
||||
<if test="queryDto.questionId !=null">
|
||||
and tq.QUESTION_ID = #{queryDto.questionId}
|
||||
</if>
|
||||
<if test="queryDto.questionIdList !=null and queryDto.questionIdList.size() > 0">
|
||||
and tq.QUESTION_ID in
|
||||
<foreach collection="queryDto.questionIdList" open="(" item="item" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="queryDto.chapter !=null and queryDto.chapter !=''">
|
||||
and tq.CHAPTER = #{queryDto.chapter}
|
||||
</if>
|
||||
<if test="queryDto.question !=null and queryDto.question !=''">
|
||||
and tq.QUESTION like concat('%' , #{queryDto.question} , '%')
|
||||
</if>
|
||||
<if test="queryDto.subject !=null and queryDto.subject !=''">
|
||||
and tq.SUBJECT = #{queryDto.subject}
|
||||
</if>
|
||||
<if test="queryDto.carTypeId !=null">
|
||||
and tq.CAR_TYPE_ID = #{queryDto.carTypeId}
|
||||
</if>
|
||||
<if test="queryDto.type !=null and queryDto.type != ''">
|
||||
and tq.TYPE = #{queryDto.type}
|
||||
</if>
|
||||
<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>
|
||||
</where>
|
||||
group by tq.QUESTION_ID
|
||||
order by tq.SHOW_ORDER asc
|
||||
</select>
|
||||
|
||||
<select id="queryQuestionByRandom" resultType="com.jwl.driver.server.vo.QusetionVo">
|
||||
select
|
||||
tq.QUESTION_ID,
|
||||
tq.QUESTION,
|
||||
tq.CHOOSE_A,
|
||||
tq.CHOOSE_B,
|
||||
tq.CHOOSE_C,
|
||||
tq.CHOOSE_D,
|
||||
tq.CHOOSE_E,
|
||||
tq.CHOOSE_F,
|
||||
tq.CHOOSE_G,
|
||||
tq.TRUE_ANSWER,
|
||||
tq.CIDS,
|
||||
tq.CATEGORY,
|
||||
tq.IMAGE_URL,
|
||||
tq.SOHU_IMG,
|
||||
tq.BEST_ANSWER,
|
||||
tq.CHAPTER,
|
||||
tq.SUBJECT,
|
||||
tq.OPTIONS,
|
||||
tq.TYPE,
|
||||
tq.SHOW_ORDER,
|
||||
tq.CAR_TYPE_ID,
|
||||
tq.IS_ACTIVE,
|
||||
tq.IS_VIP,
|
||||
tq.IS_ERROR,
|
||||
tq.IS_NEW,
|
||||
tq.EXAM_KEYS
|
||||
from td_question tq
|
||||
<where>
|
||||
tq.IS_ACTIVE = '0'
|
||||
<if test="queryDto.subject !=null and queryDto.subject !=''">
|
||||
and tq.SUBJECT = #{queryDto.subject}
|
||||
</if>
|
||||
<if test="queryDto.carTypeId !=null">
|
||||
and tq.CAR_TYPE_ID = #{queryDto.carTypeId}
|
||||
</if>
|
||||
<if test="queryDto.type !=null">
|
||||
and tq.TYPE = #{queryDto.type}
|
||||
</if>
|
||||
</where>
|
||||
order by rand() limit ${queryDto.num};
|
||||
</select>
|
||||
|
||||
<update id="updateQuestion" parameterType="com.jwl.driver.server.vo.QusetionVo">
|
||||
update td_question
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="qusetionVo.isVip !=null">
|
||||
IS_VIP = #{qusetionVo.isVip},
|
||||
</if>
|
||||
<if test="qusetionVo.isError !=null">
|
||||
IS_ERROR = #{qusetionVo.isError},
|
||||
</if>
|
||||
<if test="qusetionVo.isNew !=null">
|
||||
IS_NEW = #{qusetionVo.isNew},
|
||||
</if>
|
||||
<if test="qusetionVo.examKeys !=null">
|
||||
EXAM_KEYS = #{qusetionVo.examKeys},
|
||||
</if>
|
||||
</trim>
|
||||
where QUESTION_ID = #{qusetionVo.questionId}
|
||||
</update>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
-----BEGIN CERTIFICATE-----
|
||||
MIIEMTCCAxmgAwIBAgIUUpdMmd/MUY6i5a0gw3U+OLkkho0wDQYJKoZIhvcNAQEL
|
||||
BQAwXjELMAkGA1UEBhMCQ04xEzARBgNVBAoTClRlbnBheS5jb20xHTAbBgNVBAsT
|
||||
FFRlbnBheS5jb20gQ0EgQ2VudGVyMRswGQYDVQQDExJUZW5wYXkuY29tIFJvb3Qg
|
||||
Q0EwHhcNMjMwODEzMTQzNDEyWhcNMjgwODExMTQzNDEyWjCBijETMBEGA1UEAwwK
|
||||
MTY1MDQ3NzY0NjEbMBkGA1UECgwS5b6u5L+h5ZWG5oi357O757ufMTYwNAYDVQQL
|
||||
DC3lronlvr3ph5HkupTogZTmlofljJbkvKDmkq3mnInpmZDotKPku7vlhazlj7gx
|
||||
CzAJBgNVBAYMAkNOMREwDwYDVQQHDAhTaGVuWmhlbjCCASIwDQYJKoZIhvcNAQEB
|
||||
BQADggEPADCCAQoCggEBAMwEjj4NiNqB0OsccgQG7bHJlBeG0oe/DBrC7//DH+qb
|
||||
1YtLhTiEiCkggAiEyUKdrrD1FsUzhvT3JwsYdH4irmNoRt6RI8f/3yywQ3jwIK5m
|
||||
gKtWhoCtKlrIM7b77hUaRmtYkA9dyRNVXdw1dBVAg+e+b1hjYVCMAoa/NDds0sXr
|
||||
E4F83ySf1lkTJcRhr9pxoPljNtSgHjk/pikN/ha0sMBWPypb7JQUuyYq64hIEEGF
|
||||
k8wxoMJpVZc96/AJQRXwkTsYfOmgeUSr8uGSFdTXKhMvQTyXoPD63p9cwDFGv+Ds
|
||||
HM+sPBzcKx3994/JuBUPIhokiRPvlffs5JySWFmU64ECAwEAAaOBuTCBtjAJBgNV
|
||||
HRMEAjAAMAsGA1UdDwQEAwID+DCBmwYDVR0fBIGTMIGQMIGNoIGKoIGHhoGEaHR0
|
||||
cDovL2V2Y2EuaXRydXMuY29tLmNuL3B1YmxpYy9pdHJ1c2NybD9DQT0xQkQ0MjIw
|
||||
RTUwREJDMDRCMDZBRDM5NzU0OTg0NkMwMUMzRThFQkQyJnNnPUhBQ0M0NzFCNjU0
|
||||
MjJFMTJCMjdBOUQzM0E4N0FEMUNERjU5MjZFMTQwMzcxMA0GCSqGSIb3DQEBCwUA
|
||||
A4IBAQA5L05YdcJs6035NDw/ynV5UsRMiexRvSOXV+UY7g2hJ/WaxLb3z6KalBZt
|
||||
ha42AGzj0QGpqssWzzZXF66UPxdz979ozQlUleR1NgPOEEibE3t0uK8jqaJHX+or
|
||||
64wA7A99nl1ZjTYSXnXDpO4CoEpFLj43WwNiEYITYx4W/AXyhuT/Xg4mAm/Oy/77
|
||||
FrG2KFopJ/xANtclbW25Anej2BnBthPSTF0ylz9IfY3eYO4kSV/o7JSjO3hbaxeD
|
||||
NIYhji7tjAz7wpXwZYhdPV1ws0ncvazUYS1zdnWAr+IhZcDbU/iXLIGw3zxslPtU
|
||||
miYEOvG5AD53Rr80o0iT41TSECWO
|
||||
-----END CERTIFICATE-----
|
|
@ -0,0 +1,28 @@
|
|||
-----BEGIN PRIVATE KEY-----
|
||||
MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDMBI4+DYjagdDr
|
||||
HHIEBu2xyZQXhtKHvwwawu//wx/qm9WLS4U4hIgpIIAIhMlCna6w9RbFM4b09ycL
|
||||
GHR+Iq5jaEbekSPH/98ssEN48CCuZoCrVoaArSpayDO2++4VGkZrWJAPXckTVV3c
|
||||
NXQVQIPnvm9YY2FQjAKGvzQ3bNLF6xOBfN8kn9ZZEyXEYa/acaD5YzbUoB45P6Yp
|
||||
Df4WtLDAVj8qW+yUFLsmKuuISBBBhZPMMaDCaVWXPevwCUEV8JE7GHzpoHlEq/Lh
|
||||
khXU1yoTL0E8l6Dw+t6fXMAxRr/g7BzPrDwc3Csd/fePybgVDyIaJIkT75X37OSc
|
||||
klhZlOuBAgMBAAECggEAOc1wn5QmGgJ9tp8wjoOIBL8f/ipsq5ktTMe+R7B48neE
|
||||
YRrce87Q5RYYMFGu0/jo7aoC8YxPyEfd//7FwpcA4ZlBuv1ULe4IxRiLhVBDciYI
|
||||
foLdSMfHIEFopYdrRP9UxEUrS68+sQOWvDVI1lyZAqep1FkT0UZZ0OOLX8itTvVx
|
||||
6EN67EjpVfg60sQ3IxDc1qmhh/+qKC1XBmnCn73wB/OZ6EtVjmgQEVJFspK9bK7j
|
||||
J9zHBPTaeyNwC9eKKUeoxiESd5r2sugu8yZ8kvqwhJECa4AgHOZfskxG4YhmhROk
|
||||
l7aI0Vw/fXngj7hXyMXXHuk7FgkdMpNcVwz2RBR4AQKBgQDmaxiV52tjMp+vqNAi
|
||||
XjsE/jLAQuOI1Sz9gUoHipT4qdHnPgvtygMjSrVBCb28CE/tyNp3t/DVDuRmg+HE
|
||||
GGXhfJPA2L6uOelsH7QKyQlWSqcv8BykDPEumwhubjv/bjJw4/HkZOP3LiLSGuzu
|
||||
K+1dlcww3Fa2bEL62pN6TltdsQKBgQDiqxvG3vVIQo4kckaGNyrPDi55oph8k4H1
|
||||
s450YDfEXCy95PXpeltK9gJO/bUDmqcliLDY8PBK7aGcmEdkRcLo6KBpOS0KDRdu
|
||||
ATadnGn1w+DCtHSmrecZ5J6If+F/9YIPCCQ4gYXsVIniX6xDxhcR/Y6VVP0WwO37
|
||||
QwaDzmnO0QKBgAbl6eSC+xoLJ/CwUxrUS1wI6CgNWJZ+G0yzlC3JnlAbdWdA2kaS
|
||||
J6nk0KxTyFRaw1nRC4lN/m3CdmADTrz6JgKsIhhB5ON+ZFiSUmeIQTlOHtc2jwTy
|
||||
Rj4o8gWsUyuAdw4eJN27j3+U6AH2QGWY9xA4LdbAoe/wKcksxgGBWwbhAoGBAJSJ
|
||||
susxAqX2z3U82dBsaIZFcdlN3wWMGJctsoW64/CuwrcySqBVCWxnKH4hLjUNbMlg
|
||||
+RtBUQaZENYwyGACg0bj4vLxf/1dNORmsSa58IoYcbrGTMdJoO9L7UPgIaMb/L3j
|
||||
BPFul5eWksEhFx9WuZmVgpGDn1MA3TNR6fwIEThxAoGBAIcHOfiJH3d3q33aODPA
|
||||
cqZb5RVNc1ZpiXC5yBwsiuTw3TYXuJmcUrRKuStsXXkIr2vyc3x9Af5+vWy7eJw/
|
||||
+N+p5zxW9F5QQdEZKt/ALjXEonxkRlebz+GvsWYEP9+Li8DwFM1wlc97kLLt4XJn
|
||||
EK4LLlyBAz3ZBGm18p7RgnMP
|
||||
-----END PRIVATE KEY-----
|
Loading…
Reference in New Issue