任务清单小程序接口

This commit is contained in:
limqhz
2022-11-08 14:52:08 +08:00
parent be36036d7d
commit 519ee7b744
18 changed files with 446 additions and 125 deletions

View File

@@ -3,12 +3,12 @@ package com.quinn.common;
public enum SourceType {
/**
* OSS文件
* 直接下载
*/
OSS,
/**
* 百度网盘
* 打开第三方软件
*/
BAIDU
NEW_TAB
}

View File

@@ -0,0 +1,14 @@
package com.quinn.common;
public enum TaskType {
HABIT(1),
TASK(2),
EVENTS(3);
private int code;
TaskType(int code) {
this.code = code;
}
}

View File

@@ -4,6 +4,7 @@ package com.quinn.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.quinn.common.EmailType;
import com.quinn.dto.req.QueryTaskListReq;
import com.quinn.dto.req.SearchPage;
import com.quinn.dto.req.SendCode;
import com.quinn.dto.res.AboutDTO;
@@ -83,5 +84,27 @@ public class WxController extends BaseModelController {
return ResponseDTO.ok().setData("success");
}
@PostMapping("about/us")
public ResponseDTO queryTask(QueryTaskListReq queryTaskListReq){
Page<About> pageParam = new Page<>(queryTaskListReq.getPage(), queryTaskListReq.getPageSize());
aboutService.page(pageParam,new QueryWrapper<About>().orderByDesc("gmt_create"));
// 结果
List<About> sayList = pageParam.getRecords();
List<AboutDTO> aboutDTOS = new ArrayList<>();
if (!CollectionUtils.isEmpty(sayList)){
sayList.forEach(x->{
AboutDTO aboutDTO = new AboutDTO();
aboutDTO.setId(x.getId());
aboutDTO.setTitle(x.getTitle());
aboutDTO.setContent(x.getContent());
aboutDTO.setGmtCreate(QuinnUtils.getViewStrFromDate(x.getGmtCreate()));
aboutDTOS.add(aboutDTO);
});
}
MyPageParam myPageParam = new MyPageParam(queryTaskListReq.getPage(),queryTaskListReq.getPageSize());
myPageParam.setTotal((int) pageParam.getTotal());
return ResponseDTO.ok().setPage(myPageParam).setData(aboutDTOS);
}
}

View File

@@ -0,0 +1,12 @@
package com.quinn.dto.req;
import lombok.Data;
import java.io.Serializable;
@Data
public class BaseReq implements Serializable {
private String userToken;
}

View File

@@ -0,0 +1,11 @@
package com.quinn.dto.req;
import com.quinn.common.TaskType;
import lombok.Data;
@Data
public class QueryTaskListReq extends SearchPage {
private TaskType taskType;
}

View File

@@ -5,7 +5,7 @@ import lombok.Data;
import java.io.Serializable;
@Data
public class SearchPage implements Serializable {
public class SearchPage extends BaseReq {
int page;
int pageSize;

View File

@@ -51,7 +51,7 @@ public class CodeGenerator {
// 5、策略配置
StrategyConfig strategy = new StrategyConfig();
strategy.setInclude("qn_bucket_url");//设置要映射的表名
strategy.setInclude("qn_user_message");//设置要映射的表名
strategy.setNaming(NamingStrategy.underline_to_camel);//数据库表映射到实体的命名策略
strategy.setTablePrefix("qn_");//设置表前缀不生成

View File

@@ -0,0 +1,16 @@
package com.quinn.mapper;
import com.quinn.pojo.TaskList;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* <p>
* Mapper 接口
* </p>
*
* @author limqsh
* @since 2022-11-08
*/
public interface TaskListMapper extends BaseMapper<TaskList> {
}

View File

@@ -0,0 +1,16 @@
package com.quinn.mapper;
import com.quinn.pojo.UserMessage;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* <p>
* Mapper 接口
* </p>
*
* @author limqsh
* @since 2022-11-08
*/
public interface UserMessageMapper extends BaseMapper<UserMessage> {
}

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.quinn.mapper.TaskListMapper">
</mapper>

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.quinn.mapper.UserMessageMapper">
</mapper>

View File

@@ -0,0 +1,63 @@
package com.quinn.pojo;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* <p>
*
* </p>
*
* @author limqsh
* @since 2022-11-08
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("qn_task_list")
@ApiModel(value="TaskList对象", description="")
public class TaskList implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "自增id")
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
@ApiModelProperty(value = "用户id")
private String uid;
@ApiModelProperty(value = "任务")
private String taskName;
@ApiModelProperty(value = "任务类型1-HABIT、2-TASK、3-EVENT")
private Integer taskType;
@ApiModelProperty(value = "开始时间")
private Date startDate;
@ApiModelProperty(value = "截止日期")
private Date endDate;
@ApiModelProperty(value = "是否今日任务")
private Integer isToday;
@ApiModelProperty(value = "重复表达式")
private String copyVal;
@ApiModelProperty(value = "创建时间")
private Date gmtCreate;
@ApiModelProperty(value = "修改时间")
private Date gmtUpdate;
}

View File

@@ -0,0 +1,63 @@
package com.quinn.pojo;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* <p>
*
* </p>
*
* @author limqsh
* @since 2022-11-08
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("qn_user_message")
@ApiModel(value="UserMessage对象", description="")
public class UserMessage implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "自增id")
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
@ApiModelProperty(value = "用户id")
private String uid;
@ApiModelProperty(value = "标题")
private Integer msgTitle;
@ApiModelProperty(value = "内容")
private Date msgContent;
@ApiModelProperty(value = "是否已读")
private Date isRead;
@ApiModelProperty(value = "发送类型 1-内部 2-短信")
private Integer sendType;
@ApiModelProperty(value = "发送日期")
private Integer sendDate;
@ApiModelProperty(value = "删除标志")
private String delFlag;
@ApiModelProperty(value = "创建时间")
private Date gmtCreate;
@ApiModelProperty(value = "修改时间")
private Date gmtUpdate;
}

View File

@@ -0,0 +1,16 @@
package com.quinn.service;
import com.quinn.pojo.TaskList;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
* 服务类
* </p>
*
* @author limqsh
* @since 2022-11-08
*/
public interface TaskListService extends IService<TaskList> {
}

View File

@@ -0,0 +1,16 @@
package com.quinn.service;
import com.quinn.pojo.UserMessage;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
* 服务类
* </p>
*
* @author limqsh
* @since 2022-11-08
*/
public interface UserMessageService extends IService<UserMessage> {
}

View File

@@ -0,0 +1,20 @@
package com.quinn.service.impl;
import com.quinn.pojo.TaskList;
import com.quinn.mapper.TaskListMapper;
import com.quinn.service.TaskListService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
* <p>
* 服务实现类
* </p>
*
* @author limqsh
* @since 2022-11-08
*/
@Service
public class TaskListServiceImpl extends ServiceImpl<TaskListMapper, TaskList> implements TaskListService {
}

View File

@@ -0,0 +1,20 @@
package com.quinn.service.impl;
import com.quinn.pojo.UserMessage;
import com.quinn.mapper.UserMessageMapper;
import com.quinn.service.UserMessageService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
* <p>
* 服务实现类
* </p>
*
* @author limqsh
* @since 2022-11-08
*/
@Service
public class UserMessageServiceImpl extends ServiceImpl<UserMessageMapper, UserMessage> implements UserMessageService {
}