Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
dc_golang_server_1
Project
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
zhangjie
dc_golang_server_1
Commits
ef29a55d
Commit
ef29a55d
authored
Oct 19, 2021
by
zhengqiuyun86
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
初始化基础信息和后台管理的结构
parent
2b599a43
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
6 deletions
+4
-6
warn.log
log/warn.log
+0
-2
UWeCustomer.go
wechat/model/UWeCustomer.go
+1
-0
wechatAPI.go
wechat/web/wechatAPI.go
+3
-4
No files found.
log/warn.log
deleted
100644 → 0
View file @
2b599a43
{"level":"WARN","ts":"2021-10-07 16:08:55.565","msg":"","HostName":"DESKTOP-2789F62","Status":404,"SpendNanoS":0,"Ip":"127.0.0.1","Method":"GET","Path":"/swagger/","DataSize":18,"Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.36"}
{"level":"WARN","ts":"2021-10-07 16:09:16.983","msg":"","HostName":"DESKTOP-2789F62","Status":404,"SpendNanoS":0,"Ip":"127.0.0.1","Method":"GET","Path":"/favicon.ico","DataSize":0,"Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.36"}
wechat/model/UWeCustomer.go
View file @
ef29a55d
...
@@ -14,4 +14,5 @@ type UWeCustomer struct {
...
@@ -14,4 +14,5 @@ type UWeCustomer struct {
CreateAt
time
.
Time
`json:"createAt"`
CreateAt
time
.
Time
`json:"createAt"`
LoginAt
time
.
Time
`json:"loginAt"`
LoginAt
time
.
Time
`json:"loginAt"`
TestRole
bool
`json:"testRole"`
//是否是有测试权限
TestRole
bool
`json:"testRole"`
//是否是有测试权限
updaterId
uint32
}
}
wechat/web/wechatAPI.go
View file @
ef29a55d
...
@@ -2,7 +2,7 @@ package web
...
@@ -2,7 +2,7 @@ package web
import
(
import
(
"dc_golang_server_1/wechat/model"
"dc_golang_server_1/wechat/model"
"dc_golang_server_1/wechat/service"
wechatService
"dc_golang_server_1/wechat/service"
"dc_golang_server_1/wechat/web/response"
"dc_golang_server_1/wechat/web/response"
responseState
"dc_golang_server_1/wechat/web/response/state"
responseState
"dc_golang_server_1/wechat/web/response/state"
"github.com/gin-gonic/gin"
"github.com/gin-gonic/gin"
...
@@ -25,7 +25,7 @@ type TestResponse struct {
...
@@ -25,7 +25,7 @@ type TestResponse struct {
func
test
(
c
*
gin
.
Context
)
{
func
test
(
c
*
gin
.
Context
)
{
unionid
:=
c
.
Query
(
"unionid"
)
unionid
:=
c
.
Query
(
"unionid"
)
var
customer
model
.
UWeCustomer
var
customer
model
.
UWeCustomer
customer
=
s
ervice
.
FindUWeCustomerByUnionid
(
unionid
)
customer
=
wechatS
ervice
.
FindUWeCustomerByUnionid
(
unionid
)
if
customer
.
Id
==
0
{
if
customer
.
Id
==
0
{
c
.
JSON
(
http
.
StatusOK
,
response
.
ServerErrorResponse
{
Code
:
responseState
.
StateBusinessError
,
Msg
:
"用户不存在"
})
c
.
JSON
(
http
.
StatusOK
,
response
.
ServerErrorResponse
{
Code
:
responseState
.
StateBusinessError
,
Msg
:
"用户不存在"
})
}
else
{
}
else
{
...
@@ -42,11 +42,10 @@ func test(c *gin.Context) {
...
@@ -42,11 +42,10 @@ func test(c *gin.Context) {
// @Router /v1/login/{code} [POST]
// @Router /v1/login/{code} [POST]
func
weLogin
(
c
*
gin
.
Context
)
{
func
weLogin
(
c
*
gin
.
Context
)
{
code
:=
c
.
Param
(
"code"
)
code
:=
c
.
Param
(
"code"
)
responseData
,
err
:=
s
ervice
.
LoginFromWechatApplet
(
code
)
responseData
,
err
:=
wechatS
ervice
.
LoginFromWechatApplet
(
code
)
if
err
!=
(
response
.
ServerErrorResponse
{})
{
if
err
!=
(
response
.
ServerErrorResponse
{})
{
c
.
JSON
(
http
.
StatusOK
,
err
)
c
.
JSON
(
http
.
StatusOK
,
err
)
}
else
{
}
else
{
c
.
JSON
(
http
.
StatusOK
,
responseData
)
c
.
JSON
(
http
.
StatusOK
,
responseData
)
}
}
}
}
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