package com.dsh.guns.modular.system.controller.code; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.dsh.course.feignClient.course.CoursePackageTypeClient; import com.dsh.course.feignClient.course.model.TCoursePackageType; import com.dsh.guns.modular.system.service.ICoursePackageService; import com.dsh.guns.modular.system.service.IStoreService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import javax.annotation.Resource; import java.util.List; import java.util.Map; /** * @author zhibing.pu * @Date 2023/8/1 11:50 */ @Controller @RequestMapping("/coursePackage") public class TCoursePackageController { private String PREFIX = "/system/coursePackage/"; @Autowired private ICoursePackageService coursePackageService; @Resource private CoursePackageTypeClient coursePackageTypeClient; @Autowired private IStoreService storeService; /** * 跳转到列表页 * @param model * @return */ @GetMapping("/openCoursePackageListPage") public String openCoursePackageListPage(Model model){ List tCoursePackageTypes = coursePackageTypeClient.queryAllCoursePackageType(); model.addAttribute("coursePackageType", tCoursePackageTypes); List> list = storeService.queryProvince(); model.addAttribute("province", list); return PREFIX + "coursePackage.html"; } /** * 获取城市列表 * @param code * @return */ @ResponseBody @PostMapping("/queryCity") public List> queryCity(Integer code){ return storeService.queryCity(code); } /** * 获取列表数据 * @param provinceCode * @param cityCode * @param coursePackageTypeId * @param name * @param status * @param state * @return */ @ResponseBody @PostMapping("/queryCoursePackageLists") public Object queryCoursePackageLists(String provinceCode, String cityCode, Integer coursePackageTypeId, String name, Integer status, Integer state){ Page> mapPage = coursePackageService.queryCoursePackageLists(provinceCode, cityCode, coursePackageTypeId, name, status, state); return mapPage; } }