1、新浪新闻模块和文案网模块根据类别查询,获取所有类别
This commit is contained in:
parent
9f150e483c
commit
22571f8071
|
|
@ -16,3 +16,12 @@ export function delCopyWritingNetwork(id) {
|
|||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// 获取类型
|
||||
export function getType() {
|
||||
return request({
|
||||
url: '/webmagic/copyWritingNetwork/getType',
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,3 +16,11 @@ export function delSinaNews(id) {
|
|||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 获取类型
|
||||
export function getType() {
|
||||
return request({
|
||||
url: '/webmagic/sinaNews/getType',
|
||||
method: 'get',
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,16 +1,16 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<!-- <el-form-item label="文案标签" prop="type">
|
||||
<el-select v-model="queryParams.type" placeholder="请选择文案标签" clearable size="small">
|
||||
<el-option
|
||||
v-for="dict in dict.type.sys_user_sex"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>-->
|
||||
<el-form-item label="文案标签" prop="type">
|
||||
<el-select v-model="queryParams.type" placeholder="请选择文案标签" clearable size="small">
|
||||
<el-option
|
||||
v-for="index in typeList"
|
||||
:key="index"
|
||||
:label="index"
|
||||
:value="index"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="文案主题" prop="theme">
|
||||
<el-input
|
||||
v-model="queryParams.theme"
|
||||
|
|
@ -79,7 +79,7 @@
|
|||
|
||||
<el-table v-loading="loading" :data="copyWritingNetworkList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center"/>
|
||||
<el-table-column label="文案标签" align="center" prop="type" :show-overflow-tooltip="true" width="120px" />
|
||||
<el-table-column label="文案标签" align="center" prop="type" :show-overflow-tooltip="true" width="120px"/>
|
||||
<el-table-column label="文案主题" align="center" prop="theme" :show-overflow-tooltip="true" width="200px"/>
|
||||
<el-table-column label="文案内容" align="center" prop="content" :show-overflow-tooltip="true"/>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="150px">
|
||||
|
|
@ -108,7 +108,11 @@
|
|||
</template>
|
||||
<script>
|
||||
|
||||
import {listCopyWritingNetwork, delCopyWritingNetwork} from "@/api/business/webmagic/copywritingnetwork/copyWritingNetwork"
|
||||
import {
|
||||
listCopyWritingNetwork,
|
||||
delCopyWritingNetwork,
|
||||
getType
|
||||
} from "@/api/business/webmagic/copywritingnetwork/copyWritingNetwork"
|
||||
|
||||
export default {
|
||||
name: "CopyWritingNetwork",
|
||||
|
|
@ -147,8 +151,10 @@ export default {
|
|||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
},
|
||||
rules: {},
|
||||
|
||||
//类型集合
|
||||
typeList:[],
|
||||
|
||||
//日期组件
|
||||
pickerOptions: {
|
||||
|
|
@ -190,8 +196,16 @@ export default {
|
|||
},
|
||||
created() {
|
||||
this.getList();
|
||||
this.getType();
|
||||
},
|
||||
methods: {
|
||||
//获取类型
|
||||
getType() {
|
||||
getType().then(res =>{
|
||||
this.typeList=res.data
|
||||
})
|
||||
},
|
||||
|
||||
/** 查询文案网列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
|
|
@ -238,19 +252,20 @@ export default {
|
|||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id)
|
||||
this.single = selection.length!==1
|
||||
this.single = selection.length !== 1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids;
|
||||
this.$modal.confirm('是否确认删除文案网编号为"' + ids + '"的数据项?').then(function() {
|
||||
this.$modal.confirm('是否确认删除文案网编号为"' + ids + '"的数据项?').then(function () {
|
||||
return delCopyWritingNetwork(ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
}).catch(() => {
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,17 @@
|
|||
<div class="app-container">
|
||||
|
||||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="新闻分类" prop="category">
|
||||
<el-select v-model="queryParams.category" placeholder="请输入新闻分类" clearable size="small">
|
||||
<el-option
|
||||
v-for="index in typeList"
|
||||
:key="index"
|
||||
:label="index"
|
||||
:value="index"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="标题" prop="title">
|
||||
<el-input
|
||||
v-model="queryParams.title"
|
||||
|
|
@ -11,15 +22,7 @@
|
|||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="新闻分类" prop="category">
|
||||
<el-input
|
||||
v-model="queryParams.category"
|
||||
placeholder="请输入新闻分类"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="创建时间">
|
||||
<el-date-picker
|
||||
v-model="daterangeCreateTime"
|
||||
|
|
@ -95,7 +98,7 @@
|
|||
|
||||
<script>
|
||||
|
||||
import {listSinaNews, delSinaNews} from "@/api/business/webmagic/sina/sinaNews"
|
||||
import {listSinaNews, delSinaNews,getType} from "@/api/business/webmagic/sina/sinaNews"
|
||||
|
||||
export default {
|
||||
name: "SinaNews",
|
||||
|
|
@ -134,6 +137,9 @@ export default {
|
|||
//检查查询范围
|
||||
daterangeCreateTime: [],
|
||||
|
||||
//类型集合
|
||||
typeList:[],
|
||||
|
||||
//日期组件
|
||||
pickerOptions: {
|
||||
shortcuts: [{
|
||||
|
|
@ -175,8 +181,16 @@ export default {
|
|||
|
||||
created() {
|
||||
this.getList();
|
||||
this.getType();
|
||||
},
|
||||
methods: {
|
||||
//获取类型
|
||||
getType() {
|
||||
getType().then(res =>{
|
||||
this.typeList=res.data
|
||||
})
|
||||
},
|
||||
|
||||
//跳转链接
|
||||
to(url) {
|
||||
window.open(url, "_blank");
|
||||
|
|
|
|||
|
|
@ -35,6 +35,16 @@ public class CopyWritingNetworkController extends MyBaseController {
|
|||
@Autowired
|
||||
private CopyWritingNetworkTask copyWritingNetworkTask;
|
||||
|
||||
|
||||
@GetMapping("getType")
|
||||
@ApiOperation("获取标签")
|
||||
public AjaxResult getType() {
|
||||
List<Object> typeList=copyWritingNetworkService.getType();
|
||||
return AjaxResult.success(typeList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//----------------------远程rpc调用---------------------------
|
||||
@GetMapping("taskForPRC")
|
||||
@ApiOperation("供定时任务服务RPC远程调用")
|
||||
|
|
|
|||
|
|
@ -45,4 +45,9 @@ public interface CopyWritingNetworkMapper extends BaseMapper<CopyWritingNetwork>
|
|||
*/
|
||||
public int deleteCopyWritingNetworkByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 获取文案的标签
|
||||
* @return list
|
||||
*/
|
||||
List<String> getType();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.xjs.copywritingNetwork.pojo;
|
|||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.ruoyi.common.core.annotation.Excel;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
|
@ -21,16 +22,20 @@ public class CopyWritingNetwork implements Serializable {
|
|||
private Long id;
|
||||
|
||||
/** 文案标签 */
|
||||
@Excel(name = "文案标签")
|
||||
private String type;
|
||||
|
||||
/** 文案主题 */
|
||||
@Excel(name = "文案主题")
|
||||
private String theme;
|
||||
|
||||
/** 文案内容 */
|
||||
@Excel(name = "文案内容")
|
||||
private String content;
|
||||
|
||||
/** 创建时间 */
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Excel(name = "创建时间",dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -44,4 +44,11 @@ public interface CopyWritingNetworkService extends IService<CopyWritingNetwork>
|
|||
* @return 结果
|
||||
*/
|
||||
int deleteCopyWritingNetworkById(Long id);
|
||||
|
||||
/**
|
||||
* 获取文案的标签
|
||||
* @return list
|
||||
*/
|
||||
List<Object> getType();
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.xjs.copywritingNetwork.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.xjs.copywritingNetwork.mapper.CopyWritingNetworkMapper;
|
||||
import com.xjs.copywritingNetwork.pojo.CopyWritingNetwork;
|
||||
|
|
@ -58,4 +59,13 @@ public class CopyWritingNetworkServiceImpl extends ServiceImpl<CopyWritingNetwor
|
|||
public int deleteCopyWritingNetworkById(Long id) {
|
||||
return copyWritingNetworkMapper.deleteCopyWritingNetworkById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Object> getType() {
|
||||
QueryWrapper<CopyWritingNetwork> wrapper = new QueryWrapper<>();
|
||||
wrapper.groupBy("type");
|
||||
wrapper.select("type");
|
||||
|
||||
return this.listObjs(wrapper);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,6 +33,14 @@ public class SinaNewsController extends MyBaseController {
|
|||
private SinaNewsService sinaNewsService;
|
||||
|
||||
|
||||
@GetMapping("getType")
|
||||
@ApiOperation("获取标签")
|
||||
public AjaxResult getType() {
|
||||
List<Object> typeList=sinaNewsService.getType();
|
||||
return AjaxResult.success(typeList);
|
||||
}
|
||||
|
||||
|
||||
//----------------------远程rpc调用---------------------------
|
||||
@GetMapping("taskForPRC")
|
||||
@ApiOperation("供定时任务服务RPC远程调用")
|
||||
|
|
|
|||
|
|
@ -42,4 +42,10 @@ public interface SinaNewsService extends IService<SinaNews> {
|
|||
* @return 结果
|
||||
*/
|
||||
public int deleteSinaNewsById(Long id);
|
||||
|
||||
/**
|
||||
* 获取新闻分类
|
||||
* @return List
|
||||
*/
|
||||
List<Object> getType();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.xjs.sina.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.xjs.sina.mapper.SinaNewsMapper;
|
||||
import com.xjs.sina.pojo.SinaNews;
|
||||
|
|
@ -59,4 +60,13 @@ public class SinaNewsServiceImpl extends ServiceImpl<SinaNewsMapper, SinaNews> i
|
|||
public int deleteSinaNewsById(Long id) {
|
||||
return sinaNewsMapper.deleteSinaNewsById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Object> getType() {
|
||||
QueryWrapper<SinaNews> wrapper = new QueryWrapper<>();
|
||||
wrapper.groupBy("category");
|
||||
wrapper.select("category");
|
||||
|
||||
return this.listObjs(wrapper);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,6 +29,16 @@
|
|||
order by create_time desc
|
||||
</select>
|
||||
|
||||
|
||||
<select id="getType" resultType="java.lang.String">
|
||||
SELECT
|
||||
type
|
||||
FROM
|
||||
webmagic_copywriting_network
|
||||
GROUP BY
|
||||
type
|
||||
</select>
|
||||
|
||||
<delete id="deleteRepeatData">
|
||||
delete from webmagic_copywriting_network where id not in (
|
||||
SELECT
|
||||
|
|
|
|||
Loading…
Reference in New Issue