mirror of
https://gitee.com/dromara/RuoYi-Vue-Plus.git
synced 2026-09-20 18:15:56 +08:00
up
This commit is contained in:
parent
c591730f56
commit
d83ce56244
@ -0,0 +1,105 @@
|
||||
package org.dromara.question.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.*;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.excel.utils.ExcelUtil;
|
||||
import org.dromara.question.domain.vo.LabelsVo;
|
||||
import org.dromara.question.domain.bo.LabelsBo;
|
||||
import org.dromara.question.service.ILabelsService;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 题目标签
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2023-11-08
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/question/label")
|
||||
public class LabelsController extends BaseController {
|
||||
|
||||
private final ILabelsService labelsService;
|
||||
|
||||
/**
|
||||
* 查询题目标签列表
|
||||
*/
|
||||
@SaCheckPermission("question:label:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<LabelsVo> list(LabelsBo bo, PageQuery pageQuery) {
|
||||
return labelsService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出题目标签列表
|
||||
*/
|
||||
@SaCheckPermission("question:label:export")
|
||||
@Log(title = "题目标签", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(LabelsBo bo, HttpServletResponse response) {
|
||||
List<LabelsVo> list = labelsService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "题目标签", LabelsVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取题目标签详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("question:label:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<LabelsVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
return R.ok(labelsService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增题目标签
|
||||
*/
|
||||
@SaCheckPermission("question:label:add")
|
||||
@Log(title = "题目标签", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody LabelsBo bo) {
|
||||
return toAjax(labelsService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改题目标签
|
||||
*/
|
||||
@SaCheckPermission("question:label:edit")
|
||||
@Log(title = "题目标签", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody LabelsBo bo) {
|
||||
return toAjax(labelsService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除题目标签
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@SaCheckPermission("question:label:remove")
|
||||
@Log(title = "题目标签", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(labelsService.deleteWithValidByIds(List.of(ids), true));
|
||||
}
|
||||
}
|
||||
@ -6,6 +6,7 @@ import lombok.RequiredArgsConstructor;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.*;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.dromara.question.domain.bo.TitleResp;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
@ -63,7 +64,7 @@ public class TitleController extends BaseController {
|
||||
*/
|
||||
@SaCheckPermission("question:title:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<TitleVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
public R<TitleResp> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
return R.ok(titleService.queryById(id));
|
||||
}
|
||||
|
||||
@ -0,0 +1,41 @@
|
||||
package org.dromara.question.domain;
|
||||
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 题目标签对象 f_labels
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2023-11-08
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("f_labels")
|
||||
public class Labels extends BaseEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 标签名称
|
||||
*/
|
||||
private String label;
|
||||
|
||||
/**
|
||||
* 标签状态 1:启用 0:禁用
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,44 @@
|
||||
package org.dromara.question.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* @author : lvxudong
|
||||
* @date : 2023/11/8 17:39
|
||||
* @className : Options
|
||||
* @description :
|
||||
**/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("f_options")
|
||||
public class Options extends BaseEntity {
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 选项序号
|
||||
*/
|
||||
private Integer serial;
|
||||
|
||||
/**
|
||||
* 题目id
|
||||
*/
|
||||
private Long questionId;
|
||||
|
||||
/**
|
||||
* 选项内容
|
||||
*/
|
||||
private Long optionContent;
|
||||
}
|
||||
@ -0,0 +1,42 @@
|
||||
package org.dromara.question.domain.bo;
|
||||
|
||||
import org.dromara.question.domain.Labels;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import jakarta.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* 题目标签业务对象 f_labels
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2023-11-08
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = Labels.class, reverseConvertGenerate = false)
|
||||
public class LabelsBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@NotNull(message = "不能为空", groups = { EditGroup.class })
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 标签名称
|
||||
*/
|
||||
@NotBlank(message = "标签名称不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String label;
|
||||
|
||||
/**
|
||||
* 标签状态 1:启用 0:禁用
|
||||
*/
|
||||
@NotNull(message = "标签状态 1:启用 0:禁用不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Integer status;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,33 @@
|
||||
package org.dromara.question.domain.bo;
|
||||
|
||||
import lombok.Data;
|
||||
import org.dromara.question.domain.vo.OptionVo;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author : lvxudong
|
||||
* @date : 2023/11/8 17:47
|
||||
* @className : TitleResp
|
||||
* @description :
|
||||
**/
|
||||
@Data
|
||||
public class TitleResp implements Serializable {
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 题目
|
||||
*/
|
||||
private String question;
|
||||
|
||||
/**
|
||||
* 题目标签类型
|
||||
*/
|
||||
private Long labelName;
|
||||
|
||||
private List<OptionVo> optionVoList;
|
||||
}
|
||||
@ -0,0 +1,50 @@
|
||||
package org.dromara.question.domain.vo;
|
||||
|
||||
import org.dromara.question.domain.Labels;
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import org.dromara.common.excel.annotation.ExcelDictFormat;
|
||||
import org.dromara.common.excel.convert.ExcelDictConvert;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 题目标签视图对象 f_labels
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2023-11-08
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = Labels.class)
|
||||
public class LabelsVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ExcelProperty(value = "")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 标签名称
|
||||
*/
|
||||
@ExcelProperty(value = "标签名称")
|
||||
private String label;
|
||||
|
||||
/**
|
||||
* 标签状态 1:启用 0:禁用
|
||||
*/
|
||||
@ExcelProperty(value = "标签状态 1:启用 0:禁用")
|
||||
private Integer status;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,41 @@
|
||||
package org.dromara.question.domain.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import org.dromara.question.domain.Title;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @author : lvxudong
|
||||
* @date : 2023/11/8 17:37
|
||||
* @className : OptionVo
|
||||
* @description :
|
||||
**/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = Title.class)
|
||||
public class OptionVo implements Serializable {
|
||||
|
||||
/**
|
||||
* 主键id
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 选项序号
|
||||
*/
|
||||
private Integer serial;
|
||||
|
||||
/**
|
||||
* 题目id
|
||||
*/
|
||||
private Long questionId;
|
||||
|
||||
/**
|
||||
* 选项内容
|
||||
*/
|
||||
private Long optionContent;
|
||||
}
|
||||
@ -21,7 +21,6 @@ import java.util.Date;
|
||||
* @date 2023-11-08
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = Title.class)
|
||||
public class TitleVo implements Serializable {
|
||||
|
||||
@ -29,21 +28,18 @@ public class TitleVo implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
*
|
||||
* id
|
||||
*/
|
||||
@ExcelProperty(value = "")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 题目
|
||||
*/
|
||||
@ExcelProperty(value = "题目")
|
||||
private String question;
|
||||
|
||||
/**
|
||||
* 题目标签类型
|
||||
*/
|
||||
@ExcelProperty(value = "题目标签类型")
|
||||
private Long labelId;
|
||||
|
||||
|
||||
|
||||
@ -0,0 +1,15 @@
|
||||
package org.dromara.question.mapper;
|
||||
|
||||
import org.dromara.question.domain.Labels;
|
||||
import org.dromara.question.domain.vo.LabelsVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 题目标签Mapper接口
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2023-11-08
|
||||
*/
|
||||
public interface LabelsMapper extends BaseMapperPlus<Labels, LabelsVo> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,15 @@
|
||||
package org.dromara.question.mapper;
|
||||
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
import org.dromara.question.domain.Options;
|
||||
import org.dromara.question.domain.vo.OptionVo;
|
||||
|
||||
/**
|
||||
* @author : lvxudong
|
||||
* @date : 2023/11/8 17:45
|
||||
* @className : Option
|
||||
* @description :
|
||||
**/
|
||||
public interface OptionMapper extends BaseMapperPlus<Options, OptionVo> {
|
||||
|
||||
}
|
||||
@ -0,0 +1,49 @@
|
||||
package org.dromara.question.service;
|
||||
|
||||
import org.dromara.question.domain.Labels;
|
||||
import org.dromara.question.domain.vo.LabelsVo;
|
||||
import org.dromara.question.domain.bo.LabelsBo;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 题目标签Service接口
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2023-11-08
|
||||
*/
|
||||
public interface ILabelsService {
|
||||
|
||||
/**
|
||||
* 查询题目标签
|
||||
*/
|
||||
LabelsVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 查询题目标签列表
|
||||
*/
|
||||
TableDataInfo<LabelsVo> queryPageList(LabelsBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询题目标签列表
|
||||
*/
|
||||
List<LabelsVo> queryList(LabelsBo bo);
|
||||
|
||||
/**
|
||||
* 新增题目标签
|
||||
*/
|
||||
Boolean insertByBo(LabelsBo bo);
|
||||
|
||||
/**
|
||||
* 修改题目标签
|
||||
*/
|
||||
Boolean updateByBo(LabelsBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除题目标签信息
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
||||
@ -1,6 +1,7 @@
|
||||
package org.dromara.question.service;
|
||||
|
||||
import org.dromara.question.domain.Title;
|
||||
import org.dromara.question.domain.bo.TitleResp;
|
||||
import org.dromara.question.domain.vo.TitleVo;
|
||||
import org.dromara.question.domain.bo.TitleBo;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
@ -20,7 +21,7 @@ public interface ITitleService {
|
||||
/**
|
||||
* 查询题目
|
||||
*/
|
||||
TitleVo queryById(Long id);
|
||||
TitleResp queryById(Long id);
|
||||
|
||||
/**
|
||||
* 查询题目列表
|
||||
|
||||
@ -0,0 +1,110 @@
|
||||
package org.dromara.question.service.impl;
|
||||
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.dromara.question.domain.bo.LabelsBo;
|
||||
import org.dromara.question.domain.vo.LabelsVo;
|
||||
import org.dromara.question.domain.Labels;
|
||||
import org.dromara.question.mapper.LabelsMapper;
|
||||
import org.dromara.question.service.ILabelsService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 题目标签Service业务层处理
|
||||
*
|
||||
* @author Lion Li
|
||||
* @date 2023-11-08
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class LabelsServiceImpl implements ILabelsService {
|
||||
|
||||
private final LabelsMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询题目标签
|
||||
*/
|
||||
@Override
|
||||
public LabelsVo queryById(Long id){
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询题目标签列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<LabelsVo> queryPageList(LabelsBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<Labels> lqw = buildQueryWrapper(bo);
|
||||
Page<LabelsVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询题目标签列表
|
||||
*/
|
||||
@Override
|
||||
public List<LabelsVo> queryList(LabelsBo bo) {
|
||||
LambdaQueryWrapper<Labels> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<Labels> buildQueryWrapper(LabelsBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<Labels> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getLabel()), Labels::getLabel, bo.getLabel());
|
||||
lqw.eq(bo.getStatus() != null, Labels::getStatus, bo.getStatus());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增题目标签
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(LabelsBo bo) {
|
||||
Labels add = MapstructUtils.convert(bo, Labels.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改题目标签
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(LabelsBo bo) {
|
||||
Labels update = MapstructUtils.convert(bo, Labels.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(Labels entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除题目标签
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteBatchIds(ids) > 0;
|
||||
}
|
||||
}
|
||||
@ -8,6 +8,10 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.question.domain.Options;
|
||||
import org.dromara.question.domain.bo.TitleResp;
|
||||
import org.dromara.question.domain.vo.OptionVo;
|
||||
import org.dromara.question.mapper.OptionMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.dromara.question.domain.bo.TitleBo;
|
||||
import org.dromara.question.domain.vo.TitleVo;
|
||||
@ -31,12 +35,20 @@ public class TitleServiceImpl implements ITitleService {
|
||||
|
||||
private final TitleMapper baseMapper;
|
||||
|
||||
private final OptionMapper optionMapper;
|
||||
|
||||
/**
|
||||
* 查询题目
|
||||
*/
|
||||
@Override
|
||||
public TitleVo queryById(Long id){
|
||||
return baseMapper.selectVoById(id);
|
||||
public TitleResp queryById(Long id){
|
||||
TitleVo titleVo = baseMapper.selectVoById(id);
|
||||
List<OptionVo> options = optionMapper.selectVoList(new LambdaQueryWrapper<Options>()
|
||||
.eq(Options::getQuestionId, titleVo.getId()));
|
||||
|
||||
TitleResp resp = new TitleResp();
|
||||
resp.setOptionVoList(options);
|
||||
return resp;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -59,7 +71,6 @@ public class TitleServiceImpl implements ITitleService {
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<Title> buildQueryWrapper(TitleBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<Title> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getQuestion()), Title::getQuestion, bo.getQuestion());
|
||||
lqw.eq(bo.getLabelId() != null, Title::getLabelId, bo.getLabelId());
|
||||
|
||||
@ -0,0 +1,7 @@
|
||||
<?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.dromara.question.mapper.LabelsMapper">
|
||||
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue
Block a user