代码规范化

This commit is contained in:
18650180552 2019-03-12 14:01:25 +08:00
parent f12f001664
commit 0a2783b4a2
5 changed files with 38 additions and 70 deletions

View File

@ -5,35 +5,5 @@
后端采用go+gin+ redis 后端采用go+gin+ redis
前端采用vue+iview框架 前端采用vue+iview框架
#### 软件架构
软件架构说明
#### 安装教程 #### 安装教程
1. xxxx
2. xxxx
3. xxxx
#### 使用说明
1. xxxx
2. xxxx
3. xxxx
#### 参与贡献
1. Fork 本仓库
2. 新建 Feat_xxx 分支
3. 提交代码
4. 新建 Pull Request
#### 码云特技
1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md
2. 码云官方博客 [blog.gitee.com](https://blog.gitee.com)
3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解码云上的优秀开源项目
4. [GVP](https://gitee.com/gvp) 全称是码云最有价值开源项目,是码云综合评定出的优秀开源项目
5. 码云官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help)
6. 码云封面人物是一档用来展示码云会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)

View File

@ -9,7 +9,6 @@ import (
) )
type FileController struct { type FileController struct {
} }
func (this *FileController) OnUpload(c *gin.Context) { func (this *FileController) OnUpload(c *gin.Context) {

View File

@ -17,8 +17,8 @@ import (
"user/config" "user/config"
"user/db" "user/db"
) )
type MailController struct {
type MailController struct {
} }
type RespJson struct { type RespJson struct {
Msg string `json:"msg"` Msg string `json:"msg"`
@ -236,7 +236,7 @@ func OnSendEmailTpl(c *gin.Context) {
//content :网页模板的参数 key-value结构 //content :网页模板的参数 key-value结构
//temp_data 模板内具体要替换的变量名字 Key-value结构 //temp_data 模板内具体要替换的变量名字 Key-value结构
//generate 是否生成静态html //generate 是否生成静态html
func (this *MailController)OnSendEmailCode(c *gin.Context) { func (this *MailController) OnSendEmailCode(c *gin.Context) {
var req ReqSendEmail var req ReqSendEmail
var resp RespJson var resp RespJson
defer func() { defer func() {

View File

@ -1,32 +1,32 @@
package controller package controller
import ( import (
"bytes" "bytes"
"crypto/md5" "crypto/md5"
"encoding/json" "encoding/json"
"errors" "errors"
"fmt" "fmt"
"github.com/fatih/structs" "github.com/fatih/structs"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
_ "github.com/go-sql-driver/mysql" _ "github.com/go-sql-driver/mysql"
"github.com/tommy351/gin-sessions" "github.com/tommy351/gin-sessions"
"io" "io"
"log" "log"
"math/rand" "math/rand"
"net/http" "net/http"
"net/smtp" "net/smtp"
"regexp" "regexp"
"strconv" "strconv"
"strings" "strings"
"time" "time"
"user/config" "user/config"
"user/db" "user/db"
"user/logs" "user/logs"
"user/model" "user/model"
"user/redis" "user/redis"
) )
type UserController struct{
type UserController struct {
} }
type ReqSendEmailCode struct { type ReqSendEmailCode struct {
@ -45,7 +45,7 @@ type RespBase struct {
Data interface{} Data interface{}
} }
func (this *UserController)Auth(c *gin.Context) { func (this *UserController) Auth(c *gin.Context) {
var resp RespBase var resp RespBase
var statuscode int var statuscode int
@ -510,7 +510,7 @@ func (this *UserController) SendEmailCode(c *gin.Context) {
//判断邮箱是否存在 //判断邮箱是否存在
var users []model.Users var users []model.Users
e = db.GetMysqlClient().Query2("select * from users where email_adress = ?", &users, req.EmailAdress) e = db.GetMysqlClient().Query2("select * from users where email_adress = ?", &users, req.EmailAdress)
if nil != e{ if nil != e {
log.Print(e.Error()) log.Print(e.Error())
resp.Msg = "email address error" resp.Msg = "email address error"
return return

View File

@ -57,7 +57,6 @@ func CORSMiddleware(c *gin.Context) {
} }
} }
func main() { func main() {
InitConfig() InitConfig()
InitLogs() InitLogs()