├── image ├── 图片1.png ├── 图片2.png ├── 图片3.png ├── 图片4.png ├── 图片5.png ├── 图片6.png ├── 图片7.png ├── 图片8.png ├── 图片9.png ├── 图片10.png ├── 图片11.png ├── 图片12.png ├── 图片13.png ├── 图片14.png ├── 图片15.png └── 图片16.png ├── limage └── 1.png ├── src ├── main │ ├── resources │ │ ├── mapper │ │ │ ├── ConfigDao.xml │ │ │ ├── UserDao.xml │ │ │ ├── TokenDao.xml │ │ │ ├── NewsDao.xml │ │ │ ├── ShangpinleixingDao.xml │ │ │ ├── MessagesDao.xml │ │ │ ├── YonghuDao.xml │ │ │ ├── PaimaishangpinDao.xml │ │ │ ├── LishijingpaiDao.xml │ │ │ ├── CommonDao.xml │ │ │ └── JingpaidingdanDao.xml │ │ └── application.yml │ └── java │ │ └── com │ │ ├── dao │ │ ├── ConfigDao.java │ │ ├── UserDao.java │ │ ├── TokenDao.java │ │ ├── CommonDao.java │ │ ├── NewsDao.java │ │ ├── YonghuDao.java │ │ ├── MessagesDao.java │ │ ├── LishijingpaiDao.java │ │ ├── JingpaidingdanDao.java │ │ ├── PaimaishangpinDao.java │ │ └── ShangpinleixingDao.java │ │ ├── annotation │ │ ├── IgnoreAuth.java │ │ ├── LoginUser.java │ │ └── APPLoginUser.java │ │ ├── service │ │ ├── ConfigService.java │ │ ├── CommonService.java │ │ ├── UserService.java │ │ ├── TokenService.java │ │ ├── impl │ │ │ ├── ConfigServiceImpl.java │ │ │ ├── CommonServiceImpl.java │ │ │ ├── UserServiceImpl.java │ │ │ ├── NewsServiceImpl.java │ │ │ ├── YonghuServiceImpl.java │ │ │ ├── MessagesServiceImpl.java │ │ │ ├── LishijingpaiServiceImpl.java │ │ │ ├── JingpaidingdanServiceImpl.java │ │ │ ├── PaimaishangpinServiceImpl.java │ │ │ ├── ShangpinleixingServiceImpl.java │ │ │ └── TokenServiceImpl.java │ │ ├── NewsService.java │ │ ├── YonghuService.java │ │ ├── MessagesService.java │ │ ├── LishijingpaiService.java │ │ ├── JingpaidingdanService.java │ │ ├── PaimaishangpinService.java │ │ └── ShangpinleixingService.java │ │ ├── utils │ │ ├── MD5Util.java │ │ ├── CommonUtil.java │ │ ├── FileUtil.java │ │ ├── JQPageInfo.java │ │ ├── R.java │ │ ├── SQLFilter.java │ │ ├── HttpClientUtils.java │ │ ├── ValidatorUtils.java │ │ ├── SpringContextUtils.java │ │ ├── PageUtils.java │ │ ├── Query.java │ │ ├── BaiduUtil.java │ │ └── MPUtil.java │ │ ├── config │ │ ├── MybatisPlusConfig.java │ │ └── InterceptorConfig.java │ │ ├── entity │ │ ├── vo │ │ │ ├── ShangpinleixingVO.java │ │ │ ├── MessagesVO.java │ │ │ ├── NewsVO.java │ │ │ ├── PaimaishangpinVO.java │ │ │ ├── YonghuVO.java │ │ │ ├── LishijingpaiVO.java │ │ │ └── JingpaidingdanVO.java │ │ ├── model │ │ │ ├── ShangpinleixingModel.java │ │ │ ├── MessagesModel.java │ │ │ ├── NewsModel.java │ │ │ ├── PaimaishangpinModel.java │ │ │ ├── YonghuModel.java │ │ │ ├── LishijingpaiModel.java │ │ │ └── JingpaidingdanModel.java │ │ ├── view │ │ │ ├── NewsView.java │ │ │ ├── YonghuView.java │ │ │ ├── MessagesView.java │ │ │ ├── LishijingpaiView.java │ │ │ ├── JingpaidingdanView.java │ │ │ ├── PaimaishangpinView.java │ │ │ └── ShangpinleixingView.java │ │ ├── EIException.java │ │ ├── ConfigEntity.java │ │ ├── UserEntity.java │ │ ├── ShangpinleixingEntity.java │ │ ├── TokenEntity.java │ │ ├── MessagesEntity.java │ │ ├── NewsEntity.java │ │ ├── PaimaishangpinEntity.java │ │ ├── YonghuEntity.java │ │ ├── LishijingpaiEntity.java │ │ └── JingpaidingdanEntity.java │ │ ├── SpringbootSchemaApplication.java │ │ ├── controller │ │ ├── ConfigController.java │ │ ├── FileController.java │ │ ├── UserController.java │ │ ├── NewsController.java │ │ └── PaimaishangpinController.java │ │ └── interceptor │ │ └── AuthorizationInterceptor.java └── test │ └── java │ └── com │ └── SpringbootSchemaApplicationTests.java ├── .gitignore ├── README.md ├── pom.xml └── mvnw.cmd /image/图片1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No219Online-Auction-System/HEAD/image/图片1.png -------------------------------------------------------------------------------- /image/图片2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No219Online-Auction-System/HEAD/image/图片2.png -------------------------------------------------------------------------------- /image/图片3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No219Online-Auction-System/HEAD/image/图片3.png -------------------------------------------------------------------------------- /image/图片4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No219Online-Auction-System/HEAD/image/图片4.png -------------------------------------------------------------------------------- /image/图片5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No219Online-Auction-System/HEAD/image/图片5.png -------------------------------------------------------------------------------- /image/图片6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No219Online-Auction-System/HEAD/image/图片6.png -------------------------------------------------------------------------------- /image/图片7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No219Online-Auction-System/HEAD/image/图片7.png -------------------------------------------------------------------------------- /image/图片8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No219Online-Auction-System/HEAD/image/图片8.png -------------------------------------------------------------------------------- /image/图片9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No219Online-Auction-System/HEAD/image/图片9.png -------------------------------------------------------------------------------- /limage/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No219Online-Auction-System/HEAD/limage/1.png -------------------------------------------------------------------------------- /image/图片10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No219Online-Auction-System/HEAD/image/图片10.png -------------------------------------------------------------------------------- /image/图片11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No219Online-Auction-System/HEAD/image/图片11.png -------------------------------------------------------------------------------- /image/图片12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No219Online-Auction-System/HEAD/image/图片12.png -------------------------------------------------------------------------------- /image/图片13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No219Online-Auction-System/HEAD/image/图片13.png -------------------------------------------------------------------------------- /image/图片14.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No219Online-Auction-System/HEAD/image/图片14.png -------------------------------------------------------------------------------- /image/图片15.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No219Online-Auction-System/HEAD/image/图片15.png -------------------------------------------------------------------------------- /image/图片16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No219Online-Auction-System/HEAD/image/图片16.png -------------------------------------------------------------------------------- /src/main/resources/mapper/ConfigDao.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /src/main/java/com/dao/ConfigDao.java: -------------------------------------------------------------------------------- 1 | 2 | package com.dao; 3 | 4 | import com.baomidou.mybatisplus.mapper.BaseMapper; 5 | import com.entity.ConfigEntity; 6 | 7 | /** 8 | * 配置 9 | */ 10 | public interface ConfigDao extends BaseMapper { 11 | 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/com/annotation/IgnoreAuth.java: -------------------------------------------------------------------------------- 1 | package com.annotation; 2 | 3 | import java.lang.annotation.*; 4 | 5 | /** 6 | * 忽略Token验证 7 | */ 8 | @Target(ElementType.METHOD) 9 | @Retention(RetentionPolicy.RUNTIME) 10 | @Documented 11 | public @interface IgnoreAuth { 12 | 13 | } 14 | -------------------------------------------------------------------------------- /src/test/java/com/SpringbootSchemaApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class SpringbootSchemaApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/service/ConfigService.java: -------------------------------------------------------------------------------- 1 | 2 | package com.service; 3 | 4 | import java.util.Map; 5 | 6 | import com.baomidou.mybatisplus.service.IService; 7 | import com.entity.ConfigEntity; 8 | import com.utils.PageUtils; 9 | 10 | 11 | /** 12 | * 系统用户 13 | */ 14 | public interface ConfigService extends IService { 15 | PageUtils queryPage(Map params); 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/utils/MD5Util.java: -------------------------------------------------------------------------------- 1 | package com.utils; 2 | 3 | import cn.hutool.crypto.digest.DigestUtil; 4 | 5 | public class MD5Util { 6 | 7 | /** 8 | * @param text明文 9 | * @param key密钥 10 | * @return 密文 11 | */ 12 | // 带秘钥加密 13 | public static String md5(String text) { 14 | // 加密后的字符串 15 | String md5str = DigestUtil.md5Hex(text); 16 | return md5str; 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/annotation/LoginUser.java: -------------------------------------------------------------------------------- 1 | package com.annotation; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | 8 | /** 9 | * 登录用户信息 10 | */ 11 | @Target(ElementType.PARAMETER) 12 | @Retention(RetentionPolicy.RUNTIME) 13 | public @interface LoginUser { 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/annotation/APPLoginUser.java: -------------------------------------------------------------------------------- 1 | package com.annotation; 2 | 3 | import java.lang.annotation.ElementType; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | 8 | /** 9 | * 登录用户信息 10 | */ 11 | @Target(ElementType.PARAMETER) 12 | @Retention(RetentionPolicy.RUNTIME) 13 | public @interface APPLoginUser { 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/main/resources/mapper/UserDao.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 12 | 13 | -------------------------------------------------------------------------------- /src/main/resources/mapper/TokenDao.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 12 | 13 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/** 5 | !**/src/test/** 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | 30 | ### VS Code ### 31 | .vscode/ 32 | -------------------------------------------------------------------------------- /src/main/java/com/config/MybatisPlusConfig.java: -------------------------------------------------------------------------------- 1 | 2 | package com.config; 3 | 4 | import org.springframework.context.annotation.Bean; 5 | import org.springframework.context.annotation.Configuration; 6 | 7 | import com.baomidou.mybatisplus.mapper.MetaObjectHandler; 8 | import com.baomidou.mybatisplus.plugins.PaginationInterceptor; 9 | 10 | /** 11 | * mybatis-plus配置 12 | */ 13 | @Configuration 14 | public class MybatisPlusConfig { 15 | 16 | /** 17 | * 分页插件 18 | */ 19 | @Bean 20 | public PaginationInterceptor paginationInterceptor() { 21 | return new PaginationInterceptor(); 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/com/service/CommonService.java: -------------------------------------------------------------------------------- 1 | package com.service; 2 | 3 | import java.util.List; 4 | import java.util.Map; 5 | 6 | public interface CommonService { 7 | List getOption(Map params); 8 | 9 | Map getFollowByOption(Map params); 10 | 11 | void sh(Map params); 12 | 13 | int remindCount(Map params); 14 | 15 | Map selectCal(Map params); 16 | 17 | List> selectGroup(Map params); 18 | 19 | List> selectValue(Map params); 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/com/dao/UserDao.java: -------------------------------------------------------------------------------- 1 | 2 | package com.dao; 3 | 4 | import java.util.List; 5 | 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | import com.baomidou.mybatisplus.mapper.BaseMapper; 9 | import com.baomidou.mybatisplus.mapper.Wrapper; 10 | import com.baomidou.mybatisplus.plugins.pagination.Pagination; 11 | import com.entity.UserEntity; 12 | 13 | /** 14 | * 用户 15 | */ 16 | public interface UserDao extends BaseMapper { 17 | 18 | List selectListView(@Param("ew") Wrapper wrapper); 19 | 20 | List selectListView(Pagination page,@Param("ew") Wrapper wrapper); 21 | 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/utils/CommonUtil.java: -------------------------------------------------------------------------------- 1 | package com.utils; 2 | 3 | import java.util.Random; 4 | 5 | public class CommonUtil { 6 | /** 7 | * 获取随机字符串 8 | * 9 | * @param num 10 | * @return 11 | */ 12 | public static String getRandomString(Integer num) { 13 | String base = "abcdefghijklmnopqrstuvwxyz0123456789"; 14 | Random random = new Random(); 15 | StringBuffer sb = new StringBuffer(); 16 | for (int i = 0; i < num; i++) { 17 | int number = random.nextInt(base.length()); 18 | sb.append(base.charAt(number)); 19 | } 20 | return sb.toString(); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/dao/TokenDao.java: -------------------------------------------------------------------------------- 1 | 2 | package com.dao; 3 | 4 | import java.util.List; 5 | 6 | import org.apache.ibatis.annotations.Param; 7 | 8 | import com.baomidou.mybatisplus.mapper.BaseMapper; 9 | import com.baomidou.mybatisplus.mapper.Wrapper; 10 | import com.baomidou.mybatisplus.plugins.pagination.Pagination; 11 | import com.entity.TokenEntity; 12 | 13 | /** 14 | * token 15 | */ 16 | public interface TokenDao extends BaseMapper { 17 | 18 | List selectListView(@Param("ew") Wrapper wrapper); 19 | 20 | List selectListView(Pagination page,@Param("ew") Wrapper wrapper); 21 | 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/entity/vo/ShangpinleixingVO.java: -------------------------------------------------------------------------------- 1 | package com.entity.vo; 2 | 3 | import com.entity.ShangpinleixingEntity; 4 | 5 | import com.baomidou.mybatisplus.annotations.TableName; 6 | import java.util.Date; 7 | import org.springframework.format.annotation.DateTimeFormat; 8 | 9 | import com.fasterxml.jackson.annotation.JsonFormat; 10 | import java.io.Serializable; 11 | 12 | 13 | /** 14 | * 商品类型 15 | * 手机端接口返回实体辅助类 16 | * (主要作用去除一些不必要的字段) 17 | * @author 18 | * @email 19 | * @date 2021-02-03 16:07:05 20 | */ 21 | public class ShangpinleixingVO implements Serializable { 22 | private static final long serialVersionUID = 1L; 23 | 24 | 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/service/UserService.java: -------------------------------------------------------------------------------- 1 | 2 | package com.service; 3 | 4 | import java.util.List; 5 | import java.util.Map; 6 | 7 | import org.apache.ibatis.annotations.Param; 8 | 9 | import com.baomidou.mybatisplus.mapper.Wrapper; 10 | import com.baomidou.mybatisplus.service.IService; 11 | import com.entity.UserEntity; 12 | import com.utils.PageUtils; 13 | 14 | 15 | /** 16 | * 系统用户 17 | */ 18 | public interface UserService extends IService { 19 | PageUtils queryPage(Map params); 20 | 21 | List selectListView(Wrapper wrapper); 22 | 23 | PageUtils queryPage(Map params,Wrapper wrapper); 24 | 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/dao/CommonDao.java: -------------------------------------------------------------------------------- 1 | 2 | package com.dao; 3 | 4 | import java.util.List; 5 | import java.util.Map; 6 | 7 | /** 8 | * 通用接口 9 | */ 10 | public interface CommonDao{ 11 | List getOption(Map params); 12 | 13 | Map getFollowByOption(Map params); 14 | 15 | List getFollowByOption2(Map params); 16 | 17 | void sh(Map params); 18 | 19 | int remindCount(Map params); 20 | 21 | Map selectCal(Map params); 22 | 23 | List> selectGroup(Map params); 24 | 25 | List> selectValue(Map params); 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/entity/model/ShangpinleixingModel.java: -------------------------------------------------------------------------------- 1 | package com.entity.model; 2 | 3 | import com.entity.ShangpinleixingEntity; 4 | 5 | import com.baomidou.mybatisplus.annotations.TableName; 6 | import java.util.Date; 7 | import org.springframework.format.annotation.DateTimeFormat; 8 | 9 | import com.fasterxml.jackson.annotation.JsonFormat; 10 | import java.io.Serializable; 11 | 12 | 13 | /** 14 | * 商品类型 15 | * 接收传参的实体类 16 | *(实际开发中配合移动端接口开发手动去掉些没用的字段, 后端一般用entity就够用了) 17 | * 取自ModelAndView 的model名称 18 | * @author 19 | * @email 20 | * @date 2021-02-03 16:07:05 21 | */ 22 | public class ShangpinleixingModel implements Serializable { 23 | private static final long serialVersionUID = 1L; 24 | 25 | 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/utils/FileUtil.java: -------------------------------------------------------------------------------- 1 | package com.utils; 2 | 3 | import java.io.ByteArrayOutputStream; 4 | import java.io.File; 5 | import java.io.FileInputStream; 6 | import java.io.IOException; 7 | import java.io.InputStream; 8 | 9 | /** 10 | * 类说明 : 11 | */ 12 | 13 | public class FileUtil { 14 | public static byte[] FileToByte(File file) throws IOException { 15 | // 将数据转为流 16 | @SuppressWarnings("resource") 17 | InputStream content = new FileInputStream(file); 18 | ByteArrayOutputStream swapStream = new ByteArrayOutputStream(); 19 | byte[] buff = new byte[100]; 20 | int rc = 0; 21 | while ((rc = content.read(buff, 0, 100)) > 0) { 22 | swapStream.write(buff, 0, rc); 23 | } 24 | // 获得二进制数组 25 | return swapStream.toByteArray(); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/service/TokenService.java: -------------------------------------------------------------------------------- 1 | 2 | package com.service; 3 | 4 | import java.util.List; 5 | import java.util.Map; 6 | 7 | import com.baomidou.mybatisplus.mapper.Wrapper; 8 | import com.baomidou.mybatisplus.service.IService; 9 | import com.entity.TokenEntity; 10 | import com.utils.PageUtils; 11 | 12 | 13 | /** 14 | * token 15 | */ 16 | public interface TokenService extends IService { 17 | PageUtils queryPage(Map params); 18 | 19 | List selectListView(Wrapper wrapper); 20 | 21 | PageUtils queryPage(Map params,Wrapper wrapper); 22 | 23 | String generateToken(Long userid,String username,String tableName, String role); 24 | 25 | TokenEntity getTokenEntity(String token); 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/SpringbootSchemaApplication.java: -------------------------------------------------------------------------------- 1 | package com; 2 | 3 | import org.mybatis.spring.annotation.MapperScan; 4 | import org.springframework.boot.SpringApplication; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | import org.springframework.boot.builder.SpringApplicationBuilder; 7 | import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; 8 | 9 | @SpringBootApplication 10 | @MapperScan(basePackages = {"com.dao"}) 11 | public class SpringbootSchemaApplication extends SpringBootServletInitializer{ 12 | 13 | public static void main(String[] args) { 14 | SpringApplication.run(SpringbootSchemaApplication.class, args); 15 | } 16 | 17 | @Override 18 | protected SpringApplicationBuilder configure(SpringApplicationBuilder applicationBuilder) { 19 | return applicationBuilder.sources(SpringbootSchemaApplication.class); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/com/entity/view/NewsView.java: -------------------------------------------------------------------------------- 1 | package com.entity.view; 2 | 3 | import com.entity.NewsEntity; 4 | 5 | import com.baomidou.mybatisplus.annotations.TableName; 6 | import org.apache.commons.beanutils.BeanUtils; 7 | import java.lang.reflect.InvocationTargetException; 8 | 9 | import java.io.Serializable; 10 | 11 | 12 | /** 13 | * 竞拍公告 14 | * 后端返回视图实体辅助类 15 | * (通常后端关联的表或者自定义的字段需要返回使用) 16 | * @author 17 | * @email 18 | * @date 2021-02-03 16:07:05 19 | */ 20 | @TableName("news") 21 | public class NewsView extends NewsEntity implements Serializable { 22 | private static final long serialVersionUID = 1L; 23 | 24 | public NewsView(){ 25 | } 26 | 27 | public NewsView(NewsEntity newsEntity){ 28 | try { 29 | BeanUtils.copyProperties(this, newsEntity); 30 | } catch (IllegalAccessException | InvocationTargetException e) { 31 | // TODO Auto-generated catch block 32 | e.printStackTrace(); 33 | } 34 | 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/entity/view/YonghuView.java: -------------------------------------------------------------------------------- 1 | package com.entity.view; 2 | 3 | import com.entity.YonghuEntity; 4 | 5 | import com.baomidou.mybatisplus.annotations.TableName; 6 | import org.apache.commons.beanutils.BeanUtils; 7 | import java.lang.reflect.InvocationTargetException; 8 | 9 | import java.io.Serializable; 10 | 11 | 12 | /** 13 | * 用户 14 | * 后端返回视图实体辅助类 15 | * (通常后端关联的表或者自定义的字段需要返回使用) 16 | * @author 17 | * @email 18 | * @date 2021-02-03 16:07:05 19 | */ 20 | @TableName("yonghu") 21 | public class YonghuView extends YonghuEntity implements Serializable { 22 | private static final long serialVersionUID = 1L; 23 | 24 | public YonghuView(){ 25 | } 26 | 27 | public YonghuView(YonghuEntity yonghuEntity){ 28 | try { 29 | BeanUtils.copyProperties(this, yonghuEntity); 30 | } catch (IllegalAccessException | InvocationTargetException e) { 31 | // TODO Auto-generated catch block 32 | e.printStackTrace(); 33 | } 34 | 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/entity/view/MessagesView.java: -------------------------------------------------------------------------------- 1 | package com.entity.view; 2 | 3 | import com.entity.MessagesEntity; 4 | 5 | import com.baomidou.mybatisplus.annotations.TableName; 6 | import org.apache.commons.beanutils.BeanUtils; 7 | import java.lang.reflect.InvocationTargetException; 8 | 9 | import java.io.Serializable; 10 | 11 | 12 | /** 13 | * 留言板 14 | * 后端返回视图实体辅助类 15 | * (通常后端关联的表或者自定义的字段需要返回使用) 16 | * @author 17 | * @email 18 | * @date 2021-02-03 16:07:05 19 | */ 20 | @TableName("messages") 21 | public class MessagesView extends MessagesEntity implements Serializable { 22 | private static final long serialVersionUID = 1L; 23 | 24 | public MessagesView(){ 25 | } 26 | 27 | public MessagesView(MessagesEntity messagesEntity){ 28 | try { 29 | BeanUtils.copyProperties(this, messagesEntity); 30 | } catch (IllegalAccessException | InvocationTargetException e) { 31 | // TODO Auto-generated catch block 32 | e.printStackTrace(); 33 | } 34 | 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/dao/NewsDao.java: -------------------------------------------------------------------------------- 1 | package com.dao; 2 | 3 | import com.entity.NewsEntity; 4 | import com.baomidou.mybatisplus.mapper.BaseMapper; 5 | import java.util.List; 6 | import com.baomidou.mybatisplus.mapper.Wrapper; 7 | import com.baomidou.mybatisplus.plugins.pagination.Pagination; 8 | 9 | import org.apache.ibatis.annotations.Param; 10 | import com.entity.vo.NewsVO; 11 | import com.entity.view.NewsView; 12 | 13 | 14 | /** 15 | * 竞拍公告 16 | * 17 | * @author 18 | * @email 19 | * @date 2021-02-03 16:07:05 20 | */ 21 | public interface NewsDao extends BaseMapper { 22 | 23 | List selectListVO(@Param("ew") Wrapper wrapper); 24 | 25 | NewsVO selectVO(@Param("ew") Wrapper wrapper); 26 | 27 | List selectListView(@Param("ew") Wrapper wrapper); 28 | 29 | List selectListView(Pagination page,@Param("ew") Wrapper wrapper); 30 | 31 | NewsView selectView(@Param("ew") Wrapper wrapper); 32 | 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/com/utils/JQPageInfo.java: -------------------------------------------------------------------------------- 1 | package com.utils; 2 | 3 | public class JQPageInfo{ 4 | private Integer page; 5 | 6 | private Integer limit; 7 | 8 | private String sidx; 9 | 10 | private String order; 11 | 12 | private Integer offset; 13 | 14 | public Integer getPage() { 15 | return page; 16 | } 17 | 18 | public void setPage(Integer page) { 19 | this.page = page; 20 | } 21 | 22 | public Integer getLimit() { 23 | return limit; 24 | } 25 | 26 | public void setLimit(Integer limit) { 27 | this.limit = limit; 28 | } 29 | 30 | public String getSidx() { 31 | return sidx; 32 | } 33 | 34 | public void setSidx(String sidx) { 35 | this.sidx = sidx; 36 | } 37 | 38 | public String getOrder() { 39 | return order; 40 | } 41 | 42 | public void setOrder(String order) { 43 | this.order = order; 44 | } 45 | 46 | public Integer getOffset() { 47 | return offset; 48 | } 49 | 50 | public void setOffset(Integer offset) { 51 | this.offset = offset; 52 | } 53 | 54 | } 55 | -------------------------------------------------------------------------------- /src/main/java/com/entity/view/LishijingpaiView.java: -------------------------------------------------------------------------------- 1 | package com.entity.view; 2 | 3 | import com.entity.LishijingpaiEntity; 4 | 5 | import com.baomidou.mybatisplus.annotations.TableName; 6 | import org.apache.commons.beanutils.BeanUtils; 7 | import java.lang.reflect.InvocationTargetException; 8 | 9 | import java.io.Serializable; 10 | 11 | 12 | /** 13 | * 历史竞拍 14 | * 后端返回视图实体辅助类 15 | * (通常后端关联的表或者自定义的字段需要返回使用) 16 | * @author 17 | * @email 18 | * @date 2021-02-03 16:07:05 19 | */ 20 | @TableName("lishijingpai") 21 | public class LishijingpaiView extends LishijingpaiEntity implements Serializable { 22 | private static final long serialVersionUID = 1L; 23 | 24 | public LishijingpaiView(){ 25 | } 26 | 27 | public LishijingpaiView(LishijingpaiEntity lishijingpaiEntity){ 28 | try { 29 | BeanUtils.copyProperties(this, lishijingpaiEntity); 30 | } catch (IllegalAccessException | InvocationTargetException e) { 31 | // TODO Auto-generated catch block 32 | e.printStackTrace(); 33 | } 34 | 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/dao/YonghuDao.java: -------------------------------------------------------------------------------- 1 | package com.dao; 2 | 3 | import com.entity.YonghuEntity; 4 | import com.baomidou.mybatisplus.mapper.BaseMapper; 5 | import java.util.List; 6 | import com.baomidou.mybatisplus.mapper.Wrapper; 7 | import com.baomidou.mybatisplus.plugins.pagination.Pagination; 8 | 9 | import org.apache.ibatis.annotations.Param; 10 | import com.entity.vo.YonghuVO; 11 | import com.entity.view.YonghuView; 12 | 13 | 14 | /** 15 | * 用户 16 | * 17 | * @author 18 | * @email 19 | * @date 2021-02-03 16:07:05 20 | */ 21 | public interface YonghuDao extends BaseMapper { 22 | 23 | List selectListVO(@Param("ew") Wrapper wrapper); 24 | 25 | YonghuVO selectVO(@Param("ew") Wrapper wrapper); 26 | 27 | List selectListView(@Param("ew") Wrapper wrapper); 28 | 29 | List selectListView(Pagination page,@Param("ew") Wrapper wrapper); 30 | 31 | YonghuView selectView(@Param("ew") Wrapper wrapper); 32 | 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/com/service/impl/ConfigServiceImpl.java: -------------------------------------------------------------------------------- 1 | 2 | package com.service.impl; 3 | 4 | 5 | import java.util.Map; 6 | 7 | import org.springframework.stereotype.Service; 8 | 9 | import com.baomidou.mybatisplus.mapper.EntityWrapper; 10 | import com.baomidou.mybatisplus.plugins.Page; 11 | import com.baomidou.mybatisplus.service.impl.ServiceImpl; 12 | import com.dao.ConfigDao; 13 | import com.entity.ConfigEntity; 14 | import com.entity.UserEntity; 15 | import com.service.ConfigService; 16 | import com.utils.PageUtils; 17 | import com.utils.Query; 18 | 19 | 20 | /** 21 | * 系统用户 22 | */ 23 | @Service("configService") 24 | public class ConfigServiceImpl extends ServiceImpl implements ConfigService { 25 | @Override 26 | public PageUtils queryPage(Map params) { 27 | Page page = this.selectPage( 28 | new Query(params).getPage(), 29 | new EntityWrapper() 30 | ); 31 | return new PageUtils(page); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/com/entity/EIException.java: -------------------------------------------------------------------------------- 1 | 2 | package com.entity; 3 | 4 | /** 5 | * 自定义异常 6 | */ 7 | public class EIException extends RuntimeException { 8 | private static final long serialVersionUID = 1L; 9 | 10 | private String msg; 11 | private int code = 500; 12 | 13 | public EIException(String msg) { 14 | super(msg); 15 | this.msg = msg; 16 | } 17 | 18 | public EIException(String msg, Throwable e) { 19 | super(msg, e); 20 | this.msg = msg; 21 | } 22 | 23 | public EIException(String msg, int code) { 24 | super(msg); 25 | this.msg = msg; 26 | this.code = code; 27 | } 28 | 29 | public EIException(String msg, int code, Throwable e) { 30 | super(msg, e); 31 | this.msg = msg; 32 | this.code = code; 33 | } 34 | 35 | public String getMsg() { 36 | return msg; 37 | } 38 | 39 | public void setMsg(String msg) { 40 | this.msg = msg; 41 | } 42 | 43 | public int getCode() { 44 | return code; 45 | } 46 | 47 | public void setCode(int code) { 48 | this.code = code; 49 | } 50 | 51 | 52 | } 53 | -------------------------------------------------------------------------------- /src/main/java/com/entity/view/JingpaidingdanView.java: -------------------------------------------------------------------------------- 1 | package com.entity.view; 2 | 3 | import com.entity.JingpaidingdanEntity; 4 | 5 | import com.baomidou.mybatisplus.annotations.TableName; 6 | import org.apache.commons.beanutils.BeanUtils; 7 | import java.lang.reflect.InvocationTargetException; 8 | 9 | import java.io.Serializable; 10 | 11 | 12 | /** 13 | * 竞拍订单 14 | * 后端返回视图实体辅助类 15 | * (通常后端关联的表或者自定义的字段需要返回使用) 16 | * @author 17 | * @email 18 | * @date 2021-02-03 16:07:05 19 | */ 20 | @TableName("jingpaidingdan") 21 | public class JingpaidingdanView extends JingpaidingdanEntity implements Serializable { 22 | private static final long serialVersionUID = 1L; 23 | 24 | public JingpaidingdanView(){ 25 | } 26 | 27 | public JingpaidingdanView(JingpaidingdanEntity jingpaidingdanEntity){ 28 | try { 29 | BeanUtils.copyProperties(this, jingpaidingdanEntity); 30 | } catch (IllegalAccessException | InvocationTargetException e) { 31 | // TODO Auto-generated catch block 32 | e.printStackTrace(); 33 | } 34 | 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/entity/view/PaimaishangpinView.java: -------------------------------------------------------------------------------- 1 | package com.entity.view; 2 | 3 | import com.entity.PaimaishangpinEntity; 4 | 5 | import com.baomidou.mybatisplus.annotations.TableName; 6 | import org.apache.commons.beanutils.BeanUtils; 7 | import java.lang.reflect.InvocationTargetException; 8 | 9 | import java.io.Serializable; 10 | 11 | 12 | /** 13 | * 拍卖商品 14 | * 后端返回视图实体辅助类 15 | * (通常后端关联的表或者自定义的字段需要返回使用) 16 | * @author 17 | * @email 18 | * @date 2021-02-03 16:07:05 19 | */ 20 | @TableName("paimaishangpin") 21 | public class PaimaishangpinView extends PaimaishangpinEntity implements Serializable { 22 | private static final long serialVersionUID = 1L; 23 | 24 | public PaimaishangpinView(){ 25 | } 26 | 27 | public PaimaishangpinView(PaimaishangpinEntity paimaishangpinEntity){ 28 | try { 29 | BeanUtils.copyProperties(this, paimaishangpinEntity); 30 | } catch (IllegalAccessException | InvocationTargetException e) { 31 | // TODO Auto-generated catch block 32 | e.printStackTrace(); 33 | } 34 | 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/utils/R.java: -------------------------------------------------------------------------------- 1 | package com.utils; 2 | 3 | import java.util.HashMap; 4 | import java.util.Map; 5 | 6 | /** 7 | * 返回数据 8 | */ 9 | public class R extends HashMap { 10 | private static final long serialVersionUID = 1L; 11 | 12 | public R() { 13 | put("code", 0); 14 | } 15 | 16 | public static R error() { 17 | return error(500, "未知异常,请联系管理员"); 18 | } 19 | 20 | public static R error(String msg) { 21 | return error(500, msg); 22 | } 23 | 24 | public static R error(int code, String msg) { 25 | R r = new R(); 26 | r.put("code", code); 27 | r.put("msg", msg); 28 | return r; 29 | } 30 | 31 | public static R ok(String msg) { 32 | R r = new R(); 33 | r.put("msg", msg); 34 | return r; 35 | } 36 | 37 | public static R ok(Map map) { 38 | R r = new R(); 39 | r.putAll(map); 40 | return r; 41 | } 42 | 43 | public static R ok() { 44 | return new R(); 45 | } 46 | 47 | public R put(String key, Object value) { 48 | super.put(key, value); 49 | return this; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/com/entity/view/ShangpinleixingView.java: -------------------------------------------------------------------------------- 1 | package com.entity.view; 2 | 3 | import com.entity.ShangpinleixingEntity; 4 | 5 | import com.baomidou.mybatisplus.annotations.TableName; 6 | import org.apache.commons.beanutils.BeanUtils; 7 | import java.lang.reflect.InvocationTargetException; 8 | 9 | import java.io.Serializable; 10 | 11 | 12 | /** 13 | * 商品类型 14 | * 后端返回视图实体辅助类 15 | * (通常后端关联的表或者自定义的字段需要返回使用) 16 | * @author 17 | * @email 18 | * @date 2021-02-03 16:07:05 19 | */ 20 | @TableName("shangpinleixing") 21 | public class ShangpinleixingView extends ShangpinleixingEntity implements Serializable { 22 | private static final long serialVersionUID = 1L; 23 | 24 | public ShangpinleixingView(){ 25 | } 26 | 27 | public ShangpinleixingView(ShangpinleixingEntity shangpinleixingEntity){ 28 | try { 29 | BeanUtils.copyProperties(this, shangpinleixingEntity); 30 | } catch (IllegalAccessException | InvocationTargetException e) { 31 | // TODO Auto-generated catch block 32 | e.printStackTrace(); 33 | } 34 | 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/entity/ConfigEntity.java: -------------------------------------------------------------------------------- 1 | package com.entity; 2 | 3 | import java.io.Serializable; 4 | 5 | import com.baomidou.mybatisplus.annotations.TableId; 6 | import com.baomidou.mybatisplus.annotations.TableName; 7 | import com.baomidou.mybatisplus.enums.IdType; 8 | 9 | /** 10 | * 类说明 : 11 | */ 12 | @TableName("config") 13 | public class ConfigEntity implements Serializable{ 14 | private static final long serialVersionUID = 1L; 15 | 16 | @TableId(type = IdType.AUTO) 17 | private Long id; 18 | 19 | /** 20 | * key 21 | */ 22 | private String name; 23 | 24 | /** 25 | * value 26 | */ 27 | private String value; 28 | 29 | public Long getId() { 30 | return id; 31 | } 32 | 33 | public void setId(Long id) { 34 | this.id = id; 35 | } 36 | 37 | public String getName() { 38 | return name; 39 | } 40 | 41 | public void setName(String name) { 42 | this.name = name; 43 | } 44 | 45 | public String getValue() { 46 | return value; 47 | } 48 | 49 | public void setValue(String value) { 50 | this.value = value; 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /src/main/java/com/dao/MessagesDao.java: -------------------------------------------------------------------------------- 1 | package com.dao; 2 | 3 | import com.entity.MessagesEntity; 4 | import com.baomidou.mybatisplus.mapper.BaseMapper; 5 | import java.util.List; 6 | import com.baomidou.mybatisplus.mapper.Wrapper; 7 | import com.baomidou.mybatisplus.plugins.pagination.Pagination; 8 | 9 | import org.apache.ibatis.annotations.Param; 10 | import com.entity.vo.MessagesVO; 11 | import com.entity.view.MessagesView; 12 | 13 | 14 | /** 15 | * 留言板 16 | * 17 | * @author 18 | * @email 19 | * @date 2021-02-03 16:07:05 20 | */ 21 | public interface MessagesDao extends BaseMapper { 22 | 23 | List selectListVO(@Param("ew") Wrapper wrapper); 24 | 25 | MessagesVO selectVO(@Param("ew") Wrapper wrapper); 26 | 27 | List selectListView(@Param("ew") Wrapper wrapper); 28 | 29 | List selectListView(Pagination page,@Param("ew") Wrapper wrapper); 30 | 31 | MessagesView selectView(@Param("ew") Wrapper wrapper); 32 | 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/com/service/NewsService.java: -------------------------------------------------------------------------------- 1 | package com.service; 2 | 3 | import com.baomidou.mybatisplus.mapper.Wrapper; 4 | import com.baomidou.mybatisplus.service.IService; 5 | import com.utils.PageUtils; 6 | import com.entity.NewsEntity; 7 | import java.util.List; 8 | import java.util.Map; 9 | import com.entity.vo.NewsVO; 10 | import org.apache.ibatis.annotations.Param; 11 | import com.entity.view.NewsView; 12 | 13 | 14 | /** 15 | * 竞拍公告 16 | * 17 | * @author 18 | * @email 19 | * @date 2021-02-03 16:07:05 20 | */ 21 | public interface NewsService extends IService { 22 | 23 | PageUtils queryPage(Map params); 24 | 25 | List selectListVO(Wrapper wrapper); 26 | 27 | NewsVO selectVO(@Param("ew") Wrapper wrapper); 28 | 29 | List selectListView(Wrapper wrapper); 30 | 31 | NewsView selectView(@Param("ew") Wrapper wrapper); 32 | 33 | PageUtils queryPage(Map params,Wrapper wrapper); 34 | 35 | } 36 | 37 | -------------------------------------------------------------------------------- /src/main/java/com/service/YonghuService.java: -------------------------------------------------------------------------------- 1 | package com.service; 2 | 3 | import com.baomidou.mybatisplus.mapper.Wrapper; 4 | import com.baomidou.mybatisplus.service.IService; 5 | import com.utils.PageUtils; 6 | import com.entity.YonghuEntity; 7 | import java.util.List; 8 | import java.util.Map; 9 | import com.entity.vo.YonghuVO; 10 | import org.apache.ibatis.annotations.Param; 11 | import com.entity.view.YonghuView; 12 | 13 | 14 | /** 15 | * 用户 16 | * 17 | * @author 18 | * @email 19 | * @date 2021-02-03 16:07:05 20 | */ 21 | public interface YonghuService extends IService { 22 | 23 | PageUtils queryPage(Map params); 24 | 25 | List selectListVO(Wrapper wrapper); 26 | 27 | YonghuVO selectVO(@Param("ew") Wrapper wrapper); 28 | 29 | List selectListView(Wrapper wrapper); 30 | 31 | YonghuView selectView(@Param("ew") Wrapper wrapper); 32 | 33 | PageUtils queryPage(Map params,Wrapper wrapper); 34 | 35 | } 36 | 37 | -------------------------------------------------------------------------------- /src/main/java/com/service/MessagesService.java: -------------------------------------------------------------------------------- 1 | package com.service; 2 | 3 | import com.baomidou.mybatisplus.mapper.Wrapper; 4 | import com.baomidou.mybatisplus.service.IService; 5 | import com.utils.PageUtils; 6 | import com.entity.MessagesEntity; 7 | import java.util.List; 8 | import java.util.Map; 9 | import com.entity.vo.MessagesVO; 10 | import org.apache.ibatis.annotations.Param; 11 | import com.entity.view.MessagesView; 12 | 13 | 14 | /** 15 | * 留言板 16 | * 17 | * @author 18 | * @email 19 | * @date 2021-02-03 16:07:05 20 | */ 21 | public interface MessagesService extends IService { 22 | 23 | PageUtils queryPage(Map params); 24 | 25 | List selectListVO(Wrapper wrapper); 26 | 27 | MessagesVO selectVO(@Param("ew") Wrapper wrapper); 28 | 29 | List selectListView(Wrapper wrapper); 30 | 31 | MessagesView selectView(@Param("ew") Wrapper wrapper); 32 | 33 | PageUtils queryPage(Map params,Wrapper wrapper); 34 | 35 | } 36 | 37 | -------------------------------------------------------------------------------- /src/main/java/com/dao/LishijingpaiDao.java: -------------------------------------------------------------------------------- 1 | package com.dao; 2 | 3 | import com.entity.LishijingpaiEntity; 4 | import com.baomidou.mybatisplus.mapper.BaseMapper; 5 | import java.util.List; 6 | import com.baomidou.mybatisplus.mapper.Wrapper; 7 | import com.baomidou.mybatisplus.plugins.pagination.Pagination; 8 | 9 | import org.apache.ibatis.annotations.Param; 10 | import com.entity.vo.LishijingpaiVO; 11 | import com.entity.view.LishijingpaiView; 12 | 13 | 14 | /** 15 | * 历史竞拍 16 | * 17 | * @author 18 | * @email 19 | * @date 2021-02-03 16:07:05 20 | */ 21 | public interface LishijingpaiDao extends BaseMapper { 22 | 23 | List selectListVO(@Param("ew") Wrapper wrapper); 24 | 25 | LishijingpaiVO selectVO(@Param("ew") Wrapper wrapper); 26 | 27 | List selectListView(@Param("ew") Wrapper wrapper); 28 | 29 | List selectListView(Pagination page,@Param("ew") Wrapper wrapper); 30 | 31 | LishijingpaiView selectView(@Param("ew") Wrapper wrapper); 32 | 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/com/utils/SQLFilter.java: -------------------------------------------------------------------------------- 1 | 2 | package com.utils; 3 | 4 | import org.apache.commons.lang3.StringUtils; 5 | 6 | import com.entity.EIException; 7 | 8 | /** 9 | * SQL过滤 10 | */ 11 | public class SQLFilter { 12 | 13 | /** 14 | * SQL注入过滤 15 | * @param str 待验证的字符串 16 | */ 17 | public static String sqlInject(String str){ 18 | if(StringUtils.isBlank(str)){ 19 | return null; 20 | } 21 | //去掉'|"|;|\字符 22 | str = StringUtils.replace(str, "'", ""); 23 | str = StringUtils.replace(str, "\"", ""); 24 | str = StringUtils.replace(str, ";", ""); 25 | str = StringUtils.replace(str, "\\", ""); 26 | 27 | //转换成小写 28 | str = str.toLowerCase(); 29 | 30 | //非法字符 31 | String[] keywords = {"master", "truncate", "insert", "select", "delete", "update", "declare", "alter", "drop"}; 32 | 33 | //判断是否包含非法字符 34 | for(String keyword : keywords){ 35 | if(str.indexOf(keyword) != -1){ 36 | throw new EIException("包含非法字符"); 37 | } 38 | } 39 | 40 | return str; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/com/dao/JingpaidingdanDao.java: -------------------------------------------------------------------------------- 1 | package com.dao; 2 | 3 | import com.entity.JingpaidingdanEntity; 4 | import com.baomidou.mybatisplus.mapper.BaseMapper; 5 | import java.util.List; 6 | import com.baomidou.mybatisplus.mapper.Wrapper; 7 | import com.baomidou.mybatisplus.plugins.pagination.Pagination; 8 | 9 | import org.apache.ibatis.annotations.Param; 10 | import com.entity.vo.JingpaidingdanVO; 11 | import com.entity.view.JingpaidingdanView; 12 | 13 | 14 | /** 15 | * 竞拍订单 16 | * 17 | * @author 18 | * @email 19 | * @date 2021-02-03 16:07:05 20 | */ 21 | public interface JingpaidingdanDao extends BaseMapper { 22 | 23 | List selectListVO(@Param("ew") Wrapper wrapper); 24 | 25 | JingpaidingdanVO selectVO(@Param("ew") Wrapper wrapper); 26 | 27 | List selectListView(@Param("ew") Wrapper wrapper); 28 | 29 | List selectListView(Pagination page,@Param("ew") Wrapper wrapper); 30 | 31 | JingpaidingdanView selectView(@Param("ew") Wrapper wrapper); 32 | 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/com/dao/PaimaishangpinDao.java: -------------------------------------------------------------------------------- 1 | package com.dao; 2 | 3 | import com.entity.PaimaishangpinEntity; 4 | import com.baomidou.mybatisplus.mapper.BaseMapper; 5 | import java.util.List; 6 | import com.baomidou.mybatisplus.mapper.Wrapper; 7 | import com.baomidou.mybatisplus.plugins.pagination.Pagination; 8 | 9 | import org.apache.ibatis.annotations.Param; 10 | import com.entity.vo.PaimaishangpinVO; 11 | import com.entity.view.PaimaishangpinView; 12 | 13 | 14 | /** 15 | * 拍卖商品 16 | * 17 | * @author 18 | * @email 19 | * @date 2021-02-03 16:07:05 20 | */ 21 | public interface PaimaishangpinDao extends BaseMapper { 22 | 23 | List selectListVO(@Param("ew") Wrapper wrapper); 24 | 25 | PaimaishangpinVO selectVO(@Param("ew") Wrapper wrapper); 26 | 27 | List selectListView(@Param("ew") Wrapper wrapper); 28 | 29 | List selectListView(Pagination page,@Param("ew") Wrapper wrapper); 30 | 31 | PaimaishangpinView selectView(@Param("ew") Wrapper wrapper); 32 | 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/com/utils/HttpClientUtils.java: -------------------------------------------------------------------------------- 1 | package com.utils; 2 | 3 | import java.io.BufferedReader; 4 | import java.io.InputStreamReader; 5 | import java.net.HttpURLConnection; 6 | import java.net.URL; 7 | 8 | 9 | /** 10 | * HttpClient工具类 11 | */ 12 | public class HttpClientUtils { 13 | 14 | /** 15 | * @param uri 16 | * @return String 17 | * @description get请求方式 18 | * @author: long.he01 19 | */ 20 | public static String doGet(String uri) { 21 | 22 | StringBuilder result = new StringBuilder(); 23 | try { 24 | String res = ""; 25 | URL url = new URL(uri); 26 | HttpURLConnection conn = (HttpURLConnection) url.openConnection(); 27 | BufferedReader in = new BufferedReader(new InputStreamReader(conn.getInputStream(), "UTF-8")); 28 | String line; 29 | while ((line = in.readLine()) != null) { 30 | res += line+"\n"; 31 | } 32 | in.close(); 33 | return res; 34 | }catch (Exception e) { 35 | e.printStackTrace(); 36 | return null; 37 | } 38 | 39 | } 40 | 41 | } 42 | 43 | -------------------------------------------------------------------------------- /src/main/java/com/dao/ShangpinleixingDao.java: -------------------------------------------------------------------------------- 1 | package com.dao; 2 | 3 | import com.entity.ShangpinleixingEntity; 4 | import com.baomidou.mybatisplus.mapper.BaseMapper; 5 | import java.util.List; 6 | import com.baomidou.mybatisplus.mapper.Wrapper; 7 | import com.baomidou.mybatisplus.plugins.pagination.Pagination; 8 | 9 | import org.apache.ibatis.annotations.Param; 10 | import com.entity.vo.ShangpinleixingVO; 11 | import com.entity.view.ShangpinleixingView; 12 | 13 | 14 | /** 15 | * 商品类型 16 | * 17 | * @author 18 | * @email 19 | * @date 2021-02-03 16:07:05 20 | */ 21 | public interface ShangpinleixingDao extends BaseMapper { 22 | 23 | List selectListVO(@Param("ew") Wrapper wrapper); 24 | 25 | ShangpinleixingVO selectVO(@Param("ew") Wrapper wrapper); 26 | 27 | List selectListView(@Param("ew") Wrapper wrapper); 28 | 29 | List selectListView(Pagination page,@Param("ew") Wrapper wrapper); 30 | 31 | ShangpinleixingView selectView(@Param("ew") Wrapper wrapper); 32 | 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/com/service/LishijingpaiService.java: -------------------------------------------------------------------------------- 1 | package com.service; 2 | 3 | import com.baomidou.mybatisplus.mapper.Wrapper; 4 | import com.baomidou.mybatisplus.service.IService; 5 | import com.utils.PageUtils; 6 | import com.entity.LishijingpaiEntity; 7 | import java.util.List; 8 | import java.util.Map; 9 | import com.entity.vo.LishijingpaiVO; 10 | import org.apache.ibatis.annotations.Param; 11 | import com.entity.view.LishijingpaiView; 12 | 13 | 14 | /** 15 | * 历史竞拍 16 | * 17 | * @author 18 | * @email 19 | * @date 2021-02-03 16:07:05 20 | */ 21 | public interface LishijingpaiService extends IService { 22 | 23 | PageUtils queryPage(Map params); 24 | 25 | List selectListVO(Wrapper wrapper); 26 | 27 | LishijingpaiVO selectVO(@Param("ew") Wrapper wrapper); 28 | 29 | List selectListView(Wrapper wrapper); 30 | 31 | LishijingpaiView selectView(@Param("ew") Wrapper wrapper); 32 | 33 | PageUtils queryPage(Map params,Wrapper wrapper); 34 | 35 | } 36 | 37 | -------------------------------------------------------------------------------- /src/main/java/com/utils/ValidatorUtils.java: -------------------------------------------------------------------------------- 1 | 2 | package com.utils; 3 | 4 | 5 | import java.util.Set; 6 | 7 | import javax.validation.ConstraintViolation; 8 | import javax.validation.Validation; 9 | import javax.validation.Validator; 10 | 11 | import com.entity.EIException; 12 | 13 | /** 14 | * hibernate-validator校验工具类 15 | */ 16 | public class ValidatorUtils { 17 | private static Validator validator; 18 | 19 | static { 20 | validator = Validation.buildDefaultValidatorFactory().getValidator(); 21 | } 22 | 23 | /** 24 | * 校验对象 25 | * @param object 待校验对象 26 | * @param groups 待校验的组 27 | * @throws EIException 校验不通过,则报EIException异常 28 | */ 29 | public static void validateEntity(Object object, Class... groups) 30 | throws EIException { 31 | Set> constraintViolations = validator.validate(object, groups); 32 | if (!constraintViolations.isEmpty()) { 33 | ConstraintViolation constraint = (ConstraintViolation)constraintViolations.iterator().next(); 34 | throw new EIException(constraint.getMessage()); 35 | } 36 | } 37 | 38 | 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/com/service/JingpaidingdanService.java: -------------------------------------------------------------------------------- 1 | package com.service; 2 | 3 | import com.baomidou.mybatisplus.mapper.Wrapper; 4 | import com.baomidou.mybatisplus.service.IService; 5 | import com.utils.PageUtils; 6 | import com.entity.JingpaidingdanEntity; 7 | import java.util.List; 8 | import java.util.Map; 9 | import com.entity.vo.JingpaidingdanVO; 10 | import org.apache.ibatis.annotations.Param; 11 | import com.entity.view.JingpaidingdanView; 12 | 13 | 14 | /** 15 | * 竞拍订单 16 | * 17 | * @author 18 | * @email 19 | * @date 2021-02-03 16:07:05 20 | */ 21 | public interface JingpaidingdanService extends IService { 22 | 23 | PageUtils queryPage(Map params); 24 | 25 | List selectListVO(Wrapper wrapper); 26 | 27 | JingpaidingdanVO selectVO(@Param("ew") Wrapper wrapper); 28 | 29 | List selectListView(Wrapper wrapper); 30 | 31 | JingpaidingdanView selectView(@Param("ew") Wrapper wrapper); 32 | 33 | PageUtils queryPage(Map params,Wrapper wrapper); 34 | 35 | } 36 | 37 | -------------------------------------------------------------------------------- /src/main/java/com/service/PaimaishangpinService.java: -------------------------------------------------------------------------------- 1 | package com.service; 2 | 3 | import com.baomidou.mybatisplus.mapper.Wrapper; 4 | import com.baomidou.mybatisplus.service.IService; 5 | import com.utils.PageUtils; 6 | import com.entity.PaimaishangpinEntity; 7 | import java.util.List; 8 | import java.util.Map; 9 | import com.entity.vo.PaimaishangpinVO; 10 | import org.apache.ibatis.annotations.Param; 11 | import com.entity.view.PaimaishangpinView; 12 | 13 | 14 | /** 15 | * 拍卖商品 16 | * 17 | * @author 18 | * @email 19 | * @date 2021-02-03 16:07:05 20 | */ 21 | public interface PaimaishangpinService extends IService { 22 | 23 | PageUtils queryPage(Map params); 24 | 25 | List selectListVO(Wrapper wrapper); 26 | 27 | PaimaishangpinVO selectVO(@Param("ew") Wrapper wrapper); 28 | 29 | List selectListView(Wrapper wrapper); 30 | 31 | PaimaishangpinView selectView(@Param("ew") Wrapper wrapper); 32 | 33 | PageUtils queryPage(Map params,Wrapper wrapper); 34 | 35 | } 36 | 37 | -------------------------------------------------------------------------------- /src/main/java/com/service/ShangpinleixingService.java: -------------------------------------------------------------------------------- 1 | package com.service; 2 | 3 | import com.baomidou.mybatisplus.mapper.Wrapper; 4 | import com.baomidou.mybatisplus.service.IService; 5 | import com.utils.PageUtils; 6 | import com.entity.ShangpinleixingEntity; 7 | import java.util.List; 8 | import java.util.Map; 9 | import com.entity.vo.ShangpinleixingVO; 10 | import org.apache.ibatis.annotations.Param; 11 | import com.entity.view.ShangpinleixingView; 12 | 13 | 14 | /** 15 | * 商品类型 16 | * 17 | * @author 18 | * @email 19 | * @date 2021-02-03 16:07:05 20 | */ 21 | public interface ShangpinleixingService extends IService { 22 | 23 | PageUtils queryPage(Map params); 24 | 25 | List selectListVO(Wrapper wrapper); 26 | 27 | ShangpinleixingVO selectVO(@Param("ew") Wrapper wrapper); 28 | 29 | List selectListView(Wrapper wrapper); 30 | 31 | ShangpinleixingView selectView(@Param("ew") Wrapper wrapper); 32 | 33 | PageUtils queryPage(Map params,Wrapper wrapper); 34 | 35 | } 36 | 37 | -------------------------------------------------------------------------------- /src/main/resources/mapper/NewsDao.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 19 | 20 | 25 | 26 | 32 | 33 | 37 | 38 | -------------------------------------------------------------------------------- /src/main/java/com/utils/SpringContextUtils.java: -------------------------------------------------------------------------------- 1 | 2 | package com.utils; 3 | 4 | import org.springframework.beans.BeansException; 5 | import org.springframework.context.ApplicationContext; 6 | import org.springframework.context.ApplicationContextAware; 7 | import org.springframework.stereotype.Component; 8 | 9 | 10 | /** 11 | * Spring Context 工具类 12 | */ 13 | @Component 14 | public class SpringContextUtils implements ApplicationContextAware { 15 | public static ApplicationContext applicationContext; 16 | 17 | @Override 18 | public void setApplicationContext(ApplicationContext applicationContext) 19 | throws BeansException { 20 | SpringContextUtils.applicationContext = applicationContext; 21 | } 22 | 23 | public static Object getBean(String name) { 24 | return applicationContext.getBean(name); 25 | } 26 | 27 | public static T getBean(String name, Class requiredType) { 28 | return applicationContext.getBean(name, requiredType); 29 | } 30 | 31 | public static boolean containsBean(String name) { 32 | return applicationContext.containsBean(name); 33 | } 34 | 35 | public static boolean isSingleton(String name) { 36 | return applicationContext.isSingleton(name); 37 | } 38 | 39 | public static Class getType(String name) { 40 | return applicationContext.getType(name); 41 | } 42 | 43 | } -------------------------------------------------------------------------------- /src/main/resources/mapper/ShangpinleixingDao.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 16 | 17 | 22 | 23 | 29 | 30 | 34 | 35 | -------------------------------------------------------------------------------- /src/main/resources/mapper/MessagesDao.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 19 | 20 | 25 | 26 | 32 | 33 | 37 | 38 | -------------------------------------------------------------------------------- /src/main/java/com/service/impl/CommonServiceImpl.java: -------------------------------------------------------------------------------- 1 | 2 | package com.service.impl; 3 | 4 | 5 | import java.util.List; 6 | import java.util.Map; 7 | 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.stereotype.Service; 10 | 11 | import com.dao.CommonDao; 12 | import com.service.CommonService; 13 | 14 | 15 | /** 16 | * 系统用户 17 | */ 18 | @Service("commonService") 19 | public class CommonServiceImpl implements CommonService { 20 | 21 | @Autowired 22 | private CommonDao commonDao; 23 | 24 | @Override 25 | public List getOption(Map params) { 26 | return commonDao.getOption(params); 27 | } 28 | 29 | @Override 30 | public Map getFollowByOption(Map params) { 31 | return commonDao.getFollowByOption(params); 32 | } 33 | 34 | @Override 35 | public void sh(Map params) { 36 | commonDao.sh(params); 37 | } 38 | 39 | @Override 40 | public int remindCount(Map params) { 41 | return commonDao.remindCount(params); 42 | } 43 | 44 | @Override 45 | public Map selectCal(Map params) { 46 | return commonDao.selectCal(params); 47 | } 48 | 49 | @Override 50 | public List> selectGroup(Map params) { 51 | return commonDao.selectGroup(params); 52 | } 53 | 54 | @Override 55 | public List> selectValue(Map params) { 56 | return commonDao.selectValue(params); 57 | } 58 | 59 | } 60 | -------------------------------------------------------------------------------- /src/main/java/com/entity/UserEntity.java: -------------------------------------------------------------------------------- 1 | package com.entity; 2 | 3 | import java.io.Serializable; 4 | import java.util.Date; 5 | 6 | import com.baomidou.mybatisplus.annotations.TableId; 7 | import com.baomidou.mybatisplus.annotations.TableName; 8 | import com.baomidou.mybatisplus.enums.IdType; 9 | 10 | /** 11 | * 用户 12 | */ 13 | @TableName("users") 14 | public class UserEntity implements Serializable { 15 | private static final long serialVersionUID = 1L; 16 | 17 | @TableId(type = IdType.AUTO) 18 | private Long id; 19 | 20 | /** 21 | * 用户账号 22 | */ 23 | private String username; 24 | 25 | /** 26 | * 密码 27 | */ 28 | private String password; 29 | 30 | /** 31 | * 用户类型 32 | */ 33 | private String role; 34 | 35 | private Date addtime; 36 | 37 | public String getUsername() { 38 | return username; 39 | } 40 | 41 | public void setUsername(String username) { 42 | this.username = username; 43 | } 44 | 45 | public String getPassword() { 46 | return password; 47 | } 48 | 49 | public void setPassword(String password) { 50 | this.password = password; 51 | } 52 | 53 | public String getRole() { 54 | return role; 55 | } 56 | 57 | public void setRole(String role) { 58 | this.role = role; 59 | } 60 | 61 | public Date getAddtime() { 62 | return addtime; 63 | } 64 | 65 | public void setAddtime(Date addtime) { 66 | this.addtime = addtime; 67 | } 68 | 69 | public Long getId() { 70 | return id; 71 | } 72 | 73 | public void setId(Long id) { 74 | this.id = id; 75 | } 76 | 77 | } 78 | -------------------------------------------------------------------------------- /src/main/java/com/service/impl/UserServiceImpl.java: -------------------------------------------------------------------------------- 1 | 2 | package com.service.impl; 3 | 4 | 5 | import java.util.List; 6 | import java.util.Map; 7 | 8 | import org.springframework.stereotype.Service; 9 | 10 | import com.baomidou.mybatisplus.mapper.EntityWrapper; 11 | import com.baomidou.mybatisplus.mapper.Wrapper; 12 | import com.baomidou.mybatisplus.plugins.Page; 13 | import com.baomidou.mybatisplus.service.impl.ServiceImpl; 14 | import com.dao.UserDao; 15 | import com.entity.UserEntity; 16 | import com.service.UserService; 17 | import com.utils.PageUtils; 18 | import com.utils.Query; 19 | 20 | 21 | /** 22 | * 系统用户 23 | */ 24 | @Service("userService") 25 | public class UserServiceImpl extends ServiceImpl implements UserService { 26 | 27 | @Override 28 | public PageUtils queryPage(Map params) { 29 | Page page = this.selectPage( 30 | new Query(params).getPage(), 31 | new EntityWrapper() 32 | ); 33 | return new PageUtils(page); 34 | } 35 | 36 | @Override 37 | public List selectListView(Wrapper wrapper) { 38 | return baseMapper.selectListView(wrapper); 39 | } 40 | 41 | @Override 42 | public PageUtils queryPage(Map params, 43 | Wrapper wrapper) { 44 | Page page =new Query(params).getPage(); 45 | page.setRecords(baseMapper.selectListView(page,wrapper)); 46 | PageUtils pageUtil = new PageUtils(page); 47 | return pageUtil; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | # Tomcat 2 | server: 3 | tomcat: 4 | uri-encoding: UTF-8 5 | port: 8080 6 | servlet: 7 | context-path: /springbootp0eo6 8 | 9 | spring: 10 | datasource: 11 | driverClassName: com.mysql.jdbc.Driver 12 | url: jdbc:mysql://127.0.0.1:3306/springbootp0eo6?useUnicode=true&characterEncoding=utf-8&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC 13 | username: root 14 | password: 123456 15 | servlet: 16 | multipart: 17 | max-file-size: 10MB 18 | max-request-size: 10MB 19 | resources: 20 | static-locations: classpath:static/,file:static/ 21 | 22 | #mybatis 23 | mybatis-plus: 24 | mapper-locations: classpath*:mapper/*.xml 25 | #实体扫描,多个package用逗号或者分号分隔 26 | typeAliasesPackage: com.entity 27 | global-config: 28 | #主键类型 0:"数据库ID自增", 1:"用户输入ID",2:"全局唯一ID (数字类型唯一ID)", 3:"全局唯一ID UUID"; 29 | id-type: 1 30 | #字段策略 0:"忽略判断",1:"非 NULL 判断"),2:"非空判断" 31 | field-strategy: 2 32 | #驼峰下划线转换 33 | db-column-underline: true 34 | #刷新mapper 调试神器 35 | refresh-mapper: true 36 | #逻辑删除配置 37 | logic-delete-value: -1 38 | logic-not-delete-value: 0 39 | #自定义SQL注入器 40 | sql-injector: com.baomidou.mybatisplus.mapper.LogicSqlInjector 41 | configuration: 42 | map-underscore-to-camel-case: true 43 | cache-enabled: false 44 | call-setters-on-nulls: true 45 | #springboot 项目mybatis plus 设置 jdbcTypeForNull (oracle数据库需配置JdbcType.NULL, 默认是Other) 46 | jdbc-type-for-null: 'null' 47 | -------------------------------------------------------------------------------- /src/main/java/com/config/InterceptorConfig.java: -------------------------------------------------------------------------------- 1 | package com.config; 2 | 3 | import org.springframework.context.annotation.Bean; 4 | import org.springframework.context.annotation.Configuration; 5 | import org.springframework.web.servlet.config.annotation.InterceptorRegistry; 6 | import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; 7 | import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport; 8 | 9 | import com.interceptor.AuthorizationInterceptor; 10 | 11 | @Configuration 12 | public class InterceptorConfig extends WebMvcConfigurationSupport{ 13 | 14 | @Bean 15 | public AuthorizationInterceptor getAuthorizationInterceptor() { 16 | return new AuthorizationInterceptor(); 17 | } 18 | 19 | @Override 20 | public void addInterceptors(InterceptorRegistry registry) { 21 | registry.addInterceptor(getAuthorizationInterceptor()).addPathPatterns("/**").excludePathPatterns("/static/**"); 22 | super.addInterceptors(registry); 23 | } 24 | 25 | /** 26 | * springboot 2.0配置WebMvcConfigurationSupport之后,会导致默认配置被覆盖,要访问静态资源需要重写addResourceHandlers方法 27 | */ 28 | @Override 29 | public void addResourceHandlers(ResourceHandlerRegistry registry) { 30 | registry.addResourceHandler("/**") 31 | .addResourceLocations("classpath:/resources/") 32 | .addResourceLocations("classpath:/static/") 33 | .addResourceLocations("classpath:/admin/") 34 | .addResourceLocations("classpath:/front/") 35 | .addResourceLocations("classpath:/public/"); 36 | super.addResourceHandlers(registry); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/com/entity/vo/MessagesVO.java: -------------------------------------------------------------------------------- 1 | package com.entity.vo; 2 | 3 | import com.entity.MessagesEntity; 4 | 5 | import com.baomidou.mybatisplus.annotations.TableName; 6 | import java.util.Date; 7 | import org.springframework.format.annotation.DateTimeFormat; 8 | 9 | import com.fasterxml.jackson.annotation.JsonFormat; 10 | import java.io.Serializable; 11 | 12 | 13 | /** 14 | * 留言板 15 | * 手机端接口返回实体辅助类 16 | * (主要作用去除一些不必要的字段) 17 | * @author 18 | * @email 19 | * @date 2021-02-03 16:07:05 20 | */ 21 | public class MessagesVO implements Serializable { 22 | private static final long serialVersionUID = 1L; 23 | 24 | 25 | /** 26 | * 用户名 27 | */ 28 | 29 | private String username; 30 | 31 | /** 32 | * 留言内容 33 | */ 34 | 35 | private String content; 36 | 37 | /** 38 | * 回复内容 39 | */ 40 | 41 | private String reply; 42 | 43 | 44 | /** 45 | * 设置:用户名 46 | */ 47 | 48 | public void setUsername(String username) { 49 | this.username = username; 50 | } 51 | 52 | /** 53 | * 获取:用户名 54 | */ 55 | public String getUsername() { 56 | return username; 57 | } 58 | 59 | 60 | /** 61 | * 设置:留言内容 62 | */ 63 | 64 | public void setContent(String content) { 65 | this.content = content; 66 | } 67 | 68 | /** 69 | * 获取:留言内容 70 | */ 71 | public String getContent() { 72 | return content; 73 | } 74 | 75 | 76 | /** 77 | * 设置:回复内容 78 | */ 79 | 80 | public void setReply(String reply) { 81 | this.reply = reply; 82 | } 83 | 84 | /** 85 | * 获取:回复内容 86 | */ 87 | public String getReply() { 88 | return reply; 89 | } 90 | 91 | } 92 | -------------------------------------------------------------------------------- /src/main/java/com/entity/vo/NewsVO.java: -------------------------------------------------------------------------------- 1 | package com.entity.vo; 2 | 3 | import com.entity.NewsEntity; 4 | 5 | import com.baomidou.mybatisplus.annotations.TableName; 6 | import java.util.Date; 7 | import org.springframework.format.annotation.DateTimeFormat; 8 | 9 | import com.fasterxml.jackson.annotation.JsonFormat; 10 | import java.io.Serializable; 11 | 12 | 13 | /** 14 | * 竞拍公告 15 | * 手机端接口返回实体辅助类 16 | * (主要作用去除一些不必要的字段) 17 | * @author 18 | * @email 19 | * @date 2021-02-03 16:07:05 20 | */ 21 | public class NewsVO implements Serializable { 22 | private static final long serialVersionUID = 1L; 23 | 24 | 25 | /** 26 | * 简介 27 | */ 28 | 29 | private String introduction; 30 | 31 | /** 32 | * 图片 33 | */ 34 | 35 | private String picture; 36 | 37 | /** 38 | * 内容 39 | */ 40 | 41 | private String content; 42 | 43 | 44 | /** 45 | * 设置:简介 46 | */ 47 | 48 | public void setIntroduction(String introduction) { 49 | this.introduction = introduction; 50 | } 51 | 52 | /** 53 | * 获取:简介 54 | */ 55 | public String getIntroduction() { 56 | return introduction; 57 | } 58 | 59 | 60 | /** 61 | * 设置:图片 62 | */ 63 | 64 | public void setPicture(String picture) { 65 | this.picture = picture; 66 | } 67 | 68 | /** 69 | * 获取:图片 70 | */ 71 | public String getPicture() { 72 | return picture; 73 | } 74 | 75 | 76 | /** 77 | * 设置:内容 78 | */ 79 | 80 | public void setContent(String content) { 81 | this.content = content; 82 | } 83 | 84 | /** 85 | * 获取:内容 86 | */ 87 | public String getContent() { 88 | return content; 89 | } 90 | 91 | } 92 | -------------------------------------------------------------------------------- /src/main/resources/mapper/YonghuDao.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 24 | 25 | 30 | 31 | 37 | 38 | 42 | 43 | -------------------------------------------------------------------------------- /src/main/java/com/entity/model/MessagesModel.java: -------------------------------------------------------------------------------- 1 | package com.entity.model; 2 | 3 | import com.entity.MessagesEntity; 4 | 5 | import com.baomidou.mybatisplus.annotations.TableName; 6 | import java.util.Date; 7 | import org.springframework.format.annotation.DateTimeFormat; 8 | 9 | import com.fasterxml.jackson.annotation.JsonFormat; 10 | import java.io.Serializable; 11 | 12 | 13 | /** 14 | * 留言板 15 | * 接收传参的实体类 16 | *(实际开发中配合移动端接口开发手动去掉些没用的字段, 后端一般用entity就够用了) 17 | * 取自ModelAndView 的model名称 18 | * @author 19 | * @email 20 | * @date 2021-02-03 16:07:05 21 | */ 22 | public class MessagesModel implements Serializable { 23 | private static final long serialVersionUID = 1L; 24 | 25 | 26 | /** 27 | * 用户名 28 | */ 29 | 30 | private String username; 31 | 32 | /** 33 | * 留言内容 34 | */ 35 | 36 | private String content; 37 | 38 | /** 39 | * 回复内容 40 | */ 41 | 42 | private String reply; 43 | 44 | 45 | /** 46 | * 设置:用户名 47 | */ 48 | 49 | public void setUsername(String username) { 50 | this.username = username; 51 | } 52 | 53 | /** 54 | * 获取:用户名 55 | */ 56 | public String getUsername() { 57 | return username; 58 | } 59 | 60 | 61 | /** 62 | * 设置:留言内容 63 | */ 64 | 65 | public void setContent(String content) { 66 | this.content = content; 67 | } 68 | 69 | /** 70 | * 获取:留言内容 71 | */ 72 | public String getContent() { 73 | return content; 74 | } 75 | 76 | 77 | /** 78 | * 设置:回复内容 79 | */ 80 | 81 | public void setReply(String reply) { 82 | this.reply = reply; 83 | } 84 | 85 | /** 86 | * 获取:回复内容 87 | */ 88 | public String getReply() { 89 | return reply; 90 | } 91 | 92 | } 93 | -------------------------------------------------------------------------------- /src/main/java/com/entity/model/NewsModel.java: -------------------------------------------------------------------------------- 1 | package com.entity.model; 2 | 3 | import com.entity.NewsEntity; 4 | 5 | import com.baomidou.mybatisplus.annotations.TableName; 6 | import java.util.Date; 7 | import org.springframework.format.annotation.DateTimeFormat; 8 | 9 | import com.fasterxml.jackson.annotation.JsonFormat; 10 | import java.io.Serializable; 11 | 12 | 13 | /** 14 | * 竞拍公告 15 | * 接收传参的实体类 16 | *(实际开发中配合移动端接口开发手动去掉些没用的字段, 后端一般用entity就够用了) 17 | * 取自ModelAndView 的model名称 18 | * @author 19 | * @email 20 | * @date 2021-02-03 16:07:05 21 | */ 22 | public class NewsModel implements Serializable { 23 | private static final long serialVersionUID = 1L; 24 | 25 | 26 | /** 27 | * 简介 28 | */ 29 | 30 | private String introduction; 31 | 32 | /** 33 | * 图片 34 | */ 35 | 36 | private String picture; 37 | 38 | /** 39 | * 内容 40 | */ 41 | 42 | private String content; 43 | 44 | 45 | /** 46 | * 设置:简介 47 | */ 48 | 49 | public void setIntroduction(String introduction) { 50 | this.introduction = introduction; 51 | } 52 | 53 | /** 54 | * 获取:简介 55 | */ 56 | public String getIntroduction() { 57 | return introduction; 58 | } 59 | 60 | 61 | /** 62 | * 设置:图片 63 | */ 64 | 65 | public void setPicture(String picture) { 66 | this.picture = picture; 67 | } 68 | 69 | /** 70 | * 获取:图片 71 | */ 72 | public String getPicture() { 73 | return picture; 74 | } 75 | 76 | 77 | /** 78 | * 设置:内容 79 | */ 80 | 81 | public void setContent(String content) { 82 | this.content = content; 83 | } 84 | 85 | /** 86 | * 获取:内容 87 | */ 88 | public String getContent() { 89 | return content; 90 | } 91 | 92 | } 93 | -------------------------------------------------------------------------------- /src/main/resources/mapper/PaimaishangpinDao.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 22 | 23 | 28 | 29 | 35 | 36 | 40 | 41 | -------------------------------------------------------------------------------- /src/main/resources/mapper/LishijingpaiDao.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 25 | 26 | 31 | 32 | 38 | 39 | 43 | 44 | -------------------------------------------------------------------------------- /src/main/resources/mapper/CommonDao.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 15 | 16 | 19 | 20 | 21 | UPDATE ${table} set sfsh=#{sfsh} where id=#{id} 22 | 23 | 24 | 44 | 45 | 48 | 49 | 52 | 53 | 56 | 57 | -------------------------------------------------------------------------------- /src/main/resources/mapper/JingpaidingdanDao.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 26 | 27 | 32 | 33 | 39 | 40 | 44 | 45 | -------------------------------------------------------------------------------- /src/main/java/com/service/impl/NewsServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.service.impl; 2 | 3 | import org.springframework.stereotype.Service; 4 | import java.util.Map; 5 | import java.util.List; 6 | 7 | import com.baomidou.mybatisplus.mapper.Wrapper; 8 | import com.baomidou.mybatisplus.mapper.EntityWrapper; 9 | import com.baomidou.mybatisplus.plugins.Page; 10 | import com.baomidou.mybatisplus.service.impl.ServiceImpl; 11 | import com.utils.PageUtils; 12 | import com.utils.Query; 13 | 14 | 15 | import com.dao.NewsDao; 16 | import com.entity.NewsEntity; 17 | import com.service.NewsService; 18 | import com.entity.vo.NewsVO; 19 | import com.entity.view.NewsView; 20 | 21 | @Service("newsService") 22 | public class NewsServiceImpl extends ServiceImpl implements NewsService { 23 | 24 | 25 | @Override 26 | public PageUtils queryPage(Map params) { 27 | Page page = this.selectPage( 28 | new Query(params).getPage(), 29 | new EntityWrapper() 30 | ); 31 | return new PageUtils(page); 32 | } 33 | 34 | @Override 35 | public PageUtils queryPage(Map params, Wrapper wrapper) { 36 | Page page =new Query(params).getPage(); 37 | page.setRecords(baseMapper.selectListView(page,wrapper)); 38 | PageUtils pageUtil = new PageUtils(page); 39 | return pageUtil; 40 | } 41 | 42 | @Override 43 | public List selectListVO(Wrapper wrapper) { 44 | return baseMapper.selectListVO(wrapper); 45 | } 46 | 47 | @Override 48 | public NewsVO selectVO(Wrapper wrapper) { 49 | return baseMapper.selectVO(wrapper); 50 | } 51 | 52 | @Override 53 | public List selectListView(Wrapper wrapper) { 54 | return baseMapper.selectListView(wrapper); 55 | } 56 | 57 | @Override 58 | public NewsView selectView(Wrapper wrapper) { 59 | return baseMapper.selectView(wrapper); 60 | } 61 | 62 | } 63 | -------------------------------------------------------------------------------- /src/main/java/com/service/impl/YonghuServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.service.impl; 2 | 3 | import org.springframework.stereotype.Service; 4 | import java.util.Map; 5 | import java.util.List; 6 | 7 | import com.baomidou.mybatisplus.mapper.Wrapper; 8 | import com.baomidou.mybatisplus.mapper.EntityWrapper; 9 | import com.baomidou.mybatisplus.plugins.Page; 10 | import com.baomidou.mybatisplus.service.impl.ServiceImpl; 11 | import com.utils.PageUtils; 12 | import com.utils.Query; 13 | 14 | 15 | import com.dao.YonghuDao; 16 | import com.entity.YonghuEntity; 17 | import com.service.YonghuService; 18 | import com.entity.vo.YonghuVO; 19 | import com.entity.view.YonghuView; 20 | 21 | @Service("yonghuService") 22 | public class YonghuServiceImpl extends ServiceImpl implements YonghuService { 23 | 24 | 25 | @Override 26 | public PageUtils queryPage(Map params) { 27 | Page page = this.selectPage( 28 | new Query(params).getPage(), 29 | new EntityWrapper() 30 | ); 31 | return new PageUtils(page); 32 | } 33 | 34 | @Override 35 | public PageUtils queryPage(Map params, Wrapper wrapper) { 36 | Page page =new Query(params).getPage(); 37 | page.setRecords(baseMapper.selectListView(page,wrapper)); 38 | PageUtils pageUtil = new PageUtils(page); 39 | return pageUtil; 40 | } 41 | 42 | @Override 43 | public List selectListVO(Wrapper wrapper) { 44 | return baseMapper.selectListVO(wrapper); 45 | } 46 | 47 | @Override 48 | public YonghuVO selectVO(Wrapper wrapper) { 49 | return baseMapper.selectVO(wrapper); 50 | } 51 | 52 | @Override 53 | public List selectListView(Wrapper wrapper) { 54 | return baseMapper.selectListView(wrapper); 55 | } 56 | 57 | @Override 58 | public YonghuView selectView(Wrapper wrapper) { 59 | return baseMapper.selectView(wrapper); 60 | } 61 | 62 | } 63 | -------------------------------------------------------------------------------- /src/main/java/com/service/impl/MessagesServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.service.impl; 2 | 3 | import org.springframework.stereotype.Service; 4 | import java.util.Map; 5 | import java.util.List; 6 | 7 | import com.baomidou.mybatisplus.mapper.Wrapper; 8 | import com.baomidou.mybatisplus.mapper.EntityWrapper; 9 | import com.baomidou.mybatisplus.plugins.Page; 10 | import com.baomidou.mybatisplus.service.impl.ServiceImpl; 11 | import com.utils.PageUtils; 12 | import com.utils.Query; 13 | 14 | 15 | import com.dao.MessagesDao; 16 | import com.entity.MessagesEntity; 17 | import com.service.MessagesService; 18 | import com.entity.vo.MessagesVO; 19 | import com.entity.view.MessagesView; 20 | 21 | @Service("messagesService") 22 | public class MessagesServiceImpl extends ServiceImpl implements MessagesService { 23 | 24 | 25 | @Override 26 | public PageUtils queryPage(Map params) { 27 | Page page = this.selectPage( 28 | new Query(params).getPage(), 29 | new EntityWrapper() 30 | ); 31 | return new PageUtils(page); 32 | } 33 | 34 | @Override 35 | public PageUtils queryPage(Map params, Wrapper wrapper) { 36 | Page page =new Query(params).getPage(); 37 | page.setRecords(baseMapper.selectListView(page,wrapper)); 38 | PageUtils pageUtil = new PageUtils(page); 39 | return pageUtil; 40 | } 41 | 42 | @Override 43 | public List selectListVO(Wrapper wrapper) { 44 | return baseMapper.selectListVO(wrapper); 45 | } 46 | 47 | @Override 48 | public MessagesVO selectVO(Wrapper wrapper) { 49 | return baseMapper.selectVO(wrapper); 50 | } 51 | 52 | @Override 53 | public List selectListView(Wrapper wrapper) { 54 | return baseMapper.selectListView(wrapper); 55 | } 56 | 57 | @Override 58 | public MessagesView selectView(Wrapper wrapper) { 59 | return baseMapper.selectView(wrapper); 60 | } 61 | 62 | } 63 | -------------------------------------------------------------------------------- /src/main/java/com/service/impl/LishijingpaiServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.service.impl; 2 | 3 | import org.springframework.stereotype.Service; 4 | import java.util.Map; 5 | import java.util.List; 6 | 7 | import com.baomidou.mybatisplus.mapper.Wrapper; 8 | import com.baomidou.mybatisplus.mapper.EntityWrapper; 9 | import com.baomidou.mybatisplus.plugins.Page; 10 | import com.baomidou.mybatisplus.service.impl.ServiceImpl; 11 | import com.utils.PageUtils; 12 | import com.utils.Query; 13 | 14 | 15 | import com.dao.LishijingpaiDao; 16 | import com.entity.LishijingpaiEntity; 17 | import com.service.LishijingpaiService; 18 | import com.entity.vo.LishijingpaiVO; 19 | import com.entity.view.LishijingpaiView; 20 | 21 | @Service("lishijingpaiService") 22 | public class LishijingpaiServiceImpl extends ServiceImpl implements LishijingpaiService { 23 | 24 | 25 | @Override 26 | public PageUtils queryPage(Map params) { 27 | Page page = this.selectPage( 28 | new Query(params).getPage(), 29 | new EntityWrapper() 30 | ); 31 | return new PageUtils(page); 32 | } 33 | 34 | @Override 35 | public PageUtils queryPage(Map params, Wrapper wrapper) { 36 | Page page =new Query(params).getPage(); 37 | page.setRecords(baseMapper.selectListView(page,wrapper)); 38 | PageUtils pageUtil = new PageUtils(page); 39 | return pageUtil; 40 | } 41 | 42 | @Override 43 | public List selectListVO(Wrapper wrapper) { 44 | return baseMapper.selectListVO(wrapper); 45 | } 46 | 47 | @Override 48 | public LishijingpaiVO selectVO(Wrapper wrapper) { 49 | return baseMapper.selectVO(wrapper); 50 | } 51 | 52 | @Override 53 | public List selectListView(Wrapper wrapper) { 54 | return baseMapper.selectListView(wrapper); 55 | } 56 | 57 | @Override 58 | public LishijingpaiView selectView(Wrapper wrapper) { 59 | return baseMapper.selectView(wrapper); 60 | } 61 | 62 | } 63 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 基于Springboot的在线拍卖系统(程序+论文) 2 | = 3 | ### 完整代码获取地址:从戎源码网 ([https://armycodes.com/](https://armycodes.com/)) 4 | ### 作者微信:19941326836 QQ:952045282 5 | ### 承接计算机毕业设计、Java毕业设计、Python毕业设计、深度学习、机器学习 6 | ### 选题+开题报告+任务书+程序定制+安装调试+论文+答辩ppt 一条龙服务 7 | ### 所有选题地址https://github.com/nature924/allProject 8 | 9 | 一、项目介绍 10 | --- 11 | 系统包含两种角色:用户、管理员,系统分为前台和后台两大模块,主要功能如下: 12 | ### 前台功能 13 | 14 | ### 用户角色: 15 | 1. 首页: 16 | - 显示拍卖系统的主要信息,包括热门拍卖商品、最新竞拍公告等。 17 | 2. 拍卖商品: 18 | - 用户可以浏览当前正在拍卖的商品,查看商品详情,参与竞拍。 19 | 3. 竞拍公告: 20 | - 显示系统发布的最新竞拍公告,包括拍卖规则、竞拍时间等信息。 21 | 22 | 4. 留言反馈: 23 | - 用户可以提交反馈意见和建议,与管理员进行交流。 24 | 25 | 5. 个人中心: 26 | - 用户可以查看和编辑个人信息,管理个人账户。 27 | 28 | ### 后台功能 29 | 30 | ### 用户角色: 31 | 32 | 1. 个人中心: 33 | - 用户可以查看和编辑个人信息,管理个人账户。 34 | 35 | 2. 历史竞拍管理: 36 | - 查看用户参与过的历史竞拍记录,管理竞拍记录。 37 | 38 | 3. 竞拍订单管理: 39 | - 查看和管理用户的竞拍订单,处理订单状态。 40 | 41 | 4. 留言板管理: 42 | - 查看和管理用户提交的留言和反馈,与用户互动。 43 | 44 | 管理员角色: 45 | 46 | 1. 个人中心: 47 | - 查看和编辑管理员个人信息,管理个人账户。 48 | 49 | 2. 用户管理: 50 | - 管理系统中的用户信息,包括用户的注册、修改、删除等操作。 51 | 52 | 3. 商品类型管理: 53 | - 管理拍卖商品的类型,添加、修改、删除商品分类。 54 | 55 | 4. 拍卖商品管理: 56 | - 管理拍卖商品的添加、编辑、删除和审核,设置拍卖商品的详细信息。 57 | 58 | 5. 历史竞拍管理: 59 | - 查看和管理所有用户的历史竞拍记录。 60 | 61 | 6. 竞拍订单管理: 62 | - 查看和管理所有用户的竞拍订单,处理订单状态。 63 | 64 | 7. 留言板管理: 65 | - 查看和管理所有用户的留言和反馈,与用户互动。 66 | 67 | 8. 系统管理: 68 | - 轮播图管理:管理系统首页轮播图,添加、编辑、删除轮播图。 69 | - 竞拍公告:发布和管理竞拍公告,通知用户最新的拍卖信息和规则。 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 二、项目技术 78 | --- 79 | - 编程语言:Java 80 | - 数据库:MySQL 81 | - 项目管理工具:Maven 82 | - 前端技术:VUE、HTML、Jquery、Bootstrap 83 | - 后端技术:Spring、SpringMVC、MyBatis 84 | 85 | 三、运行环境 86 | --- 87 | - 操作系统:Windows、macOS都可以 88 | - JDK版本:JDK1.8以上都可以 89 | - 开发工具:IDEA、Ecplise、Myecplise都可以 90 | - 数据库: MySQL5.7以上都可以 91 | - Tomcat:任意版本都可以 92 | - Maven:任意版本都可以 93 | 94 | 四、运行截图 95 | --- 96 | ### 论文截图: 97 | ![image/1.png](limage/1.png) 98 | 99 | ### 程序截图: 100 | ![image/1.png](image/图片1.png) 101 | ![image/1.png](image/图片2.png) 102 | ![image/1.png](image/图片3.png) 103 | ![image/1.png](image/图片4.png) 104 | ![image/1.png](image/图片5.png) 105 | ![image/1.png](image/图片6.png) 106 | ![image/1.png](image/图片7.png) 107 | ![image/1.png](image/图片8.png) 108 | 109 | 110 | 111 | -------------------------------------------------------------------------------- /src/main/java/com/service/impl/JingpaidingdanServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.service.impl; 2 | 3 | import org.springframework.stereotype.Service; 4 | import java.util.Map; 5 | import java.util.List; 6 | 7 | import com.baomidou.mybatisplus.mapper.Wrapper; 8 | import com.baomidou.mybatisplus.mapper.EntityWrapper; 9 | import com.baomidou.mybatisplus.plugins.Page; 10 | import com.baomidou.mybatisplus.service.impl.ServiceImpl; 11 | import com.utils.PageUtils; 12 | import com.utils.Query; 13 | 14 | 15 | import com.dao.JingpaidingdanDao; 16 | import com.entity.JingpaidingdanEntity; 17 | import com.service.JingpaidingdanService; 18 | import com.entity.vo.JingpaidingdanVO; 19 | import com.entity.view.JingpaidingdanView; 20 | 21 | @Service("jingpaidingdanService") 22 | public class JingpaidingdanServiceImpl extends ServiceImpl implements JingpaidingdanService { 23 | 24 | 25 | @Override 26 | public PageUtils queryPage(Map params) { 27 | Page page = this.selectPage( 28 | new Query(params).getPage(), 29 | new EntityWrapper() 30 | ); 31 | return new PageUtils(page); 32 | } 33 | 34 | @Override 35 | public PageUtils queryPage(Map params, Wrapper wrapper) { 36 | Page page =new Query(params).getPage(); 37 | page.setRecords(baseMapper.selectListView(page,wrapper)); 38 | PageUtils pageUtil = new PageUtils(page); 39 | return pageUtil; 40 | } 41 | 42 | @Override 43 | public List selectListVO(Wrapper wrapper) { 44 | return baseMapper.selectListVO(wrapper); 45 | } 46 | 47 | @Override 48 | public JingpaidingdanVO selectVO(Wrapper wrapper) { 49 | return baseMapper.selectVO(wrapper); 50 | } 51 | 52 | @Override 53 | public List selectListView(Wrapper wrapper) { 54 | return baseMapper.selectListView(wrapper); 55 | } 56 | 57 | @Override 58 | public JingpaidingdanView selectView(Wrapper wrapper) { 59 | return baseMapper.selectView(wrapper); 60 | } 61 | 62 | } 63 | -------------------------------------------------------------------------------- /src/main/java/com/service/impl/PaimaishangpinServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.service.impl; 2 | 3 | import org.springframework.stereotype.Service; 4 | import java.util.Map; 5 | import java.util.List; 6 | 7 | import com.baomidou.mybatisplus.mapper.Wrapper; 8 | import com.baomidou.mybatisplus.mapper.EntityWrapper; 9 | import com.baomidou.mybatisplus.plugins.Page; 10 | import com.baomidou.mybatisplus.service.impl.ServiceImpl; 11 | import com.utils.PageUtils; 12 | import com.utils.Query; 13 | 14 | 15 | import com.dao.PaimaishangpinDao; 16 | import com.entity.PaimaishangpinEntity; 17 | import com.service.PaimaishangpinService; 18 | import com.entity.vo.PaimaishangpinVO; 19 | import com.entity.view.PaimaishangpinView; 20 | 21 | @Service("paimaishangpinService") 22 | public class PaimaishangpinServiceImpl extends ServiceImpl implements PaimaishangpinService { 23 | 24 | 25 | @Override 26 | public PageUtils queryPage(Map params) { 27 | Page page = this.selectPage( 28 | new Query(params).getPage(), 29 | new EntityWrapper() 30 | ); 31 | return new PageUtils(page); 32 | } 33 | 34 | @Override 35 | public PageUtils queryPage(Map params, Wrapper wrapper) { 36 | Page page =new Query(params).getPage(); 37 | page.setRecords(baseMapper.selectListView(page,wrapper)); 38 | PageUtils pageUtil = new PageUtils(page); 39 | return pageUtil; 40 | } 41 | 42 | @Override 43 | public List selectListVO(Wrapper wrapper) { 44 | return baseMapper.selectListVO(wrapper); 45 | } 46 | 47 | @Override 48 | public PaimaishangpinVO selectVO(Wrapper wrapper) { 49 | return baseMapper.selectVO(wrapper); 50 | } 51 | 52 | @Override 53 | public List selectListView(Wrapper wrapper) { 54 | return baseMapper.selectListView(wrapper); 55 | } 56 | 57 | @Override 58 | public PaimaishangpinView selectView(Wrapper wrapper) { 59 | return baseMapper.selectView(wrapper); 60 | } 61 | 62 | } 63 | -------------------------------------------------------------------------------- /src/main/java/com/service/impl/ShangpinleixingServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.service.impl; 2 | 3 | import org.springframework.stereotype.Service; 4 | import java.util.Map; 5 | import java.util.List; 6 | 7 | import com.baomidou.mybatisplus.mapper.Wrapper; 8 | import com.baomidou.mybatisplus.mapper.EntityWrapper; 9 | import com.baomidou.mybatisplus.plugins.Page; 10 | import com.baomidou.mybatisplus.service.impl.ServiceImpl; 11 | import com.utils.PageUtils; 12 | import com.utils.Query; 13 | 14 | 15 | import com.dao.ShangpinleixingDao; 16 | import com.entity.ShangpinleixingEntity; 17 | import com.service.ShangpinleixingService; 18 | import com.entity.vo.ShangpinleixingVO; 19 | import com.entity.view.ShangpinleixingView; 20 | 21 | @Service("shangpinleixingService") 22 | public class ShangpinleixingServiceImpl extends ServiceImpl implements ShangpinleixingService { 23 | 24 | 25 | @Override 26 | public PageUtils queryPage(Map params) { 27 | Page page = this.selectPage( 28 | new Query(params).getPage(), 29 | new EntityWrapper() 30 | ); 31 | return new PageUtils(page); 32 | } 33 | 34 | @Override 35 | public PageUtils queryPage(Map params, Wrapper wrapper) { 36 | Page page =new Query(params).getPage(); 37 | page.setRecords(baseMapper.selectListView(page,wrapper)); 38 | PageUtils pageUtil = new PageUtils(page); 39 | return pageUtil; 40 | } 41 | 42 | @Override 43 | public List selectListVO(Wrapper wrapper) { 44 | return baseMapper.selectListVO(wrapper); 45 | } 46 | 47 | @Override 48 | public ShangpinleixingVO selectVO(Wrapper wrapper) { 49 | return baseMapper.selectVO(wrapper); 50 | } 51 | 52 | @Override 53 | public List selectListView(Wrapper wrapper) { 54 | return baseMapper.selectListView(wrapper); 55 | } 56 | 57 | @Override 58 | public ShangpinleixingView selectView(Wrapper wrapper) { 59 | return baseMapper.selectView(wrapper); 60 | } 61 | 62 | } 63 | -------------------------------------------------------------------------------- /src/main/java/com/utils/PageUtils.java: -------------------------------------------------------------------------------- 1 | 2 | package com.utils; 3 | 4 | import java.io.Serializable; 5 | import java.util.List; 6 | import java.util.Map; 7 | 8 | import com.baomidou.mybatisplus.plugins.Page; 9 | 10 | /** 11 | * 分页工具类 12 | */ 13 | public class PageUtils implements Serializable { 14 | private static final long serialVersionUID = 1L; 15 | //总记录数 16 | private long total; 17 | //每页记录数 18 | private int pageSize; 19 | //总页数 20 | private long totalPage; 21 | //当前页数 22 | private int currPage; 23 | //列表数据 24 | private List list; 25 | 26 | /** 27 | * 分页 28 | * @param list 列表数据 29 | * @param totalCount 总记录数 30 | * @param pageSize 每页记录数 31 | * @param currPage 当前页数 32 | */ 33 | public PageUtils(List list, int totalCount, int pageSize, int currPage) { 34 | this.list = list; 35 | this.total = totalCount; 36 | this.pageSize = pageSize; 37 | this.currPage = currPage; 38 | this.totalPage = (int)Math.ceil((double)totalCount/pageSize); 39 | } 40 | 41 | /** 42 | * 分页 43 | */ 44 | public PageUtils(Page page) { 45 | this.list = page.getRecords(); 46 | this.total = page.getTotal(); 47 | this.pageSize = page.getSize(); 48 | this.currPage = page.getCurrent(); 49 | this.totalPage = page.getPages(); 50 | } 51 | 52 | /* 53 | * 空数据的分页 54 | */ 55 | public PageUtils(Map params) { 56 | Page page =new Query(params).getPage(); 57 | new PageUtils(page); 58 | } 59 | 60 | 61 | public int getPageSize() { 62 | return pageSize; 63 | } 64 | 65 | public void setPageSize(int pageSize) { 66 | this.pageSize = pageSize; 67 | } 68 | 69 | public int getCurrPage() { 70 | return currPage; 71 | } 72 | 73 | public void setCurrPage(int currPage) { 74 | this.currPage = currPage; 75 | } 76 | 77 | public List getList() { 78 | return list; 79 | } 80 | 81 | public void setList(List list) { 82 | this.list = list; 83 | } 84 | 85 | public long getTotalPage() { 86 | return totalPage; 87 | } 88 | 89 | public void setTotalPage(long totalPage) { 90 | this.totalPage = totalPage; 91 | } 92 | 93 | public long getTotal() { 94 | return total; 95 | } 96 | 97 | public void setTotal(long total) { 98 | this.total = total; 99 | } 100 | 101 | } 102 | -------------------------------------------------------------------------------- /src/main/java/com/entity/ShangpinleixingEntity.java: -------------------------------------------------------------------------------- 1 | package com.entity; 2 | 3 | import com.baomidou.mybatisplus.annotations.TableId; 4 | import com.baomidou.mybatisplus.annotations.TableName; 5 | import javax.validation.constraints.NotBlank; 6 | import javax.validation.constraints.NotEmpty; 7 | import javax.validation.constraints.NotNull; 8 | 9 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 10 | import java.lang.reflect.InvocationTargetException; 11 | 12 | import java.io.Serializable; 13 | import java.util.Date; 14 | import java.util.List; 15 | 16 | import org.springframework.format.annotation.DateTimeFormat; 17 | import com.fasterxml.jackson.annotation.JsonFormat; 18 | import org.apache.commons.beanutils.BeanUtils; 19 | import com.baomidou.mybatisplus.annotations.TableField; 20 | import com.baomidou.mybatisplus.enums.FieldFill; 21 | import com.baomidou.mybatisplus.enums.IdType; 22 | 23 | 24 | /** 25 | * 商品类型 26 | * 数据库通用操作实体类(普通增删改查) 27 | * @author 28 | * @email 29 | * @date 2021-02-03 16:07:05 30 | */ 31 | @TableName("shangpinleixing") 32 | public class ShangpinleixingEntity implements Serializable { 33 | private static final long serialVersionUID = 1L; 34 | 35 | 36 | public ShangpinleixingEntity() { 37 | 38 | } 39 | 40 | public ShangpinleixingEntity(T t) { 41 | try { 42 | BeanUtils.copyProperties(this, t); 43 | } catch (IllegalAccessException | InvocationTargetException e) { 44 | // TODO Auto-generated catch block 45 | e.printStackTrace(); 46 | } 47 | } 48 | 49 | /** 50 | * 主键id 51 | */ 52 | @TableId 53 | private Long id; 54 | /** 55 | * 商品类型 56 | */ 57 | 58 | private String shangpinleixing; 59 | 60 | 61 | @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") 62 | @DateTimeFormat 63 | private Date addtime; 64 | 65 | public Date getAddtime() { 66 | return addtime; 67 | } 68 | public void setAddtime(Date addtime) { 69 | this.addtime = addtime; 70 | } 71 | 72 | public Long getId() { 73 | return id; 74 | } 75 | 76 | public void setId(Long id) { 77 | this.id = id; 78 | } 79 | /** 80 | * 设置:商品类型 81 | */ 82 | public void setShangpinleixing(String shangpinleixing) { 83 | this.shangpinleixing = shangpinleixing; 84 | } 85 | /** 86 | * 获取:商品类型 87 | */ 88 | public String getShangpinleixing() { 89 | return shangpinleixing; 90 | } 91 | 92 | } 93 | -------------------------------------------------------------------------------- /src/main/java/com/service/impl/TokenServiceImpl.java: -------------------------------------------------------------------------------- 1 | 2 | package com.service.impl; 3 | 4 | 5 | import java.util.Calendar; 6 | import java.util.Date; 7 | import java.util.List; 8 | import java.util.Map; 9 | 10 | import org.springframework.stereotype.Service; 11 | 12 | import com.baomidou.mybatisplus.mapper.EntityWrapper; 13 | import com.baomidou.mybatisplus.mapper.Wrapper; 14 | import com.baomidou.mybatisplus.plugins.Page; 15 | import com.baomidou.mybatisplus.service.impl.ServiceImpl; 16 | import com.dao.TokenDao; 17 | import com.entity.TokenEntity; 18 | import com.entity.TokenEntity; 19 | import com.service.TokenService; 20 | import com.utils.CommonUtil; 21 | import com.utils.PageUtils; 22 | import com.utils.Query; 23 | 24 | 25 | /** 26 | * token 27 | */ 28 | @Service("tokenService") 29 | public class TokenServiceImpl extends ServiceImpl implements TokenService { 30 | 31 | @Override 32 | public PageUtils queryPage(Map params) { 33 | Page page = this.selectPage( 34 | new Query(params).getPage(), 35 | new EntityWrapper() 36 | ); 37 | return new PageUtils(page); 38 | } 39 | 40 | @Override 41 | public List selectListView(Wrapper wrapper) { 42 | return baseMapper.selectListView(wrapper); 43 | } 44 | 45 | @Override 46 | public PageUtils queryPage(Map params, 47 | Wrapper wrapper) { 48 | Page page =new Query(params).getPage(); 49 | page.setRecords(baseMapper.selectListView(page,wrapper)); 50 | PageUtils pageUtil = new PageUtils(page); 51 | return pageUtil; 52 | } 53 | 54 | @Override 55 | public String generateToken(Long userid,String username, String tableName, String role) { 56 | TokenEntity tokenEntity = this.selectOne(new EntityWrapper().eq("userid", userid).eq("role", role)); 57 | String token = CommonUtil.getRandomString(32); 58 | Calendar cal = Calendar.getInstance(); 59 | cal.setTime(new Date()); 60 | cal.add(Calendar.HOUR_OF_DAY, 1); 61 | if(tokenEntity!=null) { 62 | tokenEntity.setToken(token); 63 | tokenEntity.setExpiratedtime(cal.getTime()); 64 | this.updateById(tokenEntity); 65 | } else { 66 | this.insert(new TokenEntity(userid,username, tableName, role, token, cal.getTime())); 67 | } 68 | return token; 69 | } 70 | 71 | @Override 72 | public TokenEntity getTokenEntity(String token) { 73 | TokenEntity tokenEntity = this.selectOne(new EntityWrapper().eq("token", token)); 74 | if(tokenEntity == null || tokenEntity.getExpiratedtime().getTime() extends LinkedHashMap { 15 | private static final long serialVersionUID = 1L; 16 | /** 17 | * mybatis-plus分页参数 18 | */ 19 | private Page page; 20 | /** 21 | * 当前页码 22 | */ 23 | private int currPage = 1; 24 | /** 25 | * 每页条数 26 | */ 27 | private int limit = 10; 28 | 29 | public Query(JQPageInfo pageInfo) { 30 | //分页参数 31 | if(pageInfo.getPage()!= null){ 32 | currPage = pageInfo.getPage(); 33 | } 34 | if(pageInfo.getLimit()!= null){ 35 | limit = pageInfo.getLimit(); 36 | } 37 | 38 | 39 | //防止SQL注入(因为sidx、order是通过拼接SQL实现排序的,会有SQL注入风险) 40 | String sidx = SQLFilter.sqlInject(pageInfo.getSidx()); 41 | String order = SQLFilter.sqlInject(pageInfo.getOrder()); 42 | 43 | 44 | //mybatis-plus分页 45 | this.page = new Page<>(currPage, limit); 46 | 47 | //排序 48 | if(StringUtils.isNotBlank(sidx) && StringUtils.isNotBlank(order)){ 49 | this.page.setOrderByField(sidx); 50 | this.page.setAsc("ASC".equalsIgnoreCase(order)); 51 | } 52 | } 53 | 54 | 55 | public Query(Map params){ 56 | this.putAll(params); 57 | 58 | //分页参数 59 | if(params.get("page") != null){ 60 | currPage = Integer.parseInt((String)params.get("page")); 61 | } 62 | if(params.get("limit") != null){ 63 | limit = Integer.parseInt((String)params.get("limit")); 64 | } 65 | 66 | this.put("offset", (currPage - 1) * limit); 67 | this.put("page", currPage); 68 | this.put("limit", limit); 69 | 70 | //防止SQL注入(因为sidx、order是通过拼接SQL实现排序的,会有SQL注入风险) 71 | String sidx = SQLFilter.sqlInject((String)params.get("sidx")); 72 | String order = SQLFilter.sqlInject((String)params.get("order")); 73 | this.put("sidx", sidx); 74 | this.put("order", order); 75 | 76 | //mybatis-plus分页 77 | this.page = new Page<>(currPage, limit); 78 | 79 | //排序 80 | if(StringUtils.isNotBlank(sidx) && StringUtils.isNotBlank(order)){ 81 | this.page.setOrderByField(sidx); 82 | this.page.setAsc("ASC".equalsIgnoreCase(order)); 83 | } 84 | 85 | } 86 | 87 | public Page getPage() { 88 | return page; 89 | } 90 | 91 | public int getCurrPage() { 92 | return currPage; 93 | } 94 | 95 | public int getLimit() { 96 | return limit; 97 | } 98 | } 99 | -------------------------------------------------------------------------------- /src/main/java/com/entity/vo/PaimaishangpinVO.java: -------------------------------------------------------------------------------- 1 | package com.entity.vo; 2 | 3 | import com.entity.PaimaishangpinEntity; 4 | 5 | import com.baomidou.mybatisplus.annotations.TableName; 6 | import java.util.Date; 7 | import org.springframework.format.annotation.DateTimeFormat; 8 | 9 | import com.fasterxml.jackson.annotation.JsonFormat; 10 | import java.io.Serializable; 11 | 12 | 13 | /** 14 | * 拍卖商品 15 | * 手机端接口返回实体辅助类 16 | * (主要作用去除一些不必要的字段) 17 | * @author 18 | * @email 19 | * @date 2021-02-03 16:07:05 20 | */ 21 | public class PaimaishangpinVO implements Serializable { 22 | private static final long serialVersionUID = 1L; 23 | 24 | 25 | /** 26 | * 商品类型 27 | */ 28 | 29 | private String shangpinleixing; 30 | 31 | /** 32 | * 图片 33 | */ 34 | 35 | private String tupian; 36 | 37 | /** 38 | * 价格 39 | */ 40 | 41 | private Integer jiage; 42 | 43 | /** 44 | * 商品详情 45 | */ 46 | 47 | private String shangpinxiangqing; 48 | 49 | /** 50 | * 活动时间 51 | */ 52 | 53 | private String huodongshijian; 54 | 55 | /** 56 | * 活动状态 57 | */ 58 | 59 | private String huodongzhuangtai; 60 | 61 | 62 | /** 63 | * 设置:商品类型 64 | */ 65 | 66 | public void setShangpinleixing(String shangpinleixing) { 67 | this.shangpinleixing = shangpinleixing; 68 | } 69 | 70 | /** 71 | * 获取:商品类型 72 | */ 73 | public String getShangpinleixing() { 74 | return shangpinleixing; 75 | } 76 | 77 | 78 | /** 79 | * 设置:图片 80 | */ 81 | 82 | public void setTupian(String tupian) { 83 | this.tupian = tupian; 84 | } 85 | 86 | /** 87 | * 获取:图片 88 | */ 89 | public String getTupian() { 90 | return tupian; 91 | } 92 | 93 | 94 | /** 95 | * 设置:价格 96 | */ 97 | 98 | public void setJiage(Integer jiage) { 99 | this.jiage = jiage; 100 | } 101 | 102 | /** 103 | * 获取:价格 104 | */ 105 | public Integer getJiage() { 106 | return jiage; 107 | } 108 | 109 | 110 | /** 111 | * 设置:商品详情 112 | */ 113 | 114 | public void setShangpinxiangqing(String shangpinxiangqing) { 115 | this.shangpinxiangqing = shangpinxiangqing; 116 | } 117 | 118 | /** 119 | * 获取:商品详情 120 | */ 121 | public String getShangpinxiangqing() { 122 | return shangpinxiangqing; 123 | } 124 | 125 | 126 | /** 127 | * 设置:活动时间 128 | */ 129 | 130 | public void setHuodongshijian(String huodongshijian) { 131 | this.huodongshijian = huodongshijian; 132 | } 133 | 134 | /** 135 | * 获取:活动时间 136 | */ 137 | public String getHuodongshijian() { 138 | return huodongshijian; 139 | } 140 | 141 | 142 | /** 143 | * 设置:活动状态 144 | */ 145 | 146 | public void setHuodongzhuangtai(String huodongzhuangtai) { 147 | this.huodongzhuangtai = huodongzhuangtai; 148 | } 149 | 150 | /** 151 | * 获取:活动状态 152 | */ 153 | public String getHuodongzhuangtai() { 154 | return huodongzhuangtai; 155 | } 156 | 157 | } 158 | -------------------------------------------------------------------------------- /src/main/java/com/entity/model/PaimaishangpinModel.java: -------------------------------------------------------------------------------- 1 | package com.entity.model; 2 | 3 | import com.entity.PaimaishangpinEntity; 4 | 5 | import com.baomidou.mybatisplus.annotations.TableName; 6 | import java.util.Date; 7 | import org.springframework.format.annotation.DateTimeFormat; 8 | 9 | import com.fasterxml.jackson.annotation.JsonFormat; 10 | import java.io.Serializable; 11 | 12 | 13 | /** 14 | * 拍卖商品 15 | * 接收传参的实体类 16 | *(实际开发中配合移动端接口开发手动去掉些没用的字段, 后端一般用entity就够用了) 17 | * 取自ModelAndView 的model名称 18 | * @author 19 | * @email 20 | * @date 2021-02-03 16:07:05 21 | */ 22 | public class PaimaishangpinModel implements Serializable { 23 | private static final long serialVersionUID = 1L; 24 | 25 | 26 | /** 27 | * 商品类型 28 | */ 29 | 30 | private String shangpinleixing; 31 | 32 | /** 33 | * 图片 34 | */ 35 | 36 | private String tupian; 37 | 38 | /** 39 | * 价格 40 | */ 41 | 42 | private Integer jiage; 43 | 44 | /** 45 | * 商品详情 46 | */ 47 | 48 | private String shangpinxiangqing; 49 | 50 | /** 51 | * 活动时间 52 | */ 53 | 54 | private String huodongshijian; 55 | 56 | /** 57 | * 活动状态 58 | */ 59 | 60 | private String huodongzhuangtai; 61 | 62 | 63 | /** 64 | * 设置:商品类型 65 | */ 66 | 67 | public void setShangpinleixing(String shangpinleixing) { 68 | this.shangpinleixing = shangpinleixing; 69 | } 70 | 71 | /** 72 | * 获取:商品类型 73 | */ 74 | public String getShangpinleixing() { 75 | return shangpinleixing; 76 | } 77 | 78 | 79 | /** 80 | * 设置:图片 81 | */ 82 | 83 | public void setTupian(String tupian) { 84 | this.tupian = tupian; 85 | } 86 | 87 | /** 88 | * 获取:图片 89 | */ 90 | public String getTupian() { 91 | return tupian; 92 | } 93 | 94 | 95 | /** 96 | * 设置:价格 97 | */ 98 | 99 | public void setJiage(Integer jiage) { 100 | this.jiage = jiage; 101 | } 102 | 103 | /** 104 | * 获取:价格 105 | */ 106 | public Integer getJiage() { 107 | return jiage; 108 | } 109 | 110 | 111 | /** 112 | * 设置:商品详情 113 | */ 114 | 115 | public void setShangpinxiangqing(String shangpinxiangqing) { 116 | this.shangpinxiangqing = shangpinxiangqing; 117 | } 118 | 119 | /** 120 | * 获取:商品详情 121 | */ 122 | public String getShangpinxiangqing() { 123 | return shangpinxiangqing; 124 | } 125 | 126 | 127 | /** 128 | * 设置:活动时间 129 | */ 130 | 131 | public void setHuodongshijian(String huodongshijian) { 132 | this.huodongshijian = huodongshijian; 133 | } 134 | 135 | /** 136 | * 获取:活动时间 137 | */ 138 | public String getHuodongshijian() { 139 | return huodongshijian; 140 | } 141 | 142 | 143 | /** 144 | * 设置:活动状态 145 | */ 146 | 147 | public void setHuodongzhuangtai(String huodongzhuangtai) { 148 | this.huodongzhuangtai = huodongzhuangtai; 149 | } 150 | 151 | /** 152 | * 获取:活动状态 153 | */ 154 | public String getHuodongzhuangtai() { 155 | return huodongzhuangtai; 156 | } 157 | 158 | } 159 | -------------------------------------------------------------------------------- /src/main/java/com/entity/MessagesEntity.java: -------------------------------------------------------------------------------- 1 | package com.entity; 2 | 3 | import com.baomidou.mybatisplus.annotations.TableId; 4 | import com.baomidou.mybatisplus.annotations.TableName; 5 | import javax.validation.constraints.NotBlank; 6 | import javax.validation.constraints.NotEmpty; 7 | import javax.validation.constraints.NotNull; 8 | 9 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 10 | import java.lang.reflect.InvocationTargetException; 11 | 12 | import java.io.Serializable; 13 | import java.util.Date; 14 | import java.util.List; 15 | 16 | import org.springframework.format.annotation.DateTimeFormat; 17 | import com.fasterxml.jackson.annotation.JsonFormat; 18 | import org.apache.commons.beanutils.BeanUtils; 19 | import com.baomidou.mybatisplus.annotations.TableField; 20 | import com.baomidou.mybatisplus.enums.FieldFill; 21 | import com.baomidou.mybatisplus.enums.IdType; 22 | 23 | 24 | /** 25 | * 留言板 26 | * 数据库通用操作实体类(普通增删改查) 27 | * @author 28 | * @email 29 | * @date 2021-02-03 16:07:05 30 | */ 31 | @TableName("messages") 32 | public class MessagesEntity implements Serializable { 33 | private static final long serialVersionUID = 1L; 34 | 35 | 36 | public MessagesEntity() { 37 | 38 | } 39 | 40 | public MessagesEntity(T t) { 41 | try { 42 | BeanUtils.copyProperties(this, t); 43 | } catch (IllegalAccessException | InvocationTargetException e) { 44 | // TODO Auto-generated catch block 45 | e.printStackTrace(); 46 | } 47 | } 48 | 49 | /** 50 | * 主键id 51 | */ 52 | @TableId 53 | private Long id; 54 | /** 55 | * 留言人id 56 | */ 57 | 58 | private Long userid; 59 | 60 | /** 61 | * 用户名 62 | */ 63 | 64 | private String username; 65 | 66 | /** 67 | * 留言内容 68 | */ 69 | 70 | private String content; 71 | 72 | /** 73 | * 回复内容 74 | */ 75 | 76 | private String reply; 77 | 78 | 79 | @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") 80 | @DateTimeFormat 81 | private Date addtime; 82 | 83 | public Date getAddtime() { 84 | return addtime; 85 | } 86 | public void setAddtime(Date addtime) { 87 | this.addtime = addtime; 88 | } 89 | 90 | public Long getId() { 91 | return id; 92 | } 93 | 94 | public void setId(Long id) { 95 | this.id = id; 96 | } 97 | /** 98 | * 设置:留言人id 99 | */ 100 | public void setUserid(Long userid) { 101 | this.userid = userid; 102 | } 103 | /** 104 | * 获取:留言人id 105 | */ 106 | public Long getUserid() { 107 | return userid; 108 | } 109 | /** 110 | * 设置:用户名 111 | */ 112 | public void setUsername(String username) { 113 | this.username = username; 114 | } 115 | /** 116 | * 获取:用户名 117 | */ 118 | public String getUsername() { 119 | return username; 120 | } 121 | /** 122 | * 设置:留言内容 123 | */ 124 | public void setContent(String content) { 125 | this.content = content; 126 | } 127 | /** 128 | * 获取:留言内容 129 | */ 130 | public String getContent() { 131 | return content; 132 | } 133 | /** 134 | * 设置:回复内容 135 | */ 136 | public void setReply(String reply) { 137 | this.reply = reply; 138 | } 139 | /** 140 | * 获取:回复内容 141 | */ 142 | public String getReply() { 143 | return reply; 144 | } 145 | 146 | } 147 | -------------------------------------------------------------------------------- /src/main/java/com/entity/NewsEntity.java: -------------------------------------------------------------------------------- 1 | package com.entity; 2 | 3 | import com.baomidou.mybatisplus.annotations.TableId; 4 | import com.baomidou.mybatisplus.annotations.TableName; 5 | import javax.validation.constraints.NotBlank; 6 | import javax.validation.constraints.NotEmpty; 7 | import javax.validation.constraints.NotNull; 8 | 9 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 10 | import java.lang.reflect.InvocationTargetException; 11 | 12 | import java.io.Serializable; 13 | import java.util.Date; 14 | import java.util.List; 15 | 16 | import org.springframework.format.annotation.DateTimeFormat; 17 | import com.fasterxml.jackson.annotation.JsonFormat; 18 | import org.apache.commons.beanutils.BeanUtils; 19 | import com.baomidou.mybatisplus.annotations.TableField; 20 | import com.baomidou.mybatisplus.enums.FieldFill; 21 | import com.baomidou.mybatisplus.enums.IdType; 22 | 23 | 24 | /** 25 | * 竞拍公告 26 | * 数据库通用操作实体类(普通增删改查) 27 | * @author 28 | * @email 29 | * @date 2021-02-03 16:07:05 30 | */ 31 | @TableName("news") 32 | public class NewsEntity implements Serializable { 33 | private static final long serialVersionUID = 1L; 34 | 35 | 36 | public NewsEntity() { 37 | 38 | } 39 | 40 | public NewsEntity(T t) { 41 | try { 42 | BeanUtils.copyProperties(this, t); 43 | } catch (IllegalAccessException | InvocationTargetException e) { 44 | // TODO Auto-generated catch block 45 | e.printStackTrace(); 46 | } 47 | } 48 | 49 | /** 50 | * 主键id 51 | */ 52 | @TableId 53 | private Long id; 54 | /** 55 | * 标题 56 | */ 57 | 58 | private String title; 59 | 60 | /** 61 | * 简介 62 | */ 63 | 64 | private String introduction; 65 | 66 | /** 67 | * 图片 68 | */ 69 | 70 | private String picture; 71 | 72 | /** 73 | * 内容 74 | */ 75 | 76 | private String content; 77 | 78 | 79 | @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") 80 | @DateTimeFormat 81 | private Date addtime; 82 | 83 | public Date getAddtime() { 84 | return addtime; 85 | } 86 | public void setAddtime(Date addtime) { 87 | this.addtime = addtime; 88 | } 89 | 90 | public Long getId() { 91 | return id; 92 | } 93 | 94 | public void setId(Long id) { 95 | this.id = id; 96 | } 97 | /** 98 | * 设置:标题 99 | */ 100 | public void setTitle(String title) { 101 | this.title = title; 102 | } 103 | /** 104 | * 获取:标题 105 | */ 106 | public String getTitle() { 107 | return title; 108 | } 109 | /** 110 | * 设置:简介 111 | */ 112 | public void setIntroduction(String introduction) { 113 | this.introduction = introduction; 114 | } 115 | /** 116 | * 获取:简介 117 | */ 118 | public String getIntroduction() { 119 | return introduction; 120 | } 121 | /** 122 | * 设置:图片 123 | */ 124 | public void setPicture(String picture) { 125 | this.picture = picture; 126 | } 127 | /** 128 | * 获取:图片 129 | */ 130 | public String getPicture() { 131 | return picture; 132 | } 133 | /** 134 | * 设置:内容 135 | */ 136 | public void setContent(String content) { 137 | this.content = content; 138 | } 139 | /** 140 | * 获取:内容 141 | */ 142 | public String getContent() { 143 | return content; 144 | } 145 | 146 | } 147 | -------------------------------------------------------------------------------- /src/main/java/com/entity/vo/YonghuVO.java: -------------------------------------------------------------------------------- 1 | package com.entity.vo; 2 | 3 | import com.entity.YonghuEntity; 4 | 5 | import com.baomidou.mybatisplus.annotations.TableName; 6 | import java.util.Date; 7 | import org.springframework.format.annotation.DateTimeFormat; 8 | 9 | import com.fasterxml.jackson.annotation.JsonFormat; 10 | import java.io.Serializable; 11 | 12 | 13 | /** 14 | * 用户 15 | * 手机端接口返回实体辅助类 16 | * (主要作用去除一些不必要的字段) 17 | * @author 18 | * @email 19 | * @date 2021-02-03 16:07:05 20 | */ 21 | public class YonghuVO implements Serializable { 22 | private static final long serialVersionUID = 1L; 23 | 24 | 25 | /** 26 | * 密码 27 | */ 28 | 29 | private String mima; 30 | 31 | /** 32 | * 姓名 33 | */ 34 | 35 | private String xingming; 36 | 37 | /** 38 | * 性别 39 | */ 40 | 41 | private String xingbie; 42 | 43 | /** 44 | * 头像 45 | */ 46 | 47 | private String touxiang; 48 | 49 | /** 50 | * 身份证 51 | */ 52 | 53 | private String shenfenzheng; 54 | 55 | /** 56 | * 手机 57 | */ 58 | 59 | private String shouji; 60 | 61 | /** 62 | * 邮箱 63 | */ 64 | 65 | private String youxiang; 66 | 67 | /** 68 | * 地址 69 | */ 70 | 71 | private String dizhi; 72 | 73 | 74 | /** 75 | * 设置:密码 76 | */ 77 | 78 | public void setMima(String mima) { 79 | this.mima = mima; 80 | } 81 | 82 | /** 83 | * 获取:密码 84 | */ 85 | public String getMima() { 86 | return mima; 87 | } 88 | 89 | 90 | /** 91 | * 设置:姓名 92 | */ 93 | 94 | public void setXingming(String xingming) { 95 | this.xingming = xingming; 96 | } 97 | 98 | /** 99 | * 获取:姓名 100 | */ 101 | public String getXingming() { 102 | return xingming; 103 | } 104 | 105 | 106 | /** 107 | * 设置:性别 108 | */ 109 | 110 | public void setXingbie(String xingbie) { 111 | this.xingbie = xingbie; 112 | } 113 | 114 | /** 115 | * 获取:性别 116 | */ 117 | public String getXingbie() { 118 | return xingbie; 119 | } 120 | 121 | 122 | /** 123 | * 设置:头像 124 | */ 125 | 126 | public void setTouxiang(String touxiang) { 127 | this.touxiang = touxiang; 128 | } 129 | 130 | /** 131 | * 获取:头像 132 | */ 133 | public String getTouxiang() { 134 | return touxiang; 135 | } 136 | 137 | 138 | /** 139 | * 设置:身份证 140 | */ 141 | 142 | public void setShenfenzheng(String shenfenzheng) { 143 | this.shenfenzheng = shenfenzheng; 144 | } 145 | 146 | /** 147 | * 获取:身份证 148 | */ 149 | public String getShenfenzheng() { 150 | return shenfenzheng; 151 | } 152 | 153 | 154 | /** 155 | * 设置:手机 156 | */ 157 | 158 | public void setShouji(String shouji) { 159 | this.shouji = shouji; 160 | } 161 | 162 | /** 163 | * 获取:手机 164 | */ 165 | public String getShouji() { 166 | return shouji; 167 | } 168 | 169 | 170 | /** 171 | * 设置:邮箱 172 | */ 173 | 174 | public void setYouxiang(String youxiang) { 175 | this.youxiang = youxiang; 176 | } 177 | 178 | /** 179 | * 获取:邮箱 180 | */ 181 | public String getYouxiang() { 182 | return youxiang; 183 | } 184 | 185 | 186 | /** 187 | * 设置:地址 188 | */ 189 | 190 | public void setDizhi(String dizhi) { 191 | this.dizhi = dizhi; 192 | } 193 | 194 | /** 195 | * 获取:地址 196 | */ 197 | public String getDizhi() { 198 | return dizhi; 199 | } 200 | 201 | } 202 | -------------------------------------------------------------------------------- /src/main/java/com/entity/model/YonghuModel.java: -------------------------------------------------------------------------------- 1 | package com.entity.model; 2 | 3 | import com.entity.YonghuEntity; 4 | 5 | import com.baomidou.mybatisplus.annotations.TableName; 6 | import java.util.Date; 7 | import org.springframework.format.annotation.DateTimeFormat; 8 | 9 | import com.fasterxml.jackson.annotation.JsonFormat; 10 | import java.io.Serializable; 11 | 12 | 13 | /** 14 | * 用户 15 | * 接收传参的实体类 16 | *(实际开发中配合移动端接口开发手动去掉些没用的字段, 后端一般用entity就够用了) 17 | * 取自ModelAndView 的model名称 18 | * @author 19 | * @email 20 | * @date 2021-02-03 16:07:05 21 | */ 22 | public class YonghuModel implements Serializable { 23 | private static final long serialVersionUID = 1L; 24 | 25 | 26 | /** 27 | * 密码 28 | */ 29 | 30 | private String mima; 31 | 32 | /** 33 | * 姓名 34 | */ 35 | 36 | private String xingming; 37 | 38 | /** 39 | * 性别 40 | */ 41 | 42 | private String xingbie; 43 | 44 | /** 45 | * 头像 46 | */ 47 | 48 | private String touxiang; 49 | 50 | /** 51 | * 身份证 52 | */ 53 | 54 | private String shenfenzheng; 55 | 56 | /** 57 | * 手机 58 | */ 59 | 60 | private String shouji; 61 | 62 | /** 63 | * 邮箱 64 | */ 65 | 66 | private String youxiang; 67 | 68 | /** 69 | * 地址 70 | */ 71 | 72 | private String dizhi; 73 | 74 | 75 | /** 76 | * 设置:密码 77 | */ 78 | 79 | public void setMima(String mima) { 80 | this.mima = mima; 81 | } 82 | 83 | /** 84 | * 获取:密码 85 | */ 86 | public String getMima() { 87 | return mima; 88 | } 89 | 90 | 91 | /** 92 | * 设置:姓名 93 | */ 94 | 95 | public void setXingming(String xingming) { 96 | this.xingming = xingming; 97 | } 98 | 99 | /** 100 | * 获取:姓名 101 | */ 102 | public String getXingming() { 103 | return xingming; 104 | } 105 | 106 | 107 | /** 108 | * 设置:性别 109 | */ 110 | 111 | public void setXingbie(String xingbie) { 112 | this.xingbie = xingbie; 113 | } 114 | 115 | /** 116 | * 获取:性别 117 | */ 118 | public String getXingbie() { 119 | return xingbie; 120 | } 121 | 122 | 123 | /** 124 | * 设置:头像 125 | */ 126 | 127 | public void setTouxiang(String touxiang) { 128 | this.touxiang = touxiang; 129 | } 130 | 131 | /** 132 | * 获取:头像 133 | */ 134 | public String getTouxiang() { 135 | return touxiang; 136 | } 137 | 138 | 139 | /** 140 | * 设置:身份证 141 | */ 142 | 143 | public void setShenfenzheng(String shenfenzheng) { 144 | this.shenfenzheng = shenfenzheng; 145 | } 146 | 147 | /** 148 | * 获取:身份证 149 | */ 150 | public String getShenfenzheng() { 151 | return shenfenzheng; 152 | } 153 | 154 | 155 | /** 156 | * 设置:手机 157 | */ 158 | 159 | public void setShouji(String shouji) { 160 | this.shouji = shouji; 161 | } 162 | 163 | /** 164 | * 获取:手机 165 | */ 166 | public String getShouji() { 167 | return shouji; 168 | } 169 | 170 | 171 | /** 172 | * 设置:邮箱 173 | */ 174 | 175 | public void setYouxiang(String youxiang) { 176 | this.youxiang = youxiang; 177 | } 178 | 179 | /** 180 | * 获取:邮箱 181 | */ 182 | public String getYouxiang() { 183 | return youxiang; 184 | } 185 | 186 | 187 | /** 188 | * 设置:地址 189 | */ 190 | 191 | public void setDizhi(String dizhi) { 192 | this.dizhi = dizhi; 193 | } 194 | 195 | /** 196 | * 获取:地址 197 | */ 198 | public String getDizhi() { 199 | return dizhi; 200 | } 201 | 202 | } 203 | -------------------------------------------------------------------------------- /src/main/java/com/controller/ConfigController.java: -------------------------------------------------------------------------------- 1 | 2 | package com.controller; 3 | 4 | 5 | import java.util.Arrays; 6 | import java.util.Map; 7 | 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.web.bind.annotation.PathVariable; 10 | import org.springframework.web.bind.annotation.PostMapping; 11 | import org.springframework.web.bind.annotation.RequestBody; 12 | import org.springframework.web.bind.annotation.RequestMapping; 13 | import org.springframework.web.bind.annotation.RequestParam; 14 | import org.springframework.web.bind.annotation.RestController; 15 | 16 | import com.annotation.IgnoreAuth; 17 | import com.baomidou.mybatisplus.mapper.EntityWrapper; 18 | import com.entity.ConfigEntity; 19 | import com.service.ConfigService; 20 | import com.utils.PageUtils; 21 | import com.utils.R; 22 | import com.utils.ValidatorUtils; 23 | 24 | /** 25 | * 登录相关 26 | */ 27 | @RequestMapping("config") 28 | @RestController 29 | public class ConfigController{ 30 | 31 | @Autowired 32 | private ConfigService configService; 33 | 34 | /** 35 | * 列表 36 | */ 37 | @RequestMapping("/page") 38 | public R page(@RequestParam Map params,ConfigEntity config){ 39 | EntityWrapper ew = new EntityWrapper(); 40 | PageUtils page = configService.queryPage(params); 41 | return R.ok().put("data", page); 42 | } 43 | 44 | /** 45 | * 列表 46 | */ 47 | @IgnoreAuth 48 | @RequestMapping("/list") 49 | public R list(@RequestParam Map params,ConfigEntity config){ 50 | EntityWrapper ew = new EntityWrapper(); 51 | PageUtils page = configService.queryPage(params); 52 | return R.ok().put("data", page); 53 | } 54 | 55 | /** 56 | * 信息 57 | */ 58 | @RequestMapping("/info/{id}") 59 | public R info(@PathVariable("id") String id){ 60 | ConfigEntity config = configService.selectById(id); 61 | return R.ok().put("data", config); 62 | } 63 | 64 | /** 65 | * 详情 66 | */ 67 | @IgnoreAuth 68 | @RequestMapping("/detail/{id}") 69 | public R detail(@PathVariable("id") String id){ 70 | ConfigEntity config = configService.selectById(id); 71 | return R.ok().put("data", config); 72 | } 73 | 74 | /** 75 | * 根据name获取信息 76 | */ 77 | @RequestMapping("/info") 78 | public R infoByName(@RequestParam String name){ 79 | ConfigEntity config = configService.selectOne(new EntityWrapper().eq("name", "faceFile")); 80 | return R.ok().put("data", config); 81 | } 82 | 83 | /** 84 | * 保存 85 | */ 86 | @PostMapping("/save") 87 | public R save(@RequestBody ConfigEntity config){ 88 | // ValidatorUtils.validateEntity(config); 89 | configService.insert(config); 90 | return R.ok(); 91 | } 92 | 93 | /** 94 | * 修改 95 | */ 96 | @RequestMapping("/update") 97 | public R update(@RequestBody ConfigEntity config){ 98 | // ValidatorUtils.validateEntity(config); 99 | configService.updateById(config);//全部更新 100 | return R.ok(); 101 | } 102 | 103 | /** 104 | * 删除 105 | */ 106 | @RequestMapping("/delete") 107 | public R delete(@RequestBody Long[] ids){ 108 | configService.deleteBatchIds(Arrays.asList(ids)); 109 | return R.ok(); 110 | } 111 | } 112 | -------------------------------------------------------------------------------- /src/main/java/com/interceptor/AuthorizationInterceptor.java: -------------------------------------------------------------------------------- 1 | package com.interceptor; 2 | 3 | import java.io.IOException; 4 | import java.io.PrintWriter; 5 | import java.util.HashMap; 6 | import java.util.Map; 7 | import com.alibaba.fastjson.JSONObject; 8 | import javax.servlet.http.HttpServletRequest; 9 | import javax.servlet.http.HttpServletResponse; 10 | 11 | import org.apache.commons.lang3.StringUtils; 12 | import org.springframework.beans.factory.annotation.Autowired; 13 | import org.springframework.stereotype.Component; 14 | import org.springframework.web.method.HandlerMethod; 15 | import org.springframework.web.servlet.HandlerInterceptor; 16 | import org.springframework.web.bind.annotation.RequestMethod; 17 | import org.springframework.http.HttpStatus; 18 | 19 | import com.annotation.IgnoreAuth; 20 | import com.entity.EIException; 21 | import com.entity.TokenEntity; 22 | import com.service.TokenService; 23 | import com.utils.R; 24 | 25 | /** 26 | * 权限(Token)验证 27 | */ 28 | @Component 29 | public class AuthorizationInterceptor implements HandlerInterceptor { 30 | 31 | public static final String LOGIN_TOKEN_KEY = "Token"; 32 | 33 | @Autowired 34 | private TokenService tokenService; 35 | 36 | @Override 37 | public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { 38 | 39 | //支持跨域请求 40 | response.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE"); 41 | response.setHeader("Access-Control-Max-Age", "3600"); 42 | response.setHeader("Access-Control-Allow-Credentials", "true"); 43 | response.setHeader("Access-Control-Allow-Headers", "x-requested-with,request-source,Token, Origin,imgType, Content-Type, cache-control,postman-token,Cookie, Accept,authorization"); 44 | response.setHeader("Access-Control-Allow-Origin", request.getHeader("Origin")); 45 | // 跨域时会首先发送一个OPTIONS请求,这里我们给OPTIONS请求直接返回正常状态 46 | if (request.getMethod().equals(RequestMethod.OPTIONS.name())) { 47 | response.setStatus(HttpStatus.OK.value()); 48 | return false; 49 | } 50 | 51 | IgnoreAuth annotation; 52 | if (handler instanceof HandlerMethod) { 53 | annotation = ((HandlerMethod) handler).getMethodAnnotation(IgnoreAuth.class); 54 | } else { 55 | return true; 56 | } 57 | 58 | //从header中获取token 59 | String token = request.getHeader(LOGIN_TOKEN_KEY); 60 | 61 | /** 62 | * 不需要验证权限的方法直接放过 63 | */ 64 | if(annotation!=null) { 65 | return true; 66 | } 67 | 68 | TokenEntity tokenEntity = null; 69 | if(StringUtils.isNotBlank(token)) { 70 | tokenEntity = tokenService.getTokenEntity(token); 71 | } 72 | 73 | if(tokenEntity != null) { 74 | request.getSession().setAttribute("userId", tokenEntity.getUserid()); 75 | request.getSession().setAttribute("role", tokenEntity.getRole()); 76 | request.getSession().setAttribute("tableName", tokenEntity.getTablename()); 77 | request.getSession().setAttribute("username", tokenEntity.getUsername()); 78 | return true; 79 | } 80 | 81 | PrintWriter writer = null; 82 | response.setCharacterEncoding("UTF-8"); 83 | response.setContentType("application/json; charset=utf-8"); 84 | try { 85 | writer = response.getWriter(); 86 | writer.print(JSONObject.toJSONString(R.error(401, "请先登录"))); 87 | } finally { 88 | if(writer != null){ 89 | writer.close(); 90 | } 91 | } 92 | // throw new EIException("请先登录", 401); 93 | return false; 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /src/main/java/com/utils/BaiduUtil.java: -------------------------------------------------------------------------------- 1 | package com.utils; 2 | 3 | import java.io.BufferedReader; 4 | import java.io.InputStreamReader; 5 | import java.net.HttpURLConnection; 6 | import java.net.URL; 7 | import java.util.HashMap; 8 | import java.util.List; 9 | import java.util.Map; 10 | 11 | import org.json.JSONObject; 12 | 13 | 14 | /** 15 | * 类说明 : 16 | */ 17 | 18 | public class BaiduUtil { 19 | 20 | /** 21 | * 根据经纬度获得省市区信息 22 | * @param lon 纬度 23 | * @param lat 经度 24 | * @param coordtype 经纬度坐标系 25 | * @return 26 | */ 27 | public static Map getCityByLonLat(String key, String lng, String lat) { 28 | String location = lat + "," + lng; 29 | try { 30 | //拼装url 31 | String url = "http://api.map.baidu.com/reverse_geocoding/v3/?ak="+key+"&output=json&coordtype=wgs84ll&location="+location; 32 | String result = HttpClientUtils.doGet(url); 33 | JSONObject o = new JSONObject(result); 34 | Map area = new HashMap<>(); 35 | area.put("province", o.getJSONObject("result").getJSONObject("addressComponent").getString("province")); 36 | area.put("city", o.getJSONObject("result").getJSONObject("addressComponent").getString("city")); 37 | area.put("district", o.getJSONObject("result").getJSONObject("addressComponent").getString("district")); 38 | area.put("street", o.getJSONObject("result").getJSONObject("addressComponent").getString("street")); 39 | return area; 40 | }catch (Exception e) { 41 | e.printStackTrace(); 42 | } 43 | return null; 44 | } 45 | 46 | /** 47 | * 获取API访问token 48 | * 该token有一定的有效期,需要自行管理,当失效时需重新获取. 49 | * @param ak - 百度云官网获取的 API Key 50 | * @param sk - 百度云官网获取的 Securet Key 51 | * @return assess_token 52 | */ 53 | public static String getAuth(String ak, String sk) { 54 | // 获取token地址 55 | String authHost = "https://aip.baidubce.com/oauth/2.0/token?"; 56 | String getAccessTokenUrl = authHost 57 | // 1. grant_type为固定参数 58 | + "grant_type=client_credentials" 59 | // 2. 官网获取的 API Key 60 | + "&client_id=" + ak 61 | // 3. 官网获取的 Secret Key 62 | + "&client_secret=" + sk; 63 | try { 64 | URL realUrl = new URL(getAccessTokenUrl); 65 | // 打开和URL之间的连接 66 | HttpURLConnection connection = (HttpURLConnection) realUrl.openConnection(); 67 | connection.setRequestMethod("GET"); 68 | connection.connect(); 69 | // 获取所有响应头字段 70 | Map> map = connection.getHeaderFields(); 71 | // 遍历所有的响应头字段 72 | for (String key : map.keySet()) { 73 | System.err.println(key + "--->" + map.get(key)); 74 | } 75 | // 定义 BufferedReader输入流来读取URL的响应 76 | BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream())); 77 | String result = ""; 78 | String line; 79 | while ((line = in.readLine()) != null) { 80 | result += line; 81 | } 82 | /** 83 | * 返回结果示例 84 | */ 85 | System.err.println("result:" + result); 86 | org.json.JSONObject jsonObject = new org.json.JSONObject(result); 87 | String access_token = jsonObject.getString("access_token"); 88 | return access_token; 89 | } catch (Exception e) { 90 | System.err.printf("获取token失败!"); 91 | e.printStackTrace(System.err); 92 | } 93 | return null; 94 | } 95 | 96 | } 97 | -------------------------------------------------------------------------------- /src/main/java/com/entity/vo/LishijingpaiVO.java: -------------------------------------------------------------------------------- 1 | package com.entity.vo; 2 | 3 | import com.entity.LishijingpaiEntity; 4 | 5 | import com.baomidou.mybatisplus.annotations.TableName; 6 | import java.util.Date; 7 | import org.springframework.format.annotation.DateTimeFormat; 8 | 9 | import com.fasterxml.jackson.annotation.JsonFormat; 10 | import java.io.Serializable; 11 | 12 | 13 | /** 14 | * 历史竞拍 15 | * 手机端接口返回实体辅助类 16 | * (主要作用去除一些不必要的字段) 17 | * @author 18 | * @email 19 | * @date 2021-02-03 16:07:05 20 | */ 21 | public class LishijingpaiVO implements Serializable { 22 | private static final long serialVersionUID = 1L; 23 | 24 | 25 | /** 26 | * 商品类型 27 | */ 28 | 29 | private String shangpinleixing; 30 | 31 | /** 32 | * 日期 33 | */ 34 | 35 | @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") 36 | @DateTimeFormat 37 | private Date riqi; 38 | 39 | /** 40 | * 价格 41 | */ 42 | 43 | private Integer jiage; 44 | 45 | /** 46 | * 用户名 47 | */ 48 | 49 | private String yonghuming; 50 | 51 | /** 52 | * 姓名 53 | */ 54 | 55 | private String xingming; 56 | 57 | /** 58 | * 手机 59 | */ 60 | 61 | private String shouji; 62 | 63 | /** 64 | * 地址 65 | */ 66 | 67 | private String dizhi; 68 | 69 | /** 70 | * 是否审核 71 | */ 72 | 73 | private String sfsh; 74 | 75 | /** 76 | * 审核回复 77 | */ 78 | 79 | private String shhf; 80 | 81 | 82 | /** 83 | * 设置:商品类型 84 | */ 85 | 86 | public void setShangpinleixing(String shangpinleixing) { 87 | this.shangpinleixing = shangpinleixing; 88 | } 89 | 90 | /** 91 | * 获取:商品类型 92 | */ 93 | public String getShangpinleixing() { 94 | return shangpinleixing; 95 | } 96 | 97 | 98 | /** 99 | * 设置:日期 100 | */ 101 | 102 | public void setRiqi(Date riqi) { 103 | this.riqi = riqi; 104 | } 105 | 106 | /** 107 | * 获取:日期 108 | */ 109 | public Date getRiqi() { 110 | return riqi; 111 | } 112 | 113 | 114 | /** 115 | * 设置:价格 116 | */ 117 | 118 | public void setJiage(Integer jiage) { 119 | this.jiage = jiage; 120 | } 121 | 122 | /** 123 | * 获取:价格 124 | */ 125 | public Integer getJiage() { 126 | return jiage; 127 | } 128 | 129 | 130 | /** 131 | * 设置:用户名 132 | */ 133 | 134 | public void setYonghuming(String yonghuming) { 135 | this.yonghuming = yonghuming; 136 | } 137 | 138 | /** 139 | * 获取:用户名 140 | */ 141 | public String getYonghuming() { 142 | return yonghuming; 143 | } 144 | 145 | 146 | /** 147 | * 设置:姓名 148 | */ 149 | 150 | public void setXingming(String xingming) { 151 | this.xingming = xingming; 152 | } 153 | 154 | /** 155 | * 获取:姓名 156 | */ 157 | public String getXingming() { 158 | return xingming; 159 | } 160 | 161 | 162 | /** 163 | * 设置:手机 164 | */ 165 | 166 | public void setShouji(String shouji) { 167 | this.shouji = shouji; 168 | } 169 | 170 | /** 171 | * 获取:手机 172 | */ 173 | public String getShouji() { 174 | return shouji; 175 | } 176 | 177 | 178 | /** 179 | * 设置:地址 180 | */ 181 | 182 | public void setDizhi(String dizhi) { 183 | this.dizhi = dizhi; 184 | } 185 | 186 | /** 187 | * 获取:地址 188 | */ 189 | public String getDizhi() { 190 | return dizhi; 191 | } 192 | 193 | 194 | /** 195 | * 设置:是否审核 196 | */ 197 | 198 | public void setSfsh(String sfsh) { 199 | this.sfsh = sfsh; 200 | } 201 | 202 | /** 203 | * 获取:是否审核 204 | */ 205 | public String getSfsh() { 206 | return sfsh; 207 | } 208 | 209 | 210 | /** 211 | * 设置:审核回复 212 | */ 213 | 214 | public void setShhf(String shhf) { 215 | this.shhf = shhf; 216 | } 217 | 218 | /** 219 | * 获取:审核回复 220 | */ 221 | public String getShhf() { 222 | return shhf; 223 | } 224 | 225 | } 226 | -------------------------------------------------------------------------------- /src/main/java/com/entity/model/LishijingpaiModel.java: -------------------------------------------------------------------------------- 1 | package com.entity.model; 2 | 3 | import com.entity.LishijingpaiEntity; 4 | 5 | import com.baomidou.mybatisplus.annotations.TableName; 6 | import java.util.Date; 7 | import org.springframework.format.annotation.DateTimeFormat; 8 | 9 | import com.fasterxml.jackson.annotation.JsonFormat; 10 | import java.io.Serializable; 11 | 12 | 13 | /** 14 | * 历史竞拍 15 | * 接收传参的实体类 16 | *(实际开发中配合移动端接口开发手动去掉些没用的字段, 后端一般用entity就够用了) 17 | * 取自ModelAndView 的model名称 18 | * @author 19 | * @email 20 | * @date 2021-02-03 16:07:05 21 | */ 22 | public class LishijingpaiModel implements Serializable { 23 | private static final long serialVersionUID = 1L; 24 | 25 | 26 | /** 27 | * 商品类型 28 | */ 29 | 30 | private String shangpinleixing; 31 | 32 | /** 33 | * 日期 34 | */ 35 | 36 | @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") 37 | @DateTimeFormat 38 | private Date riqi; 39 | 40 | /** 41 | * 价格 42 | */ 43 | 44 | private Integer jiage; 45 | 46 | /** 47 | * 用户名 48 | */ 49 | 50 | private String yonghuming; 51 | 52 | /** 53 | * 姓名 54 | */ 55 | 56 | private String xingming; 57 | 58 | /** 59 | * 手机 60 | */ 61 | 62 | private String shouji; 63 | 64 | /** 65 | * 地址 66 | */ 67 | 68 | private String dizhi; 69 | 70 | /** 71 | * 是否审核 72 | */ 73 | 74 | private String sfsh; 75 | 76 | /** 77 | * 审核回复 78 | */ 79 | 80 | private String shhf; 81 | 82 | 83 | /** 84 | * 设置:商品类型 85 | */ 86 | 87 | public void setShangpinleixing(String shangpinleixing) { 88 | this.shangpinleixing = shangpinleixing; 89 | } 90 | 91 | /** 92 | * 获取:商品类型 93 | */ 94 | public String getShangpinleixing() { 95 | return shangpinleixing; 96 | } 97 | 98 | 99 | /** 100 | * 设置:日期 101 | */ 102 | 103 | public void setRiqi(Date riqi) { 104 | this.riqi = riqi; 105 | } 106 | 107 | /** 108 | * 获取:日期 109 | */ 110 | public Date getRiqi() { 111 | return riqi; 112 | } 113 | 114 | 115 | /** 116 | * 设置:价格 117 | */ 118 | 119 | public void setJiage(Integer jiage) { 120 | this.jiage = jiage; 121 | } 122 | 123 | /** 124 | * 获取:价格 125 | */ 126 | public Integer getJiage() { 127 | return jiage; 128 | } 129 | 130 | 131 | /** 132 | * 设置:用户名 133 | */ 134 | 135 | public void setYonghuming(String yonghuming) { 136 | this.yonghuming = yonghuming; 137 | } 138 | 139 | /** 140 | * 获取:用户名 141 | */ 142 | public String getYonghuming() { 143 | return yonghuming; 144 | } 145 | 146 | 147 | /** 148 | * 设置:姓名 149 | */ 150 | 151 | public void setXingming(String xingming) { 152 | this.xingming = xingming; 153 | } 154 | 155 | /** 156 | * 获取:姓名 157 | */ 158 | public String getXingming() { 159 | return xingming; 160 | } 161 | 162 | 163 | /** 164 | * 设置:手机 165 | */ 166 | 167 | public void setShouji(String shouji) { 168 | this.shouji = shouji; 169 | } 170 | 171 | /** 172 | * 获取:手机 173 | */ 174 | public String getShouji() { 175 | return shouji; 176 | } 177 | 178 | 179 | /** 180 | * 设置:地址 181 | */ 182 | 183 | public void setDizhi(String dizhi) { 184 | this.dizhi = dizhi; 185 | } 186 | 187 | /** 188 | * 获取:地址 189 | */ 190 | public String getDizhi() { 191 | return dizhi; 192 | } 193 | 194 | 195 | /** 196 | * 设置:是否审核 197 | */ 198 | 199 | public void setSfsh(String sfsh) { 200 | this.sfsh = sfsh; 201 | } 202 | 203 | /** 204 | * 获取:是否审核 205 | */ 206 | public String getSfsh() { 207 | return sfsh; 208 | } 209 | 210 | 211 | /** 212 | * 设置:审核回复 213 | */ 214 | 215 | public void setShhf(String shhf) { 216 | this.shhf = shhf; 217 | } 218 | 219 | /** 220 | * 获取:审核回复 221 | */ 222 | public String getShhf() { 223 | return shhf; 224 | } 225 | 226 | } 227 | -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | org.springframework.boot 7 | spring-boot-starter-parent 8 | 2.2.2.RELEASE 9 | 10 | 11 | com.jlwl 12 | 13 | springbootp0eo6 14 | 0.0.1-SNAPSHOT 15 | springboot-schema 16 | springboot学习框架 17 | 18 | 19 | 1.8 20 | 1.2.8 21 | 3.1.1 22 | 23 | 24 | 25 | 26 | org.springframework.boot 27 | spring-boot-starter-web 28 | 29 | 30 | org.mybatis.spring.boot 31 | mybatis-spring-boot-starter 32 | 2.1.1 33 | 34 | 35 | org.springframework.boot 36 | spring-boot-starter-jdbc 37 | 38 | 39 | 40 | mysql 41 | mysql-connector-java 42 | 43 | 44 | org.apache.shiro 45 | shiro-spring 46 | 1.3.2 47 | 48 | 49 | 50 | com.baomidou 51 | mybatis-plus 52 | 2.3 53 | 54 | 55 | com.baomidou 56 | mybatisplus-spring-boot-starter 57 | 1.0.5 58 | 59 | 60 | com.google.protobuf 61 | protobuf-java 62 | 3.10.0 63 | 64 | 65 | 66 | org.apache.commons 67 | commons-lang3 68 | 3.0 69 | 70 | 71 | 72 | javax.validation 73 | validation-api 74 | 2.0.1.Final 75 | 76 | 77 | 78 | commons-io 79 | commons-io 80 | 2.5 81 | 82 | 83 | 84 | 85 | cn.hutool 86 | hutool-all 87 | 4.0.12 88 | 89 | 90 | 91 | 92 | com.alibaba 93 | fastjson 94 | ${fastjson.version} 95 | 96 | 97 | 98 | com.baidu.aip 99 | java-sdk 100 | 4.4.1 101 | 102 | 103 | 104 | org.springframework.boot 105 | spring-boot-starter-test 106 | test 107 | 108 | 109 | org.junit.vintage 110 | junit-vintage-engine 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | org.springframework.boot 120 | spring-boot-maven-plugin 121 | 122 | 123 | 124 | 125 | 126 | -------------------------------------------------------------------------------- /src/main/java/com/controller/FileController.java: -------------------------------------------------------------------------------- 1 | package com.controller; 2 | 3 | import java.io.File; 4 | import java.io.FileNotFoundException; 5 | import java.io.IOException; 6 | import java.util.Arrays; 7 | import java.util.Date; 8 | import java.util.HashMap; 9 | import java.util.List; 10 | import java.util.Map; 11 | import java.util.Random; 12 | import java.util.UUID; 13 | 14 | import org.apache.commons.io.FileUtils; 15 | import org.apache.commons.lang3.StringUtils; 16 | import org.springframework.beans.factory.annotation.Autowired; 17 | import org.springframework.http.HttpHeaders; 18 | import org.springframework.http.HttpStatus; 19 | import org.springframework.http.MediaType; 20 | import org.springframework.http.ResponseEntity; 21 | import org.springframework.util.ResourceUtils; 22 | import org.springframework.web.bind.annotation.PathVariable; 23 | import org.springframework.web.bind.annotation.RequestBody; 24 | import org.springframework.web.bind.annotation.RequestMapping; 25 | import org.springframework.web.bind.annotation.RequestParam; 26 | import org.springframework.web.bind.annotation.RestController; 27 | import org.springframework.web.multipart.MultipartFile; 28 | 29 | import com.annotation.IgnoreAuth; 30 | import com.baomidou.mybatisplus.mapper.EntityWrapper; 31 | import com.entity.ConfigEntity; 32 | import com.entity.EIException; 33 | import com.service.ConfigService; 34 | import com.utils.R; 35 | 36 | /** 37 | * 上传文件映射表 38 | */ 39 | @RestController 40 | @RequestMapping("file") 41 | @SuppressWarnings({"unchecked","rawtypes"}) 42 | public class FileController{ 43 | @Autowired 44 | private ConfigService configService; 45 | /** 46 | * 上传文件 47 | */ 48 | @RequestMapping("/upload") 49 | public R upload(@RequestParam("file") MultipartFile file,String type) throws Exception { 50 | if (file.isEmpty()) { 51 | throw new EIException("上传文件不能为空"); 52 | } 53 | String fileExt = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")+1); 54 | File path = new File(ResourceUtils.getURL("classpath:static").getPath()); 55 | if(!path.exists()) { 56 | path = new File(""); 57 | } 58 | File upload = new File(path.getAbsolutePath(),"/upload/"); 59 | if(!upload.exists()) { 60 | upload.mkdirs(); 61 | } 62 | String fileName = new Date().getTime()+"."+fileExt; 63 | File dest = new File(upload.getAbsolutePath()+"/"+fileName); 64 | file.transferTo(dest); 65 | if(StringUtils.isNotBlank(type) && type.equals("1")) { 66 | ConfigEntity configEntity = configService.selectOne(new EntityWrapper().eq("name", "faceFile")); 67 | if(configEntity==null) { 68 | configEntity = new ConfigEntity(); 69 | configEntity.setName("faceFile"); 70 | configEntity.setValue(fileName); 71 | } else { 72 | configEntity.setValue(fileName); 73 | } 74 | configService.insertOrUpdate(configEntity); 75 | } 76 | return R.ok().put("file", fileName); 77 | } 78 | 79 | /** 80 | * 下载文件 81 | */ 82 | @IgnoreAuth 83 | @RequestMapping("/download") 84 | public ResponseEntity download(@RequestParam String fileName) { 85 | try { 86 | File path = new File(ResourceUtils.getURL("classpath:static").getPath()); 87 | if(!path.exists()) { 88 | path = new File(""); 89 | } 90 | File upload = new File(path.getAbsolutePath(),"/upload/"); 91 | if(!upload.exists()) { 92 | upload.mkdirs(); 93 | } 94 | File file = new File(upload.getAbsolutePath()+"/"+fileName); 95 | if(file.exists()){ 96 | /*if(!fileService.canRead(file, SessionManager.getSessionUser())){ 97 | getResponse().sendError(403); 98 | }*/ 99 | HttpHeaders headers = new HttpHeaders(); 100 | headers.setContentType(MediaType.APPLICATION_OCTET_STREAM); 101 | headers.setContentDispositionFormData("attachment", fileName); 102 | return new ResponseEntity(FileUtils.readFileToByteArray(file),headers, HttpStatus.CREATED); 103 | } 104 | } catch (IOException e) { 105 | e.printStackTrace(); 106 | } 107 | return new ResponseEntity(HttpStatus.INTERNAL_SERVER_ERROR); 108 | } 109 | 110 | } 111 | -------------------------------------------------------------------------------- /src/main/java/com/entity/vo/JingpaidingdanVO.java: -------------------------------------------------------------------------------- 1 | package com.entity.vo; 2 | 3 | import com.entity.JingpaidingdanEntity; 4 | 5 | import com.baomidou.mybatisplus.annotations.TableName; 6 | import java.util.Date; 7 | import org.springframework.format.annotation.DateTimeFormat; 8 | 9 | import com.fasterxml.jackson.annotation.JsonFormat; 10 | import java.io.Serializable; 11 | 12 | 13 | /** 14 | * 竞拍订单 15 | * 手机端接口返回实体辅助类 16 | * (主要作用去除一些不必要的字段) 17 | * @author 18 | * @email 19 | * @date 2021-02-03 16:07:05 20 | */ 21 | public class JingpaidingdanVO implements Serializable { 22 | private static final long serialVersionUID = 1L; 23 | 24 | 25 | /** 26 | * 商品名称 27 | */ 28 | 29 | private String shangpinmingcheng; 30 | 31 | /** 32 | * 商品类型 33 | */ 34 | 35 | private String shangpinleixing; 36 | 37 | /** 38 | * 成交价格 39 | */ 40 | 41 | private Integer chengjiaojiage; 42 | 43 | /** 44 | * 发布日期 45 | */ 46 | 47 | @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") 48 | @DateTimeFormat 49 | private Date faburiqi; 50 | 51 | /** 52 | * 用户名 53 | */ 54 | 55 | private String yonghuming; 56 | 57 | /** 58 | * 姓名 59 | */ 60 | 61 | private String xingming; 62 | 63 | /** 64 | * 手机 65 | */ 66 | 67 | private String shouji; 68 | 69 | /** 70 | * 邮箱 71 | */ 72 | 73 | private String youxiang; 74 | 75 | /** 76 | * 地址 77 | */ 78 | 79 | private String dizhi; 80 | 81 | /** 82 | * 是否支付 83 | */ 84 | 85 | private String ispay; 86 | 87 | 88 | /** 89 | * 设置:商品名称 90 | */ 91 | 92 | public void setShangpinmingcheng(String shangpinmingcheng) { 93 | this.shangpinmingcheng = shangpinmingcheng; 94 | } 95 | 96 | /** 97 | * 获取:商品名称 98 | */ 99 | public String getShangpinmingcheng() { 100 | return shangpinmingcheng; 101 | } 102 | 103 | 104 | /** 105 | * 设置:商品类型 106 | */ 107 | 108 | public void setShangpinleixing(String shangpinleixing) { 109 | this.shangpinleixing = shangpinleixing; 110 | } 111 | 112 | /** 113 | * 获取:商品类型 114 | */ 115 | public String getShangpinleixing() { 116 | return shangpinleixing; 117 | } 118 | 119 | 120 | /** 121 | * 设置:成交价格 122 | */ 123 | 124 | public void setChengjiaojiage(Integer chengjiaojiage) { 125 | this.chengjiaojiage = chengjiaojiage; 126 | } 127 | 128 | /** 129 | * 获取:成交价格 130 | */ 131 | public Integer getChengjiaojiage() { 132 | return chengjiaojiage; 133 | } 134 | 135 | 136 | /** 137 | * 设置:发布日期 138 | */ 139 | 140 | public void setFaburiqi(Date faburiqi) { 141 | this.faburiqi = faburiqi; 142 | } 143 | 144 | /** 145 | * 获取:发布日期 146 | */ 147 | public Date getFaburiqi() { 148 | return faburiqi; 149 | } 150 | 151 | 152 | /** 153 | * 设置:用户名 154 | */ 155 | 156 | public void setYonghuming(String yonghuming) { 157 | this.yonghuming = yonghuming; 158 | } 159 | 160 | /** 161 | * 获取:用户名 162 | */ 163 | public String getYonghuming() { 164 | return yonghuming; 165 | } 166 | 167 | 168 | /** 169 | * 设置:姓名 170 | */ 171 | 172 | public void setXingming(String xingming) { 173 | this.xingming = xingming; 174 | } 175 | 176 | /** 177 | * 获取:姓名 178 | */ 179 | public String getXingming() { 180 | return xingming; 181 | } 182 | 183 | 184 | /** 185 | * 设置:手机 186 | */ 187 | 188 | public void setShouji(String shouji) { 189 | this.shouji = shouji; 190 | } 191 | 192 | /** 193 | * 获取:手机 194 | */ 195 | public String getShouji() { 196 | return shouji; 197 | } 198 | 199 | 200 | /** 201 | * 设置:邮箱 202 | */ 203 | 204 | public void setYouxiang(String youxiang) { 205 | this.youxiang = youxiang; 206 | } 207 | 208 | /** 209 | * 获取:邮箱 210 | */ 211 | public String getYouxiang() { 212 | return youxiang; 213 | } 214 | 215 | 216 | /** 217 | * 设置:地址 218 | */ 219 | 220 | public void setDizhi(String dizhi) { 221 | this.dizhi = dizhi; 222 | } 223 | 224 | /** 225 | * 获取:地址 226 | */ 227 | public String getDizhi() { 228 | return dizhi; 229 | } 230 | 231 | 232 | /** 233 | * 设置:是否支付 234 | */ 235 | 236 | public void setIspay(String ispay) { 237 | this.ispay = ispay; 238 | } 239 | 240 | /** 241 | * 获取:是否支付 242 | */ 243 | public String getIspay() { 244 | return ispay; 245 | } 246 | 247 | } 248 | -------------------------------------------------------------------------------- /src/main/java/com/entity/model/JingpaidingdanModel.java: -------------------------------------------------------------------------------- 1 | package com.entity.model; 2 | 3 | import com.entity.JingpaidingdanEntity; 4 | 5 | import com.baomidou.mybatisplus.annotations.TableName; 6 | import java.util.Date; 7 | import org.springframework.format.annotation.DateTimeFormat; 8 | 9 | import com.fasterxml.jackson.annotation.JsonFormat; 10 | import java.io.Serializable; 11 | 12 | 13 | /** 14 | * 竞拍订单 15 | * 接收传参的实体类 16 | *(实际开发中配合移动端接口开发手动去掉些没用的字段, 后端一般用entity就够用了) 17 | * 取自ModelAndView 的model名称 18 | * @author 19 | * @email 20 | * @date 2021-02-03 16:07:05 21 | */ 22 | public class JingpaidingdanModel implements Serializable { 23 | private static final long serialVersionUID = 1L; 24 | 25 | 26 | /** 27 | * 商品名称 28 | */ 29 | 30 | private String shangpinmingcheng; 31 | 32 | /** 33 | * 商品类型 34 | */ 35 | 36 | private String shangpinleixing; 37 | 38 | /** 39 | * 成交价格 40 | */ 41 | 42 | private Integer chengjiaojiage; 43 | 44 | /** 45 | * 发布日期 46 | */ 47 | 48 | @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") 49 | @DateTimeFormat 50 | private Date faburiqi; 51 | 52 | /** 53 | * 用户名 54 | */ 55 | 56 | private String yonghuming; 57 | 58 | /** 59 | * 姓名 60 | */ 61 | 62 | private String xingming; 63 | 64 | /** 65 | * 手机 66 | */ 67 | 68 | private String shouji; 69 | 70 | /** 71 | * 邮箱 72 | */ 73 | 74 | private String youxiang; 75 | 76 | /** 77 | * 地址 78 | */ 79 | 80 | private String dizhi; 81 | 82 | /** 83 | * 是否支付 84 | */ 85 | 86 | private String ispay; 87 | 88 | 89 | /** 90 | * 设置:商品名称 91 | */ 92 | 93 | public void setShangpinmingcheng(String shangpinmingcheng) { 94 | this.shangpinmingcheng = shangpinmingcheng; 95 | } 96 | 97 | /** 98 | * 获取:商品名称 99 | */ 100 | public String getShangpinmingcheng() { 101 | return shangpinmingcheng; 102 | } 103 | 104 | 105 | /** 106 | * 设置:商品类型 107 | */ 108 | 109 | public void setShangpinleixing(String shangpinleixing) { 110 | this.shangpinleixing = shangpinleixing; 111 | } 112 | 113 | /** 114 | * 获取:商品类型 115 | */ 116 | public String getShangpinleixing() { 117 | return shangpinleixing; 118 | } 119 | 120 | 121 | /** 122 | * 设置:成交价格 123 | */ 124 | 125 | public void setChengjiaojiage(Integer chengjiaojiage) { 126 | this.chengjiaojiage = chengjiaojiage; 127 | } 128 | 129 | /** 130 | * 获取:成交价格 131 | */ 132 | public Integer getChengjiaojiage() { 133 | return chengjiaojiage; 134 | } 135 | 136 | 137 | /** 138 | * 设置:发布日期 139 | */ 140 | 141 | public void setFaburiqi(Date faburiqi) { 142 | this.faburiqi = faburiqi; 143 | } 144 | 145 | /** 146 | * 获取:发布日期 147 | */ 148 | public Date getFaburiqi() { 149 | return faburiqi; 150 | } 151 | 152 | 153 | /** 154 | * 设置:用户名 155 | */ 156 | 157 | public void setYonghuming(String yonghuming) { 158 | this.yonghuming = yonghuming; 159 | } 160 | 161 | /** 162 | * 获取:用户名 163 | */ 164 | public String getYonghuming() { 165 | return yonghuming; 166 | } 167 | 168 | 169 | /** 170 | * 设置:姓名 171 | */ 172 | 173 | public void setXingming(String xingming) { 174 | this.xingming = xingming; 175 | } 176 | 177 | /** 178 | * 获取:姓名 179 | */ 180 | public String getXingming() { 181 | return xingming; 182 | } 183 | 184 | 185 | /** 186 | * 设置:手机 187 | */ 188 | 189 | public void setShouji(String shouji) { 190 | this.shouji = shouji; 191 | } 192 | 193 | /** 194 | * 获取:手机 195 | */ 196 | public String getShouji() { 197 | return shouji; 198 | } 199 | 200 | 201 | /** 202 | * 设置:邮箱 203 | */ 204 | 205 | public void setYouxiang(String youxiang) { 206 | this.youxiang = youxiang; 207 | } 208 | 209 | /** 210 | * 获取:邮箱 211 | */ 212 | public String getYouxiang() { 213 | return youxiang; 214 | } 215 | 216 | 217 | /** 218 | * 设置:地址 219 | */ 220 | 221 | public void setDizhi(String dizhi) { 222 | this.dizhi = dizhi; 223 | } 224 | 225 | /** 226 | * 获取:地址 227 | */ 228 | public String getDizhi() { 229 | return dizhi; 230 | } 231 | 232 | 233 | /** 234 | * 设置:是否支付 235 | */ 236 | 237 | public void setIspay(String ispay) { 238 | this.ispay = ispay; 239 | } 240 | 241 | /** 242 | * 获取:是否支付 243 | */ 244 | public String getIspay() { 245 | return ispay; 246 | } 247 | 248 | } 249 | -------------------------------------------------------------------------------- /src/main/java/com/entity/PaimaishangpinEntity.java: -------------------------------------------------------------------------------- 1 | package com.entity; 2 | 3 | import com.baomidou.mybatisplus.annotations.TableId; 4 | import com.baomidou.mybatisplus.annotations.TableName; 5 | import javax.validation.constraints.NotBlank; 6 | import javax.validation.constraints.NotEmpty; 7 | import javax.validation.constraints.NotNull; 8 | 9 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 10 | import java.lang.reflect.InvocationTargetException; 11 | 12 | import java.io.Serializable; 13 | import java.util.Date; 14 | import java.util.List; 15 | 16 | import org.springframework.format.annotation.DateTimeFormat; 17 | import com.fasterxml.jackson.annotation.JsonFormat; 18 | import org.apache.commons.beanutils.BeanUtils; 19 | import com.baomidou.mybatisplus.annotations.TableField; 20 | import com.baomidou.mybatisplus.enums.FieldFill; 21 | import com.baomidou.mybatisplus.enums.IdType; 22 | 23 | 24 | /** 25 | * 拍卖商品 26 | * 数据库通用操作实体类(普通增删改查) 27 | * @author 28 | * @email 29 | * @date 2021-02-03 16:07:05 30 | */ 31 | @TableName("paimaishangpin") 32 | public class PaimaishangpinEntity implements Serializable { 33 | private static final long serialVersionUID = 1L; 34 | 35 | 36 | public PaimaishangpinEntity() { 37 | 38 | } 39 | 40 | public PaimaishangpinEntity(T t) { 41 | try { 42 | BeanUtils.copyProperties(this, t); 43 | } catch (IllegalAccessException | InvocationTargetException e) { 44 | // TODO Auto-generated catch block 45 | e.printStackTrace(); 46 | } 47 | } 48 | 49 | /** 50 | * 主键id 51 | */ 52 | @TableId 53 | private Long id; 54 | /** 55 | * 商品名称 56 | */ 57 | 58 | private String shangpinmingcheng; 59 | 60 | /** 61 | * 商品类型 62 | */ 63 | 64 | private String shangpinleixing; 65 | 66 | /** 67 | * 图片 68 | */ 69 | 70 | private String tupian; 71 | 72 | /** 73 | * 价格 74 | */ 75 | 76 | private Integer jiage; 77 | 78 | /** 79 | * 商品详情 80 | */ 81 | 82 | private String shangpinxiangqing; 83 | 84 | /** 85 | * 活动时间 86 | */ 87 | 88 | private String huodongshijian; 89 | 90 | /** 91 | * 活动状态 92 | */ 93 | 94 | private String huodongzhuangtai; 95 | 96 | 97 | @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") 98 | @DateTimeFormat 99 | private Date addtime; 100 | 101 | public Date getAddtime() { 102 | return addtime; 103 | } 104 | public void setAddtime(Date addtime) { 105 | this.addtime = addtime; 106 | } 107 | 108 | public Long getId() { 109 | return id; 110 | } 111 | 112 | public void setId(Long id) { 113 | this.id = id; 114 | } 115 | /** 116 | * 设置:商品名称 117 | */ 118 | public void setShangpinmingcheng(String shangpinmingcheng) { 119 | this.shangpinmingcheng = shangpinmingcheng; 120 | } 121 | /** 122 | * 获取:商品名称 123 | */ 124 | public String getShangpinmingcheng() { 125 | return shangpinmingcheng; 126 | } 127 | /** 128 | * 设置:商品类型 129 | */ 130 | public void setShangpinleixing(String shangpinleixing) { 131 | this.shangpinleixing = shangpinleixing; 132 | } 133 | /** 134 | * 获取:商品类型 135 | */ 136 | public String getShangpinleixing() { 137 | return shangpinleixing; 138 | } 139 | /** 140 | * 设置:图片 141 | */ 142 | public void setTupian(String tupian) { 143 | this.tupian = tupian; 144 | } 145 | /** 146 | * 获取:图片 147 | */ 148 | public String getTupian() { 149 | return tupian; 150 | } 151 | /** 152 | * 设置:价格 153 | */ 154 | public void setJiage(Integer jiage) { 155 | this.jiage = jiage; 156 | } 157 | /** 158 | * 获取:价格 159 | */ 160 | public Integer getJiage() { 161 | return jiage; 162 | } 163 | /** 164 | * 设置:商品详情 165 | */ 166 | public void setShangpinxiangqing(String shangpinxiangqing) { 167 | this.shangpinxiangqing = shangpinxiangqing; 168 | } 169 | /** 170 | * 获取:商品详情 171 | */ 172 | public String getShangpinxiangqing() { 173 | return shangpinxiangqing; 174 | } 175 | /** 176 | * 设置:活动时间 177 | */ 178 | public void setHuodongshijian(String huodongshijian) { 179 | this.huodongshijian = huodongshijian; 180 | } 181 | /** 182 | * 获取:活动时间 183 | */ 184 | public String getHuodongshijian() { 185 | return huodongshijian; 186 | } 187 | /** 188 | * 设置:活动状态 189 | */ 190 | public void setHuodongzhuangtai(String huodongzhuangtai) { 191 | this.huodongzhuangtai = huodongzhuangtai; 192 | } 193 | /** 194 | * 获取:活动状态 195 | */ 196 | public String getHuodongzhuangtai() { 197 | return huodongzhuangtai; 198 | } 199 | 200 | } 201 | -------------------------------------------------------------------------------- /src/main/java/com/entity/YonghuEntity.java: -------------------------------------------------------------------------------- 1 | package com.entity; 2 | 3 | import com.baomidou.mybatisplus.annotations.TableId; 4 | import com.baomidou.mybatisplus.annotations.TableName; 5 | import javax.validation.constraints.NotBlank; 6 | import javax.validation.constraints.NotEmpty; 7 | import javax.validation.constraints.NotNull; 8 | 9 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 10 | import java.lang.reflect.InvocationTargetException; 11 | 12 | import java.io.Serializable; 13 | import java.util.Date; 14 | import java.util.List; 15 | 16 | import org.springframework.format.annotation.DateTimeFormat; 17 | import com.fasterxml.jackson.annotation.JsonFormat; 18 | import org.apache.commons.beanutils.BeanUtils; 19 | import com.baomidou.mybatisplus.annotations.TableField; 20 | import com.baomidou.mybatisplus.enums.FieldFill; 21 | import com.baomidou.mybatisplus.enums.IdType; 22 | 23 | 24 | /** 25 | * 用户 26 | * 数据库通用操作实体类(普通增删改查) 27 | * @author 28 | * @email 29 | * @date 2021-02-03 16:07:05 30 | */ 31 | @TableName("yonghu") 32 | public class YonghuEntity implements Serializable { 33 | private static final long serialVersionUID = 1L; 34 | 35 | 36 | public YonghuEntity() { 37 | 38 | } 39 | 40 | public YonghuEntity(T t) { 41 | try { 42 | BeanUtils.copyProperties(this, t); 43 | } catch (IllegalAccessException | InvocationTargetException e) { 44 | // TODO Auto-generated catch block 45 | e.printStackTrace(); 46 | } 47 | } 48 | 49 | /** 50 | * 主键id 51 | */ 52 | @TableId 53 | private Long id; 54 | /** 55 | * 用户名 56 | */ 57 | 58 | private String yonghuming; 59 | 60 | /** 61 | * 密码 62 | */ 63 | 64 | private String mima; 65 | 66 | /** 67 | * 姓名 68 | */ 69 | 70 | private String xingming; 71 | 72 | /** 73 | * 性别 74 | */ 75 | 76 | private String xingbie; 77 | 78 | /** 79 | * 头像 80 | */ 81 | 82 | private String touxiang; 83 | 84 | /** 85 | * 身份证 86 | */ 87 | 88 | private String shenfenzheng; 89 | 90 | /** 91 | * 手机 92 | */ 93 | 94 | private String shouji; 95 | 96 | /** 97 | * 邮箱 98 | */ 99 | 100 | private String youxiang; 101 | 102 | /** 103 | * 地址 104 | */ 105 | 106 | private String dizhi; 107 | 108 | 109 | @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") 110 | @DateTimeFormat 111 | private Date addtime; 112 | 113 | public Date getAddtime() { 114 | return addtime; 115 | } 116 | public void setAddtime(Date addtime) { 117 | this.addtime = addtime; 118 | } 119 | 120 | public Long getId() { 121 | return id; 122 | } 123 | 124 | public void setId(Long id) { 125 | this.id = id; 126 | } 127 | /** 128 | * 设置:用户名 129 | */ 130 | public void setYonghuming(String yonghuming) { 131 | this.yonghuming = yonghuming; 132 | } 133 | /** 134 | * 获取:用户名 135 | */ 136 | public String getYonghuming() { 137 | return yonghuming; 138 | } 139 | /** 140 | * 设置:密码 141 | */ 142 | public void setMima(String mima) { 143 | this.mima = mima; 144 | } 145 | /** 146 | * 获取:密码 147 | */ 148 | public String getMima() { 149 | return mima; 150 | } 151 | /** 152 | * 设置:姓名 153 | */ 154 | public void setXingming(String xingming) { 155 | this.xingming = xingming; 156 | } 157 | /** 158 | * 获取:姓名 159 | */ 160 | public String getXingming() { 161 | return xingming; 162 | } 163 | /** 164 | * 设置:性别 165 | */ 166 | public void setXingbie(String xingbie) { 167 | this.xingbie = xingbie; 168 | } 169 | /** 170 | * 获取:性别 171 | */ 172 | public String getXingbie() { 173 | return xingbie; 174 | } 175 | /** 176 | * 设置:头像 177 | */ 178 | public void setTouxiang(String touxiang) { 179 | this.touxiang = touxiang; 180 | } 181 | /** 182 | * 获取:头像 183 | */ 184 | public String getTouxiang() { 185 | return touxiang; 186 | } 187 | /** 188 | * 设置:身份证 189 | */ 190 | public void setShenfenzheng(String shenfenzheng) { 191 | this.shenfenzheng = shenfenzheng; 192 | } 193 | /** 194 | * 获取:身份证 195 | */ 196 | public String getShenfenzheng() { 197 | return shenfenzheng; 198 | } 199 | /** 200 | * 设置:手机 201 | */ 202 | public void setShouji(String shouji) { 203 | this.shouji = shouji; 204 | } 205 | /** 206 | * 获取:手机 207 | */ 208 | public String getShouji() { 209 | return shouji; 210 | } 211 | /** 212 | * 设置:邮箱 213 | */ 214 | public void setYouxiang(String youxiang) { 215 | this.youxiang = youxiang; 216 | } 217 | /** 218 | * 获取:邮箱 219 | */ 220 | public String getYouxiang() { 221 | return youxiang; 222 | } 223 | /** 224 | * 设置:地址 225 | */ 226 | public void setDizhi(String dizhi) { 227 | this.dizhi = dizhi; 228 | } 229 | /** 230 | * 获取:地址 231 | */ 232 | public String getDizhi() { 233 | return dizhi; 234 | } 235 | 236 | } 237 | -------------------------------------------------------------------------------- /src/main/java/com/entity/LishijingpaiEntity.java: -------------------------------------------------------------------------------- 1 | package com.entity; 2 | 3 | import com.baomidou.mybatisplus.annotations.TableId; 4 | import com.baomidou.mybatisplus.annotations.TableName; 5 | import javax.validation.constraints.NotBlank; 6 | import javax.validation.constraints.NotEmpty; 7 | import javax.validation.constraints.NotNull; 8 | 9 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 10 | import java.lang.reflect.InvocationTargetException; 11 | 12 | import java.io.Serializable; 13 | import java.util.Date; 14 | import java.util.List; 15 | 16 | import org.springframework.format.annotation.DateTimeFormat; 17 | import com.fasterxml.jackson.annotation.JsonFormat; 18 | import org.apache.commons.beanutils.BeanUtils; 19 | import com.baomidou.mybatisplus.annotations.TableField; 20 | import com.baomidou.mybatisplus.enums.FieldFill; 21 | import com.baomidou.mybatisplus.enums.IdType; 22 | 23 | 24 | /** 25 | * 历史竞拍 26 | * 数据库通用操作实体类(普通增删改查) 27 | * @author 28 | * @email 29 | * @date 2021-02-03 16:07:05 30 | */ 31 | @TableName("lishijingpai") 32 | public class LishijingpaiEntity implements Serializable { 33 | private static final long serialVersionUID = 1L; 34 | 35 | 36 | public LishijingpaiEntity() { 37 | 38 | } 39 | 40 | public LishijingpaiEntity(T t) { 41 | try { 42 | BeanUtils.copyProperties(this, t); 43 | } catch (IllegalAccessException | InvocationTargetException e) { 44 | // TODO Auto-generated catch block 45 | e.printStackTrace(); 46 | } 47 | } 48 | 49 | /** 50 | * 主键id 51 | */ 52 | @TableId 53 | private Long id; 54 | /** 55 | * 商品名称 56 | */ 57 | 58 | private String shangpinmingcheng; 59 | 60 | /** 61 | * 商品类型 62 | */ 63 | 64 | private String shangpinleixing; 65 | 66 | /** 67 | * 日期 68 | */ 69 | 70 | @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") 71 | @DateTimeFormat 72 | private Date riqi; 73 | 74 | /** 75 | * 价格 76 | */ 77 | 78 | private Integer jiage; 79 | 80 | /** 81 | * 用户名 82 | */ 83 | 84 | private String yonghuming; 85 | 86 | /** 87 | * 姓名 88 | */ 89 | 90 | private String xingming; 91 | 92 | /** 93 | * 手机 94 | */ 95 | 96 | private String shouji; 97 | 98 | /** 99 | * 地址 100 | */ 101 | 102 | private String dizhi; 103 | 104 | /** 105 | * 是否审核 106 | */ 107 | 108 | private String sfsh; 109 | 110 | /** 111 | * 审核回复 112 | */ 113 | 114 | private String shhf; 115 | 116 | 117 | @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") 118 | @DateTimeFormat 119 | private Date addtime; 120 | 121 | public Date getAddtime() { 122 | return addtime; 123 | } 124 | public void setAddtime(Date addtime) { 125 | this.addtime = addtime; 126 | } 127 | 128 | public Long getId() { 129 | return id; 130 | } 131 | 132 | public void setId(Long id) { 133 | this.id = id; 134 | } 135 | /** 136 | * 设置:商品名称 137 | */ 138 | public void setShangpinmingcheng(String shangpinmingcheng) { 139 | this.shangpinmingcheng = shangpinmingcheng; 140 | } 141 | /** 142 | * 获取:商品名称 143 | */ 144 | public String getShangpinmingcheng() { 145 | return shangpinmingcheng; 146 | } 147 | /** 148 | * 设置:商品类型 149 | */ 150 | public void setShangpinleixing(String shangpinleixing) { 151 | this.shangpinleixing = shangpinleixing; 152 | } 153 | /** 154 | * 获取:商品类型 155 | */ 156 | public String getShangpinleixing() { 157 | return shangpinleixing; 158 | } 159 | /** 160 | * 设置:日期 161 | */ 162 | public void setRiqi(Date riqi) { 163 | this.riqi = riqi; 164 | } 165 | /** 166 | * 获取:日期 167 | */ 168 | public Date getRiqi() { 169 | return riqi; 170 | } 171 | /** 172 | * 设置:价格 173 | */ 174 | public void setJiage(Integer jiage) { 175 | this.jiage = jiage; 176 | } 177 | /** 178 | * 获取:价格 179 | */ 180 | public Integer getJiage() { 181 | return jiage; 182 | } 183 | /** 184 | * 设置:用户名 185 | */ 186 | public void setYonghuming(String yonghuming) { 187 | this.yonghuming = yonghuming; 188 | } 189 | /** 190 | * 获取:用户名 191 | */ 192 | public String getYonghuming() { 193 | return yonghuming; 194 | } 195 | /** 196 | * 设置:姓名 197 | */ 198 | public void setXingming(String xingming) { 199 | this.xingming = xingming; 200 | } 201 | /** 202 | * 获取:姓名 203 | */ 204 | public String getXingming() { 205 | return xingming; 206 | } 207 | /** 208 | * 设置:手机 209 | */ 210 | public void setShouji(String shouji) { 211 | this.shouji = shouji; 212 | } 213 | /** 214 | * 获取:手机 215 | */ 216 | public String getShouji() { 217 | return shouji; 218 | } 219 | /** 220 | * 设置:地址 221 | */ 222 | public void setDizhi(String dizhi) { 223 | this.dizhi = dizhi; 224 | } 225 | /** 226 | * 获取:地址 227 | */ 228 | public String getDizhi() { 229 | return dizhi; 230 | } 231 | /** 232 | * 设置:是否审核 233 | */ 234 | public void setSfsh(String sfsh) { 235 | this.sfsh = sfsh; 236 | } 237 | /** 238 | * 获取:是否审核 239 | */ 240 | public String getSfsh() { 241 | return sfsh; 242 | } 243 | /** 244 | * 设置:审核回复 245 | */ 246 | public void setShhf(String shhf) { 247 | this.shhf = shhf; 248 | } 249 | /** 250 | * 获取:审核回复 251 | */ 252 | public String getShhf() { 253 | return shhf; 254 | } 255 | 256 | } 257 | -------------------------------------------------------------------------------- /src/main/java/com/controller/UserController.java: -------------------------------------------------------------------------------- 1 | 2 | package com.controller; 3 | 4 | 5 | import java.util.Arrays; 6 | import java.util.Calendar; 7 | import java.util.Date; 8 | import java.util.Map; 9 | 10 | import javax.servlet.http.HttpServletRequest; 11 | 12 | import org.springframework.beans.factory.annotation.Autowired; 13 | import org.springframework.stereotype.Controller; 14 | import org.springframework.web.bind.annotation.GetMapping; 15 | import org.springframework.web.bind.annotation.PathVariable; 16 | import org.springframework.web.bind.annotation.PostMapping; 17 | import org.springframework.web.bind.annotation.RequestBody; 18 | import org.springframework.web.bind.annotation.RequestMapping; 19 | import org.springframework.web.bind.annotation.RequestParam; 20 | import org.springframework.web.bind.annotation.ResponseBody; 21 | import org.springframework.web.bind.annotation.RestController; 22 | 23 | import com.annotation.IgnoreAuth; 24 | import com.baomidou.mybatisplus.mapper.EntityWrapper; 25 | import com.entity.TokenEntity; 26 | import com.entity.UserEntity; 27 | import com.service.TokenService; 28 | import com.service.UserService; 29 | import com.utils.CommonUtil; 30 | import com.utils.MPUtil; 31 | import com.utils.PageUtils; 32 | import com.utils.R; 33 | import com.utils.ValidatorUtils; 34 | 35 | /** 36 | * 登录相关 37 | */ 38 | @RequestMapping("users") 39 | @RestController 40 | public class UserController{ 41 | 42 | @Autowired 43 | private UserService userService; 44 | 45 | @Autowired 46 | private TokenService tokenService; 47 | 48 | /** 49 | * 登录 50 | */ 51 | @IgnoreAuth 52 | @PostMapping(value = "/login") 53 | public R login(String username, String password, String captcha, HttpServletRequest request) { 54 | UserEntity user = userService.selectOne(new EntityWrapper().eq("username", username)); 55 | if(user==null || !user.getPassword().equals(password)) { 56 | return R.error("账号或密码不正确"); 57 | } 58 | String token = tokenService.generateToken(user.getId(),username, "users", user.getRole()); 59 | return R.ok().put("token", token); 60 | } 61 | 62 | /** 63 | * 注册 64 | */ 65 | @IgnoreAuth 66 | @PostMapping(value = "/register") 67 | public R register(@RequestBody UserEntity user){ 68 | // ValidatorUtils.validateEntity(user); 69 | if(userService.selectOne(new EntityWrapper().eq("username", user.getUsername())) !=null) { 70 | return R.error("用户已存在"); 71 | } 72 | userService.insert(user); 73 | return R.ok(); 74 | } 75 | 76 | /** 77 | * 退出 78 | */ 79 | @GetMapping(value = "logout") 80 | public R logout(HttpServletRequest request) { 81 | request.getSession().invalidate(); 82 | return R.ok("退出成功"); 83 | } 84 | 85 | /** 86 | * 密码重置 87 | */ 88 | @IgnoreAuth 89 | @RequestMapping(value = "/resetPass") 90 | public R resetPass(String username, HttpServletRequest request){ 91 | UserEntity user = userService.selectOne(new EntityWrapper().eq("username", username)); 92 | if(user==null) { 93 | return R.error("账号不存在"); 94 | } 95 | user.setPassword("123456"); 96 | userService.update(user,null); 97 | return R.ok("密码已重置为:123456"); 98 | } 99 | 100 | /** 101 | * 列表 102 | */ 103 | @RequestMapping("/page") 104 | public R page(@RequestParam Map params,UserEntity user){ 105 | EntityWrapper ew = new EntityWrapper(); 106 | PageUtils page = userService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.allLike(ew, user), params), params)); 107 | return R.ok().put("data", page); 108 | } 109 | 110 | /** 111 | * 列表 112 | */ 113 | @RequestMapping("/list") 114 | public R list( UserEntity user){ 115 | EntityWrapper ew = new EntityWrapper(); 116 | ew.allEq(MPUtil.allEQMapPre( user, "user")); 117 | return R.ok().put("data", userService.selectListView(ew)); 118 | } 119 | 120 | /** 121 | * 信息 122 | */ 123 | @RequestMapping("/info/{id}") 124 | public R info(@PathVariable("id") String id){ 125 | UserEntity user = userService.selectById(id); 126 | return R.ok().put("data", user); 127 | } 128 | 129 | /** 130 | * 获取用户的session用户信息 131 | */ 132 | @RequestMapping("/session") 133 | public R getCurrUser(HttpServletRequest request){ 134 | Long id = (Long)request.getSession().getAttribute("userId"); 135 | UserEntity user = userService.selectById(id); 136 | return R.ok().put("data", user); 137 | } 138 | 139 | /** 140 | * 保存 141 | */ 142 | @PostMapping("/save") 143 | public R save(@RequestBody UserEntity user){ 144 | // ValidatorUtils.validateEntity(user); 145 | if(userService.selectOne(new EntityWrapper().eq("username", user.getUsername())) !=null) { 146 | return R.error("用户已存在"); 147 | } 148 | userService.insert(user); 149 | return R.ok(); 150 | } 151 | 152 | /** 153 | * 修改 154 | */ 155 | @RequestMapping("/update") 156 | public R update(@RequestBody UserEntity user){ 157 | // ValidatorUtils.validateEntity(user); 158 | userService.updateById(user);//全部更新 159 | return R.ok(); 160 | } 161 | 162 | /** 163 | * 删除 164 | */ 165 | @RequestMapping("/delete") 166 | public R delete(@RequestBody Long[] ids){ 167 | userService.deleteBatchIds(Arrays.asList(ids)); 168 | return R.ok(); 169 | } 170 | } 171 | -------------------------------------------------------------------------------- /src/main/java/com/entity/JingpaidingdanEntity.java: -------------------------------------------------------------------------------- 1 | package com.entity; 2 | 3 | import com.baomidou.mybatisplus.annotations.TableId; 4 | import com.baomidou.mybatisplus.annotations.TableName; 5 | import javax.validation.constraints.NotBlank; 6 | import javax.validation.constraints.NotEmpty; 7 | import javax.validation.constraints.NotNull; 8 | 9 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 10 | import java.lang.reflect.InvocationTargetException; 11 | 12 | import java.io.Serializable; 13 | import java.util.Date; 14 | import java.util.List; 15 | 16 | import org.springframework.format.annotation.DateTimeFormat; 17 | import com.fasterxml.jackson.annotation.JsonFormat; 18 | import org.apache.commons.beanutils.BeanUtils; 19 | import com.baomidou.mybatisplus.annotations.TableField; 20 | import com.baomidou.mybatisplus.enums.FieldFill; 21 | import com.baomidou.mybatisplus.enums.IdType; 22 | 23 | 24 | /** 25 | * 竞拍订单 26 | * 数据库通用操作实体类(普通增删改查) 27 | * @author 28 | * @email 29 | * @date 2021-02-03 16:07:05 30 | */ 31 | @TableName("jingpaidingdan") 32 | public class JingpaidingdanEntity implements Serializable { 33 | private static final long serialVersionUID = 1L; 34 | 35 | 36 | public JingpaidingdanEntity() { 37 | 38 | } 39 | 40 | public JingpaidingdanEntity(T t) { 41 | try { 42 | BeanUtils.copyProperties(this, t); 43 | } catch (IllegalAccessException | InvocationTargetException e) { 44 | // TODO Auto-generated catch block 45 | e.printStackTrace(); 46 | } 47 | } 48 | 49 | /** 50 | * 主键id 51 | */ 52 | @TableId 53 | private Long id; 54 | /** 55 | * 订单编号 56 | */ 57 | 58 | private String dingdanbianhao; 59 | 60 | /** 61 | * 商品名称 62 | */ 63 | 64 | private String shangpinmingcheng; 65 | 66 | /** 67 | * 商品类型 68 | */ 69 | 70 | private String shangpinleixing; 71 | 72 | /** 73 | * 成交价格 74 | */ 75 | 76 | private Integer chengjiaojiage; 77 | 78 | /** 79 | * 发布日期 80 | */ 81 | 82 | @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd") 83 | @DateTimeFormat 84 | private Date faburiqi; 85 | 86 | /** 87 | * 用户名 88 | */ 89 | 90 | private String yonghuming; 91 | 92 | /** 93 | * 姓名 94 | */ 95 | 96 | private String xingming; 97 | 98 | /** 99 | * 手机 100 | */ 101 | 102 | private String shouji; 103 | 104 | /** 105 | * 邮箱 106 | */ 107 | 108 | private String youxiang; 109 | 110 | /** 111 | * 地址 112 | */ 113 | 114 | private String dizhi; 115 | 116 | /** 117 | * 是否支付 118 | */ 119 | 120 | private String ispay; 121 | 122 | 123 | @JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss") 124 | @DateTimeFormat 125 | private Date addtime; 126 | 127 | public Date getAddtime() { 128 | return addtime; 129 | } 130 | public void setAddtime(Date addtime) { 131 | this.addtime = addtime; 132 | } 133 | 134 | public Long getId() { 135 | return id; 136 | } 137 | 138 | public void setId(Long id) { 139 | this.id = id; 140 | } 141 | /** 142 | * 设置:订单编号 143 | */ 144 | public void setDingdanbianhao(String dingdanbianhao) { 145 | this.dingdanbianhao = dingdanbianhao; 146 | } 147 | /** 148 | * 获取:订单编号 149 | */ 150 | public String getDingdanbianhao() { 151 | return dingdanbianhao; 152 | } 153 | /** 154 | * 设置:商品名称 155 | */ 156 | public void setShangpinmingcheng(String shangpinmingcheng) { 157 | this.shangpinmingcheng = shangpinmingcheng; 158 | } 159 | /** 160 | * 获取:商品名称 161 | */ 162 | public String getShangpinmingcheng() { 163 | return shangpinmingcheng; 164 | } 165 | /** 166 | * 设置:商品类型 167 | */ 168 | public void setShangpinleixing(String shangpinleixing) { 169 | this.shangpinleixing = shangpinleixing; 170 | } 171 | /** 172 | * 获取:商品类型 173 | */ 174 | public String getShangpinleixing() { 175 | return shangpinleixing; 176 | } 177 | /** 178 | * 设置:成交价格 179 | */ 180 | public void setChengjiaojiage(Integer chengjiaojiage) { 181 | this.chengjiaojiage = chengjiaojiage; 182 | } 183 | /** 184 | * 获取:成交价格 185 | */ 186 | public Integer getChengjiaojiage() { 187 | return chengjiaojiage; 188 | } 189 | /** 190 | * 设置:发布日期 191 | */ 192 | public void setFaburiqi(Date faburiqi) { 193 | this.faburiqi = faburiqi; 194 | } 195 | /** 196 | * 获取:发布日期 197 | */ 198 | public Date getFaburiqi() { 199 | return faburiqi; 200 | } 201 | /** 202 | * 设置:用户名 203 | */ 204 | public void setYonghuming(String yonghuming) { 205 | this.yonghuming = yonghuming; 206 | } 207 | /** 208 | * 获取:用户名 209 | */ 210 | public String getYonghuming() { 211 | return yonghuming; 212 | } 213 | /** 214 | * 设置:姓名 215 | */ 216 | public void setXingming(String xingming) { 217 | this.xingming = xingming; 218 | } 219 | /** 220 | * 获取:姓名 221 | */ 222 | public String getXingming() { 223 | return xingming; 224 | } 225 | /** 226 | * 设置:手机 227 | */ 228 | public void setShouji(String shouji) { 229 | this.shouji = shouji; 230 | } 231 | /** 232 | * 获取:手机 233 | */ 234 | public String getShouji() { 235 | return shouji; 236 | } 237 | /** 238 | * 设置:邮箱 239 | */ 240 | public void setYouxiang(String youxiang) { 241 | this.youxiang = youxiang; 242 | } 243 | /** 244 | * 获取:邮箱 245 | */ 246 | public String getYouxiang() { 247 | return youxiang; 248 | } 249 | /** 250 | * 设置:地址 251 | */ 252 | public void setDizhi(String dizhi) { 253 | this.dizhi = dizhi; 254 | } 255 | /** 256 | * 获取:地址 257 | */ 258 | public String getDizhi() { 259 | return dizhi; 260 | } 261 | /** 262 | * 设置:是否支付 263 | */ 264 | public void setIspay(String ispay) { 265 | this.ispay = ispay; 266 | } 267 | /** 268 | * 获取:是否支付 269 | */ 270 | public String getIspay() { 271 | return ispay; 272 | } 273 | 274 | } 275 | -------------------------------------------------------------------------------- /src/main/java/com/utils/MPUtil.java: -------------------------------------------------------------------------------- 1 | package com.utils; 2 | 3 | import java.util.Arrays; 4 | import java.util.HashMap; 5 | import java.util.Iterator; 6 | import java.util.Map; 7 | 8 | import org.apache.commons.lang3.StringUtils; 9 | 10 | import cn.hutool.core.bean.BeanUtil; 11 | 12 | import com.baomidou.mybatisplus.mapper.Wrapper; 13 | 14 | /** 15 | * Mybatis-Plus工具类 16 | */ 17 | public class MPUtil { 18 | public static final char UNDERLINE = '_'; 19 | 20 | 21 | //mybatis plus allEQ 表达式转换 22 | public static Map allEQMapPre(Object bean,String pre) { 23 | Map map =BeanUtil.beanToMap(bean); 24 | return camelToUnderlineMap(map,pre); 25 | } 26 | 27 | //mybatis plus allEQ 表达式转换 28 | public static Map allEQMap(Object bean) { 29 | Map map =BeanUtil.beanToMap(bean); 30 | return camelToUnderlineMap(map,""); 31 | } 32 | 33 | public static Wrapper allLikePre(Wrapper wrapper,Object bean,String pre) { 34 | Map map =BeanUtil.beanToMap(bean); 35 | Map result = camelToUnderlineMap(map,pre); 36 | 37 | return genLike(wrapper,result); 38 | } 39 | 40 | public static Wrapper allLike(Wrapper wrapper,Object bean) { 41 | Map result = BeanUtil.beanToMap(bean, true, true); 42 | return genLike(wrapper,result); 43 | } 44 | 45 | 46 | public static Wrapper genLike( Wrapper wrapper,Map param) { 47 | Iterator> it = param.entrySet().iterator(); 48 | int i=0; 49 | while (it.hasNext()) { 50 | if(i>0) wrapper.and(); 51 | Map.Entry entry = it.next(); 52 | String key = entry.getKey(); 53 | String value = (String) entry.getValue(); 54 | wrapper.like(key, value); 55 | i++; 56 | } 57 | return wrapper; 58 | } 59 | 60 | public static Wrapper likeOrEq(Wrapper wrapper,Object bean) { 61 | Map result = BeanUtil.beanToMap(bean, true, true); 62 | return genLikeOrEq(wrapper,result); 63 | } 64 | 65 | public static Wrapper genLikeOrEq( Wrapper wrapper,Map param) { 66 | Iterator> it = param.entrySet().iterator(); 67 | int i=0; 68 | while (it.hasNext()) { 69 | if(i>0) wrapper.and(); 70 | Map.Entry entry = it.next(); 71 | String key = entry.getKey(); 72 | if(entry.getValue().toString().contains("%")) { 73 | wrapper.like(key, entry.getValue().toString().replace("%", "")); 74 | } else { 75 | wrapper.eq(key, entry.getValue()); 76 | } 77 | i++; 78 | } 79 | return wrapper; 80 | } 81 | 82 | public static Wrapper allEq(Wrapper wrapper,Object bean) { 83 | Map result = BeanUtil.beanToMap(bean, true, true); 84 | return genEq(wrapper,result); 85 | } 86 | 87 | 88 | public static Wrapper genEq( Wrapper wrapper,Map param) { 89 | Iterator> it = param.entrySet().iterator(); 90 | int i=0; 91 | while (it.hasNext()) { 92 | if(i>0) wrapper.and(); 93 | Map.Entry entry = it.next(); 94 | String key = entry.getKey(); 95 | wrapper.eq(key, entry.getValue()); 96 | i++; 97 | } 98 | return wrapper; 99 | } 100 | 101 | 102 | public static Wrapper between(Wrapper wrapper,Map params) { 103 | for(String key : params.keySet()) { 104 | String columnName = ""; 105 | if(key.endsWith("_start")) { 106 | columnName = key.substring(0, key.indexOf("_start")); 107 | if(StringUtils.isNotBlank(params.get(key).toString())) { 108 | wrapper.ge(columnName, params.get(key)); 109 | } 110 | } 111 | if(key.endsWith("_end")) { 112 | columnName = key.substring(0, key.indexOf("_end")); 113 | if(StringUtils.isNotBlank(params.get(key).toString())) { 114 | wrapper.le(columnName, params.get(key)); 115 | } 116 | } 117 | } 118 | return wrapper; 119 | } 120 | 121 | public static Wrapper sort(Wrapper wrapper,Map params) { 122 | String order = ""; 123 | if(params.get("order") != null && StringUtils.isNotBlank(params.get("order").toString())) { 124 | order = params.get("order").toString(); 125 | } 126 | if(params.get("sort") != null && StringUtils.isNotBlank(params.get("sort").toString())) { 127 | if(order.equalsIgnoreCase("desc")) { 128 | wrapper.orderDesc(Arrays.asList(params.get("sort"))); 129 | } else { 130 | wrapper.orderAsc(Arrays.asList(params.get("sort"))); 131 | } 132 | } 133 | return wrapper; 134 | } 135 | 136 | 137 | /** 138 | * 驼峰格式字符串转换为下划线格式字符串 139 | * 140 | * @param param 141 | * @return 142 | */ 143 | public static String camelToUnderline(String param) { 144 | if (param == null || "".equals(param.trim())) { 145 | return ""; 146 | } 147 | int len = param.length(); 148 | StringBuilder sb = new StringBuilder(len); 149 | for (int i = 0; i < len; i++) { 150 | char c = param.charAt(i); 151 | if (Character.isUpperCase(c)) { 152 | sb.append(UNDERLINE); 153 | sb.append(Character.toLowerCase(c)); 154 | } else { 155 | sb.append(c); 156 | } 157 | } 158 | return sb.toString(); 159 | } 160 | 161 | public static void main(String[] ages) { 162 | System.out.println(camelToUnderline("ABCddfANM")); 163 | } 164 | 165 | public static Map camelToUnderlineMap(Map param, String pre) { 166 | 167 | Map newMap = new HashMap(); 168 | Iterator> it = param.entrySet().iterator(); 169 | while (it.hasNext()) { 170 | Map.Entry entry = it.next(); 171 | String key = entry.getKey(); 172 | String newKey = camelToUnderline(key); 173 | if (pre.endsWith(".")) { 174 | newMap.put(pre + newKey, entry.getValue()); 175 | } else if (StringUtils.isEmpty(pre)) { 176 | newMap.put(newKey, entry.getValue()); 177 | } else { 178 | 179 | newMap.put(pre + "." + newKey, entry.getValue()); 180 | } 181 | } 182 | return newMap; 183 | } 184 | } 185 | -------------------------------------------------------------------------------- /src/main/java/com/controller/NewsController.java: -------------------------------------------------------------------------------- 1 | package com.controller; 2 | 3 | import java.text.SimpleDateFormat; 4 | import java.util.ArrayList; 5 | import java.util.Arrays; 6 | import java.util.Calendar; 7 | import java.util.Map; 8 | import java.util.HashMap; 9 | import java.util.Iterator; 10 | import java.util.Date; 11 | import java.util.List; 12 | import javax.servlet.http.HttpServletRequest; 13 | 14 | import com.utils.ValidatorUtils; 15 | import org.apache.commons.lang3.StringUtils; 16 | import org.springframework.beans.factory.annotation.Autowired; 17 | import org.springframework.web.bind.annotation.PathVariable; 18 | import org.springframework.web.bind.annotation.RequestBody; 19 | import org.springframework.web.bind.annotation.RequestMapping; 20 | import org.springframework.web.bind.annotation.RequestParam; 21 | import org.springframework.web.bind.annotation.RestController; 22 | import com.baomidou.mybatisplus.mapper.EntityWrapper; 23 | import com.baomidou.mybatisplus.mapper.Wrapper; 24 | import com.annotation.IgnoreAuth; 25 | 26 | import com.entity.NewsEntity; 27 | import com.entity.view.NewsView; 28 | 29 | import com.service.NewsService; 30 | import com.service.TokenService; 31 | import com.utils.PageUtils; 32 | import com.utils.R; 33 | import com.utils.MD5Util; 34 | import com.utils.MPUtil; 35 | import com.utils.CommonUtil; 36 | 37 | 38 | /** 39 | * 竞拍公告 40 | * 后端接口 41 | * @author 42 | * @email 43 | * @date 2021-02-03 16:07:05 44 | */ 45 | @RestController 46 | @RequestMapping("/news") 47 | public class NewsController { 48 | @Autowired 49 | private NewsService newsService; 50 | 51 | 52 | 53 | /** 54 | * 后端列表 55 | */ 56 | @RequestMapping("/page") 57 | public R page(@RequestParam Map params,NewsEntity news, HttpServletRequest request){ 58 | EntityWrapper ew = new EntityWrapper(); 59 | PageUtils page = newsService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, news), params), params)); 60 | 61 | return R.ok().put("data", page); 62 | } 63 | 64 | /** 65 | * 前端列表 66 | */ 67 | @IgnoreAuth 68 | @RequestMapping("/list") 69 | public R list(@RequestParam Map params,NewsEntity news, HttpServletRequest request){ 70 | EntityWrapper ew = new EntityWrapper(); 71 | PageUtils page = newsService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, news), params), params)); 72 | return R.ok().put("data", page); 73 | } 74 | 75 | /** 76 | * 列表 77 | */ 78 | @RequestMapping("/lists") 79 | public R list( NewsEntity news){ 80 | EntityWrapper ew = new EntityWrapper(); 81 | ew.allEq(MPUtil.allEQMapPre( news, "news")); 82 | return R.ok().put("data", newsService.selectListView(ew)); 83 | } 84 | 85 | /** 86 | * 查询 87 | */ 88 | @RequestMapping("/query") 89 | public R query(NewsEntity news){ 90 | EntityWrapper< NewsEntity> ew = new EntityWrapper< NewsEntity>(); 91 | ew.allEq(MPUtil.allEQMapPre( news, "news")); 92 | NewsView newsView = newsService.selectView(ew); 93 | return R.ok("查询竞拍公告成功").put("data", newsView); 94 | } 95 | 96 | /** 97 | * 后端详情 98 | */ 99 | @RequestMapping("/info/{id}") 100 | public R info(@PathVariable("id") Long id){ 101 | NewsEntity news = newsService.selectById(id); 102 | return R.ok().put("data", news); 103 | } 104 | 105 | /** 106 | * 前端详情 107 | */ 108 | @IgnoreAuth 109 | @RequestMapping("/detail/{id}") 110 | public R detail(@PathVariable("id") Long id){ 111 | NewsEntity news = newsService.selectById(id); 112 | return R.ok().put("data", news); 113 | } 114 | 115 | 116 | 117 | 118 | /** 119 | * 后端保存 120 | */ 121 | @RequestMapping("/save") 122 | public R save(@RequestBody NewsEntity news, HttpServletRequest request){ 123 | news.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue()); 124 | //ValidatorUtils.validateEntity(news); 125 | newsService.insert(news); 126 | return R.ok(); 127 | } 128 | 129 | /** 130 | * 前端保存 131 | */ 132 | @RequestMapping("/add") 133 | public R add(@RequestBody NewsEntity news, HttpServletRequest request){ 134 | news.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue()); 135 | //ValidatorUtils.validateEntity(news); 136 | newsService.insert(news); 137 | return R.ok(); 138 | } 139 | 140 | /** 141 | * 修改 142 | */ 143 | @RequestMapping("/update") 144 | public R update(@RequestBody NewsEntity news, HttpServletRequest request){ 145 | //ValidatorUtils.validateEntity(news); 146 | newsService.updateById(news);//全部更新 147 | return R.ok(); 148 | } 149 | 150 | 151 | /** 152 | * 删除 153 | */ 154 | @RequestMapping("/delete") 155 | public R delete(@RequestBody Long[] ids){ 156 | newsService.deleteBatchIds(Arrays.asList(ids)); 157 | return R.ok(); 158 | } 159 | 160 | /** 161 | * 提醒接口 162 | */ 163 | @RequestMapping("/remind/{columnName}/{type}") 164 | public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request, 165 | @PathVariable("type") String type,@RequestParam Map map) { 166 | map.put("column", columnName); 167 | map.put("type", type); 168 | 169 | if(type.equals("2")) { 170 | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); 171 | Calendar c = Calendar.getInstance(); 172 | Date remindStartDate = null; 173 | Date remindEndDate = null; 174 | if(map.get("remindstart")!=null) { 175 | Integer remindStart = Integer.parseInt(map.get("remindstart").toString()); 176 | c.setTime(new Date()); 177 | c.add(Calendar.DAY_OF_MONTH,remindStart); 178 | remindStartDate = c.getTime(); 179 | map.put("remindstart", sdf.format(remindStartDate)); 180 | } 181 | if(map.get("remindend")!=null) { 182 | Integer remindEnd = Integer.parseInt(map.get("remindend").toString()); 183 | c.setTime(new Date()); 184 | c.add(Calendar.DAY_OF_MONTH,remindEnd); 185 | remindEndDate = c.getTime(); 186 | map.put("remindend", sdf.format(remindEndDate)); 187 | } 188 | } 189 | 190 | Wrapper wrapper = new EntityWrapper(); 191 | if(map.get("remindstart")!=null) { 192 | wrapper.ge(columnName, map.get("remindstart")); 193 | } 194 | if(map.get("remindend")!=null) { 195 | wrapper.le(columnName, map.get("remindend")); 196 | } 197 | 198 | 199 | int count = newsService.selectCount(wrapper); 200 | return R.ok().put("count", count); 201 | } 202 | 203 | 204 | 205 | } 206 | -------------------------------------------------------------------------------- /mvnw.cmd: -------------------------------------------------------------------------------- 1 | @REM ---------------------------------------------------------------------------- 2 | @REM Licensed to the Apache Software Foundation (ASF) under one 3 | @REM or more contributor license agreements. See the NOTICE file 4 | @REM distributed with this work for additional information 5 | @REM regarding copyright ownership. The ASF licenses this file 6 | @REM to you under the Apache License, Version 2.0 (the 7 | @REM "License"); you may not use this file except in compliance 8 | @REM with the License. You may obtain a copy of the License at 9 | @REM 10 | @REM https://www.apache.org/licenses/LICENSE-2.0 11 | @REM 12 | @REM Unless required by applicable law or agreed to in writing, 13 | @REM software distributed under the License is distributed on an 14 | @REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | @REM KIND, either express or implied. See the License for the 16 | @REM specific language governing permissions and limitations 17 | @REM under the License. 18 | @REM ---------------------------------------------------------------------------- 19 | 20 | @REM ---------------------------------------------------------------------------- 21 | @REM Maven2 Start Up Batch script 22 | @REM 23 | @REM Required ENV vars: 24 | @REM JAVA_HOME - location of a JDK home dir 25 | @REM 26 | @REM Optional ENV vars 27 | @REM M2_HOME - location of maven2's installed home dir 28 | @REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands 29 | @REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a key stroke before ending 30 | @REM MAVEN_OPTS - parameters passed to the Java VM when running Maven 31 | @REM e.g. to debug Maven itself, use 32 | @REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000 33 | @REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files 34 | @REM ---------------------------------------------------------------------------- 35 | 36 | @REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on' 37 | @echo off 38 | @REM set title of command window 39 | title %0 40 | @REM enable echoing by setting MAVEN_BATCH_ECHO to 'on' 41 | @if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO% 42 | 43 | @REM set %HOME% to equivalent of $HOME 44 | if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%") 45 | 46 | @REM Execute a user defined script before this one 47 | if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre 48 | @REM check for pre script, once with legacy .bat ending and once with .cmd ending 49 | if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat" 50 | if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd" 51 | :skipRcPre 52 | 53 | @setlocal 54 | 55 | set ERROR_CODE=0 56 | 57 | @REM To isolate internal variables from possible post scripts, we use another setlocal 58 | @setlocal 59 | 60 | @REM ==== START VALIDATION ==== 61 | if not "%JAVA_HOME%" == "" goto OkJHome 62 | 63 | echo. 64 | echo Error: JAVA_HOME not found in your environment. >&2 65 | echo Please set the JAVA_HOME variable in your environment to match the >&2 66 | echo location of your Java installation. >&2 67 | echo. 68 | goto error 69 | 70 | :OkJHome 71 | if exist "%JAVA_HOME%\bin\java.exe" goto init 72 | 73 | echo. 74 | echo Error: JAVA_HOME is set to an invalid directory. >&2 75 | echo JAVA_HOME = "%JAVA_HOME%" >&2 76 | echo Please set the JAVA_HOME variable in your environment to match the >&2 77 | echo location of your Java installation. >&2 78 | echo. 79 | goto error 80 | 81 | @REM ==== END VALIDATION ==== 82 | 83 | :init 84 | 85 | @REM Find the project base dir, i.e. the directory that contains the folder ".mvn". 86 | @REM Fallback to current working directory if not found. 87 | 88 | set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR% 89 | IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir 90 | 91 | set EXEC_DIR=%CD% 92 | set WDIR=%EXEC_DIR% 93 | :findBaseDir 94 | IF EXIST "%WDIR%"\.mvn goto baseDirFound 95 | cd .. 96 | IF "%WDIR%"=="%CD%" goto baseDirNotFound 97 | set WDIR=%CD% 98 | goto findBaseDir 99 | 100 | :baseDirFound 101 | set MAVEN_PROJECTBASEDIR=%WDIR% 102 | cd "%EXEC_DIR%" 103 | goto endDetectBaseDir 104 | 105 | :baseDirNotFound 106 | set MAVEN_PROJECTBASEDIR=%EXEC_DIR% 107 | cd "%EXEC_DIR%" 108 | 109 | :endDetectBaseDir 110 | 111 | IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig 112 | 113 | @setlocal EnableExtensions EnableDelayedExpansion 114 | for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a 115 | @endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS% 116 | 117 | :endReadAdditionalConfig 118 | 119 | SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe" 120 | set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar" 121 | set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain 122 | 123 | set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar" 124 | 125 | FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO ( 126 | IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B 127 | ) 128 | 129 | @REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central 130 | @REM This allows using the maven wrapper in projects that prohibit checking in binary data. 131 | if exist %WRAPPER_JAR% ( 132 | if "%MVNW_VERBOSE%" == "true" ( 133 | echo Found %WRAPPER_JAR% 134 | ) 135 | ) else ( 136 | if not "%MVNW_REPOURL%" == "" ( 137 | SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar" 138 | ) 139 | if "%MVNW_VERBOSE%" == "true" ( 140 | echo Couldn't find %WRAPPER_JAR%, downloading it ... 141 | echo Downloading from: %DOWNLOAD_URL% 142 | ) 143 | 144 | powershell -Command "&{"^ 145 | "$webclient = new-object System.Net.WebClient;"^ 146 | "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^ 147 | "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^ 148 | "}"^ 149 | "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^ 150 | "}" 151 | if "%MVNW_VERBOSE%" == "true" ( 152 | echo Finished downloading %WRAPPER_JAR% 153 | ) 154 | ) 155 | @REM End of extension 156 | 157 | @REM Provide a "standardized" way to retrieve the CLI args that will 158 | @REM work with both Windows and non-Windows executions. 159 | set MAVEN_CMD_LINE_ARGS=%* 160 | 161 | %MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %* 162 | if ERRORLEVEL 1 goto error 163 | goto end 164 | 165 | :error 166 | set ERROR_CODE=1 167 | 168 | :end 169 | @endlocal & set ERROR_CODE=%ERROR_CODE% 170 | 171 | if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost 172 | @REM check for post script, once with legacy .bat ending and once with .cmd ending 173 | if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat" 174 | if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd" 175 | :skipRcPost 176 | 177 | @REM pause the script if MAVEN_BATCH_PAUSE is set to 'on' 178 | if "%MAVEN_BATCH_PAUSE%" == "on" pause 179 | 180 | if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE% 181 | 182 | exit /B %ERROR_CODE% 183 | -------------------------------------------------------------------------------- /src/main/java/com/controller/PaimaishangpinController.java: -------------------------------------------------------------------------------- 1 | package com.controller; 2 | 3 | import java.text.SimpleDateFormat; 4 | import java.util.ArrayList; 5 | import java.util.Arrays; 6 | import java.util.Calendar; 7 | import java.util.Map; 8 | import java.util.HashMap; 9 | import java.util.Iterator; 10 | import java.util.Date; 11 | import java.util.List; 12 | import javax.servlet.http.HttpServletRequest; 13 | 14 | import com.utils.ValidatorUtils; 15 | import org.apache.commons.lang3.StringUtils; 16 | import org.springframework.beans.factory.annotation.Autowired; 17 | import org.springframework.web.bind.annotation.PathVariable; 18 | import org.springframework.web.bind.annotation.RequestBody; 19 | import org.springframework.web.bind.annotation.RequestMapping; 20 | import org.springframework.web.bind.annotation.RequestParam; 21 | import org.springframework.web.bind.annotation.RestController; 22 | import com.baomidou.mybatisplus.mapper.EntityWrapper; 23 | import com.baomidou.mybatisplus.mapper.Wrapper; 24 | import com.annotation.IgnoreAuth; 25 | 26 | import com.entity.PaimaishangpinEntity; 27 | import com.entity.view.PaimaishangpinView; 28 | 29 | import com.service.PaimaishangpinService; 30 | import com.service.TokenService; 31 | import com.utils.PageUtils; 32 | import com.utils.R; 33 | import com.utils.MD5Util; 34 | import com.utils.MPUtil; 35 | import com.utils.CommonUtil; 36 | 37 | 38 | /** 39 | * 拍卖商品 40 | * 后端接口 41 | * @author 42 | * @email 43 | * @date 2021-02-03 16:07:05 44 | */ 45 | @RestController 46 | @RequestMapping("/paimaishangpin") 47 | public class PaimaishangpinController { 48 | @Autowired 49 | private PaimaishangpinService paimaishangpinService; 50 | 51 | 52 | 53 | /** 54 | * 后端列表 55 | */ 56 | @RequestMapping("/page") 57 | public R page(@RequestParam Map params,PaimaishangpinEntity paimaishangpin, HttpServletRequest request){ 58 | EntityWrapper ew = new EntityWrapper(); 59 | PageUtils page = paimaishangpinService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, paimaishangpin), params), params)); 60 | 61 | return R.ok().put("data", page); 62 | } 63 | 64 | /** 65 | * 前端列表 66 | */ 67 | @IgnoreAuth 68 | @RequestMapping("/list") 69 | public R list(@RequestParam Map params,PaimaishangpinEntity paimaishangpin, HttpServletRequest request){ 70 | EntityWrapper ew = new EntityWrapper(); 71 | PageUtils page = paimaishangpinService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, paimaishangpin), params), params)); 72 | return R.ok().put("data", page); 73 | } 74 | 75 | /** 76 | * 列表 77 | */ 78 | @RequestMapping("/lists") 79 | public R list( PaimaishangpinEntity paimaishangpin){ 80 | EntityWrapper ew = new EntityWrapper(); 81 | ew.allEq(MPUtil.allEQMapPre( paimaishangpin, "paimaishangpin")); 82 | return R.ok().put("data", paimaishangpinService.selectListView(ew)); 83 | } 84 | 85 | /** 86 | * 查询 87 | */ 88 | @RequestMapping("/query") 89 | public R query(PaimaishangpinEntity paimaishangpin){ 90 | EntityWrapper< PaimaishangpinEntity> ew = new EntityWrapper< PaimaishangpinEntity>(); 91 | ew.allEq(MPUtil.allEQMapPre( paimaishangpin, "paimaishangpin")); 92 | PaimaishangpinView paimaishangpinView = paimaishangpinService.selectView(ew); 93 | return R.ok("查询拍卖商品成功").put("data", paimaishangpinView); 94 | } 95 | 96 | /** 97 | * 后端详情 98 | */ 99 | @RequestMapping("/info/{id}") 100 | public R info(@PathVariable("id") Long id){ 101 | PaimaishangpinEntity paimaishangpin = paimaishangpinService.selectById(id); 102 | return R.ok().put("data", paimaishangpin); 103 | } 104 | 105 | /** 106 | * 前端详情 107 | */ 108 | @RequestMapping("/detail/{id}") 109 | public R detail(@PathVariable("id") Long id){ 110 | PaimaishangpinEntity paimaishangpin = paimaishangpinService.selectById(id); 111 | return R.ok().put("data", paimaishangpin); 112 | } 113 | 114 | 115 | 116 | 117 | /** 118 | * 后端保存 119 | */ 120 | @RequestMapping("/save") 121 | public R save(@RequestBody PaimaishangpinEntity paimaishangpin, HttpServletRequest request){ 122 | paimaishangpin.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue()); 123 | //ValidatorUtils.validateEntity(paimaishangpin); 124 | paimaishangpinService.insert(paimaishangpin); 125 | return R.ok(); 126 | } 127 | 128 | /** 129 | * 前端保存 130 | */ 131 | @RequestMapping("/add") 132 | public R add(@RequestBody PaimaishangpinEntity paimaishangpin, HttpServletRequest request){ 133 | paimaishangpin.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue()); 134 | //ValidatorUtils.validateEntity(paimaishangpin); 135 | paimaishangpinService.insert(paimaishangpin); 136 | return R.ok(); 137 | } 138 | 139 | /** 140 | * 修改 141 | */ 142 | @RequestMapping("/update") 143 | public R update(@RequestBody PaimaishangpinEntity paimaishangpin, HttpServletRequest request){ 144 | //ValidatorUtils.validateEntity(paimaishangpin); 145 | paimaishangpinService.updateById(paimaishangpin);//全部更新 146 | return R.ok(); 147 | } 148 | 149 | 150 | /** 151 | * 删除 152 | */ 153 | @RequestMapping("/delete") 154 | public R delete(@RequestBody Long[] ids){ 155 | paimaishangpinService.deleteBatchIds(Arrays.asList(ids)); 156 | return R.ok(); 157 | } 158 | 159 | /** 160 | * 提醒接口 161 | */ 162 | @RequestMapping("/remind/{columnName}/{type}") 163 | public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request, 164 | @PathVariable("type") String type,@RequestParam Map map) { 165 | map.put("column", columnName); 166 | map.put("type", type); 167 | 168 | if(type.equals("2")) { 169 | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); 170 | Calendar c = Calendar.getInstance(); 171 | Date remindStartDate = null; 172 | Date remindEndDate = null; 173 | if(map.get("remindstart")!=null) { 174 | Integer remindStart = Integer.parseInt(map.get("remindstart").toString()); 175 | c.setTime(new Date()); 176 | c.add(Calendar.DAY_OF_MONTH,remindStart); 177 | remindStartDate = c.getTime(); 178 | map.put("remindstart", sdf.format(remindStartDate)); 179 | } 180 | if(map.get("remindend")!=null) { 181 | Integer remindEnd = Integer.parseInt(map.get("remindend").toString()); 182 | c.setTime(new Date()); 183 | c.add(Calendar.DAY_OF_MONTH,remindEnd); 184 | remindEndDate = c.getTime(); 185 | map.put("remindend", sdf.format(remindEndDate)); 186 | } 187 | } 188 | 189 | Wrapper wrapper = new EntityWrapper(); 190 | if(map.get("remindstart")!=null) { 191 | wrapper.ge(columnName, map.get("remindstart")); 192 | } 193 | if(map.get("remindend")!=null) { 194 | wrapper.le(columnName, map.get("remindend")); 195 | } 196 | 197 | 198 | int count = paimaishangpinService.selectCount(wrapper); 199 | return R.ok().put("count", count); 200 | } 201 | 202 | 203 | 204 | } 205 | --------------------------------------------------------------------------------