package com.dk.mdm.controller.mst;

import com.dk.common.model.pojo.PageList;
import com.dk.common.response.ResponseResultVO;
import com.dk.mdm.model.pojo.mst.FollowPlan;
import com.dk.common.service.BaseService;
import com.dk.mdm.model.query.mst.FollowPlanQuery;
import com.dk.mdm.model.response.mst.FollowPlanResponse;
import com.dk.mdm.model.vo.mst.FollowPlanVO;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;
import io.swagger.annotations.Api;
import com.dk.mdm.service.mst.FollowPlanService;

import javax.validation.Valid;


@Api(tags = "客户跟进计划API接口")
@RestController
@RequestMapping("/mst/followPlan")
public class FollowPlanController{

    public BaseService<FollowPlan> getService() {
        return followPlanService;
    }

    @Autowired
    private FollowPlanService followPlanService;


    /**
     * @desc : 条件查询
     * @author : 于继渤
     * @date : 2024/7/09 8:45
     */
    @ApiOperation(value = "分页、关联、条件查询", notes = "分页、关联、条件查询")
    @PostMapping({"list_by"})
    public ResponseResultVO<PageList<FollowPlanResponse>> selectByCond(@RequestBody FollowPlanQuery followPlanQuery) {
        return followPlanService.selectByCond(followPlanQuery);
    }

    /**
     * @desc : 新建
     * @author : 于继渤
     * @date : 2024/7/9 8:45
     */
    @ApiOperation(
            value = "新建",
            notes = "新建"
    )
    @PostMapping("insert")
    public ResponseResultVO<?> insert(@Valid @RequestBody FollowPlanVO followPlanVO) {
        return followPlanService.insert(followPlanVO);
    }
}
