资源简介

校园跑腿(后台+微信小程序).zip

资源截图

代码片段和文件信息

package controller;

import com.alibaba.fastjson.JSONobject;
import mapper.DishesMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;
import pojo.Dishes;
import sun.misc.base64Encoder;

import javax.servlet.http.HttpServletRequest;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.math.BigDecimal;
import java.util.*;

@Controller
@RequestMapping(“dishes“)
public class DishesController {
    @Autowired
    private DishesMapper dishesMapper;
    @RequestMapping(“getList“)
    @ResponseBody
    public object getList(){
        return dishesMapper.selectByPrimaryKey();
    }
    @RequestMapping(“save“)
    @ResponseBody
    public void getList(@RequestBody Dishes dishes){
        if (dishes.getId()!=null){
            dishesMapper.updateByPrimaryKeySelective(dishes);
        }else {
            dishesMapper.insertSelective(dishes);
        }
    }
    @RequestMapping(“del“)
    @ResponseBody
    public void del(@RequestBody Dishes dishes){
            dishesMapper.deleteByPrimaryKey(dishes.getId());
    }
    @ResponseBody
    @RequestMapping(“upload“)
    public JSONobject upload(@RequestBody MultipartFile file HttpServletRequest request) throws Exception {
        String oldFileName=file.getOriginalFilename();
        String newFileName= UUID.randomUUID().toString()+oldFileName.substring(oldFileName.indexOf(“.“)oldFileName.length());
        String path=request.getSession().getServletContext().getRealPath(“/static“)+ File.separator+newFileName;
        File file1=new File(path);
        if (!file1.isDirectory()){
            file1.mkdirs();
        }
        file.transferTo(file1);
        JSONobject resObj = new JSONobject();
        resObj.put(“code“ “0“);
        resObj.put(“msg“ “上传成功“);
        resObj.put(“src“ newFileName);
        return resObj;
    }

    @RequestMapping(“wxShow“)
    @ResponseBody
    public object wxShow(String name){
        List getList=dishesMapper.getList(name);
        List maps=new ArrayList<>();
        for (Dishes d :
                getList) {
            Map map=new HashMap();
            map.put(“id“d.getId());
            map.put(“name“d.getName());
            map.put(“canteen“d.getCanteen());
            map.put(“money“d.getMoney());
            map.put(“ms“d.getMs());
            map.put(“path“d.getPath());
            map.put(“num“0);
            maps.add(map);
        }
        return maps;
    }
    @RequestMapping(“obtainDishes“)
    @ResponseBody
    public object obtainDishes(String cartname){
        List

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2019-08-20 15:07  校园跑腿(后台+微信小程序)\
     目录           0  2019-08-16 09:29  校园跑腿(后台+微信小程序)\demo\
     目录           0  2019-10-13 02:58  校园跑腿(后台+微信小程序)\demo\.idea\
     目录           0  2019-08-11 16:51  校园跑腿(后台+微信小程序)\demo\.idea\artifacts\
     文件         491  2019-08-11 16:51  校园跑腿(后台+微信小程序)\demo\.idea\artifacts\demo_war_exploded.xml
     文件         624  2019-08-11 16:51  校园跑腿(后台+微信小程序)\demo\.idea\checkstyle-idea.xml
     目录           0  2019-08-11 16:51  校园跑腿(后台+微信小程序)\demo\.idea\inspectionProfiles\
     文件        1444  2019-08-11 16:51  校园跑腿(后台+微信小程序)\demo\.idea\inspectionProfiles\Project_Default.xml
     文件         278  2019-08-11 16:51  校园跑腿(后台+微信小程序)\demo\.idea\misc.xml
     文件         255  2019-08-11 16:51  校园跑腿(后台+微信小程序)\demo\.idea\modules.xml
     文件       47845  2019-10-13 02:58  校园跑腿(后台+微信小程序)\demo\.idea\workspace.xml
     文件          12  2019-08-16 09:26  校园跑腿(后台+微信小程序)\demo\company.txt
     文件        8749  2019-08-13 13:06  校园跑腿(后台+微信小程序)\demo\demo.iml
     目录           0  2019-08-11 16:58  校园跑腿(后台+微信小程序)\demo\out\
     目录           0  2019-08-11 16:58  校园跑腿(后台+微信小程序)\demo\out\artifacts\
     目录           0  2019-09-18 11:53  校园跑腿(后台+微信小程序)\demo\out\artifacts\demo_war_exploded\
     文件        1687  2019-08-19 14:34  校园跑腿(后台+微信小程序)\demo\out\artifacts\demo_war_exploded\admin.jsp
     文件        1144  2019-08-20 11:41  校园跑腿(后台+微信小程序)\demo\out\artifacts\demo_war_exploded\adminnav.jsp
     文件         510  2019-08-11 17:01  校园跑腿(后台+微信小程序)\demo\out\artifacts\demo_war_exploded\adminwelcome.jsp
     目录           0  2019-09-18 11:53  校园跑腿(后台+微信小程序)\demo\out\artifacts\demo_war_exploded\css\
     文件        5724  2015-11-18 11:22  校园跑腿(后台+微信小程序)\demo\out\artifacts\demo_war_exploded\css\public.css
     文件        9337  2019-05-18 23:13  校园跑腿(后台+微信小程序)\demo\out\artifacts\demo_war_exploded\css\style.css
     文件       15126  2019-08-20 11:01  校园跑腿(后台+微信小程序)\demo\out\artifacts\demo_war_exploded\dishesList.jsp
     目录           0  2019-09-18 11:53  校园跑腿(后台+微信小程序)\demo\out\artifacts\demo_war_exploded\img\
     文件        2246  2015-11-16 14:49  校园跑腿(后台+微信小程序)\demo\out\artifacts\demo_war_exploded\img\buy.png
     文件       22016  2015-11-16 16:02  校园跑腿(后台+微信小程序)\demo\out\artifacts\demo_war_exploded\img\clock.jpg
     文件       41921  2015-11-13 09:46  校园跑腿(后台+微信小程序)\demo\out\artifacts\demo_war_exploded\img\formBg.png
     文件        5294  2015-11-16 17:05  校园跑腿(后台+微信小程序)\demo\out\artifacts\demo_war_exploded\img\gys.png
     文件        3667  2015-11-17 09:21  校园跑腿(后台+微信小程序)\demo\out\artifacts\demo_war_exploded\img\home.png
     文件        2902  2015-11-16 14:26  校园跑腿(后台+微信小程序)\demo\out\artifacts\demo_war_exploded\img\leftBg.png
     文件       18389  2015-11-10 08:48  校园跑腿(后台+微信小程序)\demo\out\artifacts\demo_war_exploded\img\loginBg.jpg
............此处省略867个文件信息

评论

共有 条评论