反馈历史

This commit is contained in:
2023-11-24 09:31:30 +08:00
parent 20b77a119a
commit 9e3f0c440a
8 changed files with 442 additions and 5 deletions

View File

@@ -121,6 +121,11 @@ public class GorseController extends BaseController {
return success(gorseService.getRecommendByUser(gQo.getUserId(), gQo.getRecommendation(), gQo.getCategory(), gQo.getN()));
}
@GetMapping(value = "/get_feedback_list/{userId}/{type}")
public ResponseData getFeedbackList(@PathVariable("userId") String userId, @PathVariable("type") String type) throws Exception {
return success(gorseService.listFeedback(userId, type));
}
@PutMapping(value = "/bulk/{type}")
public ResponseData bulkUserOrItem(@RequestParam Map<String, String> data, @RequestParam("file") MultipartFile file, @PathVariable("type") String type) throws Exception {
return success(gorseService.bulkUserOrItem(data, file, type));

View File

@@ -12,15 +12,17 @@ public class Feedback {
private String userId;
private String itemId;
private String timestamp;
private Item item;
public Feedback() {
}
public Feedback(String feedbackType, String userId, String itemId, String timestamp) {
public Feedback(String feedbackType, String userId, String itemId, String timestamp, Item item) {
this.feedbackType = feedbackType;
this.userId = userId;
this.itemId = itemId;
this.timestamp = timestamp;
this.item = item;
}
@JsonProperty("FeedbackType")
@@ -38,6 +40,11 @@ public class Feedback {
return itemId;
}
@JsonProperty("Item")
public Item getItem() {
return item;
}
@JsonProperty("Timestamp")
public String getTimestamp() {
return timestamp;

View File

@@ -70,7 +70,7 @@ public class GorseService {
}
public List<Feedback> listFeedback(String userId, String feedbackType) throws IOException {
return Arrays.asList(this.request("GET", this.endpoint + "/api/user/" + userId + "/feedback/" + feedbackType, null, Feedback[].class));
return Arrays.asList(this.request("GET", this.endpoint + "/api/dashboard/user/" + userId + "/feedback/" + feedbackType, null, Feedback[].class));
}
public List<String> getRecommend(String userId) throws IOException {