parent
90201ce300
commit
fef6a5762e
9 changed files with 241 additions and 0 deletions
@ -0,0 +1,32 @@ |
||||
package com.teaching.backend.common; |
||||
|
||||
|
||||
import com.teaching.backend.constant.CommonConstant; |
||||
import lombok.Data; |
||||
|
||||
/** |
||||
* 分页请求 |
||||
*/ |
||||
@Data |
||||
public class PageRequest { |
||||
|
||||
/** |
||||
* 当前页号 |
||||
*/ |
||||
private int current = 1; |
||||
|
||||
/** |
||||
* 页面大小 |
||||
*/ |
||||
private int pageSize = 10; |
||||
|
||||
/** |
||||
* 排序字段 |
||||
*/ |
||||
private String sortField; |
||||
|
||||
/** |
||||
* 排序顺序(默认升序) |
||||
*/ |
||||
private String sortOrder = CommonConstant.SORT_ORDER_ASC; |
||||
} |
@ -0,0 +1,18 @@ |
||||
package com.teaching.backend.constant; |
||||
|
||||
/** |
||||
* 通用常量 |
||||
*/ |
||||
public interface CommonConstant { |
||||
|
||||
/** |
||||
* 升序 |
||||
*/ |
||||
String SORT_ORDER_ASC = "ascend"; |
||||
|
||||
/** |
||||
* 降序 |
||||
*/ |
||||
String SORT_ORDER_DESC = " descend"; |
||||
|
||||
} |
@ -0,0 +1,22 @@ |
||||
package com.teaching.backend.model.dto.favour.courseFavour; |
||||
|
||||
import com.teaching.backend.common.PageRequest; |
||||
import com.teaching.backend.constant.CommonConstant; |
||||
import lombok.Data; |
||||
|
||||
import java.io.Serializable; |
||||
|
||||
/** |
||||
* 课程点赞请求 |
||||
*/ |
||||
@Data |
||||
public class CourseFavourQueryRequest extends PageRequest implements Serializable { |
||||
|
||||
/** |
||||
* 用户 id |
||||
*/ |
||||
private String userId; |
||||
|
||||
|
||||
private static final long serialVersionUID = 1L; |
||||
} |
@ -0,0 +1,72 @@ |
||||
package com.teaching.backend.model.vo.favour; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import com.teaching.backend.model.entity.courses.Courses; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.Data; |
||||
import org.springframework.beans.BeanUtils; |
||||
|
||||
import java.math.BigDecimal; |
||||
|
||||
/** |
||||
* @Author:youhang |
||||
* @Date:2024-06-03-11:18 |
||||
* @Description: |
||||
*/ |
||||
@TableName(value = "courses") |
||||
@Data |
||||
public class CourseFavourDetailVO { |
||||
|
||||
/** |
||||
* 内部编号 |
||||
*/ |
||||
private String id; |
||||
|
||||
/** |
||||
* 课程封面 |
||||
*/ |
||||
private String img; |
||||
|
||||
|
||||
/** |
||||
* 课程名称 |
||||
*/ |
||||
private String name; |
||||
|
||||
/** |
||||
* 教师id |
||||
*/ |
||||
@ApiModelProperty("教师id") |
||||
private String teacher; |
||||
|
||||
|
||||
/** |
||||
* 课程学分 |
||||
*/ |
||||
@ApiModelProperty(value = "课程学分", required = true) |
||||
private BigDecimal credit; |
||||
|
||||
/** |
||||
* 课程学时 |
||||
*/ |
||||
@ApiModelProperty(value = "课程学时", required = true) |
||||
private Integer classhours; |
||||
|
||||
|
||||
/** |
||||
* 对象转包装类 |
||||
* |
||||
* @param course |
||||
* @return |
||||
*/ |
||||
public static CourseFavourDetailVO objToVo(Courses course) { |
||||
if (course == null) { |
||||
return null; |
||||
} |
||||
CourseFavourDetailVO courseFavourDetailVO = new CourseFavourDetailVO(); |
||||
BeanUtils.copyProperties(course, courseFavourDetailVO); |
||||
return courseFavourDetailVO; |
||||
} |
||||
|
||||
|
||||
} |
Loading…
Reference in new issue