小程序店铺会员信息获取接口

This commit is contained in:
张松 2025-02-14 14:50:56 +08:00
parent b8f5448a7b
commit fb4348a42a
1 changed files with 31 additions and 0 deletions

View File

@ -0,0 +1,31 @@
package com.czg.controller.user;
import com.czg.account.entity.ShopUser;
import com.czg.account.service.ShopUserService;
import com.czg.resp.CzgResult;
import com.czg.sa.StpKit;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* 店铺会员相关
* @author Administrator
*/
@RestController
@RequestMapping("/user/shopUser")
public class UShopUserController {
@Resource
private ShopUserService shopUserService;
/**
* 获取当前店铺会员信息
* 请求头必须携带shopId, 不携带则会失败
* @return 店铺会员信息
*/
@GetMapping
public CzgResult<ShopUser> get() {
return CzgResult.success(shopUserService.queryChain().eq(ShopUser::getShopId, StpKit.USER.getShopId()).eq(ShopUser::getId, StpKit.USER.getLoginIdAsLong()).one());
}
}