release-修复问题

release-2024-08-08
pikaqiudeshujia 9 months ago
parent c7fa98bd8e
commit 933db7a5f8

@ -4,5 +4,5 @@ spring:
name: eureka
profile: dev
label: master
uri: http://116.62.145.60:12000
# uri: http://127.0.0.1:12000
# uri: http://116.62.145.60:12000
uri: http://127.0.0.1:12000

@ -1,5 +1,6 @@
package com.luoo.music.pojo;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import org.hibernate.annotations.DynamicInsert;
@ -10,6 +11,7 @@ import org.springframework.data.jpa.domain.support.AuditingEntityListener;
import javax.persistence.*;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;
@ -26,7 +28,7 @@ import java.util.List;
@Builder
@DynamicInsert
@DynamicUpdate
@Table(name = "tb_song_info")
@Table(name = "tb_artist_album")
@EntityListeners(AuditingEntityListener.class)
public class ArtistAlbum implements Serializable {
@ -82,15 +84,17 @@ public class ArtistAlbum implements Serializable {
/**
*
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@CreatedDate
@ApiModelProperty("创建时间")
private Date createTime;
private LocalDateTime createTime;
/**
*
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@LastModifiedDate
@ApiModelProperty("修改时间")
private Date updateTime;
private LocalDateTime updateTime;
/**
* id
*/

@ -20,7 +20,7 @@ import java.io.Serializable;
@AllArgsConstructor
@EqualsAndHashCode
@Builder
@Table(name = "tb_song_info")
@Table(name = "tb_artist_album_song")
public class ArtistAlbumSong implements Serializable {
@Id

@ -1,8 +1,9 @@
package com.luoo.music.pojo;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.Data;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.springframework.data.annotation.CreatedDate;
@ -66,11 +67,13 @@ public class SongInfo implements Serializable {
/**
*
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@CreatedDate
private LocalDateTime createTime;
/**
*
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@LastModifiedDate
private LocalDateTime updateTime;
/**

@ -74,7 +74,7 @@ public class AlbumService {
public PageResult<ArtistAlbum> getList(AlbumSearchDTO albumSearchDTO, Integer page, Integer size) {
List<ArtistAlbum> result = new ArrayList<>();
Sort sort = new Sort(Sort.Direction.DESC, "create_time");
Sort sort = new Sort(Sort.Direction.DESC, "createTime");
PageRequest pageRequest = PageRequest.of(page - 1, size, sort);
Page<ArtistAlbum> albumPage;
if (!Objects.isNull(albumSearchDTO)) {
@ -84,6 +84,8 @@ public class AlbumService {
albumPage = artistAlbumDao.findAll(pageRequest);
}
result = albumPage.getContent();
long totalElements = albumPage.getTotalElements();
return new PageResult<>(totalElements, result);
@ -106,28 +108,30 @@ public class AlbumService {
predicateList.add(builder.equal(root.get("state"), param.getState()));
}
switch (param.getTimeQuery()) {
case 1:
// 今年
LocalDate now = LocalDate.now();
int currentYear = now.getYear();
predicateList.add(builder.equal(builder.function("YEAR", Integer.class, root.get("createTime")), currentYear));
break;
case 2:
// 最近一月
LocalDate oneMonthAgo = LocalDate.now().minusMonths(1);
predicateList.add(builder.greaterThanOrEqualTo(root.get("createTime"), oneMonthAgo.atStartOfDay()));
break;
case 3:
// 最近一周
LocalDate oneWeekAgo = LocalDate.now().minusWeeks(1);
predicateList.add(builder.greaterThanOrEqualTo(root.get("createTime"), oneWeekAgo.atStartOfDay()));
break;
case 4:
// 24小时内
LocalDate oneDayAge = LocalDate.now().minusDays(1);
predicateList.add(builder.greaterThanOrEqualTo(root.get("createTime"), oneDayAge.atStartOfDay()));
break;
if (param.getTimeQuery() != null) {
switch (param.getTimeQuery()) {
case 1:
// 今年
LocalDate now = LocalDate.now();
int currentYear = now.getYear();
predicateList.add(builder.equal(builder.function("YEAR", Integer.class, root.get("createTime")), currentYear));
break;
case 2:
// 最近一月
LocalDate oneMonthAgo = LocalDate.now().minusMonths(1);
predicateList.add(builder.greaterThanOrEqualTo(root.get("createTime"), oneMonthAgo.atStartOfDay()));
break;
case 3:
// 最近一周
LocalDate oneWeekAgo = LocalDate.now().minusWeeks(1);
predicateList.add(builder.greaterThanOrEqualTo(root.get("createTime"), oneWeekAgo.atStartOfDay()));
break;
case 4:
// 24小时内
LocalDate oneDayAge = LocalDate.now().minusDays(1);
predicateList.add(builder.greaterThanOrEqualTo(root.get("createTime"), oneDayAge.atStartOfDay()));
break;
}
}
return builder.and(predicateList.toArray(new Predicate[predicateList.size()]));

@ -4,8 +4,8 @@ spring:
name: music
profile: dev
label: master
uri: http://116.62.145.60:12000
# uri: http://127.0.0.1:12000
# uri: http://116.62.145.60:12000
uri: http://127.0.0.1:12000
servlet:
multipart:
max-file-size: 20MB

@ -6,8 +6,8 @@ spring:
# profile: prod
label: master
# uri: http://116.62.145.60:13000
uri: http://116.62.145.60:12000
# uri: http://127.0.0.1:12000
# uri: http://116.62.145.60:12000
uri: http://127.0.0.1:12000
oauth2:
weixin:

@ -4,5 +4,5 @@ spring:
name: web
profile: dev
label: master
uri: http://116.62.145.60:12000
# uri: http://127.0.0.1:12000
# uri: http://116.62.145.60:12000
uri: http://127.0.0.1:12000
Loading…
Cancel
Save