package com.zcloud.modules.mall.controller;

import com.zcloud.common.annotation.SysLog;
import com.zcloud.common.utils.PageUtils;
import com.zcloud.common.utils.R;
import com.zcloud.modules.mall.entity.BusFeedbackMallEntity;
import com.zcloud.modules.mall.service.BusFeedbackMallService;
import com.zcloud.modules.sys.controller.AbstractController;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;


/**
 * @Author zhy
 * @Desc 商场反馈消息表控制层
 * @Date 2024-11-07
 */
@Api(tags = "商场反馈消息")
@RestController
@RequestMapping("feedbackMall")
public class BusFeedbackMallController extends AbstractController {
    @Autowired
    private BusFeedbackMallService feedbackService;

    @PostMapping("/list")
    public R list(@RequestBody Map<String, Object> params) {
        PageUtils page = feedbackService.queryPage(params);
        return R.ok().put("page", page);
    }

    /**
     * 商场反馈消息
     */
    @PostMapping("/info")
    public R info(@RequestBody BusFeedbackMallEntity param) {
        param = feedbackService.getById(param.getFeedbackMallId());
        return R.ok().put("feedbackMessage", param);
    }

    /**
     * 修改
     */
    @SysLog("修改")
    @PostMapping("/update")
    public R update(@RequestBody BusFeedbackMallEntity param) {
        param.setOperator(getUserId());
        feedbackService.updateById(param);
        return R.ok();
    }

}
