Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
im-microservice
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Li Feifei
im-microservice
Commits
c6573c1c
Commit
c6573c1c
authored
Jun 30, 2020
by
李洪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加time
parent
704a084f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
0 deletions
+18
-0
helper.go
helper/helper.go
+18
-0
No files found.
helper/helper.go
View file @
c6573c1c
package
helper
package
helper
import
(
import
(
"context"
"errors"
"errors"
"im-microservice/db"
"log"
"log"
"time"
"gopkg.in/go-playground/validator.v9"
"gopkg.in/go-playground/validator.v9"
)
)
...
@@ -19,3 +22,18 @@ func Valiator(in interface{}) error {
...
@@ -19,3 +22,18 @@ func Valiator(in interface{}) error {
}
}
return
nil
return
nil
}
}
func
GetNowTime
()
string
{
return
time
.
Now
()
.
Format
(
"2006-01-02 15:04:05"
)
}
var
ctx
=
context
.
Background
()
func
GetCode
(
mobile
string
)
(
string
,
error
)
{
val
,
err
:=
db
.
RedisClient
.
Get
(
ctx
,
mobile
)
.
Result
()
if
err
!=
nil
{
return
""
,
err
}
return
val
,
nil
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment