|
|
|
@ -45,7 +45,7 @@ public class EvaluationController {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @description: 通过手机获取评价
|
|
|
|
|
* @description: 获取该用户对别人的评价
|
|
|
|
|
* @param: phone
|
|
|
|
|
* @return: java.util.List<com.softegg.freetogo.Evaluate.bean.Evaluations>
|
|
|
|
|
* @author: zhanglinhao
|
|
|
|
@ -55,4 +55,47 @@ public class EvaluationController {
|
|
|
|
|
public List<Evaluations> evaluationByPhone(String phone) {
|
|
|
|
|
return evaluateService.getEListByPhone(phone);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @description: 编辑评论
|
|
|
|
|
* @param: eid
|
|
|
|
|
* @param: ebody
|
|
|
|
|
* @return: void
|
|
|
|
|
* @author: zhanglinhao
|
|
|
|
|
* @date: 2024/5/12 13:31
|
|
|
|
|
*/
|
|
|
|
|
@GetMapping("editEvaluation")
|
|
|
|
|
public void editEvaluation(int eid, String ebody) {
|
|
|
|
|
evaluateService.editEvaluation(eid, ebody);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @description: 删除评论
|
|
|
|
|
* @param: eid
|
|
|
|
|
* @return: void
|
|
|
|
|
* @author: zhanglinhao
|
|
|
|
|
* @date: 2024/5/12 13:32
|
|
|
|
|
*/
|
|
|
|
|
@GetMapping("deleteEvaluation")
|
|
|
|
|
public void deleteEvaluation(int eid) {
|
|
|
|
|
evaluateService.deleteEvaluation(eid);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @description: 获取该用户的受满意程度
|
|
|
|
|
* @param: phone
|
|
|
|
|
* @return: int
|
|
|
|
|
* @author: zhanglinhao
|
|
|
|
|
* @date: 2024/5/12 13:39
|
|
|
|
|
*/
|
|
|
|
|
@GetMapping("getSatisfaction")
|
|
|
|
|
public String getSatisfaction(String phone) {
|
|
|
|
|
List<Evaluations> elist = evaluateService.getEvaluatedByPhone(phone);
|
|
|
|
|
float sumOfSatisfaction = 0;
|
|
|
|
|
for (Evaluations evaluation : elist) {
|
|
|
|
|
sumOfSatisfaction += evaluation.getSatisfaction();
|
|
|
|
|
}
|
|
|
|
|
System.out.println("查询满意度:"+ sumOfSatisfaction);
|
|
|
|
|
return Float.toString(sumOfSatisfaction /elist.size());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|