店铺信息

This commit is contained in:
2025-03-07 13:24:02 +08:00
parent 562fbf1695
commit 643b5c0807
3 changed files with 21 additions and 2 deletions

View File

@@ -44,6 +44,7 @@ public class AuthorizationController {
/**
* 验证码获取
*
* @return 验证码信息
*/
@GetMapping("captcha")
@@ -53,6 +54,7 @@ public class AuthorizationController {
/**
* 商户登录
*
* @param loginDTO 登录参数
* @return token信息
*/
@@ -79,6 +81,7 @@ public class AuthorizationController {
RabbitPublisher rabbitPublisher;
@Resource
ShopTableService shopTableService;
@GetMapping("test")
public CzgResult<?> login(HttpServletRequest request, HttpServletResponse response) throws IOException {
// shopTableService.createQrCode(1L, 1, response, request);
@@ -87,7 +90,7 @@ public class AuthorizationController {
// rabbitPublisher.sendOrderPrintMsg("552");
// printMqListener.orderPrint("1");
// return CzgResult.success(Map.of("token", StpKit.USER.getShopId()));
return CzgResult.success( shopInfoService.getById(1));
return CzgResult.success(shopInfoService.getById(1));
}
/**
@@ -97,7 +100,9 @@ public class AuthorizationController {
@GetMapping("/userInfo")
public CzgResult<Map<String, Object>> getUserInfo() {
String account = StpKit.USER.getAccount();
ShopInfo shopInfo = shopInfoService.queryChain().select(ShopInfo::getId, ShopInfo::getShopName).one();
ShopInfo shopInfo = shopInfoService.queryChain()
.select(ShopInfo::getId, ShopInfo::getShopName)
.eq(ShopInfo::getId, StpKit.USER.getShopId()).one();
if (account.contains("@")) {
account = account.split("@")[1];
}

View File

@@ -4,6 +4,8 @@ import com.czg.account.dto.merchant.ShopMerchantEditDTO;
import com.czg.account.entity.ShopMerchant;
import com.mybatisflex.core.service.IService;
import java.io.Serializable;
/**
* 第三方商户进件 服务层。
*
@@ -15,4 +17,6 @@ public interface ShopMerchantService extends IService<ShopMerchant> {
ShopMerchant detail();
Boolean edit(ShopMerchantEditDTO shopMerchantEditDTO);
@Override
ShopMerchant getById(Serializable id);
}

View File

@@ -6,9 +6,12 @@ import com.czg.account.entity.ShopMerchant;
import com.czg.account.service.ShopMerchantService;
import com.czg.sa.StpKit;
import com.czg.service.account.mapper.ShopMerchantMapper;
import com.czg.utils.AssertUtil;
import com.mybatisflex.spring.service.impl.ServiceImpl;
import org.apache.dubbo.config.annotation.DubboService;
import java.io.Serializable;
/**
* 第三方商户进件 服务层实现。
*
@@ -36,4 +39,11 @@ public class ShopMerchantServiceImpl extends ServiceImpl<ShopMerchantMapper, Sho
BeanUtil.copyProperties(shopMerchantEditDTO, shopMerchant);
return updateById(shopMerchant);
}
@Override
public ShopMerchant getById(Serializable id) {
ShopMerchant shopMerchant = getMapper().selectOneById(id);
AssertUtil.isNull(shopMerchant, "暂未开通支付");
return getMapper().selectOneById(id);
}
}