• [go] golang exercise item – addition, deletion, query and modification of Gorm and MySQL


    The following code is placed in users.go under the models package The table structure is consistent with the struct field. Change the underline of the table field into a hump named with capital letters Create, find, delete and update users. See the following specific methods   package models import ( _ “github.com/jinzhu/gorm/dialects/mysql” ) type User […]

  • The. Net core handles webapi JSON and returns annoying null and empty


    preface In project development, annoying nulls will be encountered in both the foreground and background. If the fields in the database table allow null values, the corresponding field type in the code entity class is nullable < >, such as int?, DateTime?, The values returned from the serialization of null value fields are null. The […]

  • Integrating mybatis in springboot


    New project For the time being, just check the webjar package Import. SQL database Prepare database tools~~~~ Connect to database Add jar package file <?xml version=”1.0″ encoding=”UTF-8″?> <project xmlns=”http://maven.apache.org/POM/4.0.0″ xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xsi:schemaLocation=”http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd”> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.3.4.RELEASE</version> <relativePath/> <!– lookup parent from repository –> </parent> <groupId>com.jt</groupId> <artifactId>springboot_demo2_mybatis</artifactId> <version>0.0.1-SNAPSHOT</version> <name>springboot_demo2_mybatis</name> <description>Demo project for Spring Boot</description> <properties> […]

  • Common bean copy frameworks underline hump to hump extension support


    Last blog postUsage posture and performance comparison of common bean copy frameworksThis paper introduces the usage posture and performance comparison of several bean copy frameworks, which are mainly applicable to the copy with the same attribute name and type. In the actual business development, the conversion of hump and underline is often used. This paper […]

  • Web store writes Vue and react to convert the naming of large hump components into short bar naming


    hello everyone! I am papaya too fragrant, proficient in webstorm and common front-end technology engineers, occasionally in B station to do some webstorm skills teaching, today brings to you is the big hump small hump fast conversion short bar name or underline the way of naming. During development, we may encounter such a demand. When […]

  • Spring boot: mybatis returns null when querying underlined fields


    Problem description MyBatisUnable to query data with different property name and database field name. That is: the attribute name and database field name areHump namingandUnderline namingThe data found out in the survey areNULL。 problem analysis MyBatisThe default is one-to-one correspondence between the attribute name and the database field name   Database table column: user_ name […]

  • PHP writing specification (for reference only)


    General principles Semanticalization:What you see is what you get Prefix:isIt means whether (is + Adjective + noun),getIt means reading,setExpress write Singular and plural:Like a usergetUser, multiple usersgetUsers Avoid redundancy:Try not to use itdata、list、infosuffix Use common name with caution:Use with cautioncommon、util、functions、class、object、basicIt’s difficult to maintain the common name, such as string, etc.; to get an accurate name […]

  • Swift personal learning notes – 08: classes and structures


    This article is purely a Chinese version《The Swift Programming Language》So most of the content is in the article. This article is my study notes, not a formal and systematic record. For reference only There are still a lot of incomprehensible and uncertain points below, which I will point out with “doubtful” notes. Thanks to the […]

  • Vscode configure spell checking


    Install the plug-in code spell checker first Modify the extensions settings for this plug-in, settings.json It is amended as follows: { “workbench.editor.enablePreview”: false, “cSpell.enableFiletypes”: [ “javascript”, “css”, “vue” ] } Modify the extensions settings of this plug-in. In UI mode, remove the check box of “C spell: allow compound words”. That is, continuous words are […]

  • In the initial environment of cocos2d-x + Lua_ G global variable content


    At present, I’m not familiar with it, so I’d like to make a note. In addition to Lua’s IO, math, table and other modules, we can see that cocos2d-x inserts a lot of things into Lua environment. Most of the constant definitions are deleted and only the hump style variable names are kept. This is […]

  • Vue learning notes — Vue component


    Global component registration syntax 1. Global component registration syntax Vue.component(”,{ data: function(){ //Data used by the component …. }, Template: ‘…’ // template data defined by the component }) 2. Examples of global components <body> <div id=”app”> Use of Vue components <! — the first instance of a 2.1 component — > <button-handler></button-handler> <! — […]

  • Common variable naming standard of Beifu TwinCAT programming


    Suggestions on naming rules of common variables Beifu virtual college( https://tr.beckhoff.com.cn/ ) 1. Constant 1 constants are represented in uppercase letters, with the underline “_” Enhance readability. 1 VAR CONSTANT 2 MAX_HEIGHT: REAL := 1234; (* [Pa]*) 3 END_VAR 2. Definition of project content Take a structure as an example. When defining a structure, the […]