package com.cftech.productclassify.web;

import com.alibaba.fastjson.JSONObject;
import com.cftech.productclassify.service.ProductclassifyService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ：licc
 * @date ：Created in 2020/10/21 17:46
 * @description：
 */
@Slf4j
@RestController
@CrossOrigin
@RequestMapping("mobile/auth/productclassify")
public class MobileclassifyController {
    @Autowired
    private com.cftech.productclassify.service.ProductclassifyService ProductclassifyService;
    /**
     * @Author Licc
     * @Description  商品列表展示
     * @Date 14:14 2020/10/21
     * @Param
     * @return
     **/
    @RequestMapping(value = "/productList",method = {RequestMethod.GET,RequestMethod.POST},produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public JSONObject productList(String productName, String classifyName, String dosagaFrom){
        return ProductclassifyService.productList(productName,classifyName,dosagaFrom);
    }
    /**
     * @Author Licc
     * @Description  商品分类菜单数据回填
     * @Date 9:46 2020/10/22
     * @Param []
     * @return com.alibaba.fastjson.JSONObject
     **/
    @RequestMapping(value = "/productMenu",method = {RequestMethod.GET,RequestMethod.POST},produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public JSONObject productMenu(){
        return ProductclassifyService.productMenu();
    }
}
