1、插入操作 1.1、方法定义 /** * 插⼊⼀条记录 * * @param entity 实体对象. */ int insert(T entity); 1.2、测试用例 /* 测试添加 */ @Test public void testInser...
教程
SpringBoot释放静态资源
1、设置资源映射路径,spring默认设置为/** spring.mvc.static-path-pattern=/content/** 设置这个值以后我们如果想要访问静态资源时,必须要在访问路径的前面加上我们设置的映射资源路径。 2、设置资源...
sql in关键字使用长度超过1000问题处理
sql in关键字使用长度超过1000问题处理 in方法,选定特定自己需要查询的某些值。在这个两面有两个坑,一是目标字符中不能包含特定字符,如[']。二是,当超过1000个字符后,不能直接使用in(‘a’,‘b’,‘c’)等。下...
Gin 设置不同启动模式、优雅启动和关闭、运行多个不同端口的服务进程
1. 设置不同的启动模式 SetMode()这个函数来设置运行的模式,有三种模式可以设置,分别为 gin.ReleaseMode gin.TestMode gin.DebugMode 正式发布时应该设置为发布模式。 func NoResponse(c *gin.Cont...
thinkphp5.x 使用paginate 分页后 foreach 循环体内不能处理数据的解决办法
方法一、使用toArray()将查询出来的分页数据转成数组 $data = $goods_list->toArray(); 方法二、 $data = $goods_list->all(); 替换处理 //model里面的分页函数 public function pageQuery(){ ...
Golang 判断当前运行系统类型,是 Linux 还是 Windows?
需要一个额外的包:runtime runtime.GOARCH 返回当前的系统架构;runtime.GOOS 返回当前的操作系统。 示例: package main import ( "fmt" "runtime" ) func main() { //runtime.GOARCH ...
小程序环境判断及版本号获取
环境判断 小程序提供了一个全局的变量 __wxConfig, 其属性 envVersion 值为 develop | trial | release 分别表示开发版,体验版和正式环境 const env = __wxConfig.envVersion; // develop | trial | release...
PhpSpreadsheet 基本使用和导入 导出 模版生成Excel文件
一. 基本使用 use PhpOffice\PhpSpreadsheet\Spreadsheet; use PhpOffice\PhpSpreadsheet\Worksheet\Drawing; use PhpOffice\PhpSpreadsheet\Style\Alignment; use PhpOffice\PhpSpreadsheet\Style\Fi...
go-gin框架添加对HTTPS的支持
go-gin框架添加对HTTPS的支持 package main import ( "github.com/gin-gonic/gin" "github.com/unrolled/secure" ) func main() { router := gin.Default() router.Use(TlsHandler...
Go-Micro基本方式调用http api
1、最基本的方式,通过服务发现进行调用http api package main import ( "fmt" "github.com/micro/go-micro/client/selector" "github.com/micro/go-micro/registry" "github.com/micro/...