dev798
parent
a0ab257929
commit
fb716982f1
|
@ -7,8 +7,10 @@ import com.muyu.product.domain.DTO.Services;
|
|||
import com.muyu.product.domain.vo.ProductCategoryVo;
|
||||
import com.muyu.product.service.ArgumentService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
|
@ -29,20 +31,23 @@ public class ArgumentController {
|
|||
@Autowired
|
||||
private ArgumentService argumentService;
|
||||
|
||||
@GetMapping("/queryBrand")
|
||||
public AjaxResult queryBrand(){
|
||||
List<Brand>list = argumentService.queryBrand();
|
||||
@ApiOperation("品牌下拉框查询")
|
||||
@GetMapping("/queryBrand/{brandName}")
|
||||
public AjaxResult queryBrand(@PathVariable String brandName){
|
||||
List<Brand>list = argumentService.queryBrand(brandName);
|
||||
return success(list);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/queryService")
|
||||
@ApiOperation("查询服务")
|
||||
public AjaxResult queryService(){
|
||||
List<Services>list=argumentService.queryService();
|
||||
return success(list);
|
||||
}
|
||||
|
||||
@GetMapping("/queryCategory")
|
||||
@ApiOperation("分类查询")
|
||||
public R<List<ProductCategoryVo>>queryCategory(){
|
||||
return R.ok(argumentService.queryCategory());
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@ import com.muyu.product.domain.DTO.Brand;
|
|||
import com.muyu.product.domain.DTO.Category;
|
||||
import com.muyu.product.domain.DTO.Services;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -13,7 +14,7 @@ import java.util.List;
|
|||
*/
|
||||
@Mapper
|
||||
public interface ArgumentMapper {
|
||||
List<Brand> queryBrand();
|
||||
List<Brand> queryBrand(@PathVariable String brandName);
|
||||
|
||||
List<Services> queryService();
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ import java.util.List;
|
|||
* @Date: 2024/3/29 17:05
|
||||
*/
|
||||
public interface ArgumentService {
|
||||
List<Brand> queryBrand();
|
||||
List<Brand> queryBrand(String brandName);
|
||||
|
||||
List<Services> queryService();
|
||||
|
||||
|
|
|
@ -23,8 +23,8 @@ public class ArgumentServiceImpl implements ArgumentService {
|
|||
@Autowired
|
||||
private ArgumentMapper argumentMapper;
|
||||
@Override
|
||||
public List<Brand> queryBrand() {
|
||||
return argumentMapper.queryBrand();
|
||||
public List<Brand> queryBrand(String brandName) {
|
||||
return argumentMapper.queryBrand(brandName);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -22,11 +22,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
|
||||
<select id="queryService" resultType="com.muyu.product.domain.DTO.Services">
|
||||
select id,service_name from
|
||||
t_product_service
|
||||
t_product_service where id_delete =1
|
||||
</select>
|
||||
|
||||
<select id="queryCategory" resultType="com.muyu.product.domain.DTO.Category">
|
||||
select id,parent_id,category_name from t_product_category
|
||||
select id,parent_id,category_name from t_product_category where id_delete =1
|
||||
</select>
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue