|
|
@@ -1,6 +1,7 @@
|
|
|
package com.yhlxj.web.controller.manage;
|
|
|
|
|
|
import cn.dev33.satoken.stp.StpUtil;
|
|
|
+import cn.hutool.core.bean.BeanUtil;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.cyksj.common.exception.BusinessRuntimeException;
|
|
|
@@ -8,6 +9,7 @@ import com.yhlxj.dao.model.dto.Result;
|
|
|
import com.yhlxj.dao.model.entity.WebInfo;
|
|
|
import com.yhlxj.dao.model.entity.WholesaleUser;
|
|
|
import com.yhlxj.dao.model.enums.GatewayResponse;
|
|
|
+import com.yhlxj.dao.model.view.WebInfoView;
|
|
|
import com.yhlxj.service.wholesale.WebInfoService;
|
|
|
import com.yhlxj.service.wholesale.WholesaleUserService;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
@@ -136,4 +138,21 @@ public class WholesaleController {
|
|
|
Wrappers.lambdaQuery(WholesaleUser.class).eq(WholesaleUser::getWholesaleId, wholesaleId).like(WholesaleUser::getUsername, username)));
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 通过前缀查询店铺信息
|
|
|
+ */
|
|
|
+ @GetMapping("/getWebInfoByPrefix")
|
|
|
+ public WebInfoView getWebInfoByPrefix(@RequestParam String prefix) {
|
|
|
+ WebInfo webInfo = webInfoService.getOne(Wrappers.lambdaQuery(WebInfo.class).eq(WebInfo::getPrefix, prefix).last(" limit 1"));
|
|
|
+ if (webInfo == null) {
|
|
|
+ throw new BusinessRuntimeException("店铺不存在.");
|
|
|
+ }
|
|
|
+ if (!webInfo.getStatus()){
|
|
|
+ throw new BusinessRuntimeException("店铺已关闭.");
|
|
|
+ }
|
|
|
+ WebInfoView view = new WebInfoView();
|
|
|
+ BeanUtil.copyProperties(webInfo, view);
|
|
|
+ return view;
|
|
|
+ }
|
|
|
}
|