Commit 0437f8ba by 魏文甫

update

1 parent 8f6e8099
......@@ -3,6 +3,8 @@ package com.server.web.controller;
import com.server.web.common.service.IndexService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import java.util.Map;
......@@ -23,7 +25,8 @@ public class IndexController {
*
* @return
*/
@RequestMapping("/banner")
@ResponseBody
@RequestMapping(value = "/banner", method = {RequestMethod.POST, RequestMethod.GET}, produces = "application/json")
public Map<String, Object> banner() {
return indexService.banner();
}
......@@ -33,7 +36,8 @@ public class IndexController {
*
* @return
*/
@RequestMapping("/categoryList")
@ResponseBody
@RequestMapping(value = "/categoryList", method = {RequestMethod.POST, RequestMethod.GET}, produces = "application/json")
public Map<String, Object> categoryList() {
return indexService.categoryList();
}
......@@ -43,7 +47,8 @@ public class IndexController {
*
* @return
*/
@RequestMapping("/categoryDetail")
@ResponseBody
@RequestMapping(value = "/categoryDetail", method = {RequestMethod.POST, RequestMethod.GET}, produces = "application/json")
public Map<String, Object> categoryDetail() {
return indexService.categoryDetail();
}
......@@ -53,7 +58,8 @@ public class IndexController {
*
* @return
*/
@RequestMapping("/livingCourseToday")
@ResponseBody
@RequestMapping(value = "/livingCourseToday", method = {RequestMethod.POST, RequestMethod.GET}, produces = "application/json")
public Map<String, Object> livingCourseToday() {
return indexService.livingCourseToday();
}
......
......@@ -3,9 +3,7 @@ package com.server.web.controller;
import com.server.web.common.model.TKzyUser;
import com.server.web.common.service.InformationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.util.Map;
......@@ -24,7 +22,8 @@ public class InformationController extends BaseController {
*
* @return
*/
@RequestMapping("/secondClassList")
@ResponseBody
@RequestMapping(value = "/secondClassList", method = {RequestMethod.POST, RequestMethod.GET}, produces = "application/json")
public Map<String, Object> secondClassList(HttpServletRequest request, @RequestParam(value = "firstId") Long firstId) {
return informationService.secondClassList(firstId);
}
......@@ -34,7 +33,8 @@ public class InformationController extends BaseController {
*
* @return
*/
@RequestMapping("/secondClassDetail")
@ResponseBody
@RequestMapping(value = "/secondClassDetail", method = {RequestMethod.POST, RequestMethod.GET}, produces = "application/json")
public Map<String, Object> secondClassDetail(HttpServletRequest request, @RequestParam(value = "secondId") Long secondId,
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(value = "pageSize") Integer pageSize) {
return informationService.secondClassDetail(secondId, pageNo, pageSize);
......@@ -47,7 +47,8 @@ public class InformationController extends BaseController {
* @param informationId
* @return
*/
@RequestMapping("/informationDetail")
@ResponseBody
@RequestMapping(value = "/informationDetail", method = {RequestMethod.POST, RequestMethod.GET}, produces = "application/json")
public Map<String, Object> informationDetail(HttpServletRequest request, @RequestParam(value = "informationId") Long informationId) {
return informationService.informationDetail(informationId);
}
......@@ -61,7 +62,8 @@ public class InformationController extends BaseController {
* @param pageSize
* @return
*/
@RequestMapping("/informationCommentList")
@ResponseBody
@RequestMapping(value = "/informationCommentList", method = {RequestMethod.POST, RequestMethod.GET}, produces = "application/json")
public Map<String, Object> informationCommentList(HttpServletRequest request, @RequestParam(value = "informationId") Long informationId,
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo, @RequestParam(value = "pageSize") Integer pageSize) {
return informationService.informationCommentList(informationId, pageNo, pageSize);
......@@ -74,7 +76,8 @@ public class InformationController extends BaseController {
* @param comment
* @return
*/
@RequestMapping("/informationComment")
@ResponseBody
@RequestMapping(value = "/informationComment", method = {RequestMethod.POST, RequestMethod.GET}, produces = "application/json")
public Map<String, Object> informationComment(HttpServletRequest request, @RequestParam(value = "informationId") Long informationId, @RequestParam(value = "comment") String comment) {
TKzyUser tKzyUser = getLoginUser(request);
Long userId = null;
......
......@@ -31,7 +31,8 @@ public class UserController extends BaseController {
private TKzyUserMapper tKzyUserMapper;
@PostMapping("/userData")
@ResponseBody
@RequestMapping(value = "/userData", method = {RequestMethod.POST, RequestMethod.GET}, produces = "application/json")
public Map userData(HttpServletRequest request) {
TKzyUser loginUser = getLoginUser(request);
if (loginUser != null && loginUser.getId() != null) {
......@@ -40,7 +41,8 @@ public class UserController extends BaseController {
return returnSuccess(loginUser);
}
@PostMapping("/register")
@ResponseBody
@RequestMapping(value = "/register", method = {RequestMethod.POST, RequestMethod.GET}, produces = "application/json")
public Map register(HttpServletRequest request) {
TKzyUser user = getLoginUser(request);
String phone = request.getParameter("phone");
......@@ -92,7 +94,8 @@ public class UserController extends BaseController {
return returnSuccess(user);
}
@PostMapping("/update")
@ResponseBody
@RequestMapping(value = "/update", method = {RequestMethod.POST, RequestMethod.GET}, produces = "application/json")
public Map update(HttpServletRequest request) {
TKzyUser loginUser = getLoginUser(request);
if (loginUser == null) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!