package com.ruoyi.web.controller.smartor; 
 | 
  
 | 
import com.ruoyi.common.annotation.Log; 
 | 
import com.ruoyi.common.core.controller.BaseController; 
 | 
import com.ruoyi.common.core.domain.AjaxResult; 
 | 
import com.ruoyi.common.core.domain.entity.SysUser; 
 | 
import com.ruoyi.common.core.page.TableDataInfo; 
 | 
import com.ruoyi.common.enums.BusinessType; 
 | 
import com.ruoyi.common.utils.poi.ExcelUtil; 
 | 
import com.smartor.domain.HeLocallibrary; 
 | 
import com.smartor.service.IHeLocallibraryService; 
 | 
import org.springframework.beans.factory.annotation.Autowired; 
 | 
import org.springframework.web.bind.annotation.*; 
 | 
  
 | 
import javax.servlet.http.HttpServletResponse; 
 | 
import java.util.List; 
 | 
  
 | 
/** 
 | 
 * 宣教库Controller 
 | 
 * 
 | 
 * @author smartor 
 | 
 * @date 2023-03-04 
 | 
 */ 
 | 
@RestController 
 | 
@RequestMapping("/smartor/helibrary") 
 | 
public class HeLocallibraryController extends BaseController 
 | 
{ 
 | 
    @Autowired 
 | 
    private IHeLocallibraryService heLocallibraryService; 
 | 
  
 | 
    /** 
 | 
     * 查询宣教库列表 
 | 
     */ 
 | 
    //@PreAuthorize("@ss.hasPermi('smartor:helibrary:list')") 
 | 
   @PostMapping("/list") 
 | 
    public TableDataInfo list(@RequestBody HeLocallibrary heLocallibrary) 
 | 
    { 
 | 
        startPage(); 
 | 
        List<HeLocallibrary> list = heLocallibraryService.selectHeLocallibraryList(heLocallibrary); 
 | 
        return getDataTable(list); 
 | 
    } 
 | 
  
 | 
    /** 
 | 
     * 导出宣教库列表 
 | 
     */ 
 | 
    //@PreAuthorize("@ss.hasPermi('smartor:helibrary:export')") 
 | 
    @Log(title = "宣教库", businessType = BusinessType.EXPORT) 
 | 
    @PostMapping("/export") 
 | 
    public void export(HttpServletResponse response, HeLocallibrary heLocallibrary) 
 | 
    { 
 | 
        List<HeLocallibrary> list = heLocallibraryService.selectHeLocallibraryList(heLocallibrary); 
 | 
        ExcelUtil<HeLocallibrary> util = new ExcelUtil<HeLocallibrary>(HeLocallibrary.class); 
 | 
        util.exportExcel(response, list, "宣教库数据"); 
 | 
    } 
 | 
  
 | 
    /** 
 | 
     * 获取宣教库详细信息 
 | 
     */ 
 | 
    //@PreAuthorize("@ss.hasPermi('smartor:helibrary:query')") 
 | 
    @GetMapping(value = "/{id}") 
 | 
    public AjaxResult getInfo(@PathVariable("id") Long id) 
 | 
    { 
 | 
        return success(heLocallibraryService.selectHeLocallibraryById(id)); 
 | 
    } 
 | 
  
 | 
    /** 
 | 
     * 新增宣教库 
 | 
     */ 
 | 
    //@PreAuthorize("@ss.hasPermi('smartor:helibrary:add')") 
 | 
    @Log(title = "宣教库", businessType = BusinessType.INSERT) 
 | 
    @PostMapping("add") 
 | 
    public AjaxResult add(@RequestBody HeLocallibrary heLocallibrary) 
 | 
    { 
 | 
        SysUser user = getLoginUser().getUser(); 
 | 
        heLocallibrary.setOrgid(user.getOrgid()); 
 | 
        return toAjax(heLocallibraryService.insertHeLocallibrary(heLocallibrary)); 
 | 
    } 
 | 
  
 | 
    /** 
 | 
     * 修改宣教库 
 | 
     */ 
 | 
    //@PreAuthorize("@ss.hasPermi('smartor:helibrary:edit')") 
 | 
    @Log(title = "宣教库", businessType = BusinessType.UPDATE) 
 | 
    @PostMapping("/edit") 
 | 
    public AjaxResult edit(@RequestBody HeLocallibrary heLocallibrary) 
 | 
    { 
 | 
        return toAjax(heLocallibraryService.updateHeLocallibrary(heLocallibrary)); 
 | 
    } 
 | 
  
 | 
    /** 
 | 
     * 删除宣教库 
 | 
     */ 
 | 
    //@PreAuthorize("@ss.hasPermi('smartor:helibrary:remove')") 
 | 
    @Log(title = "宣教库", businessType = BusinessType.DELETE) 
 | 
    @GetMapping("/remove/{ids}") 
 | 
    public AjaxResult remove(@PathVariable Long[] ids) 
 | 
    { 
 | 
        return toAjax(heLocallibraryService.deleteHeLocallibraryByIds(ids)); 
 | 
    } 
 | 
} 
 |