diff --git a/zxf-admin/src/main/java/com/zxf/web/controller/wheel/ZxfmnWheelController.java b/zxf-admin/src/main/java/com/zxf/web/controller/wheel/ZxfmnWheelController.java new file mode 100644 index 0000000..f2623e8 --- /dev/null +++ b/zxf-admin/src/main/java/com/zxf/web/controller/wheel/ZxfmnWheelController.java @@ -0,0 +1,105 @@ +package com.zxf.web.controller.wheel; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; + +import com.zxf.system.domain.ZxfmnWheel; +import com.zxf.system.service.IZxfmnWheelService; +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.zxf.common.annotation.Log; +import com.zxf.common.core.controller.BaseController; +import com.zxf.common.core.domain.AjaxResult; +import com.zxf.common.enums.BusinessType; +import com.zxf.common.utils.poi.ExcelUtil; +import com.zxf.common.core.page.TableDataInfo; + +/** + * wheelController + * + * @author zxf + * @date 2023-07-18 + */ +@RestController +@RequestMapping("/wheel/wheel") +public class ZxfmnWheelController extends BaseController +{ + @Autowired + private IZxfmnWheelService zxfmnWheelService; + + /** + * 查询wheel列表 + */ + @PreAuthorize("@ss.hasPermi('wheel:wheel:list')") + @GetMapping("/list") + public TableDataInfo list(ZxfmnWheel zxfmnWheel) + { + startPage(); + List list = zxfmnWheelService.selectZxfmnWheelList(zxfmnWheel); + return getDataTable(list); + } + + /** + * 导出wheel列表 + */ + @PreAuthorize("@ss.hasPermi('wheel:wheel:export')") + @Log(title = "wheel", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, ZxfmnWheel zxfmnWheel) + { + List list = zxfmnWheelService.selectZxfmnWheelList(zxfmnWheel); + ExcelUtil util = new ExcelUtil(ZxfmnWheel.class); + util.exportExcel(response, list, "wheel数据"); + } + + /** + * 获取wheel详细信息 + */ + @PreAuthorize("@ss.hasPermi('wheel:wheel:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Integer id) + { + return success(zxfmnWheelService.selectZxfmnWheelById(id)); + } + + /** + * 新增wheel + */ + @PreAuthorize("@ss.hasPermi('wheel:wheel:add')") + @Log(title = "wheel", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody ZxfmnWheel zxfmnWheel) + { + return toAjax(zxfmnWheelService.insertZxfmnWheel(zxfmnWheel)); + } + + /** + * 修改wheel + */ + @PreAuthorize("@ss.hasPermi('wheel:wheel:edit')") + @Log(title = "wheel", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody ZxfmnWheel zxfmnWheel) + { + return toAjax(zxfmnWheelService.updateZxfmnWheel(zxfmnWheel)); + } + + /** + * 删除wheel + */ + @PreAuthorize("@ss.hasPermi('wheel:wheel:remove')") + @Log(title = "wheel", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Integer[] ids) + { + return toAjax(zxfmnWheelService.deleteZxfmnWheelByIds(ids)); + } +} diff --git a/zxf-admin/src/main/java/com/zxf/web/controller/wxapi/wxBusinessControllApi.java b/zxf-admin/src/main/java/com/zxf/web/controller/wxapi/wxBusinessControllApi.java index 96d1c9c..4b0a133 100644 --- a/zxf-admin/src/main/java/com/zxf/web/controller/wxapi/wxBusinessControllApi.java +++ b/zxf-admin/src/main/java/com/zxf/web/controller/wxapi/wxBusinessControllApi.java @@ -5,6 +5,8 @@ import com.zxf.common.annotation.Anonymous; import com.zxf.common.core.domain.AjaxResult; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.web.bind.annotation.*; import java.util.ArrayList; @@ -17,17 +19,27 @@ import java.util.Map; public class wxBusinessControllApi { private static final Logger log = LoggerFactory.getLogger(wxBusinessControllApi.class); + @Autowired + JdbcTemplate jdbcTemplate; + + + /** + * 获取首页轮播图片地址信息 + * @param param + * @return + */ @Anonymous @GetMapping("/getimage") public AjaxResult getimage(@RequestParam Map param) { log.info("获取首页轮播图图片地址 到时候返回静态服务器绝对路径"); - List a = new ArrayList(); - a.add("/images/1.jpg"); - a.add("/images/2.jpg"); - a.add("/images/3.jpg"); - return AjaxResult.success(a); + List> images=jdbcTemplate.queryForList("select CONCAT('http://127.0.0.1:8080',img_url ) img_url from zxfmn_wheel"); + return AjaxResult.success(images); } + + + + } diff --git a/zxf-system/src/main/java/com/zxf/system/domain/ZxfmnWheel.java b/zxf-system/src/main/java/com/zxf/system/domain/ZxfmnWheel.java new file mode 100644 index 0000000..126d1cd --- /dev/null +++ b/zxf-system/src/main/java/com/zxf/system/domain/ZxfmnWheel.java @@ -0,0 +1,121 @@ +package com.zxf.system.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.zxf.common.annotation.Excel; +import com.zxf.common.core.domain.BaseEntity; + +/** + * wheel对象 zxfmn_wheel + * + * @author zxf + * @date 2023-07-18 + */ +public class ZxfmnWheel extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** $column.columnComment */ + private Integer id; + + /** 1 展示 2 不展示 */ + @Excel(name = "1 展示 2 不展示") + private String isFlag; + + /** 图片地址 */ + @Excel(name = "图片地址") + private String imgUrl; + + /** 跳转地址 */ + @Excel(name = "跳转地址") + private String skipUrl; + + /** 富文本信息展示 */ + @Excel(name = "富文本信息展示") + private String richText; + + /** 视频地址 */ + @Excel(name = "视频地址") + private String videoText; + + /** 扩展 */ + @Excel(name = "扩展") + private String extend; + + public void setId(Integer id) + { + this.id = id; + } + + public Integer getId() + { + return id; + } + public void setIsFlag(String isFlag) + { + this.isFlag = isFlag; + } + + public String getIsFlag() + { + return isFlag; + } + public void setImgUrl(String imgUrl) + { + this.imgUrl = imgUrl; + } + + public String getImgUrl() + { + return imgUrl; + } + public void setSkipUrl(String skipUrl) + { + this.skipUrl = skipUrl; + } + + public String getSkipUrl() + { + return skipUrl; + } + public void setRichText(String richText) + { + this.richText = richText; + } + + public String getRichText() + { + return richText; + } + public void setVideoText(String videoText) + { + this.videoText = videoText; + } + + public String getVideoText() + { + return videoText; + } + public void setExtend(String extend) + { + this.extend = extend; + } + + public String getExtend() + { + return extend; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("isFlag", getIsFlag()) + .append("imgUrl", getImgUrl()) + .append("skipUrl", getSkipUrl()) + .append("richText", getRichText()) + .append("videoText", getVideoText()) + .append("extend", getExtend()) + .toString(); + } +} diff --git a/zxf-system/src/main/java/com/zxf/system/mapper/ZxfmnWheelMapper.java b/zxf-system/src/main/java/com/zxf/system/mapper/ZxfmnWheelMapper.java new file mode 100644 index 0000000..d3c12a7 --- /dev/null +++ b/zxf-system/src/main/java/com/zxf/system/mapper/ZxfmnWheelMapper.java @@ -0,0 +1,62 @@ +package com.zxf.system.mapper; + +import java.util.List; + +import com.zxf.system.domain.ZxfmnWheel; + +/** + * wheelMapper接口 + * + * @author zxf + * @date 2023-07-18 + */ +public interface ZxfmnWheelMapper +{ + /** + * 查询wheel + * + * @param id wheel主键 + * @return wheel + */ + public ZxfmnWheel selectZxfmnWheelById(Integer id); + + /** + * 查询wheel列表 + * + * @param zxfmnWheel wheel + * @return wheel集合 + */ + public List selectZxfmnWheelList(ZxfmnWheel zxfmnWheel); + + /** + * 新增wheel + * + * @param zxfmnWheel wheel + * @return 结果 + */ + public int insertZxfmnWheel(ZxfmnWheel zxfmnWheel); + + /** + * 修改wheel + * + * @param zxfmnWheel wheel + * @return 结果 + */ + public int updateZxfmnWheel(ZxfmnWheel zxfmnWheel); + + /** + * 删除wheel + * + * @param id wheel主键 + * @return 结果 + */ + public int deleteZxfmnWheelById(Integer id); + + /** + * 批量删除wheel + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteZxfmnWheelByIds(Integer[] ids); +} diff --git a/zxf-system/src/main/java/com/zxf/system/service/IZxfmnWheelService.java b/zxf-system/src/main/java/com/zxf/system/service/IZxfmnWheelService.java new file mode 100644 index 0000000..12aabd6 --- /dev/null +++ b/zxf-system/src/main/java/com/zxf/system/service/IZxfmnWheelService.java @@ -0,0 +1,62 @@ +package com.zxf.system.service; + +import com.zxf.system.domain.ZxfmnWheel; + +import java.util.List; + +/** + * wheelService接口 + * + * @author zxf + * @date 2023-07-18 + */ +public interface IZxfmnWheelService +{ + /** + * 查询wheel + * + * @param id wheel主键 + * @return wheel + */ + public ZxfmnWheel selectZxfmnWheelById(Integer id); + + /** + * 查询wheel列表 + * + * @param zxfmnWheel wheel + * @return wheel集合 + */ + public List selectZxfmnWheelList(ZxfmnWheel zxfmnWheel); + + /** + * 新增wheel + * + * @param zxfmnWheel wheel + * @return 结果 + */ + public int insertZxfmnWheel(ZxfmnWheel zxfmnWheel); + + /** + * 修改wheel + * + * @param zxfmnWheel wheel + * @return 结果 + */ + public int updateZxfmnWheel(ZxfmnWheel zxfmnWheel); + + /** + * 批量删除wheel + * + * @param ids 需要删除的wheel主键集合 + * @return 结果 + */ + public int deleteZxfmnWheelByIds(Integer[] ids); + + /** + * 删除wheel信息 + * + * @param id wheel主键 + * @return 结果 + */ + public int deleteZxfmnWheelById(Integer id); +} diff --git a/zxf-system/src/main/java/com/zxf/system/service/impl/ZxfmnWheelServiceImpl.java b/zxf-system/src/main/java/com/zxf/system/service/impl/ZxfmnWheelServiceImpl.java new file mode 100644 index 0000000..dc58fe1 --- /dev/null +++ b/zxf-system/src/main/java/com/zxf/system/service/impl/ZxfmnWheelServiceImpl.java @@ -0,0 +1,95 @@ +package com.zxf.system.service.impl; + +import java.util.List; + +import com.zxf.system.domain.ZxfmnWheel; +import com.zxf.system.mapper.ZxfmnWheelMapper; +import com.zxf.system.service.IZxfmnWheelService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + + +/** + * wheelService业务层处理 + * + * @author zxf + * @date 2023-07-18 + */ +@Service +public class ZxfmnWheelServiceImpl implements IZxfmnWheelService +{ + @Autowired + private ZxfmnWheelMapper zxfmnWheelMapper; + + /** + * 查询wheel + * + * @param id wheel主键 + * @return wheel + */ + @Override + public ZxfmnWheel selectZxfmnWheelById(Integer id) + { + return zxfmnWheelMapper.selectZxfmnWheelById(id); + } + + /** + * 查询wheel列表 + * + * @param zxfmnWheel wheel + * @return wheel + */ + @Override + public List selectZxfmnWheelList(ZxfmnWheel zxfmnWheel) + { + return zxfmnWheelMapper.selectZxfmnWheelList(zxfmnWheel); + } + + /** + * 新增wheel + * + * @param zxfmnWheel wheel + * @return 结果 + */ + @Override + public int insertZxfmnWheel(ZxfmnWheel zxfmnWheel) + { + return zxfmnWheelMapper.insertZxfmnWheel(zxfmnWheel); + } + + /** + * 修改wheel + * + * @param zxfmnWheel wheel + * @return 结果 + */ + @Override + public int updateZxfmnWheel(ZxfmnWheel zxfmnWheel) + { + return zxfmnWheelMapper.updateZxfmnWheel(zxfmnWheel); + } + + /** + * 批量删除wheel + * + * @param ids 需要删除的wheel主键 + * @return 结果 + */ + @Override + public int deleteZxfmnWheelByIds(Integer[] ids) + { + return zxfmnWheelMapper.deleteZxfmnWheelByIds(ids); + } + + /** + * 删除wheel信息 + * + * @param id wheel主键 + * @return 结果 + */ + @Override + public int deleteZxfmnWheelById(Integer id) + { + return zxfmnWheelMapper.deleteZxfmnWheelById(id); + } +} diff --git a/zxf-system/src/main/resources/mapper/wheel/ZxfmnWheelMapper.xml b/zxf-system/src/main/resources/mapper/wheel/ZxfmnWheelMapper.xml new file mode 100644 index 0000000..7bba943 --- /dev/null +++ b/zxf-system/src/main/resources/mapper/wheel/ZxfmnWheelMapper.xml @@ -0,0 +1,81 @@ + + + + + + + + + + + + + + + + select id, is_flag, img_url, skip_url, rich_text, video_text, extend from zxfmn_wheel + + + + + + + + insert into zxfmn_wheel + + is_flag, + img_url, + skip_url, + rich_text, + video_text, + extend, + + + #{isFlag}, + #{imgUrl}, + #{skipUrl}, + #{richText}, + #{videoText}, + #{extend}, + + + + + update zxfmn_wheel + + is_flag = #{isFlag}, + img_url = #{imgUrl}, + skip_url = #{skipUrl}, + rich_text = #{richText}, + video_text = #{videoText}, + extend = #{extend}, + + where id = #{id} + + + + delete from zxfmn_wheel where id = #{id} + + + + delete from zxfmn_wheel where id in + + #{id} + + + \ No newline at end of file diff --git a/zxf-ui/src/api/wheel/wheel.js b/zxf-ui/src/api/wheel/wheel.js new file mode 100644 index 0000000..14b6a82 --- /dev/null +++ b/zxf-ui/src/api/wheel/wheel.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询wheel列表 +export function listWheel(query) { + return request({ + url: '/wheel/wheel/list', + method: 'get', + params: query + }) +} + +// 查询wheel详细 +export function getWheel(id) { + return request({ + url: '/wheel/wheel/' + id, + method: 'get' + }) +} + +// 新增wheel +export function addWheel(data) { + return request({ + url: '/wheel/wheel', + method: 'post', + data: data + }) +} + +// 修改wheel +export function updateWheel(data) { + return request({ + url: '/wheel/wheel', + method: 'put', + data: data + }) +} + +// 删除wheel +export function delWheel(id) { + return request({ + url: '/wheel/wheel/' + id, + method: 'delete' + }) +} diff --git a/zxf-ui/src/views/wheel/wheel/index.vue b/zxf-ui/src/views/wheel/wheel/index.vue new file mode 100644 index 0000000..b8aacf4 --- /dev/null +++ b/zxf-ui/src/views/wheel/wheel/index.vue @@ -0,0 +1,287 @@ + + +