Category : mysql

SELECT hi.houseCode,SUBSTRING_INDEX(hi.houseCode,’-‘,1) AS lou,SUBSTRING_INDEX(SUBSTRING_INDEX(hi.houseCode,’-‘,2),’-‘,-1) AS men,SUBSTRING_INDEX(hi.houseCode,’-‘,-1) AS fang FROM ho..

Read more

Gin builds Blog API’s (1) Project address:https://github.com/EDDYCJY/go … Thinking First of all, before an initial project starts, everyone should think about it All kinds of program configurations are written in code, okay Is it appropriate that the API error code is hard-coded into the program Db handle to everyoneOpen, ok Get public parameters such as ..

Read more

API’s, Models for Tag Project address:https://github.com/EDDYCJY/go … This major section will cover the following knowledge points: gin: Golang’s micro-frame with excellent performance beego-validation: beego’s form validation library used in this section,Chinese document gorm, a developer-friendly ORM framework,English document com, toolkit Writing Business Logic We began to write business code, blog articles will haveLabelThe concept of, ..

Read more

API’s, Models for writing Article Project address:https://github.com/EDDYCJY/go … Define interface The logic of writing this section, let’s define the interface! Get list of articles: GET(“/articles “) Get the specified article: POST(“/articles/:id “) New article: POST(“/articles “) Update the specified article: PUT(“/articles/:id “) Delete the specified article: DELETE(“/articles/:id “) Write routing logic InroutersThe v1 version of, ..

Read more

Write a simple file log Original address:The Portal of Fans of Fried Fish In the previous section, we solved the problem that API’s can be accessed at will, so we have another problem now. Even our logs are output to the console, which is obviously unreasonable for a project, so this section is simply packagedlogLibrary, ..

Read more

Deploying Golang Applications to Docker Project address:https://github.com/EDDYCJY/go …(Get on the bus and support the wave)Original address:https://segmentfault.com/a/11 … Note: You need to install it before you start.docker, with a good mirror source This chapter source code inf-20180324-dockerOn the branch Starting from this chapter, the project catalog is based ongo-gin-exampleAs a benchmark (please be flexible with your ..

Read more

Custom GORM Callbacks GORM itself is powered by Callbacks, so you could fully customize GORM as you want Project address:https://github.com/EDDYCJY/go … GORM itself is callback driven, so we can completely customize GORM as needed to achieve our goal. Register a new callback Delete existing callbacks Replace an existing callback The order in which callbacks are ..

Read more

Golang Gin Practice Serialization 15 to Generate Two-dimensional Codes and Merge Posters Original address:Golang Gin Practice Serialization 15 to Generate Two-dimensional Codes and Merge PostersProject address:https://github.com/EDDYCJY/go … If it is helpful to you, welcome to Star. Preface In this chapter, the following functional details will be implemented: 1, generating a two-dimensional code 2. Merge Posters ..

Read more

Golang Gin Practice Serialization 16 Draw Text on Pictures Original address:Golang Gin Practice Serialization 16 Draw Text on PicturesProject address:go-gin-example Preface This chapter isSerial 15It is recommended to eat together. Main realizationDraw text on the merged posterThe function of the (this requirement is also very common), the content is relatively simple Realization What is used ..

Read more