点歌相关接口
This commit is contained in:
@@ -11,6 +11,8 @@ public interface RedisCst {
|
||||
String LOGIN_CODE = "login:code:";
|
||||
String SYS_LOG_KEY = "sys:log:";
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* key过期监听
|
||||
*/
|
||||
@@ -33,6 +35,10 @@ public interface RedisCst {
|
||||
|
||||
String PRINT_ORDER_DETAIL = "print:order:detail:";
|
||||
|
||||
// 点歌地址url
|
||||
String SONG_URL = "song:";
|
||||
|
||||
|
||||
static String getLockKey(String sign, Object... args) {
|
||||
StringBuilder key = new StringBuilder(LOCK_KEY + ":" + sign + ":");
|
||||
for (Object arg : args) {
|
||||
@@ -51,4 +57,8 @@ public interface RedisCst {
|
||||
static String getPrintOrderDetailKey(Long orderId, Long detailId) {
|
||||
return PRINT_ORDER_DETAIL + orderId + ":" + detailId;
|
||||
}
|
||||
|
||||
static String getSongUrlKey(Long shopId) {
|
||||
return SONG_URL + shopId;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
|
||||
package com.czg.account.dto.song;
|
||||
|
||||
import jakarta.validation.constraints.DecimalMin;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import jakarta.validation.constraints.Size;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 点歌-歌曲表 实体类。
|
||||
*
|
||||
* @author zs
|
||||
* @since 2025-03-01
|
||||
*/
|
||||
@Data
|
||||
public class BaseShopSongDTO {
|
||||
@NotNull
|
||||
private Long id;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
|
||||
package com.czg.account.dto.song;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import java.io.Serial;
|
||||
|
||||
import jakarta.validation.constraints.DecimalMin;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 点歌-歌曲表 实体类。
|
||||
*
|
||||
* @author zs
|
||||
* @since 2025-03-01
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@Accessors(chain = true)
|
||||
public class ShopSongAddDTO{
|
||||
|
||||
/**
|
||||
* 歌曲图片
|
||||
*/
|
||||
@NotBlank(message = "歌曲图片不为空")
|
||||
private String img;
|
||||
|
||||
/**
|
||||
* 歌曲名称
|
||||
*/
|
||||
@NotBlank(message = "歌曲名称不为空")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 原唱歌手
|
||||
*/
|
||||
private String originSinger;
|
||||
|
||||
/**
|
||||
* 演出歌手id
|
||||
*/
|
||||
private Integer singerId;
|
||||
|
||||
/**
|
||||
* 演出歌手名称
|
||||
*/
|
||||
@NotEmpty(message = "演出歌手名称不为空")
|
||||
private String singer;
|
||||
|
||||
/**
|
||||
* 单价
|
||||
*/
|
||||
@NotNull(message = "单价不为空")
|
||||
@DecimalMin("0.01")
|
||||
private BigDecimal price;
|
||||
|
||||
/**
|
||||
* 点播次数
|
||||
*/
|
||||
private Integer salesNumber;
|
||||
|
||||
/**
|
||||
* 歌曲状态:1-开启;0-关闭
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
private Integer sort;
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
|
||||
package com.czg.account.dto.song;
|
||||
|
||||
import jakarta.validation.constraints.*;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 点歌-歌曲表 实体类。
|
||||
*
|
||||
* @author zs
|
||||
* @since 2025-03-01
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
@Builder
|
||||
@Accessors(chain = true)
|
||||
public class ShopSongEditDTO extends BaseShopSongDTO {
|
||||
/**
|
||||
* 歌曲图片
|
||||
*/
|
||||
@Size(min = 1, message = "歌曲图片不为空")
|
||||
private String img;
|
||||
|
||||
/**
|
||||
* 歌曲名称
|
||||
*/
|
||||
@Size(min = 1, message = "歌曲名称不为空")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 原唱歌手
|
||||
*/
|
||||
private String originSinger;
|
||||
|
||||
/**
|
||||
* 演出歌手id
|
||||
*/
|
||||
private Integer singerId;
|
||||
|
||||
/**
|
||||
* 演出歌手名称
|
||||
*/
|
||||
@NotEmpty(message = "演出歌手名称不为空")
|
||||
private String singer;
|
||||
|
||||
/**
|
||||
* 单价
|
||||
*/
|
||||
@DecimalMin("0.01")
|
||||
private BigDecimal price;
|
||||
|
||||
/**
|
||||
* 点播次数
|
||||
*/
|
||||
private Integer salesNumber;
|
||||
|
||||
/**
|
||||
* 歌曲状态:1-开启;0-关闭
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
private Integer sort;
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
package com.czg.account.entity;
|
||||
|
||||
import com.mybatisflex.annotation.Column;
|
||||
import com.mybatisflex.annotation.Id;
|
||||
import com.mybatisflex.annotation.KeyType;
|
||||
import com.mybatisflex.annotation.Table;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 点歌-歌曲表 实体类。
|
||||
*
|
||||
* @author zs
|
||||
* @since 2025-03-01
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Table("tb_shop_song")
|
||||
public class ShopSong implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Id(keyType = KeyType.Auto)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 店铺id
|
||||
*/
|
||||
private Long shopId;
|
||||
|
||||
/**
|
||||
* 歌曲图片
|
||||
*/
|
||||
private String img;
|
||||
|
||||
/**
|
||||
* 歌曲名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 原唱歌手
|
||||
*/
|
||||
private String originSinger;
|
||||
|
||||
/**
|
||||
* 演出歌手id
|
||||
*/
|
||||
private Integer singerId;
|
||||
|
||||
/**
|
||||
* 演出歌手名称
|
||||
*/
|
||||
private String singer;
|
||||
|
||||
/**
|
||||
* 单价
|
||||
*/
|
||||
private BigDecimal price;
|
||||
|
||||
/**
|
||||
* 点播次数
|
||||
*/
|
||||
private Integer salesNumber;
|
||||
|
||||
/**
|
||||
* 歌曲状态:1-开启;0-关闭
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
private Integer sort;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Column(onInsertValue = "now()")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@Column(onInsertValue = "now()", onUpdateValue = "now()")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.czg.account.service;
|
||||
|
||||
import com.czg.account.dto.song.ShopSongAddDTO;
|
||||
import com.czg.account.dto.song.ShopSongEditDTO;
|
||||
import com.mybatisflex.core.paginate.Page;
|
||||
import com.mybatisflex.core.service.IService;
|
||||
import com.czg.account.entity.ShopSong;
|
||||
|
||||
/**
|
||||
* 点歌-歌曲表 服务层。
|
||||
*
|
||||
* @author zs
|
||||
* @since 2025-03-01
|
||||
*/
|
||||
public interface ShopSongService extends IService<ShopSong> {
|
||||
|
||||
Boolean add(Long shopId, ShopSongAddDTO shopSongAddDTO);
|
||||
|
||||
Boolean edit(Long shopId, ShopSongEditDTO shopSongEditDTO);
|
||||
|
||||
String getSongUrl(Long shopId);
|
||||
}
|
||||
Reference in New Issue
Block a user