mirror of
https://github.com/wushuo894/ani-rss.git
synced 2026-03-13 09:20:23 +00:00
fix: 修复番剧评分问题
This commit is contained in:
@@ -52,9 +52,18 @@ public class BgmController extends BaseController {
|
||||
}
|
||||
|
||||
@Auth
|
||||
@Operation(summary = "评分")
|
||||
@Operation(summary = "获取评分")
|
||||
@PostMapping("/rate")
|
||||
public Result<Integer> rate(@RequestBody Ani ani) {
|
||||
String subjectId = BgmUtil.getSubjectId(ani);
|
||||
Integer rate = BgmUtil.rate(subjectId, null);
|
||||
return Result.success(rate);
|
||||
}
|
||||
|
||||
@Auth
|
||||
@Operation(summary = "进行评分")
|
||||
@PostMapping("/setRate")
|
||||
public Result<Integer> setRate(@RequestBody Ani ani) {
|
||||
String subjectId = BgmUtil.getSubjectId(ani);
|
||||
Integer score = Opt.ofNullable(ani.getScore())
|
||||
.map(Double::intValue)
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
</div>
|
||||
<div class="flex bgm-rate-button-container">
|
||||
<el-button :icon="Ban" bg text @click="clearRate">清空评分</el-button>
|
||||
<el-button :icon="Save" bg text @click="rate(ani)">保存评分</el-button>
|
||||
<el-button :icon="Save" bg text @click="setRate(ani)">保存评分</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
@@ -58,6 +58,17 @@ let clearRate = () => {
|
||||
let rate = (v) => {
|
||||
loading.value = true
|
||||
http.rate(v)
|
||||
.then(res => {
|
||||
ani.value.score = res.data
|
||||
})
|
||||
.finally(() => {
|
||||
loading.value = false
|
||||
})
|
||||
}
|
||||
|
||||
let setRate = (v) => {
|
||||
loading.value = true
|
||||
http.setRate(v)
|
||||
.then(res => {
|
||||
ani.value.score = res.data
|
||||
|
||||
|
||||
@@ -216,12 +216,19 @@ export let stop = (status) => api.post(`api/stop?status=${status}`)
|
||||
export let refreshCover = (ani) => api.post('api/refreshCover', ani)
|
||||
|
||||
/**
|
||||
* 评分
|
||||
* 获取评分
|
||||
* @param ani 订阅
|
||||
* @returns {Promise<unknown>}
|
||||
*/
|
||||
export let rate = (ani) => api.post('api/rate', ani)
|
||||
|
||||
/**
|
||||
* 进行评分
|
||||
* @param ani 订阅
|
||||
* @returns {Promise<unknown>}
|
||||
*/
|
||||
export let setRate = (ani) => api.post('api/setRate', ani)
|
||||
|
||||
/**
|
||||
* 获取下载位置
|
||||
* @param ani 订阅
|
||||
|
||||
Reference in New Issue
Block a user