Documentation ¶
There is no documentation for this package.
Directories ¶
Path | Synopsis |
---|---|
Package apis save the web api code init.go define init() function and default system api handlers save you handle functions routes.go register handle function on url WAY TO ADD YOUR NEW API: create code file or package according to you business logic, let structure be modularized write the gin handlerFunc code like the Ping() in the file you should extract the common business logic handle functions into services package database model should be defined in models package by modularized general tool functions should be defined in utils package by modularized you can record log by utils.Logger and get config by viper you can return unified json struct by utils/response package the new return code should be defined in services/retcode package when you finish the handlerFunc you need to register it on a url in routes.go that's all.
|
Package apis save the web api code init.go define init() function and default system api handlers save you handle functions routes.go register handle function on url WAY TO ADD YOUR NEW API: create code file or package according to you business logic, let structure be modularized write the gin handlerFunc code like the Ping() in the file you should extract the common business logic handle functions into services package database model should be defined in models package by modularized general tool functions should be defined in utils package by modularized you can record log by utils.Logger and get config by viper you can return unified json struct by utils/response package the new return code should be defined in services/retcode package when you finish the handlerFunc you need to register it on a url in routes.go that's all. |
Package middleware save your custom middlewares at here
|
Package middleware save your custom middlewares at here |
Package models save database models define your database models in the package
|
Package models save database models define your database models in the package |
Package router provide a function to setup gin router without routes
|
Package router provide a function to setup gin router without routes |
Package services save common business logic code
|
Package services save common business logic code |
retcode
Package retcode define all api return code at here
|
Package retcode define all api return code at here |
Package utils save the package of third party package tools and the general tool code written by yourself write your general tool in the package
|
Package utils save the package of third party package tools and the general tool code written by yourself write your general tool in the package |
Click to show internal directories.
Click to hide internal directories.