yujian
2019-01-22 88b54772dbcf5ecab1e2316e4e4626ac901b8908
fanli/src/main/java/com/yeshi/fanli/controller/admin/ConfigAdminController.java
@@ -6,24 +6,20 @@
import java.util.Map;
import javax.annotation.Resource;
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.RequestMethod;
import org.yeshi.utils.JsonUtil;
import com.yeshi.fanli.entity.common.AdminUser;
import com.yeshi.fanli.entity.common.Config;
import com.yeshi.fanli.service.AdminUserService;
import com.yeshi.fanli.service.inter.config.ConfigService;
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;
import org.yeshi.utils.JsonUtil;
@Controller
@RequestMapping("admin/new/api/v1/config")
@@ -85,8 +81,11 @@
            return;
         }
         
         int pageSize = Constant.PAGE_SIZE;
         int count = configService.getCount(key, pageIndex);
         PageEntity pe = new PageEntity(pageIndex, Constant.PAGE_SIZE, count);
         int totalPage = (int) (count % pageSize == 0 ? count / pageSize : count / pageSize + 1);
         PageEntity pe = new PageEntity(pageIndex, pageSize, count, totalPage);
         
         JSONObject data = new JSONObject();
         data.put("pe", pe);
@@ -106,19 +105,9 @@
    * @param config
    * @param out
    */
   @RequestNoLogin()
   @RequestMapping(value = "saveModify")
   public void saveModify(String callback, Config config, Long uid, HttpServletResponse response, PrintWriter out) {
      response.setHeader("Access-Control-Allow-Origin", "*");
      response.setHeader("Access-Control-Allow-Methods", "*");
   public void saveModify(String callback, Config config, PrintWriter out) {
      AdminUser admin = adminUserService.selectByPrimaryKey(uid);
      if (admin == null) {
         out.print(JsonUtil.loadFalseResult("当前账户验证失败"));
         return;
      }
      Long id = config.getId();
      if (id == null) {
         JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("ID不能为空"));