完善c端接口
This commit is contained in:
@@ -90,6 +90,17 @@ public class BaseController
|
||||
return rspData;
|
||||
}
|
||||
|
||||
|
||||
protected TableDataInfo getDataTableData(List<?> list)
|
||||
{
|
||||
TableDataInfo rspData = new TableDataInfo();
|
||||
rspData.setCode(HttpStatus.SUCCESS);
|
||||
rspData.setMsg("查询成功");
|
||||
rspData.setData(list);
|
||||
rspData.setTotal(new PageInfo(list).getTotal());
|
||||
return rspData;
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回成功
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,176 @@
|
||||
package com.ruoyi.common.core.domain.entity;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 【请填写功能名称】对象 activity_info
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-07-20
|
||||
*/
|
||||
public class ActivityInfo extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** id */
|
||||
private String id;
|
||||
|
||||
/** 活动名称 */
|
||||
@Excel(name = "活动名称")
|
||||
private String name;
|
||||
|
||||
/** 活动内容:目前只写数字几天vip */
|
||||
@Excel(name = "活动内容:目前只写数字几天vip")
|
||||
private String content;
|
||||
|
||||
/** 活动开始时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "活动开始时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date startTime;
|
||||
|
||||
/** 活动结束时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "活动结束时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date endTime;
|
||||
|
||||
/** 创建人 */
|
||||
@Excel(name = "创建人")
|
||||
private String creator;
|
||||
|
||||
/** 修改人 */
|
||||
@Excel(name = "修改人")
|
||||
private String modify;
|
||||
|
||||
/** 1 上架 2 下架 */
|
||||
@Excel(name = "1 上架 2 下架")
|
||||
private Long shelf;
|
||||
|
||||
/** 1 删除 */
|
||||
@Excel(name = "1 删除")
|
||||
private Long isDel;
|
||||
|
||||
/** 活动图片 */
|
||||
@Excel(name = "活动图片")
|
||||
private String img;
|
||||
|
||||
public void setId(String id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setContent(String content)
|
||||
{
|
||||
this.content = content;
|
||||
}
|
||||
|
||||
public String getContent()
|
||||
{
|
||||
return content;
|
||||
}
|
||||
|
||||
public void setStartTime(Date startTime)
|
||||
{
|
||||
this.startTime = startTime;
|
||||
}
|
||||
|
||||
public Date getStartTime()
|
||||
{
|
||||
return startTime;
|
||||
}
|
||||
|
||||
public void setEndTime(Date endTime)
|
||||
{
|
||||
this.endTime = endTime;
|
||||
}
|
||||
|
||||
public Date getEndTime()
|
||||
{
|
||||
return endTime;
|
||||
}
|
||||
|
||||
public void setCreator(String creator)
|
||||
{
|
||||
this.creator = creator;
|
||||
}
|
||||
|
||||
public String getCreator()
|
||||
{
|
||||
return creator;
|
||||
}
|
||||
|
||||
public void setModify(String modify)
|
||||
{
|
||||
this.modify = modify;
|
||||
}
|
||||
|
||||
public String getModify()
|
||||
{
|
||||
return modify;
|
||||
}
|
||||
|
||||
public void setShelf(Long shelf)
|
||||
{
|
||||
this.shelf = shelf;
|
||||
}
|
||||
|
||||
public Long getShelf()
|
||||
{
|
||||
return shelf;
|
||||
}
|
||||
|
||||
public void setIsDel(Long isDel)
|
||||
{
|
||||
this.isDel = isDel;
|
||||
}
|
||||
|
||||
public Long getIsDel()
|
||||
{
|
||||
return isDel;
|
||||
}
|
||||
|
||||
public void setImg(String img)
|
||||
{
|
||||
this.img = img;
|
||||
}
|
||||
|
||||
public String getImg()
|
||||
{
|
||||
return img;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("name", getName())
|
||||
.append("content", getContent())
|
||||
.append("startTime", getStartTime())
|
||||
.append("endTime", getEndTime())
|
||||
.append("creator", getCreator())
|
||||
.append("modify", getModify())
|
||||
.append("shelf", getShelf())
|
||||
.append("isDel", getIsDel())
|
||||
.append("img", getImg())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.ruoyi.common.core.domain.entity;
|
||||
|
||||
import lombok.Data;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
@@ -8,9 +9,9 @@ import com.ruoyi.common.core.domain.BaseEntity;
|
||||
/**
|
||||
* 【请填写功能名称】对象 category_info
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2025-07-15
|
||||
*/
|
||||
@Data
|
||||
public class CategoryInfo extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
@@ -38,77 +39,5 @@ public class CategoryInfo extends BaseEntity
|
||||
@Excel(name = "修改人")
|
||||
private String modify;
|
||||
|
||||
public void setId(String id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setCategoryId(Long categoryId)
|
||||
{
|
||||
this.categoryId = categoryId;
|
||||
}
|
||||
|
||||
public Long getCategoryId()
|
||||
{
|
||||
return categoryId;
|
||||
}
|
||||
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setIsDel(Long isDel)
|
||||
{
|
||||
this.isDel = isDel;
|
||||
}
|
||||
|
||||
public Long getIsDel()
|
||||
{
|
||||
return isDel;
|
||||
}
|
||||
|
||||
public void setCreator(String creator)
|
||||
{
|
||||
this.creator = creator;
|
||||
}
|
||||
|
||||
public String getCreator()
|
||||
{
|
||||
return creator;
|
||||
}
|
||||
|
||||
public void setModify(String modify)
|
||||
{
|
||||
this.modify = modify;
|
||||
}
|
||||
|
||||
public String getModify()
|
||||
{
|
||||
return modify;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("categoryId", getCategoryId())
|
||||
.append("name", getName())
|
||||
.append("isDel", getIsDel())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("creator", getCreator())
|
||||
.append("modify", getModify())
|
||||
.toString();
|
||||
}
|
||||
private String backImg;
|
||||
}
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
package com.ruoyi.common.core.domain.entity;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 音乐信息对象 music_info
|
||||
@@ -11,6 +10,7 @@ import com.ruoyi.common.core.domain.BaseEntity;
|
||||
* @author ruoyi
|
||||
* @date 2025-07-15
|
||||
*/
|
||||
@Data
|
||||
public class MusicInfo extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
@@ -66,154 +66,10 @@ public class MusicInfo extends BaseEntity
|
||||
@Excel(name = "标签")
|
||||
private String label;
|
||||
|
||||
public void setId(String id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
private boolean like;
|
||||
|
||||
public String getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
private boolean collect;
|
||||
|
||||
public void setMusicId(Long musicId)
|
||||
{
|
||||
this.musicId = musicId;
|
||||
}
|
||||
private UserCollect userCollect;
|
||||
|
||||
public Long getMusicId()
|
||||
{
|
||||
return musicId;
|
||||
}
|
||||
|
||||
public void setName(String name)
|
||||
{
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setAuthor(String author)
|
||||
{
|
||||
this.author = author;
|
||||
}
|
||||
|
||||
public String getAuthor()
|
||||
{
|
||||
return author;
|
||||
}
|
||||
|
||||
public void setVip(Long vip)
|
||||
{
|
||||
this.vip = vip;
|
||||
}
|
||||
|
||||
public Long getVip()
|
||||
{
|
||||
return vip;
|
||||
}
|
||||
|
||||
public void setShelf(Long shelf)
|
||||
{
|
||||
this.shelf = shelf;
|
||||
}
|
||||
|
||||
public Long getShelf()
|
||||
{
|
||||
return shelf;
|
||||
}
|
||||
|
||||
public void setImgAddr(String imgAddr)
|
||||
{
|
||||
this.imgAddr = imgAddr;
|
||||
}
|
||||
|
||||
public String getImgAddr()
|
||||
{
|
||||
return imgAddr;
|
||||
}
|
||||
|
||||
public void setMusicAddr(String musicAddr)
|
||||
{
|
||||
this.musicAddr = musicAddr;
|
||||
}
|
||||
|
||||
public String getMusicAddr()
|
||||
{
|
||||
return musicAddr;
|
||||
}
|
||||
|
||||
public void setMusicType(String musicType)
|
||||
{
|
||||
this.musicType = musicType;
|
||||
}
|
||||
|
||||
public String getMusicType()
|
||||
{
|
||||
return musicType;
|
||||
}
|
||||
|
||||
public void setCreator(String creator)
|
||||
{
|
||||
this.creator = creator;
|
||||
}
|
||||
|
||||
public String getCreator()
|
||||
{
|
||||
return creator;
|
||||
}
|
||||
|
||||
public void setModify(String modify)
|
||||
{
|
||||
this.modify = modify;
|
||||
}
|
||||
|
||||
public String getModify()
|
||||
{
|
||||
return modify;
|
||||
}
|
||||
|
||||
public void setIsDel(Long isDel)
|
||||
{
|
||||
this.isDel = isDel;
|
||||
}
|
||||
|
||||
public Long getIsDel()
|
||||
{
|
||||
return isDel;
|
||||
}
|
||||
|
||||
public void setLabel(String label)
|
||||
{
|
||||
this.label = label;
|
||||
}
|
||||
|
||||
public String getLabel()
|
||||
{
|
||||
return label;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("musicId", getMusicId())
|
||||
.append("name", getName())
|
||||
.append("author", getAuthor())
|
||||
.append("vip", getVip())
|
||||
.append("shelf", getShelf())
|
||||
.append("imgAddr", getImgAddr())
|
||||
.append("musicAddr", getMusicAddr())
|
||||
.append("musicType", getMusicType())
|
||||
.append("creator", getCreator())
|
||||
.append("modify", getModify())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("isDel", getIsDel())
|
||||
.append("label", getLabel())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ public class ShopUser {
|
||||
private Long sex;
|
||||
|
||||
/** 生日 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "生日", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date birthday;
|
||||
|
||||
@@ -60,7 +60,7 @@ public class ShopUser {
|
||||
private String addr;
|
||||
|
||||
/** 注册时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "注册时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date registerTime;
|
||||
|
||||
@@ -85,4 +85,10 @@ public class ShopUser {
|
||||
private String deviceId;
|
||||
|
||||
private String headImg;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date vipStartTime;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date vipEndTime;
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ public class UserCollect extends BaseEntity
|
||||
private Long userId;
|
||||
|
||||
/** 音乐id */
|
||||
@Excel(name = "音乐id")
|
||||
@Excel(name = "收藏")
|
||||
private Long collectId;
|
||||
|
||||
/** 收藏名称 */
|
||||
|
||||
@@ -18,6 +18,8 @@ public class TableDataInfo implements Serializable
|
||||
/** 列表数据 */
|
||||
private List<?> rows;
|
||||
|
||||
private List<?> data;
|
||||
|
||||
/** 消息状态码 */
|
||||
private int code;
|
||||
|
||||
@@ -63,6 +65,18 @@ public class TableDataInfo implements Serializable
|
||||
this.rows = rows;
|
||||
}
|
||||
|
||||
|
||||
public List<?> getData()
|
||||
{
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setData(List<?> rows)
|
||||
{
|
||||
this.data = rows;
|
||||
}
|
||||
|
||||
|
||||
public int getCode()
|
||||
{
|
||||
return code;
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.ruoyi.common.utils;
|
||||
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
|
||||
public class MusicUtil {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获取当前时间 n 天后的日期
|
||||
* @param n 天数(正数表示未来,负数表示过去)
|
||||
* @return n 天后的 Date 对象
|
||||
*/
|
||||
public static Date getDateAfterNDays(int n) {
|
||||
Calendar calendar = Calendar.getInstance(); // 获取当前时间
|
||||
calendar.add(Calendar.DAY_OF_YEAR, n); // 增加或减少天数
|
||||
return calendar.getTime(); // 返回计算后的 Date
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
System.out.println(getDateAfterNDays(1));;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user