1. 程式人生 > 實用技巧 >第02組 每週小結 (3/3)

第02組 每週小結 (3/3)

第 02 組 每週小結 (3/3)

基本情況

衝刺情況彙報

過去一週完成了哪些任務?文字/口頭描述

前端:

  • 今日熱門顯示排名
  • 安卓端篩選頁面白條消除

後端:

  • 單元測試
  • 找/修 bug

展示 GitHub 當日程式碼/文件簽入記錄

做了哪些優化和迭代

前端

  • 今日熱門顯示排名
  • 安卓端篩選頁面白條消除

後端

  • 已經將所有可提前載入事項做好了

通過自動化測試測出的 bug(如沒有可不填)

後端

  • 持久層的 addTag()報錯
org.springframework.dao.DuplicateKeyException:
### Error updating database.  Cause: java.sql.SQLIntegrityConstraintViolationException: Duplicate entry '11' for key 'PRIMARY'
### The error may exist in file [E:\what-to-eat\target\classes\mapper\TagMapper.xml]
### The error may involve defaultParameterMap
### The error occurred while setting parameters
### SQL: insert into tag(tag_id,content) values (?,?)
### Cause: java.sql.SQLIntegrityConstraintViolationException: Duplicate entry '11' for key 'PRIMARY'
; Duplicate entry '11' for key 'PRIMARY'; nested exception is java.sql.SQLIntegrityConstraintViolationException: Duplicate entry '11' for key 'PRIMARY'
  • 有效標籤統計出錯

解決了哪些 Bug,又是如何解決的(需要寫詳細)

前端

搜尋欄異常白線,是 taro-ui 的 AtSearchBar 元件樣式錯誤通過重寫這個元件的樣式把白線擠到白色區域掩蓋這個問題,真正修改需要等到 taro-ui 官方修改

filter 元件

import { View } from "@tarojs/components";
import * as React from "react";
import { AtSearchBar } from "taro-ui";
import "./filter-Navigation.scss";
import { useButtonRect, useStatusBarHeight } from "../../../util/store/size";

export default function FilterNavigation(props: {
  className: string;
  children: React.ReactNode;
  searchContent: string;
  onSearchContentChange(newValue: string): void;
  onSearch(): void;
}): JSX.Element {
  const [statusBarHeight] = useStatusBarHeight();
  const [buttonRect] = useButtonRect();
  return (
    <View className="navigation">
      <View
        className="navigation-bar"
        style={{ height: `${buttonRect.bottom + 7}px` }}
      >
        <View
          className="navigation-button"
          style={{
            marginTop: `${statusBarHeight}px`,
            width: `${buttonRect.left - 7}px`,
            height: `${buttonRect.height + 14}px`,
          }}
        >
          <AtSearchBar
            className="filter-search"
            value={props.searchContent}
            onChange={(value) => {
              props.onSearchContentChange(value);
            }}
            onActionClick={() => {
              props.onSearch();
            }}
          />
        </View>
      </View>
      <View
        className={props.className}
        style={{
          height: `calc(100% - ${buttonRect.bottom + 7}px)`,
          paddingTop: `${buttonRect.bottom + 7}px`,
        }}
      >
        {props.children}
      </View>
    </View>
  );
}

對應的樣式檔案再設定,使用 padding 把白線擠到白色背景上

.filter-search {
  background-color: rgba(0, 0, 0, 0);
  width: 100%;
  border: rgba(0, 0, 0, 0);
  padding: 16px;
}

即可正常顯示

後端

  • 持久層的 addTag()報錯

不可以新增重複標籤,只是測試用例的問題,算是捕獲到的異常吧,直接操作持久層會出異常,但控制層是有做判斷的,所以使用管理系統新增重複標籤是會被忽略的

  • 有效標籤統計出錯

標籤只要一經刪除,就會報錯

後來發現是忘記重新統計了,補上就行

接下來的計劃還剩下哪些任務?

前端

後端

  • 推薦演算法的優化

  • 做食堂擁擠程度的視覺化介面實現

  • 做安全相關的事項

遇到了哪些困難?

目前最大的困難可能還是在後端,推薦的演算法不好,IO 也處理的不是很好(熱門可以提前計算,但是推薦需要根據使用者狀態實時計算),加之頻寬也並不是很給力,就存在一些速度問題,導致使用者體驗不佳

團隊有哪些收穫和疑問

收穫:完善了整個小程式

疑問:無

成果展示

展示組內最新成果

修改了介面出現白線的 bug 和新增排行榜

展示本週自動化測試的結果

我們在後端成員編寫了測試程式碼檢測出來一些簡單的邏輯錯誤現已解決

展示自動化持續整合(加分項,對應自動化測試)