From 277332d4102d9e05befd2fea63ce629291f8222d Mon Sep 17 00:00:00 2001 From: wsw Date: Sat, 29 Jul 2023 13:41:47 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AD=A6=E5=91=98=E8=AF=BE=E7=A8=8B=E9=99=84?= =?UTF-8?q?=E4=BB=B6=E5=88=97=E8=A1=A8=E6=9F=A5=E8=AF=A2=E3=80=81=E4=B8=8B?= =?UTF-8?q?=E8=BD=BD=E6=97=A5=E5=BF=97=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- databases/v1.2.sql | 12 ++ ...CourseAttachmentDownloadLogController.java | 70 +++++++++ .../controller/backend/CourseController.java | 14 +- ...CourseAttachmentDownloadLogController.java | 60 ++++++++ .../controller/frontend/CourseController.java | 40 +++--- .../playedu/api/domain/CourseAttachment.java | 1 + .../domain/CourseAttachmentDownloadLog.java | 134 ++++++++++++++++++ .../CourseAttachmentDownloadLogMapper.java | 31 ++++ .../CourseAttachmentDownloadLogService.java | 29 ++++ ...ourseAttachmentDownloadLogServiceImpl.java | 40 ++++++ ...rseAttachmentDownloadLogPaginateFiler.java | 40 ++++++ .../CourseAttachmentDownloadLogMapper.xml | 89 ++++++++++++ 12 files changed, 532 insertions(+), 28 deletions(-) create mode 100644 src/main/java/xyz/playedu/api/controller/backend/CourseAttachmentDownloadLogController.java create mode 100644 src/main/java/xyz/playedu/api/controller/frontend/CourseAttachmentDownloadLogController.java create mode 100644 src/main/java/xyz/playedu/api/domain/CourseAttachmentDownloadLog.java create mode 100644 src/main/java/xyz/playedu/api/mapper/CourseAttachmentDownloadLogMapper.java create mode 100644 src/main/java/xyz/playedu/api/service/CourseAttachmentDownloadLogService.java create mode 100644 src/main/java/xyz/playedu/api/service/impl/CourseAttachmentDownloadLogServiceImpl.java create mode 100644 src/main/java/xyz/playedu/api/types/paginate/CourseAttachmentDownloadLogPaginateFiler.java create mode 100644 src/main/resources/mapper/CourseAttachmentDownloadLogMapper.xml diff --git a/databases/v1.2.sql b/databases/v1.2.sql index 21429ea..7521345 100644 --- a/databases/v1.2.sql +++ b/databases/v1.2.sql @@ -30,4 +30,16 @@ CREATE TABLE `course_attachment` ( `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`id`), KEY `course_id` (`course_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; + +CREATE TABLE `course_attachment_download_log` ( + `id` int(11) unsigned NOT NULL AUTO_INCREMENT, + `user_id` int(11) NOT NULL DEFAULT '0' COMMENT '学员ID', + `course_id` int(11) NOT NULL DEFAULT '0' COMMENT '课程ID', + `title` varchar(255) NOT NULL DEFAULT '' COMMENT '课程标题', + `courser_attachment_id` int(11) NOT NULL DEFAULT '0' COMMENT '课程附件id', + `rid` int(11) NOT NULL DEFAULT '0' COMMENT '资源id', + `ip` varchar(45) NOT NULL DEFAULT '' COMMENT '下载ip', + `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; \ No newline at end of file diff --git a/src/main/java/xyz/playedu/api/controller/backend/CourseAttachmentDownloadLogController.java b/src/main/java/xyz/playedu/api/controller/backend/CourseAttachmentDownloadLogController.java new file mode 100644 index 0000000..f4abfef --- /dev/null +++ b/src/main/java/xyz/playedu/api/controller/backend/CourseAttachmentDownloadLogController.java @@ -0,0 +1,70 @@ +/* + * Copyright (C) 2023 杭州白书科技有限公司 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package xyz.playedu.api.controller.backend; + +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.MapUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import xyz.playedu.api.annotation.Log; +import xyz.playedu.api.constant.BusinessType; +import xyz.playedu.api.domain.*; +import xyz.playedu.api.service.*; +import xyz.playedu.api.types.JsonResponse; +import xyz.playedu.api.types.paginate.CourseAttachmentDownloadLogPaginateFiler; +import xyz.playedu.api.types.paginate.PaginationResult; + +import java.util.*; + +@RestController +@Slf4j +@RequestMapping("/backend/v1/course/attachment/download/log") +public class CourseAttachmentDownloadLogController { + + @Autowired private CourseAttachmentDownloadLogService courseAttachmentDownloadLogService; + + @GetMapping("/index") + @Log(title = "学员下载课件记录-列表", businessType = BusinessType.GET) + public JsonResponse index(@RequestParam HashMap params) { + Integer page = MapUtils.getInteger(params, "page", 1); + Integer size = MapUtils.getInteger(params, "size", 10); + String sortField = MapUtils.getString(params, "sort_field"); + String sortAlgo = MapUtils.getString(params, "sort_algo"); + + Integer userId = MapUtils.getInteger(params, "user_id"); + Integer courseId = MapUtils.getInteger(params, "course_id"); + String title = MapUtils.getString(params, "title"); + Integer courserAttachmentId = MapUtils.getInteger(params, "courser_attachment_id"); + Integer rid = MapUtils.getInteger(params, "rid"); + + CourseAttachmentDownloadLogPaginateFiler filter = new CourseAttachmentDownloadLogPaginateFiler(); + filter.setUserId(userId); + filter.setCourseId(courseId); + filter.setTitle(title); + filter.setCourserAttachmentId(courserAttachmentId); + filter.setRid(rid); + filter.setSortField(sortField); + filter.setSortAlgo(sortAlgo); + + PaginationResult result = courseAttachmentDownloadLogService.paginate(page, size, filter); + + HashMap data = new HashMap<>(); + data.put("data", result.getData()); + data.put("total", result.getTotal()); + + return JsonResponse.data(data); + } +} diff --git a/src/main/java/xyz/playedu/api/controller/backend/CourseController.java b/src/main/java/xyz/playedu/api/controller/backend/CourseController.java index 1a4fad3..f24d116 100644 --- a/src/main/java/xyz/playedu/api/controller/backend/CourseController.java +++ b/src/main/java/xyz/playedu/api/controller/backend/CourseController.java @@ -201,7 +201,7 @@ public class CourseController { } // 课程附件 - if (req.getAttachments().size() > 0) { + if (null != req.getAttachments() && req.getAttachments().size() > 0) { List insertAttachments = new ArrayList<>(); final Integer[] sort = {0}; for (CourseRequest.AttachmentItem attachmentItem : req.getAttachments()) { @@ -235,11 +235,13 @@ public class CourseController { List chapters = chapterService.getChaptersByCourseId(course.getId()); List hours = hourService.getHoursByCourseId(course.getId()); List attachments = attachmentService.getAttachmentsByCourseId(course.getId()); - Map resourceMap = resourceService.chunks(attachments.stream().map(CourseAttachment::getRid).toList()) - .stream().collect(Collectors.toMap(Resource::getId, Resource::getUrl)); - attachments.forEach(courseAttachment -> { - courseAttachment.setUrl(resourceMap.get(courseAttachment.getRid())); - }); + if(null != attachments && attachments.size() > 0){ + Map resourceMap = resourceService.chunks(attachments.stream().map(CourseAttachment::getRid).toList()) + .stream().collect(Collectors.toMap(Resource::getId, Resource::getUrl)); + attachments.forEach(courseAttachment -> { + courseAttachment.setUrl(resourceMap.get(courseAttachment.getRid())); + }); + } HashMap data = new HashMap<>(); data.put("course", course); diff --git a/src/main/java/xyz/playedu/api/controller/frontend/CourseAttachmentDownloadLogController.java b/src/main/java/xyz/playedu/api/controller/frontend/CourseAttachmentDownloadLogController.java new file mode 100644 index 0000000..6ffabb9 --- /dev/null +++ b/src/main/java/xyz/playedu/api/controller/frontend/CourseAttachmentDownloadLogController.java @@ -0,0 +1,60 @@ +/* + * Copyright (C) 2023 杭州白书科技有限公司 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package xyz.playedu.api.controller.frontend; + +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import xyz.playedu.api.FCtx; +import xyz.playedu.api.domain.*; +import xyz.playedu.api.exception.NotFoundException; +import xyz.playedu.api.service.*; +import xyz.playedu.api.types.JsonResponse; +import xyz.playedu.api.util.IpUtil; + +import java.util.Date; + +@RestController +@Slf4j +@RequestMapping("/api/v1/course/{courseId}/attachment/{attachmentId}/resource") +public class CourseAttachmentDownloadLogController { + + @Autowired private CourseService courseService; + + @Autowired private CourseAttachmentDownloadLogService courseAttachmentDownloadLogService; + + @PostMapping("/{id}") + public JsonResponse store(@PathVariable(name = "courseId") Integer courseId, + @PathVariable(name = "attachmentId") Integer attachmentId, + @PathVariable(name = "id") Integer id) throws NotFoundException { + Course course = courseService.findOrFail(courseId); + + CourseAttachmentDownloadLog courseAttachmentDownloadLog = + new CourseAttachmentDownloadLog() { + { + setUserId(FCtx.getId()); + setCourseId(course.getId()); + setTitle(course.getTitle()); + setCourserAttachmentId(attachmentId); + setRid(id); + setIp(IpUtil.getIpAddress()); + setCreatedAt(new Date()); + } + }; + courseAttachmentDownloadLogService.save(courseAttachmentDownloadLog); + return JsonResponse.success(); + } +} diff --git a/src/main/java/xyz/playedu/api/controller/frontend/CourseController.java b/src/main/java/xyz/playedu/api/controller/frontend/CourseController.java index e13e2c6..83232f4 100644 --- a/src/main/java/xyz/playedu/api/controller/frontend/CourseController.java +++ b/src/main/java/xyz/playedu/api/controller/frontend/CourseController.java @@ -22,10 +22,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import xyz.playedu.api.FCtx; -import xyz.playedu.api.constant.BackendConstant; -import xyz.playedu.api.domain.Course; -import xyz.playedu.api.domain.CourseHour; -import xyz.playedu.api.domain.UserCourseHourRecord; +import xyz.playedu.api.domain.*; import xyz.playedu.api.service.*; import xyz.playedu.api.types.JsonResponse; import xyz.playedu.api.types.paginate.CoursePaginateFiler; @@ -33,6 +30,7 @@ import xyz.playedu.api.types.paginate.PaginationResult; import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.stream.Collectors; /** @@ -50,6 +48,10 @@ public class CourseController { @Autowired private CourseHourService hourService; + @Autowired private CourseAttachmentService attachmentService; + + @Autowired private ResourceService resourceService; + @Autowired private UserCourseRecordService userCourseRecordService; @Autowired private UserCourseHourRecordService userCourseHourRecordService; @@ -76,30 +78,24 @@ public class CourseController { List courseHours = hourService.getHoursByCourseId(course.getId()); + List attachments = attachmentService.getAttachmentsByCourseId(course.getId()); + if(null != attachments && attachments.size() > 0){ + Map resourceMap = resourceService.chunks(attachments.stream().map(CourseAttachment::getRid).toList()) + .stream().collect(Collectors.toMap(Resource::getId, Resource::getUrl)); + attachments.forEach(courseAttachment -> { + courseAttachment.setUrl(resourceMap.get(courseAttachment.getRid())); + }); + } + HashMap data = new HashMap<>(); data.put("course", course); data.put("chapters", chapterService.getChaptersByCourseId(course.getId())); - data.put( - "hours", - courseHours.stream() - .filter( - courseHour -> - BackendConstant.RESOURCE_TYPE_VIDEO.equals( - courseHour.getType())) - .collect(Collectors.groupingBy(CourseHour::getChapterId))); + data.put("hours", courseHours.stream().collect(Collectors.groupingBy(CourseHour::getChapterId))); data.put("learn_record", userCourseRecordService.find(FCtx.getId(), course.getId())); - data.put( - "learn_hour_records", + data.put("learn_hour_records", userCourseHourRecordService.getRecords(FCtx.getId(), course.getId()).stream() .collect(Collectors.toMap(UserCourseHourRecord::getHourId, e -> e))); - data.put( - "attachments", - courseHours.stream() - .filter( - courseHour -> - BackendConstant.RESOURCE_TYPE_ATTACHMENT.contains( - courseHour.getType())) - .collect(Collectors.groupingBy(CourseHour::getChapterId))); + data.put("attachments", attachments); return JsonResponse.data(data); } } diff --git a/src/main/java/xyz/playedu/api/domain/CourseAttachment.java b/src/main/java/xyz/playedu/api/domain/CourseAttachment.java index 8afd208..b9fce75 100644 --- a/src/main/java/xyz/playedu/api/domain/CourseAttachment.java +++ b/src/main/java/xyz/playedu/api/domain/CourseAttachment.java @@ -54,6 +54,7 @@ public class CourseAttachment implements Serializable { private Integer rid; /** 资源url */ + @TableField(exist = false) private String url; /** */ diff --git a/src/main/java/xyz/playedu/api/domain/CourseAttachmentDownloadLog.java b/src/main/java/xyz/playedu/api/domain/CourseAttachmentDownloadLog.java new file mode 100644 index 0000000..7e29407 --- /dev/null +++ b/src/main/java/xyz/playedu/api/domain/CourseAttachmentDownloadLog.java @@ -0,0 +1,134 @@ +/* + * Copyright (C) 2023 杭州白书科技有限公司 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package xyz.playedu.api.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 com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * @TableName course_attachment_download_log + */ +@TableName(value = "course_attachment_download_log") +@Data +public class CourseAttachmentDownloadLog implements Serializable { + /** */ + @TableId(type = IdType.AUTO) + private Long id; + + /** 学员ID */ + @JsonProperty("user_id") + private Integer userId; + + /** 课程ID */ + @JsonProperty("course_id") + private Integer courseId; + + /** 标题 */ + private String title; + + /** 课程附件ID */ + @JsonProperty("courser_attachment_id") + private Integer courserAttachmentId; + + /** 资源ID */ + private Integer rid; + + /** IP */ + private String ip; + + @JsonProperty("created_at") + private Date createdAt; + + @TableField(exist = false) + private static final long serialVersionUID = 1L; + + @Override + public boolean equals(Object that) { + if (this == that) { + return true; + } + if (that == null) { + return false; + } + if (getClass() != that.getClass()) { + return false; + } + CourseAttachmentDownloadLog other = (CourseAttachmentDownloadLog) that; + return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId())) + && (this.getUserId() == null + ? other.getUserId() == null + : this.getUserId().equals(other.getUserId())) + && (this.getCourseId() == null + ? other.getCourseId() == null + : this.getCourseId().equals(other.getCourseId())) + && (this.getTitle() == null + ? other.getTitle() == null + : this.getTitle().equals(other.getTitle())) + && (this.getCourserAttachmentId() == null + ? other.getCourserAttachmentId() == null + : this.getCourserAttachmentId().equals(other.getCourserAttachmentId())) + && (this.getRid() == null + ? other.getRid() == null + : this.getRid().equals(other.getRid())) + && (this.getIp() == null + ? other.getIp() == null + : this.getIp().equals(other.getIp())) + && (this.getCreatedAt() == null + ? other.getCreatedAt() == null + : this.getCreatedAt().equals(other.getCreatedAt())); + } + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((getId() == null) ? 0 : getId().hashCode()); + result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode()); + result = prime * result + ((getCourseId() == null) ? 0 : getCourseId().hashCode()); + result = prime * result + ((getTitle() == null) ? 0 : getTitle().hashCode()); + result = prime * result + ((getCourserAttachmentId() == null) ? 0 : getCourserAttachmentId().hashCode()); + result = prime * result + ((getRid() == null) ? 0 : getRid().hashCode()); + result = prime * result + ((getIp() == null) ? 0 : getIp().hashCode()); + result = prime * result + ((getCreatedAt() == null) ? 0 : getCreatedAt().hashCode()); + return result; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getClass().getSimpleName()); + sb.append(" ["); + sb.append("Hash = ").append(hashCode()); + sb.append(", id=").append(id); + sb.append(", userId=").append(userId); + sb.append(", courseId=").append(courseId); + sb.append(", title=").append(title); + sb.append(", courserAttachmentId=").append(courserAttachmentId); + sb.append(", rid=").append(rid); + sb.append(", ip=").append(ip); + sb.append(", createdAt=").append(createdAt); + sb.append(", serialVersionUID=").append(serialVersionUID); + sb.append("]"); + return sb.toString(); + } +} diff --git a/src/main/java/xyz/playedu/api/mapper/CourseAttachmentDownloadLogMapper.java b/src/main/java/xyz/playedu/api/mapper/CourseAttachmentDownloadLogMapper.java new file mode 100644 index 0000000..2df8901 --- /dev/null +++ b/src/main/java/xyz/playedu/api/mapper/CourseAttachmentDownloadLogMapper.java @@ -0,0 +1,31 @@ +/* + * Copyright (C) 2023 杭州白书科技有限公司 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package xyz.playedu.api.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; +import xyz.playedu.api.domain.CourseAttachmentDownloadLog; +import xyz.playedu.api.types.paginate.CourseAttachmentDownloadLogPaginateFiler; + +import java.util.List; + +@Mapper +public interface CourseAttachmentDownloadLogMapper extends BaseMapper { + + List paginate(CourseAttachmentDownloadLogPaginateFiler filer); + + Long paginateCount(CourseAttachmentDownloadLogPaginateFiler filer); +} diff --git a/src/main/java/xyz/playedu/api/service/CourseAttachmentDownloadLogService.java b/src/main/java/xyz/playedu/api/service/CourseAttachmentDownloadLogService.java new file mode 100644 index 0000000..0a8e67e --- /dev/null +++ b/src/main/java/xyz/playedu/api/service/CourseAttachmentDownloadLogService.java @@ -0,0 +1,29 @@ +/* + * Copyright (C) 2023 杭州白书科技有限公司 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package xyz.playedu.api.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import org.springframework.stereotype.Service; +import xyz.playedu.api.domain.CourseAttachmentDownloadLog; +import xyz.playedu.api.types.paginate.CourseAttachmentDownloadLogPaginateFiler; +import xyz.playedu.api.types.paginate.PaginationResult; + +@Service +public interface CourseAttachmentDownloadLogService extends IService { + PaginationResult paginate(int page, int size, CourseAttachmentDownloadLogPaginateFiler filter); + + +} diff --git a/src/main/java/xyz/playedu/api/service/impl/CourseAttachmentDownloadLogServiceImpl.java b/src/main/java/xyz/playedu/api/service/impl/CourseAttachmentDownloadLogServiceImpl.java new file mode 100644 index 0000000..c9163d4 --- /dev/null +++ b/src/main/java/xyz/playedu/api/service/impl/CourseAttachmentDownloadLogServiceImpl.java @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2023 杭州白书科技有限公司 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package xyz.playedu.api.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; +import xyz.playedu.api.domain.CourseAttachmentDownloadLog; +import xyz.playedu.api.mapper.CourseAttachmentDownloadLogMapper; +import xyz.playedu.api.service.CourseAttachmentDownloadLogService; +import xyz.playedu.api.types.paginate.CourseAttachmentDownloadLogPaginateFiler; +import xyz.playedu.api.types.paginate.PaginationResult; + +@Service +public class CourseAttachmentDownloadLogServiceImpl extends ServiceImpl + implements CourseAttachmentDownloadLogService { + @Override + public PaginationResult paginate(int page, int size, CourseAttachmentDownloadLogPaginateFiler filter) { + filter.setPageStart((page - 1) * size); + filter.setPageSize(size); + + PaginationResult pageResult = new PaginationResult<>(); + pageResult.setData(getBaseMapper().paginate(filter)); + pageResult.setTotal(getBaseMapper().paginateCount(filter)); + + return pageResult; + } +} diff --git a/src/main/java/xyz/playedu/api/types/paginate/CourseAttachmentDownloadLogPaginateFiler.java b/src/main/java/xyz/playedu/api/types/paginate/CourseAttachmentDownloadLogPaginateFiler.java new file mode 100644 index 0000000..093448d --- /dev/null +++ b/src/main/java/xyz/playedu/api/types/paginate/CourseAttachmentDownloadLogPaginateFiler.java @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2023 杭州白书科技有限公司 + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package xyz.playedu.api.types.paginate; + +import lombok.Data; + +@Data +public class CourseAttachmentDownloadLogPaginateFiler { + + private Integer userId; + + private Integer courseId; + + private String title; + + private Integer courserAttachmentId; + + private Integer rid; + + private String sortField; + + private String sortAlgo; + + private Integer pageStart; + + private Integer pageSize; +} diff --git a/src/main/resources/mapper/CourseAttachmentDownloadLogMapper.xml b/src/main/resources/mapper/CourseAttachmentDownloadLogMapper.xml new file mode 100644 index 0000000..2bb841a --- /dev/null +++ b/src/main/resources/mapper/CourseAttachmentDownloadLogMapper.xml @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + id,user_id,course_id,title, + courser_attachment_id,rid, + ip,created_at + + + + + +