From b9a995aa4014b4fd5c31a744fe702332122c9f23 Mon Sep 17 00:00:00 2001 From: yuanye <418471657@qq.com> Date: Sat, 20 Nov 2021 17:10:41 +0800 Subject: [PATCH] =?UTF-8?q?c=E7=AB=AF=E4=BC=98=E9=80=89=E5=95=86=E5=93=81?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/cweb/config/AuthConfig.java | 2 + .../cweb/controller/HighBrandController.java | 69 +++++++++++++++++++ .../controller/HighGoodsTypeController.java | 69 +++++++++++++++++++ 3 files changed, 140 insertions(+) create mode 100644 hai-cweb/src/main/java/com/cweb/controller/HighBrandController.java create mode 100644 hai-cweb/src/main/java/com/cweb/controller/HighGoodsTypeController.java diff --git a/hai-cweb/src/main/java/com/cweb/config/AuthConfig.java b/hai-cweb/src/main/java/com/cweb/config/AuthConfig.java index a166949d..04aea895 100644 --- a/hai-cweb/src/main/java/com/cweb/config/AuthConfig.java +++ b/hai-cweb/src/main/java/com/cweb/config/AuthConfig.java @@ -122,6 +122,8 @@ public class AuthConfig implements WebMvcConfigurer { .excludePathPatterns("/order/qzOrderToPay") .excludePathPatterns("/czOrder/orderRefundNotify") .excludePathPatterns("/cmsContent/*") + .excludePathPatterns("/highBrand/*") + .excludePathPatterns("/highGoodsType/*") .excludePathPatterns("/sendSms/*") .excludePathPatterns("/test/*") .excludePathPatterns("/sms/*") diff --git a/hai-cweb/src/main/java/com/cweb/controller/HighBrandController.java b/hai-cweb/src/main/java/com/cweb/controller/HighBrandController.java new file mode 100644 index 00000000..810c673e --- /dev/null +++ b/hai-cweb/src/main/java/com/cweb/controller/HighBrandController.java @@ -0,0 +1,69 @@ +package com.cweb.controller; + +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import com.hai.common.exception.ErrorCode; +import com.hai.common.exception.ErrorHelp; +import com.hai.common.exception.SysCode; +import com.hai.common.security.SessionObject; +import com.hai.common.security.UserCenter; +import com.hai.common.utils.ResponseMsgUtil; +import com.hai.entity.HighBrand; +import com.hai.model.ResponseData; +import com.hai.model.UserInfoModel; +import com.hai.service.HighBrandService; +import com.hai.service.HighGoodsTypeService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; + +/** + * @Auther: 袁野 + * @Description: + * @Date: 2021/3/26 23:08 + */ +@Controller +@RequestMapping(value = "/highBrand") +@Api(value = "品牌接口") +public class HighBrandController { + + private static Logger log = LoggerFactory.getLogger(HighMerchantStoreController.class); + + + @Resource + private HighBrandService highBrandService; + + @RequestMapping(value = "/getBrandByList", method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "获取品牌列表") + public ResponseData getBrandByList(@RequestParam(name = "pageNum", required = true) Integer pageNum, + @RequestParam(name = "pageSize", required = true) Integer pageSize, + @RequestParam(name = "title", required = false) String title, + @RequestParam(name = "goodTypeId", required = false) String goodTypeId, + HttpServletRequest request) { + try { + + Map map = new HashMap<>(); + map.put("title", title); + map.put("goodTypeId", goodTypeId); + + PageHelper.startPage(pageNum,pageSize); + return ResponseMsgUtil.success(new PageInfo<>(highBrandService.getListBand(map))); + + } catch (Exception e) { + log.error("HighOrderController --> getUserOrderList() error!", e); + return ResponseMsgUtil.exception(e); + } + } +} diff --git a/hai-cweb/src/main/java/com/cweb/controller/HighGoodsTypeController.java b/hai-cweb/src/main/java/com/cweb/controller/HighGoodsTypeController.java new file mode 100644 index 00000000..be13de46 --- /dev/null +++ b/hai-cweb/src/main/java/com/cweb/controller/HighGoodsTypeController.java @@ -0,0 +1,69 @@ +package com.cweb.controller; + +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import com.hai.common.exception.ErrorCode; +import com.hai.common.exception.ErrorHelp; +import com.hai.common.exception.SysCode; +import com.hai.common.security.SessionObject; +import com.hai.common.security.UserCenter; +import com.hai.common.utils.ResponseMsgUtil; +import com.hai.entity.HighGoodsType; +import com.hai.model.ResponseData; +import com.hai.model.UserInfoModel; +import com.hai.service.HighGoodsTypeService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; + +/** + * @Auther: 袁野 + * @Description: + * @Date: 2021/3/26 23:08 + */ +@Controller +@RequestMapping(value = "/highGoodsType") +@Api(value = "商品类型接口") +public class HighGoodsTypeController { + + private static Logger log = LoggerFactory.getLogger(HighMerchantStoreController.class); + + @Autowired + private UserCenter userCenter; + + @Resource + private HighGoodsTypeService highGoodsTypeService; + + @RequestMapping(value = "/getListGoodsType", method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "获取商品类型列表") + public ResponseData getListGoodsType(@RequestParam(name = "pageNum", required = true) Integer pageNum, + @RequestParam(name = "pageSize", required = true) Integer pageSize, + @RequestParam(name = "title", required = false) String title, + HttpServletRequest request) { + try { + + Map map = new HashMap<>(); + map.put("title", title); + + PageHelper.startPage(pageNum,pageSize); + return ResponseMsgUtil.success(new PageInfo<>(highGoodsTypeService.getListGoodsType(map))); + + } catch (Exception e) { + log.error("HighOrderController --> getUserOrderList() error!", e); + return ResponseMsgUtil.exception(e); + } + } + +}