diff --git a/代码库/mall-admin/src/main/java/com/sock/mall/controller/CmsPrefrenceAreaController.java b/代码库/mall-admin/src/main/java/com/sock/mall/controller/CmsPrefrenceAreaController.java new file mode 100644 index 0000000..5be5830 --- /dev/null +++ b/代码库/mall-admin/src/main/java/com/sock/mall/controller/CmsPrefrenceAreaController.java @@ -0,0 +1,34 @@ +package com.macro.mall.controller; + +import com.macro.mall.dto.CommonResult; +import com.macro.mall.model.CmsPrefrenceArea; +import com.macro.mall.service.CmsPrefrenceAreaService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +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.RequestMethod; +import org.springframework.web.bind.annotation.ResponseBody; + +import java.util.List; + +/** + * ƷѡController + * Created by macro on 2018/6/1. + */ +@Controller//DispatcherServletַ +@Api(tags = "CmsPrefrenceAreaController", description = "Ʒѡ") +@RequestMapping("/prefrenceArea")//ӳ +public class CmsPrefrenceAreaController { + @Autowired//עԴ + private CmsPrefrenceAreaService prefrenceAreaService; + + @ApiOperation("ȡƷѡ") + @RequestMapping(value = "/listAll", method = RequestMethod.GET)//ʾ/listAll.doʱʵCmsPrefrenceAreaControllerliseAll + @ResponseBody//תдbodyJSONݻXML + public Object listAll() { + List prefrenceAreaList = prefrenceAreaService.listAll(); + return new CommonResult().success(prefrenceAreaList);//ɹ򷵻ذȫƷlistAll + } +} \ No newline at end of file diff --git a/代码库/mall-admin/src/main/java/com/sock/mall/controller/CmsSubjectController.java b/代码库/mall-admin/src/main/java/com/sock/mall/controller/CmsSubjectController.java new file mode 100644 index 0000000..b18ad63 --- /dev/null +++ b/代码库/mall-admin/src/main/java/com/sock/mall/controller/CmsSubjectController.java @@ -0,0 +1,45 @@ +package com.macro.mall.controller; + +import com.macro.mall.dto.CommonResult; +import com.macro.mall.model.CmsSubject; +import com.macro.mall.service.CmsSubjectService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +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.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.ResponseBody; + +import java.util.List; + +/** + * ƷרController + * Created by macro on 2018/6/1. + */ +@Controller +@Api(tags = "CmsSubjectController", description = "Ʒר") +@RequestMapping("/subject") +public class CmsSubjectController { + @Autowired + private CmsSubjectService subjectService; + + @ApiOperation("ȡȫƷר") + @RequestMapping(value = "/listAll", method = RequestMethod.GET) + @ResponseBody + public Object listAll() { + List subjectList = subjectService.listAll(); + return new CommonResult().success(subjectList); + } + + @ApiOperation(value = "רƷҳȡר") + @RequestMapping(value = "/list", method = RequestMethod.GET) + @ResponseBody + /*@RequestParamHTTPServletRequest*/ + public Object getList(@RequestParam(value = "keyword", required = false) String keyword, + @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum, + @RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize) { + List subjectList = subjectService.list(keyword, pageNum, pageSize); + return new CommonResult().pageSuccess(subjectList); + }