| | |
| | | import java.util.List;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | | import javax.servlet.http.HttpServletRequest;
|
| | | import javax.servlet.http.HttpServletResponse;
|
| | |
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | | import org.springframework.stereotype.Controller;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.springframework.web.bind.annotation.RequestParam;
|
| | | import org.springframework.web.multipart.commons.CommonsMultipartFile;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | |
|
| | | import com.google.gson.Gson;
|
| | |
| | | import com.google.gson.reflect.TypeToken;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.HomeNavbar;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.SuperHomeNavbar;
|
| | | import com.yeshi.fanli.entity.common.AdminUser;
|
| | | import com.yeshi.fanli.entity.system.System;
|
| | | import com.yeshi.fanli.service.AdminUserService;
|
| | | import com.yeshi.fanli.service.inter.config.SystemService;
|
| | | import com.yeshi.fanli.service.inter.homemodule.HomeNavbarService;
|
| | | import com.yeshi.fanli.service.inter.homemodule.SuperHomeNavbarService;
|
| | | import com.yeshi.fanli.tag.PageEntity;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.annotation.RequestNoLogin;
|
| | |
|
| | | @Controller
|
| | | @RequestMapping("admin/new/api/v1/navbar")
|
| | |
| | |
|
| | | @Resource
|
| | | private SystemService systemService;
|
| | | |
| | | @Resource
|
| | | private AdminUserService adminUserService;
|
| | |
|
| | | @Resource
|
| | | private HomeNavbarService homeNavbarService;
|
| | |
| | | }
|
| | |
|
| | | Integer oldOrder = resultObj.getOrderby();
|
| | | List<HomeNavbar> list = homeNavbarService.getChangeOrder(id, moveType, oldOrder);
|
| | | List<HomeNavbar> list = homeNavbarService.getChangeOrder(moveType, oldOrder);
|
| | |
|
| | | if (list != null && list.size() > 0) {
|
| | | HomeNavbar changeObj = list.get(0);
|
| | |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("删除失败"));
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | |
| | | /**
|
| | | * 专题图片上传
|
| | | * @param file
|
| | | * @param uid
|
| | | * @param id
|
| | | * @param request
|
| | | * @param response
|
| | | * @param out
|
| | | */
|
| | | @RequestNoLogin()
|
| | | @RequestMapping(value = "uploadPic")
|
| | | public void uploadPic(@RequestParam("file") CommonsMultipartFile file, Long uid,
|
| | | Long id, HttpServletRequest request, HttpServletResponse response, PrintWriter out) {
|
| | | |
| | | response.setHeader("Access-Control-Allow-Origin", "*");
|
| | | response.setHeader("Access-Control-Allow-Methods", "*");
|
| | |
|
| | | AdminUser admin = adminUserService.selectByPrimaryKey(uid);
|
| | | if (admin == null) {
|
| | | out.print(JsonUtil.loadFalseResult("当前账户验证失败"));
|
| | | return;
|
| | | }
|
| | | |
| | | if (file == null) {
|
| | | out.print(JsonUtil.loadFalseResult("上传文件为空"));
|
| | | return;
|
| | | }
|
| | | |
| | | if (id == null) {
|
| | | out.print(JsonUtil.loadFalseResult("ID不能为空"));
|
| | | return;
|
| | | }
|
| | | |
| | | try {
|
| | | |
| | | HomeNavbar resultObj = homeNavbarService.selectByPrimaryKey(id);
|
| | | if (resultObj == null) {
|
| | | out.print(JsonUtil.loadFalseResult("操作数据已不存在"));
|
| | | return;
|
| | | }
|
| | | |
| | | homeNavbarService.uploadPicture(file, resultObj);
|
| | | out.print(JsonUtil.loadTrueResult("上传成功"));
|
| | | |
| | | } catch (Exception e) {
|
| | | out.print(JsonUtil.loadFalseResult("操作失败"));
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | }
|