src/com/cms/controller/BaseCourseController.java
(开头部分) 4KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
package com.cms.controller;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.servlet.ModelAndView;
import com.alibaba.fastjson.JSON;
import com.cms.entity.BaseCourse;
import com.cms.service.BaseCourseService;
import com.cms.utils.StrUtil;
import com.cms.utils.page.Pagination;
@Controller
@RequestMapping(value="/basecourse")
public class BaseCourseController {
@Autowired
private BaseCourseService baseCourseService;
@ResponseBody
@RequestMapping(value="/list")
public String getBaseCourseList(@RequestParam(defaultValue="0")int curr,@RequestParam(defaultValue="10")int nums,
@RequestParam(defaultValue="")String searchKey) {
Pagination<BaseCourse> page = new Pagination<BaseCourse>();
page.setTotalItemsCount(baseCourseService.getTotalItemsCount(searchKey));
page.setPageSize(nums);
page.setPageNum(curr);
List<BaseCourse> list = baseCourseService.getBaseCourse(page, searchKey);
String jsonStr = StrUtil.RETURN_JONS_PRE_STR + page.getTotalItemsCount()
+ StrUtil.RETURN_JONS_MID_STR
+ JSON.toJSONString(list) + StrUtil.RETURN_JONS_END_STR;
System.out.println(jsonStr);
return jsonStr;
}
@ResponseBody
@RequestMapping(value="/listForSelect")
public String getBaseCourseListForSelect(@RequestParam(defaultValue="") String searchKey) {
List<BaseCourse> list = baseCourseService.getBaseCourseForSelect(searchKey);
String jsonStr = StrUtil.RETURN_JONS_PRE_STR + list.size()
+ StrUtil.RETURN_JONS_MID_STR
+ JSON.toJSONString(list) + StrUtil.RETURN_JONS_END_STR;
return jsonStr;
}
后面还有 97 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。