parent
1122944839
commit
b37d12cefd
@ -1,15 +1,15 @@
|
||||
package com.luoo.user.dao;
|
||||
|
||||
import com.luoo.user.pojo.TaskPoint;
|
||||
import java.awt.print.Pageable;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||
import org.springframework.data.jpa.repository.Query;
|
||||
|
||||
public interface TaskPointDao extends JpaRepository<TaskPoint, String>,
|
||||
JpaSpecificationExecutor<TaskPoint> {
|
||||
public interface TaskPointDao extends JpaRepository<TaskPoint, String>, JpaSpecificationExecutor<TaskPoint> {
|
||||
|
||||
@Query(value = " select * from tb_task_point order by id desc", countProjection = "id", nativeQuery = true)
|
||||
public Page<TaskPoint> findAll(Pageable pageable);
|
||||
public Page<TaskPoint> selectAll(Pageable pageable);
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,18 @@
|
||||
package com.luoo.user.dao;
|
||||
|
||||
import com.luoo.user.pojo.MembershipCode;
|
||||
import com.luoo.user.pojo.UserPointLog;
|
||||
import java.util.List;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||
import org.springframework.data.jpa.repository.Query;
|
||||
|
||||
public interface UserPointLogDao extends JpaRepository<UserPointLog, String>, JpaSpecificationExecutor<UserPointLog> {
|
||||
|
||||
public List<UserPointLog> findUserPointLogByUserIdAndTaskPointId(String userId, String taskPointId);
|
||||
|
||||
@Query(value = " select * from tb_user_point_log where user_id = ?1 order by create_time desc", countProjection = "id", nativeQuery = true)
|
||||
public Page<UserPointLog> getUserPointLogList(String userId, Pageable pageable);
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package com.luoo.user.listener;
|
||||
|
||||
import com.luoo.user.pojo.UserPointLog;
|
||||
import com.luoo.user.service.UserPointLogService;
|
||||
import dto.MusicPointDto;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
|
||||
import org.springframework.amqp.rabbit.annotation.RabbitListener;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @program: luoo_parent
|
||||
* @description: 积分日志队列
|
||||
* @author: yawei.huang
|
||||
* @create: 2024-07-24 13:05
|
||||
**/
|
||||
@Component
|
||||
@RabbitListener(queues = "pointLog")
|
||||
@Slf4j
|
||||
public class PointLogListener {
|
||||
|
||||
@Autowired
|
||||
private UserPointLogService userPointLogService;
|
||||
|
||||
@RabbitHandler
|
||||
public void executePointLog(UserPointLog userPointLog) {
|
||||
log.info("userPointLog:{}", userPointLog);
|
||||
userPointLogService.add(userPointLog);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
alter table tb_user_info
|
||||
add point int default 0 not null comment '积分';
|
||||
|
Loading…
Reference in new issue