ShopPushOpenId返回分页数据
This commit is contained in:
parent
ef1e14f94c
commit
0b8e742bb8
|
|
@ -8,6 +8,7 @@ import com.czg.account.service.ShopPushOpenIdService;
|
|||
import com.czg.annotation.SaAdminCheckPermission;
|
||||
import com.czg.resp.CzgResult;
|
||||
import com.czg.sa.StpKit;
|
||||
import com.mybatisflex.core.paginate.Page;
|
||||
import com.mybatisflex.core.query.QueryWrapper;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
|
|
@ -54,7 +55,7 @@ public class ShopMsgPushController {
|
|||
*/
|
||||
@SaAdminCheckPermission("shopMsgPush:list")
|
||||
@GetMapping
|
||||
public CzgResult<List<ShopPushOpenId>> allInfo() {
|
||||
public CzgResult<Page<ShopPushOpenId>> allInfo() {
|
||||
return CzgResult.success(shopPushOpenIdService.pageInfo(StpKit.USER.getShopId()));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,11 +1,10 @@
|
|||
package com.czg.account.service;
|
||||
|
||||
import com.czg.account.dto.msg.ShopPushOpenIdEditDTO;
|
||||
import com.mybatisflex.core.paginate.Page;
|
||||
import com.mybatisflex.core.service.IService;
|
||||
import com.czg.account.entity.ShopPushOpenId;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户推送信息表 服务层。
|
||||
*
|
||||
|
|
@ -14,7 +13,7 @@ import java.util.List;
|
|||
*/
|
||||
public interface ShopPushOpenIdService extends IService<ShopPushOpenId> {
|
||||
|
||||
List<ShopPushOpenId> pageInfo(Long shopId);
|
||||
Page<ShopPushOpenId> pageInfo(Long shopId);
|
||||
|
||||
Boolean edit(Long shopId, ShopPushOpenIdEditDTO shopPushOpenIdEditDTO);
|
||||
|
||||
|
|
|
|||
|
|
@ -4,6 +4,8 @@ import com.alibaba.fastjson2.JSONArray;
|
|||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.czg.account.dto.msg.ShopPushOpenIdEditDTO;
|
||||
import com.czg.exception.ApiNotPrintException;
|
||||
import com.czg.utils.PageUtil;
|
||||
import com.mybatisflex.core.paginate.Page;
|
||||
import com.mybatisflex.core.query.QueryWrapper;
|
||||
import com.mybatisflex.spring.service.impl.ServiceImpl;
|
||||
import com.czg.account.entity.ShopPushOpenId;
|
||||
|
|
@ -11,8 +13,6 @@ import com.czg.account.service.ShopPushOpenIdService;
|
|||
import com.czg.service.account.mapper.ShopPushOpenIdMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 用户推送信息表 服务层实现。
|
||||
*
|
||||
|
|
@ -23,12 +23,12 @@ import java.util.List;
|
|||
public class ShopPushOpenIdServiceImpl extends ServiceImpl<ShopPushOpenIdMapper, ShopPushOpenId> implements ShopPushOpenIdService{
|
||||
|
||||
@Override
|
||||
public List<ShopPushOpenId> pageInfo(Long shopId) {
|
||||
public Page<ShopPushOpenId> pageInfo(Long shopId) {
|
||||
// PageHelper.startPage(PageUtil.buildPageHelp());
|
||||
// return PageUtil.convert(new PageInfo<>(mapper.pageInfo(shopId)));
|
||||
List<ShopPushOpenId> list = list(new QueryWrapper().eq(ShopPushOpenId::getShopId, shopId));
|
||||
list.forEach(item -> item.setTypeInfo(JSONArray.parseArray((String) item.getTypeInfo())));
|
||||
return list;
|
||||
Page<ShopPushOpenId> page = page(PageUtil.buildPage(), new QueryWrapper().eq(ShopPushOpenId::getShopId, shopId));
|
||||
page.getRecords().forEach(item -> item.setTypeInfo(JSONArray.parseArray((String) item.getTypeInfo())));
|
||||
return page;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
Loading…
Reference in New Issue