资源简介

ssm框架 java语言 log日志 hui-admin框架 界面简洁 可以用于学习 idea开发 导入即可

资源截图

代码片段和文件信息

package ssm.api;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONobject;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import ssm.bean.Car;
import ssm.service.ICarService;
import ssm.util.DateUtils;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;
import java.util.List;

/**
 * @Author: zhuzhengjin
 * @Date: 2018/3/12 15:17
 * @Description
 */
@Controller
@RequestMapping(“/carApi“)
public class CarApi {
    @Resource
    private ICarService carService;

    /**
     * 获取全部数据接口
     * @param request
     * @param response
     * @return
     * @throws UnsupportedEncodingException
     */
    @RequestMapping(“/getCarAll“)
    @ResponseBody
    public JSONobject getAll(HttpServletRequest request HttpServletResponse response) throws UnsupportedEncodingException {
        request.setCharacterEncoding(“UTF-8“);
        JSONobject jsonobject = new JSONobject();
        List cars = carService.getAll();
        jsonobject.put(“cars“ cars);
        return jsonobject;
    }

    /**
     * 获取某条记录时间接口
     * @param request
     * @param response
     * @return
     * @throws IOException
     */
    @RequestMapping(“/getCar“)
    @ResponseBody
    public JSONobject getCar(HttpServletRequest request HttpServletResponse response) throws IOException {
        JSONobject jsonobject = new JSONobject();
        request.setCharacterEncoding(“UTF-8“);
        BufferedReader reader = new BufferedReader(new InputStreamReader(request.getInputStream() “utf-8“));
        String jsonStr = null;
        StringBuilder result = new StringBuilder();
        try {
            while ((jsonStr = reader.readLine()) != null){
                result.append(jsonStr);
            }
        }catch (Exception e){
            e.printStackTrace();
        }
        reader.close();

        JSONobject carJsonobject = JSONobject.parseobject(result.toString());

        Car newCar = carService.getEditInfo(carJsonobject.getInteger(“carId“));
        jsonobject.put(“car“ newCar);
        return jsonobject;
    }

    /**
     * 推送接口,支持一条或者多条数据
     * @param request
     * @param response
     * @return
     * @throws IOException
     */
    @RequestMapping(“/postCarList“)
    @ResponseBody
    public JSONobject postCarList(HttpServletRequest request HttpServletResponse response) throws IOException {
        JSONobject jsonobject = new JSONobject();
        request.setCharacterEncoding(“UTF-8“);
        BufferedReader reader = new BufferedReader(new InputStreamReader(request.getInputStream()“utf-8“));
        String jsonStr = null

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2018-06-13 14:19  Car4s\.git\
     文件         101  2018-03-16 17:59  Car4s\.git\COMMIT_EDITMSG
     文件         300  2018-02-24 17:05  Car4s\.git\config
     文件          73  2018-02-24 17:04  Car4s\.git\description
     文件          95  2018-03-14 18:47  Car4s\.git\FETCH_HEAD
     文件          23  2018-02-24 17:05  Car4s\.git\HEAD
     目录           0  2018-02-24 17:04  Car4s\.git\hooks\
     文件         478  2018-02-24 17:04  Car4s\.git\hooks\applypatch-msg.sample
     文件         896  2018-02-24 17:04  Car4s\.git\hooks\commit-msg.sample
     文件         189  2018-02-24 17:04  Car4s\.git\hooks\post-update.sample
     文件         424  2018-02-24 17:04  Car4s\.git\hooks\pre-applypatch.sample
     文件        1642  2018-02-24 17:04  Car4s\.git\hooks\pre-commit.sample
     文件        1239  2018-02-24 17:04  Car4s\.git\hooks\prepare-commit-msg.sample
     文件        1348  2018-02-24 17:04  Car4s\.git\hooks\pre-push.sample
     文件        4951  2018-02-24 17:04  Car4s\.git\hooks\pre-rebase.sample
     文件         544  2018-02-24 17:04  Car4s\.git\hooks\pre-receive.sample
     文件        3610  2018-02-24 17:04  Car4s\.git\hooks\update.sample
     文件      165634  2018-03-19 10:30  Car4s\.git\index
     目录           0  2018-02-24 17:04  Car4s\.git\info\
     文件         240  2018-02-24 17:04  Car4s\.git\info\exclude
     目录           0  2018-02-24 17:05  Car4s\.git\logs\
     文件         596  2018-03-16 17:59  Car4s\.git\logs\HEAD
     目录           0  2018-02-24 17:05  Car4s\.git\logs\refs\
     目录           0  2018-02-24 17:05  Car4s\.git\logs\refs\heads\
     文件         596  2018-03-16 17:59  Car4s\.git\logs\refs\heads\master
     目录           0  2018-02-24 17:05  Car4s\.git\logs\refs\remotes\
     目录           0  2018-02-24 19:24  Car4s\.git\logs\refs\remotes\origin\
     文件         180  2018-02-24 17:05  Car4s\.git\logs\refs\remotes\origin\HEAD
     文件         301  2018-03-16 17:59  Car4s\.git\logs\refs\remotes\origin\master
     目录           0  2018-03-16 17:59  Car4s\.git\objects\
     目录           0  2018-03-15 14:01  Car4s\.git\objects\08\
............此处省略3108个文件信息

评论

共有 条评论