package com.vetti.web.controller.hotake;

import com.vetti.common.annotation.Log;
import com.vetti.common.core.controller.BaseController;
import com.vetti.common.core.domain.R;
import com.vetti.common.core.page.TableWebDataInfo;
import com.vetti.common.enums.BusinessType;
import com.vetti.hotake.domain.HotakeComplianceInfo;
import com.vetti.hotake.service.IHotakeComplianceInfoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 用户合规性信息Controller
 * 
 * @author wangxiangshun
 * @date 2026-01-18
 */
@Api(tags ="用户合规性信息")
@RestController
@RequestMapping("/hotake/complianceInfo")
public class HotakeComplianceInfoController extends BaseController
{
    @Autowired
    private IHotakeComplianceInfoService hotakeComplianceInfoService;

    /**
     * 查询用户合规性信息列表
     */
    @ApiOperation("查询用户合规性信息列表")
    @GetMapping("/pageList")
    public TableWebDataInfo<HotakeComplianceInfo> pageList(HotakeComplianceInfo hotakeComplianceInfo)
    {
        startPage();
        List<HotakeComplianceInfo> list = hotakeComplianceInfoService.selectHotakeComplianceInfoList(hotakeComplianceInfo);
        return getWebDataTable(list);
    }

    /**
     * 查询用户合规性信息列表
     */
    @ApiOperation("查询用户合规性信息列表(无分页)")
    @GetMapping("/getList")
    public R<List<HotakeComplianceInfo>> list(HotakeComplianceInfo hotakeComplianceInfo)
    {
        List<HotakeComplianceInfo> list = hotakeComplianceInfoService.selectHotakeComplianceInfoList(hotakeComplianceInfo);
        return R.ok(list,"");
    }

    /**
     * 获取用户合规性信息详细信息
     */
    @ApiOperation("获取用户合规性信息详细信息")
    @GetMapping(value = "/{id}")
    public R<HotakeComplianceInfo> getInfo(@PathVariable("id") Long id)
    {
        return R.ok(hotakeComplianceInfoService.selectHotakeComplianceInfoById(id),"");
    }

    /**
     * 新增用户合规性信息
     */
    @ApiOperation("新增用户合规性信息")
    @Log(title = "用户合规性信息", businessType = BusinessType.INSERT)
    @PostMapping
    public R<?> add(@RequestBody HotakeComplianceInfo hotakeComplianceInfo)
    {
        return R.ok(hotakeComplianceInfoService.insertHotakeComplianceInfo(hotakeComplianceInfo));
    }

    /**
     * 修改用户合规性信息
     */
    @ApiOperation("修改用户合规性信息")
    @Log(title = "用户合规性信息", businessType = BusinessType.UPDATE)
    @PutMapping
    public R<?> edit(@RequestBody HotakeComplianceInfo hotakeComplianceInfo)
    {
        return R.ok(hotakeComplianceInfoService.updateHotakeComplianceInfo(hotakeComplianceInfo));
    }

    /**
     * 删除用户合规性信息
     */
    @ApiOperation("删除用户合规性信息")
    @Log(title = "用户合规性信息", businessType = BusinessType.DELETE)
	@DeleteMapping("/{id}")
    public R<?> remove(@PathVariable Long id)
    {
        return R.ok(hotakeComplianceInfoService.deleteHotakeComplianceInfoById(id));
    }
}
