本网站可以通过分类标签帮助你快速筛选出你想看的文章,记住地址:www.Facec.cc

Golang结构体详解 结构体序列化 结构体转json

Golang结构体详解 结构体序列化 结构体转json

go mod包管理

1.go mod init 项目名 初始化项目2.安装这个包方法1: go get (全局)go get github.com/shopspring/decimal方法2: go mod download(全局)依赖包会自动下载到$GOPATH/pkg/mod,多个项目可以共享的mod,注意使用go

Golang包及其日期函数

获取当前时间import("fmt""time")timeObj := time.Now()fmt.Println() //2022-04-24 17:32:25.9639049 +0800 CST m+0.004000301//年月日时分秒Y := time

Golang函数详解

//函数的可变参数,参数数量不固定func sumfn(x ...int) int{//此时的x是一个[]int类型sum := 0for _,v := range x{sum +=x}return sum}

Django 关系映射(一对一、一对多、多对多)

一对多关系类型

bootstrap5 常用类大全

.ms-auto元素居右.me-auto元素居左.p-5: padding.d-flex: flex布局.w-50: 宽度50%d-none:display:noned-md-block:当为md时,为blockbg-primary:背景颜色为primarytext-light:文本亮色d-md-f

Golang的默认初始值

bool-> falsenumbers-> 0string-> ""pointers-> nil

Serializer 嵌套

class TeacherSerializer(ModelSerializer): """讲师序列化器""" class Meta: model = Teacher fields = [

django DateTimeField和DateField

#DateTimeField日期+时间。与python里的 datetime.datetime 实例同。有以下两个可选的选项,均为bool类型:参数1:auto_now,默认值为false,设置为true时,每次执行 save 操作时,将其值设置为当前时间,并且每次修改model,都会自动更新。使用

Django全局url.py配置模板

from django.contrib import adminfrom django.urls import path, include, re_pathfrom django.views import staticfrom django.conf import settings# from .d