parent
97967b2eb7
commit
8d897c4089
@ -1,2 +0,0 @@
|
||||
# 解析IP三方库
|
||||
https://github.com/jarod/qqwry-java
|
@ -0,0 +1,11 @@
|
||||
package com.luoo.comment.dao;
|
||||
|
||||
import com.luoo.comment.pojo.Complaint;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.data.mongodb.repository.MongoRepository;
|
||||
|
||||
public interface ComplaintDao extends MongoRepository<Complaint,String> {
|
||||
|
||||
public Page<Complaint> findAllByOrderByComplaintTimeDesc(Pageable pageable);
|
||||
}
|
@ -0,0 +1,57 @@
|
||||
package com.luoo.comment.pojo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import org.springframework.data.annotation.Id;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class Complaint implements Serializable {
|
||||
|
||||
@Id
|
||||
private String _id;
|
||||
|
||||
// 举报的评论ID
|
||||
private String commentId;
|
||||
|
||||
// 举报的评论内容
|
||||
private String commentContent;
|
||||
|
||||
// 举报类型
|
||||
private String type;
|
||||
|
||||
//举报人
|
||||
private String complaintFrom;
|
||||
|
||||
// 举报时间
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date complaintTime;
|
||||
|
||||
// 举报关联
|
||||
private String journalId;
|
||||
|
||||
private String journalTitle;
|
||||
|
||||
// 举报对象
|
||||
private String complaintTo;
|
||||
|
||||
// 举报状态
|
||||
private String state;
|
||||
|
||||
// 处理结果
|
||||
private String handleResult;
|
||||
|
||||
|
||||
// 处理人
|
||||
private String handleBy;
|
||||
|
||||
// 处理时间
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date handleTime;
|
||||
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
package com.luoo.comment.service;
|
||||
|
||||
import com.luoo.comment.dao.ComplaintDao;
|
||||
import com.luoo.comment.pojo.Complaint;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class ComplaintService {
|
||||
|
||||
@Autowired
|
||||
private ComplaintDao complaintDao;
|
||||
|
||||
public Page<Complaint> search(int page, int size) {
|
||||
Pageable pageable = PageRequest.of(page-1,size);
|
||||
|
||||
return complaintDao.findAllByOrderByComplaintTimeDesc(pageable);
|
||||
}
|
||||
|
||||
public void save(Complaint complaint) {
|
||||
|
||||
complaintDao.save(complaint);
|
||||
}
|
||||
|
||||
public Complaint findByComplaintId(String complaintId) {
|
||||
return complaintDao.findById(complaintId).get();
|
||||
}
|
||||
}
|
Loading…
Reference in new issue