|
|
@@ -1,8 +1,14 @@
|
|
|
package com.yhlxj.web.controller.login;
|
|
|
|
|
|
+import cn.hutool.core.bean.BeanUtil;
|
|
|
import cn.hutool.core.lang.Validator;
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.BeanUtils;
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.cyksj.common.exception.BusinessRuntimeException;
|
|
|
+import com.yhlxj.dao.model.entity.WebInfo;
|
|
|
import com.yhlxj.dao.model.entity.WholesaleUser;
|
|
|
+import com.yhlxj.dao.model.view.WebInfoView;
|
|
|
+import com.yhlxj.service.wholesale.WebInfoService;
|
|
|
import com.yhlxj.service.wholesale.WholesaleUserService;
|
|
|
import com.yhlxj.web.util.StpUserUtil;
|
|
|
import com.yhlxj.web.util.StpWholesaleUtil;
|
|
|
@@ -16,9 +22,9 @@ import javax.servlet.http.HttpServletResponse;
|
|
|
import javax.validation.constraints.NotNull;
|
|
|
|
|
|
/**
|
|
|
+ * 用户登录
|
|
|
* @author zwhui
|
|
|
* @date 2025/6/9 15:42
|
|
|
- * 用户登录
|
|
|
*/
|
|
|
@Slf4j
|
|
|
@RequiredArgsConstructor
|
|
|
@@ -28,6 +34,8 @@ public class WholesaleUserController {
|
|
|
|
|
|
private final WholesaleUserService wholesaleUserService;
|
|
|
|
|
|
+ private final WebInfoService webInfoService;
|
|
|
+
|
|
|
private final HttpServletResponse response;
|
|
|
|
|
|
/**
|
|
|
@@ -79,4 +87,21 @@ public class WholesaleUserController {
|
|
|
response.addCookie(cookie);
|
|
|
return login;
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 通过前缀查询店铺信息
|
|
|
+ */
|
|
|
+ @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;
|
|
|
+ }
|
|
|
}
|