为了账号安全,请及时绑定邮箱和手机立即绑定
  • springBoot开发


    645fc1eb0001348006400360.jpg
    查看全部
  • <resultMap id="Areas" type="com.imooc.demo.entyti.Area">
        <id column="area_id" jdbcType="INTEGER" property="areaId" />
        <result column="area_name" jdbcType="VARCHAR" property="areaName" />
        <result column="priority" jdbcType="INTEGER" property="priority" />
        <result column="create_time" jdbcType="DATE" property="createTime" />
        <result column="last_edit_time" jdbcType="DATE" property="lastEditTime" />
    </resultMap>
     <select id="queryArea" resultMap="Areas">
     SELECT
    area_id,
    area_name,
    priority,
    create_time,
    last_edit_time
     FROM
     td_area
     ORDER BY
    priority DESC
         </select>

        绑定代码,忽略下划线改成大写

    查看全部
  • server层为了复查dao层中的操作,与事务有关

    将增删改查整合到一起

    查看全部
    0 采集 收起 来源:service层的实现

    2022-03-16

  • gitignore配置需要git管理的文件

    查看全部
  • test失败????????

    java.lang.IllegalStateException: Failed to load ApplicationContext

    查看全部
    0 采集 收起 来源:dao层开发

    2021-07-21

  • 我的

    查看全部
    0 采集 收起 来源:课程介绍

    2021-04-08

  • mybatis配置
    查看全部
    1 采集 收起 来源:pom的配置

    2021-04-08

  • 1111

    查看全部
    0 采集 收起 来源:课程介绍

    2021-04-06

  • 配置类

    查看全部
  • dataSource.return = return dataSource;

    查看全部
  • springboot项目,除了mybatis的配置,其他配置一般都不用xml。mybatis的配置也可用java类,但是xml的方式是主流。

    查看全部
  • @controllerAdvice统一异常处理

    查看全部
  • Junit单元测试

    查看全部
    0 采集 收起 来源:dao层开发

    2021-02-13

  • springboot集成mybatise,mapper.xml的编写

    查看全部
    0 采集 收起 来源:mapper的编写

    2021-02-13

  • MenuDao层:


    package com.example.demo.dao;
    
    import com.example.demo.bean.MainMenu;
    import org.springframework.stereotype.Repository;
    
    import java.util.List;
    
    @Repository
    public interface MenuDao {
        public List<MainMenu> getMenus();
    }


    MenuController层:

    package com.example.demo.logincontroller;
    
    import com.alibaba.fastjson.JSON;
    import com.example.demo.bean.MainMenu;
    import com.example.demo.dao.MenuDao;
    import org.springframework.beans.factory.annotation.Autowired;
    import org.springframework.web.bind.annotation.RequestMapping;
    import org.springframework.web.bind.annotation.RestController;
    
    import java.util.HashMap;
    import java.util.List;
    
    @RestController
    public class MenuController {
    
        @Autowired
        MenuDao menuDao;
        @RequestMapping(value="/menus")
        public String getAllMenus(){
            System.out.println("访问成功!!!");
            HashMap<String, Object> data = new HashMap<>();
            List<MainMenu> menus = menuDao.getMenus();
            if (menus != null){
                data.put("menus", menus);
                data.put("flag", 200);
            }else{
                data.put("flag", 404);
            }
            String s = JSON.toJSONString(data);
            return s;
        }
    }


    查看全部
    0 采集 收起 来源:课程介绍

    2020-12-08

  • MenuMainMapper。xml
    
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
    <mapper namespace="com.example.demo.dao.MenuDao">
    
    <!--    关系映射-->
        <resultMap id="menuMap" type="com.example.demo.bean.MainMenu">
            <id column="id" property="id"></id>
            <result column="title" property="title"></result>
            <result column="path" property="path"></result>
            <collection property="sList" ofType="com.example.demo.bean.SubMenu">
                <id column="sid" property="id"></id>
                <result column="stitle" property="title"></result>
                <result column="spath" property="path"></result>
            </collection>
        </resultMap>
        <select id="getMenus" resultMap="menuMap">
            select mm.*,sm.id as sid ,sm.title as stitle ,sm.path as spath from
            vue_mainmenu mm ,vue_submenu sm where mm.id = mid;
        </select>
    </mapper>


    查看全部
    0 采集 收起 来源:课程介绍

    2020-12-08

  • Controller层:

    package com.example.demo.logincontroller;
    
    import com.alibaba.fastjson.JSON;
    import com.example.demo.bean.UserName;
    import com.example.demo.dao.UserNameDao;
    //import jdk.nashorn.internal.parser.JSONParser;
    import org.springframework.beans.factory.annotation.Autowired;
    import org.springframework.web.bind.annotation.RequestBody;
    import org.springframework.web.bind.annotation.RequestMapping;
    //import org.springframework.web.bind.annotation.ResponseBody;
    import org.springframework.web.bind.annotation.RestController;
    
    import java.util.HashMap;
    
    @RestController
    public class LoginController {
        @Autowired
        UserNameDao userNameDao;
    
        @RequestMapping(value="/Login")
        public String login(@RequestBody UserName username){
            String flag = "error";
            UserName userName = userNameDao.getUserNameByMassage(username.getUsername(), username.getPassword());
            HashMap<String, Object> res = new HashMap<>();
            if(userName != null){
                flag = "hello world!!!";
            }
            res.put("flag", flag);
            res.put("username", username);
            String res_json = JSON.toJSONString(res);
    //        System.out.println(userName);
            return res_json;
        }
    }


    UserNameDao层:

    package com.example.demo.dao;
    
    import com.example.demo.bean.UserName;
    import org.apache.ibatis.annotations.Param;
    import org.springframework.stereotype.Repository;
    
    @Repository
    public interface UserNameDao {
        public UserName getUserNameByMassage(@Param("username") String username, @Param("password") String password);
    }

    解决跨域:

    package com.example.demo.config;
    
    import org.springframework.context.annotation.Configuration;
    import org.springframework.web.servlet.config.annotation.CorsRegistry;
    import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
    
    /**
     * 解决跨域问题
     */
    @Configuration
    public class Config extends WebMvcConfigurerAdapter {
    
        @Override
        public void addCorsMappings(CorsRegistry registry) {
            registry.addMapping("/**")
                    .allowedOrigins("*")
                    .allowedMethods("*")
                    .allowCredentials(true)
                    .maxAge(3600);
        }
    }

    实体层bean:

    package com.example.demo.bean;
    
    public class UserName {
        private int id;
        private String username;
        private String password;
    
        public UserName(){
    
        }
    
        public UserName(String username, String password){
            this.username = username;
            this.password = password;
        }
        public int getId() {
            return id;
        }
    
        public void setId(int id) {
            this.id = id;
        }
    
        public String getUsername() {
            return username;
        }
    
        public void setUsername(String username) {
            this.username = username;
        }
    
        public String getPassword() {
            return password;
        }
    
        public void setPassword(String password) {
            this.password = password;
        }
    
        @Override
        public String toString() {
            return "UserName{" +
                    "id=" + id +
                    ", username='" + username + '\'' +
                    ", password='" + password + '\'' +
                    '}';
        }
    }


    查看全部
    0 采集 收起 来源:课程介绍

    2020-12-07

  • 草他个妈耶,真鸡儿难

    查看全部
    1 采集 收起 来源:service层的实现

    2020-10-23

  • server-contentpath
    查看全部
  • server.port
    查看全部
  •   formSubmit:function(e){

        var that = this;

        var formData = e.detail.value;

        var url = that.data.addUrl;

        if(that.data.areaId != undefined){

          formData.areaId = that.data.areaId;

          url = that.data.modifyUrl;

        }

        wx.request({

          url: url,

          data: JSON.stringify(formData),

          method:"GET",

          header: {'Content-Type':'application/json'},

          success: function(res){

            var result = res.data.success;

            var toastText = "操作成功!";

            if(result != true){

              toastText = "操作失败"+res.data.errMsg;

            }

            wx.showToast({

              title: toastText,

            })

          }

        })

      }



    查看全部
  • operation.wxml

    查看全部
首页上一页1234567下一页尾页

举报

0/150
提交
取消
课程须知
1、SpringBoot和Mybatis的非常基础的知识。 2、Jdk、Maven、Mysql、Intellij Idea的安装与配置。 3、非常基础的前端开发知识(HTML、Jquery)
老师告诉你能学到什么?
1、SpringBoot + Mybatis框架的搭建 2、单元测试 3、分层设计 4、微信小程序的基本知识及本地开发 5、前后分离及联调 6、写出健壮的程序

微信扫码,参与3人拼团

意见反馈 帮助中心 APP下载
官方微信
友情提示:

您好,此课程属于迁移课程,您已购买该课程,无需重复购买,感谢您对慕课网的支持!