JAVAEE——ssm綜合練習:CRM系統(包含ssm整合)

来源:https://www.cnblogs.com/xieyupeng/archive/2018/07/11/9297264.html
-Advertisement-
Play Games

1 CRM項目外觀 1 CRM項目外觀 1. 開發環境 IDE: Eclipse Mars2 Jdk: 1.7 資料庫: MySQL 2. 創建資料庫 資料庫sql文件位置如下圖: 創建crm資料庫,執行sql 效果如下圖: 3. 工程搭建 使用的Bootstrap前端框架,官方網站 http:// ...


CRM項目外觀

 

 

 

1. 開發環境

IDE Eclipse Mars2 

Jdk: 1.7

資料庫: MySQL

2. 創建資料庫

資料庫sql文件位置如下圖:

 

 

 

創建crm資料庫,執行sql

 

 

效果如下圖:

 

 

3. 工程搭建

使用的Bootstrap前端框架,官方網站

http://www.bootcss.com/

 

工程使用Springmvcspringmybatis框架整合完成。

 

3.1. 需要的jar

  1. spring(包括springmvc
  2. mybatis
  3. mybatis-spring整合包
  4. 資料庫驅動
  5. 第三方連接池。
  6. Json依賴包Jackson

 

jar包位置如下圖:

 

 

3.2. 整合思路

Dao層:

1、SqlMapConfig.xml,空文件即可,但是需要文件頭。

2、applicationContext-dao.xml

a) 資料庫連接Druid

b) SqlSessionFactory對象,需要springmybatis整合包下的。

c) 配置mapper文件掃描器。Mapper動態代理開發 增強版

 

Service層:

1、applicationContext-service.xml包掃描器,掃描@service註解的類。

2、applicationContext-trans.xml配置事務。

 

Controller層:

1、Springmvc.xml

a) 包掃描器,掃描@Controller註解的類。

b) 配置註解驅動

c) 配置視圖解析器

 

Web.xml文件:

1、配置spring監聽器

2、配置前端控制器。

 

3.3. 創建工程

創建動態web工程,步驟如下圖:

 

 

 

創建boot-crm,如下圖

 

 

 

3.4. 加入jar

加入課前資料中的jar

 

3.5. 加入配置文件

創建config資源文件夾,在裡面創建mybatisspring文件夾

3.5.1. SqlMapConfig.xml

空文件即可

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>

</configuration>

當然也可以加上包別名,在後面的Mapper xml文件中可以不用寫全類名

<typeAliases>
<package name="com.xyp.crm.entity"/>
</typeAliases>

 

3.5.2. applicationContext-dao.xml

需要配置:

載入properties文件,數據源,SqlSessionFactoryMapper掃描

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:context="http://www.springframework.org/schema/context" xmlns:p="http://www.springframework.org/schema/p"
    xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
    http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsd
    http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.0.xsd
    http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-4.0.xsd">

    <!-- 配置 讀取properties文件 jdbc.properties -->
    <context:property-placeholder location="classpath:jdbc.properties" />

    <!-- 配置 數據源 -->
    <bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource">
        <property name="driverClassName" value="${jdbc.driver}" />
        <property name="url" value="${jdbc.url}" />
        <property name="username" value="${jdbc.username}" />
        <property name="password" value="${jdbc.password}" />
    </bean>

    <!-- 配置SqlSessionFactory -->
    <bean class="org.mybatis.spring.SqlSessionFactoryBean">
        <!-- 設置MyBatis核心配置文件 -->
        <property name="configLocation" value="classpath:mybatis/SqlMapConfig.xml" />
        <!-- 設置數據源 -->
        <property name="dataSource" ref="dataSource" />
    </bean>

    <!-- 配置Mapper掃描 -->
    <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
        <!-- 設置Mapper掃描包 -->
        <property name="basePackage" value="cn.itcast.crm.mapper" />
    </bean>
</beans>

 

 

3.5.3. jdbc.properties

配置資料庫信息

jdbc.driver=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://localhost:3306/crm?characterEncoding=utf-8
jdbc.username=root
jdbc.password=root

 

 

3.5.4. log4j.properties

配置日誌信息

# Global logging configuration
log4j.rootLogger=DEBUG, stdout
# Console output...
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%5p [%t] - %m%n

 

 

3.5.5. applicationContext-service.xml

配置service掃描

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:context="http://www.springframework.org/schema/context" xmlns:p="http://www.springframework.org/schema/p"
    xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
    http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsd
    http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.0.xsd
    http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-4.0.xsd">

    <!-- 配置Service掃描 -->
    <context:component-scan base-package="cn.itcast.crm.service" />
</beans>

 

 

3.5.6. applicationContext-trans.xml

配置事務管理:事務管理器、通知、切麵

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:context="http://www.springframework.org/schema/context" xmlns:p="http://www.springframework.org/schema/p"
    xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
    http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsd
    http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.0.xsd
    http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-4.0.xsd">

    <!-- 事務管理器 -->
    <bean id="transactionManager"    class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
        <!-- 數據源 -->
        <property name="dataSource" ref="dataSource" />
    </bean>

    <!-- 通知 -->
    <tx:advice id="txAdvice" transaction-manager="transactionManager">
        <tx:attributes>
            <!-- 傳播行為 -->
            <tx:method name="save*" propagation="REQUIRED" />
            <tx:method name="insert*" propagation="REQUIRED" />
            <tx:method name="add*" propagation="REQUIRED" />
            <tx:method name="create*" propagation="REQUIRED" />
            <tx:method name="delete*" propagation="REQUIRED" />
            <tx:method name="update*" propagation="REQUIRED" />
            <tx:method name="find*" propagation="SUPPORTS" read-only="true" />
            <tx:method name="select*" propagation="SUPPORTS" read-only="true" />
            <tx:method name="get*" propagation="SUPPORTS" read-only="true" />
            <tx:method name="query*" propagation="SUPPORTS" read-only="true" />
        </tx:attributes>
    </tx:advice>

    <!-- 切麵 -->
    <aop:config>
        <aop:advisor advice-ref="txAdvice"
            pointcut="execution(* cn.itcast.crm.service.*.*(..))" />
    </aop:config>

</beans>

 

 

3.5.7. Springmvc.xml

配置SpringMVC表現層:Controller掃描、註解驅動、視圖解析器

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
    xmlns:context="http://www.springframework.org/schema/context"
    xmlns:mvc="http://www.springframework.org/schema/mvc"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
        http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd
        http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsd">
    <!-- 配置Controller掃描 -->
    <context:component-scan base-package="cn.itcast.crm.controller" />

    <!-- 配置註解驅動 -->
    <mvc:annotation-driven />

    <!-- 配置視圖解析器 -->
    <bean    class="org.springframework.web.servlet.view.InternalResourceViewResolver">
        <!-- 首碼 -->
        <property name="prefix" value="/WEB-INF/jsp/" />
        <!-- 尾碼 -->
        <property name="suffix" value=".jsp" />
    </bean>
</beans>

 

 

3.5.8. Web.xml

配置SpringSpringMVC、解決post亂碼問題

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns="http://java.sun.com/xml/ns/javaee"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
    id="WebApp_ID" version="2.5">
    <display-name>boot-crm</display-name>
    <welcome-file-list>
        <welcome-file>index.jsp</welcome-file>
    </welcome-file-list>

    <!-- 配置spring -->
    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>classpath:spring/applicationContext-*.xml</param-value>
    </context-param>

    <!-- 配置監聽器載入spring -->
    <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>

    <!-- 配置過濾器,解決post的亂碼問題 -->
    <filter>
        <filter-name>encoding</filter-name>    <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
        <init-param>
            <param-name>Encoding</param-name>
            <param-value>utf-8</param-value>
        </init-param>
    </filter>
    <filter-mapping>
        <filter-name>encoding</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>

    <!-- 配置SpringMVC -->
    <servlet>
        <servlet-name>boot-crm</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <init-param>
            <param-name>contextConfigLocation</param-name>
            <param-value>classpath:spring/springmvc.xml</param-value>
        </init-param>
        <!-- 配置springmvc什麼時候啟動,參數必須為整數 -->
        <!-- 如果為0或者大於0,則springMVC隨著容器啟動而啟動 -->
        <!-- 如果小於0,則在第一次請求進來的時候啟動 -->
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>boot-crm</servlet-name>
        <!-- 所有的請求都進入springMVC -->
        <url-pattern>/</url-pattern>
    </servlet-mapping>
</web-app>

 

3.6. 加入靜態資源

最終效果如下圖:

 

 

4. 實現頁面展示

4.1. 代碼實現

編寫CustomerController 顯示用戶列表

@Controller
@RequestMapping("customer")
public class CustomerController {

    /**
     * 顯示用戶列表
     * 
     * @return
     */
    @RequestMapping("list")
    public String queryCustomerList() {
        return "customer";
    }

}

 

 

4.2. 頁面顯示問題

訪問頁面,發現不能正常顯示

 

 

打開開發者工具,選擇Network

發現cssjs等資源文件無法載入

 

 

 

原因:web.xml配置時,是設置所有的請求都進入SpringMVC。但是SpringMVC    無法處理cssjs等靜態資源,所以無法正常顯示

 

解決方案:

 

方法一:通過mvc:resources

    <!-- 對靜態資源進行放行 -->
    <mvc:resources location="/css/" mapping="/css/**"/>
    <mvc:resources location="/fonts/" mapping="/fonts/**"/>
    <mvc:resources location="/js/" mapping="/js/**"/>

 

 

方法二:

springmvc.xml中配置

    <!-- 解決靜態資源無法被springMVC處理的問題 -->
    <mvc:default-servlet-handler />

 方法三:

修改web.xml,讓所有以action結尾的請求都進入SpringMVC

    <servlet-mapping>
        <servlet-name>boot-crm</servlet-name>
        <!-- 所有的請求都進入springMVC -->
        <url-pattern>*.action</url-pattern>
    </servlet-mapping>

 

 

解決後的效果如下圖,可以正常顯示頁面樣式:

 

 

 

我們使用第二種方式解決,因為此項目中的頁面的請求都是以action結尾的,所以使用第二種方式,在web.xml裡面進行相應的配置

    <servlet-mapping>
        <servlet-name>boot-crm</servlet-name>
        <!-- 所有以action結尾的請求都進入springMVC -->
        <url-pattern>*.action</url-pattern>
    </servlet-mapping>

 

 

5. 實現查詢條件初始化

5.1. 需求分析

 

 

頁面效果如上圖,在查詢客戶的時候,可以選擇客戶來源,所屬行業,客戶級別信息,頁面載入時需要初始化查詢條件下拉列表。

 

前端jsp邏輯

<form class="form-inline" action="${pageContext.request.contextPath }/customer/list.action" method="get">
    <div class="form-group">
        <label for="customerName">客戶名稱</label> 
        <input type="text" class="form-control" id="customerName" value="${custName }" name="custName">
    </div>
    <div class="form-group">
        <label for="customerFrom">客戶來源</label> 
        <select    class="form-control" id="customerFrom" placeholder="客戶來源" name="custSource">
            <option value="">--請選擇--</option>
            <c:forEach items="${fromType}" var="item">
                <option value="${item.dict_id}"<c:if test="${item.dict_id == custSource}"> selected</c:if>>${item.dict_item_name }</option>
            </c:forEach>
        </select>
    </div>
    <div class="form-group">
        <label for="custIndustry">所屬行業</label> 
        <select    class="form-control" id="custIndustry"  name="custIndustry">
            <option value="">--請選擇--</option>
            <c:forEach items="${industryType}" var="item">
                <option value="${item.dict_id}"<c:if test="${item.dict_id == custIndustry}"> selected</c:if>>${item.dict_item_name }</option>
            </c:forEach>
        </select>
    </div>
    <div class="form-group">
        <label for="custLevel">客戶級別</label>
        <select    class="form-control" id="custLevel" name="custLevel">
            <option value="">--請選擇--</option>
            <c:forEach items="${levelType}" var="item">
                <option value="${item.dict_id}"<c:if test="${item.dict_id == custLevel}"> selected</c:if>>${item.dict_item_name }</option>
            </c:forEach>
        </select>
    </div>
    <button type="submit" class="btn btn-primary">查詢</button>
</form>

 

按照jsp的要求,把對應的數據查詢出來,放到模型中。

數據存放在base_dict表,可以使用dict_type_code類別代碼進行查詢

使用需要獲取的數據如下圖:

 

 

 

使用的sql:

SELECT * FROM base_dict WHERE dict_type_code = '001'

 

5.2. 實現DAO開發

5.2.1. pojo

因為頁面顯示的名字是下劃線方式,和資料庫表列名一樣,根據頁面的樣式,編寫pojo

public class BaseDict {
    private String dict_id;
    private String dict_type_code;
    private String dict_type_name;
    private String dict_item_name;
    private String dict_item_code;
    private Integer dict_sort;
    private String dict_enable;
    private String dict_memo;
get/set。。。。。。
}

 

5.2.2. Mapper

編寫BaseDictMapper

public interface BaseDictMapper {
    /**
     * 根據類別代碼查詢數據
     * 
     * @param dictTypeCode
     * @return
     */
    List<BaseDict> queryBaseDictByDictTypeCode(String dictTypeCode);
    
}

 

 

5.2.3. Mapper.xml

編寫BaseDictMapper.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="cn.itcast.crm.mapper.BaseDictMapper">

    <!-- 根據類別代碼查詢數據 -->
    <select id="queryBaseDictByDictTypeCode" parameterType="String"
        resultType="cn.itcast.crm.pojo.BaseDict">
        SELECT * FROM base_dict WHERE dict_type_code =
        #{dict_type_code}
    </select>

</mapper>

 

5.3. 實現Service開發

5.3.1. BaseDictService 介面

public interface BaseDictService {

    /**
     * 根據類別代碼查詢
     * 
     * @param dictTypeCode
     * @return
     */
    List<BaseDict> queryBaseDictByDictTypeCode(String dictTypeCode);
}

 

 

5.3.2. BaseDictServiceImpl 實現類

@Service
public class BaseDictServiceImpl implements BaseDictService {

    @Autowired
    private BaseDictMapper baseDictMapper;

    @Override
    public List<BaseDict> queryBaseDictByDictTypeCode(String dictTypeCode) {

        List<BaseDict> list = this.baseDictMapper.queryBaseDictByDictTypeCode(dictTypeCode);
        return list;
    }
}
您的分享是我們最大的動力!

-Advertisement-
Play Games
更多相關文章
  • 先上一張JVM體繫結構圖: 1)運行時數據區:經過編譯生成的位元組碼文件(class文件),由class loader(類載入子系統)載入後交給執行引擎執行。在執行引擎執行的過程中產生的數據會存儲在一塊記憶體區域。這塊記憶體區域就是運行時區域 2)程式計數器:用於記錄當前線程的正在執行的位元組碼指令位置。由 ...
  • 本人用的是ubuntu16.04 64位版伺服器,其他Linux伺服器大同小異 所需軟體在本文末尾提供永久下載鏈接 一、創建用用戶: 1.添加用戶: 2.設置用戶密碼: 3.將用戶添加到用戶組: 4.為用戶添加許可權: 在 root ALL=(ALL:ALL) 下添加下邊代碼,不要註釋這句代碼! 5. ...
  • 常用快捷鍵 全部快捷鍵 1、編輯(Editing) 2、查找/替換(Search/Replace) 3、運行(Running) 4、調試(Debugging) 5、導航(Navigation) 6、搜索相關(Usage Search) 7、重構(Refactoring) 8、控制VCS/Local ...
  • import randomflag = 1try_=0while (flag): try_ +=1 yan = "" for i in range(0,4): cun=random.randrange(1,4) if cun==i: tmp=chr(random.randint(65,90)) el ...
  • 本文介紹整數編碼,主要討論無符號整數和有符號整數的編碼不同所帶來的一些理解上的問題。無符號整數編碼很容易理解,因其沒有符號位,在二進位無符號整數轉為十進位數時,每一位上的數字(0或1)乘以該為的權值2w-1(w從1開始),然後相加即可。對於有符號整數,最高位為符號位,符號位的權值決定了正負。有符號整 ...
  • 一、什麼是繼承 繼承是一種創建類的方法,在python中,一個類可以繼承來自一個或多個父。原始類稱為基類或超類。 二、什麼時候使用繼承 在已經創建的幾個類中,這幾哥類中的方法和變數有相同的,這種時候我們就可以使用類的繼承,將其它類中已有的方法和變數通過繼承的方式,在新創建的類中,使用正常的方式就可以 ...
  • defer 匿名函數特性 執行方式類似其它語言中的析構函數,在函數體執行結束後按照調用順序的 逐個執行 即使函數發生 也會執行,類似於try...except 常用於 資源清理,文件關閉,解鎖以及記錄時間等操作 支持匿名函數的調用 通過於匿名函數配合可在return之後修改函數計算的結果 如果函數體 ...
  • 其實我是一直都想早點兒寫點兒學習筆記的,但是太懶了一直拖到了今天,好吧我已經學習了java一個月了,說一下自己的學習經歷,當做一遍複習和鞏固了! 使用cmd在開始運行欄上列印出來: 然後下麵有幾個關於黑視窗的小技巧記一下: a.清屏:cls; 例如:C:\ >cls,然後按回車鍵。 b.切換盤符:: ...
一周排行
    -Advertisement-
    Play Games
  • 移動開發(一):使用.NET MAUI開發第一個安卓APP 對於工作多年的C#程式員來說,近來想嘗試開發一款安卓APP,考慮了很久最終選擇使用.NET MAUI這個微軟官方的框架來嘗試體驗開發安卓APP,畢竟是使用Visual Studio開發工具,使用起來也比較的順手,結合微軟官方的教程進行了安卓 ...
  • 前言 QuestPDF 是一個開源 .NET 庫,用於生成 PDF 文檔。使用了C# Fluent API方式可簡化開發、減少錯誤並提高工作效率。利用它可以輕鬆生成 PDF 報告、發票、導出文件等。 項目介紹 QuestPDF 是一個革命性的開源 .NET 庫,它徹底改變了我們生成 PDF 文檔的方 ...
  • 項目地址 項目後端地址: https://github.com/ZyPLJ/ZYTteeHole 項目前端頁面地址: ZyPLJ/TreeHoleVue (github.com) https://github.com/ZyPLJ/TreeHoleVue 目前項目測試訪問地址: http://tree ...
  • 話不多說,直接開乾 一.下載 1.官方鏈接下載: https://www.microsoft.com/zh-cn/sql-server/sql-server-downloads 2.在下載目錄中找到下麵這個小的安裝包 SQL2022-SSEI-Dev.exe,運行開始下載SQL server; 二. ...
  • 前言 隨著物聯網(IoT)技術的迅猛發展,MQTT(消息隊列遙測傳輸)協議憑藉其輕量級和高效性,已成為眾多物聯網應用的首選通信標準。 MQTTnet 作為一個高性能的 .NET 開源庫,為 .NET 平臺上的 MQTT 客戶端與伺服器開發提供了強大的支持。 本文將全面介紹 MQTTnet 的核心功能 ...
  • Serilog支持多種接收器用於日誌存儲,增強器用於添加屬性,LogContext管理動態屬性,支持多種輸出格式包括純文本、JSON及ExpressionTemplate。還提供了自定義格式化選項,適用於不同需求。 ...
  • 目錄簡介獲取 HTML 文檔解析 HTML 文檔測試參考文章 簡介 動態內容網站使用 JavaScript 腳本動態檢索和渲染數據,爬取信息時需要模擬瀏覽器行為,否則獲取到的源碼基本是空的。 本文使用的爬取步驟如下: 使用 Selenium 獲取渲染後的 HTML 文檔 使用 HtmlAgility ...
  • 1.前言 什麼是熱更新 游戲或者軟體更新時,無需重新下載客戶端進行安裝,而是在應用程式啟動的情況下,在內部進行資源或者代碼更新 Unity目前常用熱更新解決方案 HybridCLR,Xlua,ILRuntime等 Unity目前常用資源管理解決方案 AssetBundles,Addressable, ...
  • 本文章主要是在C# ASP.NET Core Web API框架實現向手機發送驗證碼簡訊功能。這裡我選擇是一個互億無線簡訊驗證碼平臺,其實像阿裡雲,騰訊雲上面也可以。 首先我們先去 互億無線 https://www.ihuyi.com/api/sms.html 去註冊一個賬號 註冊完成賬號後,它會送 ...
  • 通過以下方式可以高效,並保證數據同步的可靠性 1.API設計 使用RESTful設計,確保API端點明確,並使用適當的HTTP方法(如POST用於創建,PUT用於更新)。 設計清晰的請求和響應模型,以確保客戶端能夠理解預期格式。 2.數據驗證 在伺服器端進行嚴格的數據驗證,確保接收到的數據符合預期格 ...