
package org.sky.scientific.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
import lombok.AllArgsConstructor;
import org.sky.core.boot.ctrl.KdController;
import org.sky.core.mp.support.Condition;
import org.sky.core.mp.support.Query;
import org.sky.core.tool.api.R;
import org.sky.scientific.pojo.entity.FeedBackEntity;
import org.sky.scientific.pojo.entity.FeedBackReplyEntity;
import org.sky.scientific.service.IFeedBackService;
import org.springframework.web.bind.annotation.*;


/**
 * 出勤时间设置 控制器
 *
 * @author Kd
 * @since 2025-07-01
 */
@RestController
@AllArgsConstructor
@RequestMapping("/feedback")
@Tag(name = "意见反馈")
public class FeedBackController extends KdController {

	private final IFeedBackService service;

	@GetMapping("/page")
	@ApiOperationSupport(order = 1)
	@Operation(summary = "列表")
	public R<IPage<FeedBackEntity>> page(Query query, FeedBackEntity dto) {
		IPage<FeedBackEntity> page = service.selectFeedBackPage(Condition.getPage(query), dto);
		return R.data(page);
	}

//	@GetMapping("/detail")
//	@ApiOperationSupport(order = 1)
//	@Operation(summary = "详情")
//	public R<FeedBackEntity> detail(Long feedBackId) {
//		FeedBackEntity detail = service.detail(feedBackId);
//		return R.data(detail);
//	}

	@PostMapping("/submit")
	@ApiOperationSupport(order = 3)
	@Operation(summary = "新增或修改" )
	public R<Boolean> submit(@Valid @RequestBody FeedBackEntity dto) {
 		return R.status(service.submit(dto));
	}

	@PostMapping("reply")
	@ApiOperationSupport(order = 4)
	@Operation(summary = "回复" )
	public R<Boolean> reply(@Valid @RequestBody FeedBackReplyEntity dto) {
 		return R.status(service.reply(dto));
	}


}
