|
|
@@ -9,11 +9,13 @@ import com.cyksj.common.exception.BusinessRuntimeException;
|
|
|
import com.cyksj.enums.GatewayApiCode;
|
|
|
import com.yhlxj.dao.model.dto.Result;
|
|
|
import com.yhlxj.dao.model.entity.WebInfo;
|
|
|
+import com.yhlxj.dao.model.entity.WholesaleNotice;
|
|
|
import com.yhlxj.dao.model.entity.WholesaleUser;
|
|
|
import com.yhlxj.dao.model.enums.GatewayResponse;
|
|
|
import com.yhlxj.dao.model.request.WholesaleUserReq;
|
|
|
import com.yhlxj.dao.model.view.WebInfoView;
|
|
|
import com.yhlxj.service.wholesale.WebInfoService;
|
|
|
+import com.yhlxj.service.wholesale.WholesaleNoticeService;
|
|
|
import com.yhlxj.service.wholesale.WholesaleUserService;
|
|
|
import com.yhlxj.web.util.StpUserUtil;
|
|
|
import com.yhlxj.web.util.StpWholesaleUtil;
|
|
|
@@ -25,6 +27,7 @@ import org.springframework.web.bind.annotation.*;
|
|
|
import javax.servlet.http.Cookie;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
import javax.validation.constraints.NotNull;
|
|
|
+import java.util.List;
|
|
|
|
|
|
/**
|
|
|
* 用户登录
|
|
|
@@ -43,6 +46,8 @@ public class WholesaleUserController {
|
|
|
|
|
|
private final HttpServletResponse response;
|
|
|
|
|
|
+ private final WholesaleNoticeService wholesaleNoticeService;
|
|
|
+
|
|
|
/**
|
|
|
* 批发网站登录
|
|
|
*/
|
|
|
@@ -80,7 +85,7 @@ public class WholesaleUserController {
|
|
|
if (wholesaleUser.getUsername() == null || !Validator.isEmail(wholesaleUser.getUsername())) {
|
|
|
throw BusinessRuntimeException.getInstance("请输入正确邮箱");
|
|
|
}
|
|
|
- WholesaleUser login = wholesaleUserService.register(wholesaleUser.getUsername(), wholesaleUser.getPassword());
|
|
|
+ WholesaleUser login = wholesaleUserService.register(wholesaleUser.getWholesaleId(),wholesaleUser.getUsername(), wholesaleUser.getPassword());
|
|
|
|
|
|
//写回登陆信息
|
|
|
StpUserUtil.login(login.getId());
|
|
|
@@ -147,4 +152,16 @@ public class WholesaleUserController {
|
|
|
}
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult();
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询公告
|
|
|
+ */
|
|
|
+ @GetMapping("/getNotice")
|
|
|
+ public Result<List<WholesaleNotice>> getNotice(Long wholesaleId,String platform) {
|
|
|
+ List<WholesaleNotice> list = wholesaleNoticeService.list(Wrappers.lambdaQuery(WholesaleNotice.class)
|
|
|
+ .eq(WholesaleNotice::getWholesaleId, wholesaleId)
|
|
|
+ .eq(WholesaleNotice::getPlatform, platform)
|
|
|
+ .eq(WholesaleNotice::getStatus, true));
|
|
|
+ return GatewayResponse.SUCCESS.newBuilder().toResult(list);
|
|
|
+ }
|
|
|
}
|