package org.dromara.app;

import com.wzj.soopin.member.convert.FeedbackConvert;
import com.wzj.soopin.member.domain.bo.FeedbackBO;
import com.wzj.soopin.member.service.IFeedbackService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.dromara.common.core.domain.R;
import org.dromara.common.log.annotation.Log;
import org.dromara.common.log.enums.BusinessType;
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;


@Slf4j
@Tag(name = "意见反馈")
@RequestMapping("/app/feedback")
@RestController
@AllArgsConstructor
public class AppFeedbackController {
    private final IFeedbackService service;
    private final FeedbackConvert convert;

    @Operation(summary = "修改意见反馈备注信息")
    @Log(title = "新增意见反馈", businessType = BusinessType.UPDATE)
    @PostMapping("/add")
    public R add(@RequestBody FeedbackBO feedback) {
        return R.ok(service.save(convert.toPo(feedback)));
    }
}
