1 files modified
18 files added
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.springblade.modules.subjectChoices.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.common.utils.SpringUtils; |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springblade.modules.subjectChoices.entity.SubjectChoicesEntity; |
| | | import org.springblade.modules.subjectChoices.service.ISubjectChoicesService; |
| | | import org.springblade.modules.subjectChoices.vo.SubjectChoicesVO; |
| | | import org.springblade.modules.subjectChoices.wrapper.SubjectChoicesWrapper; |
| | | import org.springblade.modules.subjectOption.entity.SubjectOptionEntity; |
| | | import org.springblade.modules.subjectOption.service.ISubjectOptionService; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.Valid; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 题目表 控制器 |
| | | * |
| | | * @author BladeX |
| | | * @since 2024-01-15 |
| | | */ |
| | | @RestController |
| | | @AllArgsConstructor |
| | | @RequestMapping("blade-subjectChoices/subjectChoices") |
| | | @Api(value = "题目表", tags = "题目表接口") |
| | | public class SubjectChoicesController extends BladeController { |
| | | |
| | | private final ISubjectChoicesService subjectChoicesService; |
| | | |
| | | /** |
| | | * 题目表 详情 |
| | | */ |
| | | @GetMapping("/detail") |
| | | @ApiOperationSupport(order = 1) |
| | | @ApiOperation(value = "详情", notes = "传入subjectChoices") |
| | | public R<SubjectChoicesVO> detail(SubjectChoicesEntity subjectChoices) { |
| | | SubjectChoicesEntity detail = subjectChoicesService.getOne(Condition.getQueryWrapper(subjectChoices)); |
| | | return R.data(SubjectChoicesWrapper.build().entityVO(detail)); |
| | | } |
| | | |
| | | /** |
| | | * 题目表 分页 |
| | | */ |
| | | @GetMapping("/list") |
| | | @ApiOperationSupport(order = 2) |
| | | @ApiOperation(value = "分页", notes = "传入subjectChoices") |
| | | public R<IPage<SubjectChoicesVO>> list(SubjectChoicesEntity subjectChoices, Query query) { |
| | | IPage<SubjectChoicesEntity> pages = subjectChoicesService.page(Condition.getPage(query), Condition.getQueryWrapper(subjectChoices)); |
| | | return R.data(SubjectChoicesWrapper.build().pageVO(pages)); |
| | | } |
| | | |
| | | /** |
| | | * 题目表 自定义分页 |
| | | */ |
| | | @GetMapping("/page") |
| | | @ApiOperationSupport(order = 3) |
| | | @ApiOperation(value = "分页", notes = "传入subjectChoices") |
| | | public R<IPage<SubjectChoicesVO>> page(SubjectChoicesVO subjectChoices, Query query) { |
| | | IPage<SubjectChoicesVO> pages = subjectChoicesService.selectSubjectChoicesPage(Condition.getPage(query), subjectChoices); |
| | | return R.data(pages); |
| | | } |
| | | |
| | | /** |
| | | * 题目表 新增 |
| | | */ |
| | | @PostMapping("/save") |
| | | @ApiOperationSupport(order = 4) |
| | | @ApiOperation(value = "新增", notes = "传入subjectChoices") |
| | | public R save(@Valid @RequestBody SubjectChoicesVO subjectChoices) { |
| | | boolean save = subjectChoicesService.save(subjectChoices); |
| | | if (save) { |
| | | List<SubjectOptionEntity> children = subjectChoices.getSubjectOptionList(); |
| | | for (SubjectOptionEntity child : children) { |
| | | child.setSubjectChoicesId(subjectChoices.getId()); |
| | | } |
| | | ISubjectOptionService bean = SpringUtils.getBean(ISubjectOptionService.class); |
| | | bean.saveBatch(children); |
| | | } |
| | | return R.status(save); |
| | | } |
| | | |
| | | /** |
| | | * 题目表 修改 |
| | | */ |
| | | @PostMapping("/update") |
| | | @ApiOperationSupport(order = 5) |
| | | @ApiOperation(value = "修改", notes = "传入subjectChoices") |
| | | public R update(@Valid @RequestBody SubjectChoicesEntity subjectChoices) { |
| | | return R.status(subjectChoicesService.updateById(subjectChoices)); |
| | | } |
| | | |
| | | /** |
| | | * 题目表 新增或修改 |
| | | */ |
| | | @PostMapping("/submit") |
| | | @ApiOperationSupport(order = 6) |
| | | @ApiOperation(value = "新增或修改", notes = "传入subjectChoices") |
| | | public R submit(@Valid @RequestBody SubjectChoicesVO subjectChoices) { |
| | | boolean save = subjectChoicesService.saveOrUpdate(subjectChoices); |
| | | if (save) { |
| | | List<SubjectOptionEntity> children = subjectChoices.getSubjectOptionList(); |
| | | for (SubjectOptionEntity child : children) { |
| | | child.setSubjectChoicesId(subjectChoices.getId()); |
| | | } |
| | | ISubjectOptionService bean = SpringUtils.getBean(ISubjectOptionService.class); |
| | | bean.saveOrUpdateBatch(children); |
| | | } |
| | | return R.status(save); |
| | | } |
| | | |
| | | /** |
| | | * 题目表 删除 |
| | | */ |
| | | @PostMapping("/remove") |
| | | @ApiOperationSupport(order = 7) |
| | | @ApiOperation(value = "逻辑删除", notes = "传入ids") |
| | | public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { |
| | | return R.status(subjectChoicesService.removeBatchByIds(Func.toLongList(ids))); |
| | | } |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.springblade.modules.subjectChoices.dto; |
| | | |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import org.springblade.modules.subjectChoices.entity.SubjectChoicesEntity; |
| | | |
| | | /** |
| | | * 题目表 数据传输对象实体类 |
| | | * |
| | | * @author BladeX |
| | | * @since 2024-01-15 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | public class SubjectChoicesDTO extends SubjectChoicesEntity { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.springblade.modules.subjectChoices.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 题目表 实体类 |
| | | * |
| | | * @author BladeX |
| | | * @since 2024-01-15 |
| | | */ |
| | | |
| | | /** |
| | | * 题目表对象 jczz_subject_choices |
| | | * |
| | | * @author ${context.author} |
| | | * @date 2024-01-15 16:53:02 |
| | | */ |
| | | @ApiModel(value = "SubjectChoices对象", description = "题目表") |
| | | @Data |
| | | @TableName("jczz_subject_choices") |
| | | public class SubjectChoicesEntity implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @ApiModelProperty(value = "主键ID", example = "") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 父级id |
| | | */ |
| | | @ApiModelProperty(value = "父级id", example = "") |
| | | @TableField("parent_id") |
| | | private Long parentId; |
| | | |
| | | /** |
| | | * 大类名称 |
| | | */ |
| | | @ApiModelProperty(value = "大类名称", example = "") |
| | | @TableField("category_name") |
| | | private String categoryName; |
| | | |
| | | /** |
| | | * 细类名称 |
| | | */ |
| | | @ApiModelProperty(value = "细类名称", example = "") |
| | | @TableField("subclass_name") |
| | | private String subclassName; |
| | | |
| | | /** |
| | | * 题目名称 |
| | | */ |
| | | @ApiModelProperty(value = "题目名称", example = "") |
| | | @TableField("subject_name") |
| | | private String subjectName; |
| | | |
| | | /** |
| | | * 类型 0:单选题 1:多选题 2:填空题 |
| | | */ |
| | | @ApiModelProperty(value = "类型 0:单选题 1:多选题 2:填空题", example = "") |
| | | @TableField("choices_type") |
| | | private Byte choicesType; |
| | | |
| | | /** |
| | | * 分值 |
| | | */ |
| | | @ApiModelProperty(value = "分值", example = "") |
| | | @TableField("score") |
| | | private BigDecimal score; |
| | | |
| | | /** |
| | | * 创建人 |
| | | */ |
| | | @ApiModelProperty(value = "创建人", example = "") |
| | | @TableField("creator") |
| | | private String creator; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @ApiModelProperty(value = "创建时间", example = "") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @TableField("create_date") |
| | | private Date createDate; |
| | | |
| | | /** |
| | | * 修改人 |
| | | */ |
| | | @ApiModelProperty(value = "修改人", example = "") |
| | | @TableField("modifier") |
| | | private String modifier; |
| | | |
| | | /** |
| | | * 修改时间 |
| | | */ |
| | | @ApiModelProperty(value = "修改时间", example = "") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @TableField("modify_date") |
| | | private Date modifyDate; |
| | | |
| | | /** |
| | | * 删除标记 0:正常;1:删除 |
| | | */ |
| | | @ApiModelProperty(value = "删除标记 0:正常;1:删除", example = "") |
| | | @TableField("del_flag") |
| | | private Byte delFlag; |
| | | |
| | | /** |
| | | * 层级 |
| | | */ |
| | | @ApiModelProperty(value = "层级", example = "") |
| | | @TableField("level") |
| | | private Integer level; |
| | | } |
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.springblade.modules.subjectChoices.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springblade.modules.subjectChoices.dto.SubjectChoicesDTO; |
| | | import org.springblade.modules.subjectChoices.entity.SubjectChoicesEntity; |
| | | import org.springblade.modules.subjectChoices.vo.SubjectChoicesVO; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 题目表 Mapper 接口 |
| | | * |
| | | * @author BladeX |
| | | * @since 2024-01-15 |
| | | */ |
| | | public interface SubjectChoicesMapper extends BaseMapper<SubjectChoicesEntity> { |
| | | |
| | | /** |
| | | * 自定义分页 |
| | | * |
| | | * @param page |
| | | * @param subjectChoices |
| | | * @return |
| | | */ |
| | | List<SubjectChoicesVO> selectSubjectChoicesPage(IPage page, @Param("subjectChoices") SubjectChoicesVO subjectChoices); |
| | | |
| | | /** |
| | | * 查询题目表 |
| | | * |
| | | * @param id 题目表ID |
| | | * @return 题目表 |
| | | */ |
| | | SubjectChoicesDTO selectSubjectChoicesById(Long id); |
| | | |
| | | /** |
| | | * 查询题目表列表 |
| | | * |
| | | * @param subjectChoicesDTO 题目表 |
| | | * @return 题目表集合 |
| | | */ |
| | | List<SubjectChoicesDTO> selectSubjectChoicesList(SubjectChoicesDTO subjectChoicesDTO); |
| | | |
| | | } |
| New file |
| | |
| | | <?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="org.springblade.modules.subjectChoices.mapper.SubjectChoicesMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="subjectChoicesResultMap" type="org.springblade.modules.subjectChoices.vo.SubjectChoicesVO"> |
| | | <result property="id" column="id"/> |
| | | <result property="parentId" column="parent_id"/> |
| | | <result property="categoryName" column="category_name"/> |
| | | <result property="subclassName" column="subclass_name"/> |
| | | <result property="subjectName" column="subject_name"/> |
| | | <result property="choicesType" column="choices_type"/> |
| | | <result property="score" column="score"/> |
| | | <result property="creator" column="creator"/> |
| | | <result property="createDate" column="create_date"/> |
| | | <result property="modifier" column="modifier"/> |
| | | <result property="modifyDate" column="modify_date"/> |
| | | <result property="delFlag" column="del_flag"/> |
| | | <result property="level" column="level"/> |
| | | <!-- <collection property="subjectOptionList" javaType="java.util.List"--> |
| | | <!-- ofType="org.springblade.modules.subjectOption.entity.SubjectOptionEntity" autoMapping="true">--> |
| | | <!-- <id property="subjectChoicesId" column="id"/>--> |
| | | <!-- </collection>--> |
| | | |
| | | <collection property="subjectOptionList" column="id" javaType="java.util.List" |
| | | ofType="org.springblade.modules.subjectOption.entity.SubjectOptionEntity" |
| | | autoMapping="true" |
| | | select="selectCircleCommentByParentId"></collection> |
| | | |
| | | </resultMap> |
| | | |
| | | <select id="selectCircleCommentByParentId" parameterType="long" |
| | | resultType="org.springblade.modules.subjectOption.entity.SubjectOptionEntity"> |
| | | select * from jczz_subject_option where |
| | | subject_choices_id = #{id} |
| | | </select> |
| | | |
| | | |
| | | <select id="selectSubjectChoicesPage" resultMap="subjectChoicesResultMap"> |
| | | select |
| | | id, |
| | | parent_id, |
| | | category_name, |
| | | subclass_name, |
| | | subject_name, |
| | | choices_type, |
| | | score, |
| | | creator, |
| | | create_date, |
| | | modifier, |
| | | modify_date, |
| | | del_flag, |
| | | level |
| | | from |
| | | jczz_subject_choices |
| | | <where> |
| | | <if test="subjectChoices.id != null ">and id = #{subjectChoices.id}</if> |
| | | <if test="subjectChoices.parentId != null ">and parent_id = #{subjectChoices.parentId}</if> |
| | | <if test="subjectChoices.categoryName != null and subjectChoices.categoryName != ''">and category_name = |
| | | #{subjectChoices.categoryName} |
| | | </if> |
| | | <if test="subjectChoices.subclassName != null and subjectChoices.subclassName != ''">and subclass_name = |
| | | #{subjectChoices.subclassName} |
| | | </if> |
| | | <if test="subjectChoices.subjectName != null and subjectChoices.subjectName != ''">and subject_name = |
| | | #{subjectChoices.subjectName} |
| | | </if> |
| | | <if test="subjectChoices.choicesType != null ">and choices_type = #{subjectChoices.choicesType}</if> |
| | | <if test="subjectChoices.score != null ">and score = #{subjectChoices.score}</if> |
| | | <if test="subjectChoices.creator != null and subjectChoices.creator != ''">and creator = |
| | | #{subjectChoices.creator} |
| | | </if> |
| | | <if test="subjectChoices.createDate != null ">and create_date = #{subjectChoices.createDate}</if> |
| | | <if test="subjectChoices.modifier != null and subjectChoices.modifier != ''">and modifier = |
| | | #{subjectChoices.modifier} |
| | | </if> |
| | | <if test="subjectChoices.modifyDate != null ">and modify_date = #{subjectChoices.modifyDate}</if> |
| | | <if test="subjectChoices.delFlag != null ">and del_flag = #{subjectChoices.delFlag}</if> |
| | | <if test="subjectChoices.level != null ">and level = #{subjectChoices.level}</if> |
| | | </where> |
| | | </select> |
| | | |
| | | |
| | | <resultMap type="org.springblade.modules.subjectChoices.dto.SubjectChoicesDTO" id="SubjectChoicesDTOResult"> |
| | | <result property="id" column="id"/> |
| | | <result property="parentId" column="parent_id"/> |
| | | <result property="categoryName" column="category_name"/> |
| | | <result property="subclassName" column="subclass_name"/> |
| | | <result property="subjectName" column="subject_name"/> |
| | | <result property="choicesType" column="choices_type"/> |
| | | <result property="score" column="score"/> |
| | | <result property="creator" column="creator"/> |
| | | <result property="createDate" column="create_date"/> |
| | | <result property="modifier" column="modifier"/> |
| | | <result property="modifyDate" column="modify_date"/> |
| | | <result property="delFlag" column="del_flag"/> |
| | | <result property="level" column="level"/> |
| | | </resultMap> |
| | | |
| | | <sql id="selectSubjectChoices"> |
| | | select |
| | | id, |
| | | parent_id, |
| | | category_name, |
| | | subclass_name, |
| | | subject_name, |
| | | choices_type, |
| | | score, |
| | | creator, |
| | | create_date, |
| | | modifier, |
| | | modify_date, |
| | | del_flag, |
| | | level |
| | | from |
| | | jczz_subject_choices |
| | | </sql> |
| | | |
| | | <select id="selectSubjectChoicesById" parameterType="long" resultMap="SubjectChoicesDTOResult"> |
| | | <include refid="selectSubjectChoices"/> |
| | | where |
| | | id = #{id} |
| | | </select> |
| | | |
| | | <select id="selectSubjectChoicesList" parameterType="org.springblade.modules.subjectChoices.dto.SubjectChoicesDTO" |
| | | resultMap="SubjectChoicesDTOResult"> |
| | | <include refid="selectSubjectChoices"/> |
| | | <where> |
| | | <if test="id != null ">and id = #{id}</if> |
| | | <if test="parentId != null ">and parent_id = #{parentId}</if> |
| | | <if test="categoryName != null and categoryName != ''">and category_name = #{categoryName}</if> |
| | | <if test="subclassName != null and subclassName != ''">and subclass_name = #{subclassName}</if> |
| | | <if test="subjectName != null and subjectName != ''">and subject_name = #{subjectName}</if> |
| | | <if test="choicesType != null ">and choices_type = #{choicesType}</if> |
| | | <if test="score != null ">and score = #{score}</if> |
| | | <if test="creator != null and creator != ''">and creator = #{creator}</if> |
| | | <if test="createDate != null ">and create_date = #{createDate}</if> |
| | | <if test="modifier != null and modifier != ''">and modifier = #{modifier}</if> |
| | | <if test="modifyDate != null ">and modify_date = #{modifyDate}</if> |
| | | <if test="delFlag != null ">and del_flag = #{delFlag}</if> |
| | | <if test="level != null ">and level = #{level}</if> |
| | | </where> |
| | | </select> |
| | | |
| | | |
| | | </mapper> |
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.springblade.modules.subjectChoices.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.springblade.modules.subjectChoices.dto.SubjectChoicesDTO; |
| | | import org.springblade.modules.subjectChoices.entity.SubjectChoicesEntity; |
| | | import org.springblade.modules.subjectChoices.vo.SubjectChoicesVO; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 题目表 服务类 |
| | | * |
| | | * @author BladeX |
| | | * @since 2024-01-15 |
| | | */ |
| | | public interface ISubjectChoicesService extends IService<SubjectChoicesEntity> { |
| | | |
| | | /** |
| | | * 自定义分页 |
| | | * |
| | | * @param page |
| | | * @param subjectChoices |
| | | * @return |
| | | */ |
| | | IPage<SubjectChoicesVO> selectSubjectChoicesPage(IPage<SubjectChoicesVO> page, SubjectChoicesVO subjectChoices); |
| | | |
| | | /** |
| | | * 查询题目表 |
| | | * |
| | | * @param id 题目表ID |
| | | * @return 题目表 |
| | | */ |
| | | SubjectChoicesDTO selectSubjectChoicesById(Long id); |
| | | |
| | | /** |
| | | * 查询题目表列表 |
| | | * |
| | | * @param subjectChoicesDTO 题目表 |
| | | * @return 题目表集合 |
| | | */ |
| | | List<SubjectChoicesDTO> selectSubjectChoicesList(SubjectChoicesDTO subjectChoicesDTO); |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.springblade.modules.subjectChoices.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springblade.modules.subjectChoices.dto.SubjectChoicesDTO; |
| | | import org.springblade.modules.subjectChoices.entity.SubjectChoicesEntity; |
| | | import org.springblade.modules.subjectChoices.mapper.SubjectChoicesMapper; |
| | | import org.springblade.modules.subjectChoices.service.ISubjectChoicesService; |
| | | import org.springblade.modules.subjectChoices.vo.SubjectChoicesVO; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 题目表 服务实现类 |
| | | * |
| | | * @author BladeX |
| | | * @since 2024-01-15 |
| | | */ |
| | | @Service |
| | | public class SubjectChoicesServiceImpl extends ServiceImpl<SubjectChoicesMapper, SubjectChoicesEntity> implements ISubjectChoicesService { |
| | | |
| | | @Override |
| | | public IPage<SubjectChoicesVO> selectSubjectChoicesPage(IPage<SubjectChoicesVO> page, SubjectChoicesVO subjectChoices) { |
| | | return page.setRecords(baseMapper.selectSubjectChoicesPage(page, subjectChoices)); |
| | | } |
| | | |
| | | /** |
| | | * 查询题目表 |
| | | * |
| | | * @param id 题目表ID |
| | | * @return 题目表 |
| | | */ |
| | | @Override |
| | | public SubjectChoicesDTO selectSubjectChoicesById(Long id) { |
| | | return this.baseMapper.selectSubjectChoicesById(id); |
| | | } |
| | | |
| | | /** |
| | | * 查询题目表列表 |
| | | * |
| | | * @param subjectChoicesDTO 题目表 |
| | | * @return 题目表集合 |
| | | */ |
| | | @Override |
| | | public List<SubjectChoicesDTO> selectSubjectChoicesList(SubjectChoicesDTO subjectChoicesDTO) { |
| | | return this.baseMapper.selectSubjectChoicesList(subjectChoicesDTO); |
| | | } |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.springblade.modules.subjectChoices.vo; |
| | | |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import org.springblade.modules.subjectChoices.entity.SubjectChoicesEntity; |
| | | import org.springblade.modules.subjectOption.entity.SubjectOptionEntity; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 题目表 视图实体类 |
| | | * |
| | | * @author BladeX |
| | | * @since 2024-01-15 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | public class SubjectChoicesVO extends SubjectChoicesEntity { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | private List<SubjectOptionEntity> subjectOptionList; |
| | | } |
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.springblade.modules.subjectChoices.wrapper; |
| | | |
| | | import org.springblade.core.mp.support.BaseEntityWrapper; |
| | | import org.springblade.core.tool.utils.BeanUtil; |
| | | import org.springblade.modules.subjectChoices.entity.SubjectChoicesEntity; |
| | | import org.springblade.modules.subjectChoices.vo.SubjectChoicesVO; |
| | | |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * 题目表 包装类,返回视图层所需的字段 |
| | | * |
| | | * @author BladeX |
| | | * @since 2024-01-15 |
| | | */ |
| | | public class SubjectChoicesWrapper extends BaseEntityWrapper<SubjectChoicesEntity, SubjectChoicesVO> { |
| | | |
| | | public static SubjectChoicesWrapper build() { |
| | | return new SubjectChoicesWrapper(); |
| | | } |
| | | |
| | | @Override |
| | | public SubjectChoicesVO entityVO(SubjectChoicesEntity subjectChoices) { |
| | | SubjectChoicesVO subjectChoicesVO = Objects.requireNonNull(BeanUtil.copy(subjectChoices, SubjectChoicesVO.class)); |
| | | |
| | | //User createUser = UserCache.getUser(subjectChoices.getCreateUser()); |
| | | //User updateUser = UserCache.getUser(subjectChoices.getUpdateUser()); |
| | | //subjectChoicesVO.setCreateUserName(createUser.getName()); |
| | | //subjectChoicesVO.setUpdateUserName(updateUser.getName()); |
| | | |
| | | return subjectChoicesVO; |
| | | } |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.springblade.modules.subjectOption.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springblade.modules.subjectOption.entity.SubjectOptionEntity; |
| | | import org.springblade.modules.subjectOption.service.ISubjectOptionService; |
| | | import org.springblade.modules.subjectOption.vo.SubjectOptionVO; |
| | | import org.springblade.modules.subjectOption.wrapper.SubjectOptionWrapper; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.validation.Valid; |
| | | |
| | | /** |
| | | * 题目选项表 控制器 |
| | | * |
| | | * @author BladeX |
| | | * @since 2024-01-15 |
| | | */ |
| | | @RestController |
| | | @AllArgsConstructor |
| | | @RequestMapping("blade-subjectOption/subjectOption") |
| | | @Api(value = "题目选项表", tags = "题目选项表接口") |
| | | public class SubjectOptionController extends BladeController { |
| | | |
| | | private final ISubjectOptionService subjectOptionService; |
| | | |
| | | /** |
| | | * 题目选项表 详情 |
| | | */ |
| | | @GetMapping("/detail") |
| | | @ApiOperationSupport(order = 1) |
| | | @ApiOperation(value = "详情", notes = "传入subjectOption") |
| | | public R<SubjectOptionVO> detail(SubjectOptionEntity subjectOption) { |
| | | SubjectOptionEntity detail = subjectOptionService.getOne(Condition.getQueryWrapper(subjectOption)); |
| | | return R.data(SubjectOptionWrapper.build().entityVO(detail)); |
| | | } |
| | | |
| | | /** |
| | | * 题目选项表 分页 |
| | | */ |
| | | @GetMapping("/list") |
| | | @ApiOperationSupport(order = 2) |
| | | @ApiOperation(value = "分页", notes = "传入subjectOption") |
| | | public R<IPage<SubjectOptionVO>> list(SubjectOptionEntity subjectOption, Query query) { |
| | | IPage<SubjectOptionEntity> pages = subjectOptionService.page(Condition.getPage(query), Condition.getQueryWrapper(subjectOption)); |
| | | return R.data(SubjectOptionWrapper.build().pageVO(pages)); |
| | | } |
| | | |
| | | /** |
| | | * 题目选项表 自定义分页 |
| | | */ |
| | | @GetMapping("/page") |
| | | @ApiOperationSupport(order = 3) |
| | | @ApiOperation(value = "分页", notes = "传入subjectOption") |
| | | public R<IPage<SubjectOptionVO>> page(SubjectOptionVO subjectOption, Query query) { |
| | | IPage<SubjectOptionVO> pages = subjectOptionService.selectSubjectOptionPage(Condition.getPage(query), subjectOption); |
| | | return R.data(pages); |
| | | } |
| | | |
| | | /** |
| | | * 题目选项表 新增 |
| | | */ |
| | | @PostMapping("/save") |
| | | @ApiOperationSupport(order = 4) |
| | | @ApiOperation(value = "新增", notes = "传入subjectOption") |
| | | public R save(@Valid @RequestBody SubjectOptionEntity subjectOption) { |
| | | return R.status(subjectOptionService.save(subjectOption)); |
| | | } |
| | | |
| | | /** |
| | | * 题目选项表 修改 |
| | | */ |
| | | @PostMapping("/update") |
| | | @ApiOperationSupport(order = 5) |
| | | @ApiOperation(value = "修改", notes = "传入subjectOption") |
| | | public R update(@Valid @RequestBody SubjectOptionEntity subjectOption) { |
| | | return R.status(subjectOptionService.updateById(subjectOption)); |
| | | } |
| | | |
| | | /** |
| | | * 题目选项表 新增或修改 |
| | | */ |
| | | @PostMapping("/submit") |
| | | @ApiOperationSupport(order = 6) |
| | | @ApiOperation(value = "新增或修改", notes = "传入subjectOption") |
| | | public R submit(@Valid @RequestBody SubjectOptionEntity subjectOption) { |
| | | return R.status(subjectOptionService.saveOrUpdate(subjectOption)); |
| | | } |
| | | |
| | | /** |
| | | * 题目选项表 删除 |
| | | */ |
| | | @PostMapping("/remove") |
| | | @ApiOperationSupport(order = 7) |
| | | @ApiOperation(value = "逻辑删除", notes = "传入ids") |
| | | public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { |
| | | return R.status(subjectOptionService.removeBatchByIds(Func.toLongList(ids))); |
| | | } |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.springblade.modules.subjectOption.dto; |
| | | |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import org.springblade.modules.subjectOption.entity.SubjectOptionEntity; |
| | | |
| | | /** |
| | | * 题目选项表 数据传输对象实体类 |
| | | * |
| | | * @author BladeX |
| | | * @since 2024-01-15 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | public class SubjectOptionDTO extends SubjectOptionEntity { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.springblade.modules.subjectOption.entity; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 题目选项表对象 jczz_subject_option |
| | | * |
| | | * @author ${context.author} |
| | | * @date 2024-01-15 16:53:02 |
| | | */ |
| | | @ApiModel(value = "SubjectOption对象", description = "题目选项表") |
| | | @Data |
| | | @TableName("jczz_subject_option") |
| | | public class SubjectOptionEntity implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @ApiModelProperty(value = "主键ID", example = "") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 选择题ID |
| | | */ |
| | | @ApiModelProperty(value = "选择题ID", example = "") |
| | | @TableField("subject_choices_id") |
| | | private Long subjectChoicesId; |
| | | |
| | | /** |
| | | * 选项名称 |
| | | */ |
| | | @ApiModelProperty(value = "选项名称", example = "") |
| | | @TableField("option_name") |
| | | private String optionName; |
| | | |
| | | /** |
| | | * 选项内容 |
| | | */ |
| | | @ApiModelProperty(value = "选项内容", example = "") |
| | | @TableField("option_content") |
| | | private String optionContent; |
| | | |
| | | /** |
| | | * 创建人 |
| | | */ |
| | | @ApiModelProperty(value = "创建人", example = "") |
| | | @TableField("creator") |
| | | private String creator; |
| | | |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @ApiModelProperty(value = "创建时间", example = "") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @TableField("create_date") |
| | | private Date createDate; |
| | | |
| | | /** |
| | | * 修改人 |
| | | */ |
| | | @ApiModelProperty(value = "修改人", example = "") |
| | | @TableField("modifier") |
| | | private String modifier; |
| | | |
| | | /** |
| | | * 修改时间 |
| | | */ |
| | | @ApiModelProperty(value = "修改时间", example = "") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @TableField("modify_date") |
| | | private Date modifyDate; |
| | | |
| | | /** |
| | | * 删除标记 0:正常;1:删除 |
| | | */ |
| | | @ApiModelProperty(value = "删除标记 0:正常;1:删除", example = "") |
| | | @TableField("del_flag") |
| | | private Byte delFlag; |
| | | |
| | | /** |
| | | * 分数 |
| | | */ |
| | | @ApiModelProperty(value = "分数", example = "") |
| | | @TableField("score") |
| | | private BigDecimal score; |
| | | |
| | | /** |
| | | * 计算公式 |
| | | */ |
| | | @ApiModelProperty(value = "计算公式", example = "") |
| | | @TableField("formula") |
| | | private String formula; |
| | | } |
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.springblade.modules.subjectOption.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.springblade.modules.subjectOption.entity.SubjectOptionEntity; |
| | | import org.springblade.modules.subjectOption.vo.SubjectOptionVO; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 题目选项表 Mapper 接口 |
| | | * |
| | | * @author BladeX |
| | | * @since 2024-01-15 |
| | | */ |
| | | public interface SubjectOptionMapper extends BaseMapper<SubjectOptionEntity> { |
| | | |
| | | /** |
| | | * 自定义分页 |
| | | * |
| | | * @param page |
| | | * @param subjectOption |
| | | * @return |
| | | */ |
| | | List<SubjectOptionVO> selectSubjectOptionPage(IPage page, SubjectOptionVO subjectOption); |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | <?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="org.springblade.modules.subjectOption.mapper.SubjectOptionMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="subjectOptionResultMap" type="org.springblade.modules.subjectOption.entity.SubjectOptionEntity"> |
| | | </resultMap> |
| | | |
| | | |
| | | <select id="selectSubjectOptionPage" resultMap="subjectOptionResultMap"> |
| | | select * from jczz_subject_option where is_deleted = 0 |
| | | </select> |
| | | |
| | | |
| | | </mapper> |
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.springblade.modules.subjectOption.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.springblade.modules.subjectOption.entity.SubjectOptionEntity; |
| | | import org.springblade.modules.subjectOption.vo.SubjectOptionVO; |
| | | |
| | | /** |
| | | * 题目选项表 服务类 |
| | | * |
| | | * @author BladeX |
| | | * @since 2024-01-15 |
| | | */ |
| | | public interface ISubjectOptionService extends IService<SubjectOptionEntity> { |
| | | |
| | | /** |
| | | * 自定义分页 |
| | | * |
| | | * @param page |
| | | * @param subjectOption |
| | | * @return |
| | | */ |
| | | IPage<SubjectOptionVO> selectSubjectOptionPage(IPage<SubjectOptionVO> page, SubjectOptionVO subjectOption); |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.springblade.modules.subjectOption.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springblade.modules.subjectOption.entity.SubjectOptionEntity; |
| | | import org.springblade.modules.subjectOption.mapper.SubjectOptionMapper; |
| | | import org.springblade.modules.subjectOption.service.ISubjectOptionService; |
| | | import org.springblade.modules.subjectOption.vo.SubjectOptionVO; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * 题目选项表 服务实现类 |
| | | * |
| | | * @author BladeX |
| | | * @since 2024-01-15 |
| | | */ |
| | | @Service |
| | | public class SubjectOptionServiceImpl extends ServiceImpl<SubjectOptionMapper, SubjectOptionEntity> implements ISubjectOptionService { |
| | | |
| | | @Override |
| | | public IPage<SubjectOptionVO> selectSubjectOptionPage(IPage<SubjectOptionVO> page, SubjectOptionVO subjectOption) { |
| | | return page.setRecords(baseMapper.selectSubjectOptionPage(page, subjectOption)); |
| | | } |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.springblade.modules.subjectOption.vo; |
| | | |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import org.springblade.modules.subjectOption.entity.SubjectOptionEntity; |
| | | |
| | | /** |
| | | * 题目选项表 视图实体类 |
| | | * |
| | | * @author BladeX |
| | | * @since 2024-01-15 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | public class SubjectOptionVO extends SubjectOptionEntity { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.springblade.modules.subjectOption.wrapper; |
| | | |
| | | import org.springblade.core.mp.support.BaseEntityWrapper; |
| | | import org.springblade.core.tool.utils.BeanUtil; |
| | | import org.springblade.modules.subjectOption.entity.SubjectOptionEntity; |
| | | import org.springblade.modules.subjectOption.vo.SubjectOptionVO; |
| | | |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * 题目选项表 包装类,返回视图层所需的字段 |
| | | * |
| | | * @author BladeX |
| | | * @since 2024-01-15 |
| | | */ |
| | | public class SubjectOptionWrapper extends BaseEntityWrapper<SubjectOptionEntity, SubjectOptionVO> { |
| | | |
| | | public static SubjectOptionWrapper build() { |
| | | return new SubjectOptionWrapper(); |
| | | } |
| | | |
| | | @Override |
| | | public SubjectOptionVO entityVO(SubjectOptionEntity subjectOption) { |
| | | SubjectOptionVO subjectOptionVO = Objects.requireNonNull(BeanUtil.copy(subjectOption, SubjectOptionVO.class)); |
| | | |
| | | //User createUser = UserCache.getUser(subjectOption.getCreateUser()); |
| | | //User updateUser = UserCache.getUser(subjectOption.getUpdateUser()); |
| | | //subjectOptionVO.setCreateUserName(createUser.getName()); |
| | | //subjectOptionVO.setUpdateUserName(updateUser.getName()); |
| | | |
| | | return subjectOptionVO; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | database: |
| | | provider: |
| | | prefix: blade- |
| | | file-store-dir: D:/myfile/ureportDbfiles |
| | | |
| | | #oss默认配置 |
| | | oss: |