拖动排序

This commit is contained in:
2026-04-28 17:40:02 +08:00
parent e823cb7e6b
commit 2977157b26
2 changed files with 10 additions and 10 deletions

View File

@@ -71,7 +71,7 @@ public class ShopPayTypeController {
* @param id 拖动的支付类型ID
* @param targetSort 目标位置排序号
*/
@PostMapping("/sort")
@GetMapping("/sort")
public CzgResult<Void> sort(@RequestParam Long shopId, @RequestParam Integer id, @RequestParam Integer targetSort) {
shopPayTypeService.updateSort(shopId, id, targetSort);
return CzgResult.success();

View File

@@ -91,10 +91,10 @@ public class ShopPayTypeServiceImpl extends ServiceImpl<ShopPayTypeMapper, ShopP
@Override
public List<ShopPayType> getList(Long shopId) {
List<ShopPayType> list = list(new QueryWrapper().eq(ShopPayType::getShopId, StpKit.USER.getShopId()));
List<ShopPayType> list = list(new QueryWrapper().eq(ShopPayType::getShopId, StpKit.USER.getShopId()).orderBy(ShopPayType::getSorts, true));
if (list.isEmpty()) {
addInfo(shopId);
list = list(new QueryWrapper().eq(ShopPayType::getShopId, StpKit.USER.getShopId()));
list = list(new QueryWrapper().eq(ShopPayType::getShopId, StpKit.USER.getShopId()).orderBy(ShopPayType::getSorts, true));
}
return list;
}