parent
1dd176a1af
commit
8dddea3bf5
|
@ -9,6 +9,8 @@ import io.swagger.v3.oas.annotations.tags.Tag;
|
|||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Tag(name = "品牌管理")
|
||||
@RestController
|
||||
@RequestMapping(value = "/admin/product/brand")
|
||||
|
@ -43,4 +45,11 @@ public class BrandController {
|
|||
brandService.deleteById(id);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@Operation(summary = "品牌列表", description = "品牌列表接口")
|
||||
@GetMapping("findAll")
|
||||
public Result<List<Brand>> findAll() {
|
||||
List<Brand> list = brandService.findAll();
|
||||
return Result.success(list);
|
||||
}
|
||||
}
|
|
@ -32,4 +32,11 @@ public interface BrandMapper {
|
|||
* @param id 品牌id
|
||||
*/
|
||||
void deleteById(Long id);
|
||||
|
||||
/**
|
||||
* 品牌列表
|
||||
*
|
||||
* @return 品牌列表
|
||||
*/
|
||||
List<Brand> findAll();
|
||||
}
|
||||
|
|
|
@ -3,6 +3,8 @@ package com.atguigu.spzx.manger.service;
|
|||
import com.atguigu.spzx.model.entity.product.Brand;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface BrandService {
|
||||
/**
|
||||
* 品牌列表查询
|
||||
|
@ -33,4 +35,11 @@ public interface BrandService {
|
|||
* @param id 品牌id
|
||||
*/
|
||||
void deleteById(Long id);
|
||||
|
||||
/**
|
||||
* 品牌列表
|
||||
*
|
||||
* @return 品牌列表
|
||||
*/
|
||||
List<Brand> findAll();
|
||||
}
|
||||
|
|
|
@ -68,4 +68,14 @@ public class BrandServiceImpl implements BrandService {
|
|||
emptyUtil.isEmpty(id, MessageConstant.DELETE_ID_IS_NOT_EMPTY);
|
||||
brandMapper.deleteById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 品牌列表
|
||||
*
|
||||
* @return 品牌列表
|
||||
*/
|
||||
@Override
|
||||
public List<Brand> findAll() {
|
||||
return brandMapper.findAll();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -42,4 +42,11 @@
|
|||
where is_deleted = 0
|
||||
order by id desc
|
||||
</select>
|
||||
|
||||
<!-- 品牌列表 -->
|
||||
<select id="findAll" resultType="com.atguigu.spzx.model.entity.product.Brand">
|
||||
select
|
||||
<include refid="columns"/>
|
||||
from brand where is_deleted = 0 order by id desc
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
Loading…
Reference in New Issue