首页>代码>ssm教材管理系统>/src/main/java/com/dev/books/controller/CollegeController.java
package com.dev.books.controller;

import com.alibaba.fastjson.JSON;
import com.dev.books.pojo.College;
import com.dev.books.service.CollegeService;
import com.dev.books.util.Layui;
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.ResponseBody;

import java.util.List;

@Controller
public class CollegeController {
    @Autowired
    CollegeService collegeService;

    @ResponseBody
    @RequestMapping(value = "/getAllCollege",produces="application/json;charset=UTF-8")
    public String getAllCollege(){
        List<College> colleges = collegeService.findAllCollege();
        Layui l = Layui.data(colleges.size(), colleges);
        return JSON.toJSONString(l);
    }
}
最近下载更多
WBelong  LV7 3月29日
qiyrt1  LV3 2月20日
森sdfgf  LV8 2月5日
吞吞吐吐她  LV4 1月18日
胖胖1234  LV1 1月7日
Camellia-while  LV1 1月2日
mq2112  LV2 2023年12月16日
2775645521  LV4 2023年11月28日
kxjh星辰  LV6 2023年10月25日
dev1ce123  LV4 2023年10月17日
最近浏览更多
zolscy  LV12 4月11日
dhcpsl  LV2 4月10日
xiongM  LV3 4月4日
玖零定制问题修复  LV34 4月4日
wddq123 4月2日
暂无贡献等级
sgjvdunjx 3月26日
暂无贡献等级
暂无贡献等级
m5433660  LV1 3月26日
123dwda 3月17日
暂无贡献等级
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友