package com.zcloud.basic.info.web.sync;

import com.zcloud.basic.info.api.sync.SyncServiceI;
import com.zcloud.basic.info.dto.sync.SyncDepartmentQryPageCmd;
import com.zcloud.basic.info.dto.sync.SyncUserQryPageCmd;
import com.zcloud.basic.info.utils.SyncPageResponse;
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.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author zhangyue
 * @date 2026/4/23 9:45
 */
@Api(tags = "同步信息")
@RequestMapping("/${application.gateway}/sync")
@RestController
@AllArgsConstructor
public class SyncController {

    private final SyncServiceI syncServiceI;
    @ApiOperation("获取用户数据")
    @PostMapping("/user/listPage")
    public SyncPageResponse listPageSyncUser(@Validated @RequestBody SyncUserQryPageCmd cmd) {
        return syncServiceI.listPageSyncUser(cmd);
    }

    @ApiOperation("获取部门数据")
    @PostMapping("/department/listPage")
    public SyncPageResponse listPageSyncDepartment(@Validated @RequestBody SyncDepartmentQryPageCmd cmd) {
        return syncServiceI.listPageSyncDepartment(cmd);
    }
}
