123456789101112131415161718192021222324252627282930313233343536373839404142 |
- package com.caimei.www.controller;
- import com.caimei.www.mapper.ProductDao;
- import com.caimei.www.pojo.JsonModel;
- import com.caimei.www.pojo.classify.Bigtype;
- import com.caimei.www.pojo.classify.SmallType;
- import org.springframework.stereotype.Controller;
- import org.springframework.web.bind.annotation.GetMapping;
- import org.springframework.web.bind.annotation.RequestMapping;
- import org.springframework.web.bind.annotation.ResponseBody;
- import javax.annotation.Resource;
- import java.util.List;
- /**
- * Description
- *
- * @author : plf
- * @date : 2020/12/23
- */
- @Controller
- @RequestMapping("classification")
- public class ClassificationController extends BaseController {
- @Resource
- private ProductDao productDao;
- @GetMapping("/select.html")
- public String selectUp() {
- return "help/select";
- }
- @GetMapping("bigTypeData")
- @ResponseBody
- public JsonModel bigTypeData(){
- List<Bigtype> bigtypeList = productDao.findBigtype();
- bigtypeList.forEach((bigtype)->{
- List<SmallType> smallTypes = productDao.findSmalltype();
- bigtype.setSmallTypes(smallTypes);
- });
- return JsonModel.success(bigtypeList);
- }
- }
|