package com.boman.web.core.controller;

import com.boman.common.core.web.controller.BaseController;
import com.boman.domain.Fxry;
import com.boman.domain.TableDataInfo;
import com.boman.domain.dto.AjaxResult;
import com.boman.web.core.domain.SysRegion;
import com.boman.web.core.mapper.SysRegionMapper;
import com.boman.web.core.service.fxry.FxryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author shiqian
 * @description 返乡人员
 * @date 2022年01月05日 15:39
 **/
@RestController
@RequestMapping("/core/fxry")
public class FxryController extends BaseController {

    @Resource
    private FxryService service;

    @Autowired
    private SysRegionMapper sysRegionMapper;

    @GetMapping("/list")
    public TableDataInfo list(Fxry fxry) {
        List<Fxry> list = service.list(fxry);
        return getDataTable(list);
    }

    @PostMapping("/add")
    public AjaxResult add(@RequestBody Fxry fxry) {
        return service.add(fxry);
    }

    @GetMapping("/getById/{id}")
    public AjaxResult getById(@PathVariable String id) {
        return AjaxResult.success(service.getById(id));
    }

    @PostMapping("/edit")
    public AjaxResult edit(@RequestBody Fxry fxry) {
        return service.edit(fxry);
    }

    @GetMapping("/delete/{id}")
    public AjaxResult delete(@PathVariable String id) {
        return service.delete(id);
    }

}
