package cn.wisenergy.web.admin.controller.app;

import cn.wisenergy.common.utils.R;
import cn.wisenergy.model.app.MemberPercent;
import cn.wisenergy.model.dto.MemberPercentQuery;
import cn.wisenergy.service.app.MemberPercentService;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 86187
 */
@Api(tags = "会员优惠比列-后台管理")
@RestController
@RequestMapping("/member")
@Slf4j
public class MemberController {
    @Autowired
    private MemberPercentService memberPercentService;

    @ApiOperation(value = "获取会员优惠比列列表", notes = "获取会员优惠比列列表", httpMethod = "GET")
    @ApiImplicitParam(name = "query", value = "查询参数", dataType = "MemberPercentQuery")
    @GetMapping("/getList")
    public R<PageInfo<MemberPercent>> getList(MemberPercentQuery query) {
        log.info("shop-mall[]MemberController[]getList[]input.param.query:" + query);
        if (null == query) {
            return R.error("入参为空!");
        }
        return memberPercentService.getList(query);
    }
}
