package com.sqx.modules.bl.commission.jjr.controller;

import com.sqx.common.utils.Result;
import com.sqx.modules.bl.commission.jjr.entity.JjrData;
import com.sqx.modules.bl.commission.jjr.service.JjrDataService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/commission/jjrData")
@Api(value = "分佣管理", tags = {"经纪人数据"})
public class JjrDataController {

    @Autowired
    private JjrDataService service;

    @GetMapping("/findPage")
    @ApiOperation("查询（分页）")
    public Result findPage(JjrData jjrData){
        return service.findPage(jjrData);
    }

    @GetMapping("/invitationArtificerPage")
    @ApiOperation("邀请技师（分页）")
    public Result invitationArtificerPage(JjrData jjrData){
        return service.invitationArtificerPage(jjrData);
    }

    @GetMapping("/artificerPage")
    @ApiOperation("技师（分页）")
    public Result artificerPage(JjrData jjrData){
        return service.artificerPage(jjrData);
    }

    @PostMapping("/cancelInvitation")
    @ApiOperation("取消邀请技师")
    public Result cancelInvitation(JjrData jjrData){
        service.cancelInvitation(jjrData);
        return Result.success();
    }

    @GetMapping("/jjrList")
    @ApiOperation("经纪人列表")
    public Result jjrList(JjrData jjrData){
        return service.findJjrPage(jjrData);
    }

    @PostMapping("/modifyJjr")
    @ApiOperation("技师修改经纪人")
    public Result modifyJjr(JjrData jjrData){
        service.modifyJjr(jjrData);
        return Result.success();
    }
}
