mirror of
https://github.com/dataease/dataease.git
synced 2026-05-19 10:18:11 +08:00
feat: 移动端收藏状态
This commit is contained in:
@@ -32,7 +32,12 @@ public interface StoreApi {
|
||||
|
||||
|
||||
@ApiOperation("移除收藏")
|
||||
@PostMapping("/remove/{storeId}")
|
||||
void remove(@PathVariable("storeId") String storeId);
|
||||
@PostMapping("/remove/{panelId}")
|
||||
void remove(@PathVariable("panelId") String panelId);
|
||||
|
||||
@ApiOperation("收藏状态")
|
||||
@PostMapping("/status/{id}")
|
||||
Boolean hasStar(@PathVariable("id") String id);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -29,4 +29,9 @@ public class StoreServer implements StoreApi {
|
||||
public void remove(String panelId) {
|
||||
storeService.removeByPanelId(panelId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean hasStar(String id) {
|
||||
return storeService.count(id) > 0L;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,4 +53,11 @@ public class StoreService {
|
||||
return extPanelStoreMapper.query(example);
|
||||
}
|
||||
|
||||
public Long count(String panelId) {
|
||||
PanelStoreExample example = new PanelStoreExample();
|
||||
example.createCriteria().andUserIdEqualTo(AuthUtils.getUser().getUserId()).andPanelGroupIdEqualTo(panelId);
|
||||
return panelStoreMapper.countByExample(example);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user