package com.cusc.nirvana.user.rnr.fp.controller;

import com.cusc.nirvana.common.result.PageResult;
import com.cusc.nirvana.common.result.Response;
import com.cusc.nirvana.user.rnr.fp.dto.FpUserOperationLogDTO;
import com.cusc.nirvana.user.rnr.fp.service.IFpUserOperationLogService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
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;

import java.util.List;

/**
 * 用户操作日志(FpUserOperationLog)表控制层
 *
 * @author yuy336
 * @since 2022-06-20 09:38:35
 */
@RestController
@RequestMapping("/fpUserOperationLog")
public class FpUserOperationLogController {
    /**
     * 服务对象
     */
    @Autowired
    private IFpUserOperationLogService fpUserOperationLogService;

    /**
     * 分页查询
     *
     * @param bean 筛选条件
     * @return 查询结果
     */
    @PostMapping("/queryByPage")
    @ApiOperation(value = "分页查询", notes = "分页查询")
    public Response<PageResult<FpUserOperationLogDTO>> queryByPage(@RequestBody FpUserOperationLogDTO bean) {
        return Response.createSuccess(fpUserOperationLogService.queryByPage(bean));
    }

    /**
     * 通过主键查询单条数据
     *
     * @param bean 实体
     * @return 单条数据
     */
   @PostMapping("/getByUuid")
    public Response<FpUserOperationLogDTO> getByUuid(@RequestBody FpUserOperationLogDTO bean) {
        return Response.createSuccess(fpUserOperationLogService.getByUuid(bean));
    }
    
     /**
     * 通过主键查询单条数据
     *
     * @param bean 实体
     * @return 单条数据
     */
   @PostMapping("/queryByList")
    public Response<List<FpUserOperationLogDTO>> queryByList(@RequestBody FpUserOperationLogDTO bean) {
        return Response.createSuccess(fpUserOperationLogService.queryByList(bean));
    }

    /**
     * 新增数据
     *
     * @param bean 实体
     * @return 新增结果
     */
    @PostMapping("/add")
    public Response add(@RequestBody FpUserOperationLogDTO bean) {
       return Response.createSuccess(fpUserOperationLogService.insert(bean));
    }

    /**
     * 编辑数据
     *
     * @param bean 实体
     * @return 编辑结果
     */
    @PostMapping("/update")
    public Response update(@RequestBody FpUserOperationLogDTO bean) {
        return Response.createSuccess(fpUserOperationLogService.update(bean));
    }

    /**
     * 删除数据
     *
     * @param bean 实体
     * @return 删除是否成功
     */
    @PostMapping("/deleteById")
    public Response<Boolean> deleteById(@RequestBody FpUserOperationLogDTO bean) {
        return Response.createSuccess(fpUserOperationLogService.deleteById(bean));
    }

}

