小程序店铺会员信息获取接口
This commit is contained in:
parent
b8f5448a7b
commit
fb4348a42a
|
|
@ -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());
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue