package com.zcloud.basic.info.app;


import com.alibaba.cola.dto.PageResponse;
import com.alibaba.cola.dto.SingleResponse;
import com.zcloud.basic.info.api.UserCorpRecordServiceI;
import com.zcloud.basic.info.dto.UserCorpRecordPageQry;
import com.zcloud.basic.info.dto.clientobject.UserCO;
import com.zcloud.basic.info.dto.clientobject.UserCorpRecordCO;
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.*;

/**
 * web-adapter
 *
 * @Author zhaokai
 * @Date 2025-12-03 10:21:58
 */
@Api(tags = "APP用户入职企业记录表")
@RequestMapping("/${application.gateway}/app/userCorpRecord")
@RestController
@AllArgsConstructor
public class AppUserCorpRecordController {
    private final UserCorpRecordServiceI userCorpRecordService;


    @ApiOperation("就职单位记录分页")
    @PostMapping("/list")
    public PageResponse<UserCorpRecordCO> page(@Validated @RequestBody UserCorpRecordPageQry qry) {
        return userCorpRecordService.listPage(qry);
    }


    @ApiOperation("就职单位用户信息详情")
    @GetMapping("/getInfoById/{id}")
    public SingleResponse<UserCO> getInfoById(@PathVariable("id") Long id) {
        return SingleResponse.of(userCorpRecordService.getInfoById(id));
    }

}

