Commit a26bfe44 authored by 胡小根's avatar 胡小根

coding

parent ca9ec080
package com.haomostudio.SeekTruthBackend.controller;
import com.haomostudio.SeekTruthBackend.service.ActivitiService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletResponse;
/**
* Created by hxgqh on 2016/10/6.
*/
public class ActivitiController {
@Autowired
ActivitiService activitiService;
@Autowired
HttpServletResponse response;
@RequestMapping(value = "/activities", method = RequestMethod.GET, produces = "application/json;charset=UTF-8")
@ResponseBody
public Object getActivities(
@RequestHeader(value = "X-Auth-Token") String token,
@RequestHeader(value = "page_no") Integer pageNo,
@RequestHeader(value = "page_size") Integer pageSize,
@RequestHeader(value = "sort_item") String sortItem,
@RequestHeader(value = "sort_order") String sortOrder,
@RequestHeader(value = "filters") String filters
) {
return activitiService.getListWithPagingAndFilter(
pageNo, pageSize, sortItem, sortOrder, filters);
}
}
package com.haomostudio.SeekTruthBackend.controller;
import com.haomostudio.SeekTruthBackend.service.ActivitiService;
import com.haomostudio.SeekTruthBackend.service.CountryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletResponse;
/**
* Created by hxgqh on 2016/10/6.
*/
@Controller
public class CountryController {
@Autowired
CountryService countryService;
@Autowired
HttpServletResponse response;
@RequestMapping(value = "/countries",
method = RequestMethod.GET,
produces = "application/json;charset=UTF-8")
@ResponseBody
public Object getCountries(
@RequestHeader(value = "page_no") Integer pageNo,
@RequestHeader(value = "page_size") Integer pageSize,
@RequestHeader(value = "sort_item") String sortItem,
@RequestHeader(value = "sort_order") String sortOrder,
@RequestHeader(value = "filters") String filters
) {
return countryService.getListWithPagingAndFilter(
pageNo, pageSize, sortItem, sortOrder, filters);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment