Giter Site home page Giter Site logo

blog_summary_of_khaos's Introduction

blog_summary_of_khaos

the summary of writing khaos ( a website)

khaos:

khaos 是实训课的一个课设作品,是一个带商城购物的论坛系统的后端管理系统(包含前后端)
前端: tauri ( vite + react + typescript )
后端: go ( gin )


前端

  1. react 第三方组件库
  2. echarts-for-react 不要用 yarn 下,有错(麻了别用这玩意一堆错),用 react-chartjs-2,这个好用。
  3. typescript 在添加比较老的 javascript 包时可能会报缺失 type 的错,一般可通过 yarn add @type/xxx 解决
  4. 字符串拼接可通过 `${stringA}${stringB}` 来解决
  5. antd 表格的 fliter,需要使 fliter 的字段唯一。
  6. antd 表格的 fliter 中的字段数据是 ColumnFilterItem[] 格式,就是一个树的数据结构(woc头一回见用这种复杂结构的东西)

后端

  1. 使用 vscode 开发 golang 时要打开文件目录,不然依赖报错
  2. mysql 查到空数据时返回空而不时报错(话说我为什么会觉得它要报错)
  3. 关于database/GetUsersList
    最初直接返回返回了53个结构体数组,后来考虑返回指针但怕垂悬引用,最后在调用的时候传入指针用于返回
    由于返回的是一整个数组,所以定义了 len 来截取长度,截取方式是 切片 ,由于取得是地址不浪费性能
  4. mysql中的表名不要叫 order,关键字重复 (我说sql怎么突然这么毒)
  5. 数据库连接池可以指定由一个 init 函数实现,每个连接创建一个连接池会导致报错(连接过多)
  6. golang 的单元测试项目启动地址不是项目根目录,读取配置文件的时候导致错误
  7. gin 使用中间件跨域很方便,详见项目的 middlewares 目录下文件。

blog_summary_of_khaos's People

Contributors

pphui8 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.