package com.crm.manager.controller;

import com.crm.manager.service.risk.RiskGroupTypeLoginFeignService;
import com.crm.rely.backend.core.dto.base.BaseResultDto;
import com.crm.rely.backend.core.dto.base.ResultWithPagerDto;
import com.crm.rely.backend.core.dto.risk.group.type.RiskGroupTypeLoginDto;
import com.crm.rely.backend.core.entity.base.SingleLongEntity;
import com.crm.rely.backend.core.entity.risk.group.type.RiskGroupTypeLoginAddEntity;
import com.crm.rely.backend.core.entity.risk.group.type.RiskGroupTypeLoginDeleteEntity;
import com.crm.rely.backend.core.entity.risk.group.type.RiskGroupTypeLoginSearchPageEntity;
import com.crm.rely.backend.core.entity.risk.group.type.RiskGroupTypeLoginUpdateEntity;
import org.springframework.beans.factory.annotation.Autowired;
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 houn
 */
@RestController
@RequestMapping("/risk/group/type/login")
public class RiskGroupTypeLoginController {

    @Autowired
    private RiskGroupTypeLoginFeignService service;


    /**
     * @param entity
     * @return
     * @throws Exception
     */
    @PostMapping("/add")
    public BaseResultDto add(@RequestBody @Validated RiskGroupTypeLoginAddEntity entity) throws Exception {


        return service.add(entity);
    }

    @PostMapping("/update")
    public BaseResultDto update(@RequestBody @Validated RiskGroupTypeLoginUpdateEntity entity) throws Exception {


        return service.update(entity);
    }

    @PostMapping("/delete")
    public BaseResultDto delete(@RequestBody @Validated RiskGroupTypeLoginDeleteEntity entity) throws Exception {


        return service.delete(entity);
    }

    @PostMapping("/search/list")
    public ResultWithPagerDto<RiskGroupTypeLoginDto> pageList(@RequestBody @Validated RiskGroupTypeLoginSearchPageEntity entity) throws Exception {

        return service.pageList(entity);
    }

    @PostMapping("/search/single")
    public BaseResultDto<RiskGroupTypeLoginDto> single(@RequestBody @Validated SingleLongEntity entity) throws Exception {

        return service.single(entity);
    }

}
