package com.hzya.frame.sys.product.controller;



import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.sys.product.service.ISysProductService;
import com.hzya.frame.web.entity.JsonResultEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;


/**
 * @description: 产品表  controller
 * @tableName: sys_product 
 * @entityName: sysProduct
 * @author: llg
 * @history: 1.0
 */

@Controller()
@RequestMapping("sysProduct")
public class SysProductController {
    @Autowired
    protected ISysProductService sysProductService;

    /**
     * @Author lvleigang
     * @Description  分页查询产品
     * @Date 9:44 上午 2023/3/1
     * @param servletRequest
     * @param servletResponse
     * @return com.hzya.frame.web.entity.JsonResultEntity
     **/
    @RequestMapping(value = "/queryPageProduct")
    @ResponseBody
    public JsonResultEntity queryPageProduct(ServletRequest servletRequest, ServletResponse servletResponse) throws Exception  {
        return  sysProductService.queryPageProduct(new JSONObject());
    }
    /**
     * @Author lvleigang
     * @Description  根据产品id查询
     * @Date 9:44 上午 2023/3/1
     * @param servletRequest
     * @param servletResponse
     * @return com.hzya.frame.web.entity.JsonResultEntity
     **/
    @RequestMapping(value = "/queryProduct")
    @ResponseBody
    public JsonResultEntity queryProduct(ServletRequest servletRequest, ServletResponse servletResponse) throws Exception  {
        return  sysProductService.queryProduct(new JSONObject());
    }

    /**
     * @Author lvleigang
     * @Description  新增产品
     * @Date 9:44 上午 2023/3/1
     * @param servletRequest
     * @param servletResponse
     * @return com.hzya.frame.web.entity.JsonResultEntity
     **/
    @RequestMapping(value = "/addProduct")
    @ResponseBody
    public JsonResultEntity addProduct(ServletRequest servletRequest, ServletResponse servletResponse) throws Exception  {
        return  sysProductService.addProduct(new JSONObject());
    }

    /**
     * @Author lvleigang
     * @Description  修改产品
     * @Date 9:44 上午 2023/3/1
     * @param servletRequest
     * @param servletResponse
     * @return com.hzya.frame.web.entity.JsonResultEntity
     **/
    @RequestMapping(value = "/updateProduct")
    @ResponseBody
    public JsonResultEntity updateProduct(ServletRequest servletRequest, ServletResponse servletResponse) throws Exception  {
        return  sysProductService.updateProduct(new JSONObject());
    }

    /**
     * @Author lvleigang
     * @Description  删除产品
     * @Date 9:44 上午 2023/3/1
     * @param servletRequest
     * @param servletResponse
     * @return com.hzya.frame.web.entity.JsonResultEntity
     **/
    @RequestMapping(value = "/delectProduct")
    @ResponseBody
    public JsonResultEntity delectProduct(ServletRequest servletRequest, ServletResponse servletResponse) throws Exception  {
        return  sysProductService.delectProduct(new JSONObject());
    }

    /**
     * @Author lvleigang
     * @Description  查询产品
     * @Date 9:44 上午 2023/3/1
     * @param servletRequest
     * @param servletResponse
     * @return com.hzya.frame.web.entity.JsonResultEntity
     **/
    @RequestMapping(value = "/queryProductAll")
    @ResponseBody
    public JsonResultEntity queryProductAll(ServletRequest servletRequest, ServletResponse servletResponse) throws Exception  {
        return  sysProductService.queryProductAll(new JSONObject());
    }
}

