<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                ``` 創建子項目springboot-dubbo-web用于單體測試mybatisplus能否操作mysql <?xml version="1.0"?> <project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.it123</groupId> <artifactId>springboot-dubbo</artifactId> <version>0.0.1-SNAPSHOT</version> </parent> <artifactId>springboot-dubbo-web</artifactId> <name>springboot-dubbo-web</name> <url>http://maven.apache.org</url> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> </properties> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>org.it123</groupId> <artifactId>springboot-dubbo-common-code</artifactId> <version>0.0.1-SNAPSHOT</version> </dependency> <dependency> <groupId>org.it123</groupId> <artifactId>springboot-dubbo-common-utils</artifactId> <version>0.0.1-SNAPSHOT</version> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-test-autoconfigure</artifactId> <scope>test</scope> </dependency> </dependencies> </project> application.properties文件內容: spring.application.name=sdubbo-web server.port=80 #???????????????°????????????/ó|????μ?????????????£???í???????????·???????????????????????????í?????????????òa???í±????·?????????í????????????? dubbo.application.name=sdubbo-web demo.service.version=1.0.0 dubbo.protocol.name=dubbo dubbo.protocol.port=20880 #????????×¢????????????????μ??????????? dubbo.registry.address=zookeeper://localhost:2181 #í3ò???????????·????????????á1???????????1????????? sdubbo-web.timeout = 5000 spring.freemarker.suffix=.html spring.freemarker.request-context-attribute=request spring.session.store-type=none spring.datasource.url=jdbc:mysql://localhost:3306/sdubbo?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false spring.datasource.username=root spring.datasource.password=root spring.datasource.driver-class-name=com.mysql.jdbc.Driver Users 實體類 package org.it123.sdubbo.web.model; import com.baomidou.mybatisplus.annotation.TableName; @TableName(value = "tab_sys_users") public class Users { private String name; private String password; public String getName() { return name; } public void setName(String name) { this.name = name; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } } UsersService 接口 package org.it123.sdubbo.web.service; import org.it123.sdubbo.web.model.Users; import org.springframework.stereotype.Service; @Service public interface UsersService { int add(Users users); } UsersServiceImpl 實現類 package org.it123.sdubbo.web.service.impl; import org.it123.sdubbo.web.dao.UsersDao; import org.it123.sdubbo.web.model.Users; import org.it123.sdubbo.web.service.UsersService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @Service public class UsersServiceImpl implements UsersService { @Autowired private UsersDao usersDao; @Override public int add(Users users) { return usersDao.insert(users); } } 操作層類 package org.it123.sdubbo.web.dao; import org.it123.sdubbo.web.model.Users; import org.springframework.stereotype.Repository; import com.baomidou.mybatisplus.core.mapper.BaseMapper; @Repository public interface UsersDao extends BaseMapper<Users> { } 控制器層 package org.it123.sdubbo.web.controller; import org.it123.sdubbo.web.model.Users; import org.it123.sdubbo.web.service.UsersService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; @RestController public class UsersController { @Autowired private UsersService usersService; @GetMapping("/demo") public String demo() { Users users = new Users(); users.setName("IT123私塾"); users.setPassword("123456"); int mum = usersService.add(users); if (mum > 0) { return "增加成功"; } else { return "增加失敗"; } } } 入口文件啟動類 package org.it123.sdubbo.web; import org.mybatis.spring.annotation.MapperScan; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import com.alibaba.dubbo.config.spring.context.annotation.EnableDubbo; @EnableDubbo @SpringBootApplication @MapperScan("org.it123.sdubbo.*.dao") public class webApplication { public static void main(String[] args) { SpringApplication.run(webApplication.class, args); } } ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看