为了账号安全,请及时绑定邮箱和手机立即绑定

请教一下,谢谢!

请教一下,谢谢!

朴实 2016-10-22 16:57:26
package com.t200.book.controller;import java.text.SimpleDateFormat;import java.util.Date;import java.util.HashMap;import java.util.List;import java.util.Map;import javax.servlet.http.HttpServletRequest;import org.springframework.beans.factory.annotation.Autowired;import org.springframework.stereotype.Controller;import org.springframework.web.bind.annotation.RequestMapping;import org.springframework.web.bind.annotation.ResponseBody;import com.t200.book.service.DetailService;/** * 收入状况相关功能 * @author 马凯   2016-10-14 */@Controller@RequestMapping("/detail")public class DetailController { @Autowired private DetailService detailService; @RequestMapping("/day") public @ResponseBody Object day(HttpServletRequest request){ // SimpleDateFormat sdf = new SimpleDateFormat("yyyy-mm-dd"); //Map<String, Object> params - com.t200.book.controller.DetailController.day(HttpServletRequest) Map<String, Object> params = new HashMap<String, Object>(); //获取日期及作者id String date = request.getParameter("date"); String authorid = request.getParameter("authorid"); //为空或为null if(date==null||"".equals(date)){ date = sdf.format(new Date()); } //赋值   date   params.put("date", date); params.put("authorid", authorid); //调用service List<Map<String, Object>> list = detailService.dayDetail(params); // 清除 params.clear(); // params.put("rows", list);    //请解释一下这段代码 //{rows:[{},{},{}]}   json return params;  //请解释一下这段代码 } }
查看完整描述

1 回答

  • 1 回答
  • 0 关注
  • 1236 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信