2024.7.10 新元素官网 字典倒序,网站接口代码
This commit is contained in:
parent
3fbe35e556
commit
25a85220ba
|
@ -0,0 +1,67 @@
|
|||
package com.ruoyi.web.controller.system;
|
||||
|
||||
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.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.utils.sign.Base64;
|
||||
import com.ruoyi.system.domain.XysArticle;
|
||||
import com.ruoyi.system.domain.XysImg;
|
||||
import com.ruoyi.system.service.IXysArticleService;
|
||||
import com.ruoyi.system.service.IXysImgService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 門戶Controller
|
||||
*
|
||||
* @author libao
|
||||
* @date 2024-07-08
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/door")
|
||||
public class DoorController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IXysArticleService xysArticleService;
|
||||
@Autowired
|
||||
private IXysImgService xysImgService;
|
||||
|
||||
/**
|
||||
* 查询文章列表
|
||||
*/
|
||||
@GetMapping("/getArticleList")
|
||||
public TableDataInfo getArticleList(XysArticle xysArticle)
|
||||
{
|
||||
startPage();
|
||||
List<XysArticle> list = xysArticleService.selectXysArticleList(xysArticle);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询图片列表
|
||||
*/
|
||||
@GetMapping("/getImgList")
|
||||
public TableDataInfo getImgList(XysImg xysImg)
|
||||
{
|
||||
startPage();
|
||||
List<XysImg> list = xysImgService.selectXysImgList(xysImg);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取文章管理详细信息
|
||||
*/
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(xysArticleService.selectXysArticleById(id));
|
||||
}
|
||||
|
||||
}
|
|
@ -79,8 +79,8 @@ public class XysArticleController extends BaseController
|
|||
@PostMapping
|
||||
public AjaxResult add(@RequestBody XysArticle xysArticle)
|
||||
{
|
||||
String content = new String(Base64.decode(xysArticle.getContent()));
|
||||
xysArticle.setContent(content);
|
||||
// String content = new String(Base64.decode(xysArticle.getContent()));
|
||||
// xysArticle.setContent(content);
|
||||
return toAjax(xysArticleService.insertXysArticle(xysArticle));
|
||||
}
|
||||
|
||||
|
@ -92,8 +92,8 @@ public class XysArticleController extends BaseController
|
|||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody XysArticle xysArticle)
|
||||
{
|
||||
String content = new String(Base64.decode(xysArticle.getContent()));
|
||||
xysArticle.setContent(content);
|
||||
// String content = new String(Base64.decode(xysArticle.getContent()));
|
||||
// xysArticle.setContent(content);
|
||||
return toAjax(xysArticleService.updateXysArticle(xysArticle));
|
||||
}
|
||||
|
||||
|
|
|
@ -14,9 +14,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
|
||||
<sql id="selectDictTypeVo">
|
||||
select dict_id, dict_name, dict_type, status, create_by, create_time, remark
|
||||
select dict_id, dict_name, dict_type, status, create_by, create_time, remark
|
||||
from sys_dict_type
|
||||
</sql>
|
||||
|
||||
|
@ -39,36 +39,37 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
and date_format(create_time,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d')
|
||||
</if>
|
||||
</where>
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectDictTypeAll" resultMap="SysDictTypeResult">
|
||||
<include refid="selectDictTypeVo"/>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectDictTypeById" parameterType="Long" resultMap="SysDictTypeResult">
|
||||
<include refid="selectDictTypeVo"/>
|
||||
where dict_id = #{dictId}
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectDictTypeByType" parameterType="String" resultMap="SysDictTypeResult">
|
||||
<include refid="selectDictTypeVo"/>
|
||||
where dict_type = #{dictType}
|
||||
</select>
|
||||
|
||||
|
||||
<select id="checkDictTypeUnique" parameterType="String" resultMap="SysDictTypeResult">
|
||||
<include refid="selectDictTypeVo"/>
|
||||
where dict_type = #{dictType} limit 1
|
||||
</select>
|
||||
|
||||
|
||||
<delete id="deleteDictTypeById" parameterType="Long">
|
||||
delete from sys_dict_type where dict_id = #{dictId}
|
||||
</delete>
|
||||
|
||||
|
||||
<delete id="deleteDictTypeByIds" parameterType="Long">
|
||||
delete from sys_dict_type where dict_id in
|
||||
<foreach collection="array" item="dictId" open="(" separator="," close=")">
|
||||
#{dictId}
|
||||
</foreach>
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<update id="updateDictType" parameterType="SysDictType">
|
||||
|
@ -83,7 +84,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</set>
|
||||
where dict_id = #{dictId}
|
||||
</update>
|
||||
|
||||
|
||||
<insert id="insertDictType" parameterType="SysDictType">
|
||||
insert into sys_dict_type(
|
||||
<if test="dictName != null and dictName != ''">dict_name,</if>
|
||||
|
@ -101,5 +102,5 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
sysdate()
|
||||
)
|
||||
</insert>
|
||||
|
||||
</mapper>
|
||||
|
||||
</mapper>
|
||||
|
|
|
@ -66,7 +66,11 @@
|
|||
<el-table v-loading="loading" :data="imgList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="官网图片管理" align="center" prop="id" />
|
||||
<el-table-column label="图片类型" align="center" prop="imgType" />
|
||||
<el-table-column label="图片类型" align="center" prop="imgType">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.img_type" :value="scope.row.imgType"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="图片地址" align="center" prop="imgUrl" width="100">
|
||||
<template slot-scope="scope">
|
||||
<image-preview :src="scope.row.imgUrl" :width="50" :height="50"/>
|
||||
|
@ -109,6 +113,16 @@
|
|||
<!-- 添加或修改图片管理对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="图片类型" prop="imgType">
|
||||
<el-select v-model="form.imgType" placeholder="请选择图片类型">
|
||||
<el-option
|
||||
v-for="dict in dict.type.img_type"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="parseInt(dict.value)"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="图片地址" prop="imgUrl">
|
||||
<image-upload v-model="form.imgUrl"/>
|
||||
</el-form-item>
|
||||
|
@ -139,7 +153,7 @@ import { listImg, getImg, delImg, addImg, updateImg } from "@/api/system/img";
|
|||
|
||||
export default {
|
||||
name: "Img",
|
||||
dicts: ['article_cat'],
|
||||
dicts: ['img_type', 'article_cat'],
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
|
|
Loading…
Reference in New Issue