package com.zcloud.domain.web;


import com.alibaba.cola.dto.MultiResponse;
import com.alibaba.cola.dto.PageResponse;
import com.alibaba.cola.dto.Response;
import com.alibaba.cola.dto.SingleResponse;
import com.jjb.saas.framework.auth.model.SSOUser;
import com.jjb.saas.framework.auth.utils.AuthContext;
import com.zcloud.domain.api.ProjectTaskInfoServiceI;
import com.zcloud.domain.dto.ProjectTaskInfoAddCmd;
import com.zcloud.domain.dto.ProjectTaskInfoPageQry;
import com.zcloud.domain.dto.ProjectTaskInfoUpdateCmd;
import com.zcloud.domain.dto.clientobject.ProjectTaskInfoCO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;

import java.util.ArrayList;

/**
 * web-adapter
 *
 * @Author zhaokai
 * @Date 2026-01-27 11:30:29
 */
@Api(tags = "课题任务详情")
@RequestMapping("/${application.gateway}/projectTaskInfo")
@RestController
@AllArgsConstructor
public class ProjectTaskInfoController {
    private final ProjectTaskInfoServiceI projectTaskInfoService;
    @ApiOperation("更新课题反馈任务项")
    @PutMapping("/edit")
    public SingleResponse edit(@Validated @RequestBody ProjectTaskInfoUpdateCmd projectTaskInfoUpdateCmd) {
        projectTaskInfoService.edit(projectTaskInfoUpdateCmd);
        return SingleResponse.buildSuccess();
    }
  /*
    @ApiOperation("新增")
    @PostMapping("/save")
    public SingleResponse<ProjectTaskInfoCO> add(@Validated @RequestBody ProjectTaskInfoAddCmd cmd) {
        SSOUser ssoUser = AuthContext.getCurrentUser();
        return projectTaskInfoService.add(cmd);
    }

    @ApiOperation("分页")
    @PostMapping("/list")
    public PageResponse<ProjectTaskInfoCO> page(@RequestBody ProjectTaskInfoPageQry qry) {
        return projectTaskInfoService.listPage(qry);
    }

    @ApiOperation("所有数据")
    @GetMapping("/listAll")
    public MultiResponse<ProjectTaskInfoCO> listAll() {
        return MultiResponse.of(new ArrayList<ProjectTaskInfoCO>());
    }

    @ApiOperation("详情")
    @GetMapping("/{id}")
    public SingleResponse<ProjectTaskInfoCO> getInfoById(@PathVariable("id") Long id) {
        return SingleResponse.of(new ProjectTaskInfoCO());
    }

    @ApiOperation("删除")
    @DeleteMapping("/{id}")
    public Response remove(@PathVariable("id") Long id) {
        projectTaskInfoService.remove(id);
        return SingleResponse.buildSuccess();
    }

    @ApiOperation("删除多个")
    @DeleteMapping("/ids")
    public Response removeBatch(@RequestParam Long[] ids) {
        projectTaskInfoService.removeBatch(ids);
        return SingleResponse.buildSuccess();
    }*/


}

