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.ProjectTaskGroupUserServiceI;
import com.zcloud.domain.dto.ProjectTaskDetailAddCmd;
import com.zcloud.domain.dto.ProjectTaskGroupUserAddCmd;
import com.zcloud.domain.dto.ProjectTaskGroupUserPageQry;
import com.zcloud.domain.dto.ProjectTaskGroupUserUpdateCmd;
import com.zcloud.domain.dto.clientobject.ProjectTaskGroupUserCO;
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 java.util.ArrayList;

/**
 * web-adapter
 *
 * @Author zhaokai
 * @Date 2026-01-29 11:28:09
 */
@Api(tags = "课题任务-管理组-用户关系")
@RequestMapping("/${application.gateway}/projectTaskGroupUser")
@RestController
@AllArgsConstructor
public class ProjectTaskGroupUserController {
    private final ProjectTaskGroupUserServiceI projectTaskGroupUserService;

    @ApiOperation("新增课题组成员")
    @PostMapping("/saveGroupUser")
    public SingleResponse<ProjectTaskGroupUserCO> saveGroupUser(@Validated @RequestBody ProjectTaskDetailAddCmd cmd) {
        return projectTaskGroupUserService.saveGroupUser(cmd);
    }
/*
    @ApiOperation("分页")
    @PostMapping("/list")
    public PageResponse<ProjectTaskGroupUserCO> page(@RequestBody ProjectTaskGroupUserPageQry qry) {
        return projectTaskGroupUserService.listPage(qry);
    }

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

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

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

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

    @ApiOperation("修改")
    @PutMapping("/edit")
    public SingleResponse edit(@Validated @RequestBody ProjectTaskGroupUserUpdateCmd projectTaskGroupUserUpdateCmd) {
        projectTaskGroupUserService.edit(projectTaskGroupUserUpdateCmd);
        return SingleResponse.buildSuccess();
    }*/
}

