package com.corewing.app.modules.app;

import com.corewing.app.common.Result;
import com.corewing.app.common.annotation.CommonLog;
import com.corewing.app.entity.FeedbackLog;
import com.corewing.app.service.FeedbackLogService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;

/**
 * 上传日志接口控制器
 */
@Api(tags = "反馈日志接口")
@RestController
@RequestMapping("/feedback_log")
public class AppFeedbackLogController {

    @Resource
    private FeedbackLogService feedbackLogService;

    /**
     * 上传日志
     * @param feedbackLog
     * @return
     */
    @CommonLog("上传反馈日志")
    @ApiOperation("上传日志")
    @PostMapping("/uploadFeedbackLog")
    public Result<String> uploadFeedbackLog(MultipartFile file, FeedbackLog feedbackLog) {
        return Result.isBool(feedbackLogService.uploadFeedbackLog(file, feedbackLog));
    }

}
