Browse Source

获取品牌

master
dimengzhe 1 year ago
parent
commit
8c266a2775
  1. 1
      src/main/java/com/yxt/yythmall/config/SaTokenConfigure.java
  2. 8
      src/main/java/com/yxt/yythmall/mallplus/biz/pms/controller/PmsBrandController.java
  3. 4
      src/main/java/com/yxt/yythmall/mallplus/biz/pms/service/IPmsBrandService.java
  4. 9
      src/main/java/com/yxt/yythmall/mallplus/biz/pms/service/impl/PmsBrandServiceImpl.java
  5. 18
      src/main/java/com/yxt/yythmall/mallplus/mbg/pms/entity/brand/BrandVo.java
  6. 4
      src/main/java/com/yxt/yythmall/mallplus/mbg/pms/mapper/PmsBrandMapper.java
  7. 3
      src/main/java/com/yxt/yythmall/mallplus/mbg/pms/mapper/PmsBrandMapper.xml

1
src/main/java/com/yxt/yythmall/config/SaTokenConfigure.java

@ -82,6 +82,7 @@ public class SaTokenConfigure implements WebMvcConfigurer {
.excludePathPatterns("/lpkcustomer/getPhoneNumber")
.excludePathPatterns("/lpkcustomer/getRealInfo/**")
.excludePathPatterns("/lpkcustomer/saveRealInfo")
.excludePathPatterns("/pms/PmsBrand/getList")
;
}
}

8
src/main/java/com/yxt/yythmall/mallplus/biz/pms/controller/PmsBrandController.java

@ -3,8 +3,10 @@ package com.yxt.yythmall.mallplus.biz.pms.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
// import com.zscat.mallplus.annotation.SysLog;
import com.yxt.common.core.result.ResultBean;
import com.yxt.yythmall.mallplus.mbg.pms.entity.PmsBrand;
import com.yxt.yythmall.mallplus.biz.pms.service.IPmsBrandService;
import com.yxt.yythmall.mallplus.mbg.pms.entity.brand.BrandVo;
import com.zscat.mallplus.utils.CommonResult;
import com.zscat.mallplus.utils.ValidatorUtils;
import io.swagger.annotations.Api;
@ -159,4 +161,10 @@ public class PmsBrandController {
return new CommonResult().failed();
}
}
@ApiOperation(value = "获取品牌")
@GetMapping("/getList")
ResultBean<List<BrandVo>> getList(){
return IPmsBrandService.getList();
}
}

4
src/main/java/com/yxt/yythmall/mallplus/biz/pms/service/IPmsBrandService.java

@ -1,7 +1,9 @@
package com.yxt.yythmall.mallplus.biz.pms.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yxt.common.core.result.ResultBean;
import com.yxt.yythmall.mallplus.mbg.pms.entity.PmsBrand;
import com.yxt.yythmall.mallplus.mbg.pms.entity.brand.BrandVo;
import java.util.List;
@ -18,4 +20,6 @@ public interface IPmsBrandService extends IService<PmsBrand> {
int updateShowStatus(List<Long> ids, Integer showStatus);
int updateFactoryStatus(List<Long> ids, Integer factoryStatus);
ResultBean<List<BrandVo>> getList();
}

9
src/main/java/com/yxt/yythmall/mallplus/biz/pms/service/impl/PmsBrandServiceImpl.java

@ -2,7 +2,9 @@ package com.yxt.yythmall.mallplus.biz.pms.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yxt.common.core.result.ResultBean;
import com.yxt.yythmall.mallplus.mbg.pms.entity.PmsBrand;
import com.yxt.yythmall.mallplus.mbg.pms.entity.brand.BrandVo;
import com.yxt.yythmall.mallplus.mbg.pms.mapper.PmsBrandMapper;
import com.yxt.yythmall.mallplus.biz.pms.service.IPmsBrandService;
import org.springframework.stereotype.Service;
@ -37,4 +39,11 @@ public class PmsBrandServiceImpl extends ServiceImpl<PmsBrandMapper, PmsBrand> i
pmsBrand.setFactoryStatus(factoryStatus);
return brandMapper.update(pmsBrand, new QueryWrapper<PmsBrand>().in("id", ids));
}
@Override
public ResultBean<List<BrandVo>> getList() {
ResultBean<List<BrandVo>> rb = ResultBean.fireFail();
List<BrandVo> brandVoList = baseMapper.getList();
return rb.success().setData(brandVoList);
}
}

18
src/main/java/com/yxt/yythmall/mallplus/mbg/pms/entity/brand/BrandVo.java

@ -0,0 +1,18 @@
package com.yxt.yythmall.mallplus.mbg.pms.entity.brand;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @description:
* @author: dimengzhe
* @date: 2024/1/19
**/
@Data
public class BrandVo {
@ApiModelProperty("品牌名称")
private String brandName;
@ApiModelProperty("品牌id")
private String id;
}

4
src/main/java/com/yxt/yythmall/mallplus/mbg/pms/mapper/PmsBrandMapper.java

@ -2,8 +2,11 @@ package com.yxt.yythmall.mallplus.mbg.pms.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yxt.yythmall.mallplus.mbg.pms.entity.PmsBrand;
import com.yxt.yythmall.mallplus.mbg.pms.entity.brand.BrandVo;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* <p>
* 品牌表 Mapper 接口
@ -15,4 +18,5 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface PmsBrandMapper extends BaseMapper<PmsBrand> {
List<BrandVo> getList();
}

3
src/main/java/com/yxt/yythmall/mallplus/mbg/pms/mapper/PmsBrandMapper.xml

@ -23,4 +23,7 @@
brand_story
</sql>
<select id="getList" resultType="com.yxt.yythmall.mallplus.mbg.pms.entity.brand.BrandVo">
select name brandName,id from pms_brand
</select>
</mapper>

Loading…
Cancel
Save