浏览代码

测试提交

小么熊🐻 4 年之前
父节点
当前提交
a07131de4f

+ 12 - 20
zzjs-admin/src/main/java/com/miaxis/app/controller/question/QuestionInfoController.java

@@ -1,38 +1,30 @@
 package com.miaxis.app.controller.question;
 
-import com.miaxis.common.constant.Constants;
-import java.util.List;
-import java.util.Arrays;
-import io.swagger.annotations.*;
-import com.miaxis.common.core.domain.Response;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-import org.springframework.web.bind.annotation.ModelAttribute;
 import com.miaxis.common.annotation.Log;
 import com.miaxis.common.core.controller.BaseController;
+import com.miaxis.common.core.domain.Response;
+import com.miaxis.common.core.page.ResponsePageInfo;
 import com.miaxis.common.enums.BusinessTypeEnum;
+import com.miaxis.common.utils.poi.ExcelUtil;
 import com.miaxis.question.domain.QuestionInfo;
 import com.miaxis.question.service.IQuestionInfoService;
-import com.miaxis.common.utils.poi.ExcelUtil;
-import com.miaxis.common.core.page.ResponsePageInfo;
+import io.swagger.annotations.*;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.Arrays;
+import java.util.List;
 
 /**
  * 【题库】Controller
  *
  * @author miaxis
- * @date 2021-03-11
+ * @date 2021-03-12
  */
 @RestController
 @RequestMapping("/question/info")
-@Api(tags={"【app-题库】"})
+@Api(tags={"【小程序-题库】"})
 public class QuestionInfoController extends BaseController{
     @Autowired
     private IQuestionInfoService questionInfoService;

+ 1 - 35
zzjs-admin/src/test/java/com/miaxis/test/NormalTest.java

@@ -1,57 +1,23 @@
 package com.miaxis.test;
 
 import com.miaxis.ZzjsApplication;
-import com.miaxis.question.domain.QuestionInfo;
-import com.miaxis.question.service.IQuestionInfoService;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.springframework.boot.test.context.SpringBootTest;
 import org.springframework.test.context.junit4.SpringRunner;
 
-import javax.annotation.Resource;
-import java.io.File;
-import java.util.List;
-
 @SpringBootTest(classes = ZzjsApplication.class)
 @RunWith(SpringRunner.class)
 public class NormalTest {
 
-    @Resource
-    private IQuestionInfoService questionService;
-
     @Test
     public void test1() throws Exception {
-        QuestionInfo questionInfo = new QuestionInfo();
-        questionInfo.setId(17650l);
-        List<QuestionInfo> list = questionService.selectQuestionInfoList(questionInfo);
-
-        for (QuestionInfo q: list) {
-            System.out.println("--------------------");
-            System.out.println(q.getExplain1());
-            //调用
-            byte2float(q.getExplain1());
-            String str = new String(q.getExplain1(), "GBK");
-            System.out.println(str);
-            String str2 = new String(q.getExplain1(), "UTF-8");
-            System.out.println(str2);
-            System.out.println("--------------------");
-        }
 
+    }
 
 
 
-    }
 
-    public float byte2float(byte[] b) {
-        if(b!=null) {
-            String str = new String(b);
-            System.out.println(str);
-           // Float f = Float.parseFloat(str);
-            return 0;
-        } else {
-            return 0;
-        }
-    }
 
 
 

+ 0 - 203
zzjs-service/src/main/java/com/miaxis/question/domain/QuestionInfo.java

@@ -1,203 +0,0 @@
-package com.miaxis.question.domain;
-
-import com.baomidou.mybatisplus.annotation.TableField;
-import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableName;
-import com.miaxis.common.annotation.Excel;
-import com.miaxis.common.core.domain.BaseBusinessEntity;
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import lombok.Data;
-/**
- * 题库对象 question_info
- *
- * @author miaxis
- * @date 2021-03-11
- */
-@Data
-@TableName("question_info")
-@ApiModel(value = "QuestionInfo", description = "题库对象 question_info")
-public class QuestionInfo extends BaseBusinessEntity{
-    private static final long serialVersionUID = 1L;
-
-    /** 1 */
-    @TableId(value = "id")
-    @ApiModelProperty(value = "1")
-    private Long id;
-
-    /** 1 */
-    @Excel(name = "1")
-    @TableField("question_id")
-    @ApiModelProperty(value = "1")
-    private Long questionId;
-
-    /** 2 */
-    @Excel(name = "2")
-    @TableField("media_type")
-    @ApiModelProperty(value = "2")
-    private Long mediaType;
-
-    /** 3 */
-    @Excel(name = "3")
-    @TableField("chapter_id")
-    @ApiModelProperty(value = "3")
-    private Long chapterId;
-
-    /** 4 */
-    @Excel(name = "4")
-    @TableField("label")
-    @ApiModelProperty(value = "4")
-    private String label;
-
-    /** 5 */
-    @Excel(name = "5")
-    @TableField("question")
-    @ApiModelProperty(value = "5")
-    private byte[] question;
-
-    /** 6 */
-    @Excel(name = "6")
-    @TableField("media_key")
-    @ApiModelProperty(value = "6")
-    private String mediaKey;
-
-    /** 7 */
-    @Excel(name = "7")
-    @TableField("answer")
-    @ApiModelProperty(value = "7")
-    private Long answer;
-
-    /** 8 */
-    @Excel(name = "8")
-    @TableField("option_a")
-    @ApiModelProperty(value = "8")
-    private String optionA;
-
-    /** 9 */
-    @Excel(name = "9")
-    @TableField("option_b")
-    @ApiModelProperty(value = "9")
-    private String optionB;
-
-    /** 10 */
-    @Excel(name = "10")
-    @TableField("option_c")
-    @ApiModelProperty(value = "10")
-    private String optionC;
-
-    /** 11 */
-    @Excel(name = "11")
-    @TableField("option_d")
-    @ApiModelProperty(value = "11")
-    private String optionD;
-
-    /** 12 */
-    @Excel(name = "12")
-    @TableField("option_e")
-    @ApiModelProperty(value = "12")
-    private String optionE;
-
-    /** 13 */
-    @Excel(name = "13")
-    @TableField("option_f")
-    @ApiModelProperty(value = "13")
-    private String optionF;
-
-    /** 13 */
-    @Excel(name = "13")
-    @TableField("option_g")
-    @ApiModelProperty(value = "13")
-    private String optionG;
-
-    /** 13 */
-    @Excel(name = "13")
-    @TableField("option_h")
-    @ApiModelProperty(value = "13")
-    private String optionH;
-
-    /** 1 */
-    @Excel(name = "1")
-    @TableField("explain1")
-    @ApiModelProperty(value = "1")
-    private byte[] explain1;
-
-    /** 1 */
-    @Excel(name = "1")
-    @TableField("concise_explain")
-    @ApiModelProperty(value = "1")
-    private byte[] conciseExplain;
-
-    /** 1 */
-    @Excel(name = "1")
-    @TableField("keywords")
-    @ApiModelProperty(value = "1")
-    private byte[] keywords;
-
-    /** 1 */
-    @Excel(name = "1")
-    @TableField("assured_keywords")
-    @ApiModelProperty(value = "1")
-    private byte[] assuredKeywords;
-
-    /** 1 */
-    @Excel(name = "1")
-    @TableField("illiteracy_explain")
-    @ApiModelProperty(value = "1")
-    private byte[] illiteracyExplain;
-
-    /** 1 */
-    @Excel(name = "1")
-    @TableField("illiteracy_keywords")
-    @ApiModelProperty(value = "1")
-    private byte[] illiteracyKeywords;
-
-    /** 1 */
-    @Excel(name = "1")
-    @TableField("difficulty")
-    @ApiModelProperty(value = "1")
-    private Long difficulty;
-
-    /** 1 */
-    @Excel(name = "1")
-    @TableField("wrong_rate")
-    @ApiModelProperty(value = "1")
-    private Long wrongRate;
-
-    /** 1 */
-    @Excel(name = "1")
-    @TableField("option_type")
-    @ApiModelProperty(value = "1")
-    private Long optionType;
-
-    /** 1 */
-    @Excel(name = "1")
-    @TableField("knack_keyword")
-    @ApiModelProperty(value = "1")
-    private byte[] knackKeyword;
-
-    /** 1 */
-    @Excel(name = "1")
-    @TableField("knack_img_url")
-    @ApiModelProperty(value = "1")
-    private byte[] knackImgUrl;
-
-    /** 1 */
-    @Excel(name = "1")
-    @TableField("knack_detail")
-    @ApiModelProperty(value = "1")
-    private byte[] knackDetail;
-
-    /** 1 */
-    @Excel(name = "1")
-    @TableField("knack_voice_txt")
-    @ApiModelProperty(value = "1")
-    private byte[] knackVoiceTxt;
-
-    /** 1 */
-    @Excel(name = "1")
-    @TableField("m")
-    @ApiModelProperty(value = "1")
-    private Long m;
-
-
-}

+ 0 - 22
zzjs-service/src/main/java/com/miaxis/question/mapper/QuestionInfoMapper.java

@@ -1,22 +0,0 @@
-package com.miaxis.question.mapper;
-
-import java.util.List;
-import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.miaxis.question.domain.QuestionInfo;
-
-/**
- * 题库Mapper接口
- *
- * @author miaxis
- * @date 2021-03-11
- */
-public interface QuestionInfoMapper extends BaseMapper<QuestionInfo> {
-    /**
-     * 查询题库列表
-     *
-     * @param questionInfo 题库
-     * @return 题库集合
-     */
-    public List<QuestionInfo> selectQuestionInfoList(QuestionInfo questionInfo);
-
-}

+ 0 - 21
zzjs-service/src/main/java/com/miaxis/question/service/IQuestionInfoService.java

@@ -1,21 +0,0 @@
-package com.miaxis.question.service;
-
-import java.util.List;
-import com.miaxis.question.domain.QuestionInfo;
-import com.baomidou.mybatisplus.extension.service.IService;
-
-/**
- * 题库Service接口
- *
- * @author miaxis
- * @date 2021-03-11
- */
-public interface IQuestionInfoService extends IService<QuestionInfo>{
-    /**
-     * 查询题库列表
-     *
-     * @param questionInfo 题库
-     * @return 题库集合
-     */
-    public List<QuestionInfo> selectQuestionInfoList(QuestionInfo questionInfo);
-}

+ 0 - 35
zzjs-service/src/main/java/com/miaxis/question/service/impl/QuestionInfoServiceImpl.java

@@ -1,35 +0,0 @@
-package com.miaxis.question.service.impl;
-
-import java.util.List;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import org.apache.commons.lang3.StringUtils;
-import com.miaxis.question.mapper.QuestionInfoMapper;
-import com.miaxis.question.domain.QuestionInfo;
-import com.miaxis.question.service.IQuestionInfoService;
-
-/**
- * 题库Service业务层处理
- *
- * @author miaxis
- * @date 2021-03-11
- */
-@Service
-public class QuestionInfoServiceImpl extends ServiceImpl<QuestionInfoMapper, QuestionInfo> implements IQuestionInfoService {
-    @Autowired
-    private QuestionInfoMapper questionInfoMapper;
-
-    /**
-     * 查询题库列表
-     *
-     * @param questionInfo 题库
-     * @return 题库
-     */
-    @Override
-    public List<QuestionInfo> selectQuestionInfoList(QuestionInfo questionInfo){
-        return questionInfoMapper.selectQuestionInfoList(questionInfo);
-    }
-}

+ 0 - 80
zzjs-service/src/main/resources/mapper/question/QuestionInfoMapper.xml

@@ -1,80 +0,0 @@
-<?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.miaxis.question.mapper.QuestionInfoMapper">
-
-    <resultMap type="QuestionInfo" id="QuestionInfoResult">
-        <result property="id"    column="id"    />
-        <result property="questionId"    column="question_id"    />
-        <result property="mediaType"    column="media_type"    />
-        <result property="chapterId"    column="chapter_id"    />
-        <result property="label"    column="label"    />
-        <result property="question"    column="question"    />
-        <result property="mediaKey"    column="media_key"    />
-        <result property="answer"    column="answer"    />
-        <result property="optionA"    column="option_a"    />
-        <result property="optionB"    column="option_b"    />
-        <result property="optionC"    column="option_c"    />
-        <result property="optionD"    column="option_d"    />
-        <result property="optionE"    column="option_e"    />
-        <result property="optionF"    column="option_f"    />
-        <result property="optionG"    column="option_g"    />
-        <result property="optionH"    column="option_h"    />
-        <result property="explain1"    column="explain1"    />
-        <result property="conciseExplain"    column="concise_explain"    />
-        <result property="keywords"    column="keywords"    />
-        <result property="assuredKeywords"    column="assured_keywords"    />
-        <result property="illiteracyExplain"    column="illiteracy_explain"    />
-        <result property="illiteracyKeywords"    column="illiteracy_keywords"    />
-        <result property="difficulty"    column="difficulty"    />
-        <result property="wrongRate"    column="wrong_rate"    />
-        <result property="optionType"    column="option_type"    />
-        <result property="knackKeyword"    column="knack_keyword"    />
-        <result property="knackImgUrl"    column="knack_img_url"    />
-        <result property="knackDetail"    column="knack_detail"    />
-        <result property="knackVoiceTxt"    column="knack_voice_txt"    />
-        <result property="m"    column="m"    />
-    </resultMap>
-
-    <sql id="selectQuestionInfoVo">
-        select id, question_id, media_type, chapter_id, label, question, media_key, answer, option_a, option_b, option_c, option_d, option_e, option_f, option_g, option_h, explain1, concise_explain, keywords, assured_keywords, illiteracy_explain, illiteracy_keywords, difficulty, wrong_rate, option_type, knack_keyword, knack_img_url, knack_detail, knack_voice_txt, m from question_info
-    </sql>
-
-    <select id="selectQuestionInfoList" parameterType="QuestionInfo" resultMap="QuestionInfoResult">
-        <include refid="selectQuestionInfoVo"/>
-        <where>
-            <if test="id != null "> and id = #{id}</if>
-            <if test="questionId != null "> and question_id = #{questionId}</if>
-            <if test="mediaType != null "> and media_type = #{mediaType}</if>
-            <if test="chapterId != null "> and chapter_id = #{chapterId}</if>
-            <if test="label != null  and label != ''"> and label = #{label}</if>
-            <if test="question != null "> and question = #{question}</if>
-            <if test="mediaKey != null  and mediaKey != ''"> and media_key = #{mediaKey}</if>
-            <if test="answer != null "> and answer = #{answer}</if>
-            <if test="optionA != null  and optionA != ''"> and option_a = #{optionA}</if>
-            <if test="optionB != null  and optionB != ''"> and option_b = #{optionB}</if>
-            <if test="optionC != null  and optionC != ''"> and option_c = #{optionC}</if>
-            <if test="optionD != null  and optionD != ''"> and option_d = #{optionD}</if>
-            <if test="optionE != null  and optionE != ''"> and option_e = #{optionE}</if>
-            <if test="optionF != null  and optionF != ''"> and option_f = #{optionF}</if>
-            <if test="optionG != null  and optionG != ''"> and option_g = #{optionG}</if>
-            <if test="optionH != null  and optionH != ''"> and option_h = #{optionH}</if>
-            <if test="explain1 != null "> and explain1 = #{explain1}</if>
-            <if test="conciseExplain != null "> and concise_explain = #{conciseExplain}</if>
-            <if test="keywords != null "> and keywords = #{keywords}</if>
-            <if test="assuredKeywords != null "> and assured_keywords = #{assuredKeywords}</if>
-            <if test="illiteracyExplain != null "> and illiteracy_explain = #{illiteracyExplain}</if>
-            <if test="illiteracyKeywords != null "> and illiteracy_keywords = #{illiteracyKeywords}</if>
-            <if test="difficulty != null "> and difficulty = #{difficulty}</if>
-            <if test="wrongRate != null "> and wrong_rate = #{wrongRate}</if>
-            <if test="optionType != null "> and option_type = #{optionType}</if>
-            <if test="knackKeyword != null "> and knack_keyword = #{knackKeyword}</if>
-            <if test="knackImgUrl != null "> and knack_img_url = #{knackImgUrl}</if>
-            <if test="knackDetail != null "> and knack_detail = #{knackDetail}</if>
-            <if test="knackVoiceTxt != null "> and knack_voice_txt = #{knackVoiceTxt}</if>
-            <if test="m != null "> and m = #{m}</if>
-        </where>
-    </select>
-
-</mapper>