dev-v2 #3

Merged
bunny merged 122 commits from dev-v2 into master-v2 2024-03-30 23:40:58 +08:00
5 changed files with 42 additions and 0 deletions
Showing only changes of commit 8dddea3bf5 - Show all commits

View File

@ -9,6 +9,8 @@ import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.List;
@Tag(name = "品牌管理") @Tag(name = "品牌管理")
@RestController @RestController
@RequestMapping(value = "/admin/product/brand") @RequestMapping(value = "/admin/product/brand")
@ -43,4 +45,11 @@ public class BrandController {
brandService.deleteById(id); brandService.deleteById(id);
return Result.success(); return Result.success();
} }
@Operation(summary = "品牌列表", description = "品牌列表接口")
@GetMapping("findAll")
public Result<List<Brand>> findAll() {
List<Brand> list = brandService.findAll();
return Result.success(list);
}
} }

View File

@ -32,4 +32,11 @@ public interface BrandMapper {
* @param id 品牌id * @param id 品牌id
*/ */
void deleteById(Long id); void deleteById(Long id);
/**
* 品牌列表
*
* @return 品牌列表
*/
List<Brand> findAll();
} }

View File

@ -3,6 +3,8 @@ package com.atguigu.spzx.manger.service;
import com.atguigu.spzx.model.entity.product.Brand; import com.atguigu.spzx.model.entity.product.Brand;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import java.util.List;
public interface BrandService { public interface BrandService {
/** /**
* 品牌列表查询 * 品牌列表查询
@ -33,4 +35,11 @@ public interface BrandService {
* @param id 品牌id * @param id 品牌id
*/ */
void deleteById(Long id); void deleteById(Long id);
/**
* 品牌列表
*
* @return 品牌列表
*/
List<Brand> findAll();
} }

View File

@ -68,4 +68,14 @@ public class BrandServiceImpl implements BrandService {
emptyUtil.isEmpty(id, MessageConstant.DELETE_ID_IS_NOT_EMPTY); emptyUtil.isEmpty(id, MessageConstant.DELETE_ID_IS_NOT_EMPTY);
brandMapper.deleteById(id); brandMapper.deleteById(id);
} }
/**
* 品牌列表
*
* @return 品牌列表
*/
@Override
public List<Brand> findAll() {
return brandMapper.findAll();
}
} }

View File

@ -42,4 +42,11 @@
where is_deleted = 0 where is_deleted = 0
order by id desc order by id desc
</select> </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> </mapper>