parent
460f7c242f
commit
0b2edf4817
@ -0,0 +1,27 @@
|
||||
package com.xjs.config;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.DbType;
|
||||
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
|
||||
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
/**
|
||||
* @author xiejs
|
||||
* @desc
|
||||
* @create 2021-12-31
|
||||
*/
|
||||
@Configuration
|
||||
public class MybatisPlusConfig {
|
||||
|
||||
/**
|
||||
* mysql分页插件
|
||||
* @return MybatisPlusInterceptor
|
||||
*/
|
||||
@Bean
|
||||
public MybatisPlusInterceptor mybatisPlusInterceptor() {
|
||||
MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
|
||||
interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));
|
||||
return interceptor;
|
||||
}
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
package com.xjs.consts;
|
||||
|
||||
/**
|
||||
* @author xiejs
|
||||
* @desc 英语单词常量类
|
||||
* @create 2021-12-31
|
||||
*/
|
||||
public class EnglishWordConst {
|
||||
|
||||
//置顶
|
||||
public static final Integer TOP = 1;
|
||||
|
||||
//不置顶
|
||||
public static final Integer NO_TOP = 2;
|
||||
|
||||
//收藏
|
||||
public static final Integer COLLECT = 1;
|
||||
|
||||
//不收藏
|
||||
public static final Integer NO_COLLECT = 2;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package com.xjs.web;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ruoyi.common.core.utils.StringUtils;
|
||||
import com.ruoyi.common.core.web.controller.BaseController;
|
||||
import com.ruoyi.common.core.web.page.PageDomain;
|
||||
import com.ruoyi.common.core.web.page.TableSupport;
|
||||
|
||||
/**
|
||||
* @author xiejs
|
||||
* @desc 自定义通用controller
|
||||
* @create 2021-12-31
|
||||
*/
|
||||
public class MyBaseController extends BaseController {
|
||||
|
||||
/**
|
||||
* mp分页封装
|
||||
* @return Page
|
||||
*/
|
||||
protected Page startPageMP( ){
|
||||
PageDomain pageDomain = TableSupport.buildPageRequest();
|
||||
Integer pageNum = pageDomain.getPageNum();
|
||||
Integer pageSize = pageDomain.getPageSize();
|
||||
Page page = new Page<>();
|
||||
if (StringUtils.isNotNull(pageNum) && StringUtils.isNotNull(pageSize))
|
||||
{
|
||||
page.setSize(pageSize);
|
||||
page.setCurrent(pageNum);
|
||||
}
|
||||
return page;
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in new issue