uniapp微信小程序投票系统实战 (SpringBoot2+vue3.2+element plus ) -后端架构搭建

锋哥原创的uniapp微信小程序投票系统实战:

uniapp微信小程序投票系统实战课程 (SpringBoot2+vue3.2+element plus ) ( 火爆连载更新中... )_哔哩哔哩_bilibiliuniapp微信小程序投票系统实战课程 (SpringBoot2+vue3.2+element plus ) ( 火爆连载更新中... )共计21条视频,包括:uniapp微信小程序投票系统实战课程 (SpringBoot2+vue3.2+element plus ) ( 火爆连载更新中... )、第2讲 投票项目后端架构搭建、第3讲 小程序端 TabBar搭建等,UP主更多精彩视频,请关注UP账号。icon-default.png?t=N7T8https://www.bilibili.com/video/BV1ea4y137xf/

uniapp微信小程序投票系统实战 (SpringBoot2+vue3.2+element plus ) -后端架构搭建_第1张图片

idea新建项目:java1234-vote3

pom.xml



    4.0.0
    
        org.springframework.boot
        spring-boot-starter-parent
        2.3.2.RELEASE
         
    
    com.java1234
    java1234-vote3
    0.0.1-SNAPSHOT
    java1234-vote3
    java1234-vote3

    
        1.8
    

    
        
            org.springframework.boot
            spring-boot-starter-web
        

        
            org.springframework.boot
            spring-boot-starter-validation
        


        
            org.springframework.boot
            spring-boot-devtools
            runtime
            true
        

        
            mysql
            mysql-connector-java
            runtime
        


        
        
            com.alibaba
            druid
            1.1.10
        
        
        
            com.baomidou
            mybatis-plus-boot-starter
            3.3.2
        
        
            com.baomidou
            mybatis-plus-boot-starter
            3.3.2
        

        
            com.alibaba
            fastjson
            1.2.40
        

        
        
            com.auth0
            java-jwt
            3.2.0
        
        
            io.jsonwebtoken
            jjwt
            0.9.1
        

        
            commons-io
            commons-io
            2.5
        

        
            org.projectlombok
            lombok
            true
        

        
        
            org.springframework.boot
            spring-boot-starter-data-redis
        
        
        
            org.apache.commons
            commons-pool2
        

        
        
            cn.hutool
            hutool-all
            5.3.3
        

        
        
            com.github.axet
            kaptcha
            0.0.9
        

        
        
            org.apache.httpcomponents
            httpclient
            4.5.2
        

    

    
        
            
                org.springframework.boot
                spring-boot-maven-plugin
                2.3.2.RELEASE
            
        
    

application.yml

server:
  port: 8866
  servlet:
    context-path: /

spring:
  datasource:
    type: com.alibaba.druid.pool.DruidDataSource
    driver-class-name: com.mysql.cj.jdbc.Driver
    url: jdbc:mysql://localhost:3306/db_vote3?serverTimezone=Asia/Shanghai
    username: root
    password: 123456


mybatis-plus:
  global-config:
    db-config:
      id-type: auto
  configuration:
    map-underscore-to-camel-case: true
    auto-mapping-behavior: full
    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
  mapper-locations: classpath:mapper/*.xml

uniapp微信小程序投票系统实战 (SpringBoot2+vue3.2+element plus ) -后端架构搭建_第2张图片

启动类加上,扫描mapper接口:@MapperScan("com.java1234.mapper")

项目结构;

uniapp微信小程序投票系统实战 (SpringBoot2+vue3.2+element plus ) -后端架构搭建_第3张图片


测试接口:

/**
 * 测试
 * @return
 */
@RequestMapping("/test")
public R test(){
    List list = wxUserInfoService.list();
    HashMap result=new HashMap<>();
    result.put("list",list);
    return R.ok(result);
}

浏览器地址栏输入:

http://localhost:8866/user/test



uniapp微信小程序投票系统实战 (SpringBoot2+vue3.2+element plus ) -后端架构搭建_第4张图片

测试OK

新建数据库:db_vote3

新建微信用户信息表:t_wxuserinfo

/*
SQLyog Ultimate v11.33 (64 bit)
MySQL - 5.7.18-log 
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;

create table `t_wxuserinfo` (
	`id` int (11),
	`openid` varchar (90),
	`nick_name` varchar (150),
	`avatar_url` varchar (600),
	`register_date` datetime ,
	`last_login_date` datetime ,
	`status` char (3)
); 
insert into `t_wxuserinfo` (`id`, `openid`, `nick_name`, `avatar_url`, `register_date`, `last_login_date`, `status`) values('6','o30ur5JpAsAUyGBkR0uW4IxvahR8','小锋老师@java1234','20230324082340000000882.jpeg','2023-02-27 17:48:29','2023-05-04 21:06:40','0');
insert into `t_wxuserinfo` (`id`, `openid`, `nick_name`, `avatar_url`, `register_date`, `last_login_date`, `status`) values('7','o30ur5PiPOr52bBsetXcIV93NL-U','小锋四号@java1234','20230410102248000000487.jpg','2023-04-10 10:21:30','2023-05-04 21:20:38','0');
insert into `t_wxuserinfo` (`id`, `openid`, `nick_name`, `avatar_url`, `register_date`, `last_login_date`, `status`) values('9','o30ur5JpAsAUyGBkR0uW4IxvahR0','微信用户','default.png','2023-04-30 07:42:19','2023-04-30 07:42:19','1');
insert into `t_wxuserinfo` (`id`, `openid`, `nick_name`, `avatar_url`, `register_date`, `last_login_date`, `status`) values('10','1',NULL,NULL,NULL,NULL,'1');
insert into `t_wxuserinfo` (`id`, `openid`, `nick_name`, `avatar_url`, `register_date`, `last_login_date`, `status`) values('11','2',NULL,NULL,NULL,NULL,'1');
insert into `t_wxuserinfo` (`id`, `openid`, `nick_name`, `avatar_url`, `register_date`, `last_login_date`, `status`) values('12','3',NULL,NULL,NULL,NULL,'1');
insert into `t_wxuserinfo` (`id`, `openid`, `nick_name`, `avatar_url`, `register_date`, `last_login_date`, `status`) values('13','4',NULL,NULL,NULL,NULL,'1');
insert into `t_wxuserinfo` (`id`, `openid`, `nick_name`, `avatar_url`, `register_date`, `last_login_date`, `status`) values('14','5',NULL,NULL,NULL,NULL,'1');
insert into `t_wxuserinfo` (`id`, `openid`, `nick_name`, `avatar_url`, `register_date`, `last_login_date`, `status`) values('15','6',NULL,NULL,NULL,NULL,'1');
insert into `t_wxuserinfo` (`id`, `openid`, `nick_name`, `avatar_url`, `register_date`, `last_login_date`, `status`) values('16','7',NULL,NULL,NULL,NULL,'1');
insert into `t_wxuserinfo` (`id`, `openid`, `nick_name`, `avatar_url`, `register_date`, `last_login_date`, `status`) values('17','8',NULL,NULL,NULL,NULL,'1');

(*记得要设置下主键自增)

你可能感兴趣的:(uni-app,uni-app,微信小程序,投票系统,小程序投票,uni-app投票)