Merge remote-tracking branch 'origin/master'

This commit is contained in:
wangw 2025-02-15 17:38:24 +08:00
commit 21ccd3e2e8
6 changed files with 12 additions and 11 deletions

View File

@ -1,5 +1,6 @@
package com.czg.controller.user;
import com.czg.account.dto.shopuser.ShopUserVipCardDTO;
import com.czg.account.entity.ShopUser;
import com.czg.account.service.ShopUserService;
import com.czg.resp.CzgResult;
@ -36,7 +37,7 @@ public class UShopUserController {
* @return 店铺会员信息列表
*/
@GetMapping("/vipCard")
public CzgResult<Page<ShopUser>> list() {
public CzgResult<Page<ShopUserVipCardDTO>> list() {
return CzgResult.success(shopUserService.vipCard(StpKit.USER.getLoginIdAsLong()));
}

View File

@ -34,7 +34,6 @@ public class MyStpLogic extends StpLogic {
* @param isAdmin 是否为管理员账号
*/
public void login(Long id, Long shopId, boolean isManager, boolean isAdmin) {
super.login(id);
login(id);
if (isManager && shopId == null) {
throw new ApiNotPrintException("管理端登录必须传递店铺id");

View File

@ -21,5 +21,9 @@ public class ShopUserVipCardDTO {
* 用户余额
*/
private BigDecimal amount;
/**
* 店铺id
*/
private Long shopId;
}

View File

@ -1,9 +1,6 @@
package com.czg.account.service;
import com.czg.account.dto.shopuser.ShopUserAddDTO;
import com.czg.account.dto.shopuser.ShopUserEditDTO;
import com.czg.account.dto.shopuser.ShopUserMoneyEditDTO;
import com.czg.account.dto.shopuser.ShopUserSummaryDTO;
import com.czg.account.dto.shopuser.*;
import com.czg.account.entity.ShopUser;
import com.mybatisflex.core.paginate.Page;
import com.mybatisflex.core.service.IService;
@ -31,6 +28,6 @@ public interface ShopUserService extends IService<ShopUser> {
/**
* 获取小程序登录用户所有店铺会员信息
*/
Page<ShopUser> vipCard(long userInfoId);
Page<ShopUserVipCardDTO> vipCard(long userInfoId);
}

View File

@ -119,8 +119,7 @@ public class ShopUserServiceImpl extends ServiceImpl<ShopUserMapper, ShopUser>
}
@Override
public Page<ShopUser> vipCard(long userInfoId) {
Page<ShopUserVipCardDTO> infos = mapper.selectVipCard(PageUtil.buildPage(), userInfoId);
return null;
public Page<ShopUserVipCardDTO> vipCard(long userInfoId) {
return mapper.selectVipCard(PageUtil.buildPage(), userInfoId);
}
}

View File

@ -39,6 +39,7 @@
</if>
</select>
<select id="selectVipCard" resultType="com.czg.account.dto.shopuser.ShopUserVipCardDTO">
select b.logo, b.shop_name shopName, a.amount, a.shop_id shopId from tb_shop_user as a left join tb_shop_info as b on a.shop_id=b.id
where a.user_id=#{userInfoId}
</select>
</mapper>