@@ -0,0 +1,1757 @@
+package com.shaozilee.dada.controller;%0A%0Aimport com.shaozilee.dada.utils.AjaxCode;%0Aimport com.shaozilee.dada.utils.Config;%0Aimport com.shaozilee.dada.utils.Uploader;%0Aimport org.apache.logging.log4j.LogManager;%0Aimport org.apache.logging.log4j.Logger;%0Aimport org.json.JSONObject;%0Aimport org.springframework.stereotype.Controller;%0Aimport org.springframework.ui.Model;%0Aimport org.springframework.web.bind.annotation.RequestMapping;%0A%0Aimport javax.servlet.http.HttpServletRequest;%0Aimport javax.servlet.http.HttpServletResponse;%0Aimport java.io.IOException;%0Aimport java.util.HashMap;%0A%0A/**%0A * Created by lee on 15-9-13.%0A */%0A%0A@Controller%0Apublic class AttachmentController extends AbstractController%7B%0A    public static Logger logger = LogManager.getLogger(AttachmentController.class);%0A%0A    @RequestMapping(%22/doUploadImage%22)%0A    public void doUploadImage(HttpServletRequest request,HttpServletResponse response,Model model) throws Exception%7B%0A        String savePath = Config.get(%22attachment.path%22);%0A        Uploader up = new Uploader(request);%0A        up.setSavePath(savePath);%0A        up.setMaxSize(2000);%0A        up.upload();%0A%0A        HashMap map = new HashMap();%0A        map.put(%22code%22,AjaxCode.SUC);%0A        map.put(%22name%22,up.getFileName());%0A        map.put(%22originalName%22,up.getOriginalName());%0A        map.put(%22size%22,up.getSize());%0A        map.put(%22state%22,up.getState());%0A        map.put(%22type%22,up.getType());%0A        map.put(%22url%22,up.getUrl());%0A%0A        JSONObject resp = new JSONObject(map);%0A        String jsonStr = resp.toString();%0A        try%7B%0A            response.getWriter().write(jsonStr);%0A            response.getWriter().close();%0A        %7Dcatch (IOException e)%7B%0A            logger.error(e.getMessage());%0A        %7D%0A%0A        logger.debug(jsonStr);%0A    %7D%0A%0A%7D%0A

add AttachmentController