package cn.iocoder.yudao.module.base.controller.admin;

import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.module.base.service.RepairRecordsItemService;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/dl/repair-records-item")
public class RepairRecordsItemController {

    @Resource
    private RepairRecordsItemService repairRecordsItemService;

    /**
     * 设置图片是否开放给用户
     *
     * @author 小李
     * @date 9:53 2024/10/25
     * @param ids 前端选中图片id（多个用“，”分隔）
     * @param isOpen 0否1是
    **/
    @GetMapping("/updateOpen")
    @Operation(summary = "设置图片是否开放给用户")
    public CommonResult<?> updateOpen(@RequestParam("ids") String ids, @RequestParam("isOpen") String isOpen) {
        repairRecordsItemService.setRepairOpen(ids, isOpen);
        return CommonResult.ok();
    }
}
