diff --git a/sf-admin/src/main/java/com/sf/index/controller/ApplyListInfoController.java b/sf-admin/src/main/java/com/sf/index/controller/ApplyListInfoController.java new file mode 100644 index 0000000..90ca829 --- /dev/null +++ b/sf-admin/src/main/java/com/sf/index/controller/ApplyListInfoController.java @@ -0,0 +1,104 @@ +package com.sf.index.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; +import org.springframework.security.access.prepost.PreAuthorize; +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.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.sf.common.annotation.Log; +import com.sf.common.core.controller.BaseController; +import com.sf.common.core.domain.AjaxResult; +import com.sf.common.enums.BusinessType; +import com.sf.index.domain.ApplyListInfo; +import com.sf.index.service.IApplyListInfoService; +import com.sf.common.utils.poi.ExcelUtil; +import com.sf.common.core.page.TableDataInfo; + +/** + * 应用列Controller + * + * @author ztzh + * @date 2024-04-11 + */ +@RestController +@RequestMapping("/index/list") +public class ApplyListInfoController extends BaseController +{ + @Autowired + private IApplyListInfoService applyListInfoService; + + /** + * 查询应用列列表 + */ + @PreAuthorize("@ss.hasPermi('index:list:list')") + @GetMapping("/list") + public TableDataInfo list(ApplyListInfo applyListInfo) + { + startPage(); + List list = applyListInfoService.selectApplyListInfoList(applyListInfo); + return getDataTable(list); + } + + /** + * 导出应用列列表 + */ + @PreAuthorize("@ss.hasPermi('index:list:export')") + @Log(title = "应用列", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, ApplyListInfo applyListInfo) + { + List list = applyListInfoService.selectApplyListInfoList(applyListInfo); + ExcelUtil util = new ExcelUtil(ApplyListInfo.class); + util.exportExcel(response, list, "应用列数据"); + } + + /** + * 获取应用列详细信息 + */ + @PreAuthorize("@ss.hasPermi('index:list:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(applyListInfoService.selectApplyListInfoById(id)); + } + + /** + * 新增应用列 + */ + @PreAuthorize("@ss.hasPermi('index:list:add')") + @Log(title = "应用列", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody ApplyListInfo applyListInfo) + { + return toAjax(applyListInfoService.insertApplyListInfo(applyListInfo)); + } + + /** + * 修改应用列 + */ + @PreAuthorize("@ss.hasPermi('index:list:edit')") + @Log(title = "应用列", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody ApplyListInfo applyListInfo) + { + return toAjax(applyListInfoService.updateApplyListInfo(applyListInfo)); + } + + /** + * 删除应用列 + */ + @PreAuthorize("@ss.hasPermi('index:list:remove')") + @Log(title = "应用列", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(applyListInfoService.deleteApplyListInfoByIds(ids)); + } +} diff --git a/sf-admin/src/main/java/com/sf/index/domain/ApplyListInfo.java b/sf-admin/src/main/java/com/sf/index/domain/ApplyListInfo.java new file mode 100644 index 0000000..65eba05 --- /dev/null +++ b/sf-admin/src/main/java/com/sf/index/domain/ApplyListInfo.java @@ -0,0 +1,133 @@ +package com.sf.index.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.sf.common.annotation.Excel; +import com.sf.common.core.domain.BaseEntity; + +/** + * 应用列对象 APPLY_LIST_INFO + * + * @author ztzh + * @date 2024-04-11 + */ +public class ApplyListInfo extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 应用名称 */ + @Excel(name = "应用名称") + private String appName; + + /** 应用描述 */ + @Excel(name = "应用描述") + private String appDesc; + + /** 图片 */ + @Excel(name = "图片") + private String picture; + + /** 排序 */ + private Long orderNum; + + /** 逻辑删除,0:未删除,1:删除 */ + private Long isDelete; + + /** 创建人 */ + private String created; + + /** 更新人 */ + private String modified; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + public void setAppName(String appName) + { + this.appName = appName; + } + + public String getAppName() + { + return appName; + } + public void setAppDesc(String appDesc) + { + this.appDesc = appDesc; + } + + public String getAppDesc() + { + return appDesc; + } + public void setPicture(String picture) + { + this.picture = picture; + } + + public String getPicture() + { + return picture; + } + public void setOrderNum(Long orderNum) + { + this.orderNum = orderNum; + } + + public Long getOrderNum() + { + return orderNum; + } + public void setIsDelete(Long isDelete) + { + this.isDelete = isDelete; + } + + public Long getIsDelete() + { + return isDelete; + } + public void setCreated(String created) + { + this.created = created; + } + + public String getCreated() + { + return created; + } + public void setModified(String modified) + { + this.modified = modified; + } + + public String getModified() + { + return modified; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("appName", getAppName()) + .append("appDesc", getAppDesc()) + .append("picture", getPicture()) + .append("orderNum", getOrderNum()) + .append("isDelete", getIsDelete()) + .append("created", getCreated()) + .append("modified", getModified()) + .append("createTime", getCreateTime()) + .append("updateTime", getUpdateTime()) + .toString(); + } +} diff --git a/sf-admin/src/main/java/com/sf/index/mapper/ApplyListInfoMapper.java b/sf-admin/src/main/java/com/sf/index/mapper/ApplyListInfoMapper.java new file mode 100644 index 0000000..f7a1911 --- /dev/null +++ b/sf-admin/src/main/java/com/sf/index/mapper/ApplyListInfoMapper.java @@ -0,0 +1,61 @@ +package com.sf.index.mapper; + +import java.util.List; +import com.sf.index.domain.ApplyListInfo; + +/** + * 应用列Mapper接口 + * + * @author ztzh + * @date 2024-04-11 + */ +public interface ApplyListInfoMapper +{ + /** + * 查询应用列 + * + * @param id 应用列主键 + * @return 应用列 + */ + public ApplyListInfo selectApplyListInfoById(Long id); + + /** + * 查询应用列列表 + * + * @param applyListInfo 应用列 + * @return 应用列集合 + */ + public List selectApplyListInfoList(ApplyListInfo applyListInfo); + + /** + * 新增应用列 + * + * @param applyListInfo 应用列 + * @return 结果 + */ + public int insertApplyListInfo(ApplyListInfo applyListInfo); + + /** + * 修改应用列 + * + * @param applyListInfo 应用列 + * @return 结果 + */ + public int updateApplyListInfo(ApplyListInfo applyListInfo); + + /** + * 删除应用列 + * + * @param id 应用列主键 + * @return 结果 + */ + public int deleteApplyListInfoById(Long id); + + /** + * 批量删除应用列 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteApplyListInfoByIds(Long[] ids); +} diff --git a/sf-admin/src/main/java/com/sf/index/service/IApplyListInfoService.java b/sf-admin/src/main/java/com/sf/index/service/IApplyListInfoService.java new file mode 100644 index 0000000..ff17ecd --- /dev/null +++ b/sf-admin/src/main/java/com/sf/index/service/IApplyListInfoService.java @@ -0,0 +1,61 @@ +package com.sf.index.service; + +import java.util.List; +import com.sf.index.domain.ApplyListInfo; + +/** + * 应用列Service接口 + * + * @author ztzh + * @date 2024-04-11 + */ +public interface IApplyListInfoService +{ + /** + * 查询应用列 + * + * @param id 应用列主键 + * @return 应用列 + */ + public ApplyListInfo selectApplyListInfoById(Long id); + + /** + * 查询应用列列表 + * + * @param applyListInfo 应用列 + * @return 应用列集合 + */ + public List selectApplyListInfoList(ApplyListInfo applyListInfo); + + /** + * 新增应用列 + * + * @param applyListInfo 应用列 + * @return 结果 + */ + public int insertApplyListInfo(ApplyListInfo applyListInfo); + + /** + * 修改应用列 + * + * @param applyListInfo 应用列 + * @return 结果 + */ + public int updateApplyListInfo(ApplyListInfo applyListInfo); + + /** + * 批量删除应用列 + * + * @param ids 需要删除的应用列主键集合 + * @return 结果 + */ + public int deleteApplyListInfoByIds(Long[] ids); + + /** + * 删除应用列信息 + * + * @param id 应用列主键 + * @return 结果 + */ + public int deleteApplyListInfoById(Long id); +} diff --git a/sf-ui/src/api/index/list.js b/sf-ui/src/api/index/list.js new file mode 100644 index 0000000..e9c13c3 --- /dev/null +++ b/sf-ui/src/api/index/list.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询应用列列表 +export function listList(query) { + return request({ + url: '/index/list/list', + method: 'get', + params: query + }) +} + +// 查询应用列详细 +export function getList(id) { + return request({ + url: '/index/list/' + id, + method: 'get' + }) +} + +// 新增应用列 +export function addList(data) { + return request({ + url: '/index/list', + method: 'post', + data: data + }) +} + +// 修改应用列 +export function updateList(data) { + return request({ + url: '/index/list', + method: 'put', + data: data + }) +} + +// 删除应用列 +export function delList(id) { + return request({ + url: '/index/list/' + id, + method: 'delete' + }) +}