InformationController.java 1.8 KB
package com.server.web.controller;

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 javax.servlet.http.HttpServletRequest;
import java.util.Map;

/**
 * Created by weiwenfu@163.com on 2020/3/12 下午 4:53.
 */
@RestController
@RequestMapping(value = BaseController.WX_NAMESPACE + "/information", produces = "application/json")
public class InformationController {
    @Autowired
    private InformationService informationService;

    /**
     * 二级分类
     *
     * @return
     */
    @RequestMapping("/secondClassList")
    public Map<String, Object> secondClassList(HttpServletRequest request, @RequestParam(value = "firstId") Long firstId) {
        return informationService.secondClassList(firstId);
    }

    /**
     * 二级分类详情
     *
     * @return
     */
    @RequestMapping("/secondClassDetail")
    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);
    }

    /**
     * 资讯详情
     *
     * @param request
     * @param informationId
     * @return
     */
    @RequestMapping("/informationDetail")
    public Map<String, Object> informationDetail(HttpServletRequest request, @RequestParam(value = "informationId") Long informationId) {
        return informationService.informationDetail(informationId);
    }


}