Compare commits
2 Commits
a3ed7449cb
...
dc0bd6288e
| Author | SHA1 | Date |
|---|---|---|
|
|
dc0bd6288e | 1 week ago |
|
|
98d710435a | 2 months ago |
@ -0,0 +1,40 @@
|
||||
package com.ruoyi.web.controller.basic;
|
||||
|
||||
import com.ruoyi.RestResponse;
|
||||
import com.ruoyi.basic.service.impl.BusinessSysDictDataService;
|
||||
import com.ruoyi.common.core.domain.entity.SysDictData;
|
||||
import com.ruoyi.system.service.ISysDictDataService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 字典数据表 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author zhangby
|
||||
* @since 2020-01-15
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/api/dict/data")
|
||||
public class ISysDictDataController {
|
||||
|
||||
@Autowired
|
||||
private BusinessSysDictDataService sysDictDataService;
|
||||
|
||||
/**
|
||||
* 某字典数据
|
||||
* @param dictType
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/list/dictType/{dictType}")
|
||||
public RestResponse dictTypeDataList(@PathVariable("dictType") String dictType){
|
||||
List<SysDictData> dictDataList = sysDictDataService.dictTypeDataList(dictType);
|
||||
return RestResponse.success().setData(dictDataList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,47 @@
|
||||
package com.ruoyi.web.controller.im;
|
||||
|
||||
import com.ruoyi.common.annotation.RepeatSubmit;
|
||||
import com.ruoyi.im.domain.vo.GroupVO;
|
||||
import com.ruoyi.im.service.GroupService;
|
||||
import com.ruoyi.web.controller.im.result.Result;
|
||||
import com.ruoyi.web.controller.im.result.ResultUtils;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
|
||||
@Tag(name = "群聊")
|
||||
@RestController
|
||||
@RequestMapping("/api/group")
|
||||
@RequiredArgsConstructor
|
||||
public class GroupController {
|
||||
|
||||
private final GroupService groupService;
|
||||
|
||||
@RepeatSubmit
|
||||
@Operation(summary = "创建群聊", description = "创建群聊")
|
||||
@PostMapping("/create")
|
||||
public Result<GroupVO> createGroup(@Valid @RequestBody GroupVO vo) {
|
||||
return ResultUtils.success(groupService.createGroup(vo));
|
||||
}
|
||||
|
||||
|
||||
@Operation(summary = "查询群聊", description = "查询单个群聊信息")
|
||||
@GetMapping("/find/{groupId}")
|
||||
public Result<GroupVO> findGroup(@NotNull(message = "群聊id不能为空") @PathVariable Long groupId) {
|
||||
return ResultUtils.success(groupService.findById(groupId));
|
||||
}
|
||||
|
||||
@Operation(summary = "查询群聊列表", description = "查询群聊列表")
|
||||
@GetMapping("/list")
|
||||
public Result<List<GroupVO>> findGroups() {
|
||||
return ResultUtils.success(groupService.findGroups());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,67 @@
|
||||
package com.ruoyi.web.controller.im;
|
||||
|
||||
import com.ruoyi.im.domain.dto.GroupMessageDTO;
|
||||
import com.ruoyi.im.domain.vo.GroupMessageVO;
|
||||
import com.ruoyi.im.service.GroupMessageService;
|
||||
|
||||
import com.ruoyi.web.controller.im.result.Result;
|
||||
import com.ruoyi.web.controller.im.result.ResultUtils;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
|
||||
@Tag(name = "群聊消息")
|
||||
@RestController
|
||||
@RequestMapping("/api/message/group")
|
||||
@RequiredArgsConstructor
|
||||
public class GroupMessageController {
|
||||
|
||||
private final GroupMessageService groupMessageService;
|
||||
|
||||
@PostMapping("/send")
|
||||
@Operation(summary = "发送群聊消息", description = "发送群聊消息")
|
||||
public Result<GroupMessageVO> sendMessage(@Valid @RequestBody GroupMessageDTO vo) {
|
||||
return ResultUtils.success(groupMessageService.sendMessage(vo));
|
||||
}
|
||||
|
||||
@GetMapping("/maxReadedId")
|
||||
@Operation(summary = "获取最大已读消息的id", description = "获取某个会话中已读消息的最大id")
|
||||
public Result<String> getMaxReadedId(@RequestParam Long groupId) {
|
||||
return ResultUtils.success(groupMessageService.getMaxReadedId(groupId),"成功");
|
||||
}
|
||||
|
||||
@GetMapping("/pullOfflineMessage")
|
||||
@Operation(summary = "拉取离线消息", description = "拉取离线消息,消息将通过webscoket异步推送")
|
||||
public Result pullOfflineMessage(@RequestParam Long minId) {
|
||||
groupMessageService.pullOfflineMessage(minId);
|
||||
return ResultUtils.success();
|
||||
}
|
||||
|
||||
@PutMapping("/readed")
|
||||
@Operation(summary = "消息已读", description = "将群聊中的消息状态置为已读")
|
||||
public Result readedMessage(@RequestParam Long groupId) {
|
||||
groupMessageService.readedMessage(groupId);
|
||||
return ResultUtils.success();
|
||||
}
|
||||
|
||||
@GetMapping("/findReadedUsers")
|
||||
@Operation(summary = "获取已读用户id", description = "获取消息已读用户列表")
|
||||
public Result<List<Long>> findReadedUsers(@RequestParam Long groupId,
|
||||
@RequestParam Long messageId) {
|
||||
return ResultUtils.success(groupMessageService.findReadedUsers(groupId, messageId));
|
||||
}
|
||||
|
||||
@GetMapping("/history")
|
||||
@Operation(summary = "查询聊天记录", description = "查询聊天记录")
|
||||
public Result<List<GroupMessageVO>> recallMessage(@NotNull(message = "群聊id不能为空") @RequestParam Long groupId,
|
||||
@NotNull(message = "页码不能为空") @RequestParam Long page,
|
||||
@NotNull(message = "size不能为空") @RequestParam Long size) {
|
||||
return ResultUtils.success(groupMessageService.findHistoryMessage(groupId, page, size));
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,74 @@
|
||||
package com.ruoyi.web.controller.mall;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.ruoyi.RestResponse;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.mall.domain.UserFavorite;
|
||||
import com.ruoyi.mall.service.UserFavoriteService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Api(tags = "app商品收藏")
|
||||
@RestController
|
||||
@RequestMapping("/api/userFavorite")
|
||||
public class UserFavoriteController {
|
||||
|
||||
@Autowired
|
||||
private UserFavoriteService service;
|
||||
|
||||
/**
|
||||
* 商品收藏
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation("收藏")
|
||||
@PostMapping("/add")
|
||||
public RestResponse addFavorite(@RequestBody UserFavorite favorite){
|
||||
return new RestResponse().setSuccess(true).setData(service.addFavorite(favorite.getProductId()));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 判断商品是否收藏
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation("判断商品是否收藏")
|
||||
@PostMapping("/existsByProductId")
|
||||
public RestResponse existsByProductId(@RequestBody UserFavorite favorite){
|
||||
Long userId=SecurityUtils.getAppLoginUser().getAppUserId();;
|
||||
return new RestResponse().setSuccess(true).setData(service.existsByUserIdAndProductId(userId,favorite.getProductId()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消收藏
|
||||
*/
|
||||
@ApiOperation("取消收藏")
|
||||
@PostMapping("/removeFavorite")
|
||||
public RestResponse removeFavorite(@RequestBody UserFavorite favorite) {
|
||||
Long userId=SecurityUtils.getAppLoginUser().getAppUserId();;
|
||||
return new RestResponse().setSuccess(true).setData(service.removeFavorite(userId,favorite.getProductId()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户的收藏列表
|
||||
*/
|
||||
@ApiOperation("获取用户的收藏列表")
|
||||
@GetMapping("/getUserFavorites")
|
||||
public RestResponse getUserFavorites() {
|
||||
return new RestResponse().setSuccess(true).setData(service.getUserFavorites());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取用户的收藏数量
|
||||
*/
|
||||
@ApiOperation("获取用户的收藏数量")
|
||||
@GetMapping("/getUserFavoriteCount")
|
||||
public RestResponse getUserFavoriteCount() {
|
||||
return new RestResponse().setSuccess(true).setData(service.getUserFavoriteCount());
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,37 @@
|
||||
package com.ruoyi.common.db;
|
||||
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.servlet.ServletContextEvent;
|
||||
import javax.servlet.ServletContextListener;
|
||||
import javax.servlet.annotation.WebListener;
|
||||
|
||||
|
||||
@Component//尽量加上这个
|
||||
@WebListener//声明为监听器 implements ServletContextListener
|
||||
public class SshContextListener implements ServletContextListener{
|
||||
|
||||
private SshTunnelConfig sshConnectionConfig;
|
||||
|
||||
public SshContextListener() {
|
||||
super();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void contextInitialized(ServletContextEvent sce) {
|
||||
System.out.println("Context initialized ... !");
|
||||
try {
|
||||
sshConnectionConfig = new SshTunnelConfig();
|
||||
sshConnectionConfig.createSshTunnel();
|
||||
} catch (Throwable e) {
|
||||
e.printStackTrace(); // 连接失败
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void contextDestroyed(ServletContextEvent sce) {
|
||||
System.out.println("Context destroyed ... !");
|
||||
sshConnectionConfig.closeSshTunnel();//断开ssh连接
|
||||
}
|
||||
}
|
||||
@ -1,116 +0,0 @@
|
||||
package com.ruoyi.framework.web.service;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
import com.ruoyi.common.constant.CacheConstants;
|
||||
import com.ruoyi.common.constant.Constants;
|
||||
import com.ruoyi.common.constant.UserConstants;
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
import com.ruoyi.common.core.domain.model.RegisterBody;
|
||||
import com.ruoyi.common.core.redis.RedisCache;
|
||||
import com.ruoyi.common.exception.user.CaptchaException;
|
||||
import com.ruoyi.common.exception.user.CaptchaExpireException;
|
||||
import com.ruoyi.common.utils.MessageUtils;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.framework.manager.AsyncManager;
|
||||
import com.ruoyi.framework.manager.factory.AsyncFactory;
|
||||
import com.ruoyi.system.service.ISysConfigService;
|
||||
import com.ruoyi.system.service.ISysUserService;
|
||||
|
||||
/**
|
||||
* 注册校验方法
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Component
|
||||
public class SysRegisterService
|
||||
{
|
||||
@Autowired
|
||||
private ISysUserService userService;
|
||||
|
||||
@Autowired
|
||||
private ISysConfigService configService;
|
||||
|
||||
@Autowired
|
||||
private RedisCache redisCache;
|
||||
|
||||
/**
|
||||
* 注册
|
||||
*/
|
||||
public String register(RegisterBody registerBody)
|
||||
{
|
||||
String msg = "", username = registerBody.getUsername(), password = registerBody.getPassword();
|
||||
|
||||
boolean captchaEnabled = configService.selectCaptchaEnabled();
|
||||
// 验证码开关
|
||||
if (captchaEnabled)
|
||||
{
|
||||
validateCaptcha(username, registerBody.getCode(), registerBody.getUuid());
|
||||
}
|
||||
|
||||
if (StringUtils.isEmpty(username))
|
||||
{
|
||||
msg = "用户名不能为空";
|
||||
}
|
||||
else if (StringUtils.isEmpty(password))
|
||||
{
|
||||
msg = "用户密码不能为空";
|
||||
}
|
||||
else if (username.length() < UserConstants.USERNAME_MIN_LENGTH
|
||||
|| username.length() > UserConstants.USERNAME_MAX_LENGTH)
|
||||
{
|
||||
msg = "账户长度必须在2到20个字符之间";
|
||||
}
|
||||
else if (password.length() < UserConstants.PASSWORD_MIN_LENGTH
|
||||
|| password.length() > UserConstants.PASSWORD_MAX_LENGTH)
|
||||
{
|
||||
msg = "密码长度必须在5到20个字符之间";
|
||||
}
|
||||
else if (UserConstants.NOT_UNIQUE.equals(userService.checkUserNameUnique(username)))
|
||||
{
|
||||
msg = "保存用户'" + username + "'失败,注册账号已存在";
|
||||
}
|
||||
else
|
||||
{
|
||||
SysUser sysUser = new SysUser();
|
||||
sysUser.setUserName(username);
|
||||
sysUser.setNickName(username);
|
||||
sysUser.setPassword(SecurityUtils.encryptPassword(registerBody.getPassword()));
|
||||
boolean regFlag = userService.registerUser(sysUser);
|
||||
if (!regFlag)
|
||||
{
|
||||
msg = "注册失败,请联系系统管理人员";
|
||||
}
|
||||
else
|
||||
{
|
||||
AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.REGISTER,
|
||||
MessageUtils.message("user.register.success")));
|
||||
}
|
||||
}
|
||||
return msg;
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验验证码
|
||||
*
|
||||
* @param username 用户名
|
||||
* @param code 验证码
|
||||
* @param uuid 唯一标识
|
||||
* @return 结果
|
||||
*/
|
||||
public void validateCaptcha(String username, String code, String uuid)
|
||||
{
|
||||
String verifyKey = CacheConstants.CAPTCHA_CODE_KEY + StringUtils.nvl(uuid, "");
|
||||
String captcha = redisCache.getCacheObject(verifyKey);
|
||||
redisCache.deleteObject(verifyKey);
|
||||
if (captcha == null)
|
||||
{
|
||||
throw new CaptchaExpireException();
|
||||
}
|
||||
if (!code.equalsIgnoreCase(captcha))
|
||||
{
|
||||
throw new CaptchaException();
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
@ -0,0 +1,39 @@
|
||||
package com.ruoyi.basic.domain;
|
||||
|
||||
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 io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 首页菜单
|
||||
* </p>
|
||||
*
|
||||
* @author xn
|
||||
* @since 2022-09-28
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("sys_app_index")
|
||||
public class SysAppIndex implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
@TableId(value = "id", type = IdType.ASSIGN_UUID)
|
||||
private Long id;
|
||||
|
||||
private String name;
|
||||
private String img;
|
||||
private String color;
|
||||
private String sort;
|
||||
private String url;
|
||||
|
||||
|
||||
}
|
||||
@ -1,80 +0,0 @@
|
||||
package com.ruoyi.basic.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 商户表
|
||||
* </p>
|
||||
*
|
||||
* @author xn
|
||||
* @since 2022-09-28
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class YjTenant implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
@TableId(value = "id", type = IdType.ASSIGN_UUID)
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 负责人id
|
||||
*/
|
||||
private Long responsibleId;//负责人id
|
||||
|
||||
private String businessLicense;//营业执照编号/统一信用编码
|
||||
|
||||
private byte[] businessLicensePicture;//营业执照照片/扫描件
|
||||
|
||||
private String legalPerson;//法人姓名
|
||||
|
||||
private String legalPersonTel;//法人联系方式
|
||||
|
||||
private String legalPersonCard;//法人证件号码
|
||||
|
||||
private byte[] legalPersonCardPicturePositive;//法人证件照片/扫描件正面
|
||||
|
||||
private byte[] legalPersonCardPictureBack;//法人证件照片/扫描件背面
|
||||
|
||||
private String vip;//付费级别
|
||||
|
||||
private String vipPrice;//付费金额
|
||||
|
||||
private String vipPriceType;//付费方式,试用,年付,终身/长期
|
||||
|
||||
private String vipPayType;//支付方式,支付宝,微信,转账银行
|
||||
|
||||
private String bankCardId;//银行转账账号
|
||||
|
||||
private Date validUntil;//有效期至,终身/长期用户不判断
|
||||
|
||||
private Date reminderDate;//年付用户预付款提醒开始日期,提醒截止日期到宽限期结束
|
||||
|
||||
private Integer gracePeriod;//宽限期
|
||||
|
||||
/**
|
||||
* 是否正常运营
|
||||
*/
|
||||
private Integer status;//状态 0申请,1审核中,2审核通过,3停止运营
|
||||
|
||||
@TableField(exist = false)
|
||||
private String legalPersonCardPicturePositive1;//法人证件照片/扫描件正面
|
||||
|
||||
@TableField(exist = false)
|
||||
private String legalPersonCardPictureBack1;//法人证件照片/扫描件背面
|
||||
|
||||
@TableField(exist = false)
|
||||
private String businessLicensePicture1;//营业执照照片/扫描件
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,22 @@
|
||||
package com.ruoyi.basic.domain.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class AnswerSubmitDTO {
|
||||
@NotNull(message = "问卷ID不能为空")
|
||||
private Long surveyId;
|
||||
private String sessionId; // 可选,为空时自动生成
|
||||
@NotNull(message = "答案列表不能为空")
|
||||
private List<AnswerItem> answers;
|
||||
|
||||
@Data
|
||||
public static class AnswerItem {
|
||||
@NotNull
|
||||
private Long questionId;
|
||||
@NotNull
|
||||
private Long optionId;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,10 @@
|
||||
package com.ruoyi.basic.domain.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ConstitutionScoreDTO {
|
||||
private String constitutionAlias;
|
||||
private String constitutionName;
|
||||
private Integer totalScore;
|
||||
}
|
||||
@ -1,34 +0,0 @@
|
||||
package com.ruoyi.basic.domain.dto;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.ruoyi.basic.domain.YjStore;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 门店表
|
||||
* </p>
|
||||
*
|
||||
* @author xn
|
||||
* @since 2022-09-28
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class StoreDto implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty("企业名称")
|
||||
private String storeName;
|
||||
//总店id
|
||||
private String parentId;
|
||||
private List<StoreDto> childList;
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
package com.ruoyi.basic.domain.model;
|
||||
|
||||
import com.ruoyi.basic.domain.dto.ConstitutionScoreDTO;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
// 返回的结果视图
|
||||
@Data
|
||||
public class AnswerResultVO {
|
||||
private String resultType; // pinghe, qixu, multiple 等
|
||||
private String resultText; // 结果描述
|
||||
private List<ConstitutionScoreDTO> constitutionScores; // 各体质得分
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
package com.ruoyi.basic.domain.model;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 选项信息
|
||||
*/
|
||||
@Data
|
||||
public class OptionVO {
|
||||
private Long optionId;
|
||||
private String optionText; // 完全符合 / 偶尔有 / 完全不符合
|
||||
private Integer score; // 2 / 1 / 0
|
||||
private Integer sortOrder;
|
||||
}
|
||||
@ -0,0 +1,45 @@
|
||||
package com.ruoyi.basic.domain.model;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 问卷完整信息VO
|
||||
*/
|
||||
@Data
|
||||
public class QuestionnaireVO implements Serializable {
|
||||
private Long surveyId; // 问卷ID
|
||||
private String title; // 问卷标题
|
||||
private String description; // 问卷说明
|
||||
private List<ConstitutionVO> constitutions; // 体质列表(含题目)
|
||||
|
||||
@Data
|
||||
public static class ConstitutionVO implements Serializable{ // 必须是 static
|
||||
private Long constitutionId;
|
||||
private String name;
|
||||
private String alias;
|
||||
private String description;
|
||||
private Integer sortOrder;
|
||||
private List<QuestionVO> questions;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class QuestionVO implements Serializable{
|
||||
private Long questionId;
|
||||
private Integer serialNumber;
|
||||
private String content;
|
||||
private Integer fullScore;
|
||||
private List<OptionVO> options;
|
||||
}
|
||||
|
||||
@Data
|
||||
public static class OptionVO implements Serializable{
|
||||
private Long optionId;
|
||||
private String optionText;
|
||||
private Integer score;
|
||||
private Integer sortOrder;
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,16 @@
|
||||
package com.ruoyi.basic.domain.question;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@TableName("question_answer_detail")
|
||||
public class QuestionAnswerDetail {
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long id;
|
||||
private Long sheetId;
|
||||
private Long questionId;
|
||||
private Long optionId;
|
||||
@TableField(exist = false)
|
||||
private Integer score;
|
||||
}
|
||||
@ -0,0 +1,20 @@
|
||||
package com.ruoyi.basic.domain.question;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
@TableName("question_answer_sheet")
|
||||
public class QuestionAnswerSheet {
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long id;
|
||||
private Long surveyId;
|
||||
@TableField("app_user_id")
|
||||
private Long userId;
|
||||
private String sessionId;
|
||||
private LocalDateTime submitTime;
|
||||
private String ipAddress;
|
||||
private String resultType;
|
||||
private String resultText;
|
||||
}
|
||||
@ -0,0 +1,14 @@
|
||||
package com.ruoyi.basic.domain.question;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@TableName("question_constitution_score")
|
||||
public class QuestionConstitutionScore {
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long id;
|
||||
private Long sheetId;
|
||||
private Long constitutionId;
|
||||
private Integer totalScore;
|
||||
}
|
||||
@ -0,0 +1,16 @@
|
||||
package com.ruoyi.basic.domain.question;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@TableName("question_constitution_type")
|
||||
public class QuestionConstitutionType {
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long id;
|
||||
private Long surveyId;
|
||||
private String name;
|
||||
private String alias;
|
||||
private String description;
|
||||
private Integer sortOrder;
|
||||
}
|
||||
@ -0,0 +1,15 @@
|
||||
package com.ruoyi.basic.domain.question;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@TableName("question_option")
|
||||
public class QuestionOption {
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long id;
|
||||
private Long questionId;
|
||||
private String optionText;
|
||||
private Integer score;
|
||||
private Integer sortOrder;
|
||||
}
|
||||
@ -0,0 +1,15 @@
|
||||
package com.ruoyi.basic.domain.question;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@TableName("question_question")
|
||||
public class QuestionQuestion {
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long id;
|
||||
private Long constitutionId;
|
||||
private Integer serialNumber;
|
||||
private String content;
|
||||
private Integer fullScore;
|
||||
}
|
||||
@ -0,0 +1,17 @@
|
||||
package com.ruoyi.basic.domain.question;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
@TableName("question_survey")
|
||||
public class QuestionSurvey {
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long id;
|
||||
private String title;
|
||||
private String description;
|
||||
private Integer status; // 0-草稿 1-发布 2-关闭
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private LocalDateTime createTime;
|
||||
}
|
||||
@ -0,0 +1,13 @@
|
||||
package com.ruoyi.basic.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.ruoyi.basic.domain.question.QuestionAnswerDetail;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface QuestionAnswerDetailMapper extends BaseMapper<QuestionAnswerDetail> {
|
||||
void insertBatch(@Param("list") List<QuestionAnswerDetail> list);
|
||||
List<QuestionAnswerDetail> getBySheetId(@Param("sheetId") Long sheetId);
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue