完善c端接口
This commit is contained in:
@@ -20,15 +20,41 @@ public class AliKeyConfig implements InitializingBean {
|
||||
@Value("${ali.accessKeySecret}")
|
||||
public String accessKeySecret;
|
||||
|
||||
@Value("${umApp.appAliKey}")
|
||||
public String umAppAliKey;
|
||||
|
||||
@Value("${umApp.appAliSecret}")
|
||||
public String umAppAliSecret;
|
||||
|
||||
|
||||
@Value("${umApp.androidKey}")
|
||||
public String umAppAndroidKey;
|
||||
|
||||
@Value("${umApp.IOSKey}")
|
||||
public String umAppIOSKey;
|
||||
|
||||
|
||||
// 终端ID
|
||||
public static String ACCESS_KEY_ID;
|
||||
|
||||
public static String ACCESS_KEY_SECRET;
|
||||
|
||||
public static String UMApp_Android_Key;
|
||||
|
||||
public static String UMApp_IOS_Key;
|
||||
|
||||
public static String UMApp_AliKey;
|
||||
|
||||
public static String UMApp_AliSecret;
|
||||
|
||||
@Override
|
||||
public void afterPropertiesSet() {
|
||||
ACCESS_KEY_ID = this.accessKeyId;
|
||||
ACCESS_KEY_SECRET = this.accessKeySecret;
|
||||
UMApp_Android_Key = this.umAppAndroidKey;
|
||||
UMApp_IOS_Key = this.umAppIOSKey;
|
||||
UMApp_AliKey = this.umAppAliKey;
|
||||
UMApp_AliSecret = this.umAppAliSecret;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -91,4 +91,8 @@ public class HttpStatus
|
||||
* 系统警告消息
|
||||
*/
|
||||
public static final int WARN = 601;
|
||||
|
||||
|
||||
// 用户过期或未开通VIP
|
||||
public static final int USER_VIP_EXPIRE = 801;
|
||||
}
|
||||
|
||||
@@ -72,4 +72,6 @@ public class MusicInfo extends BaseEntity
|
||||
|
||||
private UserCollect userCollect;
|
||||
|
||||
private MusicSceneRelate musicScene;
|
||||
|
||||
}
|
||||
|
||||
@@ -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_scene
|
||||
@@ -11,6 +10,7 @@ import com.ruoyi.common.core.domain.BaseEntity;
|
||||
* @author ruoyi
|
||||
* @date 2025-07-15
|
||||
*/
|
||||
@Data
|
||||
public class MusicScene extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
@@ -30,6 +30,10 @@ public class MusicScene extends BaseEntity
|
||||
@Excel(name = "音乐地址")
|
||||
private String musicAddr;
|
||||
|
||||
/** 音乐地址 */
|
||||
@Excel(name = "图片地址")
|
||||
private String imgAddr;
|
||||
|
||||
/** 创建人 */
|
||||
@Excel(name = "创建人")
|
||||
private String creator;
|
||||
@@ -42,88 +46,5 @@ public class MusicScene extends BaseEntity
|
||||
@Excel(name = "1删除")
|
||||
private Long isDel;
|
||||
|
||||
public void setId(String id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setSceneId(Long sceneId)
|
||||
{
|
||||
this.sceneId = sceneId;
|
||||
}
|
||||
|
||||
public Long getSceneId()
|
||||
{
|
||||
return sceneId;
|
||||
}
|
||||
|
||||
public void setScene(String scene)
|
||||
{
|
||||
this.scene = scene;
|
||||
}
|
||||
|
||||
public String getScene()
|
||||
{
|
||||
return scene;
|
||||
}
|
||||
|
||||
public void setMusicAddr(String musicAddr)
|
||||
{
|
||||
this.musicAddr = musicAddr;
|
||||
}
|
||||
|
||||
public String getMusicAddr()
|
||||
{
|
||||
return musicAddr;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("sceneId", getSceneId())
|
||||
.append("scene", getScene())
|
||||
.append("musicAddr", getMusicAddr())
|
||||
.append("creator", getCreator())
|
||||
.append("modify", getModify())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("isDel", getIsDel())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
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;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 【请填写功能名称】对象 music_scene_relate
|
||||
@@ -11,6 +12,7 @@ import com.ruoyi.common.core.domain.BaseEntity;
|
||||
* @author ruoyi
|
||||
* @date 2025-07-15
|
||||
*/
|
||||
@Data
|
||||
public class MusicSceneRelate extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
@@ -20,48 +22,17 @@ public class MusicSceneRelate extends BaseEntity
|
||||
|
||||
/** 音乐id */
|
||||
@Excel(name = "音乐id")
|
||||
private Long musicId;
|
||||
private String musicId;
|
||||
|
||||
/** 场景id */
|
||||
@Excel(name = "场景id")
|
||||
private Long sceneId;
|
||||
private String sceneIds;
|
||||
|
||||
public void setId(String id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
private Long userId;
|
||||
|
||||
public String getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
private String sceneInfo;
|
||||
|
||||
public void setMusicId(Long musicId)
|
||||
{
|
||||
this.musicId = musicId;
|
||||
}
|
||||
private String sourceMusicId;
|
||||
|
||||
public Long getMusicId()
|
||||
{
|
||||
return musicId;
|
||||
}
|
||||
|
||||
public void setSceneId(Long sceneId)
|
||||
{
|
||||
this.sceneId = sceneId;
|
||||
}
|
||||
|
||||
public Long getSceneId()
|
||||
{
|
||||
return sceneId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("musicId", getMusicId())
|
||||
.append("sceneId", getSceneId())
|
||||
.toString();
|
||||
}
|
||||
private List<MusicScene> musicScenes;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
package com.ruoyi.common.enums;
|
||||
|
||||
public enum DeviceTypeEnum {
|
||||
ANDROID,
|
||||
IOS
|
||||
}
|
||||
@@ -1,14 +1,16 @@
|
||||
package com.ruoyi.common.utils;
|
||||
|
||||
import com.ruoyi.common.core.domain.entity.ShopUser;
|
||||
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
|
||||
public class MusicUtil {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获取当前时间 n 天后的日期
|
||||
*
|
||||
* @param n 天数(正数表示未来,负数表示过去)
|
||||
* @return n 天后的 Date 对象
|
||||
*/
|
||||
@@ -19,7 +21,39 @@ public class MusicUtil {
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
System.out.println(getDateAfterNDays(1));;
|
||||
System.out.println(getDateAfterNDays(1));
|
||||
;
|
||||
}
|
||||
|
||||
// 判断用户是否是vip
|
||||
public static boolean getShopIsVip(ShopUser shopUser) {
|
||||
if (shopUser.getVip() != null && shopUser.getVip() == 1) {
|
||||
Date startTime = shopUser.getVipStartTime();
|
||||
Date endTime = shopUser.getVipEndTime();
|
||||
return isCurrentTimeInRange(startTime, endTime);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 检查当前时间是否在指定的时间范围内
|
||||
*
|
||||
* @param startDate 开始时间
|
||||
* @param endDate 结束时间
|
||||
* @return true 如果当前时间在范围内,否则 false
|
||||
*/
|
||||
public static boolean isCurrentTimeInRange(Date startDate, Date endDate) {
|
||||
Date now = new Date(); // 获取当前时间
|
||||
|
||||
// 处理跨越日期的情况(结束时间早于开始时间)
|
||||
if (endDate.before(startDate)) {
|
||||
// 当前时间 >= 开始时间 或 当前时间 <= 结束时间
|
||||
return now.after(startDate) || now.before(endDate) || now.equals(startDate) || now.equals(endDate);
|
||||
} else {
|
||||
// 开始时间 <= 当前时间 <= 结束时间
|
||||
return (now.after(startDate) || now.equals(startDate)) && (now.before(endDate) || now.equals(endDate));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user