1、36壁纸页面列表显示实现

pull/254/head
xjs 4 years ago
parent 9e761fdd69
commit 2e7c457b9f

@ -26,3 +26,12 @@ export function resetSettings() {
method: 'put',
})
}
// 获取壁纸列表
export function getWallpaperList(data) {
return request({
url: '/webmagic/_36wallpaper/list',
method: 'get',
params: data
})
}

@ -16,7 +16,7 @@
</template>
<script>
import { scrollTo } from '@/utils/scroll-to'
import {scrollTo} from '@/utils/scroll-to'
export default {
name: 'Pagination',
@ -36,7 +36,7 @@ export default {
pageSizes: {
type: Array,
default() {
return [3,10,15, 20, 30, 50,100]
return [3, 10, 12, 15, 20, 30, 50, 100]
}
},
// 5
@ -81,13 +81,13 @@ export default {
},
methods: {
handleSizeChange(val) {
this.$emit('pagination', { page: this.currentPage, limit: val })
this.$emit('pagination', {page: this.currentPage, limit: val})
if (this.autoScroll) {
scrollTo(0, 800)
}
},
handleCurrentChange(val) {
this.$emit('pagination', { page: val, limit: this.pageSize })
this.$emit('pagination', {page: val, limit: this.pageSize})
if (this.autoScroll) {
scrollTo(0, 800)
}
@ -101,6 +101,7 @@ export default {
background: #fff;
padding: 32px 16px;
}
.pagination-container.hidden {
display: none;
}

@ -88,10 +88,20 @@ export default {
methods: {
//
getSettings() {
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: "#666666"
});
getSettings().then(res => {
loading.close();
this.formData = res.data
})
},
//

@ -1,65 +1,77 @@
<template>
<div>
<div class="bigDiv">
<el-row :gutter="20" class="el-row">
<el-col :span="4">
<el-row :gutter="20" class="el-row" >
<el-col :span="4" v-for="data in wallpaperList">
<div class="grid-content bg-purple">
<div style="">
<el-image
style="height: 108px;width: 192px"
:src="data.pictureUrl"
:preview-src-list="[data.pictureUrl]">
</el-image>
</div>
<div>
</div>
</div>
</el-col>
<el-col :span="4">
<div class="grid-content bg-purple"></div>
</el-col>
<el-col :span="4">
<div class="grid-content bg-purple"></div>
</el-col>
<el-col :span="4">
<div class="grid-content bg-purple"></div>
</el-col>
<el-col :span="4">
<div class="grid-content bg-purple"></div>
</el-col>
<el-col :span="4">
<div class="grid-content bg-purple"></div>
</el-col>
</el-row>
<el-row :gutter="20" class="el-row">
<el-col :span="4">
<div class="grid-content bg-purple"></div>
</el-col>
<el-col :span="4">
<div class="grid-content bg-purple"></div>
</el-col>
<el-col :span="4">
<div class="grid-content bg-purple"></div>
</el-col>
<el-col :span="4">
<div class="grid-content bg-purple"></div>
</el-col>
<el-col :span="4">
<div class="grid-content bg-purple"></div>
</el-col>
<el-col :span="4">
<div class="grid-content bg-purple"></div>
</el-col>
</el-row>
</div>
<!-- <pagination
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>-->
/>
</div>
</template>
<script>
import {getWallpaperList} from '@/api/business/webmagic/_36wallpaper/wallpaper36'
export default {
name: "wallpaper_36Show"
name: "wallpaper_36Show",
data() {
return {
//
queryParams: {
pageNum: 1,
pageSize: 12,
condition: null,
},
//
total:0,
//
wallpaperList:{},
}
},
created() {
this.getList();
},
methods:{
getList() {
getWallpaperList(this.queryParams).then(response => {
this.wallpaperList = response.data.records;
this.total = response.data.total;
});
},
}
}
</script>
@ -73,6 +85,7 @@ export default {
min-height: 36px;
max-height: 350px;
height: 320px;
margin-bottom: 10px;
}
.bigDiv{

@ -72,7 +72,6 @@ public class ApiLogAspect {
Object obj = joinPoint.proceed();
LocalDateTime localDateTime2 = DateUtil.date().toLocalDateTime();
long between = ChronoUnit.MILLIS.between(localDateTime1, localDateTime2);
log.info("调用接口耗费时间:{}ms", between);
//执行预警切入逻辑(降级不预警)
if (obj instanceof JSONObject) {
JSONObject jsonObject = (JSONObject) obj;
@ -82,6 +81,7 @@ public class ApiLogAspect {
} else {
//如果降级,接口状态修改为异常
this.demoteHandle(joinPoint);
log.info("降级!调用接口耗费时间:{}ms", between);
}
}
@ -177,6 +177,9 @@ public class ApiLogAspect {
String name = annotationInfo.get("name");
String url = annotationInfo.get("url");
log.info("调用{}接口耗费时间:{}ms",name, between);
//根据拿到的url和name查询数据库是否存在存在则count+1不存在则add
ApiRecord apiRecord = new ApiRecord();
apiRecord.setApiName(name);

@ -1,9 +1,11 @@
package com.xjs._36wallpaper.controller;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.security.annotation.RequiresPermissions;
import com.xjs._36wallpaper.pojo._36wallpaper;
import com.xjs._36wallpaper.service._36wallpaperService;
import com.xjs._36wallpaper.task._36wallpaperTask;
import com.xjs.web.MyBaseController;
@ -23,7 +25,7 @@ import java.util.Objects;
@RestController
@RequestMapping("_36wallpaper")
@Api(tags = "爬虫模块-36壁纸网")
public class _36wallpaperController extends MyBaseController {
public class _36wallpaperController extends MyBaseController<_36wallpaper> {
@Autowired
private _36wallpaperTask wallpaperTask;
@ -60,6 +62,15 @@ public class _36wallpaperController extends MyBaseController {
return toAjax(b);
}
@GetMapping("list")
@ApiOperation("获取壁纸列表")
@RequiresPermissions("webmagic:_36wallpaper:list")
public AjaxResult list(_36wallpaper wallpaper) {
IPage<_36wallpaper> list=wallpaperService.selectWallpaperList(startPageMP(),wallpaper);
return AjaxResult.success(list);
}
//----------------------远程rpc调用---------------------------
@GetMapping("taskForPRC")

@ -5,7 +5,9 @@ import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ruoyi.common.core.annotation.Excel;
import com.xjs.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.Date;
@ -16,8 +18,9 @@ import java.util.Date;
* @since 2022-02-20
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("webmagic_36wallpaper")
public class _36wallpaper implements Serializable {
public class _36wallpaper extends BaseEntity implements Serializable {
private static final long serialVersionUID = 1L;

@ -1,6 +1,8 @@
package com.xjs._36wallpaper.service;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.xjs._36wallpaper.pojo._36wallpaper;
@ -37,4 +39,10 @@ public interface _36wallpaperService extends IService<_36wallpaper> {
*/
boolean resetSettings();
/**
*
* @param wallpaper
* @return page
*/
IPage<_36wallpaper> selectWallpaperList(Page<_36wallpaper> page, _36wallpaper wallpaper);
}

@ -1,6 +1,9 @@
package com.xjs._36wallpaper.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.core.constant.HttpStatus;
import com.ruoyi.common.core.domain.R;
@ -10,6 +13,7 @@ import com.xjs._36wallpaper.mapper._36wallpaperMapper;
import com.xjs._36wallpaper.pojo._36wallpaper;
import com.xjs._36wallpaper.service._36wallpaperService;
import com.xjs.exception.BusinessException;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -128,6 +132,19 @@ public class _36wallpaperServiceImpl extends ServiceImpl<_36wallpaperMapper, _36
return false;
}
@Override
public IPage<_36wallpaper> selectWallpaperList(Page<_36wallpaper> page, _36wallpaper wallpaper) {
String condition = wallpaper.getCondition();
QueryWrapper<_36wallpaper> wr = new QueryWrapper<>();
wr.and(StringUtils.isNotEmpty(condition), obj -> {
obj.like("picture_name", condition)
.or().like("type", condition)
.or().like("label", condition);
});
return this.page(page,wr);
}
/**
*

Loading…
Cancel
Save